Browse Source

Merge branch 'wu_2023_map' into wr_2023_business

# Conflicts:
#	ios/Podfile.lock
#	ios/Runner.xcodeproj/project.pbxproj
#	lib/home/home_page.dart
#	lib/main.dart
#	pubspec.lock
wr_2023_business
wurong 1 year ago
parent
commit
658a548520
  1. 3
      README.md
  2. BIN
      assets/image/2x/icon_by_bike.webp
  3. BIN
      assets/image/2x/icon_drive.webp
  4. BIN
      assets/image/2x/icon_search.webp
  5. BIN
      assets/image/2x/icon_transit.webp
  6. BIN
      assets/image/2x/icon_walk.webp
  7. BIN
      assets/image/2x/position_sort.webp
  8. BIN
      assets/image/3x/icon_by_bike.webp
  9. BIN
      assets/image/3x/icon_drive.webp
  10. BIN
      assets/image/3x/icon_search.webp
  11. BIN
      assets/image/3x/icon_transit.webp
  12. BIN
      assets/image/3x/icon_walk.webp
  13. BIN
      assets/image/3x/position_sort.webp
  14. BIN
      assets/image/icon_by_bike.webp
  15. BIN
      assets/image/icon_drive.webp
  16. BIN
      assets/image/icon_end.png
  17. BIN
      assets/image/icon_search.webp
  18. BIN
      assets/image/icon_start.png
  19. BIN
      assets/image/icon_transit.webp
  20. BIN
      assets/image/icon_walk.webp
  21. BIN
      assets/image/position_sort.webp
  22. BIN
      assets/image/traffic_texture_smooth.png
  23. BIN
      assets/image/traffic_texture_unknown.png
  24. 14
      assets/map_style/chinese_cities.json
  25. 14
      ios/Podfile.lock
  26. 16
      ios/Runner.xcodeproj/project.pbxproj
  27. 6
      ios/Runner/Info.plist
  28. 11
      lib/address/address_map_page.dart
  29. 4
      lib/community/community_details.dart
  30. 5
      lib/generated/intl/messages_en.dart
  31. 5
      lib/generated/intl/messages_en_US.dart
  32. 5
      lib/generated/intl/messages_zh_CN.dart
  33. 5
      lib/generated/intl/messages_zh_Hans_CN.dart
  34. 5
      lib/generated/intl/messages_zh_Hant_CN.dart
  35. 5
      lib/generated/intl/messages_zh_TW.dart
  36. 50
      lib/generated/l10n.dart
  37. 813
      lib/home/home_page.dart
  38. 2
      lib/home/huixiang_brand_page.dart
  39. 2
      lib/home/points_mall_page.dart
  40. 2
      lib/home/welfare_exchange.dart
  41. 774
      lib/home/welfare_page.dart
  42. 46
      lib/integral/integral_page.dart
  43. 56
      lib/integral/intergra_view/integral_task.dart
  44. 5
      lib/l10n/intl_en.arb
  45. 5
      lib/l10n/intl_en_US.arb
  46. 5
      lib/l10n/intl_zh_CN.arb
  47. 5
      lib/l10n/intl_zh_Hans_CN.arb
  48. 5
      lib/l10n/intl_zh_Hant_CN.arb
  49. 5
      lib/l10n/intl_zh_TW.arb
  50. 552
      lib/login/captcha/block_puzzle_captcha.dart
  51. 367
      lib/login/captcha/click_word_captcha.dart
  52. 219
      lib/login/login_page.dart
  53. 90
      lib/login/new_login_page.dart
  54. 6
      lib/main.dart
  55. 110
      lib/mine/mine_page.dart
  56. 6
      lib/mine/mine_shop_details.dart
  57. 233
      lib/mine/mine_shop_page.dart
  58. 908
      lib/mine/mine_shop_recharge.dart
  59. 74
      lib/mine/mine_view/mine_item.dart
  60. 24
      lib/mine/mine_view/mine_navbar.dart
  61. 99
      lib/mine/mine_view/mine_view.dart
  62. 326
      lib/mine/mine_vip/mine_attainment_page.dart
  63. 922
      lib/mine/recharge_page.dart
  64. 2
      lib/mine/scan_web.dart
  65. 2
      lib/order/order_detail_page.dart
  66. 354
      lib/order/order_history_page.dart
  67. 105
      lib/retrofit/data/ip_data.dart
  68. 159
      lib/retrofit/data/member_recharge_list.dart
  69. 749
      lib/retrofit/data/product_show.dart
  70. 160
      lib/retrofit/data/store.dart
  71. 16
      lib/retrofit/min_api.dart
  72. 45
      lib/retrofit/min_api.g.dart
  73. 119
      lib/retrofit/retrofit_api.dart
  74. 161
      lib/retrofit/retrofit_api.g.dart
  75. 2
      lib/setting/account_security_page.dart
  76. 61
      lib/setting/binding_phone_page.dart
  77. 42
      lib/setting/logout_ing.dart
  78. 23
      lib/setting/platform_code_page.dart
  79. 2
      lib/setting/setting_page.dart
  80. 2
      lib/setting/treaty_page.dart
  81. 2
      lib/setting/user_service_page.dart
  82. 18
      lib/settlement/settlement.dart
  83. 4
      lib/settlement/settlement_view/pay_method.dart
  84. 4
      lib/store/shop_details_page.dart
  85. 2
      lib/store/shopping/activity_prefecture_details.dart
  86. 2
      lib/store/shopping/shopping_goods_details.dart
  87. 2
      lib/store/shopping/shopping_mall_home.dart
  88. 51
      lib/store/store_order.dart
  89. 4
      lib/store/store_view/product_sku.dart
  90. 12
      lib/store/store_view/shop_goods.dart
  91. 2
      lib/store/store_view/store_header.dart
  92. 55
      lib/store/store_view/store_info.dart
  93. 1158
      lib/union/location_map_page.dart
  94. 687
      lib/union/union_list.dart
  95. 1038
      lib/union/union_page.dart
  96. 372
      lib/union/union_select_city.dart
  97. 86
      lib/utils/captcha_util.dart
  98. 11
      lib/utils/flutter_utils.dart
  99. 217
      lib/utils/location.dart
  100. 133
      lib/utils/widget_util.dart
  101. Some files were not shown because too many files have changed in this diff Show More

3
README.md

@ -84,6 +84,9 @@ samples, guidance on mobile development, and a full API reference.
小米开放平台 83364300@qq.com 具体问 :(汪姐) 小米开放平台 83364300@qq.com 具体问 :(汪姐)
推送:使用腾讯云推送 tpns 需扫码登录 (有问题同华为➕微信||或重新注册账号替换相关appKey) 推送:使用腾讯云推送 tpns 需扫码登录 (有问题同华为➕微信||或重新注册账号替换相关appKey)
友盟: wu_rong 密码:Zxc09876
https://pos.platform.lotus-wallet.com/app/ 生产环境 https://pos.platform.lotus-wallet.com/app/ 生产环境
http://192.168.10.236:8765/app/ 测试环境 http://192.168.10.236:8765/app/ 测试环境

BIN
assets/image/2x/icon_by_bike.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 812 B

BIN
assets/image/2x/icon_drive.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 736 B

BIN
assets/image/2x/icon_search.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

BIN
assets/image/2x/icon_transit.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 840 B

BIN
assets/image/2x/icon_walk.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 824 B

BIN
assets/image/2x/position_sort.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 596 B

BIN
assets/image/3x/icon_by_bike.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
assets/image/3x/icon_drive.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1016 B

BIN
assets/image/3x/icon_search.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
assets/image/3x/icon_transit.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
assets/image/3x/icon_walk.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
assets/image/3x/position_sort.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 666 B

BIN
assets/image/icon_by_bike.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 672 B

BIN
assets/image/icon_drive.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 622 B

BIN
assets/image/icon_end.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

BIN
assets/image/icon_search.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 724 B

BIN
assets/image/icon_start.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

BIN
assets/image/icon_transit.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 624 B

BIN
assets/image/icon_walk.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 666 B

BIN
assets/image/position_sort.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 574 B

BIN
assets/image/traffic_texture_smooth.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 980 B

BIN
assets/image/traffic_texture_unknown.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 888 B

14
assets/map_style/chinese_cities.json

@ -0,0 +1,14 @@
{
"热门城市": [
{"area": "武汉"},
{"area": "北京"},
{ "area": "郑州" }
],
"B": [
{ "area": "北京" }
],
"W": [{ "area": "武汉" }],
"Z": [
{ "area": "郑州" }
]
}

14
ios/Podfile.lock

@ -49,8 +49,7 @@ PODS:
- image_pickers (0.0.1): - image_pickers (0.0.1):
- AFNetworking - AFNetworking
- Flutter - Flutter
- SDWebImage - ZLPhotoBrowser-objc (= 1.0.4)
- ZLPhotoBrowser (~> 4.3.9)
- mob_sharesdk (4.4.15): - mob_sharesdk (4.4.15):
- mob_sharesdk/ShareSDK (= 4.4.15) - mob_sharesdk/ShareSDK (= 4.4.15)
- MOBFoundation (>= 3.2.9) - MOBFoundation (>= 3.2.9)
@ -240,9 +239,8 @@ PODS:
- Flutter - Flutter
- webview_flutter (0.0.1): - webview_flutter (0.0.1):
- Flutter - Flutter
- ZLPhotoBrowser (4.3.9): - ZLPhotoBrowser-objc (1.0.4):
- ZLPhotoBrowser/Core (= 4.3.9) - SDWebImage
- ZLPhotoBrowser/Core (4.3.9)
DEPENDENCIES: DEPENDENCIES:
- emoji_picker_flutter (from `.symlinks/plugins/emoji_picker_flutter/ios`) - emoji_picker_flutter (from `.symlinks/plugins/emoji_picker_flutter/ios`)
@ -283,7 +281,7 @@ SPEC REPOS:
- TPNS-iOS - TPNS-iOS
- UMCommon - UMCommon
- UMDevice - UMDevice
- ZLPhotoBrowser - ZLPhotoBrowser-objc
EXTERNAL SOURCES: EXTERNAL SOURCES:
emoji_picker_flutter: emoji_picker_flutter:
@ -347,7 +345,7 @@ SPEC CHECKSUMS:
flutter_baidu_mapapi_utils: f6a5d23da26b0e58f1ae9908da7ba87fd48384b1 flutter_baidu_mapapi_utils: f6a5d23da26b0e58f1ae9908da7ba87fd48384b1
flutter_bmflocation: 1bd73181196567fe1529f765aa4f8e2615a8a3cf flutter_bmflocation: 1bd73181196567fe1529f765aa4f8e2615a8a3cf
fluwx: 838466d89c1ba099f6eec36c514801658371cda5 fluwx: 838466d89c1ba099f6eec36c514801658371cda5
image_pickers: 4406949954a5eb4fac5ada5f13810e6419ef4467 image_pickers: 25c8916d358bc9d2707cb470ba3d57497f105773
mob_sharesdk: 0698d60b3c1549a5b0bcfdec6f407439dd2960c0 mob_sharesdk: 0698d60b3c1549a5b0bcfdec6f407439dd2960c0
MOBFoundation: 6df2684b4db4f0f5bd71b0623f82e11271bf7ac8 MOBFoundation: 6df2684b4db4f0f5bd71b0623f82e11271bf7ac8
number_precision: 26fa2be2212f9d1429f92d667d6b0aa4df0058d8 number_precision: 26fa2be2212f9d1429f92d667d6b0aa4df0058d8
@ -370,7 +368,7 @@ SPEC CHECKSUMS:
video_player_avfoundation: 6d971a232d72e6ee25368378d48a079dea01f1cf video_player_avfoundation: 6d971a232d72e6ee25368378d48a079dea01f1cf
wakelock: d0fc7c864128eac40eba1617cb5264d9c940b46f wakelock: d0fc7c864128eac40eba1617cb5264d9c940b46f
webview_flutter: 5fb4def2bbd4339889ee14d045b605cefc5bc232 webview_flutter: 5fb4def2bbd4339889ee14d045b605cefc5bc232
ZLPhotoBrowser: 02b3569b8f702d2e153e8fdb1f6b32fef3a2867c ZLPhotoBrowser-objc: c7657d3bc85ae231884e058d0e3638f619164736
PODFILE CHECKSUM: f8bac8842dd5d4f36a3709c129ae7a2ccd5be619 PODFILE CHECKSUM: f8bac8842dd5d4f36a3709c129ae7a2ccd5be619

16
ios/Runner.xcodeproj/project.pbxproj

@ -617,7 +617,7 @@
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO; CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 2; CURRENT_PROJECT_VERSION = 14;
DEVELOPMENT_TEAM = YF3Q8DVP52; DEVELOPMENT_TEAM = YF3Q8DVP52;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
@ -625,7 +625,6 @@
"$(PROJECT_DIR)/UniMPSDK/Libs", "$(PROJECT_DIR)/UniMPSDK/Libs",
); );
GCC_INPUT_FILETYPE = automatic; GCC_INPUT_FILETYPE = automatic;
GCC_NO_COMMON_BLOCKS = YES;
GCC_PREPROCESSOR_DEFINITIONS = ( GCC_PREPROCESSOR_DEFINITIONS = (
"$(inherited)", "$(inherited)",
"COCOAPODS=1", "COCOAPODS=1",
@ -668,7 +667,7 @@
"$(PROJECT_DIR)/baidu", "$(PROJECT_DIR)/baidu",
"$(PROJECT_DIR)/Runner/baidu", "$(PROJECT_DIR)/Runner/baidu",
); );
MARKETING_VERSION = 3.2.19; MARKETING_VERSION = 3.2.20;
ONLY_ACTIVE_ARCH = YES; ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = ( OTHER_LDFLAGS = (
"$(inherited)", "$(inherited)",
@ -820,16 +819,14 @@
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO; CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 2; CURRENT_PROJECT_VERSION = 14;
DEVELOPMENT_TEAM = YF3Q8DVP52; DEVELOPMENT_TEAM = YF3Q8DVP52;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
ENABLE_TESTABILITY = YES;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"$(PROJECT_DIR)/UniMPSDK/Libs", "$(PROJECT_DIR)/UniMPSDK/Libs",
); );
GCC_INPUT_FILETYPE = automatic; GCC_INPUT_FILETYPE = automatic;
GCC_NO_COMMON_BLOCKS = YES;
GCC_PREPROCESSOR_DEFINITIONS = ( GCC_PREPROCESSOR_DEFINITIONS = (
"$(inherited)", "$(inherited)",
"COCOAPODS=1", "COCOAPODS=1",
@ -872,7 +869,7 @@
"$(PROJECT_DIR)/baidu", "$(PROJECT_DIR)/baidu",
"$(PROJECT_DIR)/Runner/baidu", "$(PROJECT_DIR)/Runner/baidu",
); );
MARKETING_VERSION = 3.2.19; MARKETING_VERSION = 3.2.20;
ONLY_ACTIVE_ARCH = YES; ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = ( OTHER_LDFLAGS = (
"$(inherited)", "$(inherited)",
@ -915,7 +912,7 @@
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO; CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 2; CURRENT_PROJECT_VERSION = 14;
DEVELOPMENT_TEAM = YF3Q8DVP52; DEVELOPMENT_TEAM = YF3Q8DVP52;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
@ -923,7 +920,6 @@
"$(PROJECT_DIR)/UniMPSDK/Libs", "$(PROJECT_DIR)/UniMPSDK/Libs",
); );
GCC_INPUT_FILETYPE = automatic; GCC_INPUT_FILETYPE = automatic;
GCC_NO_COMMON_BLOCKS = YES;
GCC_PREPROCESSOR_DEFINITIONS = ( GCC_PREPROCESSOR_DEFINITIONS = (
"$(inherited)", "$(inherited)",
"COCOAPODS=1", "COCOAPODS=1",
@ -966,7 +962,7 @@
"$(PROJECT_DIR)/baidu", "$(PROJECT_DIR)/baidu",
"$(PROJECT_DIR)/Runner/baidu", "$(PROJECT_DIR)/Runner/baidu",
); );
MARKETING_VERSION = 3.2.19; MARKETING_VERSION = 3.2.20;
ONLY_ACTIVE_ARCH = YES; ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = ( OTHER_LDFLAGS = (
"$(inherited)", "$(inherited)",

6
ios/Runner/Info.plist

@ -177,5 +177,11 @@
<array> <array>
<string>location</string> <string>location</string>
</array> </array>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>iosamap</string>
<string>qqmap</string>
<string>baidumap</string>
</array>
</dict> </dict>
</plist> </plist>

11
lib/address/address_map_page.dart

@ -80,6 +80,9 @@ class _AddressMapPage extends State<AddressMapPage> {
BMFMapOptions( BMFMapOptions(
center: latLng, center: latLng,
zoomLevel: 15, zoomLevel: 15,
showZoomControl: false,
showMapScaleBar: false,
rotateEnabled: false,
), ),
); );
} }
@ -339,6 +342,9 @@ class _AddressMapPage extends State<AddressMapPage> {
double.tryParse(value.getString("longitude")), double.tryParse(value.getString("longitude")),
), ),
zoomLevel: 15, zoomLevel: 15,
showZoomControl: false,
showMapScaleBar: false,
rotateEnabled: false,
), ),
); );
} }
@ -362,7 +368,10 @@ class _AddressMapPage extends State<AddressMapPage> {
child: BMFMapWidget( child: BMFMapWidget(
mapOptions: BMFMapOptions( mapOptions: BMFMapOptions(
center: BMFCoordinate(30.553111, 114.342366), center: BMFCoordinate(30.553111, 114.342366),
zoomLevel: 12, zoomLevel: 15,
showZoomControl: false,
showMapScaleBar: false,
rotateEnabled: false,
), ),
onBMFMapCreated: onMapCreated, onBMFMapCreated: onMapCreated,
// onCameraMoveEnd: (cameraPosition) { // onCameraMoveEnd: (cameraPosition) {

4
lib/community/community_details.dart

@ -100,7 +100,7 @@ class _CommunityDetails extends State<CommunityDetails>
void initState() { void initState() {
super.initState(); super.initState();
// comunity = widget.arguments["comment"]; // comunity = widget.arguments["comment"];
EasyLoading.show(status: S.current.zhengzaijiazai); EasyLoading.show(status: S.current.zhengzaijiazai,maskType: EasyLoadingMaskType.black);
businessId = widget.arguments["businessId"]; businessId = widget.arguments["businessId"];
WidgetsBinding.instance.addObserver(this); WidgetsBinding.instance.addObserver(this);
commentFocus.addListener(_focusNodeListener); commentFocus.addListener(_focusNodeListener);
@ -399,7 +399,7 @@ class _CommunityDetails extends State<CommunityDetails>
/// ///
_queryMemberCommentList(bool isOnRefresh) async { _queryMemberCommentList(bool isOnRefresh) async {
if (!isOnRefresh) EasyLoading.show(status: S.current.zhengzaijiazai); if (!isOnRefresh) EasyLoading.show(status: S.current.zhengzaijiazai,maskType: EasyLoadingMaskType.black);
SharedPreferences sharedPreferences = await SharedPreferences.getInstance(); SharedPreferences sharedPreferences = await SharedPreferences.getInstance();
if (apiService == null) if (apiService == null)
apiService = ApiService( apiService = ApiService(

5
lib/generated/intl/messages_en.dart

@ -193,6 +193,7 @@ class MessageLookup extends MessageLookupByLibrary {
"dianhua" : MessageLookupByLibrary.simpleMessage("电话"), "dianhua" : MessageLookupByLibrary.simpleMessage("电话"),
"dianjidenglu" : MessageLookupByLibrary.simpleMessage("点击登录,享受更多精彩信息"), "dianjidenglu" : MessageLookupByLibrary.simpleMessage("点击登录,享受更多精彩信息"),
"dianneiyongcan" : MessageLookupByLibrary.simpleMessage("店内用餐"), "dianneiyongcan" : MessageLookupByLibrary.simpleMessage("店内用餐"),
"dianpuchongzhi" : MessageLookupByLibrary.simpleMessage("店铺充值"),
"dianputuijian" : MessageLookupByLibrary.simpleMessage("店铺推荐"), "dianputuijian" : MessageLookupByLibrary.simpleMessage("店铺推荐"),
"dianpuyue" : MessageLookupByLibrary.simpleMessage("店铺余额"), "dianpuyue" : MessageLookupByLibrary.simpleMessage("店铺余额"),
"dianwolingqu" : MessageLookupByLibrary.simpleMessage("点我领取"), "dianwolingqu" : MessageLookupByLibrary.simpleMessage("点我领取"),
@ -309,6 +310,7 @@ class MessageLookup extends MessageLookupByLibrary {
"huiyuanjifen" : MessageLookupByLibrary.simpleMessage("会员积分"), "huiyuanjifen" : MessageLookupByLibrary.simpleMessage("会员积分"),
"huiyuanka" : MessageLookupByLibrary.simpleMessage("会员卡"), "huiyuanka" : MessageLookupByLibrary.simpleMessage("会员卡"),
"huiyuankaxiangqing" : MessageLookupByLibrary.simpleMessage("会员卡详情"), "huiyuankaxiangqing" : MessageLookupByLibrary.simpleMessage("会员卡详情"),
"huiyuanma" : MessageLookupByLibrary.simpleMessage("会员码"),
"huiyuanquanyi" : MessageLookupByLibrary.simpleMessage("会员权益"), "huiyuanquanyi" : MessageLookupByLibrary.simpleMessage("会员权益"),
"huiyuanyue" : MessageLookupByLibrary.simpleMessage("会员余额"), "huiyuanyue" : MessageLookupByLibrary.simpleMessage("会员余额"),
"huiyuanzhongxin" : MessageLookupByLibrary.simpleMessage("会员中心"), "huiyuanzhongxin" : MessageLookupByLibrary.simpleMessage("会员中心"),
@ -468,6 +470,7 @@ class MessageLookup extends MessageLookupByLibrary {
"privacy_policy2" : MessageLookupByLibrary.simpleMessage("《一心回乡服务协议》"), "privacy_policy2" : MessageLookupByLibrary.simpleMessage("《一心回乡服务协议》"),
"privacy_policy3" : MessageLookupByLibrary.simpleMessage("《隐私服务》"), "privacy_policy3" : MessageLookupByLibrary.simpleMessage("《隐私服务》"),
"privacy_policy4" : MessageLookupByLibrary.simpleMessage("并使用本机号码登录"), "privacy_policy4" : MessageLookupByLibrary.simpleMessage("并使用本机号码登录"),
"qianbao" : MessageLookupByLibrary.simpleMessage("钱包"),
"qiandao" : MessageLookupByLibrary.simpleMessage("签到"), "qiandao" : MessageLookupByLibrary.simpleMessage("签到"),
"qiandaodejifen" : MessageLookupByLibrary.simpleMessage("签到得积分"), "qiandaodejifen" : MessageLookupByLibrary.simpleMessage("签到得积分"),
"qiandaolingjifen" : MessageLookupByLibrary.simpleMessage("签到领积分"), "qiandaolingjifen" : MessageLookupByLibrary.simpleMessage("签到领积分"),
@ -740,6 +743,7 @@ class MessageLookup extends MessageLookupByLibrary {
"yinsixieyi" : MessageLookupByLibrary.simpleMessage("《隐私协议》"), "yinsixieyi" : MessageLookupByLibrary.simpleMessage("《隐私协议》"),
"yinsizhengce1" : MessageLookupByLibrary.simpleMessage(" 感谢您使用一心回乡APP。我们非常重视您的个人信息和隐私保护。为了更好地保证您的个人权益,在您使用我们的产品前,请务必仔细阅读一心回乡"), "yinsizhengce1" : MessageLookupByLibrary.simpleMessage(" 感谢您使用一心回乡APP。我们非常重视您的个人信息和隐私保护。为了更好地保证您的个人权益,在您使用我们的产品前,请务必仔细阅读一心回乡"),
"yinsizhengce2" : MessageLookupByLibrary.simpleMessage("     在您同意后,我们才会根据您的使用需求,收集部分可能涉及的数据(地理位置、相机、存储等信息)。"), "yinsizhengce2" : MessageLookupByLibrary.simpleMessage("     在您同意后,我们才会根据您的使用需求,收集部分可能涉及的数据(地理位置、相机、存储等信息)。"),
"yinzhang" : MessageLookupByLibrary.simpleMessage("印章"),
"yiqiandao" : MessageLookupByLibrary.simpleMessage("已签到"), "yiqiandao" : MessageLookupByLibrary.simpleMessage("已签到"),
"yiqianshou" : MessageLookupByLibrary.simpleMessage("已签收"), "yiqianshou" : MessageLookupByLibrary.simpleMessage("已签收"),
"yiquxiao" : MessageLookupByLibrary.simpleMessage(" 已取消 "), "yiquxiao" : MessageLookupByLibrary.simpleMessage(" 已取消 "),
@ -812,6 +816,7 @@ class MessageLookup extends MessageLookupByLibrary {
"zhunongjifen" : MessageLookupByLibrary.simpleMessage("助农积分"), "zhunongjifen" : MessageLookupByLibrary.simpleMessage("助农积分"),
"zhunongzhuanqu" : MessageLookupByLibrary.simpleMessage("助农专区"), "zhunongzhuanqu" : MessageLookupByLibrary.simpleMessage("助农专区"),
"zhuxiaotixing" : MessageLookupByLibrary.simpleMessage("再次提醒:注销帐号后不可恢复,相关数据和信息会永久删除。"), "zhuxiaotixing" : MessageLookupByLibrary.simpleMessage("再次提醒:注销帐号后不可恢复,相关数据和信息会永久删除。"),
"zhuxiaozhanghao" : MessageLookupByLibrary.simpleMessage("注销账号"),
"ziqu" : MessageLookupByLibrary.simpleMessage("自取"), "ziqu" : MessageLookupByLibrary.simpleMessage("自取"),
"ziti" : MessageLookupByLibrary.simpleMessage("自提"), "ziti" : MessageLookupByLibrary.simpleMessage("自提"),
"zitidizhi" : MessageLookupByLibrary.simpleMessage("自提地址"), "zitidizhi" : MessageLookupByLibrary.simpleMessage("自提地址"),

5
lib/generated/intl/messages_en_US.dart

@ -193,6 +193,7 @@ class MessageLookup extends MessageLookupByLibrary {
"dianhua" : MessageLookupByLibrary.simpleMessage("Telephone"), "dianhua" : MessageLookupByLibrary.simpleMessage("Telephone"),
"dianjidenglu" : MessageLookupByLibrary.simpleMessage("Click login to enjoy more wonderful information"), "dianjidenglu" : MessageLookupByLibrary.simpleMessage("Click login to enjoy more wonderful information"),
"dianneiyongcan" : MessageLookupByLibrary.simpleMessage("store dining"), "dianneiyongcan" : MessageLookupByLibrary.simpleMessage("store dining"),
"dianpuchongzhi" : MessageLookupByLibrary.simpleMessage("Recharge"),
"dianputuijian" : MessageLookupByLibrary.simpleMessage("Store recommendation"), "dianputuijian" : MessageLookupByLibrary.simpleMessage("Store recommendation"),
"dianpuyue" : MessageLookupByLibrary.simpleMessage("Shop balance"), "dianpuyue" : MessageLookupByLibrary.simpleMessage("Shop balance"),
"dianwolingqu" : MessageLookupByLibrary.simpleMessage("Click me to get it"), "dianwolingqu" : MessageLookupByLibrary.simpleMessage("Click me to get it"),
@ -309,6 +310,7 @@ class MessageLookup extends MessageLookupByLibrary {
"huiyuanjifen" : MessageLookupByLibrary.simpleMessage("Member Points"), "huiyuanjifen" : MessageLookupByLibrary.simpleMessage("Member Points"),
"huiyuanka" : MessageLookupByLibrary.simpleMessage("Membership Card"), "huiyuanka" : MessageLookupByLibrary.simpleMessage("Membership Card"),
"huiyuankaxiangqing" : MessageLookupByLibrary.simpleMessage("Membership card details"), "huiyuankaxiangqing" : MessageLookupByLibrary.simpleMessage("Membership card details"),
"huiyuanma" : MessageLookupByLibrary.simpleMessage("vipCode"),
"huiyuanquanyi" : MessageLookupByLibrary.simpleMessage("Membership Rights"), "huiyuanquanyi" : MessageLookupByLibrary.simpleMessage("Membership Rights"),
"huiyuanyue" : MessageLookupByLibrary.simpleMessage("Member Balance"), "huiyuanyue" : MessageLookupByLibrary.simpleMessage("Member Balance"),
"huiyuanzhongxin" : MessageLookupByLibrary.simpleMessage("Member Center"), "huiyuanzhongxin" : MessageLookupByLibrary.simpleMessage("Member Center"),
@ -468,6 +470,7 @@ class MessageLookup extends MessageLookupByLibrary {
"privacy_policy2" : MessageLookupByLibrary.simpleMessage("《Service Agreement for Returning Home with One Heart》"), "privacy_policy2" : MessageLookupByLibrary.simpleMessage("《Service Agreement for Returning Home with One Heart》"),
"privacy_policy3" : MessageLookupByLibrary.simpleMessage("《privacy Services》"), "privacy_policy3" : MessageLookupByLibrary.simpleMessage("《privacy Services》"),
"privacy_policy4" : MessageLookupByLibrary.simpleMessage("Log in with your own number"), "privacy_policy4" : MessageLookupByLibrary.simpleMessage("Log in with your own number"),
"qianbao" : MessageLookupByLibrary.simpleMessage("Wallet"),
"qiandao" : MessageLookupByLibrary.simpleMessage("Sign in"), "qiandao" : MessageLookupByLibrary.simpleMessage("Sign in"),
"qiandaodejifen" : MessageLookupByLibrary.simpleMessage("Sign in and get points"), "qiandaodejifen" : MessageLookupByLibrary.simpleMessage("Sign in and get points"),
"qiandaolingjifen" : MessageLookupByLibrary.simpleMessage("Sign in to receive points"), "qiandaolingjifen" : MessageLookupByLibrary.simpleMessage("Sign in to receive points"),
@ -740,6 +743,7 @@ class MessageLookup extends MessageLookupByLibrary {
"yinsixieyi" : MessageLookupByLibrary.simpleMessage("《Privacy Agreement》"), "yinsixieyi" : MessageLookupByLibrary.simpleMessage("《Privacy Agreement》"),
"yinsizhengce1" : MessageLookupByLibrary.simpleMessage(" Thank you for using the Home bound APP. We attach great importance to your personal information and privacy protection. In order to better ensure your personal rights and interests, before you use our products, please carefully read"), "yinsizhengce1" : MessageLookupByLibrary.simpleMessage(" Thank you for using the Home bound APP. We attach great importance to your personal information and privacy protection. In order to better ensure your personal rights and interests, before you use our products, please carefully read"),
"yinsizhengce2" : MessageLookupByLibrary.simpleMessage("     With your consent, we will collect some possible data (geographic location, camera, storage and other information) according to your use needs。"), "yinsizhengce2" : MessageLookupByLibrary.simpleMessage("     With your consent, we will collect some possible data (geographic location, camera, storage and other information) according to your use needs。"),
"yinzhang" : MessageLookupByLibrary.simpleMessage("Seal"),
"yiqiandao" : MessageLookupByLibrary.simpleMessage("Signed in"), "yiqiandao" : MessageLookupByLibrary.simpleMessage("Signed in"),
"yiqianshou" : MessageLookupByLibrary.simpleMessage("Signed in"), "yiqianshou" : MessageLookupByLibrary.simpleMessage("Signed in"),
"yiquxiao" : MessageLookupByLibrary.simpleMessage(" Canceled "), "yiquxiao" : MessageLookupByLibrary.simpleMessage(" Canceled "),
@ -812,6 +816,7 @@ class MessageLookup extends MessageLookupByLibrary {
"zhunongjifen" : MessageLookupByLibrary.simpleMessage("Farming aid points"), "zhunongjifen" : MessageLookupByLibrary.simpleMessage("Farming aid points"),
"zhunongzhuanqu" : MessageLookupByLibrary.simpleMessage("Special Area for Agricultural Aid"), "zhunongzhuanqu" : MessageLookupByLibrary.simpleMessage("Special Area for Agricultural Aid"),
"zhuxiaotixing" : MessageLookupByLibrary.simpleMessage("Reminder again: After the account is logged off, it cannot be recovered, and relevant data and information will be permanently deleted。"), "zhuxiaotixing" : MessageLookupByLibrary.simpleMessage("Reminder again: After the account is logged off, it cannot be recovered, and relevant data and information will be permanently deleted。"),
"zhuxiaozhanghao" : MessageLookupByLibrary.simpleMessage("Account cancellation"),
"ziqu" : MessageLookupByLibrary.simpleMessage("self fetching"), "ziqu" : MessageLookupByLibrary.simpleMessage("self fetching"),
"ziti" : MessageLookupByLibrary.simpleMessage("Self mention"), "ziti" : MessageLookupByLibrary.simpleMessage("Self mention"),
"zitidizhi" : MessageLookupByLibrary.simpleMessage("Self lifting address"), "zitidizhi" : MessageLookupByLibrary.simpleMessage("Self lifting address"),

5
lib/generated/intl/messages_zh_CN.dart

@ -193,6 +193,7 @@ class MessageLookup extends MessageLookupByLibrary {
"dianhua" : MessageLookupByLibrary.simpleMessage("电话"), "dianhua" : MessageLookupByLibrary.simpleMessage("电话"),
"dianjidenglu" : MessageLookupByLibrary.simpleMessage("点击登录,享受更多精彩信息"), "dianjidenglu" : MessageLookupByLibrary.simpleMessage("点击登录,享受更多精彩信息"),
"dianneiyongcan" : MessageLookupByLibrary.simpleMessage("店内用餐"), "dianneiyongcan" : MessageLookupByLibrary.simpleMessage("店内用餐"),
"dianpuchongzhi" : MessageLookupByLibrary.simpleMessage("店铺充值"),
"dianputuijian" : MessageLookupByLibrary.simpleMessage("店铺推荐"), "dianputuijian" : MessageLookupByLibrary.simpleMessage("店铺推荐"),
"dianpuyue" : MessageLookupByLibrary.simpleMessage("店铺余额"), "dianpuyue" : MessageLookupByLibrary.simpleMessage("店铺余额"),
"dianwolingqu" : MessageLookupByLibrary.simpleMessage("点我领取"), "dianwolingqu" : MessageLookupByLibrary.simpleMessage("点我领取"),
@ -309,6 +310,7 @@ class MessageLookup extends MessageLookupByLibrary {
"huiyuanjifen" : MessageLookupByLibrary.simpleMessage("会员积分"), "huiyuanjifen" : MessageLookupByLibrary.simpleMessage("会员积分"),
"huiyuanka" : MessageLookupByLibrary.simpleMessage("会员卡"), "huiyuanka" : MessageLookupByLibrary.simpleMessage("会员卡"),
"huiyuankaxiangqing" : MessageLookupByLibrary.simpleMessage("会员卡详情"), "huiyuankaxiangqing" : MessageLookupByLibrary.simpleMessage("会员卡详情"),
"huiyuanma" : MessageLookupByLibrary.simpleMessage("会员码"),
"huiyuanquanyi" : MessageLookupByLibrary.simpleMessage("会员权益"), "huiyuanquanyi" : MessageLookupByLibrary.simpleMessage("会员权益"),
"huiyuanyue" : MessageLookupByLibrary.simpleMessage("会员余额"), "huiyuanyue" : MessageLookupByLibrary.simpleMessage("会员余额"),
"huiyuanzhongxin" : MessageLookupByLibrary.simpleMessage("会员中心"), "huiyuanzhongxin" : MessageLookupByLibrary.simpleMessage("会员中心"),
@ -468,6 +470,7 @@ class MessageLookup extends MessageLookupByLibrary {
"privacy_policy2" : MessageLookupByLibrary.simpleMessage("《一心回乡服务协议》"), "privacy_policy2" : MessageLookupByLibrary.simpleMessage("《一心回乡服务协议》"),
"privacy_policy3" : MessageLookupByLibrary.simpleMessage("《隐私服务》"), "privacy_policy3" : MessageLookupByLibrary.simpleMessage("《隐私服务》"),
"privacy_policy4" : MessageLookupByLibrary.simpleMessage("并使用本机号码登录"), "privacy_policy4" : MessageLookupByLibrary.simpleMessage("并使用本机号码登录"),
"qianbao" : MessageLookupByLibrary.simpleMessage("钱包"),
"qiandao" : MessageLookupByLibrary.simpleMessage("签到"), "qiandao" : MessageLookupByLibrary.simpleMessage("签到"),
"qiandaodejifen" : MessageLookupByLibrary.simpleMessage("签到得积分"), "qiandaodejifen" : MessageLookupByLibrary.simpleMessage("签到得积分"),
"qiandaolingjifen" : MessageLookupByLibrary.simpleMessage("签到领积分"), "qiandaolingjifen" : MessageLookupByLibrary.simpleMessage("签到领积分"),
@ -740,6 +743,7 @@ class MessageLookup extends MessageLookupByLibrary {
"yinsixieyi" : MessageLookupByLibrary.simpleMessage("《隐私协议》"), "yinsixieyi" : MessageLookupByLibrary.simpleMessage("《隐私协议》"),
"yinsizhengce1" : MessageLookupByLibrary.simpleMessage(" 感谢您使用一心回乡APP。我们非常重视您的个人信息和隐私保护。为了更好地保证您的个人权益,在您使用我们的产品前,请务必仔细阅读一心回乡"), "yinsizhengce1" : MessageLookupByLibrary.simpleMessage(" 感谢您使用一心回乡APP。我们非常重视您的个人信息和隐私保护。为了更好地保证您的个人权益,在您使用我们的产品前,请务必仔细阅读一心回乡"),
"yinsizhengce2" : MessageLookupByLibrary.simpleMessage("     在您同意后,我们才会根据您的使用需求,收集部分可能涉及的数据(地理位置、相机、存储等信息)。"), "yinsizhengce2" : MessageLookupByLibrary.simpleMessage("     在您同意后,我们才会根据您的使用需求,收集部分可能涉及的数据(地理位置、相机、存储等信息)。"),
"yinzhang" : MessageLookupByLibrary.simpleMessage("印章"),
"yiqiandao" : MessageLookupByLibrary.simpleMessage("已签到"), "yiqiandao" : MessageLookupByLibrary.simpleMessage("已签到"),
"yiqianshou" : MessageLookupByLibrary.simpleMessage("已签收"), "yiqianshou" : MessageLookupByLibrary.simpleMessage("已签收"),
"yiquxiao" : MessageLookupByLibrary.simpleMessage(" 已取消 "), "yiquxiao" : MessageLookupByLibrary.simpleMessage(" 已取消 "),
@ -812,6 +816,7 @@ class MessageLookup extends MessageLookupByLibrary {
"zhunongjifen" : MessageLookupByLibrary.simpleMessage("助农积分"), "zhunongjifen" : MessageLookupByLibrary.simpleMessage("助农积分"),
"zhunongzhuanqu" : MessageLookupByLibrary.simpleMessage("助农专区"), "zhunongzhuanqu" : MessageLookupByLibrary.simpleMessage("助农专区"),
"zhuxiaotixing" : MessageLookupByLibrary.simpleMessage("再次提醒:注销帐号后不可恢复,相关数据和信息会永久删除。"), "zhuxiaotixing" : MessageLookupByLibrary.simpleMessage("再次提醒:注销帐号后不可恢复,相关数据和信息会永久删除。"),
"zhuxiaozhanghao" : MessageLookupByLibrary.simpleMessage("注销账号"),
"ziqu" : MessageLookupByLibrary.simpleMessage("自取"), "ziqu" : MessageLookupByLibrary.simpleMessage("自取"),
"ziti" : MessageLookupByLibrary.simpleMessage("自提"), "ziti" : MessageLookupByLibrary.simpleMessage("自提"),
"zitidizhi" : MessageLookupByLibrary.simpleMessage("自提地址"), "zitidizhi" : MessageLookupByLibrary.simpleMessage("自提地址"),

5
lib/generated/intl/messages_zh_Hans_CN.dart

@ -193,6 +193,7 @@ class MessageLookup extends MessageLookupByLibrary {
"dianhua" : MessageLookupByLibrary.simpleMessage("电话"), "dianhua" : MessageLookupByLibrary.simpleMessage("电话"),
"dianjidenglu" : MessageLookupByLibrary.simpleMessage("点击登录,享受更多精彩信息"), "dianjidenglu" : MessageLookupByLibrary.simpleMessage("点击登录,享受更多精彩信息"),
"dianneiyongcan" : MessageLookupByLibrary.simpleMessage("店内用餐"), "dianneiyongcan" : MessageLookupByLibrary.simpleMessage("店内用餐"),
"dianpuchongzhi" : MessageLookupByLibrary.simpleMessage("店铺充值"),
"dianputuijian" : MessageLookupByLibrary.simpleMessage("店铺推荐"), "dianputuijian" : MessageLookupByLibrary.simpleMessage("店铺推荐"),
"dianpuyue" : MessageLookupByLibrary.simpleMessage("店铺余额"), "dianpuyue" : MessageLookupByLibrary.simpleMessage("店铺余额"),
"dianwolingqu" : MessageLookupByLibrary.simpleMessage("点我领取"), "dianwolingqu" : MessageLookupByLibrary.simpleMessage("点我领取"),
@ -309,6 +310,7 @@ class MessageLookup extends MessageLookupByLibrary {
"huiyuanjifen" : MessageLookupByLibrary.simpleMessage("会员积分"), "huiyuanjifen" : MessageLookupByLibrary.simpleMessage("会员积分"),
"huiyuanka" : MessageLookupByLibrary.simpleMessage("会员卡"), "huiyuanka" : MessageLookupByLibrary.simpleMessage("会员卡"),
"huiyuankaxiangqing" : MessageLookupByLibrary.simpleMessage("会员卡详情"), "huiyuankaxiangqing" : MessageLookupByLibrary.simpleMessage("会员卡详情"),
"huiyuanma" : MessageLookupByLibrary.simpleMessage("会员码"),
"huiyuanquanyi" : MessageLookupByLibrary.simpleMessage("会员权益"), "huiyuanquanyi" : MessageLookupByLibrary.simpleMessage("会员权益"),
"huiyuanyue" : MessageLookupByLibrary.simpleMessage("会员余额"), "huiyuanyue" : MessageLookupByLibrary.simpleMessage("会员余额"),
"huiyuanzhongxin" : MessageLookupByLibrary.simpleMessage("会员中心"), "huiyuanzhongxin" : MessageLookupByLibrary.simpleMessage("会员中心"),
@ -468,6 +470,7 @@ class MessageLookup extends MessageLookupByLibrary {
"privacy_policy2" : MessageLookupByLibrary.simpleMessage("《一心回乡服务协议》"), "privacy_policy2" : MessageLookupByLibrary.simpleMessage("《一心回乡服务协议》"),
"privacy_policy3" : MessageLookupByLibrary.simpleMessage("《隐私服务》"), "privacy_policy3" : MessageLookupByLibrary.simpleMessage("《隐私服务》"),
"privacy_policy4" : MessageLookupByLibrary.simpleMessage("并使用本机号码登录"), "privacy_policy4" : MessageLookupByLibrary.simpleMessage("并使用本机号码登录"),
"qianbao" : MessageLookupByLibrary.simpleMessage("钱包"),
"qiandao" : MessageLookupByLibrary.simpleMessage("签到"), "qiandao" : MessageLookupByLibrary.simpleMessage("签到"),
"qiandaodejifen" : MessageLookupByLibrary.simpleMessage("签到得积分"), "qiandaodejifen" : MessageLookupByLibrary.simpleMessage("签到得积分"),
"qiandaolingjifen" : MessageLookupByLibrary.simpleMessage("签到领积分"), "qiandaolingjifen" : MessageLookupByLibrary.simpleMessage("签到领积分"),
@ -740,6 +743,7 @@ class MessageLookup extends MessageLookupByLibrary {
"yinsixieyi" : MessageLookupByLibrary.simpleMessage("《隐私协议》"), "yinsixieyi" : MessageLookupByLibrary.simpleMessage("《隐私协议》"),
"yinsizhengce1" : MessageLookupByLibrary.simpleMessage(" 感谢您使用一心回乡APP。我们非常重视您的个人信息和隐私保护。为了更好地保证您的个人权益,在您使用我们的产品前,请务必仔细阅读一心回乡"), "yinsizhengce1" : MessageLookupByLibrary.simpleMessage(" 感谢您使用一心回乡APP。我们非常重视您的个人信息和隐私保护。为了更好地保证您的个人权益,在您使用我们的产品前,请务必仔细阅读一心回乡"),
"yinsizhengce2" : MessageLookupByLibrary.simpleMessage("     在您同意后,我们才会根据您的使用需求,收集部分可能涉及的数据(地理位置、相机、存储等信息)。"), "yinsizhengce2" : MessageLookupByLibrary.simpleMessage("     在您同意后,我们才会根据您的使用需求,收集部分可能涉及的数据(地理位置、相机、存储等信息)。"),
"yinzhang" : MessageLookupByLibrary.simpleMessage("印章"),
"yiqiandao" : MessageLookupByLibrary.simpleMessage("已签到"), "yiqiandao" : MessageLookupByLibrary.simpleMessage("已签到"),
"yiqianshou" : MessageLookupByLibrary.simpleMessage("已签收"), "yiqianshou" : MessageLookupByLibrary.simpleMessage("已签收"),
"yiquxiao" : MessageLookupByLibrary.simpleMessage(" 已取消 "), "yiquxiao" : MessageLookupByLibrary.simpleMessage(" 已取消 "),
@ -812,6 +816,7 @@ class MessageLookup extends MessageLookupByLibrary {
"zhunongjifen" : MessageLookupByLibrary.simpleMessage("助农积分"), "zhunongjifen" : MessageLookupByLibrary.simpleMessage("助农积分"),
"zhunongzhuanqu" : MessageLookupByLibrary.simpleMessage("助农专区"), "zhunongzhuanqu" : MessageLookupByLibrary.simpleMessage("助农专区"),
"zhuxiaotixing" : MessageLookupByLibrary.simpleMessage("再次提醒:注销帐号后不可恢复,相关数据和信息会永久删除。"), "zhuxiaotixing" : MessageLookupByLibrary.simpleMessage("再次提醒:注销帐号后不可恢复,相关数据和信息会永久删除。"),
"zhuxiaozhanghao" : MessageLookupByLibrary.simpleMessage("注销账号"),
"ziqu" : MessageLookupByLibrary.simpleMessage("自取"), "ziqu" : MessageLookupByLibrary.simpleMessage("自取"),
"ziti" : MessageLookupByLibrary.simpleMessage("自提"), "ziti" : MessageLookupByLibrary.simpleMessage("自提"),
"zitidizhi" : MessageLookupByLibrary.simpleMessage("自提地址"), "zitidizhi" : MessageLookupByLibrary.simpleMessage("自提地址"),

5
lib/generated/intl/messages_zh_Hant_CN.dart

@ -189,6 +189,7 @@ class MessageLookup extends MessageLookupByLibrary {
"dianhua" : MessageLookupByLibrary.simpleMessage("電話"), "dianhua" : MessageLookupByLibrary.simpleMessage("電話"),
"dianjidenglu" : MessageLookupByLibrary.simpleMessage("點擊登錄,享受更多精彩信息"), "dianjidenglu" : MessageLookupByLibrary.simpleMessage("點擊登錄,享受更多精彩信息"),
"dianneiyongcan" : MessageLookupByLibrary.simpleMessage("店内用餐"), "dianneiyongcan" : MessageLookupByLibrary.simpleMessage("店内用餐"),
"dianpuchongzhi" : MessageLookupByLibrary.simpleMessage("店鋪充值"),
"dianputuijian" : MessageLookupByLibrary.simpleMessage("店鋪推薦"), "dianputuijian" : MessageLookupByLibrary.simpleMessage("店鋪推薦"),
"dianpuyue" : MessageLookupByLibrary.simpleMessage("店鋪餘額"), "dianpuyue" : MessageLookupByLibrary.simpleMessage("店鋪餘額"),
"dianwolingqu" : MessageLookupByLibrary.simpleMessage("點我領取"), "dianwolingqu" : MessageLookupByLibrary.simpleMessage("點我領取"),
@ -305,6 +306,7 @@ class MessageLookup extends MessageLookupByLibrary {
"huiyuanjifen" : MessageLookupByLibrary.simpleMessage("會員積分"), "huiyuanjifen" : MessageLookupByLibrary.simpleMessage("會員積分"),
"huiyuanka" : MessageLookupByLibrary.simpleMessage("會員卡"), "huiyuanka" : MessageLookupByLibrary.simpleMessage("會員卡"),
"huiyuankaxiangqing" : MessageLookupByLibrary.simpleMessage("會員卡詳情"), "huiyuankaxiangqing" : MessageLookupByLibrary.simpleMessage("會員卡詳情"),
"huiyuanma" : MessageLookupByLibrary.simpleMessage("會員碼"),
"huiyuanquanyi" : MessageLookupByLibrary.simpleMessage("會員權益"), "huiyuanquanyi" : MessageLookupByLibrary.simpleMessage("會員權益"),
"huiyuanyue" : MessageLookupByLibrary.simpleMessage("會員餘額"), "huiyuanyue" : MessageLookupByLibrary.simpleMessage("會員餘額"),
"huiyuanzhongxin" : MessageLookupByLibrary.simpleMessage("會員中心"), "huiyuanzhongxin" : MessageLookupByLibrary.simpleMessage("會員中心"),
@ -463,6 +465,7 @@ class MessageLookup extends MessageLookupByLibrary {
"privacy_policy2" : MessageLookupByLibrary.simpleMessage("《一心回鄉服務協議》"), "privacy_policy2" : MessageLookupByLibrary.simpleMessage("《一心回鄉服務協議》"),
"privacy_policy3" : MessageLookupByLibrary.simpleMessage("《隱私服務》"), "privacy_policy3" : MessageLookupByLibrary.simpleMessage("《隱私服務》"),
"privacy_policy4" : MessageLookupByLibrary.simpleMessage("并使用本機號碼登錄"), "privacy_policy4" : MessageLookupByLibrary.simpleMessage("并使用本機號碼登錄"),
"qianbao" : MessageLookupByLibrary.simpleMessage("錢包"),
"qiandao" : MessageLookupByLibrary.simpleMessage("簽到"), "qiandao" : MessageLookupByLibrary.simpleMessage("簽到"),
"qiandaodejifen" : MessageLookupByLibrary.simpleMessage("簽到得積分"), "qiandaodejifen" : MessageLookupByLibrary.simpleMessage("簽到得積分"),
"qiandaolingjifen" : MessageLookupByLibrary.simpleMessage("簽到領積分"), "qiandaolingjifen" : MessageLookupByLibrary.simpleMessage("簽到領積分"),
@ -734,6 +737,7 @@ class MessageLookup extends MessageLookupByLibrary {
"yinsixieyi" : MessageLookupByLibrary.simpleMessage("《隱私協議》"), "yinsixieyi" : MessageLookupByLibrary.simpleMessage("《隱私協議》"),
"yinsizhengce1" : MessageLookupByLibrary.simpleMessage(" 感謝您使用一心回鄉APP。我們非常的重視您的個人信息和隱私保護。為了更好地保證您的個人權益,在您使用我們的產品前,請務必仔細閱讀一心回鄉"), "yinsizhengce1" : MessageLookupByLibrary.simpleMessage(" 感謝您使用一心回鄉APP。我們非常的重視您的個人信息和隱私保護。為了更好地保證您的個人權益,在您使用我們的產品前,請務必仔細閱讀一心回鄉"),
"yinsizhengce2" : MessageLookupByLibrary.simpleMessage("     在您同意後,我們才會根據您的使用需求,收集部分可能涉及(地理位置、相機、存儲等信息)的數據。"), "yinsizhengce2" : MessageLookupByLibrary.simpleMessage("     在您同意後,我們才會根據您的使用需求,收集部分可能涉及(地理位置、相機、存儲等信息)的數據。"),
"yinzhang" : MessageLookupByLibrary.simpleMessage("印章"),
"yiqiandao" : MessageLookupByLibrary.simpleMessage("已簽到"), "yiqiandao" : MessageLookupByLibrary.simpleMessage("已簽到"),
"yiqianshou" : MessageLookupByLibrary.simpleMessage("已簽收"), "yiqianshou" : MessageLookupByLibrary.simpleMessage("已簽收"),
"yiquxiao" : MessageLookupByLibrary.simpleMessage(" 已取消 "), "yiquxiao" : MessageLookupByLibrary.simpleMessage(" 已取消 "),
@ -806,6 +810,7 @@ class MessageLookup extends MessageLookupByLibrary {
"zhunongjifen" : MessageLookupByLibrary.simpleMessage("助農積分"), "zhunongjifen" : MessageLookupByLibrary.simpleMessage("助農積分"),
"zhunongzhuanqu" : MessageLookupByLibrary.simpleMessage("助農專區"), "zhunongzhuanqu" : MessageLookupByLibrary.simpleMessage("助農專區"),
"zhuxiaotixing" : MessageLookupByLibrary.simpleMessage("再次提醒:註銷帳號後不可恢復,相關資料和資訊會永久删除。"), "zhuxiaotixing" : MessageLookupByLibrary.simpleMessage("再次提醒:註銷帳號後不可恢復,相關資料和資訊會永久删除。"),
"zhuxiaozhanghao" : MessageLookupByLibrary.simpleMessage("註銷帳號"),
"ziqu" : MessageLookupByLibrary.simpleMessage("自取"), "ziqu" : MessageLookupByLibrary.simpleMessage("自取"),
"ziti" : MessageLookupByLibrary.simpleMessage("自提"), "ziti" : MessageLookupByLibrary.simpleMessage("自提"),
"zitidizhi" : MessageLookupByLibrary.simpleMessage("自提地址"), "zitidizhi" : MessageLookupByLibrary.simpleMessage("自提地址"),

5
lib/generated/intl/messages_zh_TW.dart

@ -191,6 +191,7 @@ class MessageLookup extends MessageLookupByLibrary {
"dianhua" : MessageLookupByLibrary.simpleMessage("電話"), "dianhua" : MessageLookupByLibrary.simpleMessage("電話"),
"dianjidenglu" : MessageLookupByLibrary.simpleMessage("點擊登錄,享受更多精彩信息"), "dianjidenglu" : MessageLookupByLibrary.simpleMessage("點擊登錄,享受更多精彩信息"),
"dianneiyongcan" : MessageLookupByLibrary.simpleMessage("店内用餐"), "dianneiyongcan" : MessageLookupByLibrary.simpleMessage("店内用餐"),
"dianpuchongzhi" : MessageLookupByLibrary.simpleMessage("店鋪充值"),
"dianputuijian" : MessageLookupByLibrary.simpleMessage("店鋪推薦"), "dianputuijian" : MessageLookupByLibrary.simpleMessage("店鋪推薦"),
"dianpuyue" : MessageLookupByLibrary.simpleMessage("店鋪餘額"), "dianpuyue" : MessageLookupByLibrary.simpleMessage("店鋪餘額"),
"dianwolingqu" : MessageLookupByLibrary.simpleMessage("點我領取"), "dianwolingqu" : MessageLookupByLibrary.simpleMessage("點我領取"),
@ -307,6 +308,7 @@ class MessageLookup extends MessageLookupByLibrary {
"huiyuanjifen" : MessageLookupByLibrary.simpleMessage("會員積分"), "huiyuanjifen" : MessageLookupByLibrary.simpleMessage("會員積分"),
"huiyuanka" : MessageLookupByLibrary.simpleMessage("會員卡"), "huiyuanka" : MessageLookupByLibrary.simpleMessage("會員卡"),
"huiyuankaxiangqing" : MessageLookupByLibrary.simpleMessage("會員卡詳情"), "huiyuankaxiangqing" : MessageLookupByLibrary.simpleMessage("會員卡詳情"),
"huiyuanma" : MessageLookupByLibrary.simpleMessage("會員碼"),
"huiyuanquanyi" : MessageLookupByLibrary.simpleMessage("會員權益"), "huiyuanquanyi" : MessageLookupByLibrary.simpleMessage("會員權益"),
"huiyuanyue" : MessageLookupByLibrary.simpleMessage("會員餘額"), "huiyuanyue" : MessageLookupByLibrary.simpleMessage("會員餘額"),
"huiyuanzhongxin" : MessageLookupByLibrary.simpleMessage("會員中心"), "huiyuanzhongxin" : MessageLookupByLibrary.simpleMessage("會員中心"),
@ -465,6 +467,7 @@ class MessageLookup extends MessageLookupByLibrary {
"privacy_policy2" : MessageLookupByLibrary.simpleMessage("《一心回鄉服務協議》"), "privacy_policy2" : MessageLookupByLibrary.simpleMessage("《一心回鄉服務協議》"),
"privacy_policy3" : MessageLookupByLibrary.simpleMessage("《隱私服務》"), "privacy_policy3" : MessageLookupByLibrary.simpleMessage("《隱私服務》"),
"privacy_policy4" : MessageLookupByLibrary.simpleMessage("并使用本機號碼登錄"), "privacy_policy4" : MessageLookupByLibrary.simpleMessage("并使用本機號碼登錄"),
"qianbao" : MessageLookupByLibrary.simpleMessage("錢包"),
"qiandao" : MessageLookupByLibrary.simpleMessage("簽到"), "qiandao" : MessageLookupByLibrary.simpleMessage("簽到"),
"qiandaodejifen" : MessageLookupByLibrary.simpleMessage("簽到得積分"), "qiandaodejifen" : MessageLookupByLibrary.simpleMessage("簽到得積分"),
"qiandaolingjifen" : MessageLookupByLibrary.simpleMessage("簽到領積分"), "qiandaolingjifen" : MessageLookupByLibrary.simpleMessage("簽到領積分"),
@ -737,6 +740,7 @@ class MessageLookup extends MessageLookupByLibrary {
"yinsixieyi" : MessageLookupByLibrary.simpleMessage("《隱私協議》"), "yinsixieyi" : MessageLookupByLibrary.simpleMessage("《隱私協議》"),
"yinsizhengce1" : MessageLookupByLibrary.simpleMessage(" 感謝您使用一心回鄉APP。我們非常的重視您的個人信息和隱私保護。為了更好地保證您的個人權益,在您使用我們的產品前,請務必仔細閱讀一心回鄉"), "yinsizhengce1" : MessageLookupByLibrary.simpleMessage(" 感謝您使用一心回鄉APP。我們非常的重視您的個人信息和隱私保護。為了更好地保證您的個人權益,在您使用我們的產品前,請務必仔細閱讀一心回鄉"),
"yinsizhengce2" : MessageLookupByLibrary.simpleMessage("     在您同意後,我們才會根據您的使用需求,收集部分可能涉及(地理位置、相機、存儲等信息)的數據。"), "yinsizhengce2" : MessageLookupByLibrary.simpleMessage("     在您同意後,我們才會根據您的使用需求,收集部分可能涉及(地理位置、相機、存儲等信息)的數據。"),
"yinzhang" : MessageLookupByLibrary.simpleMessage("印章"),
"yiqiandao" : MessageLookupByLibrary.simpleMessage("已簽到"), "yiqiandao" : MessageLookupByLibrary.simpleMessage("已簽到"),
"yiqianshou" : MessageLookupByLibrary.simpleMessage("已簽收"), "yiqianshou" : MessageLookupByLibrary.simpleMessage("已簽收"),
"yiquxiao" : MessageLookupByLibrary.simpleMessage(" 已取消 "), "yiquxiao" : MessageLookupByLibrary.simpleMessage(" 已取消 "),
@ -809,6 +813,7 @@ class MessageLookup extends MessageLookupByLibrary {
"zhunongjifen" : MessageLookupByLibrary.simpleMessage("助農積分"), "zhunongjifen" : MessageLookupByLibrary.simpleMessage("助農積分"),
"zhunongzhuanqu" : MessageLookupByLibrary.simpleMessage("助農專區"), "zhunongzhuanqu" : MessageLookupByLibrary.simpleMessage("助農專區"),
"zhuxiaotixing" : MessageLookupByLibrary.simpleMessage("再次提醒:註銷帳號後不可恢復,相關資料和資訊會永久删除。"), "zhuxiaotixing" : MessageLookupByLibrary.simpleMessage("再次提醒:註銷帳號後不可恢復,相關資料和資訊會永久删除。"),
"zhuxiaozhanghao" : MessageLookupByLibrary.simpleMessage("註銷帳號"),
"ziqu" : MessageLookupByLibrary.simpleMessage("自取"), "ziqu" : MessageLookupByLibrary.simpleMessage("自取"),
"ziti" : MessageLookupByLibrary.simpleMessage("自提"), "ziti" : MessageLookupByLibrary.simpleMessage("自提"),
"zitidizhi" : MessageLookupByLibrary.simpleMessage("自提地址"), "zitidizhi" : MessageLookupByLibrary.simpleMessage("自提地址"),

50
lib/generated/l10n.dart

@ -7145,6 +7145,56 @@ class S {
); );
} }
/// ``
String get qianbao {
return Intl.message(
'钱包',
name: 'qianbao',
desc: '',
args: [],
);
}
/// ``
String get huiyuanma {
return Intl.message(
'会员码',
name: 'huiyuanma',
desc: '',
args: [],
);
}
/// ``
String get yinzhang {
return Intl.message(
'印章',
name: 'yinzhang',
desc: '',
args: [],
);
}
/// ``
String get dianpuchongzhi {
return Intl.message(
'店铺充值',
name: 'dianpuchongzhi',
desc: '',
args: [],
);
}
/// ``
String get zhuxiaozhanghao {
return Intl.message(
'注销账号',
name: 'zhuxiaozhanghao',
desc: '',
args: [],
);
}
/// `使` /// `使`
String get privacy_policy4 { String get privacy_policy4 {
return Intl.message( return Intl.message(

813
lib/home/home_page.dart

@ -8,7 +8,6 @@ import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:flutter_swiper/flutter_swiper.dart'; import 'package:flutter_swiper/flutter_swiper.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/home/home_view/discount_zone.dart'; import 'package:huixiang/home/home_view/discount_zone.dart';
import 'package:huixiang/home/home_view/home_banner.dart';
import 'package:huixiang/home/home_view/home_recommend_goods.dart'; import 'package:huixiang/home/home_view/home_recommend_goods.dart';
import 'package:huixiang/home/home_view/top_selling_list.dart'; import 'package:huixiang/home/home_view/top_selling_list.dart';
import 'package:huixiang/home/home_view/union_entry.dart'; import 'package:huixiang/home/home_view/union_entry.dart';
@ -27,7 +26,6 @@ import 'package:huixiang/retrofit/data/goods.dart';
import 'package:huixiang/retrofit/data/goods_category.dart'; import 'package:huixiang/retrofit/data/goods_category.dart';
import 'package:huixiang/retrofit/data/home_rank.dart'; import 'package:huixiang/retrofit/data/home_rank.dart';
import 'package:huixiang/retrofit/data/login_info.dart'; import 'package:huixiang/retrofit/data/login_info.dart';
import 'package:huixiang/retrofit/data/msg_stats.dart';
import 'package:huixiang/retrofit/data/page.dart'; import 'package:huixiang/retrofit/data/page.dart';
import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/event_type.dart'; import 'package:huixiang/utils/event_type.dart';
@ -44,6 +42,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
import '../retrofit/data/user_info.dart'; import '../retrofit/data/user_info.dart';
import '../utils/flutter_utils.dart'; import '../utils/flutter_utils.dart';
import '../view_widget/channel_dialog.dart'; import '../view_widget/channel_dialog.dart';
import '../view_widget/custom_image.dart';
import 'home_view/happy_help_farmers.dart'; import 'home_view/happy_help_farmers.dart';
import 'home_view/shortcut_operation.dart'; import 'home_view/shortcut_operation.dart';
@ -54,7 +53,8 @@ class HomePage extends StatefulWidget {
final List<FirstLoginCouponList> firstLoginCouponList; final List<FirstLoginCouponList> firstLoginCouponList;
HomePage(Key key, this.changeTab, HomePage(Key key, this.changeTab,
{this.invite, this.interviewCouponList, this.firstLoginCouponList}): super(key: key); {this.invite, this.interviewCouponList, this.firstLoginCouponList})
: super(key: key);
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
@ -64,6 +64,32 @@ class HomePage extends StatefulWidget {
class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin { class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
ApiService apiService; ApiService apiService;
final RefreshController refreshController = RefreshController();
String categoryId;
bool showInvite = false;
bool showNew = false;
//1-2-3-
int orderType = 1;
//
bool orderDesc = true;
List<Goods> goods = [];
List<GoodsCategory> gooodsCategorys = [];
List<BannerData> bannerData = [];
List<BannerData> activityBannerData = [];
List<Brand> brandData = [];
List<Article> articles = [];
Founder founder;
bool isSigned = false;
int totalMsg = 0;
List<Coupon> coupons = [];
int state = 1;
HomeRank homeRank;
UserInfo userInfo;
dynamic mRaiseMoney = 0; //
int _loadCount = 0;
DioErrorType dioErrorType;
@override @override
void initState() { void initState() {
@ -74,8 +100,11 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
setState(() {}); setState(() {});
} }
}); });
queryActivity(); _onRefresh(isFirstIn: true);
_onRefresh(); if (showInvite) {
inviteShowAlertDialog(widget.invite, widget.interviewCouponList[0]);
showInvite = false;
}
if ((widget.invite ?? "") != "" || if ((widget.invite ?? "") != "" ||
widget.interviewCouponList != null && widget.interviewCouponList != null &&
@ -84,7 +113,6 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
// //
// if (widget.firstLoginCouponList != null && widget.firstLoginCouponList.length > 0) // if (widget.firstLoginCouponList != null && widget.firstLoginCouponList.length > 0)
// showNew = true; // showNew = true;
} }
/// ///
@ -99,18 +127,21 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
} }
/// ///
posterShowAlertDialog(ActivityPos activityPos,firstLoginCouponList) { posterShowAlertDialog(ActivityPos activityPos, firstLoginCouponList) {
var today = DateTime.now().day; var today = DateTime.now().day;
SharedPreferences.getInstance().then((value) { SharedPreferences.getInstance().then((value) {
if(value.getInt("today")==today && (value.getString("ActivityPosCode") ?? "").contains("${activityPos.code}_${value.getString("userId")};")) if (value.getInt("today") == today &&
(value.getString("ActivityPosCode") ?? "")
.contains("${activityPos.code}_${value.getString("userId")};"))
return; return;
value.setString("ActivityPosCode", "${(value.getString("ActivityPosCode")??"")}${activityPos.code}_${value.getString("userId")};"); value.setString("ActivityPosCode",
"${(value.getString("ActivityPosCode") ?? "")}${activityPos.code}_${value.getString("userId")};");
value.setInt("today", today); value.setInt("today", today);
// //
showDialog( showDialog(
context: context, context: context,
builder: (BuildContext context) { builder: (BuildContext context) {
return ActivityPoster(activityPos,firstLoginCouponList); return ActivityPoster(activityPos, firstLoginCouponList);
}, },
); );
}); });
@ -127,178 +158,133 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
); );
} }
final SwiperController controller = SwiperController(); ///banner
queryBanner() async {
String categoryId; try {
int pageNum = 1; BaseData<PageInfo<BannerData>> baseData = await apiService.queryBanner({
int couponPageNum = 1; "model": {"type": "HOME_PAGE"},
bool showInvite = false; }).catchError((onError) {
bool showNew = false; dioErrorType = onError.type;
});
//1-2-3- if (baseData != null && baseData.isSuccess) {
int orderType = 1; bannerData = baseData.data.records;
// if (bannerData.length > 0) swiperController.move(0, animation: false);
// }
bool orderDesc = true; } finally {
List<Goods> goods = []; addLoadCount();
List<GoodsCategory> gooodsCategorys = [];
List<BannerData> bannerData = [];
List<Brand> brandData = [];
List<Article> articles = [];
List<Goods> gooods = [];
Founder founder;
bool isSigned = false;
int totalMsg = 0;
List<Coupon> coupons = [];
int state = 1;
HomeRank homeRank;
UserInfo userInfo;
dynamic mRaiseMoney = 0;//
queryHome() async {
// EasyLoading.show(status: S.of(context).zhengzaijiazai);
final SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(Dio(),
context: context, token: value.getString('token'), showLoading: false);
final BaseData brand =
await apiService.queryHomeBrand().catchError((onError) {
SmartDialog.showToast(AppUtils.dioErrorTypeToString(onError.type),
alignment: Alignment.center);
refreshController.refreshFailed();
});
if (brand != null && brand.isSuccess) {
brandData.clear();
brandData.addAll((brand.data["brandList"] as List<dynamic>)
.map((e) => Brand.fromJson(e))
.toList());
founder = Founder.fromJson(brand.data["founder"]);
} }
}
final BaseData<PageInfo<Article>> article = await apiService.queryArticle({ ///banner
"pageNum": 1, queryActivityBanner() async {
"pageSize": 3, try {
"searchKey": "", BaseData<PageInfo<BannerData>> baseData = await apiService.queryBanner({
"state": 1, "model": {"type": "HOME_STORE_PAGE"},
"type": 2 }).catchError((onError) {});
}).catchError((onError) { if (baseData != null && baseData.isSuccess) {
refreshController.refreshFailed(); activityBannerData = baseData.data.records;
}); }
articles.clear(); } finally {
if (article != null && article.isSuccess) { addLoadCount();
articles.addAll(article.data.list);
} }
}
final BaseData<HomeRank> rank = await apiService.recommendRank().catchError((onError) {}); addLoadCount() {
if (rank != null && rank.isSuccess) { _loadCount += 1;
homeRank = rank.data; if (_loadCount == 7) {
_loadCount = 0;
EasyLoading.dismiss();
if (dioErrorType == null)
refreshController.refreshCompleted();
else {
SmartDialog.showToast(AppUtils.dioErrorTypeToString(dioErrorType),
alignment: Alignment.center);
refreshController.refreshFailed();
}
if (mounted) setState(() {});
} }
}
final BaseData<PageInfo<Goods>> goodsData = await apiService.creditGoods({ ///
"orderDesc": true, queryRecommendRank() async {
"orderType": 1, try {
"pageNum": 1, BaseData<HomeRank> rank =
"pageSize": 100, await apiService.recommendRank().catchError((onError) {});
"state": 1 if (rank != null && rank.isSuccess) {
}).catchError((onError) { homeRank = rank.data;
refreshController.refreshFailed(); }
}); } finally {
if (goodsData != null && goodsData.isSuccess) { addLoadCount();
gooods.clear();
gooods.addAll(goodsData.data.list);
} }
}
BaseData<PageInfo<GoodsCategory>> dataCategory = ///
await apiService.goodsCategory({ queryGoodsCategory() async {
"current": 1, try {
"map": {}, BaseData<PageInfo<GoodsCategory>> dataCategory =
"model": {"pageNum": 1, "pageSize": 20, "searchKey": ""}, await apiService.goodsCategory({
"order": "descending", "current": 1,
"size": 20, "map": {},
"sort": "sortOrder" "model": {"pageNum": 1, "pageSize": 20, "searchKey": ""},
}).catchError((onError) { "order": "descending",
refreshController.loadFailed(); "size": 20,
refreshController.refreshFailed(); "sort": "sortOrder"
}); }).catchError((onError) {});
if (dataCategory != null &&
if (dataCategory != null && dataCategory.isSuccess &&
dataCategory.isSuccess && dataCategory.data != null &&
dataCategory.data != null && dataCategory.data.records != null &&
dataCategory.data.records != null && dataCategory.data.records.length > 0) {
dataCategory.data.records.length > 0) { gooodsCategorys.clear();
gooodsCategorys.clear(); gooodsCategorys.add(GoodsCategory(name: S.of(context).quanbu));
gooodsCategorys.add(GoodsCategory(name: S.of(context).quanbu)); gooodsCategorys.addAll(dataCategory.data.records);
gooodsCategorys.addAll(dataCategory.data.records); }
} finally {
addLoadCount();
} }
}
var param = { ///
"categoryId": categoryId ?? "", queryPointsProductList(bool isRefresh) async {
"orderDesc": orderDesc, try {
"orderType": orderType, if (!isRefresh)
"pageNum": pageNum, EasyLoading.show(
"pageSize": 100, status: S.current.zhengzaijiazai,
"state": 1 maskType: EasyLoadingMaskType.black);
}; var param = {
BaseData<PageInfo<Goods>> pageGoods = "categoryId": categoryId ?? "",
await apiService.creditGoods(param).catchError((onError) { "orderDesc": orderDesc,
refreshController.loadFailed(); "orderType": orderType,
refreshController.refreshFailed(); "pageNum": 1,
}); "pageSize": 100,
EasyLoading.dismiss(); "state": 1
if (pageGoods != null && pageGoods.isSuccess) { };
if (pageNum == 1) { BaseData<PageInfo<Goods>> pageGoods =
goods.clear(); await apiService.creditGoods(param).catchError((onError) {});
if (pageGoods != null && pageGoods.isSuccess) {
goods = pageGoods.data.list;
} }
goods.addAll(pageGoods.data.list); } finally {
refreshController.refreshCompleted(); if (isRefresh)
refreshController.loadComplete(); addLoadCount();
if (pageGoods.data.pageNum == pageGoods.data.pages) { else {
refreshController.loadNoData(); EasyLoading.dismiss();
} else { setState(() {});
pageNum += 1;
} }
} else {
refreshController.loadFailed();
refreshController.refreshFailed();
} }
final BaseData<PageInfo<BannerData>> baseData =
await apiService.queryBanner({
"model": {"type": "HOME_PAGE"},
}).catchError((onError) {
refreshController.refreshFailed();
});
if (baseData != null && baseData.isSuccess) {
bannerData.clear();
bannerData.addAll(baseData.data.records);
refreshController.refreshCompleted();
if (bannerData.length > 0) controller.move(0, animation: false);
} else {
refreshController.refreshFailed();
}
EasyLoading.dismiss();
if (showInvite) {
inviteShowAlertDialog(widget.invite, widget.interviewCouponList[0]);
showInvite = false;
}
//
// if (showNew) {
// newShowAlertDialog(widget.firstLoginCouponList);
// showNew = false;
// }
} }
/// ///
queryUserBalance() async { queryUserBalance() async {
BaseData<UserInfo> baseData = try {
await apiService.queryInfo().catchError((onError) {}); BaseData<UserInfo> baseData =
if (baseData != null && baseData.isSuccess) { await apiService.queryInfo().catchError((onError) {});
userInfo = baseData.data; if (baseData != null && baseData.isSuccess) {
mRaiseMoney = double.tryParse(userInfo.raiseMoney); userInfo = baseData.data;
if (mounted) setState(() {}); mRaiseMoney = double.tryParse(userInfo.raiseMoney);
}
} finally {
addLoadCount();
} }
} }
@ -326,35 +312,18 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
/// ///
queryActivity() async { queryActivity() async {
if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(
Dio(),
context: context,
token: value.getString("token"),
showLoading: true
);
}
BaseData<ActivityPos> baseData = BaseData<ActivityPos> baseData =
await apiService.appPopup().catchError((onError) { await apiService.appPopup().catchError((onError) {});
});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
if(baseData.data?.enabled ?? true) if (baseData.data?.enabled ?? true)
posterShowAlertDialog(baseData.data,widget.firstLoginCouponList); posterShowAlertDialog(baseData.data, widget.firstLoginCouponList);
} }
} }
/// ///
queryWiped(memberCouponId) async { queryWiped(memberCouponId) async {
if (apiService == null) { BaseData baseData =
SharedPreferences value = await SharedPreferences.getInstance(); await apiService.wiped(memberCouponId).catchError((onError) {});
apiService = ApiService(
Dio(),
context: context,
token: value.getString("token"),
);
}
BaseData baseData = await apiService.wiped(memberCouponId).catchError((onError) {});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
SmartDialog.showToast("核销成功", alignment: Alignment.center); SmartDialog.showToast("核销成功", alignment: Alignment.center);
} else { } else {
@ -363,6 +332,25 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
} }
queryCoupon() async { queryCoupon() async {
try {
BaseData<PageInfo<Coupon>> baseData = await apiService.queryCoupon({
"centre": true,
"pageNum": 1,
"pageSize": 10,
"searchKey": "",
"state": 0
}).catchError((onError) {});
if (baseData != null && baseData.isSuccess) {
coupons = baseData.data.list;
}
} finally {
addLoadCount();
}
}
_onRefresh({bool isFirstIn = false}) async {
EasyLoading.show(
status: S.current.zhengzaijiazai, maskType: EasyLoadingMaskType.black);
if (apiService == null) { if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance(); SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService( apiService = ApiService(
@ -371,39 +359,16 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
token: value.getString("token"), token: value.getString("token"),
); );
} }
BaseData<PageInfo<Coupon>> baseData = await apiService.queryCoupon({ dioErrorType = null;
"centre": true, if (isFirstIn) queryActivity();
"pageNum": couponPageNum, queryBanner();
"pageSize": 10, queryActivityBanner();
"searchKey": "", queryRecommendRank();
"state": 0 queryGoodsCategory();
}).catchError((onError) { queryPointsProductList(true);
refreshController.refreshFailed(); queryUserBalance();
refreshController.loadFailed();
});
if (couponPageNum == 1) coupons.clear();
if (baseData != null && baseData.isSuccess) {
coupons.addAll(baseData.data.list);
refreshController.refreshCompleted();
refreshController.loadComplete();
if (baseData.data.pageNum == baseData.data.pages) {
refreshController.loadNoData();
} else {
couponPageNum += 1;
}
setState(() {});
}
else {
refreshController.refreshFailed();
refreshController.loadFailed();
}
}
_onRefresh() async{
await queryHome();
await queryUserBalance();
// queryMsgStats(); // queryMsgStats();
await queryCoupon(); queryCoupon();
} }
@override @override
@ -412,8 +377,6 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
if (refreshController != null) refreshController.dispose(); if (refreshController != null) refreshController.dispose();
} }
final RefreshController refreshController = RefreshController();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
super.build(context); super.build(context);
@ -502,99 +465,91 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
enablePullUp: false, enablePullUp: false,
header: MyHeader(), header: MyHeader(),
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
onRefresh: () { onRefresh: _onRefresh,
setState(() {_onRefresh();
});
},
child: SingleChildScrollView( child: SingleChildScrollView(
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
child: FutureBuilder( child: Column(
future: queryHome(), children: [
builder: (context, snapshot) { ///banner
return Column( homeBanner(),
children: [
///banner ///
HomeBanner(bannerData, controller), UnionEntry((int jpIndex) {
widget.changeTab(1, jpIndex);
/// }),
UnionEntry((int jpIndex) {
widget.changeTab(1,jpIndex); ///
}), ShortcutOperation((int jpIndex) {
widget.changeTab(1, jpIndex);
/// }),
ShortcutOperation((int jpIndex) {
widget.changeTab(1,jpIndex); ///广
}), if(activityBannerData.length > 0)
spread(),
///广
spread(), // ///
// SignView(isSigned, (value) {
// /// // setState(() {
// SignView(isSigned, (value) { // isSigned = value;
// setState(() { // });
// isSigned = value; // }),
// });
// }), ///
if (coupons != null && coupons.length != 0)
/// DiscountZone(coupons),
if(coupons != null && coupons.length != 0)
DiscountZone(coupons), ///-
if (homeRank != null &&
///- homeRank.commodityZone.length != 0)
if(homeRank != null && homeRank.commodityZone.length != 0) HomeRecommendGoods(homeRank),
HomeRecommendGoods(homeRank),
///
if((homeRank?.commodityZone?.length ??0) == 0) // if(mRaiseMoney != 0)
SizedBox(height: 20.h,), HappyHelpFarmers(),
/// ///
// if(mRaiseMoney != 0) WelfareCore(),
HappyHelpFarmers(),
///
/// if (homeRank != null &&
WelfareCore(), homeRank.commodityList.length != 0)
TopSellingList(homeRank),
///
if(homeRank != null && homeRank.commodityList.length != 0) // ///
TopSellingList(homeRank), // QuickOrder(),
// /// // ///
// QuickOrder(), // CouponView(),
// /// // ///
// CouponView(), // FeaturedActivity(),
// /// // ///
// FeaturedActivity(), // HomeIntegralStore(gooods),
// /// ///Tab
// HomeIntegralStore(gooods), PointsGoodsTitle(
gooodsCategorys,
///Tab (orderType, orderDesc) {
PointsGoodsTitle( this.orderType = orderType;
gooodsCategorys, this.orderDesc = orderDesc;
(orderType, orderDesc) { queryPointsProductList(false);
this.orderType = orderType; },
this.orderDesc = orderDesc; (index) {
setState(() {}); categoryId = gooodsCategorys[index].id;
}, queryPointsProductList(false);
(index) { },
categoryId = gooodsCategorys[index].id; ),
pageNum = 1;
setState(() {}); ///
}, PointGoods(
), goods,
(index) {
/// _toDetails(index);
PointGoods( },
goods, ),
(index) { ],
_toDetails(index); )),
},
),
],
);})
),
), ),
), ),
), ),
@ -605,57 +560,191 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
); );
} }
Widget spread(){ Widget homeBanner() {
return Container(
child: AspectRatio(
aspectRatio: 1.25,
child: bannerData != null && bannerData.isNotEmpty
? Swiper(
pagination: SwiperPagination(
margin: EdgeInsets.only(bottom: 12.h),
alignment: Alignment.bottomCenter,
builder: DotSwiperPaginationBuilder(
size: 8,
activeSize: 8,
space: 5,
activeColor: Colors.white,
color: Colors.white.withAlpha(76),
),
),
autoplay: true,
duration: 1000,
autoplayDelay: 2000,
physics: BouncingScrollPhysics(),
itemBuilder: (context, position) {
return InkWell(
onTap: () {
bannerClick(bannerData[position]);
},
child: Container(
child: MImage(
bannerData[position].imgUrl,
fit: BoxFit.cover,
errorSrc: "assets/image/default_2_1.webp",
fadeSrc: "assets/image/default_2_1.webp",
),
),
);
},
itemCount: bannerData.length,
)
: Image.asset(
"assets/image/default_2_1.webp",
fit: BoxFit.cover,
),
),
);
}
/// contentType 0123,4:,5:7
bannerClick(BannerData bannerData) async {
switch (bannerData.contentType) {
case 1:
Navigator.of(context).pushNamed('/router/integral_store_page',
arguments: {"goodsId": bannerData.content});
break;
case 2:
Navigator.of(context).pushNamed('/router/web_page', arguments: {
"activityId": bannerData.content,
});
break;
case 3:
Navigator.of(context).pushNamed('/router/web_page', arguments: {
"articleId": bannerData.content,
});
break;
case 4:
String router = bannerData.content;
// String router = "/router/store_order?{\"id\":\"1512378184161558528\",\"tenant\":\"1188\",\"storeName\":\"农场煮意\"}";
if (router.contains("?")) {
String params = router.substring(router.indexOf("?") + 1);
Map map = jsonDecode(params);
Navigator.of(context).pushNamed(
router.substring(0, router.indexOf("?")),
arguments: map);
} else {
Navigator.of(context).pushNamed(router);
}
break;
case 5:
Navigator.of(context).pushNamed('/router/class_details', arguments: {
"id": bannerData.content,
});
break;
case 7:
String params =
bannerData.content.substring(bannerData.content.indexOf("?") + 1);
Map map = jsonDecode(params);
Navigator.of(context).pushNamed(
bannerData.content.substring(0, bannerData.content.indexOf("?")),
arguments: map);
break;
}
}
Widget spread() {
return Container( return Container(
width: double.infinity, width: double.infinity,
// margin: EdgeInsets.symmetric(horizontal:14.w),
height: 85.h, height: 85.h,
child: Swiper( child: activityBannerData != null && activityBannerData.isNotEmpty
pagination: SwiperPagination( ? Swiper(
alignment: Alignment.bottomCenter, pagination: SwiperPagination(
margin: EdgeInsets.only(top: 5.h), alignment: Alignment.bottomCenter,
builder: DotSwiperPaginationBuilder( margin: EdgeInsets.only(top: 5.h),
size: 8.w, builder: DotSwiperPaginationBuilder(
activeSize: 8.w, size: 8.w,
space: 5.w, activeSize: 8.w,
activeColor: Colors.white, space: 5.w,
color: Colors.white.withAlpha(76), activeColor: Colors.white,
), color: Colors.white.withAlpha(76),
),
autoplay:true,
duration: 1000,
autoplayDelay: 2000,
itemBuilder: (context, position) {
return GestureDetector(
onTap: (){
if(position == 0){
Navigator.of(context).pushNamed('/router/invite_friends');
}else if(position == 1){
Navigator.of(context).pushNamed('/router/trading_card_page');
}
},
child:Container(
margin: EdgeInsets.symmetric(horizontal:14.w),
child: ClipRRect(
child:Image.asset(
spreadItem[position],
width:double.infinity,
fit: BoxFit.fill,
height:double.infinity,
), ),
borderRadius: BorderRadius.circular(6.w),
), ),
autoplay: true,
duration: 1000,
autoplayDelay: 2000,
itemBuilder: (context, position) {
return InkWell(
onTap: () {
spreadBannerClick(activityBannerData[position]);
},
child: Container(
margin: EdgeInsets.symmetric(horizontal: 14.w),
child: MImage(
activityBannerData[position].imgUrl,
fit: BoxFit.cover,
radius: BorderRadius.circular(6),
errorSrc: "assets/image/default_2_1.webp",
fadeSrc: "assets/image/default_2_1.webp",
),
),
);
},
itemCount: activityBannerData.length,
)
: Image.asset(
"assets/image/default_2_1.webp",
fit: BoxFit.cover,
), ),
);
},
itemCount:2,
),
); );
} }
final List<String> spreadItem = [ /// contentType 0123,4:,5:7
"assets/image/welfare_spread.webp", spreadBannerClick(BannerData activityBannerData) async {
"assets/image/welfare_yz.webp", switch (activityBannerData.contentType) {
]; case 1:
Navigator.of(context).pushNamed('/router/integral_store_page',
arguments: {"goodsId": activityBannerData.content});
break;
case 2:
Navigator.of(context).pushNamed('/router/web_page', arguments: {
"activityId": activityBannerData.content,
});
break;
case 3:
Navigator.of(context).pushNamed('/router/web_page', arguments: {
"articleId": activityBannerData.content,
});
break;
case 4:
String router = activityBannerData.content;
// String router = "/router/store_order?{\"id\":\"1512378184161558528\",\"tenant\":\"1188\",\"storeName\":\"农场煮意\"}";
if (router.contains("?")) {
String params = router.substring(router.indexOf("?") + 1);
Map map = jsonDecode(params);
Navigator.of(context).pushNamed(
router.substring(0, router.indexOf("?")),
arguments: map);
} else {
Navigator.of(context).pushNamed(router);
}
break;
case 5:
Navigator.of(context).pushNamed('/router/class_details', arguments: {
"id": activityBannerData.content,
});
break;
case 7:
String params = activityBannerData.content
.substring(activityBannerData.content.indexOf("?") + 1);
Map map = jsonDecode(params);
Navigator.of(context).pushNamed(
activityBannerData.content
.substring(0, activityBannerData.content.indexOf("?")),
arguments: map);
break;
}
}
/// ///
toScan() async { toScan() async {
@ -681,20 +770,24 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
// //
// http://miniscan.lotus-wallet.com/placeorder?tenant_code=1194&table_id=1669609340031467520&store_id=1637659387134738432 // http://miniscan.lotus-wallet.com/placeorder?tenant_code=1194&table_id=1669609340031467520&store_id=1637659387134738432
var result = await Navigator.of(context).pushNamed('/router/qr_scan'); var result = await Navigator.of(context).pushNamed('/router/qr_scan');
if(result.toString().contains("type\":\"coupon")){ if (result.toString().contains("type\":\"coupon")) {
/// ///
activityShowAlertDialog(result.toString()); activityShowAlertDialog(result.toString());
return; return;
}if(result.toString().contains("type\":\"wiped")){ }
if (result.toString().contains("type\":\"wiped")) {
/// ///
queryWiped(jsonDecode(result.toString())["memberCouponId"]); queryWiped(jsonDecode(result.toString())["memberCouponId"]);
return; return;
} }
// String result = await scanner.scan(); // String result = await scanner.scan();
Uri uri = Uri.parse(result); Uri uri = Uri.parse(result);
String tableId = uri.queryParameters["tableId"] ?? uri.queryParameters["table_id"]; String tableId =
String tenantCode = uri.queryParameters["tenantCode"] ?? uri.queryParameters["tenant_code"]; uri.queryParameters["tableId"] ?? uri.queryParameters["table_id"];
String shopId = uri.queryParameters["shopId"] ?? uri.queryParameters["store_id"]; String tenantCode = uri.queryParameters["tenantCode"] ??
uri.queryParameters["tenant_code"];
String shopId =
uri.queryParameters["shopId"] ?? uri.queryParameters["store_id"];
if (tableId != null && if (tableId != null &&
tableId != "" && tableId != "" &&
tenantCode != null && tenantCode != null &&

2
lib/home/huixiang_brand_page.dart

@ -44,7 +44,7 @@ class _BrandPage extends State<BrandPage>
Founder founder; Founder founder;
queryHome() async { queryHome() async {
EasyLoading.show(status: S.current.zhengzaijiazai); EasyLoading.show(status: S.current.zhengzaijiazai,maskType: EasyLoadingMaskType.black);
final SharedPreferences value = await SharedPreferences.getInstance(); final SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService( apiService = ApiService(

2
lib/home/points_mall_page.dart

@ -95,7 +95,7 @@ class _PointsMallPage extends State<PointsMallPage>
} }
creditGoods() async { creditGoods() async {
EasyLoading.show(status: S.current.zhengzaijiazai); EasyLoading.show(status: S.current.zhengzaijiazai,maskType: EasyLoadingMaskType.black);
final SharedPreferences value = await SharedPreferences.getInstance(); final SharedPreferences value = await SharedPreferences.getInstance();
client = ApiService(Dio(), client = ApiService(Dio(),

2
lib/home/welfare_exchange.dart

@ -62,7 +62,7 @@ class _WelfareExchange extends State<WelfareExchange>
} }
queryUser() async { queryUser() async {
EasyLoading.show(status: S.current.zhengzaijiazai); EasyLoading.show(status: S.current.zhengzaijiazai,maskType: EasyLoadingMaskType.black);
BaseData<UserInfo> baseData = BaseData<UserInfo> baseData =
await apiService.queryInfo().catchError((onError) {}); await apiService.queryInfo().catchError((onError) {});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {

774
lib/home/welfare_page.dart

File diff suppressed because it is too large Load Diff

46
lib/integral/integral_page.dart

@ -19,10 +19,10 @@ import 'package:huixiang/view_widget/sign_in_widget.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import '../utils/flutter_utils.dart';
import 'intergra_view/integral_task.dart'; import 'intergra_view/integral_task.dart';
class IntegralPage extends StatefulWidget { class IntegralPage extends StatefulWidget {
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
return _IntegralPage(); return _IntegralPage();
@ -51,13 +51,17 @@ class _IntegralPage extends State<IntegralPage> {
); );
userInfo = UserInfo.fromJson(jsonDecode(value.getString("user"))); userInfo = UserInfo.fromJson(jsonDecode(value.getString("user")));
BaseData<List<Rank>> rankData = await apiService.rankList() BaseData<List<Rank>> rankData =
.catchError((onError) {}); await apiService.rankList().catchError((onError) {
SmartDialog.showToast(AppUtils.dioErrorTypeToString(onError.type),
alignment: Alignment.center);
refreshController.refreshFailed();
});
if (rankData != null && rankData.isSuccess) { if (rankData != null && rankData.isSuccess) {
ranks.clear(); ranks.clear();
ranks.addAll(rankData.data); ranks.addAll(rankData.data);
refreshController.refreshCompleted(); refreshController.refreshCompleted();
}else { } else {
refreshController.refreshFailed(); refreshController.refreshFailed();
} }
@ -112,7 +116,9 @@ class _IntegralPage extends State<IntegralPage> {
Scaffold( Scaffold(
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
appBar: MyAppBar( appBar: MyAppBar(
exit: (){Navigator.of(context).pop(signInfo.todayHasSignin ?? false);}, exit: () {
Navigator.of(context).pop(signInfo?.todayHasSignin ?? false);
},
background: Colors.transparent, background: Colors.transparent,
leadingColor: Colors.white, leadingColor: Colors.white,
title: "", title: "",
@ -124,7 +130,9 @@ class _IntegralPage extends State<IntegralPage> {
margin: EdgeInsets.only(right: 16.w), margin: EdgeInsets.only(right: 16.w),
child: GestureDetector( child: GestureDetector(
onTap: () { onTap: () {
Navigator.of(context).pushNamed('/router/integral_detailed_page',arguments:{"titleType":2}); Navigator.of(context).pushNamed(
'/router/integral_detailed_page',
arguments: {"titleType": 2});
}, },
child: Text( child: Text(
S.of(context).mingxi, S.of(context).mingxi,
@ -137,17 +145,17 @@ class _IntegralPage extends State<IntegralPage> {
), ),
), ),
), ),
body:SmartRefresher( body: SmartRefresher(
controller: refreshController, controller: refreshController,
enablePullDown: true, enablePullDown: true,
enablePullUp: false, enablePullUp: false,
header: MyHeader(), header: MyHeader(color: Colors.white,),
footer: CustomFooter( footer: CustomFooter(
builder: (context, mode) { builder: (context, mode) {
return MyFooter(mode); return MyFooter(mode);
}, },
), ),
onRefresh:(){ onRefresh: () {
setState(() { setState(() {
querySignInfo(); querySignInfo();
}); });
@ -163,9 +171,19 @@ class _IntegralPage extends State<IntegralPage> {
return Column( return Column(
children: [ children: [
/// VIP等级显示 /// VIP等级显示
IntegralVip(rankLevel, signInfo, userInfo,"${ (signInfo?.signInList?.length ) ?? "0"}", IntegralVip(
((signInfo?.rewardList != null && signInfo.rewardList.length > (signInfo?.signInList?.length ?? 0)) ? rankLevel,
signInfo.rewardList[signInfo?.signInList?.length ?? 0]:0).toString()), signInfo,
userInfo,
"${(signInfo?.signInList?.length) ?? "0"}",
((signInfo?.rewardList != null &&
signInfo.rewardList.length >
(signInfo?.signInList?.length ??
0))
? signInfo.rewardList[
signInfo?.signInList?.length ?? 0]
: 0)
.toString()),
/// ///
InForPoints(signInfo, _signIn), InForPoints(signInfo, _signIn),
@ -191,7 +209,9 @@ class _IntegralPage extends State<IntegralPage> {
SmartDialog.showToast("今日已签到了", alignment: Alignment.center); SmartDialog.showToast("今日已签到了", alignment: Alignment.center);
return; return;
} }
EasyLoading.show(status: S.of(context).zhengzaijiazai); EasyLoading.show(
status: S.of(context).zhengzaijiazai,
maskType: EasyLoadingMaskType.black);
BaseData baseData = await apiService.signIn().catchError((onError) {}); BaseData baseData = await apiService.signIn().catchError((onError) {});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
setState(() {}); setState(() {});

56
lib/integral/intergra_view/integral_task.dart

@ -6,6 +6,8 @@ import 'package:huixiang/utils/font_weight.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/view_widget/round_button.dart'; import 'package:huixiang/view_widget/round_button.dart';
import '../../view_widget/no_data_view.dart';
class IntegralTask extends StatefulWidget { class IntegralTask extends StatefulWidget {
final SignInfo signInfo; final SignInfo signInfo;
@ -57,28 +59,38 @@ class _IntegralTask extends State<IntegralTask> {
), ),
Expanded( Expanded(
child: Container( child: Container(
child: ListView.builder( child: (widget.signInfo != null &&
padding: EdgeInsets.only(left: 10.w, top: 20.h), widget.signInfo.taskList != null &&
physics: BouncingScrollPhysics(), widget.signInfo.taskList.length > 0)
// loop: false, ? ListView.builder(
// pagination: SwiperPagination( padding: EdgeInsets.only(left: 10.w, top: 20.h),
// alignment: Alignment.bottomCenter, physics: BouncingScrollPhysics(),
// builder: DotSwiperPaginationBuilder( // loop: false,
// size: 8, // pagination: SwiperPagination(
// activeSize: 8, // alignment: Alignment.bottomCenter,
// space: 5, // builder: DotSwiperPaginationBuilder(
// activeColor: Colors.black, // size: 8,
// color: Colors.black.withAlpha(76), // activeSize: 8,
// ), // space: 5,
// ), // activeColor: Colors.black,
itemBuilder: (context, position) { // color: Colors.black.withAlpha(76),
return taskItem(widget.signInfo.taskList[position]); // ),
}, // ),
itemCount: (widget.signInfo != null && itemBuilder: (context, position) {
widget.signInfo.taskList != null && return taskItem(widget.signInfo.taskList[position]);
widget.signInfo.taskList.length > 0) },
? widget.signInfo.taskList.length itemCount: (widget.signInfo != null &&
: 0), widget.signInfo.taskList != null &&
widget.signInfo.taskList.length > 0)
? widget.signInfo.taskList.length
: 0)
: NoDataView(
src: "assets/image/xiao_fei.webp",
isShowBtn: false,
text: "暂无任务可做~",
fontSize: 16.sp,
margin: EdgeInsets.only(left: 60.w, right: 60.w),
),
), ),
flex: 1, flex: 1,
) )

5
lib/l10n/intl_en.arb

@ -743,6 +743,11 @@
"xiugai":"修改", "xiugai":"修改",
"bangdingshouji":"绑定手机", "bangdingshouji":"绑定手机",
"genggaibangdingshoujihao":"更改绑定手机号", "genggaibangdingshoujihao":"更改绑定手机号",
"qianbao":"钱包",
"huiyuanma":"会员码",
"yinzhang":"印章",
"dianpuchongzhi":"店铺充值",
"zhuxiaozhanghao":"注销账号",

5
lib/l10n/intl_en_US.arb

@ -744,6 +744,11 @@
"xiugai":"modify", "xiugai":"modify",
"bangdingshouji":"bind phone", "bangdingshouji":"bind phone",
"genggaibangdingshoujihao":"modify bind phone", "genggaibangdingshoujihao":"modify bind phone",
"qianbao":"Wallet",
"huiyuanma":"vipCode",
"yinzhang":"Seal",
"dianpuchongzhi":"Recharge",
"zhuxiaozhanghao":"Account cancellation",

5
lib/l10n/intl_zh_CN.arb

@ -744,6 +744,11 @@
"xiugai":"修改", "xiugai":"修改",
"bangdingshouji":"绑定手机", "bangdingshouji":"绑定手机",
"genggaibangdingshoujihao":"更改绑定手机号", "genggaibangdingshoujihao":"更改绑定手机号",
"qianbao":"钱包",
"huiyuanma":"会员码",
"yinzhang":"印章",
"dianpuchongzhi":"店铺充值",
"zhuxiaozhanghao":"注销账号",

5
lib/l10n/intl_zh_Hans_CN.arb

@ -744,6 +744,11 @@
"xiugai":"修改", "xiugai":"修改",
"bangdingshouji":"绑定手机", "bangdingshouji":"绑定手机",
"genggaibangdingshoujihao":"更改绑定手机号", "genggaibangdingshoujihao":"更改绑定手机号",
"qianbao":"钱包",
"huiyuanma":"会员码",
"yinzhang":"印章",
"dianpuchongzhi":"店铺充值",
"zhuxiaozhanghao":"注销账号",

5
lib/l10n/intl_zh_Hant_CN.arb

@ -735,6 +735,11 @@
"xiugai":"修改", "xiugai":"修改",
"bangdingshouji":"綁定手機", "bangdingshouji":"綁定手機",
"genggaibangdingshoujihao":"更改綁定手機號", "genggaibangdingshoujihao":"更改綁定手機號",
"qianbao":"錢包",
"huiyuanma":"會員碼",
"yinzhang":"印章",
"dianpuchongzhi":"店鋪充值",
"zhuxiaozhanghao":"註銷帳號",

5
lib/l10n/intl_zh_TW.arb

@ -737,6 +737,11 @@
"xiugai":"修改", "xiugai":"修改",
"bangdingshouji":"綁定手機", "bangdingshouji":"綁定手機",
"genggaibangdingshoujihao":"更改綁定手機號", "genggaibangdingshoujihao":"更改綁定手機號",
"qianbao":"錢包",
"huiyuanma":"會員碼",
"yinzhang":"印章",
"dianpuchongzhi":"店鋪充值",
"zhuxiaozhanghao":"註銷帳號",

552
lib/login/captcha/block_puzzle_captcha.dart

File diff suppressed because one or more lines are too long

367
lib/login/captcha/click_word_captcha.dart

@ -0,0 +1,367 @@
import 'dart:convert';
import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import '../../retrofit/retrofit_api.dart';
import '../../utils/captcha_util.dart';
import '../../utils/widget_util.dart';
typedef VoidSuccessCallback = dynamic Function(String v);
class ClickWordCaptcha extends StatefulWidget {
final VoidSuccessCallback onSuccess; //
final VoidCallback onFail; //
const ClickWordCaptcha({Key key, this.onSuccess, this.onFail})
: super(key: key);
@override
_ClickWordCaptchaState createState() => _ClickWordCaptchaState();
}
class _ClickWordCaptchaState extends State<ClickWordCaptcha> {
ClickWordCaptchaState _clickWordCaptchaState = ClickWordCaptchaState.none;
List<Offset> _tapOffsetList = [];
ClickWordCaptchaModel _clickWordCaptchaModel = ClickWordCaptchaModel();
Color titleColor = Colors.black;
Color borderColor = Color(0xffdddddd);
String bottomTitle = "";
Size baseSize = Size(310.0, 155.0);
//
_changeResultState() {
switch (_clickWordCaptchaState) {
case ClickWordCaptchaState.normal:
titleColor = Colors.black;
borderColor = Color(0xffdddddd);
break;
case ClickWordCaptchaState.success:
_tapOffsetList = [];
titleColor = Colors.green;
borderColor = Colors.green;
bottomTitle = "验证成功";
break;
case ClickWordCaptchaState.fail:
_tapOffsetList = [];
titleColor = Colors.red;
borderColor = Colors.red;
bottomTitle = "验证失败";
break;
default:
titleColor = Colors.black;
borderColor = Color(0xffdddddd);
bottomTitle = "数据加载中……";
break;
}
setState(() {});
}
@override
void initState() {
super.initState();
_loadCaptcha();
}
//
_loadCaptcha() async {
_tapOffsetList = [];
_clickWordCaptchaState = ClickWordCaptchaState.none;
_changeResultState();
ApiService apiIpService = ApiService(Dio(), context: context);
ClickWordCaptchaModel baseData = await apiIpService.captchaGet({"captchaType": "clickWord"}).catchError((onError) {});
if (baseData == null) {
_clickWordCaptchaModel.secretKey = "";
bottomTitle = "加载失败,请刷新";
_clickWordCaptchaState = ClickWordCaptchaState.normal;
_changeResultState();
return;
}
else {
_clickWordCaptchaModel = baseData;
var baseR = await WidgetUtil.getImageWH(
image: Image.memory(
Base64Decoder().convert(_clickWordCaptchaModel.imgStr)));
baseSize = baseR.size;
bottomTitle = "请依次点击【${_clickWordCaptchaModel.wordStr}";
}
_clickWordCaptchaState = ClickWordCaptchaState.normal;
_changeResultState();
}
//
_checkCaptcha() async {
List<Map<String, dynamic>> mousePos = [];
_tapOffsetList.map((size) {
mousePos
.add({"x": size.dx.roundToDouble(), "y": size.dy.roundToDouble()});
}).toList();
var pointStr = json.encode(mousePos);
var cryptedStr = pointStr;
// secretKey as加密
if (!CaptchaUtil.isEmpty(_clickWordCaptchaModel.secretKey)) {
cryptedStr = CaptchaUtil.aesEncode(
key: _clickWordCaptchaModel.secretKey, content: pointStr);
// var dcrypt = CaptchaUtil.aesDecode(
// key: _clickWordCaptchaModel.secretKey, content: cryptedStr);
}
// Map _map = json.decode(dcrypt);
ApiService apiIpService = ApiService(Dio(), context: context);
bool baseData = await apiIpService.captchaCheck({
"pointJson": cryptedStr,
"captchaType": "clickWord",
"token": _clickWordCaptchaModel.token
}).catchError((onError) {});
if (baseData) {
_checkFail();
return;
}
// token ---
var captchaVerification = "${_clickWordCaptchaModel.token}---$pointStr";
if (!CaptchaUtil.isEmpty(_clickWordCaptchaModel.secretKey)) {
// token --- _clickWordCaptchaModel.secretKey
captchaVerification = CaptchaUtil.aesEncode(
key: _clickWordCaptchaModel.secretKey,
content: captchaVerification);
}
_checkSuccess(captchaVerification);
}
//
_checkFail() async {
_clickWordCaptchaState = ClickWordCaptchaState.fail;
_changeResultState();
await Future.delayed(Duration(milliseconds: 1000));
_loadCaptcha();
//
if (widget.onFail != null) {
widget.onFail();
}
}
//
_checkSuccess(String pointJson) async {
_clickWordCaptchaState = ClickWordCaptchaState.success;
_changeResultState();
await Future.delayed(Duration(milliseconds: 1000));
var cryptedStr = CaptchaUtil.aesEncode(key: 'BGxdEUOZkXka4HSj', content: pointJson);
print(cryptedStr);
// pointJson es加密之后的信息
if (widget.onSuccess != null) {
widget.onSuccess(cryptedStr);
}
//
Navigator.pop(context);
}
@override
Widget build(BuildContext context) {
var data = MediaQuery.of(context);
var dialogWidth = 0.9 * data.size.width;
var isRatioCross = false;
if (dialogWidth < 320.0) {
dialogWidth = data.size.width;
isRatioCross = true;
}
return Scaffold(
backgroundColor: Colors.transparent,
body: Center(
child: Container(
width: dialogWidth,
height: 320.h,
color: Colors.white,
child: Column(
children: <Widget>[
_topConttainer(),
_captchaContainer(),
_bottomContainer()
],
),
),
),
);
}
//
_captchaContainer() {
List<Widget> _widgetList = [];
if (!CaptchaUtil.isEmpty(_clickWordCaptchaModel.imgStr)) {
_widgetList.add(Image(
width: baseSize.width,
height: baseSize.height,
gaplessPlayback: true,
image: MemoryImage(
Base64Decoder().convert(_clickWordCaptchaModel.imgStr))));
}
double _widgetW = 20;
for (int i = 0; i < _tapOffsetList.length; i++) {
Offset offset = _tapOffsetList[i];
_widgetList.add(Positioned(
left: offset.dx - _widgetW * 0.5,
top: offset.dy - _widgetW * 0.5,
child: Container(
alignment: Alignment.center,
width: _widgetW,
height: _widgetW,
decoration: BoxDecoration(
color: Color(0xCC43A047),
borderRadius: BorderRadius.all(Radius.circular(_widgetW))),
child: Text(
"${i + 1}",
style: TextStyle(color: Colors.white, fontSize: 15),
),
)));
}
_widgetList.add(//
Positioned(
top: 0,
right: 0,
child: IconButton(
icon: Icon(Icons.refresh),
iconSize: 30,
color: Colors.deepOrangeAccent,
onPressed: () {
//
_loadCaptcha();
}),
));
return GestureDetector(
onTapDown: (TapDownDetails details) {
debugPrint(
"onTapDown globalPosition全局坐标系位置: ${details.globalPosition} localPosition组件坐标系位置: ${details.localPosition} ");
if (!CaptchaUtil.isListEmpty(_clickWordCaptchaModel.wordList) &&
_tapOffsetList.length < _clickWordCaptchaModel.wordList.length) {
_tapOffsetList.add(
Offset(details.localPosition.dx, details.localPosition.dy));
}
setState(() {});
if (!CaptchaUtil.isListEmpty(_clickWordCaptchaModel.wordList) &&
_tapOffsetList.length == _clickWordCaptchaModel.wordList.length) {
_checkCaptcha();
}
},
child: Container(
width: baseSize.width,
height: baseSize.height,
child: Stack(
children: _widgetList,
),
));
}
//
_bottomContainer() {
return Container(
height: 50.h,
margin: EdgeInsets.only(top: 10),
alignment: Alignment.center,
width: baseSize.width,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(4)),
border: Border.all(color: borderColor)),
child:
Text(bottomTitle, style: TextStyle(fontSize: 18, color: titleColor)),
);
}
//+
_topConttainer() {
return Container(
padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
margin: EdgeInsets.only(bottom: 20, top: 5),
decoration: BoxDecoration(
border: Border(bottom: BorderSide(width: 1, color: Color(0xffe5e5e5))),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Text(
'请完成安全验证',
style: TextStyle(fontSize: 18),
),
IconButton(
icon: Icon(Icons.highlight_off),
iconSize: 35,
color: Colors.black54,
onPressed: () {
//退
Navigator.pop(context);
}),
],
),
);
}
}
//
enum ClickWordCaptchaState {
normal, //
success, //
fail, //
none, // 使
}
//
class ClickWordCaptchaModel {
String imgStr; //url base64 data
String jigsawImageBase64; //url base64 data
String token; // token
List wordList; //
String wordStr; //
String secretKey; //key
ClickWordCaptchaModel(
{this.imgStr = "",
this.jigsawImageBase64 = "",
this.token = "",
this.secretKey = "",
this.wordList = const [],
this.wordStr = ""});
//
static ClickWordCaptchaModel fromMap(Map<String, dynamic> map) {
ClickWordCaptchaModel captchaModel = ClickWordCaptchaModel();
captchaModel.imgStr = map["originalImageBase64"] ?? "";
captchaModel.jigsawImageBase64 = map["jigsawImageBase64"] ?? "";
captchaModel.token = map["token"] ?? "";
captchaModel.secretKey = map["secretKey"] ?? "";
captchaModel.wordList = map["wordList"] ?? [];
if (!CaptchaUtil.isListEmpty(captchaModel.wordList)) {
captchaModel.wordStr = captchaModel.wordList.join(",");
}
return captchaModel;
}
//
Map<String, dynamic> toJson() {
var map = new Map<String, dynamic>();
map['imgStr'] = imgStr;
map['jigsawImageBase64'] = jigsawImageBase64;
map['token'] = token;
map['secretKey'] = token;
map['wordList'] = wordList;
map['wordStr'] = wordStr;
return map;
}
@override
String toString() {
// TODO: implement toString
return JsonEncoder.withIndent(' ').convert(toJson());
}
}

219
lib/login/login_page.dart

@ -75,7 +75,8 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
sharedPreferences.getString("token") != null && sharedPreferences.getString("token") != null &&
sharedPreferences.getString("token") != "") { sharedPreferences.getString("token") != "") {
Navigator.of(context).popAndPushNamed('/router/main_page'); Navigator.of(context).popAndPushNamed('/router/main_page');
} else {initController(); } else {
initController();
client = ApiService(Dio(), context: context); client = ApiService(Dio(), context: context);
isShowLogin = true; isShowLogin = true;
@ -180,15 +181,16 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
_controllerInviteCode.addListener(() { _controllerInviteCode.addListener(() {
print(_controllerInviteCode.text); print(_controllerInviteCode.text);
if (_controllerInviteCode.text != null && _controllerInviteCode.text != "") { if (_controllerInviteCode.text != null &&
if (_controllerInviteCode.text.length == 6 ){ _controllerInviteCode.text != "") {
if (_controllerInviteCode.text.length == 6) {
statusInviteTextColor = Color(0xFF353535); statusInviteTextColor = Color(0xFF353535);
statusInviteLineColor = Color(0xFF32A060); statusInviteLineColor = Color(0xFF32A060);
statusInviteVisible = false; statusInviteVisible = false;
} else { } else {
statusInviteTextColor = Color(0xFFF72626); statusInviteTextColor = Color(0xFFF72626);
statusInviteLineColor = Color(0xFFF72626); statusInviteLineColor = Color(0xFFF72626);
statusInviteVisible = true; statusInviteVisible = true;
} }
} }
}); });
@ -206,7 +208,6 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
Color statusInviteTextColor = Color(0xFF353535); Color statusInviteTextColor = Color(0xFF353535);
Color statusInviteLineColor = Color(0xFF32A060); Color statusInviteLineColor = Color(0xFF32A060);
_sendCode() async { _sendCode() async {
SharedPreferences sharedPreferences = await SharedPreferences.getInstance(); SharedPreferences sharedPreferences = await SharedPreferences.getInstance();
if (!sharedPreferences.containsKey("isShowPrivacyPolicy") || if (!sharedPreferences.containsKey("isShowPrivacyPolicy") ||
@ -228,7 +229,8 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
} }
if (_sendCodeStatus == 0) { if (_sendCodeStatus == 0) {
client client
.sendVerify(areaCode,mobile) .sendVerify(
{"areaCode": areaCode, "mobile": mobile, "verification": ""})
.then((value) => { .then((value) => {
if (value.isSuccess) if (value.isSuccess)
{_sendCodeStatus = 1, countdown()} {_sendCodeStatus = 1, countdown()}
@ -242,8 +244,8 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
} }
}) })
.catchError((error) { .catchError((error) {
SmartDialog.showToast("$error", alignment: Alignment.center); SmartDialog.showToast("$error", alignment: Alignment.center);
}); });
} }
} }
@ -324,28 +326,35 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
var param = { var param = {
"capcha": code, "capcha": code,
"mobile": mobile, "mobile": mobile,
"invite":invite, "invite": invite,
}; };
EasyLoading.show(status: S.of(context).zhengzaijiazai); EasyLoading.show(
BaseData<LoginInfo> value = await client.memberLogin(param).catchError((error) { status: S.of(context).zhengzaijiazai,
maskType: EasyLoadingMaskType.black);
BaseData<LoginInfo> value =
await client.memberLogin(param).catchError((error) {
print(error.message); print(error.message);
SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type), alignment: Alignment.center); SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type),
alignment: Alignment.center);
}); });
// EasyLoading.show(status: S.of(context).zhengzaijiazai); // EasyLoading.show(status: S.of(context).zhengzaijiazai);
Future.delayed(Duration(seconds:2), () { Future.delayed(Duration(seconds: 2), () {
if (value !=null && value.isSuccess) { if (value != null && value.isSuccess) {
saveUserJson(value.data.authInfo.toJson()); saveUserJson(value.data.authInfo.toJson());
eventBus.fire(EventType(3)); eventBus.fire(EventType(3));
Navigator.of(context).pushNamedAndRemoveUntil( Navigator.of(context).pushNamedAndRemoveUntil(
'/router/main_page', '/router/main_page', (route) => false,
(route) => false,arguments:{"invite":invite,"interviewCouponList":value.data.interviewCouponList, arguments: {
"firstLoginCouponList":value.data.firstLoginCouponList}); "invite": invite,
"interviewCouponList": value.data.interviewCouponList,
"firstLoginCouponList": value.data.firstLoginCouponList
});
EasyLoading.dismiss(); EasyLoading.dismiss();
} else { } else {
if(value?.msg !=null) if (value?.msg != null)
SmartDialog.showToast("${value?.msg ??""}", alignment: Alignment.center); SmartDialog.showToast("${value?.msg ?? ""}",
alignment: Alignment.center);
} }
}); });
} }
@ -515,7 +524,7 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
height: MediaQuery.of(context).size.height * 0.78, height: MediaQuery.of(context).size.height * 0.78,
margin: EdgeInsets.only(top: 56.h), margin: EdgeInsets.only(top: 56.h),
alignment: Alignment.topCenter, alignment: Alignment.topCenter,
child:Image.asset( child: Image.asset(
"assets/image/icon_login_logo.webp", "assets/image/icon_login_logo.webp",
width: 91.w, width: 91.w,
height: 91.h, height: 91.h,
@ -708,7 +717,7 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
), ),
), ),
Container( Container(
height:30.h, height: 30.h,
width: MediaQuery.of(context).size.width - 80.h, width: MediaQuery.of(context).size.width - 80.h,
// margin: EdgeInsets.only(top: 12.h), // margin: EdgeInsets.only(top: 12.h),
child: TextField( child: TextField(
@ -754,7 +763,7 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
color: statusPhoneLineColor, color: statusPhoneLineColor,
), ),
SizedBox( SizedBox(
height:30.h, height: 30.h,
child: Visibility( child: Visibility(
visible: statusPhoneVisible, visible: statusPhoneVisible,
child: Text( child: Text(
@ -775,7 +784,7 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
), ),
), ),
Container( Container(
height:30.h, height: 30.h,
width: MediaQuery.of(context).size.width - 80.h, width: MediaQuery.of(context).size.width - 80.h,
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
@ -878,7 +887,7 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
), ),
), ),
SizedBox( SizedBox(
height:25.h, height: 25.h,
// child: Visibility( // child: Visibility(
// visible: statusPhoneVisible, // visible: statusPhoneVisible,
// child: Text( // child: Text(
@ -891,89 +900,95 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
// ), // ),
), ),
GestureDetector( GestureDetector(
onTap: (){ onTap: () {
setState(() { setState(() {
invitationCode = false; invitationCode = false;
}); });
}, },
child: child: invitationCode
invitationCode ? ? Container(
Container(child: child: Column(
Column(children: [ children: [
Text( Text(
S.of(context).woyouyaoqingma, S.of(context).woyouyaoqingma,
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.black, color: Colors.black,
), ),
), ),
Container( Container(
width: 56.w, width: 56.w,
height: 0.5, height: 0.5,
color: Colors.black, color: Colors.black,
), ),
],),):Container(child: Column( ],
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
S.of(context).input_invite_code_hide,
style: TextStyle(
fontSize: 16.sp,
fontWeight: FontWeight.bold,
color: Colors.black,
),
), ),
Container( )
height:25.h, : Container(
width: MediaQuery.of(context).size.width - 80.h, child: Column(
child: TextField( crossAxisAlignment: CrossAxisAlignment.start,
style: TextStyle( children: [
height: 1.h, Text(
fontSize: 16.sp, S.of(context).input_invite_code_hide,
color: statusInviteTextColor, style: TextStyle(
fontSize: 16.sp,
fontWeight: FontWeight.bold,
color: Colors.black,
),
), ),
onChanged: (value){ Container(
setState(() { height: 25.h,
}); width: MediaQuery.of(context).size.width - 80.h,
}, child: TextField(
controller: _controllerInviteCode, style: TextStyle(
keyboardType: TextInputType.text, height: 1.h,
decoration: InputDecoration( fontSize: 16.sp,
errorBorder: InputBorder.none, color: statusInviteTextColor,
focusedBorder: InputBorder.none, ),
enabledBorder: InputBorder.none, onChanged: (value) {
hintText: "", setState(() {});
// contentPadding: EdgeInsets.only(top: 12, bottom: 12, left: 12), },
hintStyle: TextStyle( controller: _controllerInviteCode,
fontSize: 10.sp, keyboardType: TextInputType.text,
color: Color(0xFFA29E9E), decoration: InputDecoration(
errorBorder: InputBorder.none,
focusedBorder: InputBorder.none,
enabledBorder: InputBorder.none,
hintText: "",
// contentPadding: EdgeInsets.only(top: 12, bottom: 12, left: 12),
hintStyle: TextStyle(
fontSize: 10.sp,
color: Color(0xFFA29E9E),
),
),
textInputAction: TextInputAction.next,
inputFormatters: [
LengthLimitingTextInputFormatter(6)
],
cursorColor: Colors.grey,
maxLines: 1,
), ),
), ),
textInputAction: TextInputAction.next, Container(
inputFormatters: [LengthLimitingTextInputFormatter(6)], height: 1.h,
cursorColor: Colors.grey, width: MediaQuery.of(context).size.width - 80.h,
maxLines: 1, color: statusInviteLineColor,
), margin: EdgeInsets.only(bottom: 10.h),
),
Container(
height: 1.h,
width: MediaQuery.of(context).size.width - 80.h,
color: statusInviteLineColor,
margin: EdgeInsets.only(bottom: 10.h),
),
Visibility(
visible: statusInviteVisible,
child: Text(
S.of(context).invite_code_error,
style: TextStyle(
color: Color(0xFFF72626),
fontSize: 12.sp,
), ),
), Visibility(
visible: statusInviteVisible,
child: Text(
S.of(context).invite_code_error,
style: TextStyle(
color: Color(0xFFF72626),
fontSize: 12.sp,
),
),
),
],
), ),
], ),
),),
), ),
Expanded( Expanded(
flex: 1, flex: 1,

90
lib/login/new_login_page.dart

@ -26,6 +26,7 @@ import 'package:sharesdk_plugin/sharesdk_interface.dart';
import '../main.dart'; import '../main.dart';
import '../retrofit/data/channels_list.dart'; import '../retrofit/data/channels_list.dart';
import 'captcha/block_puzzle_captcha.dart';
class NewLoginPage extends StatefulWidget { class NewLoginPage extends StatefulWidget {
final Map<String, dynamic> arguments; final Map<String, dynamic> arguments;
@ -56,22 +57,15 @@ class _NewLoginPage extends State<NewLoginPage> {
String area = "+86"; String area = "+86";
String channelName; String channelName;
ChannelsList channelsList; ChannelsList channelsList;
String mobile;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
isLogin(); isLogin();
queryChannels();
} }
queryChannels() async{ queryChannels() async{
SharedPreferences sharedPreferences = await SharedPreferences.getInstance();
if (!sharedPreferences.containsKey("isShowPrivacyPolicy") ||
!sharedPreferences.getBool("isShowPrivacyPolicy")) {
showAlertDialog();
return;
}
apiService = ApiService(Dio(), context: context);
BaseData<ChannelsList> baseData = await apiService.appChannels().catchError((error) { BaseData<ChannelsList> baseData = await apiService.appChannels().catchError((error) {
print(error.message); print(error.message);
SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type), SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type),
@ -80,7 +74,6 @@ class _NewLoginPage extends State<NewLoginPage> {
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
channelsList = baseData.data; channelsList = baseData.data;
setState((){}); setState((){});
EasyLoading.dismiss();
} else { } else {
if (baseData?.msg != null) if (baseData?.msg != null)
SmartDialog.showToast(baseData.msg, alignment: Alignment.center); SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
@ -136,37 +129,22 @@ class _NewLoginPage extends State<NewLoginPage> {
showAlertDialog(); showAlertDialog();
return; return;
} }
if (!checkStatus) { mobile = _controllerPhone.text;
SmartDialog.showToast(S.of(context).gouxuanxieyi,
alignment: Alignment.center);
return;
}
var mobile = _controllerPhone.text;
if (mobile == "") { if (mobile == "") {
mobileStatus = 2; mobileStatus = 2;
mobileErrorText = S.of(context).qingshurushoujihao; mobileErrorText = S.of(context).qingshurushoujihao;
SmartDialog.showToast(S.of(context).qingshurushoujihao,
alignment: Alignment.center);
setState(() {}); setState(() {});
return; return;
} }
if (!checkStatus) {
SmartDialog.showToast(S.of(context).gouxuanxieyi,
alignment: Alignment.center);
return;
}
if (_sendCodeStatus == 0) { if (_sendCodeStatus == 0) {
apiService loadingBlockPuzzle(context);
.sendVerify(area, mobile)
.then((value) => {
if (value.isSuccess)
{_sendCodeStatus = 1, countdown()}
else
{
btnText = S.of(context).send_code,
_sendCodeStatus = 0,
SmartDialog.showToast("${value.msg}",
alignment: Alignment.center),
refresh()
}
})
.catchError((error) {
SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type),
alignment: Alignment.center);
});
} }
} }
@ -241,7 +219,7 @@ class _NewLoginPage extends State<NewLoginPage> {
"areaCode": area, "areaCode": area,
"regChannel":channelName ?? "" "regChannel":channelName ?? ""
}; };
EasyLoading.show(status: S.of(context).zhengzaijiazai); EasyLoading.show(status: S.of(context).zhengzaijiazai,maskType: EasyLoadingMaskType.black);
BaseData value = await apiService.memberLogin(param).catchError((error) { BaseData value = await apiService.memberLogin(param).catchError((error) {
print(error.message); print(error.message);
SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type), SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type),
@ -262,11 +240,11 @@ class _NewLoginPage extends State<NewLoginPage> {
"interviewCouponList": userInfo.interviewCouponList, "interviewCouponList": userInfo.interviewCouponList,
"firstLoginCouponList": userInfo.firstLoginCouponList "firstLoginCouponList": userInfo.firstLoginCouponList
}); });
EasyLoading.dismiss();
} else { } else {
if (value.msg != null) if (value.msg != null)
SmartDialog.showToast(value?.msg, alignment: Alignment.center); SmartDialog.showToast(value?.msg, alignment: Alignment.center);
} }
EasyLoading.dismiss();
} }
saveUserJson(userJson) { saveUserJson(userJson) {
@ -295,11 +273,10 @@ class _NewLoginPage extends State<NewLoginPage> {
sharedPreferences.getString("mobile") == "13800138000"; sharedPreferences.getString("mobile") == "13800138000";
Navigator.of(context).popAndPushNamed('/router/main_page'); Navigator.of(context).popAndPushNamed('/router/main_page');
} else { } else {
initController();
apiService = ApiService(Dio(), context: context); apiService = ApiService(Dio(), context: context);
initController();
isShowLogin = true; isShowLogin = true;
setState(() {}); queryChannels();
} }
} }
@ -974,4 +951,41 @@ class _NewLoginPage extends State<NewLoginPage> {
r'^((13[0-9])|(14[0-9])|(15[0-9])|(16[0-9])|(17[0-9])|(18[0-9])|(19[0-9]))\d{8}$'); r'^((13[0-9])|(14[0-9])|(15[0-9])|(16[0-9])|(17[0-9])|(18[0-9])|(19[0-9]))\d{8}$');
return exp.hasMatch(mobile); return exp.hasMatch(mobile);
} }
//
loadingBlockPuzzle(BuildContext context,
{barrierDismissible = true}) {
showDialog<Null>(
context: context,
barrierDismissible: barrierDismissible,
builder: (BuildContext context) {
return BlockPuzzleCaptchaPage(
onSuccess: (v) {
sendSms(v);
},
onFail: () {
print("onFail");
},
);
},
);
}
sendSms(v) async{
BaseData baseData = await apiService.sendVerify({"areaCode":area, "mobile": mobile, "verification": v}).catchError((onError) {
SmartDialog.showToast(AppUtils.dioErrorTypeToString(onError.type),
alignment: Alignment.center);});
if (baseData != null && baseData.isSuccess) {
_sendCodeStatus = 1;
countdown();
SmartDialog.showToast(baseData.data,
alignment: Alignment.center);
}else{
btnText = S.of(context).send_code;
_sendCodeStatus = 0;
SmartDialog.showToast("${baseData.msg}",
alignment: Alignment.center);
refresh();
}
}
} }

6
lib/main.dart

@ -73,6 +73,7 @@ import 'package:huixiang/settlement/settlement.dart';
import 'package:huixiang/store/store_view/product_meals_sku.dart'; import 'package:huixiang/store/store_view/product_meals_sku.dart';
import 'package:huixiang/test_page.dart'; import 'package:huixiang/test_page.dart';
import 'package:huixiang/union/location_map_page.dart'; import 'package:huixiang/union/location_map_page.dart';
import 'package:huixiang/union/union_select_city.dart';
import 'package:huixiang/utils/ImgCachePath.dart'; import 'package:huixiang/utils/ImgCachePath.dart';
import 'package:huixiang/vip/user_vip_service_page.dart'; import 'package:huixiang/vip/user_vip_service_page.dart';
@ -133,6 +134,7 @@ import 'mine/manage_address_page.dart';
import 'mine/mine_greenery.dart'; import 'mine/mine_greenery.dart';
import 'mine/mine_shop_details.dart'; import 'mine/mine_shop_details.dart';
import 'mine/mine_shop_page.dart'; import 'mine/mine_shop_page.dart';
import 'mine/mine_shop_recharge.dart';
import 'mine/mine_view/community_follow.dart'; import 'mine/mine_view/community_follow.dart';
import 'mine/mine_vip/binding_assistant_card.dart'; import 'mine/mine_vip/binding_assistant_card.dart';
import 'mine/mine_vip/legal_right_details.dart'; import 'mine/mine_vip/legal_right_details.dart';
@ -426,6 +428,8 @@ Map<String, WidgetBuilder> routers = <String, WidgetBuilder>{
MineGreenery(), MineGreenery(),
'/router/mine_shop_page': (context, {arguments}) => '/router/mine_shop_page': (context, {arguments}) =>
MineShopPage(), MineShopPage(),
'/router/mine_shop_recharge': (context, {arguments}) =>
MineShopRecharge(arguments: arguments,),
'/router/mine_shop_details': (context, {arguments}) => '/router/mine_shop_details': (context, {arguments}) =>
MineShopDetails(arguments:arguments,), MineShopDetails(arguments:arguments,),
'/router/coupon_page': (context, {arguments}) => '/router/coupon_page': (context, {arguments}) =>
@ -462,6 +466,8 @@ Map<String, WidgetBuilder> routers = <String, WidgetBuilder>{
BindingPhonePage(arguments:arguments), BindingPhonePage(arguments:arguments),
'/router/trading_card_page': (context, {arguments}) => '/router/trading_card_page': (context, {arguments}) =>
TradingCardPage(), TradingCardPage(),
'/router/union_select_city': (context, {arguments}) =>
UnionSelectCity(arguments:arguments),
'/router/business_login_page': (context, {arguments}) => '/router/business_login_page': (context, {arguments}) =>
BusinessLoginPage(arguments: arguments), BusinessLoginPage(arguments: arguments),
'/router/business_page': (context, {arguments}) => '/router/business_page': (context, {arguments}) =>

110
lib/mine/mine_page.dart

@ -26,9 +26,11 @@ import 'package:shared_preferences/shared_preferences.dart';
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import '../retrofit/data/banner.dart';
import '../retrofit/data/coupon.dart'; import '../retrofit/data/coupon.dart';
import '../retrofit/data/page.dart'; import '../retrofit/data/page.dart';
import '../utils/flutter_utils.dart'; import '../utils/flutter_utils.dart';
import '../view_widget/custom_image.dart';
import 'mine_view/mine_item.dart'; import 'mine_view/mine_item.dart';
import 'mine_view/mine_view.dart'; import 'mine_view/mine_view.dart';
@ -49,6 +51,7 @@ class MinePageState extends State<MinePage> with AutomaticKeepAliveClientMixin {
final RefreshController _refreshController = RefreshController(); final RefreshController _refreshController = RefreshController();
int totalMsg = 0; int totalMsg = 0;
String couponNum; String couponNum;
List<BannerData> activityBannerData = [];
_toUserInfo() async { _toUserInfo() async {
SharedPreferences shared = await SharedPreferences.getInstance(); SharedPreferences shared = await SharedPreferences.getInstance();
@ -78,6 +81,7 @@ class MinePageState extends State<MinePage> with AutomaticKeepAliveClientMixin {
querySocialInfo(); querySocialInfo();
queryMsgStats(); queryMsgStats();
queryCoupon(); queryCoupon();
queryActivityBanner();
// queryCard(); // queryCard();
eventBus.on<EventType>().listen((event) { eventBus.on<EventType>().listen((event) {
@ -136,6 +140,23 @@ class MinePageState extends State<MinePage> with AutomaticKeepAliveClientMixin {
// EasyLoading.dismiss(); // EasyLoading.dismiss();
} }
///banner
queryActivityBanner() async {
SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(
Dio(),
context: context,
token: value.getString("token"),
showLoading: false,
);
BaseData<PageInfo<BannerData>> baseData = await apiService.queryBanner({
"model": {"type": "HOME_STORE_PAGE"},
}).catchError((onError) {});
if (baseData != null && baseData.isSuccess) {
activityBannerData = baseData.data.records;
}
}
queryCoupon() async { queryCoupon() async {
SharedPreferences value = await SharedPreferences.getInstance(); SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService( apiService = ApiService(
@ -166,6 +187,7 @@ class MinePageState extends State<MinePage> with AutomaticKeepAliveClientMixin {
queryCoupon(); queryCoupon();
querySocialInfo(); querySocialInfo();
queryMsgStats(); queryMsgStats();
queryActivityBanner();
} }
///(//) ///(//)
@ -427,10 +449,11 @@ class MinePageState extends State<MinePage> with AutomaticKeepAliveClientMixin {
///广 ///广
Widget spreadImage() { Widget spreadImage() {
return Container( return Container(
margin: EdgeInsets.only(bottom: 30.h,),
width: double.infinity, width: double.infinity,
margin: EdgeInsets.only(bottom:24.h),
height: 85.h, height: 85.h,
child: Swiper( child: activityBannerData != null && activityBannerData.isNotEmpty
? Swiper(
pagination: SwiperPagination( pagination: SwiperPagination(
alignment: Alignment.bottomCenter, alignment: Alignment.bottomCenter,
margin: EdgeInsets.only(top: 5.h), margin: EdgeInsets.only(top: 5.h),
@ -442,37 +465,82 @@ class MinePageState extends State<MinePage> with AutomaticKeepAliveClientMixin {
color: Colors.white.withAlpha(76), color: Colors.white.withAlpha(76),
), ),
), ),
autoplay:true, autoplay: true,
duration: 1000, duration: 1000,
autoplayDelay: 2000, autoplayDelay: 2000,
itemBuilder: (context, position) { itemBuilder: (context, position) {
return GestureDetector( return InkWell(
onTap: (){ onTap: () {
if(position == 0){ spreadBannerClick(activityBannerData[position]);
Navigator.of(context).pushNamed('/router/invite_friends');
}else if(position == 1){
Navigator.of(context).pushNamed('/router/trading_card_page');
}
}, },
child:Container( child: Container(
margin: EdgeInsets.symmetric(horizontal:14.w), margin: EdgeInsets.symmetric(horizontal: 14.w),
child: ClipRRect( child: MImage(
child:Image.asset( activityBannerData[position].imgUrl,
spreadItem[position], fit: BoxFit.cover,
width:double.infinity, radius: BorderRadius.circular(6),
fit: BoxFit.fill, errorSrc: "assets/image/default_2_1.webp",
height:double.infinity, fadeSrc: "assets/image/default_2_1.webp",
),
borderRadius: BorderRadius.circular(6.w),
), ),
), ),
); );
}, },
itemCount:2, itemCount: activityBannerData.length,
)
: Image.asset(
"assets/image/default_2_1.webp",
fit: BoxFit.cover,
), ),
); );
} }
/// contentType 0123,4:,5:7
spreadBannerClick(BannerData activityBannerData) async {
switch (activityBannerData.contentType) {
case 1:
Navigator.of(context).pushNamed('/router/integral_store_page',
arguments: {"goodsId": activityBannerData.content});
break;
case 2:
Navigator.of(context).pushNamed('/router/web_page', arguments: {
"activityId": activityBannerData.content,
});
break;
case 3:
Navigator.of(context).pushNamed('/router/web_page', arguments: {
"articleId": activityBannerData.content,
});
break;
case 4:
String router = activityBannerData.content;
// String router = "/router/store_order?{\"id\":\"1512378184161558528\",\"tenant\":\"1188\",\"storeName\":\"农场煮意\"}";
if (router.contains("?")) {
String params = router.substring(router.indexOf("?") + 1);
Map map = jsonDecode(params);
Navigator.of(context).pushNamed(
router.substring(0, router.indexOf("?")),
arguments: map);
} else {
Navigator.of(context).pushNamed(router);
}
break;
case 5:
Navigator.of(context).pushNamed('/router/class_details', arguments: {
"id": activityBannerData.content,
});
break;
case 7:
String params = activityBannerData.content
.substring(activityBannerData.content.indexOf("?") + 1);
Map map = jsonDecode(params);
Navigator.of(context).pushNamed(
activityBannerData.content
.substring(0, activityBannerData.content.indexOf("?")),
arguments: map);
break;
}
}
final List<String> spreadItem = [ final List<String> spreadItem = [
"assets/image/welfare_spread.webp", "assets/image/welfare_spread.webp",
"assets/image/welfare_yz.webp", "assets/image/welfare_yz.webp",

6
lib/mine/mine_shop_details.dart

@ -511,6 +511,12 @@ class _MineShopDetails extends State<MineShopDetails> {
), ),
), ),
), ),
if(((store.distance ?? 0) > 1000
? S.of(context).gongli(
((store.distance ?? 0) / 1000 * 100).toInt() / 100.0)
: S
.of(context)
.mi(((store.distance ?? 0) * 100).toInt() / 100.0)) != "0.0米")
Text( Text(
(store.distance ?? 0) > 1000 (store.distance ?? 0) > 1000
? S.of(context).gongli( ? S.of(context).gongli(

233
lib/mine/mine_shop_page.dart

@ -2,6 +2,7 @@ import 'dart:convert';
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/page.dart'; import 'package:huixiang/retrofit/data/page.dart';
@ -27,88 +28,195 @@ class MineShopPage extends StatefulWidget {
} }
} }
class _MineShopPage extends State<MineShopPage> { class _MineShopPage extends State<MineShopPage> with WidgetsBindingObserver{
List<VipCard> coupons = []; List<VipCard> coupons = [];
ApiService apiService; ApiService apiService;
int current = 1; int current = 1;
RefreshController refreshController ; RefreshController refreshController ;
final TextEditingController editingController = TextEditingController();
int optionIndex = 0;
bool isKeyBoardShow = false;
List<String> hotSearch = [];
List<String> historySearch = [];
FocusNode _focusNode = FocusNode();
bool hasFocus = true;
int priceOrder = 0;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
refreshController = RefreshController(); refreshController = RefreshController();
SharedPreferences.getInstance().then((value) { SharedPreferences.getInstance().then((value) {
apiService = apiService =
ApiService(Dio(), context: context, token: value.getString("token")); ApiService(Dio(), context: context, token: value.getString("token"));
queryVipCard(); queryVipCard();
}); });
_focusNode.addListener(() {
setState(() {
hasFocus = _focusNode.hasFocus;
});
});
} }
_onRefresh() { @override
current = 1; void didChangeMetrics() {
queryVipCard(); super.didChangeMetrics();
WidgetsBinding.instance.addPostFrameCallback((_) {
setState(() {
print("object: ${MediaQuery.of(context).viewInsets.bottom}");
if (MediaQuery.of(context).viewInsets.bottom == 0) {
if (isKeyBoardShow) {
isKeyBoardShow = false;
//
FocusScope.of(context).requestFocus(FocusNode());
}
} else {
isKeyBoardShow = true;
}
});
});
}
///
@override
void dispose() {
_focusNode.unfocus();
refreshController.dispose();
super.dispose();
} }
queryVipCard() async { queryVipCard({bool showLoading = true}) async {
BaseData<List<VipCard>> baseData = try{
await apiService.vipList({}).catchError((error) { if(showLoading)EasyLoading.show(status: S.current.zhengzaijiazai, maskType: EasyLoadingMaskType.black);
refreshController.refreshFailed(); BaseData<List<VipCard>> baseData =
}); await apiService.vipList({
if (baseData != null && baseData.isSuccess) { "keywords":editingController.text,
coupons.clear(); }).catchError((error) {
coupons.addAll(baseData.data); refreshController.refreshFailed();
setState(() {
refreshController.refreshCompleted();
}); });
} else { if (baseData != null && baseData.isSuccess) {
refreshController.refreshFailed(); coupons.clear();
coupons.addAll(baseData.data);
refreshController.refreshCompleted();
} else {
refreshController.refreshFailed();
}
}finally{
EasyLoading.dismiss();
setState(() {});
} }
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return GestureDetector(
appBar: MyAppBar( behavior: HitTestBehavior.opaque,
title: S.of(context).dianpuyue, onTap: (){
titleColor: Colors.black, FocusScope.of(context).requestFocus(FocusNode());
background: Colors.white, },
leadingColor: Colors.black, child: Scaffold(
resizeToAvoidBottomInset: false,
appBar: MyAppBar(
title: "店铺充值",
titleColor: Colors.black,
background: Colors.white,
leadingColor: Colors.black,
),
body:Column(
children: [
Container(
color: Colors.white,
padding: EdgeInsets.only(top:10.h,bottom:18.h,),
child: searchShopItem(),
),
Expanded(child: SmartRefresher(
enablePullDown: true,
enablePullUp: false,
header: MyHeader(),
footer: CustomFooter(
builder: (context, mode) {
return MyFooter(mode);
},
),
controller: refreshController,
onRefresh: queryVipCard,
physics: BouncingScrollPhysics(),
child: (coupons != null && coupons.length > 0)
? ListView.builder(
padding: EdgeInsets.symmetric(vertical: 8.h),
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {
Navigator.of(context).pushNamed(
'/router/mine_shop_recharge',
arguments: {
"id": coupons[position].id,
"tenantCode":coupons[position].tenantCode,
"storeId":coupons[position].storeList[0].id
}).then((value) {
queryVipCard(showLoading: false);
});
},
child: shopItem(coupons[position]),
);
},
itemCount: coupons != null ? coupons.length : 0,
)
: NoDataView(
src: "assets/image/icon_empty.webp",
isShowBtn: false,
text: "还没有会员卡~",
fontSize: 16.sp,
margin: EdgeInsets.only(top: 120.h),
),
),)
],
),
), ),
body: SmartRefresher( );
enablePullDown: true, }
enablePullUp: false,
header: MyHeader(), Widget searchShopItem() {
footer: CustomFooter( return Container(
builder: (context, mode) { margin: EdgeInsets.fromLTRB(14.w, 0, 14.w, 0),
return MyFooter(mode); padding: EdgeInsets.symmetric(vertical: 6.h),
}, decoration: BoxDecoration(
color: Color(0xFFF5FAF7),
borderRadius: BorderRadius.circular(4),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
),
],
),
child: TextField(
textInputAction: TextInputAction.search,
onEditingComplete: () {
FocusScope.of(context).requestFocus(FocusNode());
queryVipCard();
},
controller: editingController,
style: TextStyle(
fontSize: 14.sp,
), ),
controller: refreshController, decoration: InputDecoration(
onRefresh: queryVipCard, hintText: "搜索联盟会员店",
physics: BouncingScrollPhysics(), hintStyle: TextStyle(
child: (coupons != null && coupons.length > 0) fontSize: 12.sp,
? ListView.builder( color: Color(0xFFB3B3B3),
padding: EdgeInsets.symmetric(vertical: 8.h), ),
itemBuilder: (context, position) { isCollapsed: true,
return GestureDetector( prefixIcon:Padding(padding: EdgeInsets.only(left: 5.w,right: 5.w),child: Image.asset(
onTap: () { "assets/image/icon_search.webp",
Navigator.of(context).pushNamed( width: 16.h,
'/router/mine_shop_details', height: 16.h,
arguments: {"id": coupons[position].id}); ),),
}, prefixIconConstraints: BoxConstraints(),
child: shopItem(coupons[position]), border: InputBorder.none,
);
},
itemCount: coupons != null ? coupons.length : 0,
)
: NoDataView(
src: "assets/image/icon_empty.webp",
isShowBtn: false,
text: "还没有会员卡~",
fontSize: 16.sp,
margin: EdgeInsets.only(top: 120.h),
), ),
), ),
); );
@ -218,19 +326,20 @@ class _MineShopPage extends State<MineShopPage> {
), ),
)), )),
Text( Text(
S.of(context).chakanxiangqing, "去充值",
style: TextStyle( style: TextStyle(
color: Color(0xFF353535), color: Color(0xFF262626),
fontSize: 12.sp, fontSize: 12.sp,
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
), ),
), ),
SizedBox(width: 2,), SizedBox(width: 2,),
Icon( Image.asset(
Icons.chevron_right, "assets/image/icon_right_z.webp",
size: 24, width: 16,
color: Colors.black, height: 16,
), color: Color(0xFF262626),
)
], ],
), ),
], ],

908
lib/mine/mine_shop_recharge.dart

@ -0,0 +1,908 @@
import 'dart:io';
import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_html/flutter_html.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:fluwx/fluwx.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/vip_card.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/store/scan.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/custom_image.dart';
import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:shared_preferences/shared_preferences.dart';
import '../retrofit/data/member_recharge_list.dart';
import '../retrofit/data/rechargeActLists.dart';
import '../retrofit/data/wx_pay.dart';
import '../retrofit/min_api.dart';
import '../utils/flutter_utils.dart';
import '../utils/min.dart';
import '../view_widget/classic_header.dart';
import '../view_widget/my_footer.dart';
import '../view_widget/no_data_view.dart';
import '../view_widget/recharge_details_dialog.dart';
import 'package:tobias/tobias.dart' as tobias;
class MineShopRecharge extends StatefulWidget {
final Map<String, dynamic> arguments;
MineShopRecharge({this.arguments});
@override
State<StatefulWidget> createState() {
return _MineShopRecharge();
}
}
class _MineShopRecharge extends State<MineShopRecharge> {
ApiService apiService;
MinApiService minService;
VipCard vipCard;
List<MemberRechargeList> memberRechargeList = [];
int selectIndex = 0;
double discount = 100;
var checkIndex = 2;
dynamic payListen;
int _loadCount = 0;
String tenant;
String storeId;
String minToken;
final RefreshController refreshController = RefreshController();
@override
void dispose() {
super.dispose();
refreshController.dispose();
if (payListen != null) payListen.cancel();
}
@override
void initState() {
super.initState();
storeId = widget.arguments["storeId"];
tenant = widget.arguments["tenantCode"];
_onRefresh();
payListen = weChatResponseEventHandler.listen((event) async {
print("payCallback: ${event.errCode}");
if (event.errCode == 0) {
SmartDialog.showToast("充值成功", alignment: Alignment.center);
} else {
SmartDialog.showToast("充值失败", alignment: Alignment.center);
}
vipDetail();
});
}
///
vipDetail({bool isSingle = true}) async {
try {
BaseData<VipCard> baseData = await apiService.vipDetail({
"id": widget.arguments["id"],
"latitude": "",
"longitude": "",
}).catchError((onError) {});
if (baseData != null && baseData.isSuccess) {
vipCard = baseData.data;
}
} finally {
if (isSingle)
setState(() {});
else
addLoadCount();
}
}
///
minLogin() async {
try {
var baseData = await apiService.minLogin(storeId).catchError((onError) {
debugPrint(onError.toString());
});
if (baseData != null && baseData.isSuccess) {
minToken = baseData.data["token"];
SharedPreferences.getInstance().then(
(value) => {
value.setString('minToken', minToken),
value.setString('tenant', tenant),
value.setString('storeId', storeId),
},
);
minService = MinApiService(
Dio(),
context: context,
token: minToken,
tenant: tenant,
storeId: storeId,
);
}
} finally {}
}
///
queryRechargeActList() async {
try {
BaseData<List<MemberRechargeList>> baseData =
await minService.memberRechargeList().catchError((onError) {});
if (baseData != null && baseData.isSuccess) {
memberRechargeList = baseData.data;
}
} finally {
addLoadCount();
}
}
///
shopRecharge() async {
if (minService == null) await minLogin();
BaseData<dynamic> baseData = await minService.memberRecharge({
"money": 0,
"rechargeId": memberRechargeList[selectIndex].id,
"type": checkIndex == 2 ? "wechat" : "alipay",
}).catchError((error) {});
if (baseData != null && baseData.isSuccess) {
if (checkIndex == 2) {
if (Platform.isAndroid) {
if (!(await Min.isInitialize())) {
// app的充值支付使用同一个WXPayEntryActivity回调
// getPackage空指针
//
await Min.initialize();
}
}
WxPay wxPay = WxPay.fromJson(baseData.data);
await registerWxApi(
appId: wxPay.appId,
doOnAndroid: true,
universalLink: "https://hx.lotus-wallet.com/app/",
);
payWithWeChat(
appId: wxPay.appId,
partnerId: wxPay.partnerId,
prepayId: wxPay.prepayId,
packageValue: wxPay.packageValue,
nonceStr: wxPay.nonceStr,
timeStamp: int.tryParse(wxPay.timeStamp),
sign: wxPay.sign,
);
} else {
tobias.isAliPayInstalled().then((value) => {
//
if (!value)
{SmartDialog.showToast("请安装支付宝", alignment: Alignment.center)}
else
{
tobias.aliPay(baseData.data["body"]).then((payRes) {
if (payRes['resultStatus'] == 9000 ||
payRes['resultStatus'] == '9000') {
SmartDialog.showToast("充值成功",
alignment: Alignment.center);
} else {
SmartDialog.showToast(payRes['memo'],
alignment: Alignment.center);
}
vipDetail();
})
}
});
}
} else {
SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
}
}
_onRefresh() async {
EasyLoading.show(
status: S.current.zhengzaijiazai, maskType: EasyLoadingMaskType.black);
if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance();
apiService =
ApiService(Dio(), context: context, token: value.getString("token"));
}
if (minService == null) await minLogin();
vipDetail(isSingle: false);
queryRechargeActList();
}
addLoadCount() {
_loadCount += 1;
if (_loadCount == 2) {
_loadCount = 0;
EasyLoading.dismiss();
if (refreshController.isRefresh) refreshController.refreshCompleted();
if (mounted) setState(() {});
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: MyAppBar(
title: "店铺充值",
titleColor: Colors.black,
background: Colors.white,
brightness: Brightness.dark,
leadingColor: Colors.black,
),
body: SmartRefresher(
enablePullDown: true,
enablePullUp: false,
header: MyHeader(),
footer: CustomFooter(
builder: (context, mode) {
return MyFooter(mode);
},
),
controller: refreshController,
onRefresh: _onRefresh,
physics: BouncingScrollPhysics(),
child: Column(
children: [
shopRechargeCard(),
(memberRechargeList != null &&
(memberRechargeList?.length ?? 0) > 0)
? Expanded(
child: ListView.builder(
padding: EdgeInsets.zero,
itemCount: (memberRechargeList != null &&
(memberRechargeList?.length ?? 0) > 0)
? memberRechargeList.length
: 0,
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: BouncingScrollPhysics(),
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {
setState(() {
selectIndex = position;
});
},
child: rechargeItem(
memberRechargeList[position], position));
},
))
: NoDataView(
src: "assets/image/xiao_fei.webp",
isShowBtn: false,
text: "当前店铺暂无充值套餐~",
fontSize: 16.sp,
margin:
EdgeInsets.only(top: 90.h, left: 60.w, right: 60.w),
),
if (memberRechargeList != null &&
(memberRechargeList?.length ?? 0) > 0)
Container(
width: double.infinity,
margin: EdgeInsets.only(left: 16, right: 16),
padding: EdgeInsets.only(
top: 20.h,
bottom: 24.h,
),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(bottom: 16.h),
child: Text(
S.of(context).zhifufangshi,
style: TextStyle(
fontSize: 16.sp,
color: Colors.black,
fontWeight: FontWeight.bold,
),
),
),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
setState(() {
checkIndex = 2;
});
},
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Image.asset("assets/image/icon_we_chat.webp"),
Expanded(
flex: 1,
child: Padding(
padding: EdgeInsets.only(left: 8.w),
child: Text(
S.of(context).weixinzhifu,
style: TextStyle(
fontSize: 14.sp,
color: Color(0xff353535),
),
),
),
),
checkView(2),
],
),
),
SizedBox(height: 10.h),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
setState(() {
checkIndex = 3;
});
},
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Image.asset("assets/image/icon_alipay.webp"),
Expanded(
flex: 1,
child: Padding(
padding: EdgeInsets.only(left: 8.w),
child: Text(
S.of(context).zhifubao,
style: TextStyle(
fontSize: 14.sp,
color: Color(0xff353535),
),
),
),
),
checkView(3),
],
),
),
],
),
),
if (memberRechargeList != null &&
(memberRechargeList?.length ?? 0) > 0)
Align(
alignment: Alignment.bottomCenter,
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
shopRecharge();
},
child: Container(
height: 56.h,
width: double.infinity,
alignment: Alignment.center,
decoration: BoxDecoration(
color: Color(0xFF32A060),
borderRadius: BorderRadius.circular(27),
),
margin: EdgeInsets.only(
top: 12.h, left: 16.w, right: 16.w, bottom: 21.h),
child: Text(
S.of(context).querenchongzhi,
style: TextStyle(
fontSize: 16.sp,
fontWeight: MyFontWeight.medium,
color: Colors.white,
),
),
),
),
)
],
),
));
}
///
int colorByName(String storeName) {
if (storeName == null) return 0xFF32A060;
if (storeName.contains("百年川椒") || storeName.contains("百年川椒")) {
return 0xFFC30D23;
} else if (storeName.contains("海峡姐妹") || storeName.contains("海峽姐妹")) {
return 0xFFE4C796;
} else if (storeName.contains("前进麦味") || storeName.contains("前進麥味")) {
return 0xFF265782;
}
return 0xFF32A060;
}
///
Widget shopRechargeCard() {
return GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
Navigator.of(context).pushNamed('/router/mine_shop_details',
arguments: {"id": widget.arguments["id"]});
},
child: Container(
width: double.infinity,
// height:140.h,
margin:
EdgeInsets.only(bottom: 24.h, top: 14.h, left: 14.w, right: 14.w),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
decoration: BoxDecoration(
borderRadius: new BorderRadius.only(
topLeft: Radius.circular(6),
topRight: Radius.circular(6),
),
color: Color(colorByName(vipCard?.tenantName ?? "")),
),
padding: EdgeInsets.only(left: 12.w),
height: 62.h,
child: Row(
children: [
MImage(
(vipCard?.storeList?.length ?? 0) > 0
? vipCard.storeList[0].logo
: "",
width: 38,
height: 38,
radius: BorderRadius.circular(100),
fit: BoxFit.cover,
errorSrc: "assets/image/default_1.webp",
fadeSrc: "assets/image/default_1.webp",
),
SizedBox(
width: 6,
),
Text(
vipCard != null ? vipCard.tenantName : "",
style: TextStyle(
color: Color(0xFFFFFFFF),
fontSize: 15.sp,
fontWeight: MyFontWeight.medium,
),
),
],
),
),
Container(
decoration: BoxDecoration(
borderRadius: new BorderRadius.only(
bottomRight: Radius.circular(6),
topRight: Radius.circular(6),
),
color: Colors.white,
),
padding: EdgeInsets.all(12.h),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"店铺余额(元)",
style: TextStyle(
color: Color(0xFF262626),
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
),
),
Text(
"No.${vipCard?.id ?? ""}",
style: TextStyle(
color: Color(0xFF262626),
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
),
),
],
),
SizedBox(
height: 4.h,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
child: Text(
"${vipCard != null ? vipCard.balance : ""}",
style: TextStyle(
color: Color(0xFF262626),
fontSize: 24.sp,
fontFamily: 'JDZhengHT',
fontWeight: MyFontWeight.medium,
),
),
),
Text(
"适用门店",
style: TextStyle(
color: Color(0xFF262626),
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
),
),
SizedBox(
width: 2,
),
Image.asset(
"assets/image/icon_right_z.webp",
width: 16,
height: 16,
color: Color(0xFF262626),
)
],
),
],
),
),
],
),
),
);
}
///item
Widget rechargeItem(MemberRechargeList memberRechargeList, index) {
return Container(
width: double.infinity,
height: 69.h,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4),
border: Border.all(
color:
selectIndex == index ? Color(0xFF32A060) : Color(0xFFFAFAFA),
width: selectIndex == index ? 1 : 0,
),
color: selectIndex == index ? Color(0XFFF0FAF4) : Colors.white),
margin: EdgeInsets.only(bottom: 14.h, left: 14.w, right: 14.w),
padding: EdgeInsets.only(left: 16),
child: Flex(
direction: Axis.horizontal,
children: [
Expanded(
flex: 1,
child: Container(
child: Text.rich(
TextSpan(children: [
TextSpan(
text: "储值 ",
style: TextStyle(
fontSize: 12.sp,
color: selectIndex == index
? Color(0xFF4D4D4D)
: Color(0xFF868686),
fontWeight: MyFontWeight.regular),
),
TextSpan(
text:
"${AppUtils.calculateDouble(double.tryParse(memberRechargeList.rechargeMoney) ?? 0)}",
style: TextStyle(
fontSize: 18.sp,
fontFamily: 'JDZhengHT',
color: selectIndex == index
? Color(0xFF353535)
: Color(0xFF868686),
fontWeight: MyFontWeight.semi_bold),
),
]),
),
)),
Container(
width: 1.w,
height: 37.h,
color:
selectIndex == index ? Color(0xFF32A060) : Color(0xFF979797),
margin: EdgeInsets.only(right: 16.w, left: 12),
),
Expanded(
flex: 2,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text.rich(
TextSpan(children: [
TextSpan(
text: "实际到账 ",
style: TextStyle(
fontSize: 12.sp,
color: selectIndex == index
? Color(0xFF353535)
: Color(0xFF868686),
fontWeight: MyFontWeight.regular),
),
TextSpan(
text:
"${((memberRechargeList?.limitNum ?? 0) != 0 && ((memberRechargeList?.limitNum ?? 0) - (memberRechargeList?.useNum ?? 0) <= 0)) ?
(AppUtils.calculateDouble(double.tryParse(memberRechargeList.rechargeMoney) ?? 0)) :
(AppUtils.calculateDouble((double.tryParse(memberRechargeList.rechargeMoney) ?? 0) + (double.tryParse(memberRechargeList.giftdMoney) ?? 0) + ((double.tryParse(memberRechargeList.rechargeMoney) ?? 0) - ((double.tryParse(memberRechargeList.rechargeMoney) ?? 0) * (discount / 100)))))}",
style: TextStyle(
fontSize: 18.sp,
fontFamily: 'JDZhengHT',
color: selectIndex == index
? Color(0xFF353535)
: Color(0xFF868686),
fontWeight: MyFontWeight.semi_bold),
),
]),
),
SizedBox(
height: 4.h,
),
GestureDetector(
onTap: () {
setState(() {
if (selectIndex == index)
showRecharge(memberRechargeList, index);
});
},
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
"充值说明",
style: TextStyle(
color: selectIndex == index
? Color(0xFF4D4D4D)
: Color(0xFF868686),
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
),
),
Icon(
Icons.chevron_right,
size: 20,
color: selectIndex == index
? Color(0xFF353535)
: Color(0xFF868686),
),
],
)),
],
))
],
));
}
Widget checkView(var index) {
return Container(
padding: EdgeInsets.only(right: 16.w, left: 46.w),
alignment: Alignment.center,
child: Image.asset(
checkIndex != index
? "assets/image/icon_radio_unselected.webp"
: "assets/image/icon_radio_selected.webp",
width: 15.w,
height: 15.h,
),
);
}
///
showRecharge(MemberRechargeList memberRechargeList, index) {
showModalBottomSheet(
context: context,
backgroundColor: Colors.transparent,
builder: (context) {
return Container(
padding: EdgeInsets.only(top: 12),
decoration: new BoxDecoration(
color: Colors.white,
borderRadius: new BorderRadius.only(
topLeft: const Radius.circular(25.0),
topRight: const Radius.circular(25.0))),
child: Container(
height: 355,
child: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
child: Container(
margin: EdgeInsets.symmetric(vertical: 12.h),
alignment: Alignment.center,
child: Text(
"充值说明",
style: TextStyle(
fontWeight: MyFontWeight.bold,
fontSize: 15.sp,
color: Color(0xFF353535),
),
),
)),
GestureDetector(
onTap: () {
setState(() {
Navigator.of(context).pop();
});
},
child: Icon(
Icons.clear,
color: Colors.black,
size: 18,
),
),
SizedBox(width: 14),
],
),
SizedBox(
height: 12.h,
),
Container(
width: double.infinity,
height: 1.h,
color: Color(0xFFF2F2F2),
margin: EdgeInsets.only(bottom: 13.h),
),
Padding(
padding: EdgeInsets.only(left: 14),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Expanded(
child: Container(
color: Colors.white,
child: Html(
data: memberRechargeList?.remark ?? "",
customImageRenders: {
networkSourceMatcher():
networkImageRender(
loadingWidget: () {
return Container();
},
),
},
),
),
)
],
),
)
],
),
)));
});
}
Widget shopItem(StoreListBean store) {
return Container(
decoration: BoxDecoration(
borderRadius: new BorderRadius.circular(6),
color: Colors.white,
),
padding: EdgeInsets.all(12),
margin: EdgeInsets.symmetric(horizontal: 16.w, vertical: 8.h),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Expanded(
flex: 1,
child: Text(
(store != null) ? store.storeName : "",
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.semi_bold,
color: Colors.black,
),
),
),
GestureDetector(
onTap: () {
// Navigator.of(context).pushNamed('/router/union_detail_page',
// arguments: {"id": store.id});
if (store.posType.code == "NORMALSTORE") {
Scan.toScan(
context,
store.id,
store.tenantCode,
store.storeName,
);
} else {
Navigator.of(context).pushNamed(
'/router/store_order',
arguments: {
"id": store.id,
"tenant": store.tenantCode,
"storeName": store.storeName
},
);
}
},
child: Text(
S.of(context).chakan,
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xff32A060),
),
),
),
Icon(
Icons.chevron_right,
color: Color(0xff32A060),
size: 16,
),
],
),
SizedBox(
height: 8.h,
),
Row(
children: [
Text(
"${S.of(context).dizhi}: ",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xff353535),
),
),
Expanded(
child: Text(
store.address,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xff353535),
),
),
flex: 1,
)
],
),
SizedBox(
height: 4.h,
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
flex: 1,
child: Text(
S.of(context).yingyeshijian((store.openStartTime == null &&
store.openEndTime == null)
? S.of(context).quantian
: "${store.openStartTime.substring(0, store.openStartTime.lastIndexOf(":"))} - ${store.openEndTime.substring(0, store.openEndTime.lastIndexOf(":"))}"),
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xff353535),
),
),
),
Text(
(store.distance ?? 0) > 1000
? S.of(context).gongli(
((store.distance ?? 0) / 1000 * 100).toInt() / 100.0)
: S
.of(context)
.mi(((store.distance ?? 0) * 100).toInt() / 100.0),
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xff868686),
),
),
],
),
],
),
);
}
}

74
lib/mine/mine_view/mine_item.dart

@ -1,6 +1,5 @@
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/login_tips_dialog.dart'; import 'package:huixiang/view_widget/login_tips_dialog.dart';
@ -182,7 +181,7 @@ class _MineItem extends State<MineItem> {
}); });
}, },
child: mineItem( child: mineItem(
S.of(context).dianpuyue, S.of(context).dianpuchongzhi,
"assets/image/shop_yue.webp", "assets/image/shop_yue.webp",
), ),
),), ),),
@ -224,7 +223,7 @@ class _MineItem extends State<MineItem> {
], ],
), ),
SizedBox(height: 12.h,), SizedBox(height: 12.h,),
if(isShowMore) // if(isShowMore)
Row( Row(
children: [ children: [
/// ///
@ -323,9 +322,9 @@ class _MineItem extends State<MineItem> {
// ),), // ),),
], ],
), ),
if(isShowMore) // if(isShowMore)
SizedBox(height: 12.h,), SizedBox(height: 12.h,),
if(isShowMore) // if(isShowMore)
Row( Row(
children: [ children: [
//// ////
@ -354,38 +353,39 @@ class _MineItem extends State<MineItem> {
Expanded(child:Container(),), Expanded(child:Container(),),
], ],
), ),
GestureDetector( ///
behavior: HitTestBehavior.opaque, // GestureDetector(
onTap: () { // behavior: HitTestBehavior.opaque,
setState(() { // onTap: () {
isShowMore = !isShowMore; // setState(() {
}); // isShowMore = !isShowMore;
}, // });
child: Container( // },
margin: EdgeInsets.symmetric(vertical: 10), // child: Container(
child: Row( // margin: EdgeInsets.symmetric(vertical: 10),
mainAxisAlignment: MainAxisAlignment.center, // child: Row(
crossAxisAlignment: CrossAxisAlignment.center, // mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.max, // crossAxisAlignment: CrossAxisAlignment.center,
children: [ // mainAxisSize: MainAxisSize.max,
Text( // children: [
(isShowMore != null && !isShowMore)?S.of(context).zhankai: S.of(context).shouqi, // Text(
style: TextStyle( // (isShowMore != null && !isShowMore)?S.of(context).zhankai: S.of(context).shouqi,
fontSize: 12.sp, // style: TextStyle(
fontWeight: MyFontWeight.regular, // fontSize: 12.sp,
color: Color(0xFF32A060), // fontWeight: MyFontWeight.regular,
), // color: Color(0xFF32A060),
), // ),
Icon( // ),
(isShowMore != null && !isShowMore) // Icon(
? Icons.keyboard_arrow_down // (isShowMore != null && !isShowMore)
: Icons.keyboard_arrow_up, // ? Icons.keyboard_arrow_down
color: Color(0xFF32A060), // : Icons.keyboard_arrow_up,
size: 18, // color: Color(0xFF32A060),
), // size: 18,
], // ),
),), // ],
) // ),),
// )
], ],
), ),
); );

24
lib/mine/mine_view/mine_navbar.dart

@ -85,7 +85,7 @@ class _MineNavbar extends State<MineNavbar> {
}); });
}, },
child: mineTopItem( child: mineTopItem(
"钱包", S.of(context).qianbao,
"assets/image/wallet.webp", "assets/image/wallet.webp",
), ),
), ),
@ -105,7 +105,7 @@ class _MineNavbar extends State<MineNavbar> {
}); });
}, },
child: mineTopItem( child: mineTopItem(
"会员码", S.of(context).huiyuanma,
"assets/image/vip_code.webp", "assets/image/vip_code.webp",
), ),
), ),
@ -175,18 +175,18 @@ class _MineNavbar extends State<MineNavbar> {
Expanded( Expanded(
child: InkWell( child: InkWell(
onTap: () { onTap: () {
SharedPreferences.getInstance().then((value) { // SharedPreferences.getInstance().then((value) {
if (value.getString("token") == null || // if (value.getString("token") == null ||
value.getString("token") == "") { // value.getString("token") == "") {
LoginTipsDialog().show(context); // LoginTipsDialog().show(context);
return; // return;
} // }
widget.toIntegralPage(); // widget.toIntegralPage();
}); // });
}, },
child: mineBottomItem( child: mineBottomItem(
widget?.userInfo?.points?? "0", widget?.userInfo?.points?? "0",
"积分", S.of(context).jifen,
), ),
), ),
), ),
@ -246,7 +246,7 @@ class _MineNavbar extends State<MineNavbar> {
}, },
child: mineBottomItem( child: mineBottomItem(
widget?.userInfo?.happyBean?? "0", widget?.userInfo?.happyBean?? "0",
"印章", S.of(context).yinzhang,
), ),
), ),
), ),

99
lib/mine/mine_view/mine_view.dart

@ -373,55 +373,56 @@ class _MineView extends State<MineView> {
), ),
), ),
), ),
widget.userInfo == null ///
? Container( // widget.userInfo == null
alignment: Alignment.center, // ? Container(
height: 50.h, // alignment: Alignment.center,
child: Icon( // height: 50.h,
Icons.keyboard_arrow_right, // child: Icon(
size: 20, // Icons.keyboard_arrow_right,
color: Colors.black, // size: 20,
), // color: Colors.black,
) // ),
: Container( // )
alignment: Alignment.bottomRight, // : Container(
height: 50.h, // alignment: Alignment.bottomRight,
child: GestureDetector( // height: 50.h,
onTap: () { // child: GestureDetector(
widget.toIntegralPage(); // onTap: () {
}, // widget.toIntegralPage();
child: Container( // },
padding: EdgeInsets.only( // child: Container(
top: 4.h, bottom: 4.h, right: 16.w, left: 7.w), // padding: EdgeInsets.only(
margin: EdgeInsets.only(right: 14.w), // top: 4.h, bottom: 4.h, right: 16.w, left: 7.w),
decoration: BoxDecoration( // margin: EdgeInsets.only(right: 14.w),
borderRadius: BorderRadius.circular(12), // decoration: BoxDecoration(
color: Colors.white), // borderRadius: BorderRadius.circular(12),
child: Row( // color: Colors.white),
mainAxisAlignment: MainAxisAlignment.end, // child: Row(
children: [ // mainAxisAlignment: MainAxisAlignment.end,
Image.asset( // children: [
"assets/image/icon_gold_coin.webp", // Image.asset(
width: 16, // "assets/image/icon_gold_coin.webp",
height: 16, // width: 16,
), // height: 16,
Text( // ),
S.of(context).tiantianlingjifen, // Text(
style: TextStyle( // S.of(context).tiantianlingjifen,
color: Color(0xFF32A060), // style: TextStyle(
fontSize: 12.sp, // color: Color(0xFF32A060),
fontWeight: MyFontWeight.regular, // fontSize: 12.sp,
), // fontWeight: MyFontWeight.regular,
), // ),
// Icon( // ),
// Icons.keyboard_arrow_right, // // Icon(
// size: 16, // // Icons.keyboard_arrow_right,
// color: Colors.black, // // size: 16,
// ) // // color: Colors.black,
], // // )
), // ],
)), // ),
), // )),
// ),
], ],
), ),
); );

326
lib/mine/mine_vip/mine_attainment_page.dart

@ -20,6 +20,8 @@ import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import '../../view_widget/no_data_view.dart';
class MineAttainmentPage extends StatefulWidget { class MineAttainmentPage extends StatefulWidget {
final Map<String, dynamic> arguments; final Map<String, dynamic> arguments;
@ -41,7 +43,6 @@ class _MineAttainmentPage extends State<MineAttainmentPage> {
SocialInfo infoNumber; SocialInfo infoNumber;
final RefreshController refreshController = RefreshController(); final RefreshController refreshController = RefreshController();
@override @override
void dispose() { void dispose() {
super.dispose(); super.dispose();
@ -115,7 +116,7 @@ class _MineAttainmentPage extends State<MineAttainmentPage> {
); );
BaseData<SocialInfo> baseData = BaseData<SocialInfo> baseData =
await apiService.socialInfo().catchError((onError) {}); await apiService.socialInfo().catchError((onError) {});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
setState(() { setState(() {
infoNumber = baseData.data; infoNumber = baseData.data;
@ -125,7 +126,7 @@ class _MineAttainmentPage extends State<MineAttainmentPage> {
EasyLoading.dismiss(); EasyLoading.dismiss();
} }
_onRefresh(){ _onRefresh() {
queryAttainmentBadges(); queryAttainmentBadges();
querySocialInfo(); querySocialInfo();
} }
@ -140,151 +141,162 @@ class _MineAttainmentPage extends State<MineAttainmentPage> {
), ),
), ),
child: Scaffold( child: Scaffold(
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
appBar: MyAppBar( appBar: MyAppBar(
title:S.of(context).wodechengjiu, title: S.of(context).wodechengjiu,
titleColor: Colors.black, titleColor: Colors.black,
titleSize: 18.sp, titleSize: 18.sp,
background: Colors.transparent, background: Colors.transparent,
leadingColor: Colors.black, leadingColor: Colors.black,
), ),
body: SmartRefresher( body: SmartRefresher(
controller: refreshController, controller: refreshController,
enablePullDown: true, enablePullDown: true,
enablePullUp: false, enablePullUp: false,
header: MyHeader(), header: MyHeader(),
footer: CustomFooter( footer: CustomFooter(
builder: (context, mode) { builder: (context, mode) {
return MyFooter(mode); return MyFooter(mode);
},
),
onRefresh:(){
setState(() {
_onRefresh();
});
}, },
physics: BouncingScrollPhysics(), ),
child: Container( onRefresh: () {
child: setState(() {
SingleChildScrollView( _onRefresh();
physics: BouncingScrollPhysics(), });
child: Column( },
children: [ physics: BouncingScrollPhysics(),
SizedBox(height: 24), child: Container(
MImage( child: SingleChildScrollView(
userInfo?.headimg ?? "", physics: BouncingScrollPhysics(),
isCircle: true, child: Column(
width: 58, children: [
height: 58, SizedBox(height: 24),
fit: BoxFit.cover, MImage(
errorSrc: "assets/image/default_user.webp", userInfo?.headimg ?? "",
fadeSrc: "assets/image/default_user.webp", isCircle: true,
width: 58,
height: 58,
fit: BoxFit.cover,
errorSrc: "assets/image/default_user.webp",
fadeSrc: "assets/image/default_user.webp",
),
SizedBox(height: 8),
Text(
userInfo?.nickname ?? S.of(context).denglu,
style: TextStyle(
fontSize: 16.sp,
fontWeight: FontWeight.bold,
color: Color(0xFF353535),
), ),
SizedBox(height: 8), ),
Text( SizedBox(height: 28),
userInfo?.nickname ?? S.of(context).denglu, Container(
style: TextStyle( margin: EdgeInsets.only(
fontSize: 16.sp, left: 16, right: 16, top: 26, bottom: 8),
fontWeight: FontWeight.bold, padding: EdgeInsets.all(20),
color: Color(0xFF353535), decoration: BoxDecoration(
), color: Colors.white,
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
)
],
borderRadius: BorderRadius.all(Radius.circular(8)),
), ),
SizedBox(height: 28), child: Column(
Container( mainAxisAlignment: MainAxisAlignment.spaceAround,
margin: crossAxisAlignment: CrossAxisAlignment.start,
EdgeInsets.only(left: 16, right: 16, top: 26, bottom: 8), children: [
padding: EdgeInsets.all(20), Row(
decoration: BoxDecoration( children: [
color: Colors.white, Text(
boxShadow: [ S.of(context).chengjiuhuizhang,
BoxShadow( style: TextStyle(
color: Colors.black.withAlpha(12), fontWeight: MyFontWeight.medium,
offset: Offset(0, 3), fontSize: 14.sp,
blurRadius: 14, color: Color(0xFF353535)),
spreadRadius: 0, ),
) SizedBox(width: 4),
], Text(
borderRadius: BorderRadius.all(Radius.circular(8)), "(",
), style: TextStyle(
child: Column( fontWeight: MyFontWeight.medium,
mainAxisAlignment: MainAxisAlignment.spaceAround, fontSize: 14,
crossAxisAlignment: CrossAxisAlignment.start, color: Color(0xFF353535)),
children: [ ),
Row( Text(
children: [ infoNumber != null
Text( ? infoNumber.achievementNumber.toString()
S.of(context).chengjiuhuizhang, : "0",
style: TextStyle( style: TextStyle(
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,
fontSize: 14.sp, fontSize: 14,
color: Color(0xFF353535)), color: Color(0xFF32A060)),
), ),
SizedBox(width: 4), Text(
Text( "/${vipBadgesList.length})",
"(", style: TextStyle(
style: TextStyle( fontWeight: MyFontWeight.medium,
fontWeight: MyFontWeight.medium, fontSize: 14,
fontSize: 14, color: Color(0xFF353535)),
color: Color(0xFF353535)), ),
), ],
Text( ),
infoNumber != null ? infoNumber.achievementNumber.toString() :"0", SizedBox(height: 12),
style: TextStyle( attainmentBadge(),
fontWeight: MyFontWeight.medium, ],
fontSize: 14,
color: Color(0xFF32A060)),
),
Text(
"/${vipBadgesList.length})",
style: TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 14,
color: Color(0xFF353535)),
),
],
),
SizedBox(height: 12),
attainmentBadge(),
],
),
), ),
], ),
), ],
), ),
), ),
),), ),
),
),
); );
} }
/// ///
Widget attainmentBadge() { Widget attainmentBadge() {
return GridView.builder( return (vipBadgesList != null && (vipBadgesList?.length ?? 0) > 0)
itemCount: vipBadgesList == null ? 0 : vipBadgesList.length, ? GridView.builder(
shrinkWrap: true, itemCount: vipBadgesList == null ? 0 : vipBadgesList.length,
physics: NeverScrollableScrollPhysics(), shrinkWrap: true,
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( physics: NeverScrollableScrollPhysics(),
//Widget数量 gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3, //Widget数量
//Widget之间间距 crossAxisCount: 3,
crossAxisSpacing: 13, //Widget之间间距
//Widget之间间距 crossAxisSpacing: 13,
mainAxisSpacing: 12, //Widget之间间距
//Widget宽高比例 mainAxisSpacing: 12,
childAspectRatio: AppUtils.textScale(context) > 1 //Widget宽高比例
? (1 - ((AppUtils.textScale(context) - 1))) childAspectRatio: AppUtils.textScale(context) > 1
: 0.85, ? (1 - ((AppUtils.textScale(context) - 1)))
), : 0.85,
itemBuilder: (context, index) { ),
return GestureDetector( itemBuilder: (context, index) {
onTap: () { return GestureDetector(
setState(() { onTap: () {
queryAchievementDetail(index); setState(() {
}); queryAchievementDetail(index);
}, });
child: badgeItem(vipBadgesList[index]), },
); child: badgeItem(vipBadgesList[index]),
}, );
); },
)
: NoDataView(
src: "assets/image/xiao_fei.webp",
isShowBtn: false,
text: "当前暂无成就徽章~",
fontSize: 16.sp,
margin: EdgeInsets.only(left: 60.w, right: 60.w),
);
;
} }
Widget badgeItem(VipBadgesList vipBadgesList) { Widget badgeItem(VipBadgesList vipBadgesList) {
@ -358,7 +370,7 @@ class _MineAttainmentPage extends State<MineAttainmentPage> {
), ),
SizedBox(height: 10), SizedBox(height: 10),
Text( Text(
"${vipBadgesList.length >index ?vipBadgesList[index].name :""}${achievementDetail.length > checkPosition ?achievementDetail[checkPosition].name:""}徽章", "${vipBadgesList.length > index ? vipBadgesList[index].name : ""}${achievementDetail.length > checkPosition ? achievementDetail[checkPosition].name : ""}徽章",
style: TextStyle( style: TextStyle(
fontSize: 16.sp, fontSize: 16.sp,
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
@ -369,7 +381,7 @@ class _MineAttainmentPage extends State<MineAttainmentPage> {
height: 6.h, height: 6.h,
), ),
Text( Text(
"${vipBadgesList.length >index ? vipBadgesList[index].name :""} ${AppUtils.calculateDouble(double.tryParse(achievementDetail.length > checkPosition ?achievementDetail[checkPosition].lessScore :"") ?? 0)} 即可升级", "${vipBadgesList.length > index ? vipBadgesList[index].name : ""} ${AppUtils.calculateDouble(double.tryParse(achievementDetail.length > checkPosition ? achievementDetail[checkPosition].lessScore : "") ?? 0)} 即可升级",
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
@ -392,27 +404,29 @@ class _MineAttainmentPage extends State<MineAttainmentPage> {
), ),
SizedBox(width: 8), SizedBox(width: 8),
Column( Column(
crossAxisAlignment:CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: children:
achievementDetail[checkPosition].rewardList != null achievementDetail[checkPosition].rewardList != null
? achievementDetail[checkPosition].rewardList.map((e) { ? achievementDetail[checkPosition]
return Text( .rewardList
rewardStr(e), .map((e) {
style: TextStyle( return Text(
fontWeight: MyFontWeight.regular, rewardStr(e),
fontSize: 12.sp, style: TextStyle(
color: Color(0xFF515151)), fontWeight: MyFontWeight.regular,
); fontSize: 12.sp,
}).toList() color: Color(0xFF515151)),
: [], );
}).toList()
: [],
), ),
], ],
), ),
Expanded( Expanded(
child: Container( child: Container(
height: double.maxFinite, height: double.maxFinite,
margin: EdgeInsets.only(top:14), margin: EdgeInsets.only(top: 14),
child: ListView.builder( child: ListView.builder(
shrinkWrap: true, shrinkWrap: true,
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
@ -443,12 +457,12 @@ class _MineAttainmentPage extends State<MineAttainmentPage> {
); );
} }
String rewardStr(RewardList rewardList){ String rewardStr(RewardList rewardList) {
if(rewardList.rewardType == 1) if (rewardList.rewardType == 1)
return "积分:${rewardList.refId}"; return "积分:${rewardList.refId}";
else if(rewardList.rewardType == 2) else if (rewardList.rewardType == 2)
return "平台余额:${rewardList.refId}"; return "平台余额:${rewardList.refId}";
else if(rewardList.rewardType == 3) else if (rewardList.rewardType == 3)
return "平台兑换券:${rewardList.couponName}"; return "平台兑换券:${rewardList.couponName}";
return ""; return "";
} }

922
lib/mine/recharge_page.dart

File diff suppressed because it is too large Load Diff

2
lib/mine/scan_web.dart

@ -26,7 +26,7 @@ class _ScanWeb extends State<ScanWeb> {
super.initState(); super.initState();
result = widget.arguments["result"]; result = widget.arguments["result"];
title = widget.arguments["title"]; title = widget.arguments["title"];
EasyLoading.show(status: S.current.zhengzaijiazai); EasyLoading.show(status: S.current.zhengzaijiazai,maskType: EasyLoadingMaskType.black);
} }
@override @override

2
lib/order/order_detail_page.dart

@ -48,7 +48,7 @@ class _OrderDetailPage extends State<OrderDetailPage> {
super.initState(); super.initState();
jumpState = widget.arguments["jumpState"]; jumpState = widget.arguments["jumpState"];
SharedPreferences.getInstance().then((value) { SharedPreferences.getInstance().then((value) {
EasyLoading.show(status: S.of(context).zhengzaijiazai); EasyLoading.show(status: S.of(context).zhengzaijiazai,maskType: EasyLoadingMaskType.black);
apiService = ApiService(Dio(), apiService = ApiService(Dio(),
context: context, token: value.getString("token"),); context: context, token: value.getString("token"),);
queryDetails(); queryDetails();

354
lib/order/order_history_page.dart

@ -1,5 +1,6 @@
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/order/order_utils.dart'; import 'package:huixiang/order/order_utils.dart';
@ -132,57 +133,29 @@ class OrderHistoryList extends StatefulWidget {
class _OrderHistoryList extends State<OrderHistoryList> class _OrderHistoryList extends State<OrderHistoryList>
with AutomaticKeepAliveClientMixin { with AutomaticKeepAliveClientMixin {
final RefreshController refreshController = RefreshController(); final RefreshController refreshController = RefreshController();
@override
Widget build(BuildContext context) {
super.build(context);
return SmartRefresher(
controller: refreshController,
enablePullDown: true,
enablePullUp: true,
physics: BouncingScrollPhysics(),
header: MyHeader(),
footer: CustomFooter(
builder: (context, mode) {
return MyFooter(mode);
},
),
onRefresh: _onRefresh,
onLoading: queryOrder,
child: (orderInfos != null && orderInfos.length > 0)
? ListView.builder(
itemCount: orderInfos != null ? orderInfos.length : 0,
itemBuilder: (context, position) {
return InkWell(
onTap: () {
Navigator.of(context).pushNamed('/router/order_details',
arguments: {"id": orderInfos[position].id,"jumpState":2});
},
child: orderItem(orderInfos[position]),
);
})
: NoDataView(
src: "assets/image/ding_dan.webp",
isShowBtn: false,
text: "目前暂无订单,快去下一单吧~",
fontSize: 16.sp,
margin: EdgeInsets.only(top: 120),
),
);
}
bool isRemake = true; bool isRemake = true;
ApiService apiService; ApiService apiService;
int current = 1; int current = 1;
List<OrderInfo> orderInfos = [];
UserInfo userInfo;
@override
void initState() {
super.initState();
SharedPreferences.getInstance().then((value) => {
apiService = ApiService(Dio(),
showLoading: true,
context: context,
token: value.getString("token")),
queryOrder(),
queryUserBalance(),
});
}
_onRefresh() { _onRefresh() {
current = 1; current = 1;
queryOrder(); queryOrder();
} }
List<OrderInfo> orderInfos = [];
queryOrder() async { queryOrder() async {
BaseData<PageInfo<OrderInfo>> baseData = await apiService.orderList({ BaseData<PageInfo<OrderInfo>> baseData = await apiService.orderList({
"current": current, "current": current,
@ -213,24 +186,173 @@ class _OrderHistoryList extends State<OrderHistoryList>
} }
setState(() {}); setState(() {});
} else { } else {
SmartDialog.showToast(baseData?.msg ?? "",alignment: Alignment.center); if((baseData?.msg ?? "") != "")
SmartDialog.showToast(baseData.msg,alignment: Alignment.center);
refreshController.refreshFailed(); refreshController.refreshFailed();
refreshController.loadFailed(); refreshController.loadFailed();
} }
} }
@override minLogin(OrderInfo orderInfo) {
void initState() { apiService.minLogin(orderInfo.storeId).catchError((onError) {
super.initState(); debugPrint(onError);
}).then((baseData) {
SharedPreferences.getInstance().then((value) => { if (baseData != null && baseData.isSuccess) {
apiService = ApiService(Dio(), Map<String, dynamic> minStoreInfo = baseData.data;
showLoading: true, String minToken = minStoreInfo["token"];
String tenant = orderInfo.tenantCode;
String storeId = orderInfo.storeId;
SharedPreferences.getInstance().then(
(value) => {
value.setString('minToken', minToken),
value.setString('tenant', tenant),
value.setString('storeId', storeId),
},
);
paySelected(
orderInfo,
MinApiService(
Dio(),
context: context, context: context,
token: value.getString("token")), token: minToken,
queryOrder(), tenant: tenant,
queryUserBalance(), storeId: storeId,
}); ));
}
});
}
queryDetails(id) async {
if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(Dio(),
context: context, token: value.getString("token"), showLoading: true);
}
BaseData<OrderInfo> baseData =
await apiService.orderDetail(id).catchError((error) {});
if (baseData != null && baseData.isSuccess) {
return baseData.data;
}
}
queryUserBalance() async {
BaseData<UserInfo> baseData =
await apiService.queryInfo().catchError((onError) {
});
if (baseData != null && baseData.isSuccess) {
userInfo = baseData.data;
if (mounted) setState(() {});
}else {
SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
}
}
paySelected(OrderInfo orderInfo, MinApiService minService) async {
var payChannel = await showModalBottomSheet(
context: context,
backgroundColor: Colors.transparent,
builder: (context) {
return OrderPaySelected(userInfo);
},
);
if (payChannel != null && payChannel > 0) {
orderInfo = await queryDetails(orderInfo.id);
OrderUtils.carryOnPay(
payChannel,
minService,
orderInfo,
(BaseData baseData) {
SmartDialog.showToast(
baseData?.msg == "ok" ? "订单支付成功" : baseData?.msg,
alignment: Alignment.center);
Future.delayed(Duration(seconds: 3), () {
_onRefresh();
});
},
);
}
}
payResult(BaseData baseData) {}
orderCancel(String orderId) async {
BaseData baseData =
await apiService.orderCancel(orderId).catchError((onError) {});
if (baseData != null && baseData.isSuccess) {
SmartDialog.showToast("订单取消成功");
_onRefresh();
}else{
if(baseData.msg != null)
SmartDialog.showToast(baseData.msg,alignment: Alignment.center);
}
}
aginOrder(OrderInfo orderInfo) {
// Navigator.of(context).pushNamed(
// '/router/union_detail_page',
// arguments: {"id": storeId},
// );
// String storeId = (orderInfo != null &&
// orderInfo.storeVO != null)
// ? (orderInfo.storeVO.id ?? "")
// : "";
if (orderInfo.storeVO.posType.code == "NORMALSTORE") {
Scan.toScan(
context,
orderInfo.storeVO.id,
orderInfo.tenantCode,
orderInfo.storeVO.storeName,
);
} else {
Navigator.of(context).pushNamed(
'/router/store_order',
arguments: {
"id": orderInfo.storeVO.id,
"tenant": orderInfo.tenantCode,
"storeName": orderInfo.storeVO.storeName
},
);
}
}
@override
Widget build(BuildContext context) {
super.build(context);
return SmartRefresher(
controller: refreshController,
enablePullDown: true,
enablePullUp: true,
physics: BouncingScrollPhysics(),
header: MyHeader(),
footer: CustomFooter(
builder: (context, mode) {
return MyFooter(mode);
},
),
onRefresh: _onRefresh,
onLoading: queryOrder,
child: (orderInfos != null && orderInfos.length > 0)
? ListView.builder(
itemCount: orderInfos != null ? orderInfos.length : 0,
itemBuilder: (context, position) {
return InkWell(
onTap: () {
Navigator.of(context).pushNamed('/router/order_details',
arguments: {"id": orderInfos[position].id,"jumpState":2});
},
child: orderItem(orderInfos[position]),
);
})
: NoDataView(
src: "assets/image/ding_dan.webp",
isShowBtn: false,
text: "目前暂无订单,快去下一单吧~",
fontSize: 16.sp,
margin: EdgeInsets.only(top: 120),
),
);
} }
String orderAllGoods(OrderInfo orderInfo) { String orderAllGoods(OrderInfo orderInfo) {
@ -535,130 +657,6 @@ class _OrderHistoryList extends State<OrderHistoryList>
); );
} }
minLogin(OrderInfo orderInfo) {
apiService.minLogin(orderInfo.storeId).catchError((onError) {
debugPrint(onError);
}).then((baseData) {
if (baseData != null && baseData.isSuccess) {
Map<String, dynamic> minStoreInfo = baseData.data;
String minToken = minStoreInfo["token"];
String tenant = orderInfo.tenantCode;
String storeId = orderInfo.storeId;
SharedPreferences.getInstance().then(
(value) => {
value.setString('minToken', minToken),
value.setString('tenant', tenant),
value.setString('storeId', storeId),
},
);
paySelected(
orderInfo,
MinApiService(
Dio(),
context: context,
token: minToken,
tenant: tenant,
storeId: storeId,
));
}
});
}
queryDetails(id) async {
if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(Dio(),
context: context, token: value.getString("token"), showLoading: true);
}
BaseData<OrderInfo> baseData =
await apiService.orderDetail(id).catchError((error) {});
if (baseData != null && baseData.isSuccess) {
return baseData.data;
}
}
UserInfo userInfo;
queryUserBalance() async {
BaseData<UserInfo> baseData =
await apiService.queryInfo().catchError((onError) {});
if (baseData != null && baseData.isSuccess) {
userInfo = baseData.data;
if (mounted) setState(() {});
}else {
SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
}
}
paySelected(OrderInfo orderInfo, MinApiService minService) async {
var payChannel = await showModalBottomSheet(
context: context,
backgroundColor: Colors.transparent,
builder: (context) {
return OrderPaySelected(userInfo);
},
);
if (payChannel != null && payChannel > 0) {
orderInfo = await queryDetails(orderInfo.id);
OrderUtils.carryOnPay(
payChannel,
minService,
orderInfo,
(BaseData baseData) {
SmartDialog.showToast(
baseData?.msg == "ok" ? "订单支付成功" : baseData?.msg,
alignment: Alignment.center);
Future.delayed(Duration(seconds: 3), () {
_onRefresh();
});
},
);
}
}
payResult(BaseData baseData) {}
orderCancel(String orderId) async {
BaseData baseData =
await apiService.orderCancel(orderId).catchError((onError) {});
if (baseData != null && baseData.isSuccess) {
SmartDialog.showToast("订单取消成功");
_onRefresh();
}else{
if(baseData.msg != null)
SmartDialog.showToast(baseData.msg,alignment: Alignment.center);
}
}
aginOrder(OrderInfo orderInfo) {
// Navigator.of(context).pushNamed(
// '/router/union_detail_page',
// arguments: {"id": storeId},
// );
// String storeId = (orderInfo != null &&
// orderInfo.storeVO != null)
// ? (orderInfo.storeVO.id ?? "")
// : "";
if (orderInfo.storeVO.posType.code == "NORMALSTORE") {
Scan.toScan(
context,
orderInfo.storeVO.id,
orderInfo.tenantCode,
orderInfo.storeVO.storeName,
);
} else {
Navigator.of(context).pushNamed(
'/router/store_order',
arguments: {
"id": orderInfo.storeVO.id,
"tenant": orderInfo.tenantCode,
"storeName": orderInfo.storeVO.storeName
},
);
}
}
String totalPrice(orderInfo) { String totalPrice(orderInfo) {
if (orderInfo == null) return ""; if (orderInfo == null) return "";
double totalPrice = (double.tryParse(orderInfo.orderSum) + double totalPrice = (double.tryParse(orderInfo.orderSum) +

105
lib/retrofit/data/ip_data.dart

@ -0,0 +1,105 @@
/// ip : "27.18.151.119"
/// pro : "湖北省"
/// proCode : "420000"
/// city : "武汉市"
/// cityCode : "420100"
/// region : ""
/// regionCode : "0"
/// addr : "湖北省武汉市 电信"
/// regionNames : ""
/// err : ""
class IpData {
IpData({
String ip,
String pro,
String proCode,
String city,
String cityCode,
String region,
String regionCode,
String addr,
String regionNames,
String err,}){
_ip = ip;
_pro = pro;
_proCode = proCode;
_city = city;
_cityCode = cityCode;
_region = region;
_regionCode = regionCode;
_addr = addr;
_regionNames = regionNames;
_err = err;
}
IpData.fromJson(dynamic json) {
_ip = json['ip'];
_pro = json['pro'];
_proCode = json['proCode'];
_city = json['city'];
_cityCode = json['cityCode'];
_region = json['region'];
_regionCode = json['regionCode'];
_addr = json['addr'];
_regionNames = json['regionNames'];
_err = json['err'];
}
String _ip;
String _pro;
String _proCode;
String _city;
String _cityCode;
String _region;
String _regionCode;
String _addr;
String _regionNames;
String _err;
IpData copyWith({ String ip,
String pro,
String proCode,
String city,
String cityCode,
String region,
String regionCode,
String addr,
String regionNames,
String err,
}) => IpData( ip: ip ?? _ip,
pro: pro ?? _pro,
proCode: proCode ?? _proCode,
city: city ?? _city,
cityCode: cityCode ?? _cityCode,
region: region ?? _region,
regionCode: regionCode ?? _regionCode,
addr: addr ?? _addr,
regionNames: regionNames ?? _regionNames,
err: err ?? _err,
);
String get ip => _ip;
String get pro => _pro;
String get proCode => _proCode;
String get city => _city;
String get cityCode => _cityCode;
String get region => _region;
String get regionCode => _regionCode;
String get addr => _addr;
String get regionNames => _regionNames;
String get err => _err;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['ip'] = _ip;
map['pro'] = _pro;
map['proCode'] = _proCode;
map['city'] = _city;
map['cityCode'] = _cityCode;
map['region'] = _region;
map['regionCode'] = _regionCode;
map['addr'] = _addr;
map['regionNames'] = _regionNames;
map['err'] = _err;
return map;
}
}

159
lib/retrofit/data/member_recharge_list.dart

@ -0,0 +1,159 @@
/// id : "1681490552371019776"
/// rechargeMoney : "100.00"
/// giftdMoney : "10.00"
/// limitNum : 0
/// gitfdCouponId : null
/// startDate : null
/// endDate : null
/// startTime : null
/// endTime : null
/// tenantCode : "1175"
/// createTime : "2023-07-21 09:22:53"
/// isDeleted : 0
/// rechargeType : 0
/// remark : "充值100.00 赠送10.00"
/// sortValue : 0
/// useNum : 0
class MemberRechargeList {
MemberRechargeList({
String id,
String rechargeMoney,
String giftdMoney,
dynamic limitNum,
dynamic gitfdCouponId,
dynamic startDate,
dynamic endDate,
dynamic startTime,
dynamic endTime,
String tenantCode,
String createTime,
num isDeleted,
num rechargeType,
String remark,
num sortValue,
dynamic useNum,}){
_id = id;
_rechargeMoney = rechargeMoney;
_giftdMoney = giftdMoney;
_limitNum = limitNum;
_gitfdCouponId = gitfdCouponId;
_startDate = startDate;
_endDate = endDate;
_startTime = startTime;
_endTime = endTime;
_tenantCode = tenantCode;
_createTime = createTime;
_isDeleted = isDeleted;
_rechargeType = rechargeType;
_remark = remark;
_sortValue = sortValue;
_useNum = useNum;
}
MemberRechargeList.fromJson(dynamic json) {
_id = json['id'];
_rechargeMoney = json['rechargeMoney'];
_giftdMoney = json['giftdMoney'];
_limitNum = json['limitNum'];
_gitfdCouponId = json['gitfdCouponId'];
_startDate = json['startDate'];
_endDate = json['endDate'];
_startTime = json['startTime'];
_endTime = json['endTime'];
_tenantCode = json['tenantCode'];
_createTime = json['createTime'];
_isDeleted = json['isDeleted'];
_rechargeType = json['rechargeType'];
_remark = json['remark'];
_sortValue = json['sortValue'];
_useNum = json['useNum'];
}
String _id;
String _rechargeMoney;
String _giftdMoney;
dynamic _limitNum;
dynamic _gitfdCouponId;
dynamic _startDate;
dynamic _endDate;
dynamic _startTime;
dynamic _endTime;
String _tenantCode;
String _createTime;
num _isDeleted;
num _rechargeType;
String _remark;
num _sortValue;
dynamic _useNum;
MemberRechargeList copyWith({ String id,
String rechargeMoney,
String giftdMoney,
dynamic limitNum,
dynamic gitfdCouponId,
dynamic startDate,
dynamic endDate,
dynamic startTime,
dynamic endTime,
String tenantCode,
String createTime,
num isDeleted,
num rechargeType,
String remark,
num sortValue,
dynamic useNum,
}) => MemberRechargeList( id: id ?? _id,
rechargeMoney: rechargeMoney ?? _rechargeMoney,
giftdMoney: giftdMoney ?? _giftdMoney,
limitNum: limitNum ?? _limitNum,
gitfdCouponId: gitfdCouponId ?? _gitfdCouponId,
startDate: startDate ?? _startDate,
endDate: endDate ?? _endDate,
startTime: startTime ?? _startTime,
endTime: endTime ?? _endTime,
tenantCode: tenantCode ?? _tenantCode,
createTime: createTime ?? _createTime,
isDeleted: isDeleted ?? _isDeleted,
rechargeType: rechargeType ?? _rechargeType,
remark: remark ?? _remark,
sortValue: sortValue ?? _sortValue,
useNum: useNum ?? _useNum,
);
String get id => _id;
String get rechargeMoney => _rechargeMoney;
String get giftdMoney => _giftdMoney;
dynamic get limitNum => _limitNum;
dynamic get gitfdCouponId => _gitfdCouponId;
dynamic get startDate => _startDate;
dynamic get endDate => _endDate;
dynamic get startTime => _startTime;
dynamic get endTime => _endTime;
String get tenantCode => _tenantCode;
String get createTime => _createTime;
num get isDeleted => _isDeleted;
num get rechargeType => _rechargeType;
String get remark => _remark;
num get sortValue => _sortValue;
dynamic get useNum => _useNum;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['id'] = _id;
map['rechargeMoney'] = _rechargeMoney;
map['giftdMoney'] = _giftdMoney;
map['limitNum'] = _limitNum;
map['gitfdCouponId'] = _gitfdCouponId;
map['startDate'] = _startDate;
map['endDate'] = _endDate;
map['startTime'] = _startTime;
map['endTime'] = _endTime;
map['tenantCode'] = _tenantCode;
map['createTime'] = _createTime;
map['isDeleted'] = _isDeleted;
map['rechargeType'] = _rechargeType;
map['remark'] = _remark;
map['sortValue'] = _sortValue;
map['useNum'] = _useNum;
return map;
}
}

749
lib/retrofit/data/product_show.dart

@ -0,0 +1,749 @@
/// id : "1484156758195699712"
/// createTime : "2022-01-20 21:32:00"
/// createUser : "1364043181062094848"
/// updateTime : "2022-01-21 18:27:02"
/// updateUser : "1364043181062094848"
/// supplierName : "一心回乡生态农场"
/// storeId : "1460885296764682240"
/// categoryId : "1460889654206136320"
/// groupId : "1484146679266410496"
/// shortName : "【一心回乡】三益米 筋道绵润、鲜稻尝鲜;自留种老品种,非转基因种子"
/// productName : "三益米1kg"
/// sellDesc : ""
/// productCode : "PRO202201202132000000000000001"
/// weight : "0"
/// applyPrice : "39.00"
/// price : "24.00"
/// vipPrice : null
/// stock : -13
/// sellCount : 19
/// needLogistics : 1
/// oversold : 1
/// organic : 0
/// status : 1
/// posShow : true
/// subscribeParam : null
/// isRaise : false
/// productType : 0
/// productNumber : 1
/// setMeal : 1
/// attrStyle : 0
/// detail : ""
/// isDelete : 0
/// printerFlag : "DEFAULT"
/// materials : null
/// materialId : null
/// details : ""
/// thumbnailImg : ""
/// info : ""
/// buyCount : 12
/// sellCountLimit : 0
/// stockRecoveryTime : null
/// isAddPurchase : null
/// limitNum : 0
/// rankId : "0"
/// happyBean : 0
/// imgs : ["https://pos.upload.lotus-wallet.com/1179/2022/01/243f54db-2dc8-4a9b-9ccc-09fc7a4e2a2e.jpg"]
/// productSkuList : [{"id":"1484156758229254144","createTime":"2022-01-20 21:32:00","createUser":"1364043181062094848","updateTime":"2022-01-20 21:32:00","updateUser":"1364043181062094848","storeId":"1460885296764682240","skuCode":"P202201202132002","skuNameStr":"","productId":"1484156758195699712","skuPrice":"24.00","applyPrice":"39.00","vipPrice":"24.00","packagingFee":"0.00","skuImg":null,"skuStock":-13,"autoRenewSkuStock":0,"deliveries":0,"ticketType":"","ticketWipedTimeTemplateId":null,"takeType":null,"ticketDays":"0","ticketExpireTime":"23:59:59","sort":50,"setMeal":"","productSetMeals":null,"weight":0.0,"volume":0.0,"isDelete":0,"material":null,"version":0,"skuTickets":null,"ticketStyle":""}]
class ProductShow {
ProductShow({
String id,
String createTime,
String createUser,
String updateTime,
String updateUser,
String supplierName,
String storeId,
String categoryId,
String groupId,
String shortName,
String productName,
String sellDesc,
String productCode,
String weight,
String applyPrice,
String price,
dynamic vipPrice,
num stock,
num sellCount,
num needLogistics,
num oversold,
num organic,
num status,
bool posShow,
dynamic subscribeParam,
bool isRaise,
num productType,
num productNumber,
num setMeal,
num attrStyle,
String detail,
num isDelete,
String printerFlag,
dynamic materials,
dynamic materialId,
String details,
String thumbnailImg,
String info,
num buyCount,
num sellCountLimit,
dynamic stockRecoveryTime,
dynamic isAddPurchase,
num limitNum,
String rankId,
num happyBean,
List<String> imgs,
List<ProductSkuList> productSkuList,}){
_id = id;
_createTime = createTime;
_createUser = createUser;
_updateTime = updateTime;
_updateUser = updateUser;
_supplierName = supplierName;
_storeId = storeId;
_categoryId = categoryId;
_groupId = groupId;
_shortName = shortName;
_productName = productName;
_sellDesc = sellDesc;
_productCode = productCode;
_weight = weight;
_applyPrice = applyPrice;
_price = price;
_vipPrice = vipPrice;
_stock = stock;
_sellCount = sellCount;
_needLogistics = needLogistics;
_oversold = oversold;
_organic = organic;
_status = status;
_posShow = posShow;
_subscribeParam = subscribeParam;
_isRaise = isRaise;
_productType = productType;
_productNumber = productNumber;
_setMeal = setMeal;
_attrStyle = attrStyle;
_detail = detail;
_isDelete = isDelete;
_printerFlag = printerFlag;
_materials = materials;
_materialId = materialId;
_details = details;
_thumbnailImg = thumbnailImg;
_info = info;
_buyCount = buyCount;
_sellCountLimit = sellCountLimit;
_stockRecoveryTime = stockRecoveryTime;
_isAddPurchase = isAddPurchase;
_limitNum = limitNum;
_rankId = rankId;
_happyBean = happyBean;
_imgs = imgs;
_productSkuList = productSkuList;
}
ProductShow.fromJson(dynamic json) {
_id = json['id'];
_createTime = json['createTime'];
_createUser = json['createUser'];
_updateTime = json['updateTime'];
_updateUser = json['updateUser'];
_supplierName = json['supplierName'];
_storeId = json['storeId'];
_categoryId = json['categoryId'];
_groupId = json['groupId'];
_shortName = json['shortName'];
_productName = json['productName'];
_sellDesc = json['sellDesc'];
_productCode = json['productCode'];
_weight = json['weight'];
_applyPrice = json['applyPrice'];
_price = json['price'];
_vipPrice = json['vipPrice'];
_stock = json['stock'];
_sellCount = json['sellCount'];
_needLogistics = json['needLogistics'];
_oversold = json['oversold'];
_organic = json['organic'];
_status = json['status'];
_posShow = json['posShow'];
_subscribeParam = json['subscribeParam'];
_isRaise = json['isRaise'];
_productType = json['productType'];
_productNumber = json['productNumber'];
_setMeal = json['setMeal'];
_attrStyle = json['attrStyle'];
_detail = json['detail'];
_isDelete = json['isDelete'];
_printerFlag = json['printerFlag'];
_materials = json['materials'];
_materialId = json['materialId'];
_details = json['details'];
_thumbnailImg = json['thumbnailImg'];
_info = json['info'];
_buyCount = json['buyCount'];
_sellCountLimit = json['sellCountLimit'];
_stockRecoveryTime = json['stockRecoveryTime'];
_isAddPurchase = json['isAddPurchase'];
_limitNum = json['limitNum'];
_rankId = json['rankId'];
_happyBean = json['happyBean'];
_imgs = json['imgs'] != null ? json['imgs'].cast<String>() : [];
if (json['productSkuList'] != null) {
_productSkuList = [];
json['productSkuList'].forEach((v) {
_productSkuList.add(ProductSkuList.fromJson(v));
});
}
}
String _id;
String _createTime;
String _createUser;
String _updateTime;
String _updateUser;
String _supplierName;
String _storeId;
String _categoryId;
String _groupId;
String _shortName;
String _productName;
String _sellDesc;
String _productCode;
String _weight;
String _applyPrice;
String _price;
dynamic _vipPrice;
num _stock;
num _sellCount;
num _needLogistics;
num _oversold;
num _organic;
num _status;
bool _posShow;
dynamic _subscribeParam;
bool _isRaise;
num _productType;
num _productNumber;
num _setMeal;
num _attrStyle;
String _detail;
num _isDelete;
String _printerFlag;
dynamic _materials;
dynamic _materialId;
String _details;
String _thumbnailImg;
String _info;
num _buyCount;
num _sellCountLimit;
dynamic _stockRecoveryTime;
dynamic _isAddPurchase;
num _limitNum;
String _rankId;
num _happyBean;
List<String> _imgs;
List<ProductSkuList> _productSkuList;
ProductShow copyWith({ String id,
String createTime,
String createUser,
String updateTime,
String updateUser,
String supplierName,
String storeId,
String categoryId,
String groupId,
String shortName,
String productName,
String sellDesc,
String productCode,
String weight,
String applyPrice,
String price,
dynamic vipPrice,
num stock,
num sellCount,
num needLogistics,
num oversold,
num organic,
num status,
bool posShow,
dynamic subscribeParam,
bool isRaise,
num productType,
num productNumber,
num setMeal,
num attrStyle,
String detail,
num isDelete,
String printerFlag,
dynamic materials,
dynamic materialId,
String details,
String thumbnailImg,
String info,
num buyCount,
num sellCountLimit,
dynamic stockRecoveryTime,
dynamic isAddPurchase,
num limitNum,
String rankId,
num happyBean,
List<String> imgs,
List<ProductSkuList> productSkuList,
}) => ProductShow( id: id ?? _id,
createTime: createTime ?? _createTime,
createUser: createUser ?? _createUser,
updateTime: updateTime ?? _updateTime,
updateUser: updateUser ?? _updateUser,
supplierName: supplierName ?? _supplierName,
storeId: storeId ?? _storeId,
categoryId: categoryId ?? _categoryId,
groupId: groupId ?? _groupId,
shortName: shortName ?? _shortName,
productName: productName ?? _productName,
sellDesc: sellDesc ?? _sellDesc,
productCode: productCode ?? _productCode,
weight: weight ?? _weight,
applyPrice: applyPrice ?? _applyPrice,
price: price ?? _price,
vipPrice: vipPrice ?? _vipPrice,
stock: stock ?? _stock,
sellCount: sellCount ?? _sellCount,
needLogistics: needLogistics ?? _needLogistics,
oversold: oversold ?? _oversold,
organic: organic ?? _organic,
status: status ?? _status,
posShow: posShow ?? _posShow,
subscribeParam: subscribeParam ?? _subscribeParam,
isRaise: isRaise ?? _isRaise,
productType: productType ?? _productType,
productNumber: productNumber ?? _productNumber,
setMeal: setMeal ?? _setMeal,
attrStyle: attrStyle ?? _attrStyle,
detail: detail ?? _detail,
isDelete: isDelete ?? _isDelete,
printerFlag: printerFlag ?? _printerFlag,
materials: materials ?? _materials,
materialId: materialId ?? _materialId,
details: details ?? _details,
thumbnailImg: thumbnailImg ?? _thumbnailImg,
info: info ?? _info,
buyCount: buyCount ?? _buyCount,
sellCountLimit: sellCountLimit ?? _sellCountLimit,
stockRecoveryTime: stockRecoveryTime ?? _stockRecoveryTime,
isAddPurchase: isAddPurchase ?? _isAddPurchase,
limitNum: limitNum ?? _limitNum,
rankId: rankId ?? _rankId,
happyBean: happyBean ?? _happyBean,
imgs: imgs ?? _imgs,
productSkuList: productSkuList ?? _productSkuList,
);
String get id => _id;
String get createTime => _createTime;
String get createUser => _createUser;
String get updateTime => _updateTime;
String get updateUser => _updateUser;
String get supplierName => _supplierName;
String get storeId => _storeId;
String get categoryId => _categoryId;
String get groupId => _groupId;
String get shortName => _shortName;
String get productName => _productName;
String get sellDesc => _sellDesc;
String get productCode => _productCode;
String get weight => _weight;
String get applyPrice => _applyPrice;
String get price => _price;
dynamic get vipPrice => _vipPrice;
num get stock => _stock;
num get sellCount => _sellCount;
num get needLogistics => _needLogistics;
num get oversold => _oversold;
num get organic => _organic;
num get status => _status;
bool get posShow => _posShow;
dynamic get subscribeParam => _subscribeParam;
bool get isRaise => _isRaise;
num get productType => _productType;
num get productNumber => _productNumber;
num get setMeal => _setMeal;
num get attrStyle => _attrStyle;
String get detail => _detail;
num get isDelete => _isDelete;
String get printerFlag => _printerFlag;
dynamic get materials => _materials;
dynamic get materialId => _materialId;
String get details => _details;
String get thumbnailImg => _thumbnailImg;
String get info => _info;
num get buyCount => _buyCount;
num get sellCountLimit => _sellCountLimit;
dynamic get stockRecoveryTime => _stockRecoveryTime;
dynamic get isAddPurchase => _isAddPurchase;
num get limitNum => _limitNum;
String get rankId => _rankId;
num get happyBean => _happyBean;
List<String> get imgs => _imgs;
List<ProductSkuList> get productSkuList => _productSkuList;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['id'] = _id;
map['createTime'] = _createTime;
map['createUser'] = _createUser;
map['updateTime'] = _updateTime;
map['updateUser'] = _updateUser;
map['supplierName'] = _supplierName;
map['storeId'] = _storeId;
map['categoryId'] = _categoryId;
map['groupId'] = _groupId;
map['shortName'] = _shortName;
map['productName'] = _productName;
map['sellDesc'] = _sellDesc;
map['productCode'] = _productCode;
map['weight'] = _weight;
map['applyPrice'] = _applyPrice;
map['price'] = _price;
map['vipPrice'] = _vipPrice;
map['stock'] = _stock;
map['sellCount'] = _sellCount;
map['needLogistics'] = _needLogistics;
map['oversold'] = _oversold;
map['organic'] = _organic;
map['status'] = _status;
map['posShow'] = _posShow;
map['subscribeParam'] = _subscribeParam;
map['isRaise'] = _isRaise;
map['productType'] = _productType;
map['productNumber'] = _productNumber;
map['setMeal'] = _setMeal;
map['attrStyle'] = _attrStyle;
map['detail'] = _detail;
map['isDelete'] = _isDelete;
map['printerFlag'] = _printerFlag;
map['materials'] = _materials;
map['materialId'] = _materialId;
map['details'] = _details;
map['thumbnailImg'] = _thumbnailImg;
map['info'] = _info;
map['buyCount'] = _buyCount;
map['sellCountLimit'] = _sellCountLimit;
map['stockRecoveryTime'] = _stockRecoveryTime;
map['isAddPurchase'] = _isAddPurchase;
map['limitNum'] = _limitNum;
map['rankId'] = _rankId;
map['happyBean'] = _happyBean;
map['imgs'] = _imgs;
if (_productSkuList != null) {
map['productSkuList'] = _productSkuList.map((v) => v.toJson()).toList();
}
return map;
}
}
/// id : "1484156758229254144"
/// createTime : "2022-01-20 21:32:00"
/// createUser : "1364043181062094848"
/// updateTime : "2022-01-20 21:32:00"
/// updateUser : "1364043181062094848"
/// storeId : "1460885296764682240"
/// skuCode : "P202201202132002"
/// skuNameStr : ""
/// productId : "1484156758195699712"
/// skuPrice : "24.00"
/// applyPrice : "39.00"
/// vipPrice : "24.00"
/// packagingFee : "0.00"
/// skuImg : null
/// skuStock : -13
/// autoRenewSkuStock : 0
/// deliveries : 0
/// ticketType : ""
/// ticketWipedTimeTemplateId : null
/// takeType : null
/// ticketDays : "0"
/// ticketExpireTime : "23:59:59"
/// sort : 50
/// setMeal : ""
/// productSetMeals : null
/// weight : 0.0
/// volume : 0.0
/// isDelete : 0
/// material : null
/// version : 0
/// skuTickets : null
/// ticketStyle : ""
class ProductSkuList {
ProductSkuList({
String id,
String createTime,
String createUser,
String updateTime,
String updateUser,
String storeId,
String skuCode,
String skuNameStr,
String productId,
String skuPrice,
String applyPrice,
String vipPrice,
String packagingFee,
dynamic skuImg,
num skuStock,
num autoRenewSkuStock,
num deliveries,
String ticketType,
dynamic ticketWipedTimeTemplateId,
dynamic takeType,
String ticketDays,
String ticketExpireTime,
num sort,
String setMeal,
dynamic productSetMeals,
num weight,
num volume,
num isDelete,
dynamic material,
num version,
dynamic skuTickets,
String ticketStyle,}){
_id = id;
_createTime = createTime;
_createUser = createUser;
_updateTime = updateTime;
_updateUser = updateUser;
_storeId = storeId;
_skuCode = skuCode;
_skuNameStr = skuNameStr;
_productId = productId;
_skuPrice = skuPrice;
_applyPrice = applyPrice;
_vipPrice = vipPrice;
_packagingFee = packagingFee;
_skuImg = skuImg;
_skuStock = skuStock;
_autoRenewSkuStock = autoRenewSkuStock;
_deliveries = deliveries;
_ticketType = ticketType;
_ticketWipedTimeTemplateId = ticketWipedTimeTemplateId;
_takeType = takeType;
_ticketDays = ticketDays;
_ticketExpireTime = ticketExpireTime;
_sort = sort;
_setMeal = setMeal;
_productSetMeals = productSetMeals;
_weight = weight;
_volume = volume;
_isDelete = isDelete;
_material = material;
_version = version;
_skuTickets = skuTickets;
_ticketStyle = ticketStyle;
}
ProductSkuList.fromJson(dynamic json) {
_id = json['id'];
_createTime = json['createTime'];
_createUser = json['createUser'];
_updateTime = json['updateTime'];
_updateUser = json['updateUser'];
_storeId = json['storeId'];
_skuCode = json['skuCode'];
_skuNameStr = json['skuNameStr'];
_productId = json['productId'];
_skuPrice = json['skuPrice'];
_applyPrice = json['applyPrice'];
_vipPrice = json['vipPrice'];
_packagingFee = json['packagingFee'];
_skuImg = json['skuImg'];
_skuStock = json['skuStock'];
_autoRenewSkuStock = json['autoRenewSkuStock'];
_deliveries = json['deliveries'];
_ticketType = json['ticketType'];
_ticketWipedTimeTemplateId = json['ticketWipedTimeTemplateId'];
_takeType = json['takeType'];
_ticketDays = json['ticketDays'];
_ticketExpireTime = json['ticketExpireTime'];
_sort = json['sort'];
_setMeal = json['setMeal'];
_productSetMeals = json['productSetMeals'];
_weight = json['weight'];
_volume = json['volume'];
_isDelete = json['isDelete'];
_material = json['material'];
_version = json['version'];
_skuTickets = json['skuTickets'];
_ticketStyle = json['ticketStyle'];
}
String _id;
String _createTime;
String _createUser;
String _updateTime;
String _updateUser;
String _storeId;
String _skuCode;
String _skuNameStr;
String _productId;
String _skuPrice;
String _applyPrice;
String _vipPrice;
String _packagingFee;
dynamic _skuImg;
num _skuStock;
num _autoRenewSkuStock;
num _deliveries;
String _ticketType;
dynamic _ticketWipedTimeTemplateId;
dynamic _takeType;
String _ticketDays;
String _ticketExpireTime;
num _sort;
String _setMeal;
dynamic _productSetMeals;
num _weight;
num _volume;
num _isDelete;
dynamic _material;
num _version;
dynamic _skuTickets;
String _ticketStyle;
ProductSkuList copyWith({ String id,
String createTime,
String createUser,
String updateTime,
String updateUser,
String storeId,
String skuCode,
String skuNameStr,
String productId,
String skuPrice,
String applyPrice,
String vipPrice,
String packagingFee,
dynamic skuImg,
num skuStock,
num autoRenewSkuStock,
num deliveries,
String ticketType,
dynamic ticketWipedTimeTemplateId,
dynamic takeType,
String ticketDays,
String ticketExpireTime,
num sort,
String setMeal,
dynamic productSetMeals,
num weight,
num volume,
num isDelete,
dynamic material,
num version,
dynamic skuTickets,
String ticketStyle,
}) => ProductSkuList( id: id ?? _id,
createTime: createTime ?? _createTime,
createUser: createUser ?? _createUser,
updateTime: updateTime ?? _updateTime,
updateUser: updateUser ?? _updateUser,
storeId: storeId ?? _storeId,
skuCode: skuCode ?? _skuCode,
skuNameStr: skuNameStr ?? _skuNameStr,
productId: productId ?? _productId,
skuPrice: skuPrice ?? _skuPrice,
applyPrice: applyPrice ?? _applyPrice,
vipPrice: vipPrice ?? _vipPrice,
packagingFee: packagingFee ?? _packagingFee,
skuImg: skuImg ?? _skuImg,
skuStock: skuStock ?? _skuStock,
autoRenewSkuStock: autoRenewSkuStock ?? _autoRenewSkuStock,
deliveries: deliveries ?? _deliveries,
ticketType: ticketType ?? _ticketType,
ticketWipedTimeTemplateId: ticketWipedTimeTemplateId ?? _ticketWipedTimeTemplateId,
takeType: takeType ?? _takeType,
ticketDays: ticketDays ?? _ticketDays,
ticketExpireTime: ticketExpireTime ?? _ticketExpireTime,
sort: sort ?? _sort,
setMeal: setMeal ?? _setMeal,
productSetMeals: productSetMeals ?? _productSetMeals,
weight: weight ?? _weight,
volume: volume ?? _volume,
isDelete: isDelete ?? _isDelete,
material: material ?? _material,
version: version ?? _version,
skuTickets: skuTickets ?? _skuTickets,
ticketStyle: ticketStyle ?? _ticketStyle,
);
String get id => _id;
String get createTime => _createTime;
String get createUser => _createUser;
String get updateTime => _updateTime;
String get updateUser => _updateUser;
String get storeId => _storeId;
String get skuCode => _skuCode;
String get skuNameStr => _skuNameStr;
String get productId => _productId;
String get skuPrice => _skuPrice;
String get applyPrice => _applyPrice;
String get vipPrice => _vipPrice;
String get packagingFee => _packagingFee;
dynamic get skuImg => _skuImg;
num get skuStock => _skuStock;
num get autoRenewSkuStock => _autoRenewSkuStock;
num get deliveries => _deliveries;
String get ticketType => _ticketType;
dynamic get ticketWipedTimeTemplateId => _ticketWipedTimeTemplateId;
dynamic get takeType => _takeType;
String get ticketDays => _ticketDays;
String get ticketExpireTime => _ticketExpireTime;
num get sort => _sort;
String get setMeal => _setMeal;
dynamic get productSetMeals => _productSetMeals;
num get weight => _weight;
num get volume => _volume;
num get isDelete => _isDelete;
dynamic get material => _material;
num get version => _version;
dynamic get skuTickets => _skuTickets;
String get ticketStyle => _ticketStyle;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['id'] = _id;
map['createTime'] = _createTime;
map['createUser'] = _createUser;
map['updateTime'] = _updateTime;
map['updateUser'] = _updateUser;
map['storeId'] = _storeId;
map['skuCode'] = _skuCode;
map['skuNameStr'] = _skuNameStr;
map['productId'] = _productId;
map['skuPrice'] = _skuPrice;
map['applyPrice'] = _applyPrice;
map['vipPrice'] = _vipPrice;
map['packagingFee'] = _packagingFee;
map['skuImg'] = _skuImg;
map['skuStock'] = _skuStock;
map['autoRenewSkuStock'] = _autoRenewSkuStock;
map['deliveries'] = _deliveries;
map['ticketType'] = _ticketType;
map['ticketWipedTimeTemplateId'] = _ticketWipedTimeTemplateId;
map['takeType'] = _takeType;
map['ticketDays'] = _ticketDays;
map['ticketExpireTime'] = _ticketExpireTime;
map['sort'] = _sort;
map['setMeal'] = _setMeal;
map['productSetMeals'] = _productSetMeals;
map['weight'] = _weight;
map['volume'] = _volume;
map['isDelete'] = _isDelete;
map['material'] = _material;
map['version'] = _version;
map['skuTickets'] = _skuTickets;
map['ticketStyle'] = _ticketStyle;
return map;
}
}

160
lib/retrofit/data/store.dart

@ -1,8 +1,7 @@
import 'package:huixiang/retrofit/data/coupon_vo.dart'; import 'package:huixiang/retrofit/data/coupon_vo.dart';
import 'package:huixiang/retrofit/data/product_show.dart';
import 'package:huixiang/retrofit/data/store_type.dart'; import 'package:huixiang/retrofit/data/store_type.dart';
class Store { class Store {
Store(); Store();
@ -38,81 +37,94 @@ class Store {
CouponVo couponVO; CouponVo couponVO;
dynamic deliveryInfo; dynamic deliveryInfo;
String businessType; String businessType;
String businessService;
List<ProductShow> productShow;
StoreType posType; StoreType posType;
factory Store.fromJson(Map<String, dynamic> json) => Store() factory Store.fromJson(Map<String, dynamic> json) =>
..id = json['id'] as String Store()
..createTime = json['createTime'] as String ..id = json['id'] as String
..createUser = json['createUser'] as String ..createTime = json['createTime'] as String
..updateTime = json['updateTime'] as String ..createUser = json['createUser'] as String
..updateUser = json['updateUser'] as String ..updateTime = json['updateTime'] as String
..tenantCode = json['tenantCode'] as String ..updateUser = json['updateUser'] as String
..useErp = json['useErp'] as bool ..tenantCode = json['tenantCode'] as String
..openStartTime = json['openStartTime'] as String ..useErp = json['useErp'] as bool
..openEndTime = json['openEndTime'] as String ..openStartTime = json['openStartTime'] as String
..perCapitaConsumption = json['perCapitaConsumption'] as String ..openEndTime = json['openEndTime'] as String
..storeName = json['storeName'] as String ..perCapitaConsumption = json['perCapitaConsumption'] as String
..distance = (json['distance'] as num)?.toDouble() ..storeName = json['storeName'] as String
..logo = json['logo'] as String ..distance = (json['distance'] as num)?.toDouble()
..facade = json['facade'] as String ..logo = json['logo'] as String
..shipAddress = json['shipAddress'] as String ..facade = json['facade'] as String
..remark = json['remark'] ..shipAddress = json['shipAddress'] as String
..mobile = json['mobile'] as String ..remark = json['remark']
..longitude = json['longitude'] as String ..mobile = json['mobile'] as String
..latitude = json['latitude'] as String ..longitude = json['longitude'] as String
..refundAddress = json['refundAddress'] ..latitude = json['latitude'] as String
..refundTel = json['refundTel'] ..refundAddress = json['refundAddress']
..refundContact = json['refundContact'] ..refundTel = json['refundTel']
..isAutoSendRefundAddress = json['isAutoSendRefundAddress'] as int ..refundContact = json['refundContact']
..province = json['province'] as String ..isAutoSendRefundAddress = json['isAutoSendRefundAddress'] as int
..city = json['city'] as String ..province = json['province'] as String
..district = json['district'] as String ..city = json['city'] as String
..address = json['address'] as String ..district = json['district'] as String
..headName = json['headName'] as String ..address = json['address'] as String
..headMobile = json['headMobile'] as String ..headName = json['headName'] as String
..deliveryInfo = json['deliveryInfo'] ..headMobile = json['headMobile'] as String
..businessType = json['businessType'] as String ..deliveryInfo = json['deliveryInfo']
..couponVO = json['couponVO'] == null ? null : CouponVo.fromJson(json['couponVO']) ..businessType = json['businessType'] as String
..posType = json['posType'] == null ..businessService = json['businessService'] as String
? null ..couponVO = json['couponVO'] == null ? null : CouponVo.fromJson(
: StoreType.fromJson(json['posType'] as Map<String, dynamic>); json['couponVO'])
..productShow = (json['productShow'] as List)
Map<String, dynamic> toJson() => <String, dynamic>{ ?.map((e) =>
'id': this.id, e == null ? null : ProductShow.fromJson(e as Map<String, dynamic>))
'createTime': this.createTime, ?.toList()
'createUser': this.createUser, ..posType = json['posType'] == null
'updateTime': this.updateTime, ? null
'updateUser': this.updateUser, : StoreType.fromJson(json['posType'] as Map<String, dynamic>);
'tenantCode': this.tenantCode,
'useErp': this.useErp,
'openStartTime': this.openStartTime,
'openEndTime': this.openEndTime,
'perCapitaConsumption': this.perCapitaConsumption,
'storeName': this.storeName,
'distance': this.distance,
'logo': this.logo,
'facade': this.facade,
'shipAddress': this.shipAddress,
'remark': this.remark,
'mobile': this.mobile,
'longitude': this.longitude,
'latitude': this.latitude,
'refundAddress': this.refundAddress,
'refundTel': this.refundTel,
'refundContact': this.refundContact,
'isAutoSendRefundAddress': this.isAutoSendRefundAddress,
'province': this.province,
'city': this.city,
'district': this.district,
'address': this.address,
'headName': this.headName,
'headMobile': this.headMobile,
'deliveryInfo': this.deliveryInfo,
'businessType': this.businessType,
'couponVO': this.couponVO != null ? this.couponVO.toJson() : null,
'posType': this.posType,
};
Map<String, dynamic> toJson() =>
<String, dynamic>{
'id': this.id,
'createTime': this.createTime,
'createUser': this.createUser,
'updateTime': this.updateTime,
'updateUser': this.updateUser,
'tenantCode': this.tenantCode,
'useErp': this.useErp,
'openStartTime': this.openStartTime,
'openEndTime': this.openEndTime,
'perCapitaConsumption': this.perCapitaConsumption,
'storeName': this.storeName,
'distance': this.distance,
'logo': this.logo,
'facade': this.facade,
'shipAddress': this.shipAddress,
'remark': this.remark,
'mobile': this.mobile,
'longitude': this.longitude,
'latitude': this.latitude,
'refundAddress': this.refundAddress,
'refundTel': this.refundTel,
'refundContact': this.refundContact,
'isAutoSendRefundAddress': this.isAutoSendRefundAddress,
'province': this.province,
'city': this.city,
'district': this.district,
'address': this.address,
'headName': this.headName,
'headMobile': this.headMobile,
'deliveryInfo': this.deliveryInfo,
'businessType': this.businessType,
'businessService': this.businessService,
'couponVO': this.couponVO != null ? this.couponVO.toJson() : null,
'productShow': this.productShow.map((e) => e.toJson()).toList(),
'posType': this.posType,
};
} }

16
lib/retrofit/min_api.dart

@ -19,6 +19,7 @@ import 'data/activity_order_list.dart';
import 'data/findMiNiGroupList.dart'; import 'data/findMiNiGroupList.dart';
import 'data/home_recommend_list.dart'; import 'data/home_recommend_list.dart';
import 'data/launch_join_act.dart'; import 'data/launch_join_act.dart';
import 'data/member_recharge_list.dart';
import 'data/miNiDetail.dart'; import 'data/miNiDetail.dart';
import 'data/settleOrderInfo.dart'; import 'data/settleOrderInfo.dart';
import 'data/shoppingCart.dart'; import 'data/shoppingCart.dart';
@ -26,7 +27,7 @@ import 'data/shopping_home_config.dart';
part 'min_api.g.dart'; part 'min_api.g.dart';
const localBaseUrl = "http://192.168.10.78:8765/app/";/// const localBaseUrl = "http://app-api.test.yixinhuixiang.com/app/";///
// const localBaseUrl = "http://pos-test.api.lotus-wallet.com/app/";/// // const localBaseUrl = "http://pos-test.api.lotus-wallet.com/app/";///
const serviceBaseUrl = "https://pos.api.lotus-wallet.com/app/";///线 const serviceBaseUrl = "https://pos.api.lotus-wallet.com/app/";///线
@ -49,7 +50,7 @@ abstract class MinApiService {
headers["tenant"] = tenant; headers["tenant"] = tenant;
} }
if (storeId != null && storeId != "") { if (storeId != null && storeId != "") {
headers["store_id"] = storeId; headers["store-id"] = storeId;
} }
headers["Environment"] = "app"; headers["Environment"] = "app";
dio.options = BaseOptions( dio.options = BaseOptions(
@ -67,7 +68,7 @@ abstract class MinApiService {
debugPrint("headers = ${options.headers}"); debugPrint("headers = ${options.headers}");
if (showLoading && !EasyLoading.isShow) { if (showLoading && !EasyLoading.isShow) {
//loading //loading
EasyLoading.show(status: S.of(context).zhengzaijiazai); EasyLoading.show(status: S.of(context).zhengzaijiazai,maskType: EasyLoadingMaskType.black);
} }
if (options.data is FormData) { if (options.data is FormData) {
debugPrint("params data = FormData"); debugPrint("params data = FormData");
@ -243,4 +244,13 @@ abstract class MinApiService {
@POST("promotion/useMemberCoupon") @POST("promotion/useMemberCoupon")
Future<BaseData> useMemberCoupon(@Body() Map<String, dynamic> param); Future<BaseData> useMemberCoupon(@Body() Map<String, dynamic> param);
///
@POST("/member/recharge")
Future<BaseData<dynamic>> memberRecharge(@Body() Map<String, dynamic> param);
///
@GET("/store/getRechargePreferential")
Future<BaseData<List<MemberRechargeList>>> memberRechargeList();
} }

45
lib/retrofit/min_api.g.dart

@ -651,4 +651,49 @@ class _MinApiService implements MinApiService {
); );
return value; return value;
} }
@override
Future<BaseData<dynamic>> memberRecharge(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<dynamic>.fromJson(
_result.data,
(json) => json as dynamic,
);
return value;
}
@override
Future<BaseData<List<MemberRechargeList>>> memberRechargeList() async {
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'/store/getRechargePreferential',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<List<MemberRechargeList>>.fromJson(
_result.data,
(json) => (json as List<dynamic>)
.map<MemberRechargeList>(
(i) => MemberRechargeList.fromJson(i as Map<String, dynamic>))
.toList());
return value;
}
} }

119
lib/retrofit/retrofit_api.dart

@ -6,7 +6,7 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:gbk2utf8/gbk2utf8.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/activity.dart'; import 'package:huixiang/retrofit/data/activity.dart';
import 'package:huixiang/retrofit/data/article.dart'; import 'package:huixiang/retrofit/data/article.dart';
@ -14,11 +14,11 @@ import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/comunity_comment.dart'; import 'package:huixiang/retrofit/data/comunity_comment.dart';
import 'package:huixiang/retrofit/data/coupon.dart'; import 'package:huixiang/retrofit/data/coupon.dart';
import 'package:huixiang/retrofit/data/farmers_list.dart'; import 'package:huixiang/retrofit/data/farmers_list.dart';
import 'package:huixiang/retrofit/data/login_info.dart';
import 'package:huixiang/retrofit/data/order_info.dart'; import 'package:huixiang/retrofit/data/order_info.dart';
import 'package:huixiang/view_widget/login_tips_dialog.dart'; import 'package:huixiang/view_widget/login_tips_dialog.dart';
import 'package:retrofit/retrofit.dart'; import 'package:retrofit/retrofit.dart';
import '../login/captcha/click_word_captcha.dart';
import '../utils/flutter_utils.dart'; import '../utils/flutter_utils.dart';
import 'data/achievement_detail_list.dart'; import 'data/achievement_detail_list.dart';
import 'data/activity_pos.dart'; import 'data/activity_pos.dart';
@ -41,6 +41,7 @@ import 'data/headlines_list.dart';
import 'data/headlines_list_details.dart'; import 'data/headlines_list_details.dart';
import 'data/home_rank.dart'; import 'data/home_rank.dart';
import 'data/invitation_list.dart'; import 'data/invitation_list.dart';
import 'data/ip_data.dart';
import 'data/logistics.dart'; import 'data/logistics.dart';
import 'data/member_Infor.dart'; import 'data/member_Infor.dart';
import 'data/member_comment_list.dart'; import 'data/member_comment_list.dart';
@ -49,7 +50,6 @@ import 'data/msg_stats.dart';
import 'data/page.dart'; import 'data/page.dart';
import 'data/rank.dart'; import 'data/rank.dart';
import 'data/rechargeActLists.dart'; import 'data/rechargeActLists.dart';
import 'data/recharge_list.dart';
import 'data/second_card_list.dart'; import 'data/second_card_list.dart';
import 'data/sign_info.dart'; import 'data/sign_info.dart';
import 'data/social_info.dart'; import 'data/social_info.dart';
@ -66,9 +66,15 @@ import 'data/wx_pay.dart';
part 'retrofit_api.g.dart'; part 'retrofit_api.g.dart';
const localBaseUrl = "http://192.168.10.78:8766/app/";/// const localBaseUrl = "http://platform-api.test.yixinhuixiang.com/app/";///
// const localBaseUrl = "http://platform.test.api.lotus-wallet.com/app/";/// // const localBaseUrl = "http://platform.test.api.lotus-wallet.com/app/";///
const serviceBaseUrl = "https://pos.platform.lotus-wallet.com/app/";///线 const serviceBaseUrl = "https://pos.platform.lotus-wallet.com/app/";
///线
const ipBaseUrl = "http://whois.pconline.com.cn";
///ip
@RestApi(baseUrl: localBaseUrl) @RestApi(baseUrl: localBaseUrl)
abstract class ApiService { abstract class ApiService {
@ -78,6 +84,7 @@ abstract class ApiService {
BuildContext context, BuildContext context,
String token, String token,
bool showLoading = false, bool showLoading = false,
bool isIp = false,
bool pay = true, bool pay = true,
}) { }) {
Map<String, dynamic> headers = Map<String, dynamic> headers =
@ -85,6 +92,9 @@ abstract class ApiService {
if (pay) { if (pay) {
headers["Environment"] = "app"; headers["Environment"] = "app";
} }
print("软件当前运行的模式 kReleaseMode:"+(kReleaseMode ? "发布模式":"调试模式"));
if (kReleaseMode) baseUrl = serviceBaseUrl;
if (isIp) baseUrl = ipBaseUrl;
dio.options = BaseOptions( dio.options = BaseOptions(
connectTimeout: 60000, connectTimeout: 60000,
receiveTimeout: 60000, receiveTimeout: 60000,
@ -93,34 +103,40 @@ abstract class ApiService {
); );
dio.interceptors.add( dio.interceptors.add(
InterceptorsWrapper(onRequest: (RequestOptions options) { InterceptorsWrapper(onRequest: (RequestOptions options) {
try {
debugPrint("\n======================= 请求数据 ======================="); debugPrint("\n======================= 请求数据 =======================");
debugPrint("method = ${options.method.toString()}"); debugPrint("method = ${options.method.toString()}");
debugPrint("url = ${options.uri.toString()}"); debugPrint("url = ${options.uri.toString()}");
debugPrint("headers = ${options.headers}"); debugPrint("headers = ${options.headers}");
if (showLoading && !EasyLoading.isShow) { if (showLoading && !EasyLoading.isShow) {
//loading //loading
EasyLoading.show(status: S.of(context).zhengzaijiazai); EasyLoading.show(
status: S.of(context).zhengzaijiazai,
maskType: EasyLoadingMaskType.black);
} }
if (options.data is FormData) { if (options.data is FormData) {
debugPrint("params data = FormData"); debugPrint("params data = FormData");
} else { } else {
debugPrint("params data = ${jsonEncode(options.data)}"); debugPrint("params data = ${jsonEncode(options.data)}");
} }
debugPrint("params queryParameters = ${options.queryParameters}"); debugPrint("params queryParameters = ${options.queryParameters}");
} catch (e1) {}
}, onResponse: (Response response) { }, onResponse: (Response response) {
try {
debugPrint("\n======================= 响应数据开始 ======================="); debugPrint("\n======================= 响应数据开始 =======================");
if (showLoading && EasyLoading.isShow) { if (showLoading && EasyLoading.isShow) {
EasyLoading.dismiss(); EasyLoading.dismiss();
} }
debugPrint("code = ${response.statusCode}"); debugPrint("code = ${response.statusCode}");
p(jsonEncode(response.data)); p(jsonEncode(response.data));
// debugPrint(jsonEncode(response.data), wrapWidth: response.data.toString().length * 10); // debugPrint(jsonEncode(response.data), wrapWidth: response.data.toString().length * 10);
Map map = response.data; Map map = response.data;
if (map["code"] != 0) { // if (map["code"] != 0) {
EasyLoading.dismiss(); // EasyLoading.dismiss();
} // }
if (map["code"] == 40005 || map["code"] == 40001) { if (map["code"] == 40005 || map["code"] == 40001) {
if (!LoginTipsDialog().isShow) { if (!LoginTipsDialog().isShow) {
print("show: ${LoginTipsDialog().isShow}"); print("show: ${LoginTipsDialog().isShow}");
@ -131,6 +147,7 @@ abstract class ApiService {
// SmartDialog.showToast(map["msg"], alignment: Alignment.center); // SmartDialog.showToast(map["msg"], alignment: Alignment.center);
} }
debugPrint("======================= 响应数据结束 =======================\n"); debugPrint("======================= 响应数据结束 =======================\n");
} catch (e2) {}
}, onError: (DioError e) { }, onError: (DioError e) {
if (EasyLoading.isShow) { if (EasyLoading.isShow) {
EasyLoading.dismiss(); EasyLoading.dismiss();
@ -143,16 +160,14 @@ abstract class ApiService {
debugPrint("\n"); debugPrint("\n");
}), }),
); );
if (kReleaseMode) {
baseUrl = serviceBaseUrl;
}
return _ApiService(dio, baseUrl: baseUrl); return _ApiService(dio, baseUrl: baseUrl);
} }
static void p(String msg) { static void p(String msg) {
//String的length是字符数量不是字节数量所以为了防止中文字符过多 //String的length是字符数量不是字节数量所以为了防止中文字符过多
// 4*1024MAX字节打印长度改为1000字符数 // 4*1024MAX字节打印长度改为1000字符数
if(msg.length > 10000)
return;
int maxStrLength = 900; int maxStrLength = 900;
//1000 //1000
while (msg.length > maxStrLength) { while (msg.length > maxStrLength) {
@ -166,11 +181,12 @@ abstract class ApiService {
/// ///
@POST("/file/upload") @POST("/file/upload")
@MultiPart() @MultiPart()
Future<BaseData<UploadResult>> upload( Future<BaseData<UploadResult>> upload(@Part(name: "file") File data,
@Part(name: "file") File data, @Part(name: "folderId") int folderId,bool isVideo); @Part(name: "folderId") int folderId, bool isVideo);
/// ///
@GET("https://restapi.amap.com/v3/place/around?key=542b46afa8e4b88fe1eb3c4d0ba0872f&location={lat},{lng}&keywords={keywords}&offset={size}&page={page}&extensions=all") @GET(
"https://restapi.amap.com/v3/place/around?key=542b46afa8e4b88fe1eb3c4d0ba0872f&location={lat},{lng}&keywords={keywords}&offset={size}&page={page}&extensions=all")
Future<dynamic> searchPoi(@Path("lat") String lat, @Path("lng") String lng, Future<dynamic> searchPoi(@Path("lat") String lat, @Path("lng") String lng,
@Path("keywords") String keywords, int size, int page); @Path("keywords") String keywords, int size, int page);
@ -183,8 +199,8 @@ abstract class ApiService {
Future<BaseData<ChannelsList>> appChannels(); Future<BaseData<ChannelsList>> appChannels();
/// ///
@GET("/auth/sendVerify/{areaCode}/{mobile}") @POST("/auth/sendVerify")
Future<BaseData> sendVerify(@Path("areaCode") String areaCode, @Path("mobile") String mobile); Future<BaseData<dynamic>> sendVerify(@Body() Map<String, dynamic> param);
/// ///
@POST("/creditGoods/list") @POST("/creditGoods/list")
@ -221,8 +237,9 @@ abstract class ApiService {
Future<BaseData<dynamic>> recharge(@Body() Map<String, dynamic> param); Future<BaseData<dynamic>> recharge(@Body() Map<String, dynamic> param);
/// ///
@GET("/wallet/rechargeActList") @GET("/wallet/rechargeActList?tenantCode={tenantCode}")
Future<BaseData<RechargeActLists>> rechargeActList(); Future<BaseData<RechargeActLists>> rechargeActList(
@Path("tenantCode") String tenantCode);
/// ///
@GET("/coupon/receive?couponId={couponId}") @GET("/coupon/receive?couponId={couponId}")
@ -298,11 +315,13 @@ abstract class ApiService {
/// ///
@POST("/information/list") @POST("/information/list")
Future<BaseData<PageInfo<Article>>> queryArticle(@Body() Map<String, dynamic> param); Future<BaseData<PageInfo<Article>>> queryArticle(
@Body() Map<String, dynamic> param);
///banner查询 ///banner查询
@POST("/banner/page") @POST("/banner/page")
Future<BaseData<PageInfo<BannerData>>> queryBanner(@Body() Map<String, dynamic> param); Future<BaseData<PageInfo<BannerData>>> queryBanner(
@Body() Map<String, dynamic> param);
/// ///
@GET("/home/brand") @GET("/home/brand")
@ -351,6 +370,16 @@ abstract class ApiService {
Future<BaseData<PageInfo<Message>>> msgList( Future<BaseData<PageInfo<Message>>> msgList(
@Body() Map<String, dynamic> param); @Body() Map<String, dynamic> param);
///
@POST("/captcha/get")
Future<ClickWordCaptchaModel> captchaGet(
@Body() Map<String, dynamic> param);
///
@POST("/captcha/check")
Future<bool> captchaCheck(
@Body() Map<String, dynamic> param);
///App消息详情 ///App消息详情
@GET("/app-msg/{id}") @GET("/app-msg/{id}")
Future<BaseData> queryMsg(@Path("id") String id); Future<BaseData> queryMsg(@Path("id") String id);
@ -404,11 +433,13 @@ abstract class ApiService {
/// ///
@POST("/information/trend-list") @POST("/information/trend-list")
Future<BaseData<PageInfo<ComunityComment>>> trendList(@Body() Map<String, dynamic> map); Future<BaseData<PageInfo<ComunityComment>>> trendList(
@Body() Map<String, dynamic> map);
/// / /// /
@POST("/member/follow/list") @POST("/member/follow/list")
Future<BaseData<PageInfo<ListData>>> followList(@Body() Map<String, dynamic> map); Future<BaseData<PageInfo<ListData>>> followList(
@Body() Map<String, dynamic> map);
//// ////
@PUT("/member/follow/{followId}") @PUT("/member/follow/{followId}")
@ -428,11 +459,13 @@ abstract class ApiService {
/// ///
@GET("/course/catalogList/{courseId}") @GET("/course/catalogList/{courseId}")
Future<BaseData<List<Chapter>>> catalogList(@Path("courseId") String courseId); Future<BaseData<List<Chapter>>> catalogList(
@Path("courseId") String courseId);
/// ///
@POST("/course/list") @POST("/course/list")
Future<BaseData<PageInfo<CourseList>>> courseList(@Body() Map<String, dynamic> map); Future<BaseData<PageInfo<CourseList>>> courseList(
@Body() Map<String, dynamic> map);
/// ///
@GET("/course/collectList") @GET("/course/collectList")
@ -440,7 +473,8 @@ abstract class ApiService {
/// ///
@GET("/course/collect/{collectId}") @GET("/course/collect/{collectId}")
Future<BaseData<List<CourseList>>> collect(@Path("collectId") String collectId); Future<BaseData<List<CourseList>>> collect(
@Path("collectId") String collectId);
/// ///
@GET("/course/{id}") @GET("/course/{id}")
@ -452,15 +486,18 @@ abstract class ApiService {
/// APP查询所有成就徽章 /// APP查询所有成就徽章
@POST("/app-memberAchievement/findBadges") @POST("/app-memberAchievement/findBadges")
Future<BaseData<List<VipBadgesList>>> findBadges(@Body() Map<String, dynamic> map); Future<BaseData<List<VipBadgesList>>> findBadges(
@Body() Map<String, dynamic> map);
/// ///
@GET("/app-memberAchievement/getAchievementDetail?achievementCategoryId={achievementCategoryId}") @GET(
Future<BaseData<List<AchievementDetailList>>> getAchievementDetail(@Path("achievementCategoryId") String achievementCategoryId); "/app-memberAchievement/getAchievementDetail?achievementCategoryId={achievementCategoryId}")
Future<BaseData<List<AchievementDetailList>>> getAchievementDetail(
@Path("achievementCategoryId") String achievementCategoryId);
/// ///
@GET("/member/benefitList") @GET("/member/benefitList")
Future<BaseData<List<VipBenefitList>>> benefitList(); Future<BaseData<List<VipBenefitList>>> benefitList();
/// ///
@GET("/home/vipBenefit") @GET("/home/vipBenefit")
@ -480,7 +517,8 @@ abstract class ApiService {
/// ///
@GET("/creditOrder/getAppShippingTrace?orderId={orderId}") @GET("/creditOrder/getAppShippingTrace?orderId={orderId}")
Future<BaseData<Logistics>> getAppShippingTrace(@Path("orderId") String orderId); Future<BaseData<Logistics>> getAppShippingTrace(
@Path("orderId") String orderId);
/// ///
@POST("/member/rankBuy") @POST("/member/rankBuy")
@ -492,11 +530,13 @@ abstract class ApiService {
/// ///
@GET("/information/category/{id}") @GET("/information/category/{id}")
Future<BaseData<HeadlinesListDetails>> headlinesDetails(@Path("id") String id); Future<BaseData<HeadlinesListDetails>> headlinesDetails(
@Path("id") String id);
/// ///
@POST("/member/inviteMemberList") @POST("/member/inviteMemberList")
Future<BaseData<PageInfo<InvitationList>>> inviteMemberList(@Body() Map<String, dynamic> map); Future<BaseData<PageInfo<InvitationList>>> inviteMemberList(
@Body() Map<String, dynamic> map);
/// ///
@GET("/coupon/wiped/{memberCouponId}") @GET("/coupon/wiped/{memberCouponId}")
@ -564,5 +604,10 @@ abstract class ApiService {
/// ///
@GET("/store/storeListByCreditId/{creditGoodsId}") @GET("/store/storeListByCreditId/{creditGoodsId}")
Future<BaseData<List<Store>>> storeListByCreditId(@Path("creditGoodsId") String creditGoodsId); Future<BaseData<List<Store>>> storeListByCreditId(
@Path("creditGoodsId") String creditGoodsId);
///APP门店推广渠道
@GET("/ipJson.jsp")
Future<IpData> getIpInfo();
} }

161
lib/retrofit/retrofit_api.g.dart

@ -17,21 +17,18 @@ class _ApiService implements ApiService {
String baseUrl; String baseUrl;
@override @override
Future<BaseData<UploadResult>> upload(data, folderId,bool isVideo) async { Future<BaseData<UploadResult>> upload(data, folderId, bool isVideo) async {
ArgumentError.checkNotNull(data, 'data'); ArgumentError.checkNotNull(data, 'data');
ArgumentError.checkNotNull(folderId, 'folderId'); ArgumentError.checkNotNull(folderId, 'folderId');
const _extra = <String, dynamic>{}; const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{}; final queryParameters = <String, dynamic>{};
final _data = FormData(); final _data = FormData();
String fileName = data.path.split(Platform.pathSeparator).last; String fileName = data.path.split(Platform.pathSeparator).last;
if(!isVideo && !fileName.contains(".jpeg") && !fileName.contains(".png")) if (!isVideo && !fileName.contains(".jpeg") && !fileName.contains(".png"))
fileName += ".jpeg"; fileName += ".jpeg";
else if(isVideo && !fileName.contains(".mp4")) else if (isVideo && !fileName.contains(".mp4")) fileName += ".mp4";
fileName += ".mp4";
_data.files.add(MapEntry( _data.files.add(MapEntry(
'file', 'file', MultipartFile.fromFileSync(data.path, filename: fileName)));
MultipartFile.fromFileSync(data.path,
filename: fileName)));
print("filename:$fileName"); print("filename:$fileName");
if (folderId != null) { if (folderId != null) {
_data.fields.add(MapEntry('folderId', folderId.toString())); _data.fields.add(MapEntry('folderId', folderId.toString()));
@ -93,7 +90,7 @@ class _ApiService implements ApiService {
data: _data); data: _data);
final value = BaseData.fromJson( final value = BaseData.fromJson(
_result.data, _result.data,
(json) => json==null?null:json, (json) => json == null ? null : json,
); );
return value; return value;
} }
@ -114,30 +111,29 @@ class _ApiService implements ApiService {
data: _data); data: _data);
final value = BaseData<ChannelsList>.fromJson( final value = BaseData<ChannelsList>.fromJson(
_result.data, _result.data,
(json) => ChannelsList.fromJson(json), (json) => ChannelsList.fromJson(json),
); );
return value; return value;
} }
@override @override
Future<BaseData<dynamic>> sendVerify(areaCode,mobile) async { Future<BaseData<dynamic>> sendVerify(param) async {
ArgumentError.checkNotNull(mobile, 'mobile'); ArgumentError.checkNotNull(param, 'param');
ArgumentError.checkNotNull(areaCode, 'areaCode');
const _extra = <String, dynamic>{}; const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{}; final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{}; final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>( _data.addAll(param ?? <String, dynamic>{});
'/auth/sendVerify/$areaCode/$mobile', final _result = await _dio.request<Map<String, dynamic>>('/auth/sendVerify',
queryParameters: queryParameters, queryParameters: queryParameters,
options: RequestOptions( options: RequestOptions(
method: 'GET', method: 'POST',
headers: <String, dynamic>{}, headers: <String, dynamic>{},
extra: _extra, extra: _extra,
baseUrl: baseUrl), baseUrl: baseUrl),
data: _data); data: _data);
final value = BaseData<dynamic>.fromJson( final value = BaseData<dynamic>.fromJson(
_result.data, _result.data,
(json) => json as dynamic, (json) => json == null ? null :json as dynamic,
); );
return value; return value;
} }
@ -322,12 +318,12 @@ class _ApiService implements ApiService {
} }
@override @override
Future<BaseData<RechargeActLists>> rechargeActList() async { Future<BaseData<RechargeActLists>> rechargeActList(tenantCode) async {
const _extra = <String, dynamic>{}; const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{}; final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{}; final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>( final _result = await _dio.request<Map<String, dynamic>>(
'/wallet/rechargeActList', '/wallet/rechargeActList?tenantCode=$tenantCode',
queryParameters: queryParameters, queryParameters: queryParameters,
options: RequestOptions( options: RequestOptions(
method: 'GET', method: 'GET',
@ -337,7 +333,7 @@ class _ApiService implements ApiService {
data: _data); data: _data);
final value = BaseData<RechargeActLists>.fromJson( final value = BaseData<RechargeActLists>.fromJson(
_result.data, _result.data,
(json) => RechargeActLists.fromJson(json), (json) => RechargeActLists.fromJson(json),
); );
return value; return value;
} }
@ -359,7 +355,7 @@ class _ApiService implements ApiService {
data: _data); data: _data);
final value = BaseData<dynamic>.fromJson( final value = BaseData<dynamic>.fromJson(
_result.data, _result.data,
(json) => json == null ? null :json as dynamic, (json) => json == null ? null : json as dynamic,
); );
return value; return value;
} }
@ -592,9 +588,11 @@ class _ApiService implements ApiService {
data: _data); data: _data);
final value = BaseData<List<Store>>.fromJson( final value = BaseData<List<Store>>.fromJson(
_result.data, _result.data,
(json) => (json as List<dynamic>) (json) => ((json ?? "") == "")
.map<Store>((i) => Store.fromJson(i as Map<String, dynamic>)) ? null
.toList()); : (json as List<dynamic>)
.map<Store>((i) => Store.fromJson(i as Map<String, dynamic>))
.toList());
return value; return value;
} }
@ -885,10 +883,12 @@ class _ApiService implements ApiService {
data: _data); data: _data);
final value = BaseData<PageInfo<OrderInfo>>.fromJson( final value = BaseData<PageInfo<OrderInfo>>.fromJson(
_result.data, _result.data,
(json) => ((json??"") == "")?null:PageInfo<OrderInfo>.fromJson( (json) => ((json ?? "") == "")
json, ? null
(json) => OrderInfo.fromJson(json), : PageInfo<OrderInfo>.fromJson(
), json,
(json) => OrderInfo.fromJson(json),
),
); );
return value; return value;
} }
@ -1031,6 +1031,46 @@ class _ApiService implements ApiService {
return value; return value;
} }
@override
Future<ClickWordCaptchaModel> captchaGet(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>>('/captcha/get',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value =
(_result.data['repCode'] != '0000' || _result.data['repData'] == null)
? null
: ClickWordCaptchaModel.fromMap(_result.data['repData']);
return value;
}
@override
Future<bool> captchaCheck(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>>('/captcha/check',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
return (_result.data['repCode'] != '0000' || _result.data['repData'] == null || !_result.data['repData']['result']);
}
@override @override
Future<BaseData<dynamic>> queryMsg(id) async { Future<BaseData<dynamic>> queryMsg(id) async {
ArgumentError.checkNotNull(id, 'id'); ArgumentError.checkNotNull(id, 'id');
@ -1272,7 +1312,7 @@ class _ApiService implements ApiService {
data: _data); data: _data);
final value = BaseData<String>.fromJson( final value = BaseData<String>.fromJson(
_result.data, _result.data,
(json) => json==null?null:(json as String), (json) => json == null ? null : (json as String),
); );
return value; return value;
} }
@ -1295,7 +1335,7 @@ class _ApiService implements ApiService {
data: _data); data: _data);
final value = BaseData<bool>.fromJson( final value = BaseData<bool>.fromJson(
_result.data, _result.data,
(json) => (json??"")=="" ? null :(json as bool), (json) => (json ?? "") == "" ? null : (json as bool),
); );
return value; return value;
} }
@ -1881,7 +1921,8 @@ class _ApiService implements ApiService {
const _extra = <String, dynamic>{}; const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{}; final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{}; final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>('coupon/detail/$memberCouponId', final _result = await _dio.request<Map<String, dynamic>>(
'coupon/detail/$memberCouponId',
queryParameters: queryParameters, queryParameters: queryParameters,
options: RequestOptions( options: RequestOptions(
method: 'GET', method: 'GET',
@ -2018,7 +2059,7 @@ class _ApiService implements ApiService {
data: _data); data: _data);
final value = BaseData<HomeRank>.fromJson( final value = BaseData<HomeRank>.fromJson(
_result.data, _result.data,
(json) => HomeRank.fromJson(json), (json) => HomeRank.fromJson(json),
); );
return value; return value;
} }
@ -2039,7 +2080,7 @@ class _ApiService implements ApiService {
data: _data); data: _data);
final value = BaseData<dynamic>.fromJson( final value = BaseData<dynamic>.fromJson(
_result.data, _result.data,
(json) => json as dynamic, (json) => json as dynamic,
); );
return value; return value;
} }
@ -2051,7 +2092,8 @@ class _ApiService implements ApiService {
final queryParameters = <String, dynamic>{}; final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{}; final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{}); _data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>('/member/updatePayPwd', final _result = await _dio.request<Map<String, dynamic>>(
'/member/updatePayPwd',
queryParameters: queryParameters, queryParameters: queryParameters,
options: RequestOptions( options: RequestOptions(
method: 'POST', method: 'POST',
@ -2061,7 +2103,7 @@ class _ApiService implements ApiService {
data: _data); data: _data);
final value = BaseData<dynamic>.fromJson( final value = BaseData<dynamic>.fromJson(
_result.data, _result.data,
(json) => json as dynamic, (json) => json as dynamic,
); );
return value; return value;
} }
@ -2073,7 +2115,8 @@ class _ApiService implements ApiService {
final queryParameters = <String, dynamic>{}; final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{}; final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{}); _data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>('/member/verifyByUpdatePayPwd', final _result = await _dio.request<Map<String, dynamic>>(
'/member/verifyByUpdatePayPwd',
queryParameters: queryParameters, queryParameters: queryParameters,
options: RequestOptions( options: RequestOptions(
method: 'POST', method: 'POST',
@ -2083,7 +2126,7 @@ class _ApiService implements ApiService {
data: _data); data: _data);
final value = BaseData<dynamic>.fromJson( final value = BaseData<dynamic>.fromJson(
_result.data, _result.data,
(json) => json as dynamic, (json) => json as dynamic,
); );
return value; return value;
} }
@ -2093,8 +2136,7 @@ class _ApiService implements ApiService {
const _extra = <String, dynamic>{}; const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{}; final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{}; final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>( final _result = await _dio.request<Map<String, dynamic>>('/vipCard/index',
'/vipCard/index',
queryParameters: queryParameters, queryParameters: queryParameters,
options: RequestOptions( options: RequestOptions(
method: 'GET', method: 'GET',
@ -2104,11 +2146,30 @@ class _ApiService implements ApiService {
data: _data); data: _data);
final value = BaseData<VipCardHome>.fromJson( final value = BaseData<VipCardHome>.fromJson(
_result.data, _result.data,
(json) => VipCardHome.fromJson(json), (json) => VipCardHome.fromJson(json),
); );
return value; return value;
} }
@override
Future<IpData> getIpInfo() async {
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<List<int>>('/ipJson.jsp',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
extra: _extra,
baseUrl: baseUrl,
responseType: ResponseType.bytes),
data: _data);
var ts = gbk.decode(_result.data);
final value = IpData.fromJson(jsonDecode(
ts.substring(ts.indexOf("{\"ip\":\"")).replaceAll(");}", "")));
return value;
}
@override @override
Future<BaseData<dynamic>> orderVip(param) async { Future<BaseData<dynamic>> orderVip(param) async {
ArgumentError.checkNotNull(param, 'param'); ArgumentError.checkNotNull(param, 'param');
@ -2116,7 +2177,8 @@ class _ApiService implements ApiService {
final queryParameters = <String, dynamic>{}; final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{}; final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{}); _data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>('/vipCard/orderVip', final _result = await _dio.request<Map<String, dynamic>>(
'/vipCard/orderVip',
queryParameters: queryParameters, queryParameters: queryParameters,
options: RequestOptions( options: RequestOptions(
method: 'POST', method: 'POST',
@ -2126,7 +2188,7 @@ class _ApiService implements ApiService {
data: _data); data: _data);
final value = BaseData<dynamic>.fromJson( final value = BaseData<dynamic>.fromJson(
_result.data, _result.data,
(json) => json as dynamic, (json) => json as dynamic,
); );
return value; return value;
} }
@ -2136,8 +2198,7 @@ class _ApiService implements ApiService {
const _extra = <String, dynamic>{}; const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{}; final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{}; final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>( final _result = await _dio.request<Map<String, dynamic>>('/raise/products',
'/raise/products',
queryParameters: queryParameters, queryParameters: queryParameters,
options: RequestOptions( options: RequestOptions(
method: 'GET', method: 'GET',
@ -2147,7 +2208,7 @@ class _ApiService implements ApiService {
data: _data); data: _data);
final value = BaseData<List<FarmersList>>.fromJson( final value = BaseData<List<FarmersList>>.fromJson(
_result.data, _result.data,
(json) => (json as List<dynamic>) (json) => (json as List<dynamic>)
.map<FarmersList>( .map<FarmersList>(
(i) => FarmersList.fromJson(i as Map<String, dynamic>)) (i) => FarmersList.fromJson(i as Map<String, dynamic>))
.toList()); .toList());
@ -2161,7 +2222,8 @@ class _ApiService implements ApiService {
final queryParameters = <String, dynamic>{}; final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{}; final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{}); _data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>('/auth/changePhone', final _result = await _dio.request<Map<String, dynamic>>(
'/auth/changePhone',
queryParameters: queryParameters, queryParameters: queryParameters,
options: RequestOptions( options: RequestOptions(
method: 'POST', method: 'POST',
@ -2171,7 +2233,7 @@ class _ApiService implements ApiService {
data: _data); data: _data);
final value = BaseData<dynamic>.fromJson( final value = BaseData<dynamic>.fromJson(
_result.data, _result.data,
(json) => json as dynamic, (json) => json as dynamic,
); );
return value; return value;
} }
@ -2193,7 +2255,7 @@ class _ApiService implements ApiService {
data: _data); data: _data);
final value = BaseData<dynamic>.fromJson( final value = BaseData<dynamic>.fromJson(
_result.data, _result.data,
(json) => json as dynamic, (json) => json as dynamic,
); );
return value; return value;
} }
@ -2215,9 +2277,8 @@ class _ApiService implements ApiService {
data: _data); data: _data);
final value = BaseData<List<Store>>.fromJson( final value = BaseData<List<Store>>.fromJson(
_result.data, _result.data,
(json) => (json as List<dynamic>) (json) => (json as List<dynamic>)
.map<Store>( .map<Store>((i) => Store.fromJson(i as Map<String, dynamic>))
(i) => Store.fromJson(i as Map<String, dynamic>))
.toList()); .toList());
return value; return value;
} }

2
lib/setting/account_security_page.dart

@ -26,7 +26,7 @@ class _AccountSecurityPage extends State<AccountSecurityPage> {
@override @override
void initState() { void initState() {
super.initState(); super.initState();
EasyLoading.show(status: S.current.zhengzaijiazai); EasyLoading.show(status: S.current.zhengzaijiazai,maskType: EasyLoadingMaskType.black);
SharedPreferences.getInstance().then((value) => { SharedPreferences.getInstance().then((value) => {
apiService = ApiService(Dio(), apiService = ApiService(Dio(),
context: context, token: value.getString("token"),), context: context, token: value.getString("token"),),

61
lib/setting/binding_phone_page.dart

@ -14,6 +14,7 @@ import 'package:huixiang/utils/font_weight.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import '../login/captcha/block_puzzle_captcha.dart';
import '../view_widget/border_text.dart'; import '../view_widget/border_text.dart';
class BindingPhonePage extends StatefulWidget { class BindingPhonePage extends StatefulWidget {
@ -42,6 +43,8 @@ class _BindingPhonePage extends State<BindingPhonePage> {
Timer _timer; Timer _timer;
UserInfo userInfo; UserInfo userInfo;
int phoneState = 1; int phoneState = 1;
String mobile;
String newMobile;
@override @override
void initState() { void initState() {
@ -114,16 +117,6 @@ class _BindingPhonePage extends State<BindingPhonePage> {
/// ///
verificationCode() async { verificationCode() async {
var mobile = _controllerPhone.text;
if (mobile == "" && phoneState == 1) {
SmartDialog.showToast(S.of(context).qingshurushoujihao, alignment: Alignment.center);
return;
}
var newMobile = _controllerNewPhone.text;
if (newMobile == "" && phoneState == 2) {
SmartDialog.showToast(S.of(context).qingshurushoujihao, alignment: Alignment.center);
return;
}
if (apiService == null) { if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance(); SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(Dio(), apiService = ApiService(Dio(),
@ -466,7 +459,22 @@ class _BindingPhonePage extends State<BindingPhonePage> {
alignment: Alignment.bottomCenter, alignment: Alignment.bottomCenter,
child: InkWell( child: InkWell(
onTap: (){ onTap: (){
verificationCode(); mobile = _controllerPhone.text;
if (mobile == "" && phoneState == 1) {
SmartDialog.showToast(S.of(context).qingshurushoujihao, alignment: Alignment.center);
return;
}
newMobile = _controllerNewPhone.text;
if (newMobile == "" && phoneState == 2) {
SmartDialog.showToast(S.of(context).qingshurushoujihao, alignment: Alignment.center);
return;
}
if(mobile != (userInfo?.phone??"")){
SmartDialog.showToast("手机号码不正确",
alignment: Alignment.center);
return ;
}
loadingBlockPuzzle(context);
}, },
child: BorderText( child: BorderText(
text: btnText, text: btnText,
@ -691,7 +699,17 @@ class _BindingPhonePage extends State<BindingPhonePage> {
alignment: Alignment.bottomCenter, alignment: Alignment.bottomCenter,
child: InkWell( child: InkWell(
onTap:(){ onTap:(){
verificationCode(); mobile = _controllerPhone.text;
if (mobile == "" && phoneState == 1) {
SmartDialog.showToast(S.of(context).qingshurushoujihao, alignment: Alignment.center);
return;
}
newMobile = _controllerNewPhone.text;
if (newMobile == "" && phoneState == 2) {
SmartDialog.showToast(S.of(context).qingshurushoujihao, alignment: Alignment.center);
return;
}
loadingBlockPuzzle(context);
}, },
child: BorderText( child: BorderText(
text: btnText, text: btnText,
@ -803,4 +821,23 @@ class _BindingPhonePage extends State<BindingPhonePage> {
), ),
); );
} }
//
loadingBlockPuzzle(BuildContext context,
{barrierDismissible = true}) {
showDialog<Null>(
context: context,
barrierDismissible: barrierDismissible,
builder: (BuildContext context) {
return BlockPuzzleCaptchaPage(
onSuccess: (v) {
verificationCode();
},
onFail: () {
print("onFail");
},
);
},
);
}
} }

42
lib/setting/logout_ing.dart

@ -17,6 +17,7 @@ import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import '../login/captcha/block_puzzle_captcha.dart';
import '../main.dart'; import '../main.dart';
class LogoutIng extends StatefulWidget { class LogoutIng extends StatefulWidget {
@ -73,16 +74,20 @@ class _LogoutIng extends State<LogoutIng> {
} }
if (_sendCodeStatus != 0) if (_sendCodeStatus != 0)
return; return;
if (apiService == null) { loadingBlockPuzzle(context);
SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(
Dio(),
context: context,
token: value.getString("token"),
showLoading: true
);
} }
BaseData baseData = await apiService.sendVerify("+86",mobile).catchError((onError) {});
sendProving(v) async{
if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(
Dio(),
context: context,
token: value.getString("token"),
showLoading: true
);
}
BaseData baseData = await apiService.sendVerify({"areaCode": "+86", "mobile": phoneController.text, "verification": v}).catchError((onError) {});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
countdown(); countdown();
SmartDialog.showToast(baseData.data, SmartDialog.showToast(baseData.data,
@ -497,4 +502,23 @@ class _LogoutIng extends State<LogoutIng> {
// xgFlutterPlugin.stopXg(); // xgFlutterPlugin.stopXg();
// } // }
} }
//
loadingBlockPuzzle(BuildContext context,
{barrierDismissible = true}) {
showDialog<Null>(
context: context,
barrierDismissible: barrierDismissible,
builder: (BuildContext context) {
return BlockPuzzleCaptchaPage(
onSuccess: (v) {
sendProving(v);
},
onFail: () {
print("onFail");
},
);
},
);
}
} }

23
lib/setting/platform_code_page.dart

@ -15,6 +15,8 @@ import 'package:huixiang/view_widget/pay_selected_dialog.dart';
import 'package:pin_input_text_field/pin_input_text_field.dart'; import 'package:pin_input_text_field/pin_input_text_field.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import '../login/captcha/block_puzzle_captcha.dart';
class PlatformCodePage extends StatefulWidget { class PlatformCodePage extends StatefulWidget {
final Map<String, dynamic> arguments; final Map<String, dynamic> arguments;
@ -189,7 +191,7 @@ class _PlatformCodePage extends State<PlatformCodePage> {
GestureDetector( GestureDetector(
onTap: () { onTap: () {
setState(() { setState(() {
sendCode(); loadingBlockPuzzle(context);
}); });
}, },
child: Container( child: Container(
@ -308,4 +310,23 @@ class _PlatformCodePage extends State<PlatformCodePage> {
), ),
); );
} }
//
loadingBlockPuzzle(BuildContext context,
{barrierDismissible = true}) {
showDialog<Null>(
context: context,
barrierDismissible: barrierDismissible,
builder: (BuildContext context) {
return BlockPuzzleCaptchaPage(
onSuccess: (v) {
sendCode();
},
onFail: () {
print("onFail");
},
);
},
);
}
} }

2
lib/setting/setting_page.dart

@ -175,7 +175,7 @@ class _SettingPage extends State<SettingPage> {
height: 16.h, height: 16.h,
), ),
GestureDetector( GestureDetector(
child: settingSingleItem("注销账号"), child: settingSingleItem(S.of(context).zhuxiaozhanghao),
onTap: () { onTap: () {
Navigator.of(context).pushNamed('/router/logout_page'); Navigator.of(context).pushNamed('/router/logout_page');
}, },

2
lib/setting/treaty_page.dart

@ -23,7 +23,7 @@ class _TreatyPage extends State<TreatyPage> {
@override @override
void initState() { void initState() {
super.initState(); super.initState();
EasyLoading.show(status: S.current.zhengzaijiazai); EasyLoading.show(status: S.current.zhengzaijiazai,maskType: EasyLoadingMaskType.black);
// if (Platform.isAndroid) WebView.platform = SurfaceAndroidWebView(); // if (Platform.isAndroid) WebView.platform = SurfaceAndroidWebView();
// if (Platform.isIOS) WebView.platform = CupertinoWebView(); // if (Platform.isIOS) WebView.platform = CupertinoWebView();
} }

2
lib/setting/user_service_page.dart

@ -25,7 +25,7 @@ class _UserServicePage extends State<UserServicePage> with WidgetsBindingObserve
void initState() { void initState() {
super.initState(); super.initState();
WidgetsBinding.instance.addObserver(this); WidgetsBinding.instance.addObserver(this);
EasyLoading.show(status: S.current.zhengzaijiazai); EasyLoading.show(status: S.current.zhengzaijiazai,maskType: EasyLoadingMaskType.black);
if (Platform.isAndroid) WebView.platform = SurfaceAndroidWebView(); if (Platform.isAndroid) WebView.platform = SurfaceAndroidWebView();
if (Platform.isIOS) WebView.platform = CupertinoWebView(); if (Platform.isIOS) WebView.platform = CupertinoWebView();
} }

18
lib/settlement/settlement.dart

@ -140,7 +140,7 @@ class _Settlement extends State<Settlement> {
storeId: storeId, storeId: storeId,
showLoading: false); showLoading: false);
queryMemberInfo(); queryMemberInfo();
if (promotions != null && promotions != "" && tableId <= 0) { if (widget.arguments["pid"] != null && widget.arguments["pid"] != "" && tableId <= 0) {
queryOrderInfo( queryOrderInfo(
address != null ? address.id : null, address != null ? address.id : null,
((storeInfo?.pickupType?.dineInTakeStatus ?? false) == true && ((storeInfo?.pickupType?.dineInTakeStatus ?? false) == true &&
@ -155,13 +155,13 @@ class _Settlement extends State<Settlement> {
productSkuId ?? "", productSkuId ?? "",
actProductId ?? "", actProductId ?? "",
actProductSkuId ?? "", actProductSkuId ?? "",
"ACTIVITY", "AUTO",
// useVipPriceSelect, // useVipPriceSelect,
// useBenefitSelect, // useBenefitSelect,
count1, count1,
payChannel, payChannel,
tableId); tableId);
} else if (coupons != null && coupons != "" && tableId <= 0) { } else if ( widget.arguments["cid"] != null && widget.arguments["cid"] != "" && tableId <= 0) {
queryOrderInfo( queryOrderInfo(
address != null ? address.id : null, address != null ? address.id : null,
((storeInfo?.pickupType?.dineInTakeStatus ?? false) == true && ((storeInfo?.pickupType?.dineInTakeStatus ?? false) == true &&
@ -170,13 +170,13 @@ class _Settlement extends State<Settlement> {
selectedBtn != 2) selectedBtn != 2)
? diningStatus ? diningStatus
: selectedBtn, : selectedBtn,
widget.arguments["cid"], widget.arguments["cid"]??0,
0, 0,
productId ?? 0, productId ?? 0,
productSkuId ?? "", productSkuId ?? "",
actProductId ?? "", actProductId ?? "",
actProductSkuId ?? "", actProductSkuId ?? "",
"COUPON", "AUTO",
// useVipPriceSelect, // useVipPriceSelect,
// useBenefitSelect, // useBenefitSelect,
count1, count1,
@ -228,7 +228,7 @@ class _Settlement extends State<Settlement> {
payChannel, payChannel,
tableId) async { tableId) async {
try { try {
EasyLoading.show(status: S.current.zhengzaijiazai); EasyLoading.show(status: S.current.zhengzaijiazai,maskType: EasyLoadingMaskType.black);
BaseData<SettleOrderInfo> baseData = await minService.getOrderInfo({ BaseData<SettleOrderInfo> baseData = await minService.getOrderInfo({
"addressId": addressId, "addressId": addressId,
@ -329,7 +329,7 @@ class _Settlement extends State<Settlement> {
/// ///
queryOrderDetails(id) async { queryOrderDetails(id) async {
EasyLoading.show(status: S.current.zhengzaijiazai); EasyLoading.show(status: S.current.zhengzaijiazai,maskType: EasyLoadingMaskType.black);
BaseData<MinOrderInfo> baseData = await minService.getOrderDetails({ BaseData<MinOrderInfo> baseData = await minService.getOrderDetails({
"id": pageType != null ? widget.arguments["orderId"] : id ?? parentId, "id": pageType != null ? widget.arguments["orderId"] : id ?? parentId,
}).catchError((error) {}); }).catchError((error) {});
@ -632,7 +632,7 @@ class _Settlement extends State<Settlement> {
print("error: $error"); print("error: $error");
}); });
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
EasyLoading.show(status: S.current.zhengzaijiazai); EasyLoading.show(status: S.current.zhengzaijiazai,maskType: EasyLoadingMaskType.black);
placeOrder = true; placeOrder = true;
this.downOrder = DownOrder.fromJson(baseData.data); this.downOrder = DownOrder.fromJson(baseData.data);
querySettlement(); querySettlement();
@ -1383,7 +1383,7 @@ class _Settlement extends State<Settlement> {
0, 0,
(settleOrderInfo.isRaise || payChannel == 5) (settleOrderInfo.isRaise || payChannel == 5)
? "" ? ""
: promotion?.id ?? productId, : widget.arguments["pid"] ?? (promotion?.id ?? productId),
productSkuId ?? "", productSkuId ?? "",
actProductId ?? "", actProductId ?? "",
actProductSkuId ?? "", actProductSkuId ?? "",

4
lib/settlement/settlement_view/pay_method.dart

@ -287,9 +287,7 @@ class _PayMethod extends State<PayMethod> {
), ),
), ),
if(mRaiseMoney !="0" && (widget.tableId > 0 ? !(widget?.minOrderInfo?.isRaise ?? false) : !(widget?.settleOrderInfo?.isRaise ?? false))) if(mRaiseMoney !="0" && (widget.tableId > 0 ? !(widget?.minOrderInfo?.isRaise ?? false) : !(widget?.settleOrderInfo?.isRaise ?? false)))
SizedBox(
height: 10,
),
if(widget.tableId > 0 ? !(widget?.minOrderInfo?.isRaise ?? false) : !(widget?.settleOrderInfo?.isRaise ?? false)) if(widget.tableId > 0 ? !(widget?.minOrderInfo?.isRaise ?? false) : !(widget?.settleOrderInfo?.isRaise ?? false))
GestureDetector( GestureDetector(
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,

4
lib/store/shop_details_page.dart

@ -94,7 +94,7 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
/// ///
queryStoreInfo() async { queryStoreInfo() async {
EasyLoading.show(status: S.current.zhengzaijiazai); EasyLoading.show(status: S.current.zhengzaijiazai,maskType: EasyLoadingMaskType.black);
SharedPreferences value = await SharedPreferences.getInstance(); SharedPreferences value = await SharedPreferences.getInstance();
if (apiService == null) if (apiService == null)
apiService = ApiService( apiService = ApiService(
@ -321,7 +321,7 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
/// ///
_queryMiNiDetail(String id, int count) async { _queryMiNiDetail(String id, int count) async {
EasyLoading.show(status: S.current.zhengzaijiazai); EasyLoading.show(status: S.current.zhengzaijiazai,maskType: EasyLoadingMaskType.black);
if (count < 0) { if (count < 0) {
shopCarGoods.shoppingCartSkuItemList.forEach((element) { shopCarGoods.shoppingCartSkuItemList.forEach((element) {
if (element.productId == id) { if (element.productId == id) {

2
lib/store/shopping/activity_prefecture_details.dart

@ -95,7 +95,7 @@ class _ActivityPrefectureDetails extends State<ActivityPrefectureDetails> {
/// ///
minLogin(SharedPreferences shared) async { minLogin(SharedPreferences shared) async {
EasyLoading.show(status: S.of(context).zhengzaijiazai); EasyLoading.show(status: S.of(context).zhengzaijiazai,maskType: EasyLoadingMaskType.black);
apiService = ApiService( apiService = ApiService(
Dio(), Dio(),
context: context, context: context,

2
lib/store/shopping/shopping_goods_details.dart

@ -116,7 +116,7 @@ class _ShoppingGoodsDetails extends State<ShoppingGoodsDetails> {
/// ///
minLogin(SharedPreferences shared) async { minLogin(SharedPreferences shared) async {
EasyLoading.show(status: S.of(context).zhengzaijiazai); EasyLoading.show(status: S.of(context).zhengzaijiazai,maskType: EasyLoadingMaskType.black);
apiService = ApiService( apiService = ApiService(
Dio(), Dio(),
context: context, context: context,

2
lib/store/shopping/shopping_mall_home.dart

@ -55,7 +55,7 @@ class _ShoppingMallHome extends State<ShoppingMallHome>
/// ///
minLogin(SharedPreferences shared) async { minLogin(SharedPreferences shared) async {
EasyLoading.show(status: S.of(context).zhengzaijiazai); EasyLoading.show(status: S.of(context).zhengzaijiazai,maskType: EasyLoadingMaskType.black);
apiService = ApiService( apiService = ApiService(
Dio(), Dio(),
context: context, context: context,

51
lib/store/store_order.dart

@ -97,12 +97,13 @@ class _StoreOrderPage extends State<StoreOrderPage>
/// ///
minLogin(SharedPreferences shared) async { minLogin(SharedPreferences shared) async {
EasyLoading.show(status: S.of(context).zhengzaijiazai); EasyLoading.show(
status: S.of(context).zhengzaijiazai,
maskType: EasyLoadingMaskType.black);
apiService = ApiService( apiService = ApiService(
Dio(), Dio(),
context: context, context: context,
token: shared.getString('token'), token: shared.getString('token'),
showLoading: true,
); );
apiService.minLogin(storeId).catchError((onError) { apiService.minLogin(storeId).catchError((onError) {
SmartDialog.showToast(AppUtils.dioErrorTypeToString(onError.type), SmartDialog.showToast(AppUtils.dioErrorTypeToString(onError.type),
@ -128,8 +129,6 @@ class _StoreOrderPage extends State<StoreOrderPage>
storeId: storeId, storeId: storeId,
); );
EasyLoading.dismiss();
queryMemberInfo(); queryMemberInfo();
queryShopCar().then((value) { queryShopCar().then((value) {
@ -207,7 +206,6 @@ class _StoreOrderPage extends State<StoreOrderPage>
setState(() {}); setState(() {});
} }
} }
EasyLoading.dismiss();
} }
RefreshController refreshController; RefreshController refreshController;
@ -247,7 +245,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
context), context),
sliver: SliverAppBar( sliver: SliverAppBar(
expandedHeight: (storeInfo != null && expandedHeight: (storeInfo != null &&
storeInfo.couponVOList != null) storeInfo.couponVOList != null)
? 400.h ? 400.h
: 395.h, : 395.h,
floating: false, floating: false,
@ -330,7 +328,10 @@ class _StoreOrderPage extends State<StoreOrderPage>
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: [ children: [
/// ///
StoreInfoView(storeInfo), StoreInfoView(
storeInfo,
widget.arguments["distance"],
),
// Padding(padding:EdgeInsets.only(left: 14.w), // Padding(padding:EdgeInsets.only(left: 14.w),
// child: Text( // child: Text(
// S.of(context).diandan, // S.of(context).diandan,
@ -658,9 +659,8 @@ class _StoreOrderPage extends State<StoreOrderPage>
"shoppingCart": shopCarGoods, "shoppingCart": shopCarGoods,
"numberOfPeople": numberOfPeople, "numberOfPeople": numberOfPeople,
"distance": widget.arguments["distance"], "distance": widget.arguments["distance"],
"vipLevelName": memberVo?.memberRankVo?.rankName ??"", "vipLevelName": memberVo?.memberRankVo?.rankName ?? "",
"isVips": memberVo?.isVip ?? false, "isVips": memberVo?.isVip ?? false,
"distance": widget.arguments["distance"],
"subscribeParam": miNiDetail?.subscribeParam, "subscribeParam": miNiDetail?.subscribeParam,
}, },
); );
@ -757,7 +757,8 @@ class _StoreOrderPage extends State<StoreOrderPage>
/// ///
_queryMiNiDetail(String id, int count) async { _queryMiNiDetail(String id, int count) async {
EasyLoading.show(status: S.current.zhengzaijiazai); EasyLoading.show(
status: S.current.zhengzaijiazai, maskType: EasyLoadingMaskType.black);
if (count < 0) { if (count < 0) {
shopCarGoods.shoppingCartSkuItemList.forEach((element) async { shopCarGoods.shoppingCartSkuItemList.forEach((element) async {
if (element.productId == id) { if (element.productId == id) {
@ -1058,17 +1059,17 @@ class _Title extends State<Title> {
double maxScrollExtent = widget.controller.position.maxScrollExtent; double maxScrollExtent = widget.controller.position.maxScrollExtent;
double alphaHeight = (kToolbarHeight) / 2; double alphaHeight = (kToolbarHeight) / 2;
double alphaProgress = maxScrollExtent - widget.controller.offset; double alphaProgress = maxScrollExtent - widget.controller.offset;
double alphatemp = 0; double alphaTemp = 0;
if (alphaProgress <= 1) { if (alphaProgress <= 1) {
alphatemp = 1; alphaTemp = 1;
} else if (alphaProgress <= alphaHeight) { } else if (alphaProgress <= alphaHeight) {
alphatemp = alphaTemp =
(((alphaHeight - alphaProgress) / alphaHeight) > 0.5) ? 1 : 0; (((alphaHeight - alphaProgress) / alphaHeight) > 0.5) ? 1 : 0;
} else { } else {
alphatemp = 0; alphaTemp = 0;
} }
if (alpha != alphatemp && mounted) { if (alpha != alphaTemp && mounted) {
alpha = alphatemp; alpha = alphaTemp;
print("object: $alpha"); print("object: $alpha");
widget.scrollChange(alpha); widget.scrollChange(alpha);
setState(() {}); setState(() {});
@ -1080,14 +1081,16 @@ class _Title extends State<Title> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
margin: EdgeInsets.only(bottom: 38.h), margin: EdgeInsets.only(bottom: 38.h),
child: Text( child: alpha == 0
widget.title ?? "", ? null
style: TextStyle( : Text(
color: Colors.black.withOpacity(alpha), widget.title ?? "",
fontWeight: FontWeight.bold, style: TextStyle(
fontSize: 18.sp, color: Colors.black,
), fontWeight: FontWeight.bold,
), fontSize: 18.sp,
),
),
); );
} }
} }

4
lib/store/store_view/product_sku.dart

@ -244,7 +244,7 @@ class _ProductSku extends State<ProductSku> {
false) == false) ==
false) { false) {
_isTapEd = true; _isTapEd = true;
EasyLoading.show(status: S.current.zhengzaijiazai); EasyLoading.show(status: S.current.zhengzaijiazai,maskType: EasyLoadingMaskType.black);
await widget.reduce(widget.miNiDetail, selectSkus); await widget.reduce(widget.miNiDetail, selectSkus);
} }
count -= 1; count -= 1;
@ -275,7 +275,7 @@ class _ProductSku extends State<ProductSku> {
false) == false) ==
false) { false) {
_isTapEd = true; _isTapEd = true;
EasyLoading.show(status: S.current.zhengzaijiazai); EasyLoading.show(status: S.current.zhengzaijiazai,maskType: EasyLoadingMaskType.black);
if (count == 1 && realCount == 0) if (count == 1 && realCount == 0)
await widget.addShopCar( await widget.addShopCar(
widget.miNiDetail, selectSkus, 2); widget.miNiDetail, selectSkus, 2);

12
lib/store/store_view/shop_goods.dart

@ -359,7 +359,7 @@ class _ShopGoods extends State<ShopGoods> {
// SmartDialog.showToast("库存不足", // SmartDialog.showToast("库存不足",
// alignment: Alignment.center); // alignment: Alignment.center);
// } else // } else
if (_jumpType == -1) if (_jumpType == -1)
queryMiNiDetail(widget.productListBean.id); queryMiNiDetail(widget.productListBean.id);
else if (_jumpType == 0) else if (_jumpType == 0)
widget.add(widget.shoppingCartSkuItemListBean); widget.add(widget.shoppingCartSkuItemListBean);
@ -497,6 +497,7 @@ class _ShopGoods extends State<ShopGoods> {
SizedBox( SizedBox(
height: 4.h, height: 4.h,
), ),
///VIP价格 ///VIP价格
// if (widget.productListBean.vipPrice != null) // if (widget.productListBean.vipPrice != null)
// Row( // Row(
@ -645,9 +646,12 @@ class _ShopGoods extends State<ShopGoods> {
// //
// http://miniscan.lotus-wallet.com/placeorder?tenant_code=1194&table_id=1669609340031467520&store_id=1637659387134738432 // http://miniscan.lotus-wallet.com/placeorder?tenant_code=1194&table_id=1669609340031467520&store_id=1637659387134738432
Uri uri = Uri.parse(result); Uri uri = Uri.parse(result);
String tableId = uri.queryParameters["tableId"] ?? uri.queryParameters["table_id"]; String tableId =
String tenantCode = uri.queryParameters["tenantCode"] ?? uri.queryParameters["tenant_code"]; uri.queryParameters["tableId"] ?? uri.queryParameters["table_id"];
String shopId = uri.queryParameters["shopId"] ?? uri.queryParameters["store_id"]; String tenantCode = uri.queryParameters["tenantCode"] ??
uri.queryParameters["tenant_code"];
String shopId =
uri.queryParameters["shopId"] ?? uri.queryParameters["store_id"];
if (tableId != null && if (tableId != null &&
tableId != "" && tableId != "" &&
tenantCode != null && tenantCode != null &&

2
lib/store/store_view/store_header.dart

@ -43,7 +43,7 @@ class StoreHeader extends SliverPersistentHeaderDelegate {
child: Column( child: Column(
children: [ children: [
/// ///
StoreInfoView(storeInfo), StoreInfoView(storeInfo,0),
/// ///
if (storeInfo != null && storeInfo.couponVOList != null) if (storeInfo != null && storeInfo.couponVOList != null)

55
lib/store/store_view/store_info.dart

@ -11,8 +11,9 @@ import 'package:url_launcher/url_launcher.dart';
class StoreInfoView extends StatefulWidget { class StoreInfoView extends StatefulWidget {
final StoreInfo storeInfo; final StoreInfo storeInfo;
final double distance;
StoreInfoView(this.storeInfo); StoreInfoView(this.storeInfo,this.distance);
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
@ -172,13 +173,14 @@ class _StoreInfoView extends State<StoreInfoView> {
arguments: { arguments: {
"lat": widget.storeInfo.latitude, "lat": widget.storeInfo.latitude,
"lng": widget.storeInfo.longitude, "lng": widget.storeInfo.longitude,
"storeName": widget.storeInfo.storeName, "storeInfo":widget.storeInfo,
"distance":widget.distance
}, },
); );
}, },
child:Container( child:Container(
color: Colors.transparent, color: Colors.transparent,
padding:EdgeInsets.only(right: 8.w) , padding:EdgeInsets.only(right: 8.w,bottom: 16.h) ,
child: Image.asset( child: Image.asset(
"assets/image/icon_union_location.webp", "assets/image/icon_union_location.webp",
width: 20, width: 20,
@ -190,28 +192,34 @@ class _StoreInfoView extends State<StoreInfoView> {
child: GestureDetector( child: GestureDetector(
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
onTap: () { onTap: () {
Navigator.of(context).pushNamed( if(widget.storeInfo.longitude != null && widget.storeInfo.latitude != null){
'/router/location_map', Navigator.of(context).pushNamed(
arguments: { '/router/location_map',
"lat": widget.storeInfo.latitude, arguments: {
"lng": widget.storeInfo.longitude, "lat": widget.storeInfo.latitude,
"storeName": widget.storeInfo.storeName, "lng": widget.storeInfo.longitude,
}, "storeInfo":widget.storeInfo,
); "distance":widget.distance
},
);
}else{
return;
}
}, },
child: Text( child:Padding(padding: EdgeInsets.only(bottom: 16.h,),
"${S.of(context).dizhi}:${widget.storeInfo != null ? widget.storeInfo.address : ""}", child: Text(
maxLines: 2, "${S.of(context).dizhi}:${widget.storeInfo != null ? widget.storeInfo.address : ""}",
textAlign: TextAlign.justify, maxLines: 2,
style: TextStyle( textAlign: TextAlign.justify,
color: Color(0xFF353535), style: TextStyle(
fontWeight: MyFontWeight.regular, color: Color(0xFF353535),
fontSize: 12.sp, fontWeight: MyFontWeight.regular,
fontSize: 12.sp,
),
), ),
), ),
), ),
), ),
if((widget?.storeInfo?.tel ?? "") != "") if((widget?.storeInfo?.tel ?? "") != "")
GestureDetector( GestureDetector(
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
@ -219,7 +227,7 @@ class _StoreInfoView extends State<StoreInfoView> {
showCallMobile(); showCallMobile();
}, },
child: Container( child: Container(
padding:EdgeInsets.only(left: 16.w,right: 8.w) , padding:EdgeInsets.only(left: 16.w,right: 8.w,bottom: 16.h) ,
child: Image.asset( child: Image.asset(
"assets/image/icon_union_call.webp", "assets/image/icon_union_call.webp",
width: 24, width: 24,
@ -233,7 +241,6 @@ class _StoreInfoView extends State<StoreInfoView> {
width: double.infinity, width: double.infinity,
height: 1, height: 1,
color: Color(0xFFF4F5F2), color: Color(0xFFF4F5F2),
margin: EdgeInsets.only(top: 16),
) )
], ],
), ),
@ -291,8 +298,8 @@ class _StoreInfoView extends State<StoreInfoView> {
text: "$e", text: "$e",
backgroup: Color(0xFFFF7A1A), backgroup: Color(0xFFFF7A1A),
padding: EdgeInsets.only( padding: EdgeInsets.only(
left: 2.w, left: 4.w,
right: 2.w, right: 4.w,
), ),
fontSize: 10.sp, fontSize: 10.sp,
textColor: Colors.white, textColor: Colors.white,

1158
lib/union/location_map_page.dart

File diff suppressed because it is too large Load Diff

687
lib/union/union_list.dart

@ -1,28 +1,37 @@
import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_baidu_mapapi_base/flutter_baidu_mapapi_base.dart';
import 'package:flutter_baidu_mapapi_utils/flutter_baidu_mapapi_utils.dart';
import 'package:flutter_bmflocation/flutter_bmflocation.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/store.dart'; import 'package:huixiang/retrofit/data/store.dart';
import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/border_text.dart'; import 'package:huixiang/utils/location.dart';
import 'package:huixiang/view_widget/classic_header.dart';
import 'package:huixiang/view_widget/custom_image.dart'; import 'package:huixiang/view_widget/custom_image.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/view_widget/request_permission.dart';
import 'package:huixiang/view_widget/round_button.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:shimmer/shimmer.dart'; import 'package:shimmer/shimmer.dart';
import '../retrofit/data/base_data.dart';
import '../retrofit/data/product_show.dart';
import '../retrofit/retrofit_api.dart';
import '../utils/flutter_utils.dart';
import '../view_widget/classic_header.dart';
import '../view_widget/no_data_view.dart'; import '../view_widget/no_data_view.dart';
import '../view_widget/round_button.dart';
class UnionList extends StatefulWidget { class UnionList extends StatefulWidget {
final RefreshController refreshController; final String serviceType;
final List<Store> storeList; final BMFCoordinate latLng;
final Function onRefresh; final String searchKey;
final Function queryStore; final String city;
UnionList(this.refreshController,this.storeList,this.onRefresh,this.queryStore);
UnionList(Key key, this.serviceType, this.latLng, this.searchKey, this.city)
: super(key: key);
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
@ -30,89 +39,112 @@ class UnionList extends StatefulWidget {
} }
} }
class _UnionList extends State<UnionList> { class _UnionList extends State<UnionList> with AutomaticKeepAliveClientMixin {
final TextEditingController editingController = TextEditingController(); ApiService apiService;
List<Store> storeList;
BMFCoordinate latLng;
final RefreshController _refreshController = RefreshController();
@override
bool get wantKeepAlive => true;
@override
void initState() {
super.initState();
queryStore();
}
queryStore() async {
if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(
Dio(),
context: context,
token: value.getString("token"),
);
}
BaseData<List<Store>> baseData = await apiService.queryStore({
"city": widget.city ?? "",
// "district": district,
// "province": province,
"latitude": (widget.latLng?.latitude ?? "").toString(),
"longitude": (widget.latLng?.longitude ?? "").toString(),
if (widget.searchKey != "") "searchKey": widget.searchKey,
"serviceType": widget.serviceType,
"exchange": false,
}).catchError((error) {
SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type),
alignment: Alignment.center);
_refreshController.refreshFailed();
});
if (baseData != null && baseData.isSuccess) {
storeList = baseData.data;
_refreshController.refreshCompleted();
} else {
_refreshController.refreshFailed();
}
EasyLoading.dismiss();
setState(() {});
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Column( return SmartRefresher(
children: [ controller: _refreshController,
buildSearchItem(), enablePullDown: true,
Container( enablePullUp: false,
height: MediaQuery.of(context).size.height - header: MyHeader(
103.h - color: Colors.white,
MediaQuery.of(context).padding.top, ),
child: SmartRefresher( physics: BouncingScrollPhysics(),
controller: widget.refreshController, onRefresh: queryStore,
enablePullUp: false, child: (storeList == null || storeList.length == 0)
enablePullDown: true, ? NoDataView(
physics: BouncingScrollPhysics(), src: "assets/image/di_zhi.webp",
header: MyHeader(), isShowBtn: false,
onRefresh: widget.onRefresh, text: ((widget.city??"") != "武汉" && (widget.city??"") != "郑州" && (widget.city??"") != "北京") ?
child: (widget.storeList == null || widget.storeList.length == 0) " 当前回乡开放门店 仅包含 武汉/北京/郑州,您当前的位置无法获取,请手动更换城市" :"暂无店铺列表~",
? NoDataView( fontSize: 16.sp,
src:"assets/image/di_zhi.webp", margin: EdgeInsets.only(top: 120.h,left:45.w,right:45.w),
isShowBtn: false, )
text: "暂无店铺列表~", : ListView.builder(
fontSize: 16.sp, itemCount: storeList.length,
margin: EdgeInsets.only(top: 120.h), padding: EdgeInsets.only(
):ListView.builder( top: 8.h,
itemCount:widget.storeList == null ? 0 : widget.storeList.length, bottom: 100.h,
padding: EdgeInsets.only( ),
top: 8.h, itemBuilder: (context, position) {
bottom: 100.h, /* + (375.h - 88.h) + 4.h*/ return InkWell(
), onTap: () {
physics: NeverScrollableScrollPhysics(), {
itemBuilder: (context, position) { Navigator.of(context).pushNamed(
return InkWell( '/router/store_order',
onTap: () { arguments: {
// if (widget.storeList[position].posType.code == "NORMALSTORE") { "id": storeList[position].id,
// showDeleteDialog(); "tenant": storeList[position].tenantCode,
// } "storeName": storeList[position].storeName,
// else "distance": storeList[position].distance
// if ( widget.storeList[position].storeName == "一心回乡商城") { },
// Navigator.of(context).pushNamed( );
// '/router/shopping_mall_home', }
// arguments: { },
// "type": 0, child: buildStoreItem(storeList[position], position),
// "id": widget.storeList[position].id, );
// "tenant": widget.storeList[position].tenantCode, },
// "storeName": widget.storeList[position].storeName ),
// },
// );
// }
// else
{
Navigator.of(context).pushNamed(
'/router/store_order',
arguments: {
"id": widget.storeList[position].id,
"tenant": widget.storeList[position].tenantCode,
"storeName": widget.storeList[position].storeName,
"distance":widget.storeList[position].distance
},
);
}
},
child:
buildStoreItem(widget.storeList[position], position),
);
})),
)
],
); );
} }
Widget sm(){ Widget sm() {
return Container( return Container(
margin:EdgeInsets.symmetric(horizontal: 14.w,vertical: 8.h), margin: EdgeInsets.symmetric(horizontal: 14.w, vertical: 8.h),
width: double.infinity, width: double.infinity,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.circular(6), borderRadius: BorderRadius.circular(6),
), ),
height: 223.h, height: 223.h,
child:Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Shimmer.fromColors( Shimmer.fromColors(
@ -124,19 +156,25 @@ class _UnionList extends State<UnionList> {
height: 140.h, height: 140.h,
), ),
), ),
Padding(padding: EdgeInsets.only(left: 6.w,bottom: 5.h,top: 12.h), Padding(
child: Shimmer.fromColors( padding: EdgeInsets.only(left: 6.w, bottom: 5.h, top: 12.h),
baseColor: Color(0XFFD8D8D8), child: Shimmer.fromColors(
highlightColor: Color(0XFFD8D8D8), baseColor: Color(0XFFD8D8D8),
child: Container( highlightColor: Color(0XFFD8D8D8),
decoration: BoxDecoration( child: Container(
color: Color(0XFFD8D8D8), decoration: BoxDecoration(
borderRadius: BorderRadius.circular(2), color: Color(0XFFD8D8D8),
borderRadius: BorderRadius.circular(2),
),
width: 108.w,
height: 20.h,
), ),
width: 108.w,
height: 20.h,
), ),
),),Padding(padding: EdgeInsets.only(left: 6.w,), ),
Padding(
padding: EdgeInsets.only(
left: 6.w,
),
child: Shimmer.fromColors( child: Shimmer.fromColors(
baseColor: Color(0XFFD8D8D8), baseColor: Color(0XFFD8D8D8),
highlightColor: Color(0XFFD8D8D8), highlightColor: Color(0XFFD8D8D8),
@ -148,68 +186,212 @@ class _UnionList extends State<UnionList> {
width: 260.w, width: 260.w,
height: 20.h, height: 20.h,
), ),
),), ),
),
], ],
), ),
); );
} }
Widget buildSearchItem() { Widget buildStoreItem(Store store, position) {
return Container( return Container(
height: 36.h, margin: EdgeInsets.fromLTRB(16.w, 8.h, 16.w, 12.h),
margin: EdgeInsets.fromLTRB(6.w, 0, 14.w, 0), padding: EdgeInsets.symmetric(horizontal:12.w,vertical: 12.h),
padding: EdgeInsets.fromLTRB(0, 6.h, 0, 6.h),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Color(0xFFF5FAF7), color: Colors.white,
borderRadius: BorderRadius.circular(4), borderRadius: BorderRadius.all(Radius.circular(6)),
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
color: Colors.black.withAlpha(12), color: Colors.black.withAlpha(25),
offset: Offset(0, 3), offset: Offset(0, 1),
blurRadius: 14, blurRadius: 12,
spreadRadius: 0, spreadRadius: 0,
)
]),
width: double.infinity,
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Stack(
children: [
MImage(
store.facade,
width: 74.h,
height: 74.h,
fit: BoxFit.cover,
radius: BorderRadius.circular(6),
errorSrc: "assets/image/default_1.webp",
fadeSrc: "assets/image/default_1.webp",
),
Container(
decoration: BoxDecoration(
color: Color(0xFF32A060),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(6),
bottomRight: Radius.circular(6),
topRight: Radius.circular(2),
bottomLeft: Radius.circular(2)),
),
padding: EdgeInsets.symmetric(horizontal: 3.w, vertical: 2.h),
child: Text(
"品牌",
style: TextStyle(
color: Colors.white,
fontSize: 10.sp,
fontWeight: MyFontWeight.regular,
),
),
)
],
), ),
SizedBox(
width: 12.w,
),
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
store?.storeName ?? "",
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: Color(0xFF0D0D0D),
fontSize: 14.sp,
fontWeight: MyFontWeight.bold,
),
),
SizedBox(height: 6.h),
Row(
children: [
Text(
S.of(context).ren(
store?.perCapitaConsumption ?? "",
),
style: TextStyle(
color: Color(0xFF4D4D4D),
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
),
),
SizedBox(width: 22.w),
if (store.distance != null)
Image.asset(
"assets/image/icon_union_location_black.webp",
fit: BoxFit.fill,
height: 12,
width: 12,
),
SizedBox(width: 4.w),
if (store.distance != null)
Text(
(store.distance ?? 0) > 1000
? S.of(context).gongli(
((store.distance ?? 0) / 1000 * 100).toInt() /
100.0)
: S
.of(context)
.mi(((store.distance ?? 0) * 100).toInt() / 100.0),
style: TextStyle(
color: Color(0xFF4D4D4D),
fontSize: 12.sp,
),
),
],
),
SizedBox(height: 10.h),
Row(
children: []..addAll(
itemServer(store != null ? store.businessService : "")),
),
if (storeList[position].productShow != null)
SizedBox(height: store.businessService == "" ? 40.h : 23.h),
if (storeList[position].productShow != null)
Container(
height: 100.h,
child: ListView.builder(
padding: EdgeInsets.zero,
itemCount:
(storeList[position].productShow?.length ?? 0) > 3
? 3
: storeList[position].productShow?.length ?? 0,
scrollDirection: Axis.horizontal,
shrinkWrap: true,
physics:BouncingScrollPhysics(),
itemBuilder: (context, index) {
return GestureDetector(
onTap: () {},
child: unionGoodsItem(
storeList[position].productShow[index]),
);
},
),
),
],
))
], ],
), ),
child: TextField( );
textInputAction: TextInputAction.search, }
onEditingComplete: () {
FocusScope.of(context).requestFocus(FocusNode()); ///
widget.queryStore(editingController.text); List<Widget> itemServer(String businessService) {
}, if (businessService == null || businessService == "") return [];
controller: editingController, var list = businessService.split(",");
cursorHeight: 25.h, return list
decoration: InputDecoration( .map((e) => Container(
contentPadding: EdgeInsets.symmetric( margin: EdgeInsets.only(right: 8.w),
vertical: 12.h, child: RoundButton(
), height: 17.h * AppUtils.textScale(context),
prefixIcon:InkWell( text: "$e",
onTap: () { backgroup: Color(0xFFF65720),
widget.queryStore(editingController.text); padding: EdgeInsets.only(
}, left: 4.w,
child: Icon( right: 4.w,
Icons.search,
size: 24,
color: Colors.black,
),
), ),
suffixIcon: InkWell( fontSize: 10.sp,
onTap: () { textColor: Colors.white,
editingController.clear(); ),
}, ))
child: Icon( .toList();
Icons.close, }
size: 19,
color: Colors.grey, Widget unionGoodsItem(ProductShow productShow) {
return Container(
width: 74.h,
margin: EdgeInsets.only(right: 8.w),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
MImage(
productShow?.imgs[0] ?? "",
width: 74.h,
height: 74.h,
fit: BoxFit.cover,
radius: BorderRadius.circular(4),
errorSrc: "assets/image/default_1.webp",
fadeSrc: "assets/image/default_1.webp",
),
Padding(
padding: EdgeInsets.only(top: 8.h),
child: Text(
productShow?.productName ?? "",
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: Color(0xFFA29E9E),
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
),
), ),
), ),
border: InputBorder.none, ],
),
), ),
); );
} }
Widget buildStoreItem(Store store, position) { //ui
Widget buildStoreItems(Store store, position) {
return Container( return Container(
margin: EdgeInsets.fromLTRB(16.w, 8.h, 16.w, 12.h), margin: EdgeInsets.fromLTRB(16.w, 8.h, 16.w, 12.h),
decoration: BoxDecoration( decoration: BoxDecoration(
@ -275,62 +457,65 @@ class _UnionList extends State<UnionList> {
), ),
Expanded( Expanded(
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
SizedBox( SizedBox(
height: 40.h, height: 40.h,
), ),
Text( Text(
store?.storeName ?? "", store?.storeName ?? "",
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
color: Color(0xFF0D0D0D), color: Color(0xFF0D0D0D),
fontSize: 14.sp, fontSize: 14.sp,
fontWeight: MyFontWeight.bold, fontWeight: MyFontWeight.bold,
), ),
),
SizedBox(
height: 5.h,
),
Expanded(
child: Text(
"${S.of(context).dizhi}:${store.address}",
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: Color(0xFF4D4D4D),
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
), ),
SizedBox( ),
height: 5.h, )
],
)),
if (store.distance != null)
Container(
width: 59.w,
height: 18.h,
alignment: Alignment.center,
margin: EdgeInsets.only(top: 20.h),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(2),
color: Color(0xFF32A060),
),
child: Visibility(
child: Text(
(store.distance ?? 0) > 1000
? S.of(context).gongli(
((store.distance ?? 0) / 1000 * 100).toInt() /
100.0)
: S.of(context).mi(
((store.distance ?? 0) * 100).toInt() /
100.0),
style: TextStyle(
color: Color(0xFFFFFFFF),
fontSize: 10.sp,
), ),
Expanded(child: Text(
"${S.of(context).dizhi}:${store.address}",
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: Color(0xFF4D4D4D),
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
),
),)
],
)),
if(store.distance != null)
Container(
width: 59.w,
height: 18.h,
alignment: Alignment.center,
margin: EdgeInsets.only(top: 20.h),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(2),
color: Color(0xFF32A060),
),
child: Visibility(
child: Text(
(store.distance ?? 0) > 1000
? S.of(context).gongli(
((store.distance ?? 0) / 1000 * 100).toInt() /
100.0)
: S.of(context).mi(
((store.distance ?? 0) * 100).toInt() / 100.0),
style: TextStyle(
color: Color(0xFFFFFFFF),
fontSize: 10.sp,
), ),
visible: store.distance != null,
), ),
visible: store.distance != null,
), ),
),
], ],
), ),
), ),
@ -339,130 +524,4 @@ class _UnionList extends State<UnionList> {
), ),
); );
} }
///
showDeleteDialog() {
showDialog(
context: context,
builder: (context) {
return AlertDialog(
content: Container(
width: MediaQuery.of(context).size.width - 84.w,
height: 130.h,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
"您即将进行扫码点餐",
style: TextStyle(
fontSize: 17.sp,
fontWeight: FontWeight.bold,
color: Colors.black,
),
),
SizedBox(
height: 30.h,
),
Row(
children: [
Expanded(
child: InkWell(
child: BorderText(
text: "取消",
textColor: Color(0xFF32A060),
fontSize: 16.sp,
fontWeight: FontWeight.bold,
borderColor: Color(0xFF32A060),
radius: 4,
padding: EdgeInsets.all(12),
borderWidth: 1,
),
onTap: () {
Navigator.of(context).pop();
},
),
flex: 1,
),
SizedBox(
width: 16.w,
),
Expanded(
child: InkWell(
child: RoundButton(
text: "确定",
textColor: Colors.white,
radius: 4,
padding: EdgeInsets.all(12),
backgroup: Color(0xFF32A060),
fontSize: 16.sp,
fontWeight: FontWeight.bold,
),
onTap: () {
toScan();
Navigator.of(context).pop();
},
),
flex: 1,
),
],
)
],
),
),
);
},
);
}
///
toScan() async {
if (await Permission.camera.isPermanentlyDenied) {
showCupertinoDialog(
context: context,
builder: (context) {
return RequestPermission(
"assets/image/icon_camera_permission_tips.webp",
S.of(context).ninxiangjiquanxianweikaiqi,
S.of(context).weilekaipaizhaoxuanzhetouxiang,
S.of(context).kaiqiquanxian,
(result) async {
if (result) {
await openAppSettings();
}
},
heightRatioWithWidth: 0.82,
);
});
} else if (await Permission.camera.isGranted) {
// http://pos.app.gznl.top/placeorder/?tableId=1315903669597634560&tenantCode=1166&shopId=1300372027722432512
//
// http://miniscan.lotus-wallet.com/placeorder?tenant_code=1194&table_id=1669609340031467520&store_id=1637659387134738432
var result = await Navigator.of(context).pushNamed('/router/qr_scan');
// String result = await scanner.scan();
Uri uri = Uri.parse(result);
String tableId = uri.queryParameters["tableId"] ?? uri.queryParameters["table_id"];
String tenantCode = uri.queryParameters["tenantCode"] ?? uri.queryParameters["tenant_code"];
String shopId = uri.queryParameters["shopId"] ?? uri.queryParameters["store_id"];
if (tableId != null &&
tableId != "" &&
tenantCode != null &&
tenantCode != "" &&
shopId != null &&
shopId != "") {
Navigator.of(context).pushNamed(
'/router/store_order',
arguments: {
"id": shopId,
"tenant": tenantCode,
"storeName": "",
"tableId": int.tryParse(tableId),
},
);
}
} else {
await Permission.camera.request();
}
}
} }

1038
lib/union/union_page.dart

File diff suppressed because it is too large Load Diff

372
lib/union/union_select_city.dart

@ -0,0 +1,372 @@
import 'dart:convert';
import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import '../retrofit/data/ip_data.dart';
import '../retrofit/retrofit_api.dart';
class UnionSelectCity extends StatefulWidget {
final Map<String, dynamic> arguments;
UnionSelectCity({this.arguments});
@override
State<StatefulWidget> createState() {
return _UnionSelectCity();
}
}
class _UnionSelectCity extends State<UnionSelectCity> {
RefreshController refreshController = RefreshController();
Map<String, dynamic> areaMap;
ApiService apiIpService;
String ipName;
int ipState = 0;
List<String> hotCity = [];
List<String> areaList = [];
@override
void initState() {
super.initState();
areaCode();
queryIpInfo();
}
void areaCode({String searchTxt}) async {
var value =
await rootBundle.loadString('assets/map_style/chinese_cities.json');
areaList.clear();
areaMap = jsonDecode(value);
hotCity = (areaMap["热门城市"] as List).map((e) {
return e["area"].toString();
}).toList();
areaMap.remove("热门城市");
Map<String, dynamic> tempAreaMap = jsonDecode(value);
areaMap.forEach((key, value) {
if (searchTxt != null && searchTxt.trim() != "")
value.forEach((element) {
if (!element["area"].contains(searchTxt))
(tempAreaMap[key] as List)
.removeWhere((el) => el["area"] == element["area"]);
});
if (tempAreaMap[key].isNotEmpty) areaList.add(key);
});
areaMap = tempAreaMap;
setState(() {});
}
queryIpInfo() async {
apiIpService = ApiService(
Dio(),
context: context,
isIp: true
);
IpData baseData = await apiIpService.getIpInfo().catchError((onError) {});
if (baseData?.city != null) {
ipName = baseData.city.replaceAll("", "");
if(ipName != widget.arguments["cityName"] ){
ipState=2;
setState((){});
}
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
resizeToAvoidBottomInset: false,
backgroundColor: Color(0xFFF0F0F0),
body: Container(
color: Color(0xFFF0F0F0),
child: Column(
children: [
Container(
color: Colors.white,
padding: EdgeInsets.only(left: 14.w, top: 44.h, bottom: 24.h),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
Navigator.of(context).pop();
},
child: Container(
padding: EdgeInsets.only(right: 21.w),
child: Icon(
Icons.arrow_back_ios,
color: Colors.black,
),
)),
Expanded(child: searchCityItem())
],
),
Padding(
padding: EdgeInsets.only(top: 16.h, bottom: 24.h),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Padding(
padding: EdgeInsets.only(right: 10.w),
child: Text(
(ipState == 0||ipState == 1) ? "当前位置" : "已选:",
style: TextStyle(
color: Color(0xFFA29E9E),
fontWeight: MyFontWeight.medium,
fontSize: 16.sp,
),
),
),
Image.asset(
"assets/image/icon_union_location.webp",
width: 20,
height: 20,
),
Expanded(
// padding: EdgeInsets.only(
// left: 8.w,
// ),
child: Text(
(ipState== 1) ? (ipName??""):widget.arguments["cityName"] ?? "",
style: TextStyle(
color: Color(0xFF4D4D4D),
fontWeight: MyFontWeight.medium,
fontSize: 16.sp,
),
),
),
if(ipState == 2)
Icon(
Icons.gps_fixed,
color: Colors.grey,
size: 18,
),
if(ipState == 2)
Padding(padding:EdgeInsets.only(left:5.w,right: 12.w),
child:GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: (){
setState((){
ipState = 1;
Navigator.of(context).pop(ipName);
});
},
child: Text(
"重新定位",
style: TextStyle(
color: Color(0xFF4D4D4D),
fontWeight: MyFontWeight.medium,
fontSize: 16.sp,
),
),
),)
],
)),
Padding(
padding: EdgeInsets.only(bottom: 16.h),
child: Text(
"热门城市",
style: TextStyle(
color: Color(0xFFA29E9E),
fontWeight: MyFontWeight.medium,
fontSize: 16.sp,
),
),
),
GridView.builder(
itemCount: hotCity.length,
padding: EdgeInsets.only(right: 14.h, bottom: 14.h),
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 4,
crossAxisSpacing: 12.w,
mainAxisSpacing: 12.w,
childAspectRatio: 2.5,
),
itemBuilder: (context, index) {
return GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
Navigator.of(context).pop(hotCity[index]);
setState((){});
},
child: Container(
decoration: BoxDecoration(
color: Color(0xFFF7F7F7),
borderRadius: BorderRadius.circular(4),
),
alignment: Alignment.center,
child: Text(
hotCity[index],
style: TextStyle(
color: Color(0xFF4D4D4D),
fontWeight: MyFontWeight.medium,
fontSize: 16.sp,
),
)));
},
),
],
),
),
Expanded(child: sortList())
],
),
),
);
}
Widget searchCityItem() {
return Container(
margin: EdgeInsets.fromLTRB(6.w, 0, 14.w, 0),
padding: EdgeInsets.symmetric(vertical: 6.h),
decoration: BoxDecoration(
color: Color(0xFFF1F1F1),
borderRadius: BorderRadius.circular(6),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
),
],
),
child: TextField(
textInputAction: TextInputAction.search,
onEditingComplete: () {
FocusScope.of(context).requestFocus(FocusNode());
},
onChanged: (txt) {
areaCode(searchTxt: txt);
},
style: TextStyle(
fontSize: 14.sp,
),
decoration: InputDecoration(
hintText: "搜索联盟会员店",
hintStyle: TextStyle(
fontSize: 12.sp,
color: Color(0xFFB3B3B3),
),
isCollapsed: true,
prefixIcon:Padding(padding: EdgeInsets.only(left: 5.w,right: 5.w),child: Image.asset(
"assets/image/icon_search.webp",
width: 16.h,
height: 16.h,
),),
prefixIconConstraints: BoxConstraints(),
border: InputBorder.none,
),
),
);
}
Widget sortList() {
return areaList.length != 0 ?ListView.builder(
padding: EdgeInsets.zero,
itemCount: areaList.length,
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: BouncingScrollPhysics(),
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {},
child: sortItem(position),
);
},
):Padding(padding:EdgeInsets.only(top:12.h),
child: Text(
"抱歉,未找到相关位置,可尝试修改后重试",
style: TextStyle(
color: Color(0xFF4D4D4D),
fontWeight: MyFontWeight.medium,
fontSize: 14.sp,
),
));
}
Widget sortItem(int position) {
return Column(
children: [
Container(
width: double.infinity,
// color: Colors.white,
padding: EdgeInsets.only(top: 14.h, bottom: 4.h, left: 16.w),
margin: EdgeInsets.only(bottom: 12.h),
child: Text(
areaList[position],
style: TextStyle(
color: Color(0xFF4D4D4D),
fontWeight: MyFontWeight.medium,
fontSize: 16.sp,
),
),
),
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6.w),
color: Colors.white,
),
margin: EdgeInsets.symmetric(horizontal: 14.w),
padding: EdgeInsets.only(
top: 8.h,
),
child: mapWidget(position),
)
],
);
}
Widget mapWidget(position) {
int mapIndex = 0;
return Column(
children: (areaMap[areaList[position]] as List).map((e) {
mapIndex += 1;
return globalRoamingItem(
e, mapIndex == areaMap[areaList[position]].length);
}).toList(),
);
}
Widget globalRoamingItem(data, isLast) {
return GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
Navigator.of(context).pop(data["area"]);
},
child: Container(
width: double.infinity,
child: Text(
data["area"],
style: TextStyle(
color: Color(0xFF000000),
fontWeight: MyFontWeight.regular,
fontSize: 14.sp,
),
),
decoration: BoxDecoration(
border: isLast
? null
: Border(
bottom: BorderSide(
width: 1.w,
color: Color(0xFFDCDCDC),
style: BorderStyle.solid,
),
),
),
padding: EdgeInsets.only(top: 16.h, bottom: 16.h, left: 16.w),
),
);
}
}

86
lib/utils/captcha_util.dart

@ -0,0 +1,86 @@
import 'dart:convert';
import 'package:steel_crypt/steel_crypt.dart';
import 'package:convert/convert.dart';
import 'package:crypto/crypto.dart';
class CaptchaUtil{
///aes加密
/// [key]AesCrypt加密key
/// [content]
static String aesEncode({String key, String content}) {
var aesCrypt = AesCrypt(
key: base64UrlEncode(key.codeUnits), padding: PaddingAES.pkcs7);
return aesCrypt.ecb.encrypt(inp: content);
}
///aes解密
/// [key]aes解密key
/// [content]
static String aesDecode({String key, String content}) {
var aesCrypt = AesCrypt(
key: base64UrlEncode(key.codeUnits), padding: PaddingAES.pkcs7);
return aesCrypt.ecb.decrypt(enc: content);
}
/// isEmpty.
static bool isEmpty(Object value) {
if (value == null) return true;
if (value is String && value.isEmpty) {
return true;
}
return false;
}
//list length == 0 || list == null
static bool isListEmpty(Object value) {
if (value == null) return true;
if (value is List && value.length == 0) {
return true;
}
return false;
}
static String jsonFormat(Map<dynamic, dynamic> map) {
Map _map = Map<String, Object>.from(map);
JsonEncoder encoder = JsonEncoder.withIndent(' ');
return encoder.convert(_map);
}
static String generateMd5(String data){
var content = new Utf8Encoder().convert(data);
var digest = md5.convert(content);
return hex.encode(digest.bytes);
}
static signData(Object params, tokenStr) async {
var time = new DateTime.now().millisecondsSinceEpoch;
String token = tokenStr;
Map<String, dynamic> reqData = new Map();
Map<String, dynamic> paramsObj = new Map();
paramsObj = params as Map<String, dynamic>;
var arr = [];
//
paramsObj?.forEach((key, value) => arr.add(key));
//
Map cr = new Map();
cr['token'] = token;
cr['time'] = time.toString();
cr['reqData'] = json.encode(paramsObj);
var array = [];
cr.forEach((key, value) => array.add(key));
array.sort();
var str = '';
for (var i = 0; i < array.length; i++) {
var key = array[i];
var value = cr[key];
str += key + value;
}
reqData["time"] = time;
reqData["token"] = token;
reqData['reqData'] = params;
reqData['sign'] = generateMd5(str);
return reqData;
}
}

11
lib/utils/flutter_utils.dart

@ -1,3 +1,4 @@
import 'dart:convert';
import 'dart:io'; import 'dart:io';
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
@ -10,11 +11,11 @@ import 'package:path_provider/path_provider.dart';
class AppUtils { class AppUtils {
///线 ///线
static Future<String> calculateDistance( static Future<String> calculateDistance(
BMFCoordinate bmfCoordinate, BMFCoordinate myLatLng) async { BMFCoordinate bmfCoordinate, BMFCoordinate myLatLng, {bool isMi = false}) async {
double mi = double mi =
await BMFCalculateUtils.getLocationDistance(bmfCoordinate, myLatLng); await BMFCalculateUtils.getLocationDistance(bmfCoordinate, myLatLng);
NumberFormat numberFormat = NumberFormat("#.#"); NumberFormat numberFormat = NumberFormat("#.#");
return "${numberFormat.format(mi / 1000)}"; return "${numberFormat.format(mi / (isMi ? 1 :1000))}";
} }
@ -77,12 +78,12 @@ class AppUtils {
return resString; return resString;
} }
/// ///()
static Future<BMFCoordinate> coordConvert(BMFCoordinate latLng) async { static Future<BMFCoordinate> coordConvert(BMFCoordinate latLng) async {
return BMFCalculateUtils.coordConvert( return BMFCalculateUtils.coordConvert(
coordinate: latLng, coordinate: latLng,
fromType: BMF_COORD_TYPE.BD09LL, fromType: BMF_COORD_TYPE.COMMON,
toType: BMF_COORD_TYPE.COMMON); toType: BMF_COORD_TYPE.BD09LL);
} }
static bool isPhone(mobile) { static bool isPhone(mobile) {

217
lib/utils/location.dart

@ -11,10 +11,9 @@ import 'package:permission_handler/permission_handler.dart';
import 'font_weight.dart'; import 'font_weight.dart';
BaiduLocationAndroidOption initAndroidOptions() { BaiduLocationAndroidOption initAndroidOptions() {
BaiduLocationAndroidOption options = BaiduLocationAndroidOption( BaiduLocationAndroidOption options = BaiduLocationAndroidOption(
// //
locationMode: BMFLocationMode.hightAccuracy, locationMode: BMFLocationMode.hightAccuracy,
// //
isNeedAddress: true, isNeedAddress: true,
@ -63,7 +62,6 @@ BaiduLocationIOSOption initIOSOptions() {
return options; return options;
} }
class Location { class Location {
static Location _instance; static Location _instance;
@ -80,17 +78,18 @@ class Location {
LocationFlutterPlugin aMapFlutterLocation; LocationFlutterPlugin aMapFlutterLocation;
Future<bool> startLocation(context, Function(BaiduLocation result) locationCallback) async { Future<bool> startLocation(
aMapFlutterLocation.prepareLoc(initAndroidOptions().getMap(), initIOSOptions().getMap()); context, Function(BaiduLocation result) locationCallback) async {
if (!(await Permission.locationWhenInUse.serviceStatus.isEnabled)) { aMapFlutterLocation.prepareLoc(
enableLocation(context); initAndroidOptions().getMap(), initIOSOptions().getMap());
var permissionStatus = await Permission.location.status;
if (!permissionStatus.isGranted) {
if (permissionStatus.isUndetermined)
showTipsAlertDialog(context);
return false; return false;
} } else {
if (await Permission.location.isPermanentlyDenied) { aMapFlutterLocation.singleLocationCallback(
requestDialog(context, locationCallback); callback: (BaiduLocation result) {
return false;
} else if (await Permission.location.isGranted) {
aMapFlutterLocation.singleLocationCallback(callback: (BaiduLocation result) {
locationCallback.call(result); locationCallback.call(result);
}); });
if (Platform.isIOS) { if (Platform.isIOS) {
@ -102,21 +101,6 @@ class Location {
await aMapFlutterLocation.startLocation(); await aMapFlutterLocation.startLocation();
} }
return true; return true;
} else if (await Permission.location.isUndetermined) {
showAlertDialog(context);
await Permission.location.request();
Navigator.of(context).pop();
return false;
} else {
if (Platform.isIOS) {
//
requestDialog(context, locationCallback);
} else {
showAlertDialog(context);
await Permission.location.request();
Navigator.of(context).pop();
}
return false;
} }
} }
@ -172,56 +156,173 @@ class Location {
} }
/// ///
showAlertDialog(context) { showTipsAlertDialog(context) async {
// //
showDialog( showDialog(
context: context, context: context,
barrierDismissible: false,
barrierColor: null,
builder: (BuildContext context) { builder: (BuildContext context) {
return SimpleDialog( return Column(
titlePadding: EdgeInsets.all(10), children: [
backgroundColor: Colors.transparent,
elevation: 0,
alignment: Alignment.topCenter,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(6),
),
children: <Widget>[
Container( Container(
width: double.infinity, width: double.infinity,
height: 120.h, padding: EdgeInsets.all(15),
padding: EdgeInsets.all(16), margin: EdgeInsets.all(15),
decoration: new BoxDecoration( decoration: new BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(10),
), ),
child:Column( child: Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Icon(
"访问精确地理位置信息权限说明", Icons.location_on_outlined,
style: TextStyle( color: Colors.black,
fontSize: 15.sp, size: 22,
fontWeight:MyFontWeight.regular,
color: Colors.black,
),
), ),
SizedBox(height: 3.h,), Expanded(
Text( child: Column(
"为了向您推荐附近的门店信息,推荐您在使用期间让我们使用位置信息,不授权该权限不影响app正常使用。", crossAxisAlignment: CrossAxisAlignment.start,
style: TextStyle( mainAxisSize: MainAxisSize.min,
fontSize: 13.sp, children: [
height: 1.3.h, Text(
fontWeight:MyFontWeight.regular, // "访问精确地理位置信息权限说明",
color: Colors.black, "位置权限使用说明",
style: TextStyle(
fontSize: 18.sp,
fontWeight: MyFontWeight.regular,
color: Colors.black,
),
),
SizedBox(
height: 3.h,
),
Text(
// "为了向您推荐附近的门店信息,推荐您在使用期间让我们使用位置信息,不授权该权限不影响app正常使用。",
"为了向您推荐附近的门店信息,推荐您在使用期间让我们使用位置信息",
style: TextStyle(
fontSize: 13.sp,
fontWeight: MyFontWeight.regular,
color: Colors.black,
),
),
],
), ),
), ),
], ],
), ),
), )
], ],
mainAxisSize: MainAxisSize.min,
); );
}, },
); );
await Permission.location.request();
Navigator.of(context).pop();
} }
///
showAlertDialog(context) {
//
showDialog(
context: context,
barrierDismissible: true,
barrierColor: null,
builder: (BuildContext context) {
return Column(
children: [
Container(
width: double.infinity,
padding: EdgeInsets.all(15),
margin: EdgeInsets.all(15),
decoration: new BoxDecoration(
color: Colors.black.withOpacity(0.6),
borderRadius: BorderRadius.circular(10),
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Text(
// "访问精确地理位置信息权限说明",
"定位服务未开启",
style: TextStyle(
fontSize: 18.sp,
fontWeight: MyFontWeight.regular,
color: Colors.white,
),
),
SizedBox(
height: 3.h,
),
Text(
// "为了向您推荐附近的门店信息,推荐您在使用期间让我们使用位置信息,不授权该权限不影响app正常使用。",
"开启后才能提供更详细的定位服务哦!",
style: TextStyle(
fontSize: 13.sp,
fontWeight: MyFontWeight.regular,
color: Colors.white,
),
),
],
),
),
GestureDetector(
child: Container(
child: Text(
"去开启",
style: TextStyle(
fontSize: 15.sp,
fontWeight: MyFontWeight.regular,
color: Colors.white,
),
),
margin: EdgeInsets.symmetric(
horizontal: 15.w, vertical: 25.h),
padding:
EdgeInsets.symmetric(vertical: 2.h, horizontal: 10.w),
decoration: BoxDecoration(
color: Colors.green,
borderRadius: BorderRadius.circular(100),
),
),
onTap: () async {
await openAppSettings();
if (await Permission.location.isGranted)
Navigator.of(context).pop();
},
behavior: HitTestBehavior.opaque,
),
GestureDetector(
behavior: HitTestBehavior.opaque,
child: Container(
child: Icon(
Icons.close,
color: Colors.white.withOpacity(0.8),
size: 12,
),
decoration: BoxDecoration(
color: Colors.black.withOpacity(0.8),
borderRadius: BorderRadius.circular(100),
),
padding: EdgeInsets.all(5),
),
onTap: () {
Navigator.of(context).pop();
},
)
],
),
)
],
mainAxisSize: MainAxisSize.min,
);
},
);
}
} }

133
lib/utils/widget_util.dart

@ -0,0 +1,133 @@
import 'dart:async';
import 'package:flutter/widgets.dart';
import 'captcha_util.dart';
/**
* @Author: thl
* @GitHub: https://github.com/Sky24n
* @Email: 863764940@qq.com
* @Email: sky24no@gmail.com
* @Description: Widget Util.
* @Date: 2018/9/10
*/
/// Widget Util.
class WidgetUtil {
bool _hasMeasured = false;
double _width;
double _height;
/// Widget rendering listener.
/// Widget渲染监听.
/// context: Widget context.
/// isOnce: true,Continuous monitoring false,Listen only once.
/// onCallBack: Widget Rect CallBack.
void asyncPrepare(
BuildContext context, bool isOnce, ValueChanged<Rect> onCallBack) {
if (_hasMeasured) return;
WidgetsBinding.instance.addPostFrameCallback((Duration timeStamp) {
RenderObject box = context.findRenderObject();
if (box != null) {
if (isOnce) _hasMeasured = true;
double width = box.semanticBounds.width;
double height = box.semanticBounds.height;
if (_width != width || _height != height) {
_width = width;
_height = height;
if (onCallBack != null) onCallBack(box.semanticBounds);
}
}
});
}
/// Widget渲染监听.
void asyncPrepares(bool isOnce, ValueChanged<Rect> onCallBack) {
if (_hasMeasured) return;
WidgetsBinding.instance.addPostFrameCallback((Duration timeStamp) {
if (isOnce) _hasMeasured = true;
if (onCallBack != null) onCallBack(null);
});
}
///get Widget Bounds (width, height, left, top, right, bottom and so on).Widgets must be rendered completely.
///widget Rect
static Rect getWidgetBounds(BuildContext context) {
RenderObject box = context.findRenderObject();
return (box != null) ? box.semanticBounds : Rect.zero;
}
///Get the coordinates of the widget on the screen.Widgets must be rendered completely.
///widget在屏幕上的坐标,widget必须渲染完成
static Offset getWidgetLocalToGlobal(BuildContext context) {
RenderBox box = context.findRenderObject() as RenderBox;
return box == null ? Offset.zero : box.localToGlobal(Offset.zero);
}
/// get image width heightload error return Rect.zero.unit px
/// Rect.zero. px
/// image
/// url network
/// local url , package
static Future<Rect> getImageWH(
{Image image, String url, String localUrl, String package}) {
if (CaptchaUtil.isEmpty(image) &&
CaptchaUtil.isEmpty(url) &&
CaptchaUtil.isEmpty(localUrl)) {
return Future.value(Rect.zero);
}
Completer<Rect> completer = Completer<Rect>();
Image img = image ?? ((url != null && url.isNotEmpty)
? Image.network(url)
: Image.asset(localUrl, package: package));
img.image
.resolve(const ImageConfiguration())
.addListener(ImageStreamListener(
(ImageInfo info, bool _) {
completer.complete(Rect.fromLTWH(0, 0, info.image.width.toDouble(),
info.image.height.toDouble()));
},
onError: (Object exception, StackTrace stackTrace) {
completer.completeError(exception, stackTrace);
},
));
return completer.future;
}
/// get image width height, load error throw exception.unit px
/// . px
/// image
/// url network
/// local url (full path/example"assets/images/ali_connors.png"""assets/images/3.0x/ali_connors.png"" );
/// package
static Future<Rect> getImageWHE(
{Image image,
String url,
String localUrl,
String package}) {
if (CaptchaUtil.isEmpty(image) &&
CaptchaUtil.isEmpty(url) &&
CaptchaUtil.isEmpty(localUrl)) {
return Future.error("image is null.");
}
Completer<Rect> completer = Completer<Rect>();
Image img = image != null
? image
: ((url != null && url.isNotEmpty)
? Image.network(url)
: Image.asset(localUrl, package: package));
img.image
.resolve(const ImageConfiguration())
.addListener(ImageStreamListener(
(ImageInfo info, bool _) {
completer.complete(Rect.fromLTWH(0, 0, info.image.width.toDouble(),
info.image.height.toDouble()));
},
onError: (Object exception, StackTrace stackTrace) {
completer.completeError(exception, stackTrace);
},
));
return completer.future;
}
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save