Browse Source

遊客登錄

null_safety
fmk 4 years ago
parent
commit
72a91a0503
  1. BIN
      assets/image/2x/icon_login_tips.png
  2. BIN
      assets/image/3x/icon_login_tips.png
  3. BIN
      assets/image/icon_login_tips.png
  4. 69
      ios/Runner.xcodeproj/project.pbxproj
  5. 2
      ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
  6. 6
      ios/Runner/AppDelegate.m
  7. 30
      ios/Runner/Info.plist
  8. 4
      ios/Runner/Runner.entitlements
  9. BIN
      ios/UniMPSDK/Libs/libWeChatSDK.a
  10. BIN
      ios/UniMPSDK/Libs/liblibPayment.a
  11. BIN
      ios/UniMPSDK/Libs/libwxpay.a
  12. 205
      ios/wx/Headers/WXApi.h
  13. 1247
      ios/wx/Headers/WXApiObject.h
  14. 68
      ios/wx/Headers/WechatAuthSDK.h
  15. BIN
      ios/wx/Libs/libWeChatSDK.a
  16. 5
      lib/generated/intl/messages_en.dart
  17. 5
      lib/generated/intl/messages_zh_CN.dart
  18. 5
      lib/generated/intl/messages_zh_TW.dart
  19. 50
      lib/generated/l10n.dart
  20. 14
      lib/home/activity_list_page.dart
  21. 248
      lib/home/founder_story_page.dart
  22. 66
      lib/home/home_page.dart
  23. 74
      lib/home/huixiang_brand_page.dart
  24. 4
      lib/home/main_home_page.dart
  25. 5
      lib/l10n/intl_en.arb
  26. 5
      lib/l10n/intl_zh_CN.arb
  27. 6
      lib/l10n/intl_zh_TW.arb
  28. 90
      lib/login/login_page.dart
  29. 6
      lib/main.dart
  30. 5
      lib/main_page.dart
  31. 121
      lib/mine/mine_page.dart
  32. 2
      lib/mine/mine_wallet_page.dart
  33. 66
      lib/retrofit/retrofit_api.dart
  34. 765
      lib/retrofit/retrofit_api.g.dart
  35. 10
      lib/union/union_details_page.dart
  36. 31
      lib/union/union_page.dart
  37. 128
      lib/view_widget/login_tips.dart
  38. 6
      lib/view_widget/store_title_tab.dart
  39. 289
      pubspec.lock
  40. 3
      pubspec.yaml

BIN
assets/image/2x/icon_login_tips.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

BIN
assets/image/3x/icon_login_tips.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

BIN
assets/image/icon_login_tips.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

69
ios/Runner.xcodeproj/project.pbxproj

@ -45,6 +45,15 @@
6EE8F3782695820600237A5E /* libiconv.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 6EE8F3772695820600237A5E /* libiconv.tbd */; };
6EE8F37F269582C200237A5E /* UniappPlugin.m in Sources */ = {isa = PBXBuildFile; fileRef = 6EE8F37E269582C200237A5E /* UniappPlugin.m */; };
899C4C3C26A5179900B44087 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 899C4C3E26A5179900B44087 /* InfoPlist.strings */; };
89A6269F26A7F6D30004A8F0 /* liblibPayment.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 89A6269E26A7F6D30004A8F0 /* liblibPayment.a */; };
89A626A126A7F6E30004A8F0 /* libwxpay.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 89A626A026A7F6E30004A8F0 /* libwxpay.a */; };
89A626A526A7F71A0004A8F0 /* libsqlite3.0.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 89A626A426A7F71A0004A8F0 /* libsqlite3.0.tbd */; };
89A626A726A7FF910004A8F0 /* libWeChatSDK.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 89A626A626A7FF910004A8F0 /* libWeChatSDK.a */; };
89A626AC26A8002F0004A8F0 /* libWeChatSDK.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 89A626AB26A8002F0004A8F0 /* libWeChatSDK.a */; };
89A626B026A80E520004A8F0 /* AMapFoundationKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 89AEFA4226A6800800DD2817 /* AMapFoundationKit.framework */; };
89A626B126A80E520004A8F0 /* AMapLocationKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 89AEFA8C26A699A000DD2817 /* AMapLocationKit.framework */; };
89A626B226A80E520004A8F0 /* libAMapLocationPlugin.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 89AEFA8826A6996300DD2817 /* libAMapLocationPlugin.a */; };
89A626B326A80E520004A8F0 /* liblibGeolocation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 89AEFA8A26A6997E00DD2817 /* liblibGeolocation.a */; };
89AEFA3926A67F8400DD2817 /* libDCUniAmap.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 89AEFA3826A67F8400DD2817 /* libDCUniAmap.a */; };
89AEFA3B26A67F9C00DD2817 /* libDCUniMap.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 89AEFA3A26A67F9C00DD2817 /* libDCUniMap.a */; };
89AEFA3D26A67FB100DD2817 /* DCUniVideoPublic.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 89AEFA3C26A67FB100DD2817 /* DCUniVideoPublic.framework */; };
@ -205,6 +214,14 @@
899C4C3D26A5179900B44087 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
899C4C3F26A5179F00B44087 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/InfoPlist.strings"; sourceTree = "<group>"; };
899C4C4026A517A000B44087 /* zh-Hant */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hant"; path = "zh-Hant.lproj/InfoPlist.strings"; sourceTree = "<group>"; };
89A6269E26A7F6D30004A8F0 /* liblibPayment.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = liblibPayment.a; sourceTree = "<group>"; };
89A626A026A7F6E30004A8F0 /* libwxpay.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libwxpay.a; sourceTree = "<group>"; };
89A626A426A7F71A0004A8F0 /* libsqlite3.0.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libsqlite3.0.tbd; path = usr/lib/libsqlite3.0.tbd; sourceTree = SDKROOT; };
89A626A626A7FF910004A8F0 /* libWeChatSDK.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libWeChatSDK.a; sourceTree = "<group>"; };
89A626AB26A8002F0004A8F0 /* libWeChatSDK.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libWeChatSDK.a; sourceTree = "<group>"; };
89A626AD26A800390004A8F0 /* WechatAuthSDK.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WechatAuthSDK.h; sourceTree = "<group>"; };
89A626AE26A800390004A8F0 /* WXApiObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXApiObject.h; sourceTree = "<group>"; };
89A626AF26A800390004A8F0 /* WXApi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXApi.h; sourceTree = "<group>"; };
89AEFA3826A67F8400DD2817 /* libDCUniAmap.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libDCUniAmap.a; sourceTree = "<group>"; };
89AEFA3A26A67F9C00DD2817 /* libDCUniMap.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libDCUniMap.a; sourceTree = "<group>"; };
89AEFA3C26A67FB100DD2817 /* DCUniVideoPublic.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = DCUniVideoPublic.framework; sourceTree = "<group>"; };
@ -238,12 +255,18 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
89A626B026A80E520004A8F0 /* AMapFoundationKit.framework in Frameworks */,
89A626B126A80E520004A8F0 /* AMapLocationKit.framework in Frameworks */,
89A626B226A80E520004A8F0 /* libAMapLocationPlugin.a in Frameworks */,
89A626B326A80E520004A8F0 /* liblibGeolocation.a in Frameworks */,
89AEFA9526A69A4800DD2817 /* SystemConfiguration.framework in Frameworks */,
6EE8F370269581EC00237A5E /* CoreTelephony.framework in Frameworks */,
89AEFA8F26A699DE00DD2817 /* libz.tbd in Frameworks */,
89A626A526A7F71A0004A8F0 /* libsqlite3.0.tbd in Frameworks */,
89A6269F26A7F6D30004A8F0 /* liblibPayment.a in Frameworks */,
89AEFA9326A69A3600DD2817 /* Security.framework in Frameworks */,
6EE8F362269581AF00237A5E /* GLKit.framework in Frameworks */,
89AEFA9126A69A2200DD2817 /* ExternalAccessory.framework in Frameworks */,
89AEFA8F26A699DE00DD2817 /* libz.tbd in Frameworks */,
6EE8F36C269581D500237A5E /* libc++.tbd in Frameworks */,
89AEFA4526A6802000DD2817 /* MapKit.framework in Frameworks */,
89AEFA3D26A67FB100DD2817 /* DCUniVideoPublic.framework in Frameworks */,
@ -264,6 +287,7 @@
6EE8F35C2695819500237A5E /* CoreMedia.framework in Frameworks */,
6EE8F3582695818800237A5E /* JavaScriptCore.framework in Frameworks */,
6EE8F3542695816000237A5E /* liblibNavigator.a in Frameworks */,
89A626A126A7F6E30004A8F0 /* libwxpay.a in Frameworks */,
6EE8F3502695816000237A5E /* liblibUI.a in Frameworks */,
89AEFA3F26A67FBD00DD2817 /* AMapSearchKit.framework in Frameworks */,
C9444B3318AB7FB815E97950 /* libPods-Runner.a in Frameworks */,
@ -272,6 +296,8 @@
6EE8F34D2695816000237A5E /* liblibWeex.a in Frameworks */,
6EE8F3552695816000237A5E /* storage.framework in Frameworks */,
6EE8F3512695816000237A5E /* libcoreSupport.a in Frameworks */,
89A626A726A7FF910004A8F0 /* libWeChatSDK.a in Frameworks */,
89A626AC26A8002F0004A8F0 /* libWeChatSDK.a in Frameworks */,
6EE8F3562695816000237A5E /* liblibNativeObj.a in Frameworks */,
6EE8F3532695816000237A5E /* liblibPGInvocation.a in Frameworks */,
6EE8F34B2695816000237A5E /* libSDWebImage.a in Frameworks */,
@ -286,6 +312,7 @@
4ACDDAD1B437E297D1948602 /* Frameworks */ = {
isa = PBXGroup;
children = (
89A626A426A7F71A0004A8F0 /* libsqlite3.0.tbd */,
89AEFA9626A69D8E00DD2817 /* Foundation.framework */,
89AEFA9426A69A4800DD2817 /* SystemConfiguration.framework */,
89AEFA9226A69A3600DD2817 /* Security.framework */,
@ -449,6 +476,9 @@
6EE8F3382695816000237A5E /* Libs */ = {
isa = PBXGroup;
children = (
89A626A626A7FF910004A8F0 /* libWeChatSDK.a */,
89A626A026A7F6E30004A8F0 /* libwxpay.a */,
89A6269E26A7F6D30004A8F0 /* liblibPayment.a */,
89AEFA8C26A699A000DD2817 /* AMapLocationKit.framework */,
89AEFA8A26A6997E00DD2817 /* liblibGeolocation.a */,
89AEFA8826A6996300DD2817 /* libAMapLocationPlugin.a */,
@ -474,6 +504,33 @@
path = Libs;
sourceTree = "<group>";
};
89A626A826A7FFF30004A8F0 /* wx */ = {
isa = PBXGroup;
children = (
89A626AA26A8000C0004A8F0 /* Headers */,
89A626A926A800010004A8F0 /* Libs */,
);
path = wx;
sourceTree = SOURCE_ROOT;
};
89A626A926A800010004A8F0 /* Libs */ = {
isa = PBXGroup;
children = (
89A626AB26A8002F0004A8F0 /* libWeChatSDK.a */,
);
path = Libs;
sourceTree = "<group>";
};
89A626AA26A8000C0004A8F0 /* Headers */ = {
isa = PBXGroup;
children = (
89A626AD26A800390004A8F0 /* WechatAuthSDK.h */,
89A626AF26A800390004A8F0 /* WXApi.h */,
89A626AE26A800390004A8F0 /* WXApiObject.h */,
);
path = Headers;
sourceTree = "<group>";
};
9740EEB11CF90186004384FC /* Flutter */ = {
isa = PBXGroup;
children = (
@ -508,6 +565,7 @@
97C146F01CF9000F007C117D /* Runner */ = {
isa = PBXGroup;
children = (
89A626A826A7FFF30004A8F0 /* wx */,
89847A4826A14482008C8077 /* Runner.entitlements */,
6EE8F2E42695813500237A5E /* UniMPSDK */,
6EE8F2E32695806400237A5E /* Class */,
@ -811,6 +869,8 @@
"\"${PODS_ROOT}/Headers/Public/video_player\"",
"\"${PODS_ROOT}/Headers/Public/wakelock\"",
"\"${PODS_ROOT}/Headers/Public/webview_flutter\"",
"$(PROJECT_DIR)/UniMPSDK/Headers",
"$(PROJECT_DIR)/wx/Headers",
);
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
@ -820,6 +880,7 @@
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/UniMPSDK/Libs",
"$(PROJECT_DIR)/wx/Libs",
);
MARKETING_VERSION = 1.0.16;
ONLY_ACTIVE_ARCH = NO;
@ -1011,6 +1072,8 @@
"\"${PODS_ROOT}/Headers/Public/video_player\"",
"\"${PODS_ROOT}/Headers/Public/wakelock\"",
"\"${PODS_ROOT}/Headers/Public/webview_flutter\"",
"$(PROJECT_DIR)/UniMPSDK/Headers",
"$(PROJECT_DIR)/wx/Headers",
);
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
@ -1020,6 +1083,7 @@
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/UniMPSDK/Libs",
"$(PROJECT_DIR)/wx/Libs",
);
MARKETING_VERSION = 1.0.16;
ONLY_ACTIVE_ARCH = YES;
@ -1104,6 +1168,8 @@
"\"${PODS_ROOT}/Headers/Public/video_player\"",
"\"${PODS_ROOT}/Headers/Public/wakelock\"",
"\"${PODS_ROOT}/Headers/Public/webview_flutter\"",
"$(PROJECT_DIR)/UniMPSDK/Headers",
"$(PROJECT_DIR)/wx/Headers",
);
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
@ -1113,6 +1179,7 @@
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/UniMPSDK/Libs",
"$(PROJECT_DIR)/wx/Libs",
);
MARKETING_VERSION = 1.0.16;
ONLY_ACTIVE_ARCH = NO;

2
ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme

@ -40,7 +40,7 @@
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Release"
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"

6
ios/Runner/AppDelegate.m

@ -73,4 +73,10 @@
return [super application:application didFinishLaunchingWithOptions:launchOptions];
}
- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray<id<UIUserActivityRestoring>> * _Nullable))restorationHandler {
// 通过通用链接唤起 App
[DCUniMPSDKEngine application:application continueUserActivity:userActivity];
return YES;
}
@end

30
ios/Runner/Info.plist

@ -2,10 +2,13 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>amap</key>
<string></string>
<key>appkey</key>
<string>feaae7986201b571cace1b83728be5bb</string>
<key>UniversalLinks</key>
<string>https://hx.lotus-wallet.com/app/</string>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>weixinULAPI</string>
<string>weixin</string>
</array>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
@ -30,9 +33,22 @@
<string>$(MARKETING_VERSION)</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLSchemes</key>
<array>
<string>wx3b269e795ed23e5f</string>
</array>
<key>CFBundleURLTypes</key>
<array>
<dict/>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLName</key>
<string>weixin</string>
<key>CFBundleURLSchemes</key>
<array>
<string>wx3b269e795ed23e5f</string>
</array>
</dict>
</array>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
@ -86,6 +102,10 @@
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>amap</key>
<string></string>
<key>appkey</key>
<string>feaae7986201b571cace1b83728be5bb</string>
<key>io.flutter.embedded_views_preview</key>
<string>YES</string>
</dict>

4
ios/Runner/Runner.entitlements

@ -4,5 +4,9 @@
<dict>
<key>aps-environment</key>
<string>development</string>
<key>com.apple.developer.associated-domains</key>
<array>
<string>applinks:demo.dcloud.net.cn</string>
</array>
</dict>
</plist>

BIN
ios/UniMPSDK/Libs/libWeChatSDK.a

Binary file not shown.

BIN
ios/UniMPSDK/Libs/liblibPayment.a

Binary file not shown.

BIN
ios/UniMPSDK/Libs/libwxpay.a

Binary file not shown.

205
ios/wx/Headers/WXApi.h

@ -0,0 +1,205 @@
//
// WXApi.h
// 所有Api接口
//
// Created by Wechat on 12-2-28.
// Copyright (c) 2012年 Tencent. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "WXApiObject.h"
NS_ASSUME_NONNULL_BEGIN
#pragma mark - WXApiDelegate
/*! @brief 接收并处理来自微信终端程序的事件消息
*
*
* WXApiDelegate handleOpenURL:delegate:使
*/
@protocol WXApiDelegate <NSObject>
@optional
/*! @brief 收到一个来自微信的请求,第三方应用程序处理完后调用sendResp向微信发送结果
*
* sendResp发送处理结果给微信
* GetMessageFromWXReqShowMessageFromWXReq等
* @param req
*/
- (void)onReq:(BaseReq*)req;
/*! @brief 发送一个sendReq后,收到微信的回应
*
* sendReq后会收到onResp
* SendMessageToWXRespSendAuthResp等
* @param resp具体的回应内容
*/
- (void)onResp:(BaseResp*)resp;
@end
#pragma mark - WXApiLogDelegate
@protocol WXApiLogDelegate <NSObject>
- (void)onLog:(NSString*)log logLevel:(WXLogLevel)level;
@end
#pragma mark - WXApi
/*! @brief 微信Api接口函数类
*
* SDK的所有接口
*/
@interface WXApi : NSObject
/*! @brief WXApi的成员函数,向微信终端程序注册第三方应用。
*
*
* @attention 线
* @param appid ID
* @param universalLink Universal Link
* @return YESNO
*/
+ (BOOL)registerApp:(NSString *)appid universalLink:(NSString *)universalLink;
/*! @brief 处理旧版微信通过URL启动App时传递的数据
*
* application:openURL:sourceApplication:annotation:application:handleOpenURL中调用
* @param url URL
* @param delegate WXApiDelegate对象
* @return YESNO
*/
+ (BOOL)handleOpenURL:(NSURL *)url delegate:(nullable id<WXApiDelegate>)delegate;
/*! @brief 处理微信通过Universal Link启动App时传递的数据
*
* application:continueUserActivity:restorationHandler:
* @param userActivity API传递过来的userActivity
* @param delegate WXApiDelegate对象
* @return YESNO
*/
+ (BOOL)handleOpenUniversalLink:(NSUserActivity *)userActivity delegate:(nullable id<WXApiDelegate>)delegate;
/*! @brief 检查微信是否已被用户安装
*
* @return YESNO
*/
+ (BOOL)isWXAppInstalled;
/*! @brief 判断当前微信的版本是否支持OpenApi
*
* @return YESNO
*/
+ (BOOL)isWXAppSupportApi;
/*! @brief 判断当前微信的版本是否支持分享微信状态功能
*
* @attention LSApplicationQueriesSchemes配置中添加weixinStateAPI
* @return YESNO
*/
+ (BOOL)isWXAppSupportStateAPI;
/*! @brief 获取微信的itunes安装地址
*
* @return
*/
+ (NSString *)getWXAppInstallUrl;
/*! @brief 获取当前微信SDK的版本号
*
* @return SDK的版本号
*/
+ (NSString *)getApiVersion;
/*! @brief 打开微信
*
* @return YESNO
*/
+ (BOOL)openWXApp;
/*! @brief 发送请求到微信,等待微信返回onResp
*
* onResponResp
* SendAuthReqSendMessageToWXReqPayReq等
* @param req
* @param completion block
*/
+ (void)sendReq:(BaseReq *)req completion:(void (^ __nullable)(BOOL success))completion;
/*! @brief 收到微信onReq的请求,发送对应的应答给微信,并切换到微信界面
*
* onReq的请求
* GetMessageFromWXRespShowMessageFromWXResp等
* @param resp
* @param completion block
*/
+ (void)sendResp:(BaseResp*)resp completion:(void (^ __nullable)(BOOL success))completion;
/*! @brief 发送Auth请求到微信,支持用户没安装微信,等待微信返回onResp
*
* onResponRespSendAuthReq类型
* @param req
* @param viewController
* @param delegate WXApiDelegate对象
* @param completion block
*/
+ (void)sendAuthReq:(SendAuthReq *)req viewController:(UIViewController*)viewController delegate:(nullable id<WXApiDelegate>)delegate completion:(void (^ __nullable)(BOOL success))completion;
/*! @brief 测试函数,用于排查当前App通过Universal Link方式分享到微信的流程
1: registerApp:universalLink接口,
2: Log产生startLogByLevel函数Log排查问题
3: block
4: SDK时调试使用
*
* completion回调的step为WXULCheckStepFinal时Universal Link接入成功
* @param completion Block
*/
+ (void)checkUniversalLinkReady:(nonnull WXCheckULCompletion)completion;
/*! @brief WXApi的成员函数,接受微信的log信息。byBlock
1:SDK会强引用这个block,,
2:startLog by block之后startLoad,logBlocklogBlock
*
* @param level log的级别
* @param logBlock log的回调block
*/
+ (void)startLogByLevel:(WXLogLevel)level logBlock:(WXLogBolock)logBlock;
/*! @brief WXApi的成员函数,接受微信的log信息。byDelegate
1:sdk会弱引用这个delegateWXApiDelegate同一个对象
2:startLog by delegate之后startLoad,logDelegate对象
* @param level log的级别
* @param logDelegate log的回调代理
*/
+ (void)startLogByLevel:(WXLogLevel)level logDelegate:(id<WXApiLogDelegate>)logDelegate;
/*! @brief 停止打印log,会清理block或者delegate为空,释放block
* @param
*/
+ (void)stopLog;
@end
NS_ASSUME_NONNULL_END

1247
ios/wx/Headers/WXApiObject.h

File diff suppressed because it is too large Load Diff

68
ios/wx/Headers/WechatAuthSDK.h

@ -0,0 +1,68 @@
//
// WechatAuthSDK.h
// WechatAuthSDK
//
// Created by 李凯 on 13-11-29.
// Copyright (c) 2013年 Tencent. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
enum AuthErrCode {
WechatAuth_Err_Ok = 0, //Auth成功
WechatAuth_Err_NormalErr = -1, //普通错误
WechatAuth_Err_NetworkErr = -2, //网络错误
WechatAuth_Err_GetQrcodeFailed = -3, //获取二维码失败
WechatAuth_Err_Cancel = -4, //用户取消授权
WechatAuth_Err_Timeout = -5, //超时
};
@protocol WechatAuthAPIDelegate<NSObject>
@optional
- (void)onAuthGotQrcode:(UIImage *)image; //得到二维码
- (void)onQrcodeScanned; //二维码被扫描
- (void)onAuthFinish:(int)errCode AuthCode:(nullable NSString *)authCode; //成功登录
@end
@interface WechatAuthSDK : NSObject{
NSString *_sdkVersion;
__weak id<WechatAuthAPIDelegate> _delegate;
}
@property(nonatomic, weak, nullable) id<WechatAuthAPIDelegate> delegate;
@property(nonatomic, readonly) NSString *sdkVersion; //authSDK版本号
/*! @brief 发送登录请求,等待WechatAuthAPIDelegate回调
*
* @param appId ID
* @param nonceStr 使signature不同
* @param timeStamp
* @param scope ,
* @param signature
* @param schemeData scheme后
* @return YESNO
:Auth在运行Auth未完成或未Stop再次调用Auth接口时会返回NO
*/
- (BOOL)Auth:(NSString *)appId
nonceStr:(NSString *)nonceStr
timeStamp:(NSString *)timeStamp
scope:(NSString *)scope
signature:(NSString *)signature
schemeData:(nullable NSString *)schemeData;
/*! @brief 暂停登录请求
*
* @return YESNO
*/
- (BOOL)StopAuth;
@end
NS_ASSUME_NONNULL_END

BIN
ios/wx/Libs/libWeChatSDK.a

Binary file not shown.

5
lib/generated/intl/messages_en.dart

@ -245,6 +245,7 @@ class MessageLookup extends MessageLookupByLibrary {
"muqianzanwuxingdianhuodong" : MessageLookupByLibrary.simpleMessage("目前暂无星店活动"),
"nindingweigongnengweikaiqi" : MessageLookupByLibrary.simpleMessage("您定位功能开关未开启,请点击去打開定位"),
"nindingweiquanxianweiyunxu" : MessageLookupByLibrary.simpleMessage("您未开启位置权限,请点击确定申请权限"),
"ninweidenglu" : MessageLookupByLibrary.simpleMessage("您未登录,请点击去登录"),
"ninyouyigedingdanyaolingqu" : MessageLookupByLibrary.simpleMessage("您有一个订单需要前往门店领取"),
"ninyouyigexindedingdan" : MessageLookupByLibrary.simpleMessage("您有一个新的订单"),
"peisong" : MessageLookupByLibrary.simpleMessage("配送"),
@ -290,6 +291,7 @@ class MessageLookup extends MessageLookupByLibrary {
"quanxianshezhi" : MessageLookupByLibrary.simpleMessage("权限设置"),
"qucanhao" : MessageLookupByLibrary.simpleMessage("取餐号"),
"qudanhao" : m17,
"qudenglu" : MessageLookupByLibrary.simpleMessage("去登录"),
"queding" : MessageLookupByLibrary.simpleMessage("确定"),
"queren" : MessageLookupByLibrary.simpleMessage("确认"),
"querenchongzhi" : MessageLookupByLibrary.simpleMessage("确认充值"),
@ -357,8 +359,10 @@ class MessageLookup extends MessageLookupByLibrary {
"wanchengyicixiadan" : MessageLookupByLibrary.simpleMessage("完成一次下单"),
"wanshanshengrixinxi_nl" : MessageLookupByLibrary.simpleMessage("完善生日信息后自动生成"),
"wanshanshengrixinxi_yhq" : MessageLookupByLibrary.simpleMessage("完善生日信息得专属优惠劵"),
"weidenglu" : MessageLookupByLibrary.simpleMessage("未登录"),
"weihexiao" : MessageLookupByLibrary.simpleMessage("未核销"),
"weikaiqi" : MessageLookupByLibrary.simpleMessage("未开启"),
"weilegeiningenghaodefuwu" : MessageLookupByLibrary.simpleMessage("为了给您提供更好的服务,以及享受更加精彩的信息内容,请您在使用期间,进行登录"),
"weilexiangnintuijianfujindemendianxinxi" : MessageLookupByLibrary.simpleMessage("为了向您推荐附近的门店信息,推荐您在使用期间让我们使用位置信息"),
"weiwancheng" : MessageLookupByLibrary.simpleMessage(" 未完成 "),
"weixinzhifu" : MessageLookupByLibrary.simpleMessage("微信支付"),
@ -413,6 +417,7 @@ class MessageLookup extends MessageLookupByLibrary {
"youhuiquan" : MessageLookupByLibrary.simpleMessage("优惠券"),
"youhuiquanlingqu" : MessageLookupByLibrary.simpleMessage("优惠券领取"),
"youhuiquanwufajileijifen" : MessageLookupByLibrary.simpleMessage("优惠金额无法累积积分,订单撤销或其他原因造成的未成功支付的订单,无法获得对应的积分。"),
"youkedenglu" : MessageLookupByLibrary.simpleMessage("游客登录"),
"youxiaoqizhi" : m27,
"yuan" : MessageLookupByLibrary.simpleMessage(""),
"yuan_" : m28,

5
lib/generated/intl/messages_zh_CN.dart

@ -244,6 +244,7 @@ class MessageLookup extends MessageLookupByLibrary {
"muqianzanwuxingdianhuodong" : MessageLookupByLibrary.simpleMessage("目前暂无星店活动"),
"nindingweigongnengweikaiqi" : MessageLookupByLibrary.simpleMessage("您定位功能开关未开启,请点击去打開定位"),
"nindingweiquanxianweiyunxu" : MessageLookupByLibrary.simpleMessage("您未开启位置权限,请点击确定申请权限"),
"ninweidenglu" : MessageLookupByLibrary.simpleMessage("您未登录,请点击去登录"),
"ninyouyigedingdanyaolingqu" : MessageLookupByLibrary.simpleMessage("您有一个订单需要前往门店领取"),
"ninyouyigexindedingdan" : MessageLookupByLibrary.simpleMessage("您有一个新的订单"),
"peisong" : MessageLookupByLibrary.simpleMessage("配送"),
@ -289,6 +290,7 @@ class MessageLookup extends MessageLookupByLibrary {
"quanxianshezhi" : MessageLookupByLibrary.simpleMessage("权限设置"),
"qucanhao" : MessageLookupByLibrary.simpleMessage("取餐号"),
"qudanhao" : m17,
"qudenglu" : MessageLookupByLibrary.simpleMessage("去登录"),
"queding" : MessageLookupByLibrary.simpleMessage("确定"),
"queren" : MessageLookupByLibrary.simpleMessage("确认"),
"querenchongzhi" : MessageLookupByLibrary.simpleMessage("确认充值"),
@ -356,8 +358,10 @@ class MessageLookup extends MessageLookupByLibrary {
"wanchengyicixiadan" : MessageLookupByLibrary.simpleMessage("完成一次下单"),
"wanshanshengrixinxi_nl" : MessageLookupByLibrary.simpleMessage("完善生日信息后自动生成"),
"wanshanshengrixinxi_yhq" : MessageLookupByLibrary.simpleMessage("完善生日信息得专属优惠劵"),
"weidenglu" : MessageLookupByLibrary.simpleMessage("未登录"),
"weihexiao" : MessageLookupByLibrary.simpleMessage("未核销"),
"weikaiqi" : MessageLookupByLibrary.simpleMessage("未开启"),
"weilegeiningenghaodefuwu" : MessageLookupByLibrary.simpleMessage("为了给您提供更好的服务,以及享受更加精彩的信息内容,请您在使用期间,进行登录"),
"weilexiangnintuijianfujindemendianxinxi" : MessageLookupByLibrary.simpleMessage("为了向您推荐附近的门店信息,推荐您在使用期间让我们使用位置信息"),
"weiwancheng" : MessageLookupByLibrary.simpleMessage(" 未完成 "),
"weixinzhifu" : MessageLookupByLibrary.simpleMessage("微信支付"),
@ -412,6 +416,7 @@ class MessageLookup extends MessageLookupByLibrary {
"youhuiquan" : MessageLookupByLibrary.simpleMessage("优惠券"),
"youhuiquanlingqu" : MessageLookupByLibrary.simpleMessage("优惠券领取"),
"youhuiquanwufajileijifen" : MessageLookupByLibrary.simpleMessage("优惠金额无法累积积分,订单撤销或其他原因造成的未成功支付的订单,无法获得对应的积分。"),
"youkedenglu" : MessageLookupByLibrary.simpleMessage("游客登录"),
"youxiaoqizhi" : m27,
"yuan" : MessageLookupByLibrary.simpleMessage(""),
"yuan_" : m28,

5
lib/generated/intl/messages_zh_TW.dart

@ -244,6 +244,7 @@ class MessageLookup extends MessageLookupByLibrary {
"muqianzanwuxingdianhuodong" : MessageLookupByLibrary.simpleMessage("目前暫無星店活動"),
"nindingweigongnengweikaiqi" : MessageLookupByLibrary.simpleMessage("您定位功能開關未開啟,請點擊去開啟定位"),
"nindingweiquanxianweiyunxu" : MessageLookupByLibrary.simpleMessage("您未开启位置权限,请点击确定申请权限"),
"ninweidenglu" : MessageLookupByLibrary.simpleMessage("您未登錄,請點擊去燈籠"),
"ninyouyigedingdanyaolingqu" : MessageLookupByLibrary.simpleMessage("您有一個訂單需要前往門店領取"),
"ninyouyigexindedingdan" : MessageLookupByLibrary.simpleMessage("您有一個新訂單"),
"peisong" : MessageLookupByLibrary.simpleMessage("配送"),
@ -289,6 +290,7 @@ class MessageLookup extends MessageLookupByLibrary {
"quanxianshezhi" : MessageLookupByLibrary.simpleMessage("權限設置"),
"qucanhao" : MessageLookupByLibrary.simpleMessage("取餐號"),
"qudanhao" : m17,
"qudenglu" : MessageLookupByLibrary.simpleMessage("去登錄"),
"queding" : MessageLookupByLibrary.simpleMessage("確定"),
"queren" : MessageLookupByLibrary.simpleMessage("确认"),
"querenchongzhi" : MessageLookupByLibrary.simpleMessage("確認充值"),
@ -356,8 +358,10 @@ class MessageLookup extends MessageLookupByLibrary {
"wanchengyicixiadan" : MessageLookupByLibrary.simpleMessage("完成一次下單"),
"wanshanshengrixinxi_nl" : MessageLookupByLibrary.simpleMessage("完善生日資訊後自動生成 "),
"wanshanshengrixinxi_yhq" : MessageLookupByLibrary.simpleMessage("完善生日資訊得專屬優惠劵 "),
"weidenglu" : MessageLookupByLibrary.simpleMessage("未登錄"),
"weihexiao" : MessageLookupByLibrary.simpleMessage("未核銷"),
"weikaiqi" : MessageLookupByLibrary.simpleMessage("未開啓"),
"weilegeiningenghaodefuwu" : MessageLookupByLibrary.simpleMessage("為了給您提供更好的服務,以及享受更加精彩的信息內容,請在使用使用期間登錄"),
"weilexiangnintuijianfujindemendianxinxi" : MessageLookupByLibrary.simpleMessage("為了向您推薦附近的門店信息,推薦您在使用期間讓我們使用位置信息"),
"weiwancheng" : MessageLookupByLibrary.simpleMessage(" 未完成 "),
"weixinzhifu" : MessageLookupByLibrary.simpleMessage("微信支付"),
@ -412,6 +416,7 @@ class MessageLookup extends MessageLookupByLibrary {
"youhuiquan" : MessageLookupByLibrary.simpleMessage("優惠券"),
"youhuiquanlingqu" : MessageLookupByLibrary.simpleMessage("優惠券領取"),
"youhuiquanwufajileijifen" : MessageLookupByLibrary.simpleMessage("優惠金額無法累積積分,訂單撤銷或其他原因造成的未成功支付的訂單,無法獲得對應的積分。"),
"youkedenglu" : MessageLookupByLibrary.simpleMessage("遊客登錄"),
"youxiaoqizhi" : m27,
"yuan" : MessageLookupByLibrary.simpleMessage(""),
"yuan_" : m28,

50
lib/generated/l10n.dart

@ -3655,6 +3655,56 @@ class S {
);
}
/// ``
String get ninweidenglu {
return Intl.message(
'您未登录,请点击去登录',
name: 'ninweidenglu',
desc: '',
args: [],
);
}
/// `使`
String get weilegeiningenghaodefuwu {
return Intl.message(
'为了给您提供更好的服务,以及享受更加精彩的信息内容,请您在使用期间,进行登录',
name: 'weilegeiningenghaodefuwu',
desc: '',
args: [],
);
}
/// ``
String get qudenglu {
return Intl.message(
'去登录',
name: 'qudenglu',
desc: '',
args: [],
);
}
/// ``
String get weidenglu {
return Intl.message(
'未登录',
name: 'weidenglu',
desc: '',
args: [],
);
}
/// ``
String get youkedenglu {
return Intl.message(
'游客登录',
name: 'youkedenglu',
desc: '',
args: [],
);
}
/// `使`
String get privacy_policy4 {
return Intl.message(

14
lib/home/activity_list_page.dart

@ -37,12 +37,12 @@ class _ActivityListPage extends State<ActivityListPage>
List<Activity> activityList;
queryActivity() async {
showCupertinoDialog(
context: context,
barrierDismissible: true,
builder: (context) {
return LoadingView();
});
// showCupertinoDialog(
// context: context,
// barrierDismissible: true,
// builder: (context) {
// return LoadingView();
// });
BaseData baseData = await apiService.informationList({
"pageNum": 1,
"pageSize": 10,
@ -52,7 +52,7 @@ class _ActivityListPage extends State<ActivityListPage>
}).catchError((error) {
_refreshController.refreshFailed();
});
if (Navigator.canPop(context)) Navigator.of(context).pop();
// if (Navigator.canPop(context)) Navigator.of(context).pop();
if (baseData != null && baseData.isSuccess) {
PageInfo pageInfo = PageInfo.fromJson(baseData.data);
_refreshController.refreshCompleted();

248
lib/home/founder_story_page.dart

@ -461,128 +461,128 @@ class _FounderStoryPage extends State<FounderStoryPage> {
);
}
Widget _commentItem(var position) {
return Container(
child: Column(
children: [
Padding(
padding: EdgeInsets.all(16),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
ClipOval(
child: Image.network(
"https://t7.baidu.com/it/u=2841334870,333581502&fm=193&f=GIF",
fit: BoxFit.cover,
width: 40,
height: 40,
),
clipBehavior: Clip.hardEdge,
),
SizedBox(
width: 12,
),
Expanded(
child: Container(
height: 60,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text.rich(
TextSpan(children: [
TextSpan(
text: "张三",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 14,
color: Colors.black),
),
]),
textDirection: TextDirection.ltr,
),
Text(
"2021.04.12 12:12",
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle(
fontSize: 12,
color: Color(0xff808080),
),
),
],
),
),
flex: 1,
),
Container(
alignment: Alignment.topRight,
child: Row(
children: [
Image.asset(
"assets/image/icon_like.png",
width: 16,
height: 16,
),
Text(
"58",
style:
TextStyle(fontSize: 12, color: Color(0xff1A1A1A)),
),
],
),
),
],
),
),
Padding(
padding: EdgeInsets.only(left: 68, right: 16),
child: Text(
"文本,是指书面语言的表现形式,从文学角度说,通常是具有完整、系统含义(Mess…",
style: TextStyle(fontSize: 14, color: Color(0xff1A1A1A)),
),
),
SizedBox(
height: 12,
),
Container(
width: double.infinity,
margin: EdgeInsets.only(left: 68, right: 16),
decoration: new BoxDecoration(
color: Color(0xffF2F2F2),
borderRadius: BorderRadius.circular(2.0),
),
child: Padding(
padding: EdgeInsets.only(left: 4, top: 4, bottom: 4),
child: Text(
"文本,是指书面语言的表现形式文本,是指、",
style: TextStyle(fontSize: 12, color: Color(0xff808080)),
),
),
),
if (position == 5)
Container(
height: 63,
decoration: BoxDecoration(
color: Color(0xffF2F2F2),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 2),
blurRadius: 14,
spreadRadius: 0)
],
),
margin: EdgeInsets.only(top: 30),
alignment: Alignment.center,
child: Text(
"-已显示全部评论-",
style: TextStyle(fontSize: 14, color: Color(0xff353535)),
),
),
],
),
);
}
// Widget _commentItem(var position) {
// return Container(
// child: Column(
// children: [
// Padding(
// padding: EdgeInsets.all(16),
// child: Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// crossAxisAlignment: CrossAxisAlignment.center,
// children: [
// ClipOval(
// child: Image.network(
// "https://t7.baidu.com/it/u=2841334870,333581502&fm=193&f=GIF",
// fit: BoxFit.cover,
// width: 40,
// height: 40,
// ),
// clipBehavior: Clip.hardEdge,
// ),
// SizedBox(
// width: 12,
// ),
// Expanded(
// child: Container(
// height: 60,
// child: Column(
// mainAxisAlignment: MainAxisAlignment.spaceEvenly,
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Text.rich(
// TextSpan(children: [
// TextSpan(
// text: "张三",
// style: TextStyle(
// fontWeight: FontWeight.bold,
// fontSize: 14,
// color: Colors.black),
// ),
// ]),
// textDirection: TextDirection.ltr,
// ),
// Text(
// "2021.04.12 12:12",
// overflow: TextOverflow.ellipsis,
// maxLines: 2,
// style: TextStyle(
// fontSize: 12,
// color: Color(0xff808080),
// ),
// ),
// ],
// ),
// ),
// flex: 1,
// ),
// Container(
// alignment: Alignment.topRight,
// child: Row(
// children: [
// Image.asset(
// "assets/image/icon_like.png",
// width: 16,
// height: 16,
// ),
// Text(
// "58",
// style:
// TextStyle(fontSize: 12, color: Color(0xff1A1A1A)),
// ),
// ],
// ),
// ),
// ],
// ),
// ),
// Padding(
// padding: EdgeInsets.only(left: 68, right: 16),
// child: Text(
// "文本,是指书面语言的表现形式,从文学角度说,通常是具有完整、系统含义(Mess…",
// style: TextStyle(fontSize: 14, color: Color(0xff1A1A1A)),
// ),
// ),
// SizedBox(
// height: 12,
// ),
// Container(
// width: double.infinity,
// margin: EdgeInsets.only(left: 68, right: 16),
// decoration: new BoxDecoration(
// color: Color(0xffF2F2F2),
// borderRadius: BorderRadius.circular(2.0),
// ),
// child: Padding(
// padding: EdgeInsets.only(left: 4, top: 4, bottom: 4),
// child: Text(
// "文本,是指书面语言的表现形式文本,是指、",
// style: TextStyle(fontSize: 12, color: Color(0xff808080)),
// ),
// ),
// ),
// if (position == 5)
// Container(
// height: 63,
// decoration: BoxDecoration(
// color: Color(0xffF2F2F2),
// boxShadow: [
// BoxShadow(
// color: Colors.black.withAlpha(12),
// offset: Offset(0, 2),
// blurRadius: 14,
// spreadRadius: 0)
// ],
// ),
// margin: EdgeInsets.only(top: 30),
// alignment: Alignment.center,
// child: Text(
// "-已显示全部评论-",
// style: TextStyle(fontSize: 14, color: Color(0xff353535)),
// ),
// ),
// ],
// ),
// );
// }
}

66
lib/home/home_page.dart

@ -1,6 +1,7 @@
import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:flutter_swiper/flutter_swiper.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/main.dart';
@ -18,7 +19,7 @@ import 'package:huixiang/view_widget/custom_image.dart';
import 'package:huixiang/view_widget/hot_item.dart';
import 'package:huixiang/view_widget/item_title.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/view_widget/loading_view.dart';
import 'package:huixiang/view_widget/login_tips.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:shared_preferences/shared_preferences.dart';
@ -30,6 +31,7 @@ class HomePage extends StatefulWidget {
}
class _HomePage extends State<HomePage> with AutomaticKeepAliveClientMixin {
ApiService apiService;
@override
@ -37,16 +39,37 @@ class _HomePage extends State<HomePage> with AutomaticKeepAliveClientMixin {
super.initState();
SharedPreferences.getInstance().then((value) => {
isLogin = (value.containsKey("token") &&
value.getString('token') != null &&
value.getString('token') != ""),
apiService = ApiService(Dio(),
context: context, token: value.getString('token')),
context: context,
token: value.getString('token'),
showLoading: false),
queryHome(),
});
eventBus.on<EventType>().listen((event) {
setState(() {});
if (event.type < 3) {
setState(() {});
};
});
}
bool isLogin = false;
loginTips() {
SmartDialog.show(
widget: LoginTips(
click: () {
SharedPreferences.getInstance().then((value) => value.clear());
Navigator.of(context).pushNamed('/router/login_page', arguments: {"login":"login"});
},
),
clickBgDismissTemp: false,
);
}
List<BannerData> bannerData = [];
List<Brand> brandData = [];
List<Article> articles = [];
@ -54,12 +77,7 @@ class _HomePage extends State<HomePage> with AutomaticKeepAliveClientMixin {
Founder founder;
queryHome() async {
showCupertinoDialog(
context: context,
barrierDismissible: true,
builder: (context) {
return LoadingView();
});
SmartDialog.showLoading(msg: S.of(context).zhengzaijiazai);
BaseData baseData = await apiService.queryBanner({
"model": {"type": "HOME_PAGE"},
}).catchError((onError) {
@ -112,14 +130,14 @@ class _HomePage extends State<HomePage> with AutomaticKeepAliveClientMixin {
gooods.clear();
gooods.addAll(page.list.map((e) => Goods.fromJson(e)));
}
Future.delayed(Duration(milliseconds: 500), () {
if (Navigator.canPop(context))
Navigator.of(context).pop();
});
// Future.delayed(Duration(milliseconds: 500), () {
// if (Navigator.canPop(context))
// Navigator.of(context).pop();
// });
SmartDialog.dismiss();
if (baseData != null && baseData.isSuccess) {
refreshController.refreshCompleted();
if(mounted)
setState(() {});
if (mounted) setState(() {});
} else {
refreshController.refreshFailed();
}
@ -153,12 +171,19 @@ class _HomePage extends State<HomePage> with AutomaticKeepAliveClientMixin {
imgPath: "assets/image/icon_today_task.png",
moreText: S.of(context).renwuzhongxin,
onTap: () {
Navigator.of(context)
.pushNamed('/router/integral_page');
if (!isLogin) {
loginTips();
return;
}
Navigator.of(context).pushNamed('/router/integral_page');
},
),
InkWell(
onTap: () {
if (!isLogin) {
loginTips();
return;
}
Navigator.of(context).pushNamed('/router/integral_page');
},
child: signIn(),
@ -284,8 +309,8 @@ class _HomePage extends State<HomePage> with AutomaticKeepAliveClientMixin {
text: " ",
),
TextSpan(
text:
S.of(context).jianjie("${founder != null ? founder.description : ""}"),
text: S.of(context).jianjie(
"${founder != null ? founder.description : ""}"),
style: TextStyle(
fontSize: 10.sp,
color: Colors.white,
@ -393,7 +418,8 @@ class _HomePage extends State<HomePage> with AutomaticKeepAliveClientMixin {
children: [
Expanded(
child: Text(
S.of(context)
S
.of(context)
.yuan_(double.tryParse(goods.worth).toInt()),
overflow: TextOverflow.ellipsis,
style: TextStyle(

74
lib/home/huixiang_brand_page.dart

@ -15,7 +15,6 @@ import 'package:huixiang/utils/MyPainter.dart';
import 'package:huixiang/utils/event_type.dart';
import 'package:huixiang/view_widget/classic_header.dart';
import 'package:huixiang/view_widget/custom_image.dart';
import 'package:huixiang/view_widget/icon_text.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/view_widget/loading_view.dart';
import 'package:huixiang/view_widget/store_title_tab.dart';
@ -44,12 +43,12 @@ class _BrandPage extends State<BrandPage>
var isShowMore = false;
queryHome() async {
showCupertinoDialog(
context: context,
barrierDismissible: true,
builder: (context) {
return LoadingView();
});
// showCupertinoDialog(
// context: context,
// barrierDismissible: true,
// builder: (context) {
// return LoadingView();
// });
BaseData baseData = await apiService.queryHome().catchError((error) {
refreshController.refreshFailed();
});
@ -64,7 +63,7 @@ class _BrandPage extends State<BrandPage>
.map((e) => BannerData.fromJson(e))
.toList());
if (Navigator.canPop(context)) Navigator.of(context).pop();
// if (Navigator.canPop(context)) Navigator.of(context).pop();
if (baseData != null && baseData.isSuccess) {
refreshController.refreshCompleted();
@ -80,16 +79,18 @@ class _BrandPage extends State<BrandPage>
void initState() {
super.initState();
SharedPreferences.getInstance().then((value) =>
{
apiService = ApiService(Dio(),
context: context, token: value.getString('token')),
queryHome(),
});
SharedPreferences.getInstance().then((value) => {
apiService = ApiService(Dio(),
context: context, token: value.getString('token')),
queryHome(),
});
eventBus.on<EventType>().listen((event) {
print("object: BrandPage");
setState(() {});
if (event.type < 3) {
setState(() {});
}
;
});
}
@ -100,10 +101,7 @@ class _BrandPage extends State<BrandPage>
super.build(context);
return Scaffold(
appBar: AppBar(
toolbarHeight: 40.h - MediaQuery
.of(context)
.padding
.top,
toolbarHeight: 40.h - MediaQuery.of(context).padding.top,
backgroundColor: Colors.white,
elevation: 0,
),
@ -136,11 +134,13 @@ class _BrandPage extends State<BrandPage>
),
Positioned(
child: StoreTitleTab(
brandText,
scrollController: scrollController,
chiliGlobalKey: chiliGlobalKey,
milkTeaGlobalKey: milkTeaGlobalKey,
breadGlobalKey: breadGlobalKey),
brandText,
scrollController: scrollController,
chiliGlobalKey: chiliGlobalKey,
milkTeaGlobalKey: milkTeaGlobalKey,
breadGlobalKey: breadGlobalKey,
isScroll: true,
),
top: 0,
),
],
@ -153,10 +153,14 @@ class _BrandPage extends State<BrandPage>
var widgets = <Widget>[
banner(),
buildInfo(),
StoreTitleTab(brandText,
chiliGlobalKey: chiliGlobalKey,
milkTeaGlobalKey: milkTeaGlobalKey,
breadGlobalKey: breadGlobalKey)
StoreTitleTab(
brandText,
scrollController: scrollController,
chiliGlobalKey: chiliGlobalKey,
milkTeaGlobalKey: milkTeaGlobalKey,
breadGlobalKey: breadGlobalKey,
isScroll: false,
)
];
if (brandData == null) return widgets;
(brandData.contents as Map<String, dynamic>).forEach((key, value) {
@ -230,7 +234,7 @@ class _BrandPage extends State<BrandPage>
TextSpan(children: [
TextSpan(
text:
brandData == null ? "" : brandData.originator,
brandData == null ? "" : brandData.originator,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 14.sp,
@ -238,9 +242,7 @@ class _BrandPage extends State<BrandPage>
),
),
TextSpan(
text: S
.of(context)
.jituanchuangbanren,
text: " ${S.of(context).jituanchuangbanren}",
style: TextStyle(
fontSize: 10.sp,
color: Colors.black,
@ -273,9 +275,7 @@ class _BrandPage extends State<BrandPage>
mainAxisSize: MainAxisSize.max,
children: [
Text(
S
.of(context)
.gengduo,
S.of(context).gengduo,
style: TextStyle(
fontSize: 12.sp,
color: Colors.black,
@ -325,9 +325,7 @@ class _BrandPage extends State<BrandPage>
height: 40,
),
Text(
S
.of(context)
.linian,
S.of(context).linian,
style: TextStyle(
fontSize: 16.sp,
fontWeight: FontWeight.bold,

4
lib/home/main_home_page.dart

@ -32,7 +32,9 @@ class _MainHomePage extends State<MainHomePage>
eventBus.on<EventType>().listen((event) {
print("object: MainHomePage");
setState(() {});
if (event.type < 3) {
setState(() {});
};
});
}

5
lib/l10n/intl_en.arb

@ -378,6 +378,11 @@
"huiyuanjifen": "会员积分",
"huiyuanyue": "会员余额",
"gongxinichengweibendianhuiyuan": "恭喜您,成为本店的会员,快去享受超多会员权益吧。",
"ninweidenglu": "您未登录,请点击去登录",
"weilegeiningenghaodefuwu": "为了给您提供更好的服务,以及享受更加精彩的信息内容,请您在使用期间,进行登录",
"qudenglu": "去登录",
"weidenglu": "未登录",
"youkedenglu": "游客登录",

5
lib/l10n/intl_zh_CN.arb

@ -379,6 +379,11 @@
"huiyuanjifen": "会员积分",
"huiyuanyue": "会员余额",
"gongxinichengweibendianhuiyuan": "恭喜您,成为本店的会员,快去享受超多会员权益吧。",
"ninweidenglu": "您未登录,请点击去登录",
"weilegeiningenghaodefuwu": "为了给您提供更好的服务,以及享受更加精彩的信息内容,请您在使用期间,进行登录",
"qudenglu": "去登录",
"weidenglu": "未登录",
"youkedenglu": "游客登录",

6
lib/l10n/intl_zh_TW.arb

@ -371,7 +371,11 @@
"huiyuanjifen": "會員積分",
"huiyuanyue": "會員餘額",
"gongxinichengweibendianhuiyuan": "恭喜您,成為本店會員,快去享受超多的會員權益吧。",
"ninweidenglu": "您未登錄,請點擊去燈籠",
"weilegeiningenghaodefuwu": "為了給您提供更好的服務,以及享受更加精彩的信息內容,請在使用使用期間登錄",
"qudenglu": "去登錄",
"weidenglu": "未登錄",
"youkedenglu": "遊客登錄",
"privacy_policy4": "并使用本機號碼登錄"

90
lib/login/login_page.dart

@ -4,10 +4,13 @@ import 'dart:io';
import 'dart:ui';
import 'package:flutter/gestures.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:huixiang/main.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/retrofit/data/user_entity.dart';
import 'package:huixiang/utils/event_type.dart';
import 'package:huixiang/view_widget/border_text.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@ -15,12 +18,13 @@ import 'package:flutter/services.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:dio/dio.dart';
import 'package:huixiang/view_widget/loading_view.dart';
import 'package:photo_view/photo_view.dart';
import 'package:shared_preferences/shared_preferences.dart';
class LoginPage extends StatefulWidget {
LoginPage({Key key}) : super(key: key);
final Map<String, dynamic> arguments;
LoginPage({this.arguments});
@override
_MyLoginPageState createState() => _MyLoginPageState();
@ -63,6 +67,8 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
TapGestureRecognizer tapGestureRecognizer = TapGestureRecognizer();
double offsetBtn = 0;
@override
void initState() {
super.initState();
@ -80,9 +86,11 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
scrollController.addListener(() {
RenderBox renderBox = loginKey.currentContext.findRenderObject();
offsetBtn = scrollController.offset;
print("offsetBtn: $offsetBtn");
var screenHeight = MediaQuery.of(context).size.height;
var scrollHeight = screenHeight * 1.47;
// var spaceHeight = screenHeight * 0.6244;
var height = scrollHeight - renderBox.size.height;
var chaHeight = screenHeight - renderBox.size.height;
changeAlpha =
@ -209,6 +217,7 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
_login() async {
// Navigator.of(context).popAndPushNamed('/router/main_page');
// return;
print("222222");
if (alpha != 255) {
scrollToTop();
return;
@ -248,21 +257,21 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
"capcha": code,
"mobile": mobile,
};
showCupertinoDialog(
context: context,
barrierDismissible: true,
builder: (context) {
return LoadingView();
});
SmartDialog.showLoading(msg: S.of(context).zhengzaijiazai);
BaseData value = await client.memberLogin(param).catchError((error) {
print(error);
Fluttertoast.showToast(msg: "$error");
});
Future.delayed(Duration(seconds: 2), () {
if (Navigator.canPop(context)) Navigator.of(context).pop();
SmartDialog.dismiss();
if (value.isSuccess) {
saveUserJson(value.data);
Navigator.of(context).popAndPushNamed('/router/main_page');
eventBus.fire(EventType(3));
if (widget.arguments != null) {
Navigator.of(context).pop();
} else {
Navigator.of(context).popAndPushNamed('/router/main_page');
}
} else {
Fluttertoast.showToast(msg: "${value.msg}");
}
@ -463,13 +472,16 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
top: 0,
),
Positioned(
top: MediaQuery.of(context).size.height * 0.1039,
top:
MediaQuery.of(context).size.height * 0.1039,
bottom: 0,
child: Container(
padding: EdgeInsets.symmetric(horizontal: 40.w),
padding:
EdgeInsets.symmetric(horizontal: 40.w),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Opacity(
opacity: (255 - changeAlpha) / 255,
@ -529,6 +541,43 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
),
),
),
bottom: 140.h -
(50.h -
(offsetBtn > 50.h
? 50.h
: offsetBtn < 0
? 0
: offsetBtn)),
left: 40.w,
right: 40.w,
),
Positioned(
child: InkWell(
onTap: () {
print("11111");
if (widget.arguments != null) {
Navigator.of(context).pop();
} else {
Navigator.of(context)
.popAndPushNamed('/router/main_page');
}
},
child: Visibility(
visible: (changeAlpha / 255) > 0,
child: Opacity(
opacity: changeAlpha / 255,
child: BorderText(
padding: EdgeInsets.all(9.h),
text: S.of(context).youkedenglu,
fontSize: 18.sp,
textColor: Color(0xFF32A060),
borderColor: Color(0xFF32A060),
borderWidth: 1.w,
radius: 2,
),
),
),
),
bottom: 88.h,
left: 40.w,
right: 40.w,
@ -561,9 +610,8 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
),
firstCurve: Curves.easeInOut,
secondCurve: Curves.easeInOut,
crossFadeState: isShowLogin
? CrossFadeState.showSecond
: CrossFadeState.showFirst,
crossFadeState:
isShowLogin ? CrossFadeState.showSecond : CrossFadeState.showFirst,
duration: Duration(milliseconds: 1200),
);
}
@ -725,7 +773,9 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
onTap: _sendCode,
child: BorderText(
text: btnText,
borderColor: _sendCodeStatus == 0 ? Color(0xFF32A060) : Color(0xFFFF7A1A),
borderColor: _sendCodeStatus == 0
? Color(0xFF32A060)
: Color(0xFFFF7A1A),
borderWidth: 1.w,
radius: 2,
padding: EdgeInsets.only(
@ -787,7 +837,7 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
recognizer: tapGestureRecognizer,
style: TextStyle(
fontSize: 11.sp,
color: Colors.black,
color: Color(0xFF32A060),
),
),
TextSpan(
@ -819,7 +869,7 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
),
),
SizedBox(
height: 150.h,
height: 208.h,
)
],
),

6
lib/main.dart

@ -5,6 +5,7 @@ import 'package:event_bus/event_bus.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/address/address_map_page.dart';
import 'package:huixiang/address/edit_address_page.dart';
import 'package:huixiang/article/hot_article_details_page.dart';
@ -103,7 +104,6 @@ class MyApp extends StatelessWidget {
print("locale: $locale");
print("supportedLocales: $supportedLocales");
// Localizations.maybeLocaleOf(context)
return appLocale ??
Locale.fromSubtags(languageCode: 'zh', countryCode: 'TW');
},
@ -115,6 +115,7 @@ class MyApp extends StatelessWidget {
],
supportedLocales: S.delegate.supportedLocales,
home: LoginPage(),
// home: MainPage(),
builder: (context, widget) {
double textScaleFactor = MediaQuery.of(context).textScaleFactor;
print("textScaleFactor: $textScaleFactor");
@ -123,7 +124,7 @@ class MyApp extends StatelessWidget {
textScaleFactor: textScaleFactor > 1.15 ? 1.15 : textScaleFactor,
// devicePixelRatio: devicePixelRatio * textScaleFactor
),
child: widget,
child: FlutterSmartDialog(child: widget),
);
},
onGenerateRoute: (settings) {
@ -153,6 +154,7 @@ class MyApp extends StatelessWidget {
}
Map<String, WidgetBuilder> routers = <String, WidgetBuilder>{
'/router/login_page': (context, {arguments}) => LoginPage(arguments: arguments),
'/router/main_page': (context, {arguments}) => MainPage(),
'/router/msg_page': (context, {arguments}) => MainMessagePage(),
'/router/system_msg_page': (context, {arguments}) => SystemMessagePage(),

5
lib/main_page.dart

@ -52,7 +52,9 @@ class _MainPage extends State<MainPage> {
];
eventBus.on<EventType>().listen((event) {
setState(() {});
if (event.type < 3) {
setState(() {});
};
});
queryUserInfo();
@ -60,6 +62,7 @@ class _MainPage extends State<MainPage> {
queryUserInfo() async {
SharedPreferences sharedPreferences = await SharedPreferences.getInstance();
if (sharedPreferences.getString("token") == null || sharedPreferences.getString("token") == "") return;
BaseData baseDate = await ApiService(Dio(),
context: context, token: sharedPreferences.getString('token'))
.queryInfo();

121
lib/mine/mine_page.dart

@ -2,6 +2,7 @@ import 'dart:convert';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/main.dart';
@ -13,6 +14,7 @@ import 'package:huixiang/utils/event_type.dart';
import 'package:huixiang/view_widget/classic_header.dart';
import 'package:huixiang/view_widget/custom_image.dart';
import 'package:huixiang/view_widget/loading_view.dart';
import 'package:huixiang/view_widget/login_tips.dart';
import 'package:huixiang/view_widget/mine_vip_view.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:shared_preferences/shared_preferences.dart';
@ -30,16 +32,49 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
ApiService apiService;
_toUserInfo() async {
if (!isLogin) {
loginTips();
return;
}
await Navigator.of(context).pushNamed('/router/user_info_page');
queryUserInfo();
}
bool isLogin = false;
loginTips() {
SmartDialog.show(
widget: LoginTips(
click: () {
SharedPreferences.getInstance().then((value) => value.clear());
Navigator.of(context).pushNamed('/router/login_page', arguments: {"login":"login"});
},
),
clickBgDismissTemp: false,
);
}
@override
void initState() {
super.initState();
refreshUserInfo();
eventBus.on<EventType>().listen((event) {
print("EventType: ${event.type}");
if (event.type < 3) {
setState(() {});
}
if (event.type == 3) {
refreshUserInfo();
};
});
}
refreshUserInfo() {
SharedPreferences.getInstance().then(
(value) => {
(value) => {
isLogin = (value.containsKey("token") &&
value.getString('token') != null &&
value.getString('token') != ""),
apiService = ApiService(Dio(),
context: context, token: value.getString('token')),
if (value.containsKey('user'))
@ -49,10 +84,6 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
queryUserInfo()
},
);
eventBus.on<EventType>().listen((event) {
setState(() {});
});
}
UserInfo userinfo;
@ -60,19 +91,7 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
List<Rank> ranks = [];
queryUserInfo() async {
showCupertinoDialog(
context: context,
barrierDismissible: true,
builder: (context) {
return LoadingView();
});
BaseData baseDate = await apiService.queryInfo().catchError((onError) {
_refreshController.refreshFailed();
});
BaseData rankData = await apiService.rankList().catchError((onError) {
_refreshController.refreshFailed();
});
BaseData rankData = await apiService.rankList();
if (rankData != null && rankData.isSuccess) {
ranks.clear();
ranks.addAll((rankData.data as List<dynamic>)
@ -80,7 +99,7 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
.toList());
}
if (Navigator.canPop(context)) Navigator.of(context).pop();
BaseData baseDate = await apiService.queryInfo();
if (baseDate != null && baseDate.isSuccess) {
userinfo = UserInfo.fromJson(baseDate.data);
if (userinfo != null &&
@ -99,7 +118,6 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
_refreshController.refreshCompleted();
} else {
_refreshController.refreshFailed();
Fluttertoast.showToast(msg: baseDate.msg);
}
if (mounted) setState(() {});
}
@ -134,6 +152,10 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
),
GestureDetector(
onTap: () {
if (!isLogin) {
loginTips();
return;
}
Navigator.of(context).pushNamed(
'/router/mine_vip_level_page',
arguments: {
@ -265,6 +287,10 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
children: [
InkWell(
onTap: () {
if (!isLogin) {
loginTips();
return;
}
Navigator.of(context).pushNamed('/router/mine_wallet');
},
child: mineItem(
@ -274,6 +300,10 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
),
InkWell(
onTap: () {
if (!isLogin) {
loginTips();
return;
}
Navigator.of(context).pushNamed('/router/exchange_history_page');
},
child: mineItem(
@ -283,6 +313,10 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
),
InkWell(
onTap: () {
if (!isLogin) {
loginTips();
return;
}
Navigator.of(context).pushNamed('/router/roll_center_page');
},
child: mineItem(
@ -292,6 +326,10 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
),
InkWell(
onTap: () {
if (!isLogin) {
loginTips();
return;
}
Navigator.of(context).pushNamed('/router/manage_address_page');
},
child: mineItem(
@ -377,6 +415,10 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
flex: 1,
child: GestureDetector(
onTap: () {
if (!isLogin) {
loginTips();
return;
}
Navigator.of(context).pushNamed('/router/mine_card');
},
child: Row(
@ -413,6 +455,10 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
flex: 1,
child: GestureDetector(
onTap: () {
if (!isLogin) {
loginTips();
return;
}
Navigator.of(context).pushNamed('/router/order_history_page');
},
child: Row(
@ -475,12 +521,29 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
Row(
children: [
Expanded(
child: Text(
userinfo == null ? "" : "${userinfo.nickname}",
style: TextStyle(
fontSize: 16.sp,
fontWeight: FontWeight.bold,
color: Color(0xFF353535)),
child: InkWell(
onTap: () {
SmartDialog.show(
widget: LoginTips(
click: () {
SharedPreferences.getInstance()
.then((value) => value.clear());
Navigator.of(context)
.pushNamed('/router/login_page', arguments: {"login":"login"});
},
),
clickBgDismissTemp: false,
);
},
child: Text(
userinfo == null
? S.of(context).weidenglu
: "${userinfo.nickname}",
style: TextStyle(
fontSize: 16.sp,
fontWeight: FontWeight.bold,
color: Color(0xFF353535)),
),
),
flex: 1,
),
@ -497,7 +560,7 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
],
),
Text(
userinfo == null ? "NO.0" : "NO.${userinfo.vipNo}",
userinfo == null ? "" : "NO.${userinfo.vipNo}",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF2F2F2F),
@ -528,6 +591,10 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
Expanded(
child: GestureDetector(
onTap: () {
if (!isLogin) {
loginTips();
return;
}
Navigator.of(context)
.pushNamed('/router/integral_page');
},

2
lib/mine/mine_wallet_page.dart

@ -71,7 +71,7 @@ class _MineWalletPage extends State<MineWalletPage> {
queryUserBalance();
BaseData baseData = await apiService.queryBillInfo({
"current": current,
"model": {"category": "", "title": "bill_tenant_balance", "type": ""},
"model": {"category": "", "title": "bill_title_balance", "type": ""},
"order": "descending",
"size": 10,
"sort": "id"

66
lib/retrofit/retrofit_api.dart

@ -2,25 +2,34 @@ import 'dart:convert';
import 'dart:io';
import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/login/login_page.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/view_widget/loading_view.dart';
import 'package:huixiang/view_widget/login_tips.dart';
import 'package:retrofit/retrofit.dart';
import 'package:shared_preferences/shared_preferences.dart';
part 'retrofit_api.g.dart';
const base_url = "http://platform.test.api.lotus-wallet.com/app/";
// const base_url = "http://192.168.10.236:8766/app/";
// const base_url = "http://192.168.10.129:8766/app/";
// const baseUrl = "http://platform.test.api.lotus-wallet.com/app/";
const baseUrl = "http://192.168.10.236:8766/app/";
// const baseUrl = "http://192.168.10.129:8766/app/";
@RestApi(baseUrl: base_url)
@RestApi(baseUrl: baseUrl)
abstract class ApiService {
factory ApiService(Dio dio,
{String baseUrl, BuildContext context, String token}) {
{String baseUrl,
BuildContext context,
String token,
bool showLoading = true}) {
Map<String, dynamic> headers =
token == null || token == "" ? {} : {'token': "Bearer $token"};
(token == null || token == "") ? {} : {'token': "Bearer $token"};
dio.options = BaseOptions(
connectTimeout: 60000,
receiveTimeout: 60000,
@ -32,6 +41,9 @@ abstract class ApiService {
debugPrint("method = ${options.method.toString()}");
debugPrint("url = ${options.uri.toString()}");
debugPrint("headers = ${options.headers}");
if (showLoading) { //loading
SmartDialog.showLoading(msg: S.current.zhengzaijiazai);
}
if (options.data is FormData) {
debugPrint("params data = FormData");
} else {
@ -39,21 +51,35 @@ abstract class ApiService {
}
debugPrint("params queryParameters = ${options.queryParameters}");
}, onResponse: (Response response) {
if (showLoading) {
SmartDialog.dismiss();
}
debugPrint("\n====================== 响应数据开始 =====================");
debugPrint("code = ${response.statusCode}");
// print("data = ${jsonEncode(response.data)}");
p(jsonEncode(response.data));
Map map = response.data;
if (map["code"] == 40005 || map["code"] == 40001) {
SharedPreferences.getInstance().then((value) => value.clear());
Navigator.pushAndRemoveUntil(context, MaterialPageRoute(
builder: (BuildContext context) {
return LoginPage();
},
), (route) => route == null);
// Navigator.pushAndRemoveUntil(context, MaterialPageRoute(
// builder: (BuildContext context) {
// return LoginPage();
// },
// ), (route) => route == null);
// showDialog(context);
SmartDialog.show(
widget: LoginTips(
click: () {
SharedPreferences.getInstance().then((value) => value.clear());
Navigator.of(context).pushNamed('/router/login_page', arguments: {"login":"login"});
},
),
clickBgDismissTemp: false,
);
}
debugPrint("======================= 响应数据结束 =======================\n");
}, onError: (DioError e) {
if (showLoading) {
SmartDialog.dismiss();
}
debugPrint("\n=======================错误响应数据 ========================");
debugPrint("type = ${e.type}");
debugPrint("message = ${e.message}");
@ -61,12 +87,23 @@ abstract class ApiService {
}),
);
if(kReleaseMode) {
if (kReleaseMode) {
baseUrl = base_url;
}
return _ApiService(dio, baseUrl: baseUrl);
}
static showDialog(context) async {
dynamic ddd = await showCupertinoDialog(
context: context,
barrierDismissible: false,
builder: (context) {
return LoginTips();
},
);
print("ddd: $ddd");
}
static void p(String msg) {
//String的length是字符数量不是字节数量所以为了防止中文字符过多
// 4*1024MAX字节打印长度改为1000字符数
@ -208,7 +245,7 @@ abstract class ApiService {
@GET("/auth/mini/login/{storeId}")
Future<BaseData> minLogin(@Path("storeId") String storeId);
///
///
@POST("/member/listBill")
Future<BaseData> queryBillInfo(@Body() Map<String, dynamic> param);
@ -239,5 +276,4 @@ abstract class ApiService {
///
@GET("/member/vipDetail/{id}")
Future<BaseData> vipDetail(@Path("id") String id);
}

765
lib/retrofit/retrofit_api.g.dart

@ -1,765 +0,0 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'retrofit_api.dart';
// **************************************************************************
// RetrofitGenerator
// **************************************************************************
class _ApiService implements ApiService {
_ApiService(this._dio, {this.baseUrl}) {
ArgumentError.checkNotNull(_dio, '_dio');
baseUrl ??= 'http://platform.test.api.lotus-wallet.com/app/';
}
final Dio _dio;
String baseUrl;
@override
Future<BaseData> upload(data, folderId) async {
ArgumentError.checkNotNull(data, 'data');
ArgumentError.checkNotNull(folderId, 'folderId');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = FormData();
_data.files.add(MapEntry(
'file',
MultipartFile.fromFileSync(data.path,
filename: data.path.split(Platform.pathSeparator).last)));
if (folderId != null) {
_data.fields.add(MapEntry('folderId', folderId.toString()));
}
final _result = await _dio.request<Map<String, dynamic>>('/file/upload',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<dynamic> searchPoi(lat, lng, keywords, size, page) async {
ArgumentError.checkNotNull(lat, 'lat');
ArgumentError.checkNotNull(lng, 'lng');
ArgumentError.checkNotNull(keywords, 'keywords');
ArgumentError.checkNotNull(size, 'size');
ArgumentError.checkNotNull(page, 'page');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request(
'https://restapi.amap.com/v3/place/around?key=542b46afa8e4b88fe1eb3c4d0ba0872f&location=$lat,$lng&keywords=$keywords&offset={size}&page={page}&extensions=all',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = _result.data;
return value;
}
@override
Future<BaseData> memberLogin(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>(
'/auth/platform/memberLogin',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> sendVerify(mobile) async {
ArgumentError.checkNotNull(mobile, 'mobile');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'/auth/sendVerify/$mobile',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> creditGoods(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>(
'/creditGoods/list',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> creditGoodsById(id) async {
ArgumentError.checkNotNull(id, 'id');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>('/creditGoods/$id',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> queryInfo() async {
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>('/member/info',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> editInfo(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>(
'/member/editMemberInfo',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> signInInfo() async {
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'/member/signInInfo',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> signIn() async {
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>('/member/signIn',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> recharge(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>('/member/recharge',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> receiveCoupon(couponId) async {
ArgumentError.checkNotNull(couponId, 'couponId');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'/coupon/receive?couponId=$couponId',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> creditOrderList(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>(
'/creditOrder/list',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> creditOrder(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>(
'/creditOrder/create',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> addAddress(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>('/address/add',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> deleteAddress(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>('/address/delete',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> queryAddress(id) async {
ArgumentError.checkNotNull(id, 'id');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'/address/detail/$id',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> queryMemberAddress() async {
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'/address/queryMemberAddress',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> updateAddress(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>('/address/update',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> queryCoupon(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>(
'/coupon/centreList',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> queryCard(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>(
'/coupon/packageList',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> queryStore(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>('/store/list',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> informationList(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>(
'/information/list',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> informationInfo(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>(
'/information/{id}',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> creditOrderReceive(id) async {
ArgumentError.checkNotNull(id, 'id');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'/creditOrder/receive/$id',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> queryHome() async {
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>('/home/home',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> queryStoreInfo(id) async {
ArgumentError.checkNotNull(id, 'id');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>('/store/$id',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> queryArticle(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>(
'/information/list',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> queryBanner(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>('/banner/page',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> queryHomeBrand() async {
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>('/home/brand',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> minLogin(storeId) async {
ArgumentError.checkNotNull(storeId, 'storeId');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'/auth/mini/login/$storeId',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> queryBillInfo(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>('/member/listBill',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> rankList() async {
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>('/member/rankList',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> orderList(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>('/order/list',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> orderDetail(id) async {
ArgumentError.checkNotNull(id, 'id');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'/order/orderDetail?id=$id',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> continuePay(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>(
'/order/continuePay',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> receiveToCard(id) async {
ArgumentError.checkNotNull(id, 'id');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'/creditOrder/receive/$id',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> vipList() async {
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>('/member/vipList',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> vipDetail(id) async {
ArgumentError.checkNotNull(id, 'id');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'/member/vipDetail/$id',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
}

10
lib/union/union_details_page.dart

@ -910,6 +910,7 @@ class _UnionDetailsPage extends State<UnionDetailsPage> {
if (!(await Min.isInitialize())) {
await Min.initialize();
}
printMin();
String miniAppId = storeInfo.mini.miniAppId;
String filePath = "";
if (Platform.isAndroid) {
@ -929,6 +930,13 @@ class _UnionDetailsPage extends State<UnionDetailsPage> {
await Min.reloadWgt(miniAppId, filePath);
}
}
//baseURL : 'http://192.168.10.130:8765/app/', //
//baseURL : 'http://192.168.10.236:8766/app/', //
// baseURL : 'https://pos-test.api.lotus-wallet.com/app/', //
// baseURL : 'https://pos.api.lotus-wallet.com/app/', //线
// socketUrl: 'ws://192.168.10.130:9999/cart', //
// socketUrl : 'wss://pos-test.api.lotus-wallet.com:10005/cart', //
// socketUrl : 'wss://pos.api.lotus-wallet.com:10015/cart', //线
SharedPreferences sharedPreferences = await SharedPreferences.getInstance();
String nickname = sharedPreferences.getString("nick");
@ -944,7 +952,7 @@ class _UnionDetailsPage extends State<UnionDetailsPage> {
"tenantCode": storeInfo.tenantCode,
if (latitude != null && longitude != null)
"position": "$latitude,$longitude",
"baseURL": 'https://pos-test.api.lotus-wallet.com/app/',
"baseURL": "http://192.168.10.236:8765/app/",
"uid": userId,
"userInfo": {
"nickname": nickname,

31
lib/union/union_page.dart

@ -10,6 +10,7 @@ import 'package:flutter/foundation.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/main.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
@ -107,7 +108,6 @@ class _UnionPage extends State<UnionPage>
"feaae7986201b571cace1b83728be5bb");
aMapFlutterLocation = AMapFlutterLocation();
aMapFlutterLocation.onLocationChanged().listen((event) {
if (Navigator.canPop(context)) Navigator.of(context).pop();
if (event != null &&
event["latitude"] != null &&
event["longitude"] != null) {
@ -139,7 +139,9 @@ class _UnionPage extends State<UnionPage>
eventBus.on<EventType>().listen((event) {
print("object: UnionPage");
setState(() {});
if (event.type < 3) {
setState(() {});
};
});
}
@ -173,7 +175,7 @@ class _UnionPage extends State<UnionPage>
SharedPreferences.getInstance().then(
(value) => {
apiService = ApiService(Dio(),
context: context, token: value.getString('token')),
context: context, token: value.getString('token'), showLoading: false),
if (value.containsKey("latitude") &&
value.containsKey("longitude") &&
value.containsKey("province") &&
@ -214,7 +216,6 @@ class _UnionPage extends State<UnionPage>
List<Store> storeList;
queryStore(latitude, longitude, province, city, district, searchKey) async {
showLoadingDialog();
BaseData baseData = await apiService.queryStore({
// "city": city,
// "district": district,
@ -225,17 +226,12 @@ class _UnionPage extends State<UnionPage>
}).catchError((error) {
refreshController.refreshFailed();
});
if (Navigator.canPop(context))
Navigator.of(context).pop();
SmartDialog.dismiss();
if (baseData != null && baseData.isSuccess) {
storeList = (baseData.data as List<dynamic>)
.map((e) => Store.fromJson(e))
.toList();
buildMarker();
refreshController.refreshCompleted();
setState(() {});
} else {
@ -271,15 +267,6 @@ class _UnionPage extends State<UnionPage>
setState(() {});
}
showLoadingDialog() {
showCupertinoDialog(
context: context,
barrierDismissible: true,
builder: (context) {
return LoadingView();
});
}
List<Marker> markers = [];
@override
@ -407,8 +394,12 @@ class _UnionPage extends State<UnionPage>
requestDialog();
refreshController.refreshCompleted();
} else if (await Permission.location.isGranted) {
showLoadingDialog();
SmartDialog.showLoading(msg: S.of(context).zhengzaijiazai);
aMapFlutterLocation.startLocation();
Future.delayed(Duration(seconds: 6), () {
SmartDialog.dismiss();
refreshController.refreshCompleted();
});
} else if (await Permission.location.isUndetermined) {
await Permission.location.request();
refreshController.refreshCompleted();

128
lib/view_widget/login_tips.dart

@ -0,0 +1,128 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/view_widget/border_text.dart';
import 'package:huixiang/view_widget/round_button.dart';
import 'package:shared_preferences/shared_preferences.dart';
class LoginTips extends StatelessWidget {
final Function click;
LoginTips({this.click});
@override
Widget build(BuildContext context) {
return WillPopScope(
child: Material(
type: MaterialType.transparency,
child: Center(
child: Container(
width: 0.7867.sw,
padding: EdgeInsets.symmetric(vertical: 20.h, horizontal: 24.w),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
),
child: AspectRatio(
aspectRatio: 0.9,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisSize: MainAxisSize.max,
children: [
Image.asset(
"assets/image/icon_login_tips.png",
width: 0.7867.sw * 0.6,
height: 0.7867.sw * 0.6 * 0.7,
fit: BoxFit.fill,
),
SizedBox(
height: 20.w,
),
Container(
alignment: Alignment.centerLeft,
child: Text(
S.of(context).ninweidenglu,
textAlign: TextAlign.start,
style: TextStyle(
fontSize: 14.sp,
fontWeight: FontWeight.bold,
color: Colors.black,
),
),
),
SizedBox(
height: 3.w,
),
Text(
S.of(context).weilegeiningenghaodefuwu,
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF727272),
),
),
SizedBox(
height: 20.w,
),
Row(
mainAxisSize: MainAxisSize.max,
children: [
Expanded(
child: InkWell(
onTap: () {
SmartDialog.dismiss();
},
child: BorderText(
text: S
.of(context)
.quxiao,
textColor: Color(0xFF32A060),
borderWidth: 1.w,
borderColor: Color(0xFF32A060),
padding: EdgeInsets.all(12.w),
fontSize: 16.sp,
fontWeight: FontWeight.bold,
radius: 4,
),
),
flex: 1,
),
SizedBox(
width: 13.w,
),
Expanded(
child: InkWell(
onTap: () {
click();
SmartDialog.dismiss();
},
child: RoundButton(
text: S.of(context).qudenglu,
textColor: Colors.white,
padding: EdgeInsets.all(12.w),
fontSize: 16.sp,
backgroup: Color(0xFF32A060),
fontWeight: FontWeight.bold,
radius: 4,
),
),
flex: 1,
),
],
),
],
),
),
),
),
), onWillPop: () async {
return Future.value(false);
});
}
}

6
lib/view_widget/store_title_tab.dart

@ -11,11 +11,13 @@ class StoreTitleTab extends StatefulWidget {
final GlobalKey milkTeaGlobalKey;
final GlobalKey breadGlobalKey;
final bool isScroll;
StoreTitleTab(this.brandText,
{this.scrollController,
this.chiliGlobalKey,
this.milkTeaGlobalKey,
this.breadGlobalKey});
this.breadGlobalKey, this.isScroll = false});
@override
State<StatefulWidget> createState() {
@ -95,7 +97,7 @@ class _StoreTitleTab extends State<StoreTitleTab> {
@override
Widget build(BuildContext context) {
return Visibility(
visible: (widget.scrollController == null) ? true : isVisible,
visible: (!widget.isScroll) ? true : isVisible,
child: Container(
width: MediaQuery.of(context).size.width,
child: Container(

289
pubspec.lock

File diff suppressed because it is too large Load Diff

3
pubspec.yaml

@ -26,6 +26,7 @@ dependencies:
sdk: flutter
flutter_localizations:
sdk: flutter
# fluwx: ^3.5.0
barcode_widget: ^2.0.1
cupertino_icons: ^1.0.2
@ -62,10 +63,12 @@ dependencies:
intl: ^0.17.0
shared_preferences: ^2.0.6
fluttertoast: ^8.0.7
flutter_smart_dialog: ^2.1.6
# url_launcher: ^6.0.5
# app_links: ^2.1.0
# crop_image: ^1.0.1
image_cropper: ^1.4.1
image_picker_gallery_camera: ^0.1.6

Loading…
Cancel
Save