Browse Source

Merge branch 'new_revision_app' into dev

# Conflicts:
#	lib/settlement/settlement_view/activity_coupon_remarks.dart
new_revision_app
wurong 2 years ago
parent
commit
80177ee257
  1. 2
      android/app/build.gradle
  2. BIN
      assets/image/2x/mine_order.webp
  3. BIN
      assets/image/2x/mine_vip_logo.webp
  4. BIN
      assets/image/2x/set.webp
  5. BIN
      assets/image/2x/vip_code.webp
  6. BIN
      assets/image/2x/wallet.webp
  7. BIN
      assets/image/2x/write_off_bg.webp
  8. BIN
      assets/image/3x/mine_order.webp
  9. BIN
      assets/image/3x/mine_vip_logo.webp
  10. BIN
      assets/image/3x/set.webp
  11. BIN
      assets/image/3x/vip_code.webp
  12. BIN
      assets/image/3x/wallet.webp
  13. BIN
      assets/image/3x/write_off_bg.webp
  14. BIN
      assets/image/mine_order.webp
  15. BIN
      assets/image/mine_vip_logo.webp
  16. BIN
      assets/image/set.webp
  17. BIN
      assets/image/vip_code.webp
  18. BIN
      assets/image/wallet.webp
  19. BIN
      assets/image/write_off_bg.webp
  20. 2
      ios/Flutter/AppFrameworkInfo.plist
  21. 12
      ios/Podfile
  22. 8
      ios/Podfile.lock
  23. 12
      ios/Runner.xcodeproj/project.pbxproj
  24. 25
      lib/base_state.dart
  25. 8
      lib/community/community_child_page.dart
  26. 292
      lib/community/community_details.dart
  27. 175
      lib/community/community_list.dart
  28. 1
      lib/community/community_page.dart
  29. 585
      lib/community/community_view/class_details.dart
  30. 12
      lib/community/community_view/class_details_video.dart
  31. 2
      lib/community/community_view/class_list_view.dart
  32. 405
      lib/community/community_view/community_dynamic.dart
  33. 2
      lib/community/community_view/home_class.dart
  34. 64
      lib/community/new_community_details.dart
  35. 72
      lib/community/photo_view_gallery_screen.dart
  36. 8
      lib/generated/intl/messages_en.dart
  37. 12
      lib/generated/intl/messages_en_US.dart
  38. 8
      lib/generated/intl/messages_zh_CN.dart
  39. 8
      lib/generated/intl/messages_zh_Hans_CN.dart
  40. 10
      lib/generated/intl/messages_zh_Hant_CN.dart
  41. 8
      lib/generated/intl/messages_zh_TW.dart
  42. 80
      lib/generated/l10n.dart
  43. 11
      lib/home/home_page.dart
  44. 90
      lib/home/welfare_exchange.dart
  45. 55
      lib/home/welfare_page.dart
  46. 11
      lib/l10n/intl_en.arb
  47. 10
      lib/l10n/intl_en_US.arb
  48. 10
      lib/l10n/intl_zh_CN.arb
  49. 10
      lib/l10n/intl_zh_Hans_CN.arb
  50. 10
      lib/l10n/intl_zh_Hant_CN.arb
  51. 10
      lib/l10n/intl_zh_TW.arb
  52. 59
      lib/login/new_login_page.dart
  53. 10
      lib/main.dart
  54. 6
      lib/main_page.dart
  55. 1034
      lib/message/system_details.dart
  56. 712
      lib/message/system_message.dart
  57. 164
      lib/mine/mine_page.dart
  58. 8
      lib/mine/mine_view/community_follow.dart
  59. 2
      lib/mine/mine_view/mine_item.dart
  60. 301
      lib/mine/mine_view/mine_navbar.dart
  61. 214
      lib/mine/mine_view/mine_view.dart
  62. 2
      lib/mine/mine_wallet_page.dart
  63. 691
      lib/mine/personal_page.dart
  64. 4
      lib/mine/recharge_page.dart
  65. 58
      lib/mine/scan_web.dart
  66. 103
      lib/mine/user_info_page.dart
  67. 192
      lib/mine/vip_pay_code.dart
  68. 17
      lib/order/edit_remarks_page.dart
  69. 2
      lib/order/exchange_order_page.dart
  70. 6
      lib/order/order_detail_page.dart
  71. 97
      lib/order/order_history_page.dart
  72. 24
      lib/order/order_view/order_address.dart
  73. 8
      lib/order/order_view/order_pay_selected.dart
  74. 715
      lib/order/write_off_page.dart
  75. 86
      lib/qr/qr_code_scan.dart
  76. 8
      lib/retrofit/data/settleOrderInfo.dart
  77. 3
      lib/retrofit/data/user_info.dart
  78. 2
      lib/retrofit/retrofit_api.dart
  79. 4
      lib/retrofit/retrofit_api.g.dart
  80. 6
      lib/setting/logout_ing.dart
  81. 22
      lib/settlement/settlement.dart
  82. 6
      lib/settlement/settlement_view/activity_coupon_remarks.dart
  83. 42
      lib/settlement/settlement_view/distribution.dart
  84. 13
      lib/settlement/settlement_view/pay_method.dart
  85. 2
      lib/settlement/settlement_view/settlement_order_commodity.dart
  86. 357
      lib/store/shop_details_page.dart
  87. 66
      lib/store/store_order.dart
  88. 630
      lib/store/store_view/product_sku.dart
  89. 148
      lib/store/store_view/shop_goods.dart
  90. 3
      lib/union/union_list.dart
  91. 2
      lib/union/union_page.dart
  92. 4
      lib/view_widget/activity_coupons.dart
  93. 6
      lib/view_widget/activity_poster.dart
  94. 2
      lib/view_widget/coupon_details_dialog.dart
  95. 2
      lib/view_widget/cupertino_date_picker.dart
  96. 244
      lib/view_widget/mine_vip_entry.dart
  97. 4
      lib/view_widget/my_appbar.dart
  98. 4
      lib/view_widget/new_coupon_widget.dart
  99. 4
      lib/view_widget/pay_selected_dialog.dart
  100. 2
      lib/view_widget/receiving_method_dialog.dart
  101. Some files were not shown because too many files have changed in this diff Show More

2
android/app/build.gradle

@ -184,7 +184,7 @@ dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar']) implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.tencent.mm.opensdk:wechat-sdk-android-without-mta:6.6.5' // implementation 'com.tencent.mm.opensdk:wechat-sdk-android-without-mta:6.6.5'
implementation fileTree(include: ['*.aar'], dir: 'libs') implementation fileTree(include: ['*.aar'], dir: 'libs')
implementation 'androidx.legacy:legacy-support-v4:1.0.0' implementation 'androidx.legacy:legacy-support-v4:1.0.0'

BIN
assets/image/2x/mine_order.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 866 B

BIN
assets/image/2x/mine_vip_logo.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

BIN
assets/image/2x/set.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
assets/image/2x/vip_code.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
assets/image/2x/wallet.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

BIN
assets/image/2x/write_off_bg.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

BIN
assets/image/3x/mine_order.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
assets/image/3x/mine_vip_logo.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
assets/image/3x/set.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

BIN
assets/image/3x/vip_code.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
assets/image/3x/wallet.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
assets/image/3x/write_off_bg.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

BIN
assets/image/mine_order.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 642 B

BIN
assets/image/mine_vip_logo.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 718 B

BIN
assets/image/set.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 908 B

BIN
assets/image/vip_code.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 720 B

BIN
assets/image/wallet.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 710 B

BIN
assets/image/write_off_bg.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

2
ios/Flutter/AppFrameworkInfo.plist

@ -21,6 +21,6 @@
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>1.0</string> <string>1.0</string>
<key>MinimumOSVersion</key> <key>MinimumOSVersion</key>
<string>9.0</string> <string>11.0</string>
</dict> </dict>
</plist> </plist>

12
ios/Podfile

@ -1,5 +1,5 @@
# Uncomment this line to define a global platform for your project # Uncomment this line to define a global platform for your project
platform :ios, '10.0' platform :ios, '11.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency. # CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true' ENV['COCOAPODS_DISABLE_STATS'] = 'true'
@ -33,8 +33,18 @@ target 'Runner' do
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end end
#post_install do |installer|
# installer.pods_project.targets.each do |target|
# flutter_additional_ios_build_settings(target)
# end
#end
post_install do |installer| post_install do |installer|
installer.pods_project.targets.each do |target| installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target) flutter_additional_ios_build_settings(target)
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'NO'
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0'
end
end end
end end

8
ios/Podfile.lock

@ -22,6 +22,8 @@ PODS:
- BaiduMapKit/Utils (6.5.1): - BaiduMapKit/Utils (6.5.1):
- BaiduMapKit/Base - BaiduMapKit/Base
- BMKLocationKit (2.0.4) - BMKLocationKit (2.0.4)
- emoji_picker_flutter (0.0.1):
- Flutter
- Flutter (1.0.0) - Flutter (1.0.0)
- flutter_baidu_mapapi_base (3.1.0): - flutter_baidu_mapapi_base (3.1.0):
- BaiduMapKit/Utils (= 6.5.1) - BaiduMapKit/Utils (= 6.5.1)
@ -238,6 +240,7 @@ PODS:
- SDWebImage - SDWebImage
DEPENDENCIES: DEPENDENCIES:
- emoji_picker_flutter (from `.symlinks/plugins/emoji_picker_flutter/ios`)
- Flutter (from `Flutter`) - Flutter (from `Flutter`)
- flutter_baidu_mapapi_base (from `.symlinks/plugins/flutter_baidu_mapapi_base/ios`) - flutter_baidu_mapapi_base (from `.symlinks/plugins/flutter_baidu_mapapi_base/ios`)
- flutter_baidu_mapapi_map (from `.symlinks/plugins/flutter_baidu_mapapi_map/ios`) - flutter_baidu_mapapi_map (from `.symlinks/plugins/flutter_baidu_mapapi_map/ios`)
@ -276,6 +279,8 @@ SPEC REPOS:
- ZLPhotoBrowser-objc - ZLPhotoBrowser-objc
EXTERNAL SOURCES: EXTERNAL SOURCES:
emoji_picker_flutter:
:path: ".symlinks/plugins/emoji_picker_flutter/ios"
Flutter: Flutter:
:path: Flutter :path: Flutter
flutter_baidu_mapapi_base: flutter_baidu_mapapi_base:
@ -325,6 +330,7 @@ SPEC CHECKSUMS:
AFNetworking: 7864c38297c79aaca1500c33288e429c3451fdce AFNetworking: 7864c38297c79aaca1500c33288e429c3451fdce
BaiduMapKit: f227cfb43581e91466fb4f1344f655eab5788777 BaiduMapKit: f227cfb43581e91466fb4f1344f655eab5788777
BMKLocationKit: 688d8e1194980b96fc9a6585c0eb42e62fbaf780 BMKLocationKit: 688d8e1194980b96fc9a6585c0eb42e62fbaf780
emoji_picker_flutter: df19dac03a2b39ac667dc8d1da939ef3a9e21347
Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a
flutter_baidu_mapapi_base: cb406be78c3a949fb58a45dc6627f139d580bd37 flutter_baidu_mapapi_base: cb406be78c3a949fb58a45dc6627f139d580bd37
flutter_baidu_mapapi_map: 81c4e6e93dc668e311d9b521421deaf292390434 flutter_baidu_mapapi_map: 81c4e6e93dc668e311d9b521421deaf292390434
@ -355,6 +361,6 @@ SPEC CHECKSUMS:
webview_flutter: 5fb4def2bbd4339889ee14d045b605cefc5bc232 webview_flutter: 5fb4def2bbd4339889ee14d045b605cefc5bc232
ZLPhotoBrowser-objc: c7657d3bc85ae231884e058d0e3638f619164736 ZLPhotoBrowser-objc: c7657d3bc85ae231884e058d0e3638f619164736
PODFILE CHECKSUM: 77c662d4cd560e96445691f5bf7f29e2b140072c PODFILE CHECKSUM: 9a26c1c4037e42be4afc95d70f8bd02a4b989a1c
COCOAPODS: 1.11.3 COCOAPODS: 1.11.3

12
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 = 7; CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = YF3Q8DVP52; DEVELOPMENT_TEAM = YF3Q8DVP52;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
@ -667,7 +667,7 @@
"$(PROJECT_DIR)/baidu", "$(PROJECT_DIR)/baidu",
"$(PROJECT_DIR)/Runner/baidu", "$(PROJECT_DIR)/Runner/baidu",
); );
MARKETING_VERSION = 3.1.7; MARKETING_VERSION = 3.2.2;
ONLY_ACTIVE_ARCH = YES; ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = ( OTHER_LDFLAGS = (
"$(inherited)", "$(inherited)",
@ -819,7 +819,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 = 7; CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = YF3Q8DVP52; DEVELOPMENT_TEAM = YF3Q8DVP52;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
@ -869,7 +869,7 @@
"$(PROJECT_DIR)/baidu", "$(PROJECT_DIR)/baidu",
"$(PROJECT_DIR)/Runner/baidu", "$(PROJECT_DIR)/Runner/baidu",
); );
MARKETING_VERSION = 3.1.7; MARKETING_VERSION = 3.2.2;
ONLY_ACTIVE_ARCH = YES; ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = ( OTHER_LDFLAGS = (
"$(inherited)", "$(inherited)",
@ -912,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 = 7; CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = YF3Q8DVP52; DEVELOPMENT_TEAM = YF3Q8DVP52;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
@ -962,7 +962,7 @@
"$(PROJECT_DIR)/baidu", "$(PROJECT_DIR)/baidu",
"$(PROJECT_DIR)/Runner/baidu", "$(PROJECT_DIR)/Runner/baidu",
); );
MARKETING_VERSION = 3.1.7; MARKETING_VERSION = 3.2.2;
ONLY_ACTIVE_ARCH = YES; ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = ( OTHER_LDFLAGS = (
"$(inherited)", "$(inherited)",

25
lib/base_state.dart

@ -1,12 +1,11 @@
import 'dart:convert'; import 'dart:convert';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:huixiang/utils/bridge.dart'; import 'package:huixiang/utils/bridge.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
abstract class BaseState<T extends StatefulWidget> extends State<T> with WidgetsBindingObserver { abstract class BaseState<T extends StatefulWidget> extends State<T>
with WidgetsBindingObserver {
@override @override
void dispose() { void dispose() {
super.dispose(); super.dispose();
@ -60,8 +59,10 @@ abstract class BaseState<T extends StatefulWidget> extends State<T> with Widgets
params["activityId"] = pushMap["info"]; params["activityId"] = pushMap["info"];
break; break;
case 3: case 3:
routeName = "/router/union_detail_page"; routeName = "/router/store_order";
params["id"] = pushMap["info"]; params["id"] = pushMap["info"];
params["tenant"] = pushMap["tenant"];
params["storeName"] = pushMap["storeName"];
break; break;
case 4: case 4:
routeName = "/router/integral_store_page"; routeName = "/router/integral_store_page";
@ -71,6 +72,18 @@ abstract class BaseState<T extends StatefulWidget> extends State<T> with Widgets
routeName = "/router/order_details"; routeName = "/router/order_details";
params["id"] = pushMap["info"]; params["id"] = pushMap["info"];
break; break;
case 6:
routeName = "/router/community_details";
params["businessId"] = pushMap["info"];
break;
case 8:
routeName = "/router/mine_wallet";
params["id"] = pushMap["info"];
break;
case 9:
routeName = "/router/welfare_page";
params["id"] = pushMap["info"];
break;
} }
sharedPreferences.setString("pushData", ""); sharedPreferences.setString("pushData", "");
print("xgPushClickAction: routeName: $routeName"); print("xgPushClickAction: routeName: $routeName");
@ -79,6 +92,4 @@ abstract class BaseState<T extends StatefulWidget> extends State<T> with Widgets
} }
} }
} }
}
}

8
lib/community/community_child_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_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/community/community_view/community_dynamic.dart'; import 'package:huixiang/community/community_view/community_dynamic.dart';
import 'package:huixiang/retrofit/data/article.dart'; import 'package:huixiang/retrofit/data/article.dart';
import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/base_data.dart';
@ -15,6 +16,8 @@ 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';
class CommunityChildPage extends StatefulWidget { class CommunityChildPage extends StatefulWidget {
final String typeStr; final String typeStr;
final Function onScroll; final Function onScroll;
@ -84,6 +87,8 @@ class CommunityChildPageState extends State<CommunityChildPage>
"pageSize": 10, "pageSize": 10,
"searchKey": searchKey ?? "" "searchKey": searchKey ?? ""
}).catchError((error) { }).catchError((error) {
SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type),
alignment: Alignment.center);
if (searchKey == null) { if (searchKey == null) {
refreshController.refreshFailed(); refreshController.refreshFailed();
refreshController.loadFailed(); refreshController.loadFailed();
@ -101,6 +106,7 @@ class CommunityChildPageState extends State<CommunityChildPage>
element.content = jsonEncode(baseData.data.list[0].subjectInfo); element.content = jsonEncode(baseData.data.list[0].subjectInfo);
element.mainTitle = baseData.data.list[0].subject; element.mainTitle = baseData.data.list[0].subject;
element.followed = baseData.data.list[0].selfFollow; element.followed = baseData.data.list[0].selfFollow;
element.liked = baseData.data.list[0].selfLike;
element.authorHeadImg = baseData.data.list[0].memberInfo?.avatar; element.authorHeadImg = baseData.data.list[0].memberInfo?.avatar;
element.authorName = baseData.data.list[0].memberInfo?.nickname; element.authorName = baseData.data.list[0].memberInfo?.nickname;
element.location = baseData.data.list[0].location; element.location = baseData.data.list[0].location;
@ -123,6 +129,7 @@ class CommunityChildPageState extends State<CommunityChildPage>
article.content = jsonEncode(element.subjectInfo); article.content = jsonEncode(element.subjectInfo);
article.mainTitle = element.subject; article.mainTitle = element.subject;
article.followed = element.selfFollow; article.followed = element.selfFollow;
article.liked = element.selfLike;
article.authorHeadImg = element.memberInfo?.avatar; article.authorHeadImg = element.memberInfo?.avatar;
article.authorName = element.memberInfo?.nickname; article.authorName = element.memberInfo?.nickname;
article.location = element.location; article.location = element.location;
@ -206,6 +213,7 @@ class CommunityChildPageState extends State<CommunityChildPage>
setState(() {}); setState(() {});
}); });
setState(() {}); setState(() {});
}, },
); );
}, },

292
lib/community/community_details.dart

@ -1,3 +1,5 @@
import 'dart:ui';
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
@ -26,9 +28,11 @@ class CommunityDetails extends StatefulWidget {
} }
} }
class _CommunityDetails extends State<CommunityDetails> with WidgetsBindingObserver { class _CommunityDetails extends State<CommunityDetails>
with WidgetsBindingObserver {
double height = 0; double height = 0;
double commentHeight = 60.h; double commentHeight = 60.h;
// ComunityComment comunity; // ComunityComment comunity;
String parenId = "0"; String parenId = "0";
final GlobalKey commentKey = GlobalKey(); final GlobalKey commentKey = GlobalKey();
@ -44,18 +48,23 @@ class _CommunityDetails extends State<CommunityDetails> with WidgetsBindingObser
Article article; Article article;
String businessId; String businessId;
final GlobalKey inputKey = GlobalKey();
final TextEditingController commentTextController = TextEditingController();
bool emojiShowing = false;
static double keyboard_height=300;
double keyboard = -1;
bool needShowSmiley = false;
bool needHideSmiley = false;
@override
void didChangeMetrics() { void didChangeMetrics() {
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
isKeyBoardShow = MediaQuery.of(context).viewInsets.bottom > 0;
if (!mounted) return; if (!mounted) return;
if (MediaQuery if (MediaQuery.of(context).viewInsets.bottom == 0) {
.of(context)
.viewInsets
.bottom == 0) {
if (isKeyBoardShow) { if (isKeyBoardShow) {
FocusScope.of(context).requestFocus(FocusNode()); FocusScope.of(context).requestFocus(FocusNode());
if (mounted) if (mounted)
if(!emojiShowing)
setState(() { setState(() {
hintText = S.current.liuxianinjingcaidepinglunba; hintText = S.current.liuxianinjingcaidepinglunba;
isKeyBoardShow = false; isKeyBoardShow = false;
@ -68,6 +77,18 @@ class _CommunityDetails extends State<CommunityDetails> with WidgetsBindingObser
}); });
} }
}); });
if (needShowSmiley && window.viewInsets.bottom <= 0.1) {
needShowSmiley = false;
setState(() {
emojiShowing = true;
});
}
if(needHideSmiley && window.viewInsets.bottom > 0.1) {
needHideSmiley = false;
setState(() {
emojiShowing = false;
});
}
} }
@override @override
@ -76,11 +97,45 @@ class _CommunityDetails extends State<CommunityDetails> with WidgetsBindingObser
// comunity = widget.arguments["comment"]; // comunity = widget.arguments["comment"];
businessId = widget.arguments["businessId"]; businessId = widget.arguments["businessId"];
WidgetsBinding.instance.addObserver(this); WidgetsBinding.instance.addObserver(this);
commentFocus.addListener(_focusNodeListener);
_queryMemberCommentList(); _queryMemberCommentList();
queryDetails(businessId); queryDetails(businessId);
} }
void _focusNodeListener() {
/*if (_focusNode.hasFocus || _focusNode.consumeKeyboardToken()){
setState(() {
smileyPadGone = true;
});
}*/
}
_onTextFieldTap() {
if(emojiShowing) {
needHideSmiley = true;
}
}
_onSmileyTap() {
if(!emojiShowing && commentFocus.hasFocus && isKeyBoardShow) {
needShowSmiley = true;
commentFocus.unfocus();
} else {
setState(() {
emojiShowing = !emojiShowing;
isKeyBoardShow = emojiShowing;
});
}
}
@override
void dispose(){
WidgetsBinding.instance.removeObserver(this);
commentFocus.removeListener(_focusNodeListener);
super.dispose();
}
/// ///
queryDetails(id) async { queryDetails(id) async {
SharedPreferences value = await SharedPreferences.getInstance(); SharedPreferences value = await SharedPreferences.getInstance();
@ -90,8 +145,8 @@ class _CommunityDetails extends State<CommunityDetails> with WidgetsBindingObser
context: context, context: context,
token: value.getString("token"), token: value.getString("token"),
); );
BaseData<Article> baseData = await apiService.informationInfo(id) BaseData<Article> baseData =
.catchError((onError) { await apiService.informationInfo(id).catchError((onError) {
debugPrint(onError.toString()); debugPrint(onError.toString());
}); });
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
@ -103,105 +158,122 @@ class _CommunityDetails extends State<CommunityDetails> with WidgetsBindingObser
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( double h = MediaQuery.of(context).viewInsets.bottom;
appBar: MyAppBar( if(h > 0 && keyboard < h) {
title: S.of(context).dongtaixiangqing, keyboard = h;
titleColor: Colors.black, setState(() {
titleSize: 18.sp, });
background: Colors.white, }
leading: true, return GestureDetector(
leadingColor: Colors.black, behavior: HitTestBehavior.translucent,
), onTap: () {
body: GestureDetector( setState(() {
behavior: HitTestBehavior.translucent, emojiShowing = false;
onTap: () { isKeyBoardShow = emojiShowing;
FocusScope.of(context).requestFocus(FocusNode()); FocusScope.of(context).requestFocus(FocusNode());
}, });
child:Container( },
child: Column( child: Scaffold(
children: [ // resizeToAvoidBottomInset: false,
Expanded( appBar: MyAppBar(
child: SingleChildScrollView( title: S.of(context).dongtaixiangqing,
physics: BouncingScrollPhysics(), titleColor: Colors.black,
child: Column( titleSize: 18.sp,
children: [ background: Colors.white,
if(article != null) leading: true,
CommunityDynamic( leadingColor: Colors.black,
article, ),
0, body: Container(
exitFull: () { child: Column(
setState(() {}); children: [
}, Expanded(
userId:widget.arguments !=null ? widget.arguments["userId"] :widget.arguments["mid"], child: SingleChildScrollView(
itemCount: 3, physics: BouncingScrollPhysics(),
isDetails: true, child: Column(
heightFun: (height) { children: [
this.height = height + if (article != null)
MediaQuery CommunityDynamic(
.of(context) article,
.padding 0,
.top + exitFull: () {
kToolbarHeight + setState(() {});
24; },
if (mounted) setState(() {}); userId: widget.arguments != null
}, ? widget.arguments["userId"]
), : widget.arguments["mid"],
CommentList( itemCount: 3,
commentKey, isDetails: true,
article?.likes ?? 0, heightFun: (height) {
businessId, this.height = height +
4, MediaQuery.of(context).padding.top +
isKeyBoardShow, kToolbarHeight +
_reply, 24;
_delCommentTips, if (mounted) setState(() {});
12.sp, },
requestApiFinish: (total){setState(() {
commentTotal = total;
});},
),
if (memberList == null || memberList.length == 0)
Container(
width: double.infinity,
alignment: Alignment.topCenter,
margin: EdgeInsets.only(top: 40),
padding: EdgeInsets.all(22.h),
child: Text(
S.of(context)
.zanwupinglun,
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.bold,
color: Color(0xFFA0A0A0),
), ),
CommentList(
commentKey,
article?.likes ?? 0,
businessId,
4,
isKeyBoardShow,
_reply,
_delCommentTips,
12.sp,
requestApiFinish: (total) {
setState(() {
commentTotal = total;
});
},
), ),
), if (memberList == null || memberList.length == 0)
], Container(
width: double.infinity,
alignment: Alignment.topCenter,
margin: EdgeInsets.only(top: 40),
padding: EdgeInsets.all(22.h),
child: Text(
S.of(context).zanwupinglun,
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.bold,
color: Color(0xFFA0A0A0),
),
),
),
],
),
),
flex: 1,
), ),
),
flex: 1,
),
/// ///
InputComment( InputComment(
inputKey, inputKey,
hintText, hintText,
isKeyBoardShow, isKeyBoardShow,
commentFocus, keyboard_height,
commentTextController, keyboard,
_toComment, emojiShowing,
_queryMemberComment, commentFocus,
_queryInformationLikes, commentTextController,
isLike: article?.liked ?? false, _toComment,
_onSmileyTap,
_onTextFieldTap,
_queryMemberComment,
_queryInformationLikes,
isLike: article?.liked ?? false,
),
],
), ),
], ),
), ));
)),
);
} }
//// ////
_queryInformationLikes() async { _queryInformationLikes() async {
BaseData baseData = await apiService.informationLikes(businessId).catchError((onError) {}); BaseData baseData =
await apiService.informationLikes(businessId).catchError((onError) {});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
commentKey.currentState.setState(() {}); commentKey.currentState.setState(() {});
setState(() { setState(() {
@ -222,7 +294,7 @@ class _CommunityDetails extends State<CommunityDetails> with WidgetsBindingObser
"content": content, "content": content,
"parentId": parenId, "parentId": parenId,
"relationalId": businessId, "relationalId": businessId,
"relationalType":4 "relationalType": 4
}).catchError((error) {}); }).catchError((error) {});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
CommentListState state = commentKey.currentState; CommentListState state = commentKey.currentState;
@ -241,28 +313,16 @@ class _CommunityDetails extends State<CommunityDetails> with WidgetsBindingObser
scrollController.animateTo( scrollController.animateTo(
first.dy + first.dy +
scrollController.offset - scrollController.offset -
(kToolbarHeight + MediaQuery (kToolbarHeight + MediaQuery.of(context).padding.top),
.of(context)
.padding
.top),
duration: Duration(milliseconds: 300), duration: Duration(milliseconds: 300),
curve: Curves.easeIn, curve: Curves.easeIn,
); );
} }
final GlobalKey inputKey = GlobalKey();
final TextEditingController commentTextController = TextEditingController();
contentHeight() { contentHeight() {
double contentHeight = MediaQuery double contentHeight = MediaQuery.of(context).size.height -
.of(context)
.size
.height -
kToolbarHeight - kToolbarHeight -
MediaQuery MediaQuery.of(context).padding.top -
.of(context)
.padding
.top -
160.h; 160.h;
if ((contentHeight - 60.h) > (128.h * memberList.length)) { if ((contentHeight - 60.h) > (128.h * memberList.length)) {
commentHeight = contentHeight - (128.h * memberList.length); commentHeight = contentHeight - (128.h * memberList.length);
@ -300,14 +360,14 @@ class _CommunityDetails extends State<CommunityDetails> with WidgetsBindingObser
Dio(), Dio(),
context: context, context: context,
token: sharedPreferences.getString("token"), token: sharedPreferences.getString("token"),
showLoading: false, showLoading: true,
); );
BaseData<PageInfo<MemberCommentList>> baseData = BaseData<PageInfo<MemberCommentList>> baseData =
await apiService.memberCommentList({ await apiService.memberCommentList({
"pageNum": 1, "pageNum": 1,
"pageSize": 100, "pageSize": 100,
"relationalId": businessId, "relationalId": businessId,
"relationalType":4, "relationalType": 4,
}).catchError((error) {}); }).catchError((error) {});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
commentTotal = baseData.data.size; commentTotal = baseData.data.size;

175
lib/community/community_list.dart

@ -24,16 +24,8 @@ class CommunityList extends StatefulWidget {
final Function exitFull; final Function exitFull;
final Function removalDynamic; final Function removalDynamic;
CommunityList( CommunityList(this.comments, this.userId, this.commentType,
this.comments, {this.isList = false, this.exitFull, this.removalDynamic});
this.userId,
this.commentType,{
this.isList = false,
this.exitFull,
this.removalDynamic
}
);
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
@ -88,39 +80,43 @@ class _CommunityList extends State<CommunityList> {
children: [ children: [
(widget.comments == null || widget.comments.length == 0) (widget.comments == null || widget.comments.length == 0)
? NoDataView( ? NoDataView(
src: widget.commentType == 1 ? "assets/image/dong_tai.webp" :"assets/image/guan_zhu.webp", src: widget.commentType == 1
isShowBtn: false, ? "assets/image/dong_tai.webp"
text:widget.commentType == 1 ? "目前暂无发布动态,要把开心的事讲出来哦~" :"目前暂无添加关注,可在推荐中关注自己喜欢的人哦~", : "assets/image/guan_zhu.webp",
fontSize: 16.sp, isShowBtn: false,
margin: EdgeInsets.only(top: 120.h,left: 60.w,right: 60.w), text: widget.commentType == 1
): ? "目前暂无发布动态,要把开心的事讲出来哦~"
ListView.builder( : "目前暂无添加关注,可在推荐中关注自己喜欢的人哦~",
padding: EdgeInsets.zero, fontSize: 16.sp,
itemCount: widget.comments.length, margin: EdgeInsets.only(top: 120.h, left: 60.w, right: 60.w),
scrollDirection: Axis.vertical, )
shrinkWrap: true, : ListView.builder(
physics: NeverScrollableScrollPhysics(), padding: EdgeInsets.zero,
itemBuilder: (context, position) { itemCount: widget.comments.length,
return GestureDetector( scrollDirection: Axis.vertical,
onTap: () { shrinkWrap: true,
Navigator.of(context) physics: NeverScrollableScrollPhysics(),
.pushNamed('/router/new_community_details', arguments: { itemBuilder: (context, position) {
"commentsId": widget.comments[position].id, return GestureDetector(
"userId":widget.userId, onTap: () {
// exitFull: () { Navigator.of(context).pushNamed(
// setState(() {}); '/router/new_community_details',
// }, arguments: {
}).then((value) { "commentsId": widget.comments[position].id,
widget.exitFull(); "userId": widget.userId,
setState(() { // exitFull: () {
}); // setState(() {});
}); // },
setState(() {}); }).then((value) {
}, widget.exitFull();
child: communityItem(widget.comments[position], position), setState(() {});
); });
}, setState(() {});
), },
child: communityItem(widget.comments[position], position),
);
},
),
], ],
)); ));
} }
@ -149,7 +145,7 @@ class _CommunityList extends State<CommunityList> {
fit: BoxFit.contain, fit: BoxFit.contain,
radius: BorderRadius.circular(2), radius: BorderRadius.circular(2),
width: MediaQuery.of(context).size.width / 1.5, width: MediaQuery.of(context).size.width / 1.5,
height: MediaQuery.of(context).size.width/1.5, height: MediaQuery.of(context).size.width / 1.5,
errorSrc: "assets/image/default_2_1.webp", errorSrc: "assets/image/default_2_1.webp",
fadeSrc: "assets/image/default_2_1.webp", fadeSrc: "assets/image/default_2_1.webp",
)), )),
@ -315,54 +311,55 @@ class _CommunityList extends State<CommunityList> {
), ),
), ),
if ((comments?.memberInfo?.mid ?? "") != (widget.userId)) if ((comments?.memberInfo?.mid ?? "") != (widget.userId))
GestureDetector( GestureDetector(
onTap: () { onTap: () {
setState(() { setState(() {
if (widget.commentType == 0) { if (widget.commentType == 0) {
comments.selfFollow = !(comments.selfFollow ?? false); comments.selfFollow =
_vipFollow(comments?.memberInfo?.mid,comments?.selfFollow ?? false); !(comments.selfFollow ?? false);
} else { _vipFollow(comments?.memberInfo?.mid,
showDeleteDialog(position); comments?.selfFollow ?? false);
} } else {
}); showDeleteDialog(position);
}, }
child: });
(widget.commentType == 0) ? },
Container( child: (widget.commentType == 0)
width: 56.w, ? Container(
height: 25.h, width: 56.w,
alignment: Alignment.center,
child: RoundButton(
height: 25.h, height: 25.h,
backgroup: (comments?.selfFollow ?? false) alignment: Alignment.center,
? Color(0xFFE6E6E6) child: RoundButton(
: Color(0xFF32A060), height: 25.h,
textColor: (comments?.selfFollow ?? false) backgroup: (comments?.selfFollow ?? false)
? Color(0xFF808080) ? Color(0xFFE6E6E6)
: Colors.white, : Color(0xFF32A060),
text: (comments?.selfFollow ?? false) textColor: (comments?.selfFollow ?? false)
? S.of(context).yiguanzhu
: S.of(context).guanzhu,
radius: 20,
icons: Icon(
(comments?.selfFollow ?? false)
? Icons.check
: Icons.add,
color: (comments?.selfFollow ?? false)
? Color(0xFF808080) ? Color(0xFF808080)
: Colors.white, : Colors.white,
size: 15, text: (comments?.selfFollow ?? false)
? S.of(context).yiguanzhu
: S.of(context).guanzhu,
radius: 20,
icons: Icon(
(comments?.selfFollow ?? false)
? Icons.check
: Icons.add,
color: (comments?.selfFollow ?? false)
? Color(0xFF808080)
: Colors.white,
size: 15,
),
))
: Padding(
padding: EdgeInsets.all(20),
child: Icon(
Icons.close,
color: Colors.black,
size: 16,
), ),
))
: Padding(
padding: EdgeInsets.all(20),
child: Icon(
Icons.close,
color: Colors.black,
size: 16,
), ),
), ),
),
], ],
), ),
SizedBox( SizedBox(
@ -457,7 +454,7 @@ class _CommunityList extends State<CommunityList> {
Expanded( Expanded(
child: InkWell( child: InkWell(
child: BorderText( child: BorderText(
text:S.of(context).quxiao, text: S.of(context).quxiao,
textColor: Color(0xFF32A060), textColor: Color(0xFF32A060),
fontSize: 16.sp, fontSize: 16.sp,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
@ -478,7 +475,7 @@ class _CommunityList extends State<CommunityList> {
Expanded( Expanded(
child: InkWell( child: InkWell(
child: RoundButton( child: RoundButton(
text:S.of(context).queding, text: S.of(context).queding,
textColor: Colors.white, textColor: Colors.white,
radius: 4, radius: 4,
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12),

1
lib/community/community_page.dart

@ -79,6 +79,7 @@ class _CommunityPage extends State<CommunityPage>
return Scaffold( return Scaffold(
appBar: MyAppBar( appBar: MyAppBar(
leading: false, leading: false,
centerTitle: true,
titleChild: PreferredSize( titleChild: PreferredSize(
preferredSize: Size( preferredSize: Size(
MediaQuery.of(context).size.width - 60.w, MediaQuery.of(context).size.width - 60.w,

585
lib/community/community_view/class_details.dart

@ -1,4 +1,5 @@
import 'dart:convert'; import 'dart:convert';
import 'dart:ui';
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
@ -53,11 +54,17 @@ class _ClassDetails extends State<ClassDetails> with WidgetsBindingObserver {
int chapterIndex = 0; int chapterIndex = 0;
double height = 0; double height = 0;
var isShowMore = false; var isShowMore = false;
bool emojiShowing = false;
static double keyboard_height=300;
double keyboard = -1;
bool needShowSmiley = false;
bool needHideSmiley = false;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
WidgetsBinding.instance.addObserver(this); WidgetsBinding.instance.addObserver(this);
commentFocus.addListener(_focusNodeListener);
courseDetails(widget.arguments["id"]); courseDetails(widget.arguments["id"]);
queryChapterList(widget.arguments["id"]); queryChapterList(widget.arguments["id"]);
} }
@ -70,6 +77,7 @@ class _ClassDetails extends State<ClassDetails> with WidgetsBindingObserver {
Dio(), Dio(),
context: context, context: context,
token: value.getString("token"), token: value.getString("token"),
showLoading: true
); );
} }
BaseData<List<Chapter>> baseData = BaseData<List<Chapter>> baseData =
@ -114,6 +122,7 @@ class _ClassDetails extends State<ClassDetails> with WidgetsBindingObserver {
if (isKeyBoardShow) { if (isKeyBoardShow) {
FocusScope.of(context).requestFocus(FocusNode()); FocusScope.of(context).requestFocus(FocusNode());
if (mounted) if (mounted)
if(!emojiShowing)
setState(() { setState(() {
hintText = S.current.liuxianinjingcaidepinglunba; hintText = S.current.liuxianinjingcaidepinglunba;
isKeyBoardShow = false; isKeyBoardShow = false;
@ -126,282 +135,364 @@ class _ClassDetails extends State<ClassDetails> with WidgetsBindingObserver {
}); });
} }
}); });
if (needShowSmiley && window.viewInsets.bottom <= 0.1) {
needShowSmiley = false;
setState(() {
emojiShowing = true;
});
}
if(needHideSmiley && window.viewInsets.bottom > 0.1) {
needHideSmiley = false;
setState(() {
emojiShowing = false;
});
}
}
void _focusNodeListener() {
/*if (_focusNode.hasFocus || _focusNode.consumeKeyboardToken()){
setState(() {
smileyPadGone = true;
});
}*/
}
_onTextFieldTap() {
if(emojiShowing) {
needHideSmiley = true;
}
}
_onSmileyTap() {
if(!emojiShowing && commentFocus.hasFocus && isKeyBoardShow) {
needShowSmiley = true;
commentFocus.unfocus();
} else {
setState(() {
emojiShowing = !emojiShowing;
isKeyBoardShow = emojiShowing;
});
}
}
@override
void dispose(){
WidgetsBinding.instance.removeObserver(this);
commentFocus.removeListener(_focusNodeListener);
super.dispose();
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
double h = MediaQuery.of(context).viewInsets.bottom;
if(h > 0 && keyboard <= 0) {
setState(() {
keyboard = h;
});
}
return AnnotatedRegion<SystemUiOverlayStyle>( return AnnotatedRegion<SystemUiOverlayStyle>(
value: SystemUiOverlayStyle.light, value: SystemUiOverlayStyle.light,
child: Material(child: Scaffold( child: Material(
body: GestureDetector( child: Scaffold(
behavior: HitTestBehavior.translucent, body: GestureDetector(
onTap: () { behavior: HitTestBehavior.translucent,
FocusScope.of(context).requestFocus(FocusNode()); onTap: () {
}, setState(() {
child:Container( emojiShowing = false;
// margin: EdgeInsets.only(top:25), isKeyBoardShow = emojiShowing;
child: Column( FocusScope.of(context).requestFocus(FocusNode());
children: [ });
Expanded( },
child: SingleChildScrollView( child: Container(
physics: BouncingScrollPhysics(), // margin: EdgeInsets.only(top:25),
child: Column( child: Column(
children: [ children: [
Container( Expanded(
child:Stack( child: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Column(
children: [ children: [
ClassDetailsVideo(key:videoKey,exitFull: (){setState(() {});},
coverImg: chapterList.length > chapterIndex
? chapterList[chapterIndex].content.coverImg
: "",isShowImg: this.isShowImg,
changeShowImg: (isShowImg){setState(() {
this.isShowImg = isShowImg;
});},heightFun: (height) {
this.height = height +
MediaQuery
.of(context)
.padding
.top +
kToolbarHeight +
24;
if (mounted) setState(() {});
},),
Container( Container(
margin: EdgeInsets.only( height: MediaQuery.of(context).size.width / 1.5,
top: 40.h, left: 16.w, right: 16.w), child: Stack(
decoration: BoxDecoration(
color: Colors.transparent,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
GestureDetector( ClassDetailsVideo(
child: Image.asset( key: videoKey,
"assets/image/integral_return.webp", exitFull: () {
width: 24, setState(() {});
height: 24, },
), coverImg:
onTap: () { chapterList.length > chapterIndex
Navigator.of(context).pop( ? chapterList[chapterIndex]
course != null ? course.viewers + 1 : 0); .content
.coverImg
: "",
isShowImg: this.isShowImg,
changeShowImg: (isShowImg) {
setState(() {
this.isShowImg = isShowImg;
});
},
heightFun: (height) {
this.height = height +
MediaQuery.of(context).padding.top +
kToolbarHeight +
24;
if (mounted) setState(() {});
}, },
), ),
], Container(
), margin: EdgeInsets.only(
), top: 40.h, left: 16.w, right: 16.w),
], decoration: BoxDecoration(
), color: Colors.transparent,
),
Container(
margin: EdgeInsets.only(bottom: 16.h),
padding: EdgeInsets.only(left: 16, top: 16, right: 10),
decoration: BoxDecoration(
color: Colors.white,
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 2),
blurRadius: 14,
spreadRadius: 0,
)
],
),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Container(
// height: 22.h,
padding:EdgeInsets.only(left:2,right:2),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(2),
border: Border.all(
width: 1,
color: Color(0xFFFF7A1A),
style: BorderStyle.solid,
),
),
child: Text(
(course?.tags != null &&
course.tags.length > 0)
? course.tags[0]
: "",
overflow:TextOverflow.ellipsis,
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFFFF7A1A),
), ),
), child: Row(
), mainAxisAlignment:
SizedBox( MainAxisAlignment.spaceBetween,
width: 6.w, crossAxisAlignment:
), CrossAxisAlignment.center,
Expanded( children: [
child: Text( GestureDetector(
course != null ? course.subject : "", child: Image.asset(
overflow: TextOverflow.ellipsis, "assets/image/integral_return.webp",
maxLines: 2, width: 24,
style: TextStyle( height: 24,
fontSize: 16.sp, ),
fontWeight: MyFontWeight.semi_bold, onTap: () {
color: Color(0xFF1A1A1A), Navigator.of(context).pop(
course != null
? course.viewers + 1
: 0);
},
),
],
), ),
), ),
flex: 1, ],
), ),
// GestureDetector(
// onTap: () {
// share();
// },
// child: Icon(
// Icons.share,
// size: 24,
// color: Colors.black,
// ),
// ),
// SizedBox(width: 15.w,),
],
),
SizedBox(
height: 10.h,
), ),
Padding( Container(
padding: EdgeInsets.only(right: 16), margin: EdgeInsets.only(bottom: 16.h),
child: Row( padding: EdgeInsets.only(
left: 16, top: 16, right: 10),
decoration: BoxDecoration(
color: Colors.white,
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 2),
blurRadius: 14,
spreadRadius: 0,
)
],
),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Expanded( Row(
child: Text( children: [
"${S.of(context).jiangshi}:${course != null ? course.author.name : ""}", Container(
overflow: TextOverflow.ellipsis, // height: 22.h,
maxLines: 2, padding: EdgeInsets.only(
style: TextStyle( left: 2, right: 2),
fontSize: 12.sp, alignment: Alignment.center,
fontWeight: MyFontWeight.regular, decoration: BoxDecoration(
color: Colors.black, borderRadius:
BorderRadius.circular(2),
border: Border.all(
width: 1,
color: Color(0xFFFF7A1A),
style: BorderStyle.solid,
),
), ),
)), child: Text(
Text( (course?.tags != null &&
"${S.of(context).bofangcishu}:", course.tags.length > 0)
style: TextStyle( ? course.tags[0]
fontSize: 12.sp, : "",
fontWeight: MyFontWeight.regular, overflow: TextOverflow.ellipsis,
color: Color(0xFF808080), style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFFFF7A1A),
),
),
),
SizedBox(
width: 6.w,
),
Expanded(
child: Text(
course != null
? course.subject
: "",
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle(
fontSize: 16.sp,
fontWeight:
MyFontWeight.semi_bold,
color: Color(0xFF1A1A1A),
),
),
flex: 1,
),
// GestureDetector(
// onTap: () {
// share();
// },
// child: Icon(
// Icons.share,
// size: 24,
// color: Colors.black,
// ),
// ),
// SizedBox(width: 15.w,),
],
),
SizedBox(
height: 10.h,
),
Padding(
padding: EdgeInsets.only(right: 16),
child: Row(
children: [
Expanded(
child: Text(
"${S.of(context).jiangshi}:${course != null ? course.author.name : ""}",
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Colors.black,
),
)),
Text(
"${S.of(context).bofangcishu}:",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF808080),
),
),
SizedBox(
width: 4,
),
Text(
course != null
? course.viewers.toString()
: "",
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF808080),
),
),
],
), ),
), ),
SizedBox( SizedBox(
width: 4, height: 10.h,
), ),
Text( Text(
course != null course != null ? course.introduce : "",
? course.viewers.toString() overflow: isShowMore
: "", ? TextOverflow.visible
overflow: TextOverflow.ellipsis, : TextOverflow.ellipsis,
maxLines: 2, maxLines: isShowMore ? 10 : 2,
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
height: 1.2.h,
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
color: Color(0xFF808080), color: Colors.black,
), ),
), ),
SizedBox(height: 3.h),
GestureDetector(
onTap: () {
setState(() {
isShowMore = !isShowMore;
});
},
child: Align(
alignment: Alignment.center,
child: Icon(
(isShowMore != null && !isShowMore)
? Icons.keyboard_arrow_down
: Icons.keyboard_arrow_up,
color: Colors.black,
size: 24,
),
),
),
SizedBox(height: 3.h),
], ],
), ),
), ),
SizedBox( anthology(),
height: 10.h, CommentList(
), commentKey,
Text( course?.likes ?? course?.likes ?? 0,
course != null ? course.introduce : "", widget.arguments["id"],
overflow: isShowMore 3,
? TextOverflow.visible isKeyBoardShow,
: TextOverflow.ellipsis, _reply,
maxLines: isShowMore ? 10 : 2, _delCommentTips,
style: TextStyle( 12.sp,
fontSize: 12.sp, requestApiFinish: (total) {
height: 1.2.h,
fontWeight: MyFontWeight.regular,
color: Colors.black,
),
),
SizedBox(height: 3.h),
GestureDetector(
onTap: () {
setState(() { setState(() {
isShowMore = !isShowMore; commentTotal = total;
}); });
}, },
child:Align( ),
alignment: Alignment.center, if (commentTotal == 0)
child: Icon( Container(
(isShowMore != null && !isShowMore) width: double.infinity,
? Icons.keyboard_arrow_down alignment: Alignment.topCenter,
: Icons.keyboard_arrow_up, margin: EdgeInsets.only(top: 40),
color: Colors.black, padding: EdgeInsets.all(22.h),
size: 24, child: Text(
S.of(context).zanwupinglun,
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.bold,
color: Color(0xFFA0A0A0),
),
), ),
), ),
),
SizedBox(height: 3.h),
], ],
), ),
), ),
anthology(), flex: 1,
CommentList( ),
commentKey,
course?.likes ?? course?.likes ?? 0, ///
widget.arguments["id"], InputComment(
3, inputKey,
isKeyBoardShow, hintText,
_reply, isKeyBoardShow,
_delCommentTips, keyboard_height,
12.sp, keyboard,
requestApiFinish: (total) { emojiShowing,
setState(() { commentFocus,
commentTotal = total; commentTextController,
}); _toComment,
}, _onSmileyTap,
), _onTextFieldTap,
if (commentTotal == 0) _queryMemberComment,
Container( _queryCourseLikes,
width: double.infinity, isLike: course?.selfLiked,
alignment: Alignment.topCenter, ),
margin: EdgeInsets.only(top: 40), ],
padding: EdgeInsets.all(22.h),
child: Text(
S.of(context).zanwupinglun,
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.bold,
color: Color(0xFFA0A0A0),
),
),
),
],
),
), ),
flex: 1, )),
), ),
/// ));
InputComment(
inputKey,
hintText,
isKeyBoardShow,
commentFocus,
commentTextController,
_toComment,
_queryMemberComment,
_queryCourseLikes,
isLike: course?.selfLiked,
),
],
),
)),
),)
);
} }
Widget anthology() { Widget anthology() {
@ -563,16 +654,16 @@ class _ClassDetails extends State<ClassDetails> with WidgetsBindingObserver {
share() async { share() async {
SSDKMap params = SSDKMap() SSDKMap params = SSDKMap()
..setGeneral( ..setGeneral(
course.subject != null course.subject != null ? course.subject : "",
? course.subject
: "",
course != null ? course.introduce : "", course != null ? course.introduce : "",
[ [
chapterList[chapterIndex].content.coverImg != null chapterList[chapterIndex].content.coverImg != null
? chapterList[chapterIndex].content.coverImg:"", ? chapterList[chapterIndex].content.coverImg
: "",
], ],
chapterList[chapterIndex].content.fileUrl != null chapterList[chapterIndex].content.fileUrl != null
? chapterList[chapterIndex].content.fileUrl:"", ? chapterList[chapterIndex].content.fileUrl
: "",
"", "",
buildShareUrl(), buildShareUrl(),
"", "",
@ -590,12 +681,12 @@ class _ClassDetails extends State<ClassDetails> with WidgetsBindingObserver {
if (platform == ShareSDKPlatforms.line) { if (platform == ShareSDKPlatforms.line) {
params.map["type"] = SSDKContentTypes.text.value; params.map["type"] = SSDKContentTypes.text.value;
params.map["text"] = params.map["text"] =
"${course.subject ?? ""} ${buildShareUrl()}"; "${course.subject ?? ""} ${buildShareUrl()}";
} }
SharesdkPlugin.share(platform, params, SharesdkPlugin.share(platform, params,
(state, userData, contentEntity, error) { (state, userData, contentEntity, error) {
print("share!$state"); print("share!$state");
}); });
}); });
}); });
} }

12
lib/community/community_view/class_details_video.dart

@ -138,16 +138,16 @@ class ClassDetailsVideoState extends State<ClassDetailsVideo> {
? Container( ? Container(
color: Colors.black, color: Colors.black,
width: width, width: width,
// height: width / 7 * 5, height:MediaQuery.of(context).size.width / 1.5,
height: height, // margin: EdgeInsets.only(top: MediaQuery.of(context).padding.top),
child: chewies = Chewie( child: chewies = Chewie(
controller: chewieAudioController, controller: chewieAudioController,
), ),
) )
: Container( : Container(
width: width, width: width,
// height:width / 7 * 5, height:MediaQuery.of(context).size.width / 1.5,
height: height, // margin: EdgeInsets.only(top: MediaQuery.of(context).padding.top),
)), )),
if (widget.isShowImg) if (widget.isShowImg)
GestureDetector( GestureDetector(
@ -160,8 +160,8 @@ class ClassDetailsVideoState extends State<ClassDetailsVideo> {
}, },
child: Container( child: Container(
width: width, width: width,
// height: width / 7 * 5, height: MediaQuery.of(context).size.width / 1.5,
height: height, // margin: EdgeInsets.only(top: MediaQuery.of(context).padding.top),
color: Colors.black, color: Colors.black,
child: Stack( child: Stack(
children: [ children: [

2
lib/community/community_view/class_list_view.dart

@ -217,7 +217,7 @@ class _ClassListView extends State<ClassListView> {
maxLines: 2, maxLines: 2,
style: TextStyle( style: TextStyle(
fontSize: 13.sp, fontSize: 13.sp,
height: 1.2.h, height: 1.5.h,
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,
color: Colors.black, color: Colors.black,
), ),

405
lib/community/community_view/community_dynamic.dart

@ -149,11 +149,28 @@ class _CommunityDynamic extends State<CommunityDynamic> {
} }
} }
goPersonalPage()async{ ////
await Navigator.of(context) _queryInformationLikes(isLikes) async {
.pushNamed('/router/personal_page', arguments: { if (apiService == null) {
"memberId": SharedPreferences value = await SharedPreferences.getInstance();
(widget.article.author == widget.userId) apiService = ApiService(
Dio(),
context: context,
token: value.getString("token"),
);
}
BaseData baseData = await apiService
.informationLikes(widget.article.id)
.catchError((onError) {});
if (baseData != null && baseData.isSuccess) {
widget.exitFull();
setState(() {});
}
}
goPersonalPage() async {
await Navigator.of(context).pushNamed('/router/personal_page', arguments: {
"memberId": (widget.article.author == widget.userId)
? "0" ? "0"
: widget.article.author, : widget.article.author,
}); });
@ -168,7 +185,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
margin: EdgeInsets.only(top: 2.h), margin: EdgeInsets.only(top: 2.h),
key: globalKey, key: globalKey,
alignment: Alignment.topCenter, alignment: Alignment.topCenter,
padding: EdgeInsets.only(left: 16.w,top: 16.h,right: 16.w), padding: EdgeInsets.only(left: 16.w, top: 16.h, right: 16.w),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
boxShadow: [ boxShadow: [
@ -209,7 +226,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
}, },
child: MImage( child: MImage(
(widget?.article?.authorHeadImg ?? (widget?.article?.authorHeadImg ??
"https://lmg.jj20.com/up/allimg/tx30/09041130358711081.jpg"), ""),
width: 44, width: 44,
height: 44, height: 44,
isCircle: true, isCircle: true,
@ -228,7 +245,10 @@ class _CommunityDynamic extends State<CommunityDynamic> {
Text( Text(
widget?.article?.authorName ?? "", widget?.article?.authorName ?? "",
style: TextStyle( style: TextStyle(
fontSize: MediaQuery.of(context).size.width >= 650 ? 12.sp :15.sp, fontSize:
MediaQuery.of(context).size.width >= 650
? 12.sp
: 15.sp,
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF1A1A1A), color: Color(0xFF1A1A1A),
), ),
@ -236,7 +256,10 @@ class _CommunityDynamic extends State<CommunityDynamic> {
Text( Text(
widget?.article?.createTime ?? "", widget?.article?.createTime ?? "",
style: TextStyle( style: TextStyle(
fontSize: MediaQuery.of(context).size.width >= 650 ? 10.sp :13.sp, fontSize:
MediaQuery.of(context).size.width >= 650
? 10.sp
: 13.sp,
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
color: Color(0xFF808080), color: Color(0xFF808080),
), ),
@ -301,52 +324,56 @@ class _CommunityDynamic extends State<CommunityDynamic> {
SizedBox( SizedBox(
height: 12.h, height: 12.h,
), ),
widget.isList ? Text( widget.isList
widget?.article?.mainTitle ?? "", ? Text(
maxLines:5, widget?.article?.mainTitle ?? "",
overflow: TextOverflow.ellipsis, maxLines: 5,
style: TextStyle( overflow: TextOverflow.ellipsis,
color: Color(0xFF1A1A1A), style: TextStyle(
fontWeight: MyFontWeight.regular, color: Color(0xFF1A1A1A),
fontSize: 15.sp, fontWeight: MyFontWeight.regular,
), fontSize: 15.sp,
) :Text( ),
widget?.article?.mainTitle ?? "", )
style: TextStyle( : Text(
color: Color(0xFF1A1A1A), widget?.article?.mainTitle ?? "",
fontWeight: MyFontWeight.regular, style: TextStyle(
fontSize: 15.sp, color: Color(0xFF1A1A1A),
), fontWeight: MyFontWeight.regular,
), fontSize: 15.sp,
),
),
buildMedia(widget?.article?.content), buildMedia(widget?.article?.content),
SizedBox( SizedBox(
height:8.h, height: 8.h,
), ),
if (widget.article.location != "") if (widget.article.location != "")
Padding(padding:EdgeInsets.only(bottom:7), Padding(
child: Row( padding: EdgeInsets.only(bottom: 7),
children: [ child: Row(
Icon( children: [
Icons.place, Icon(
size: 16, Icons.place,
color: Color(0xFFB3B2B2), size: 16,
), color: Color(0xFFB3B2B2),
SizedBox( ),
width: 2, SizedBox(
), width: 2,
Expanded( ),
child: Text( Expanded(
widget?.article?.location ?? "", child: Text(
overflow: TextOverflow.ellipsis, widget?.article?.location ?? "",
maxLines: 1, overflow: TextOverflow.ellipsis,
style: TextStyle( maxLines: 1,
fontSize: 12.sp, style: TextStyle(
fontWeight: MyFontWeight.medium, fontSize: 12.sp,
color: Color(0xFFB3B2B2), fontWeight: MyFontWeight.medium,
), color: Color(0xFFB3B2B2),
)), ),
], )),
),), ],
),
),
if (!widget.isDetails) if (!widget.isDetails)
SizedBox( SizedBox(
height: 5.h, height: 5.h,
@ -355,111 +382,124 @@ class _CommunityDynamic extends State<CommunityDynamic> {
Container( Container(
// padding: EdgeInsets.only(bottom: 16), // padding: EdgeInsets.only(bottom: 16),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Expanded( Expanded(
child: Container( child: Container(
padding: EdgeInsets.only(bottom: 16.h),
child:Row(
// mainAxisAlignment: MainAxisAlignment.center,
// crossAxisAlignment: CrossAxisAlignment.center,
children: [
SvgPicture.asset(
"assets/svg/liulanliang.svg",
width: 16,
height: 16,
),
SizedBox(
width: 5.w,
),
Text(
(widget.article != null)
? "${widget.article.viewers}"
: "",
style: TextStyle(
fontSize: 14.sp,
fontFamily: 'JDZhengHT',
fontWeight: MyFontWeight.regular,
color: Color(0xFF1A1A1A),
),
),
],
)),
),
Expanded(
child:Container(
padding: EdgeInsets.only(bottom: 16.h), padding: EdgeInsets.only(bottom: 16.h),
child:Row( child: Row(
// mainAxisAlignment: MainAxisAlignment.center, children: [
// crossAxisAlignment: CrossAxisAlignment.center, SvgPicture.asset(
children: [ "assets/svg/liulanliang.svg",
SvgPicture.asset( width: 16,
"assets/svg/pinglun.svg", height: 16,
width: 16, ),
height: 16, SizedBox(
), width: 5.w,
SizedBox( ),
width: 5.w, Text(
), (widget.article != null)
Text( ? "${widget.article.viewers}"
"${widget.article.comments ?? 0}", : "",
style: TextStyle( style: TextStyle(
fontSize: 14.sp, fontSize: 14.sp,
fontFamily: 'JDZhengHT', fontFamily: 'JDZhengHT',
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
color: Color(0xFF1A1A1A), color: Color(0xFF1A1A1A),
), ),
), ),
], ],
))), )),
Expanded( ),
child:Container( Expanded(
padding: EdgeInsets.only(bottom: 16.h), child: Container(
child:Row( padding: EdgeInsets.only(bottom: 16.h),
// mainAxisAlignment: MainAxisAlignment.center, child: Row(
// crossAxisAlignment: CrossAxisAlignment.center, children: [
children: [ SvgPicture.asset(
SvgPicture.asset( "assets/svg/pinglun.svg",
"assets/svg/xihuan.svg", width: 16,
width: 16, height: 16,
height: 16, ),
), SizedBox(
SizedBox( width: 5.w,
width: 5.w, ),
), Text(
Text( "${widget.article.comments ?? 0}",
"${widget.article.likes ?? 0}", style: TextStyle(
style: TextStyle( fontSize: 14.sp,
fontSize: 14.sp, fontFamily: 'JDZhengHT',
fontFamily: 'JDZhengHT', fontWeight: MyFontWeight.regular,
fontWeight: MyFontWeight.regular, color: Color(0xFF1A1A1A),
color: Color(0xFF1A1A1A), ),
), ),
), ],
], ))),
)),
),
if (widget?.article?.author != widget.userId ?? "")
Expanded( Expanded(
child: GestureDetector( child: GestureDetector(
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
onTap: () { onTap: () {
setState(() { setState(() {
choiceShowBottomSheet(); widget.article.liked =
}); !(widget.article.liked ?? false);
}, _queryInformationLikes(
child: Container( widget.article.liked ?? false);
padding: EdgeInsets.only(top:3.h,bottom: 16.h), });
alignment: Alignment.center, },
// color: Colors.red, child: Container(
child: Icon( padding: EdgeInsets.only(bottom: 16.h),
Icons.more_horiz, child: Row(
color: Colors.black, children: [
(widget.article.liked ?? false)
? Image.asset(
"assets/image/icon_like.webp",
width: 16,
height: 16,
)
: Image.asset(
"assets/image/icon_like_h.webp",
width: 16,
height: 16,
),
SizedBox(
width: 5.w,
), ),
))), Text(
], "${widget.article.likes ?? 0}",
),), style: TextStyle(
fontSize: 14.sp,
fontFamily: 'JDZhengHT',
fontWeight: MyFontWeight.regular,
color: Color(0xFF1A1A1A),
),
),
],
)),
)),
if ((widget?.article?.author != widget.userId ?? "") &&
widget.commentType == 0)
Expanded(
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
setState(() {
choiceShowBottomSheet();
});
},
child: Container(
padding:
EdgeInsets.only(top: 3.h, bottom: 16.h),
alignment: Alignment.center,
// color: Colors.red,
child: Icon(
Icons.more_horiz,
color: Colors.black,
),
))),
],
),
),
], ],
), ),
), ),
@ -794,14 +834,11 @@ class _CommunityDynamic extends State<CommunityDynamic> {
topLeft: const Radius.circular(25.0), topLeft: const Radius.circular(25.0),
topRight: const Radius.circular(25.0))), topRight: const Radius.circular(25.0))),
child: Container( child: Container(
width: 130.w,
height: 130.h, height: 130.h,
child: Column( child: Column(
children: [ children: [
SizedBox(
height: 10.h,
),
GestureDetector( GestureDetector(
behavior: HitTestBehavior.translucent,
onTap: () { onTap: () {
setState(() { setState(() {
Navigator.of(context).pop(); Navigator.of(context).pop();
@ -809,6 +846,9 @@ class _CommunityDynamic extends State<CommunityDynamic> {
}); });
}, },
child: Container( child: Container(
width: double.infinity,
margin: EdgeInsets.only(top: 10.h),
padding: EdgeInsets.symmetric(vertical: 5.h),
child: Row( child: Row(
children: [ children: [
SizedBox( SizedBox(
@ -841,37 +881,42 @@ class _CommunityDynamic extends State<CommunityDynamic> {
color: Color(0xFFF7F7F7), color: Color(0xFFF7F7F7),
), ),
GestureDetector( GestureDetector(
behavior: HitTestBehavior.translucent,
onTap: () { onTap: () {
setState(() { setState(() {
Navigator.of(context) Navigator.of(context)
.popAndPushNamed('/router/report_page',arguments: { .popAndPushNamed('/router/report_page', arguments: {
"userName":widget?.article?.authorName ?? "", "userName": widget?.article?.authorName ?? "",
"authorId":widget?.article?.author ?? "", "authorId": widget?.article?.author ?? "",
}); });
}); });
}, },
child: Row( child: Container(
children: [ width: double.infinity,
SizedBox( padding: EdgeInsets.symmetric(vertical: 5.h),
width: 4.w, child: Row(
), children: [
SvgPicture.asset( SizedBox(
"assets/svg/ju_b.svg", width: 4.w,
width: 20,
height: 20,
),
SizedBox(
width: 15.w,
),
Text(
S.of(context).jubaogaineirong,
style: TextStyle(
fontSize: 17.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF1A1A1A),
), ),
), SvgPicture.asset(
], "assets/svg/ju_b.svg",
width: 20,
height: 20,
),
SizedBox(
width: 15.w,
),
Text(
S.of(context).jubaogaineirong,
style: TextStyle(
fontSize: 17.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF1A1A1A),
),
),
],
),
)) ))
], ],
), ),

2
lib/community/community_view/home_class.dart

@ -67,7 +67,7 @@ class _HomeClass extends State<HomeClass> {
), ),
), ),
Container( Container(
height: 195, height: 195.h,
margin: EdgeInsets.only(top: 10.h), margin: EdgeInsets.only(top: 10.h),
child: ListView.builder( child: ListView.builder(
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,

64
lib/community/new_community_details.dart

@ -1,3 +1,4 @@
import 'dart:ui';
import 'dart:convert'; import 'dart:convert';
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
@ -55,6 +56,11 @@ class _NewCommunityDetails extends State<NewCommunityDetails> with WidgetsBindin
Article article; Article article;
String commentsId; String commentsId;
String userId; String userId;
bool emojiShowing =false;
static double keyboard_height=300;
double keyboard = -1;
bool needShowSmiley = false;
bool needHideSmiley = false;
@override @override
void initState() { void initState() {
@ -62,6 +68,7 @@ class _NewCommunityDetails extends State<NewCommunityDetails> with WidgetsBindin
commentsId = widget.arguments["commentsId"]; commentsId = widget.arguments["commentsId"];
userId = widget.arguments["userId"]; userId = widget.arguments["userId"];
WidgetsBinding.instance.addObserver(this); WidgetsBinding.instance.addObserver(this);
commentFocus.addListener(_focusNodeListener);
queryDetails(commentsId); queryDetails(commentsId);
} }
@ -105,6 +112,7 @@ class _NewCommunityDetails extends State<NewCommunityDetails> with WidgetsBindin
if (isKeyBoardShow) { if (isKeyBoardShow) {
FocusScope.of(context).requestFocus(FocusNode()); FocusScope.of(context).requestFocus(FocusNode());
if (mounted) if (mounted)
if(!emojiShowing)
setState(() { setState(() {
hintText = S.current.liuxianinjingcaidepinglunba; hintText = S.current.liuxianinjingcaidepinglunba;
isKeyBoardShow = false; isKeyBoardShow = false;
@ -117,10 +125,61 @@ class _NewCommunityDetails extends State<NewCommunityDetails> with WidgetsBindin
}); });
} }
}); });
if (needShowSmiley && window.viewInsets.bottom <= 0.1) {
needShowSmiley = false;
setState(() {
emojiShowing = true;
});
}
if(needHideSmiley && window.viewInsets.bottom > 0.1) {
needHideSmiley = false;
setState(() {
emojiShowing = false;
});
}
}
void _focusNodeListener() {
/*if (_focusNode.hasFocus || _focusNode.consumeKeyboardToken()){
setState(() {
smileyPadGone = true;
});
}*/
}
_onTextFieldTap() {
if(emojiShowing) {
needHideSmiley = true;
}
}
_onSmileyTap() {
if(!emojiShowing && commentFocus.hasFocus && isKeyBoardShow) {
needShowSmiley = true;
commentFocus.unfocus();
} else {
setState(() {
emojiShowing = !emojiShowing;
isKeyBoardShow = emojiShowing;
});
}
}
@override
void dispose(){
WidgetsBinding.instance.removeObserver(this);
commentFocus.removeListener(_focusNodeListener);
super.dispose();
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
double h = MediaQuery.of(context).viewInsets.bottom;
if(h > 0 && keyboard <h) {
setState(() {
keyboard = h;
});
}
return WillPopScope( return WillPopScope(
onWillPop: () async { onWillPop: () async {
Navigator.of(context).pop(true); Navigator.of(context).pop(true);
@ -312,9 +371,14 @@ class _NewCommunityDetails extends State<NewCommunityDetails> with WidgetsBindin
inputKey, inputKey,
hintText, hintText,
isKeyBoardShow, isKeyBoardShow,
keyboard_height,
keyboard,
emojiShowing,
commentFocus, commentFocus,
commentTextController, commentTextController,
_toComment, _toComment,
_onSmileyTap,
_onTextFieldTap,
_queryMemberComment, _queryMemberComment,
_queryInformationLikes, _queryInformationLikes,
isLike: article?.liked ?? false, isLike: article?.liked ?? false,

72
lib/community/photo_view_gallery_screen.dart

@ -42,41 +42,47 @@ class _PhotoViewGalleryScreenState extends State<PhotoViewGalleryScreen> {
left: 0, left: 0,
bottom: 0, bottom: 0,
right: 0, right: 0,
child: Container( child: GestureDetector(
child: PhotoViewGallery.builder( onTap: (){
scrollPhysics: const BouncingScrollPhysics(), Navigator.of(context).pop();
builder: (BuildContext context, int index) { },
return PhotoViewGalleryPageOptions( child: Container(
imageProvider: NetworkToFileImage( color: Colors.black,
url: widget.images[index], child: PhotoViewGallery.builder(
file: fileFromDocsDir(widget.images[index].toString() scrollPhysics: const BouncingScrollPhysics(),
.replaceAll("https://pos.upload.gznl.top/", "").replaceAll("/", "")), builder: (BuildContext context, int index) {
debug: true, return PhotoViewGalleryPageOptions(
), imageProvider: NetworkToFileImage(
); url: widget.images[index],
}, file: fileFromDocsDir(widget.images[index].toString()
itemCount: widget.images.length, .replaceAll("https://pos.upload.gznl.top/", "").replaceAll("/", "")),
loadingBuilder: (context, progress) => Center( debug: true,
child: Container( ),
width: 20.0, );
height: 20.0, },
child: CircularProgressIndicator( itemCount: widget.images.length,
value: progress == null loadingBuilder: (context, progress) => Center(
? null child: Container(
: progress.cumulativeBytesLoaded / width: 20.0,
progress.expectedTotalBytes, height: 20.0,
child: CircularProgressIndicator(
value: progress == null
? null
: progress.cumulativeBytesLoaded /
progress.expectedTotalBytes,
),
), ),
), ),
), backgroundDecoration: null,
backgroundDecoration: null, pageController: widget.controller,
pageController: widget.controller, enableRotation: false,
enableRotation: false, onPageChanged: (index){
onPageChanged: (index){ setState(() {
setState(() { currentIndex=index;
currentIndex=index; });
}); },
}, )
) ),
), ),
), ),
Positioned(//index显示 Positioned(//index显示

8
lib/generated/intl/messages_en.dart

@ -293,6 +293,7 @@ class MessageLookup extends MessageLookupByLibrary {
"huixiangrenyimendian" : MessageLookupByLibrary.simpleMessage("适用于:一心回乡任意门店"), "huixiangrenyimendian" : MessageLookupByLibrary.simpleMessage("适用于:一心回乡任意门店"),
"huixiangtoutiao" : MessageLookupByLibrary.simpleMessage("回乡头条"), "huixiangtoutiao" : MessageLookupByLibrary.simpleMessage("回乡头条"),
"huixiangvipkazhuanxiang" : MessageLookupByLibrary.simpleMessage("回乡VIP卡专享权益"), "huixiangvipkazhuanxiang" : MessageLookupByLibrary.simpleMessage("回乡VIP卡专享权益"),
"huixiangxieyi" : MessageLookupByLibrary.simpleMessage("回乡VIP会员卡规则协议"),
"huiyuandengji" : MessageLookupByLibrary.simpleMessage("会员等级"), "huiyuandengji" : MessageLookupByLibrary.simpleMessage("会员等级"),
"huiyuandengjishuoming" : MessageLookupByLibrary.simpleMessage("会员等级说明"), "huiyuandengjishuoming" : MessageLookupByLibrary.simpleMessage("会员等级说明"),
"huiyuanguize" : MessageLookupByLibrary.simpleMessage("会员规则说明"), "huiyuanguize" : MessageLookupByLibrary.simpleMessage("会员规则说明"),
@ -317,6 +318,7 @@ class MessageLookup extends MessageLookupByLibrary {
"huodongyue_" : m11, "huodongyue_" : m11,
"huodongzixun" : MessageLookupByLibrary.simpleMessage("活动资讯"), "huodongzixun" : MessageLookupByLibrary.simpleMessage("活动资讯"),
"huopinyisongda" : MessageLookupByLibrary.simpleMessage("货品已送达"), "huopinyisongda" : MessageLookupByLibrary.simpleMessage("货品已送达"),
"huozan" : MessageLookupByLibrary.simpleMessage("获赞"),
"input_code" : MessageLookupByLibrary.simpleMessage("手机验证码"), "input_code" : MessageLookupByLibrary.simpleMessage("手机验证码"),
"input_code_hide" : MessageLookupByLibrary.simpleMessage("请输入验证码"), "input_code_hide" : MessageLookupByLibrary.simpleMessage("请输入验证码"),
"input_invite_code_hide" : MessageLookupByLibrary.simpleMessage("填写邀请码"), "input_invite_code_hide" : MessageLookupByLibrary.simpleMessage("填写邀请码"),
@ -389,6 +391,7 @@ class MessageLookup extends MessageLookupByLibrary {
"lijikaitong" : MessageLookupByLibrary.simpleMessage("立即开通"), "lijikaitong" : MessageLookupByLibrary.simpleMessage("立即开通"),
"lijilingqu" : MessageLookupByLibrary.simpleMessage("立即领取"), "lijilingqu" : MessageLookupByLibrary.simpleMessage("立即领取"),
"lijiqiandao" : MessageLookupByLibrary.simpleMessage("立即签到"), "lijiqiandao" : MessageLookupByLibrary.simpleMessage("立即签到"),
"lijishiyong" : MessageLookupByLibrary.simpleMessage("立即使用"),
"lijitiyan" : MessageLookupByLibrary.simpleMessage("立即体验"), "lijitiyan" : MessageLookupByLibrary.simpleMessage("立即体验"),
"likekaitong" : MessageLookupByLibrary.simpleMessage("立刻开通"), "likekaitong" : MessageLookupByLibrary.simpleMessage("立刻开通"),
"likexufei" : MessageLookupByLibrary.simpleMessage("立刻续费"), "likexufei" : MessageLookupByLibrary.simpleMessage("立刻续费"),
@ -406,6 +409,7 @@ class MessageLookup extends MessageLookupByLibrary {
"login_splash" : MessageLookupByLibrary.simpleMessage("欢迎来到一心回乡"), "login_splash" : MessageLookupByLibrary.simpleMessage("欢迎来到一心回乡"),
"lvbiyue" : MessageLookupByLibrary.simpleMessage("绿币余额"), "lvbiyue" : MessageLookupByLibrary.simpleMessage("绿币余额"),
"lvbiyue_" : m18, "lvbiyue_" : m18,
"lvbizhifu" : MessageLookupByLibrary.simpleMessage("绿币支付"),
"main_menu1" : MessageLookupByLibrary.simpleMessage("净弼"), "main_menu1" : MessageLookupByLibrary.simpleMessage("净弼"),
"main_menu2" : MessageLookupByLibrary.simpleMessage("联盟"), "main_menu2" : MessageLookupByLibrary.simpleMessage("联盟"),
"main_menu3" : MessageLookupByLibrary.simpleMessage("有机生活"), "main_menu3" : MessageLookupByLibrary.simpleMessage("有机生活"),
@ -420,6 +424,7 @@ class MessageLookup extends MessageLookupByLibrary {
"meizhousangengxin" : MessageLookupByLibrary.simpleMessage("每周三更新"), "meizhousangengxin" : MessageLookupByLibrary.simpleMessage("每周三更新"),
"meizhousanquanbao" : MessageLookupByLibrary.simpleMessage("每周三更新劵包"), "meizhousanquanbao" : MessageLookupByLibrary.simpleMessage("每周三更新劵包"),
"mendianxuanzhe" : MessageLookupByLibrary.simpleMessage("门店选择"), "mendianxuanzhe" : MessageLookupByLibrary.simpleMessage("门店选择"),
"mendianyue" : MessageLookupByLibrary.simpleMessage("门店余额"),
"menpaihao" : MessageLookupByLibrary.simpleMessage("请输入门牌号"), "menpaihao" : MessageLookupByLibrary.simpleMessage("请输入门牌号"),
"mi" : m21, "mi" : m21,
"mingxi" : MessageLookupByLibrary.simpleMessage("明细"), "mingxi" : MessageLookupByLibrary.simpleMessage("明细"),
@ -565,6 +570,7 @@ class MessageLookup extends MessageLookupByLibrary {
"shiyongriqi" : MessageLookupByLibrary.simpleMessage("使用日期"), "shiyongriqi" : MessageLookupByLibrary.simpleMessage("使用日期"),
"shiyongshuoming" : MessageLookupByLibrary.simpleMessage("使用说明"), "shiyongshuoming" : MessageLookupByLibrary.simpleMessage("使用说明"),
"shiyongtiaojian" : MessageLookupByLibrary.simpleMessage("使用条件"), "shiyongtiaojian" : MessageLookupByLibrary.simpleMessage("使用条件"),
"shiyongxiangqing" : MessageLookupByLibrary.simpleMessage("使用详情"),
"shouhuodi" : MessageLookupByLibrary.simpleMessage("收货地址"), "shouhuodi" : MessageLookupByLibrary.simpleMessage("收货地址"),
"shouhuodizhi" : MessageLookupByLibrary.simpleMessage("请输入详细收货地址"), "shouhuodizhi" : MessageLookupByLibrary.simpleMessage("请输入详细收货地址"),
"shouhuodizhi1" : MessageLookupByLibrary.simpleMessage("收货地址"), "shouhuodizhi1" : MessageLookupByLibrary.simpleMessage("收货地址"),
@ -607,6 +613,7 @@ class MessageLookup extends MessageLookupByLibrary {
"wancheng" : MessageLookupByLibrary.simpleMessage("完成"), "wancheng" : MessageLookupByLibrary.simpleMessage("完成"),
"wancheng_" : m32, "wancheng_" : m32,
"wanchengyicixiadan" : MessageLookupByLibrary.simpleMessage("完成一次下单"), "wanchengyicixiadan" : MessageLookupByLibrary.simpleMessage("完成一次下单"),
"wangjimima" : MessageLookupByLibrary.simpleMessage("忘记密码"),
"wanjiankang" : MessageLookupByLibrary.simpleMessage("玩健康"), "wanjiankang" : MessageLookupByLibrary.simpleMessage("玩健康"),
"wanshanshengrixinxi_nl" : MessageLookupByLibrary.simpleMessage("完善生日信息后自动生成"), "wanshanshengrixinxi_nl" : MessageLookupByLibrary.simpleMessage("完善生日信息后自动生成"),
"wanshanshengrixinxi_yhq" : MessageLookupByLibrary.simpleMessage("完善生日信息得专属优惠劵"), "wanshanshengrixinxi_yhq" : MessageLookupByLibrary.simpleMessage("完善生日信息得专属优惠劵"),
@ -676,6 +683,7 @@ class MessageLookup extends MessageLookupByLibrary {
"xiugaiyonghuming" : MessageLookupByLibrary.simpleMessage("修改用户名"), "xiugaiyonghuming" : MessageLookupByLibrary.simpleMessage("修改用户名"),
"xuanguige" : MessageLookupByLibrary.simpleMessage("选规格"), "xuanguige" : MessageLookupByLibrary.simpleMessage("选规格"),
"xuanji" : MessageLookupByLibrary.simpleMessage("选集"), "xuanji" : MessageLookupByLibrary.simpleMessage("选集"),
"xuanzeshangpinlingqufangshi" : MessageLookupByLibrary.simpleMessage("请选择商品的领取方式"),
"xuefeihuiyuan" : MessageLookupByLibrary.simpleMessage("续费会员"), "xuefeihuiyuan" : MessageLookupByLibrary.simpleMessage("续费会员"),
"xuexijiankang" : MessageLookupByLibrary.simpleMessage("学习健康"), "xuexijiankang" : MessageLookupByLibrary.simpleMessage("学习健康"),
"xufeihuixiangVIP" : MessageLookupByLibrary.simpleMessage("续费回乡VIP"), "xufeihuixiangVIP" : MessageLookupByLibrary.simpleMessage("续费回乡VIP"),

12
lib/generated/intl/messages_en_US.dart

@ -293,6 +293,7 @@ class MessageLookup extends MessageLookupByLibrary {
"huixiangrenyimendian" : MessageLookupByLibrary.simpleMessage("For:Any store dedicated to returning home"), "huixiangrenyimendian" : MessageLookupByLibrary.simpleMessage("For:Any store dedicated to returning home"),
"huixiangtoutiao" : MessageLookupByLibrary.simpleMessage("Homecoming Headlines"), "huixiangtoutiao" : MessageLookupByLibrary.simpleMessage("Homecoming Headlines"),
"huixiangvipkazhuanxiang" : MessageLookupByLibrary.simpleMessage("Home Return VIP Card Exclusive Rights"), "huixiangvipkazhuanxiang" : MessageLookupByLibrary.simpleMessage("Home Return VIP Card Exclusive Rights"),
"huixiangxieyi" : MessageLookupByLibrary.simpleMessage("Homecoming VIP Membership Card Rules Agreement"),
"huiyuandengji" : MessageLookupByLibrary.simpleMessage("Membership Level"), "huiyuandengji" : MessageLookupByLibrary.simpleMessage("Membership Level"),
"huiyuandengjishuoming" : MessageLookupByLibrary.simpleMessage("Member Level Description"), "huiyuandengjishuoming" : MessageLookupByLibrary.simpleMessage("Member Level Description"),
"huiyuanguize" : MessageLookupByLibrary.simpleMessage("Member Rules Description"), "huiyuanguize" : MessageLookupByLibrary.simpleMessage("Member Rules Description"),
@ -317,6 +318,7 @@ class MessageLookup extends MessageLookupByLibrary {
"huodongyue_" : m11, "huodongyue_" : m11,
"huodongzixun" : MessageLookupByLibrary.simpleMessage("Activity information"), "huodongzixun" : MessageLookupByLibrary.simpleMessage("Activity information"),
"huopinyisongda" : MessageLookupByLibrary.simpleMessage("The goods have been delivered"), "huopinyisongda" : MessageLookupByLibrary.simpleMessage("The goods have been delivered"),
"huozan" : MessageLookupByLibrary.simpleMessage("liked"),
"input_code" : MessageLookupByLibrary.simpleMessage("Mobile phone verification code"), "input_code" : MessageLookupByLibrary.simpleMessage("Mobile phone verification code"),
"input_code_hide" : MessageLookupByLibrary.simpleMessage("Please enter the verification code"), "input_code_hide" : MessageLookupByLibrary.simpleMessage("Please enter the verification code"),
"input_invite_code_hide" : MessageLookupByLibrary.simpleMessage("Fill in the invitation code"), "input_invite_code_hide" : MessageLookupByLibrary.simpleMessage("Fill in the invitation code"),
@ -389,6 +391,7 @@ class MessageLookup extends MessageLookupByLibrary {
"lijikaitong" : MessageLookupByLibrary.simpleMessage("Open now"), "lijikaitong" : MessageLookupByLibrary.simpleMessage("Open now"),
"lijilingqu" : MessageLookupByLibrary.simpleMessage("Get it now"), "lijilingqu" : MessageLookupByLibrary.simpleMessage("Get it now"),
"lijiqiandao" : MessageLookupByLibrary.simpleMessage("Sign in immediately"), "lijiqiandao" : MessageLookupByLibrary.simpleMessage("Sign in immediately"),
"lijishiyong" : MessageLookupByLibrary.simpleMessage("Use Now"),
"lijitiyan" : MessageLookupByLibrary.simpleMessage("Experience Now"), "lijitiyan" : MessageLookupByLibrary.simpleMessage("Experience Now"),
"likekaitong" : MessageLookupByLibrary.simpleMessage("Open now"), "likekaitong" : MessageLookupByLibrary.simpleMessage("Open now"),
"likexufei" : MessageLookupByLibrary.simpleMessage("Renew now"), "likexufei" : MessageLookupByLibrary.simpleMessage("Renew now"),
@ -406,6 +409,7 @@ class MessageLookup extends MessageLookupByLibrary {
"login_splash" : MessageLookupByLibrary.simpleMessage("Welcome Back Home"), "login_splash" : MessageLookupByLibrary.simpleMessage("Welcome Back Home"),
"lvbiyue" : MessageLookupByLibrary.simpleMessage("balance of green currency"), "lvbiyue" : MessageLookupByLibrary.simpleMessage("balance of green currency"),
"lvbiyue_" : m18, "lvbiyue_" : m18,
"lvbizhifu" : MessageLookupByLibrary.simpleMessage("green payment"),
"main_menu1" : MessageLookupByLibrary.simpleMessage("Jing Bi"), "main_menu1" : MessageLookupByLibrary.simpleMessage("Jing Bi"),
"main_menu2" : MessageLookupByLibrary.simpleMessage("Union"), "main_menu2" : MessageLookupByLibrary.simpleMessage("Union"),
"main_menu3" : MessageLookupByLibrary.simpleMessage("Organic Life"), "main_menu3" : MessageLookupByLibrary.simpleMessage("Organic Life"),
@ -420,6 +424,7 @@ class MessageLookup extends MessageLookupByLibrary {
"meizhousangengxin" : MessageLookupByLibrary.simpleMessage("updated every Wednesday"), "meizhousangengxin" : MessageLookupByLibrary.simpleMessage("updated every Wednesday"),
"meizhousanquanbao" : MessageLookupByLibrary.simpleMessage("Wednesday renewal coupon"), "meizhousanquanbao" : MessageLookupByLibrary.simpleMessage("Wednesday renewal coupon"),
"mendianxuanzhe" : MessageLookupByLibrary.simpleMessage("Store Selection"), "mendianxuanzhe" : MessageLookupByLibrary.simpleMessage("Store Selection"),
"mendianyue" : MessageLookupByLibrary.simpleMessage("store balance"),
"menpaihao" : MessageLookupByLibrary.simpleMessage("Please enter the house number"), "menpaihao" : MessageLookupByLibrary.simpleMessage("Please enter the house number"),
"mi" : m21, "mi" : m21,
"mingxi" : MessageLookupByLibrary.simpleMessage("Details"), "mingxi" : MessageLookupByLibrary.simpleMessage("Details"),
@ -565,6 +570,7 @@ class MessageLookup extends MessageLookupByLibrary {
"shiyongriqi" : MessageLookupByLibrary.simpleMessage("Use Date"), "shiyongriqi" : MessageLookupByLibrary.simpleMessage("Use Date"),
"shiyongshuoming" : MessageLookupByLibrary.simpleMessage("Instructions for Use"), "shiyongshuoming" : MessageLookupByLibrary.simpleMessage("Instructions for Use"),
"shiyongtiaojian" : MessageLookupByLibrary.simpleMessage("Use Conditions"), "shiyongtiaojian" : MessageLookupByLibrary.simpleMessage("Use Conditions"),
"shiyongxiangqing" : MessageLookupByLibrary.simpleMessage("Use Details"),
"shouhuodi" : MessageLookupByLibrary.simpleMessage("Ship To Address"), "shouhuodi" : MessageLookupByLibrary.simpleMessage("Ship To Address"),
"shouhuodizhi" : MessageLookupByLibrary.simpleMessage("Please enter the detailed receiving address"), "shouhuodizhi" : MessageLookupByLibrary.simpleMessage("Please enter the detailed receiving address"),
"shouhuodizhi1" : MessageLookupByLibrary.simpleMessage("Delivery address"), "shouhuodizhi1" : MessageLookupByLibrary.simpleMessage("Delivery address"),
@ -607,6 +613,7 @@ class MessageLookup extends MessageLookupByLibrary {
"wancheng" : MessageLookupByLibrary.simpleMessage("finish"), "wancheng" : MessageLookupByLibrary.simpleMessage("finish"),
"wancheng_" : m32, "wancheng_" : m32,
"wanchengyicixiadan" : MessageLookupByLibrary.simpleMessage("Place an order once"), "wanchengyicixiadan" : MessageLookupByLibrary.simpleMessage("Place an order once"),
"wangjimima" : MessageLookupByLibrary.simpleMessage("Forgot password"),
"wanjiankang" : MessageLookupByLibrary.simpleMessage("Play healthy"), "wanjiankang" : MessageLookupByLibrary.simpleMessage("Play healthy"),
"wanshanshengrixinxi_nl" : MessageLookupByLibrary.simpleMessage("Automatically generated after improving birthday information"), "wanshanshengrixinxi_nl" : MessageLookupByLibrary.simpleMessage("Automatically generated after improving birthday information"),
"wanshanshengrixinxi_yhq" : MessageLookupByLibrary.simpleMessage("Exclusive coupon for improving birthday information"), "wanshanshengrixinxi_yhq" : MessageLookupByLibrary.simpleMessage("Exclusive coupon for improving birthday information"),
@ -676,6 +683,7 @@ class MessageLookup extends MessageLookupByLibrary {
"xiugaiyonghuming" : MessageLookupByLibrary.simpleMessage("Modify User Name"), "xiugaiyonghuming" : MessageLookupByLibrary.simpleMessage("Modify User Name"),
"xuanguige" : MessageLookupByLibrary.simpleMessage("Select specs"), "xuanguige" : MessageLookupByLibrary.simpleMessage("Select specs"),
"xuanji" : MessageLookupByLibrary.simpleMessage("Selection"), "xuanji" : MessageLookupByLibrary.simpleMessage("Selection"),
"xuanzeshangpinlingqufangshi" : MessageLookupByLibrary.simpleMessage("Please select the picking method of goods"),
"xuefeihuiyuan" : MessageLookupByLibrary.simpleMessage("Renewal member"), "xuefeihuiyuan" : MessageLookupByLibrary.simpleMessage("Renewal member"),
"xuexijiankang" : MessageLookupByLibrary.simpleMessage("Learning Health"), "xuexijiankang" : MessageLookupByLibrary.simpleMessage("Learning Health"),
"xufeihuixiangVIP" : MessageLookupByLibrary.simpleMessage("Renewal Home VIP"), "xufeihuixiangVIP" : MessageLookupByLibrary.simpleMessage("Renewal Home VIP"),
@ -751,8 +759,8 @@ class MessageLookup extends MessageLookupByLibrary {
"zaituzhong" : MessageLookupByLibrary.simpleMessage("In transit"), "zaituzhong" : MessageLookupByLibrary.simpleMessage("In transit"),
"zaixiankefu" : MessageLookupByLibrary.simpleMessage("Online Customer Service"), "zaixiankefu" : MessageLookupByLibrary.simpleMessage("Online Customer Service"),
"zanbuzhichixianshangdiancan" : MessageLookupByLibrary.simpleMessage("Online ordering is not supported temporarily"), "zanbuzhichixianshangdiancan" : MessageLookupByLibrary.simpleMessage("Online ordering is not supported temporarily"),
"zanweijiesuo" : MessageLookupByLibrary.simpleMessage("Not yet unlocked"), "zanweijiesuo" : MessageLookupByLibrary.simpleMessage("Not unlocked"),
"zanweikaifang" : MessageLookupByLibrary.simpleMessage("Not yet open"), "zanweikaifang" : MessageLookupByLibrary.simpleMessage("Not open"),
"zanweikaitong" : MessageLookupByLibrary.simpleMessage("Not yet open"), "zanweikaitong" : MessageLookupByLibrary.simpleMessage("Not yet open"),
"zanwupinglun" : MessageLookupByLibrary.simpleMessage("No comment, please comment"), "zanwupinglun" : MessageLookupByLibrary.simpleMessage("No comment, please comment"),
"zanwuxianshangjindian" : MessageLookupByLibrary.simpleMessage("Temporary wireless shopping"), "zanwuxianshangjindian" : MessageLookupByLibrary.simpleMessage("Temporary wireless shopping"),

8
lib/generated/intl/messages_zh_CN.dart

@ -293,6 +293,7 @@ class MessageLookup extends MessageLookupByLibrary {
"huixiangrenyimendian" : MessageLookupByLibrary.simpleMessage("适用于:一心回乡任意门店"), "huixiangrenyimendian" : MessageLookupByLibrary.simpleMessage("适用于:一心回乡任意门店"),
"huixiangtoutiao" : MessageLookupByLibrary.simpleMessage("回乡头条"), "huixiangtoutiao" : MessageLookupByLibrary.simpleMessage("回乡头条"),
"huixiangvipkazhuanxiang" : MessageLookupByLibrary.simpleMessage("回乡VIP卡专享权益"), "huixiangvipkazhuanxiang" : MessageLookupByLibrary.simpleMessage("回乡VIP卡专享权益"),
"huixiangxieyi" : MessageLookupByLibrary.simpleMessage("回乡VIP会员卡规则协议"),
"huiyuandengji" : MessageLookupByLibrary.simpleMessage("会员等级"), "huiyuandengji" : MessageLookupByLibrary.simpleMessage("会员等级"),
"huiyuandengjishuoming" : MessageLookupByLibrary.simpleMessage("会员等级说明"), "huiyuandengjishuoming" : MessageLookupByLibrary.simpleMessage("会员等级说明"),
"huiyuanguize" : MessageLookupByLibrary.simpleMessage("会员规则说明"), "huiyuanguize" : MessageLookupByLibrary.simpleMessage("会员规则说明"),
@ -317,6 +318,7 @@ class MessageLookup extends MessageLookupByLibrary {
"huodongyue_" : m11, "huodongyue_" : m11,
"huodongzixun" : MessageLookupByLibrary.simpleMessage("活动资讯"), "huodongzixun" : MessageLookupByLibrary.simpleMessage("活动资讯"),
"huopinyisongda" : MessageLookupByLibrary.simpleMessage("货品已送达"), "huopinyisongda" : MessageLookupByLibrary.simpleMessage("货品已送达"),
"huozan" : MessageLookupByLibrary.simpleMessage("获赞"),
"input_code" : MessageLookupByLibrary.simpleMessage("手机验证码"), "input_code" : MessageLookupByLibrary.simpleMessage("手机验证码"),
"input_code_hide" : MessageLookupByLibrary.simpleMessage("请输入验证码"), "input_code_hide" : MessageLookupByLibrary.simpleMessage("请输入验证码"),
"input_invite_code_hide" : MessageLookupByLibrary.simpleMessage("填写邀请码"), "input_invite_code_hide" : MessageLookupByLibrary.simpleMessage("填写邀请码"),
@ -389,6 +391,7 @@ class MessageLookup extends MessageLookupByLibrary {
"lijikaitong" : MessageLookupByLibrary.simpleMessage("立即开通"), "lijikaitong" : MessageLookupByLibrary.simpleMessage("立即开通"),
"lijilingqu" : MessageLookupByLibrary.simpleMessage("立即领取"), "lijilingqu" : MessageLookupByLibrary.simpleMessage("立即领取"),
"lijiqiandao" : MessageLookupByLibrary.simpleMessage("立即签到"), "lijiqiandao" : MessageLookupByLibrary.simpleMessage("立即签到"),
"lijishiyong" : MessageLookupByLibrary.simpleMessage("立即使用"),
"lijitiyan" : MessageLookupByLibrary.simpleMessage("立即体验"), "lijitiyan" : MessageLookupByLibrary.simpleMessage("立即体验"),
"likekaitong" : MessageLookupByLibrary.simpleMessage("立刻开通"), "likekaitong" : MessageLookupByLibrary.simpleMessage("立刻开通"),
"likexufei" : MessageLookupByLibrary.simpleMessage("立刻续费"), "likexufei" : MessageLookupByLibrary.simpleMessage("立刻续费"),
@ -406,6 +409,7 @@ class MessageLookup extends MessageLookupByLibrary {
"login_splash" : MessageLookupByLibrary.simpleMessage("欢迎来到一心回乡"), "login_splash" : MessageLookupByLibrary.simpleMessage("欢迎来到一心回乡"),
"lvbiyue" : MessageLookupByLibrary.simpleMessage("绿币余额"), "lvbiyue" : MessageLookupByLibrary.simpleMessage("绿币余额"),
"lvbiyue_" : m18, "lvbiyue_" : m18,
"lvbizhifu" : MessageLookupByLibrary.simpleMessage("绿币支付"),
"main_menu1" : MessageLookupByLibrary.simpleMessage("净弼"), "main_menu1" : MessageLookupByLibrary.simpleMessage("净弼"),
"main_menu2" : MessageLookupByLibrary.simpleMessage("联盟"), "main_menu2" : MessageLookupByLibrary.simpleMessage("联盟"),
"main_menu3" : MessageLookupByLibrary.simpleMessage("有机生活"), "main_menu3" : MessageLookupByLibrary.simpleMessage("有机生活"),
@ -420,6 +424,7 @@ class MessageLookup extends MessageLookupByLibrary {
"meizhousangengxin" : MessageLookupByLibrary.simpleMessage("每周三更新"), "meizhousangengxin" : MessageLookupByLibrary.simpleMessage("每周三更新"),
"meizhousanquanbao" : MessageLookupByLibrary.simpleMessage("每周三更新劵包"), "meizhousanquanbao" : MessageLookupByLibrary.simpleMessage("每周三更新劵包"),
"mendianxuanzhe" : MessageLookupByLibrary.simpleMessage("门店选择"), "mendianxuanzhe" : MessageLookupByLibrary.simpleMessage("门店选择"),
"mendianyue" : MessageLookupByLibrary.simpleMessage("门店余额"),
"menpaihao" : MessageLookupByLibrary.simpleMessage("请输入门牌号"), "menpaihao" : MessageLookupByLibrary.simpleMessage("请输入门牌号"),
"mi" : m21, "mi" : m21,
"mingxi" : MessageLookupByLibrary.simpleMessage("明细"), "mingxi" : MessageLookupByLibrary.simpleMessage("明细"),
@ -565,6 +570,7 @@ class MessageLookup extends MessageLookupByLibrary {
"shiyongriqi" : MessageLookupByLibrary.simpleMessage("使用日期"), "shiyongriqi" : MessageLookupByLibrary.simpleMessage("使用日期"),
"shiyongshuoming" : MessageLookupByLibrary.simpleMessage("使用说明"), "shiyongshuoming" : MessageLookupByLibrary.simpleMessage("使用说明"),
"shiyongtiaojian" : MessageLookupByLibrary.simpleMessage("使用条件"), "shiyongtiaojian" : MessageLookupByLibrary.simpleMessage("使用条件"),
"shiyongxiangqing" : MessageLookupByLibrary.simpleMessage("使用详情"),
"shouhuodi" : MessageLookupByLibrary.simpleMessage("收货地址"), "shouhuodi" : MessageLookupByLibrary.simpleMessage("收货地址"),
"shouhuodizhi" : MessageLookupByLibrary.simpleMessage("请输入详细收货地址"), "shouhuodizhi" : MessageLookupByLibrary.simpleMessage("请输入详细收货地址"),
"shouhuodizhi1" : MessageLookupByLibrary.simpleMessage("收货地址"), "shouhuodizhi1" : MessageLookupByLibrary.simpleMessage("收货地址"),
@ -607,6 +613,7 @@ class MessageLookup extends MessageLookupByLibrary {
"wancheng" : MessageLookupByLibrary.simpleMessage("完成"), "wancheng" : MessageLookupByLibrary.simpleMessage("完成"),
"wancheng_" : m32, "wancheng_" : m32,
"wanchengyicixiadan" : MessageLookupByLibrary.simpleMessage("完成一次下单"), "wanchengyicixiadan" : MessageLookupByLibrary.simpleMessage("完成一次下单"),
"wangjimima" : MessageLookupByLibrary.simpleMessage("忘记密码"),
"wanjiankang" : MessageLookupByLibrary.simpleMessage("玩健康"), "wanjiankang" : MessageLookupByLibrary.simpleMessage("玩健康"),
"wanshanshengrixinxi_nl" : MessageLookupByLibrary.simpleMessage("完善生日信息后自动生成"), "wanshanshengrixinxi_nl" : MessageLookupByLibrary.simpleMessage("完善生日信息后自动生成"),
"wanshanshengrixinxi_yhq" : MessageLookupByLibrary.simpleMessage("完善生日信息得专属优惠劵"), "wanshanshengrixinxi_yhq" : MessageLookupByLibrary.simpleMessage("完善生日信息得专属优惠劵"),
@ -676,6 +683,7 @@ class MessageLookup extends MessageLookupByLibrary {
"xiugaiyonghuming" : MessageLookupByLibrary.simpleMessage("修改用户名"), "xiugaiyonghuming" : MessageLookupByLibrary.simpleMessage("修改用户名"),
"xuanguige" : MessageLookupByLibrary.simpleMessage("选规格"), "xuanguige" : MessageLookupByLibrary.simpleMessage("选规格"),
"xuanji" : MessageLookupByLibrary.simpleMessage("选集"), "xuanji" : MessageLookupByLibrary.simpleMessage("选集"),
"xuanzeshangpinlingqufangshi" : MessageLookupByLibrary.simpleMessage("请选择商品的领取方式"),
"xuefeihuiyuan" : MessageLookupByLibrary.simpleMessage("续费会员"), "xuefeihuiyuan" : MessageLookupByLibrary.simpleMessage("续费会员"),
"xuexijiankang" : MessageLookupByLibrary.simpleMessage("学习健康"), "xuexijiankang" : MessageLookupByLibrary.simpleMessage("学习健康"),
"xufeihuixiangVIP" : MessageLookupByLibrary.simpleMessage("续费回乡VIP"), "xufeihuixiangVIP" : MessageLookupByLibrary.simpleMessage("续费回乡VIP"),

8
lib/generated/intl/messages_zh_Hans_CN.dart

@ -293,6 +293,7 @@ class MessageLookup extends MessageLookupByLibrary {
"huixiangrenyimendian" : MessageLookupByLibrary.simpleMessage("适用于:一心回乡任意门店"), "huixiangrenyimendian" : MessageLookupByLibrary.simpleMessage("适用于:一心回乡任意门店"),
"huixiangtoutiao" : MessageLookupByLibrary.simpleMessage("回乡头条"), "huixiangtoutiao" : MessageLookupByLibrary.simpleMessage("回乡头条"),
"huixiangvipkazhuanxiang" : MessageLookupByLibrary.simpleMessage("回乡VIP卡专享权益"), "huixiangvipkazhuanxiang" : MessageLookupByLibrary.simpleMessage("回乡VIP卡专享权益"),
"huixiangxieyi" : MessageLookupByLibrary.simpleMessage("回乡VIP会员卡规则协议"),
"huiyuandengji" : MessageLookupByLibrary.simpleMessage("会员等级"), "huiyuandengji" : MessageLookupByLibrary.simpleMessage("会员等级"),
"huiyuandengjishuoming" : MessageLookupByLibrary.simpleMessage("会员等级说明"), "huiyuandengjishuoming" : MessageLookupByLibrary.simpleMessage("会员等级说明"),
"huiyuanguize" : MessageLookupByLibrary.simpleMessage("会员规则说明"), "huiyuanguize" : MessageLookupByLibrary.simpleMessage("会员规则说明"),
@ -317,6 +318,7 @@ class MessageLookup extends MessageLookupByLibrary {
"huodongyue_" : m11, "huodongyue_" : m11,
"huodongzixun" : MessageLookupByLibrary.simpleMessage("活动资讯"), "huodongzixun" : MessageLookupByLibrary.simpleMessage("活动资讯"),
"huopinyisongda" : MessageLookupByLibrary.simpleMessage("货品已送达"), "huopinyisongda" : MessageLookupByLibrary.simpleMessage("货品已送达"),
"huozan" : MessageLookupByLibrary.simpleMessage("获赞"),
"input_code" : MessageLookupByLibrary.simpleMessage("手机验证码"), "input_code" : MessageLookupByLibrary.simpleMessage("手机验证码"),
"input_code_hide" : MessageLookupByLibrary.simpleMessage("请输入验证码"), "input_code_hide" : MessageLookupByLibrary.simpleMessage("请输入验证码"),
"input_invite_code_hide" : MessageLookupByLibrary.simpleMessage("填写邀请码"), "input_invite_code_hide" : MessageLookupByLibrary.simpleMessage("填写邀请码"),
@ -389,6 +391,7 @@ class MessageLookup extends MessageLookupByLibrary {
"lijikaitong" : MessageLookupByLibrary.simpleMessage("立即开通"), "lijikaitong" : MessageLookupByLibrary.simpleMessage("立即开通"),
"lijilingqu" : MessageLookupByLibrary.simpleMessage("立即领取"), "lijilingqu" : MessageLookupByLibrary.simpleMessage("立即领取"),
"lijiqiandao" : MessageLookupByLibrary.simpleMessage("立即签到"), "lijiqiandao" : MessageLookupByLibrary.simpleMessage("立即签到"),
"lijishiyong" : MessageLookupByLibrary.simpleMessage("立即使用"),
"lijitiyan" : MessageLookupByLibrary.simpleMessage("立即体验"), "lijitiyan" : MessageLookupByLibrary.simpleMessage("立即体验"),
"likekaitong" : MessageLookupByLibrary.simpleMessage("立刻开通"), "likekaitong" : MessageLookupByLibrary.simpleMessage("立刻开通"),
"likexufei" : MessageLookupByLibrary.simpleMessage("立刻续费"), "likexufei" : MessageLookupByLibrary.simpleMessage("立刻续费"),
@ -406,6 +409,7 @@ class MessageLookup extends MessageLookupByLibrary {
"login_splash" : MessageLookupByLibrary.simpleMessage("欢迎来到一心回乡"), "login_splash" : MessageLookupByLibrary.simpleMessage("欢迎来到一心回乡"),
"lvbiyue" : MessageLookupByLibrary.simpleMessage("绿币余额"), "lvbiyue" : MessageLookupByLibrary.simpleMessage("绿币余额"),
"lvbiyue_" : m18, "lvbiyue_" : m18,
"lvbizhifu" : MessageLookupByLibrary.simpleMessage("绿币支付"),
"main_menu1" : MessageLookupByLibrary.simpleMessage("净弼"), "main_menu1" : MessageLookupByLibrary.simpleMessage("净弼"),
"main_menu2" : MessageLookupByLibrary.simpleMessage("联盟"), "main_menu2" : MessageLookupByLibrary.simpleMessage("联盟"),
"main_menu3" : MessageLookupByLibrary.simpleMessage("有机生活"), "main_menu3" : MessageLookupByLibrary.simpleMessage("有机生活"),
@ -420,6 +424,7 @@ class MessageLookup extends MessageLookupByLibrary {
"meizhousangengxin" : MessageLookupByLibrary.simpleMessage("每周三更新"), "meizhousangengxin" : MessageLookupByLibrary.simpleMessage("每周三更新"),
"meizhousanquanbao" : MessageLookupByLibrary.simpleMessage("每周三更新劵包"), "meizhousanquanbao" : MessageLookupByLibrary.simpleMessage("每周三更新劵包"),
"mendianxuanzhe" : MessageLookupByLibrary.simpleMessage("门店选择"), "mendianxuanzhe" : MessageLookupByLibrary.simpleMessage("门店选择"),
"mendianyue" : MessageLookupByLibrary.simpleMessage("门店余额"),
"menpaihao" : MessageLookupByLibrary.simpleMessage("请输入门牌号"), "menpaihao" : MessageLookupByLibrary.simpleMessage("请输入门牌号"),
"mi" : m21, "mi" : m21,
"mingxi" : MessageLookupByLibrary.simpleMessage("明细"), "mingxi" : MessageLookupByLibrary.simpleMessage("明细"),
@ -565,6 +570,7 @@ class MessageLookup extends MessageLookupByLibrary {
"shiyongriqi" : MessageLookupByLibrary.simpleMessage("使用日期"), "shiyongriqi" : MessageLookupByLibrary.simpleMessage("使用日期"),
"shiyongshuoming" : MessageLookupByLibrary.simpleMessage("使用说明"), "shiyongshuoming" : MessageLookupByLibrary.simpleMessage("使用说明"),
"shiyongtiaojian" : MessageLookupByLibrary.simpleMessage("使用条件"), "shiyongtiaojian" : MessageLookupByLibrary.simpleMessage("使用条件"),
"shiyongxiangqing" : MessageLookupByLibrary.simpleMessage("使用详情"),
"shouhuodi" : MessageLookupByLibrary.simpleMessage("收货地址"), "shouhuodi" : MessageLookupByLibrary.simpleMessage("收货地址"),
"shouhuodizhi" : MessageLookupByLibrary.simpleMessage("请输入详细收货地址"), "shouhuodizhi" : MessageLookupByLibrary.simpleMessage("请输入详细收货地址"),
"shouhuodizhi1" : MessageLookupByLibrary.simpleMessage("收货地址"), "shouhuodizhi1" : MessageLookupByLibrary.simpleMessage("收货地址"),
@ -607,6 +613,7 @@ class MessageLookup extends MessageLookupByLibrary {
"wancheng" : MessageLookupByLibrary.simpleMessage("完成"), "wancheng" : MessageLookupByLibrary.simpleMessage("完成"),
"wancheng_" : m32, "wancheng_" : m32,
"wanchengyicixiadan" : MessageLookupByLibrary.simpleMessage("完成一次下单"), "wanchengyicixiadan" : MessageLookupByLibrary.simpleMessage("完成一次下单"),
"wangjimima" : MessageLookupByLibrary.simpleMessage("忘记密码"),
"wanjiankang" : MessageLookupByLibrary.simpleMessage("玩健康"), "wanjiankang" : MessageLookupByLibrary.simpleMessage("玩健康"),
"wanshanshengrixinxi_nl" : MessageLookupByLibrary.simpleMessage("完善生日信息后自动生成"), "wanshanshengrixinxi_nl" : MessageLookupByLibrary.simpleMessage("完善生日信息后自动生成"),
"wanshanshengrixinxi_yhq" : MessageLookupByLibrary.simpleMessage("完善生日信息得专属优惠劵"), "wanshanshengrixinxi_yhq" : MessageLookupByLibrary.simpleMessage("完善生日信息得专属优惠劵"),
@ -676,6 +683,7 @@ class MessageLookup extends MessageLookupByLibrary {
"xiugaiyonghuming" : MessageLookupByLibrary.simpleMessage("修改用户名"), "xiugaiyonghuming" : MessageLookupByLibrary.simpleMessage("修改用户名"),
"xuanguige" : MessageLookupByLibrary.simpleMessage("选规格"), "xuanguige" : MessageLookupByLibrary.simpleMessage("选规格"),
"xuanji" : MessageLookupByLibrary.simpleMessage("选集"), "xuanji" : MessageLookupByLibrary.simpleMessage("选集"),
"xuanzeshangpinlingqufangshi" : MessageLookupByLibrary.simpleMessage("请选择商品的领取方式"),
"xuefeihuiyuan" : MessageLookupByLibrary.simpleMessage("续费会员"), "xuefeihuiyuan" : MessageLookupByLibrary.simpleMessage("续费会员"),
"xuexijiankang" : MessageLookupByLibrary.simpleMessage("学习健康"), "xuexijiankang" : MessageLookupByLibrary.simpleMessage("学习健康"),
"xufeihuixiangVIP" : MessageLookupByLibrary.simpleMessage("续费回乡VIP"), "xufeihuixiangVIP" : MessageLookupByLibrary.simpleMessage("续费回乡VIP"),

10
lib/generated/intl/messages_zh_Hant_CN.dart

@ -289,6 +289,7 @@ class MessageLookup extends MessageLookupByLibrary {
"huixiangrenyimendian" : MessageLookupByLibrary.simpleMessage("适用于:一心回乡任意门店"), "huixiangrenyimendian" : MessageLookupByLibrary.simpleMessage("适用于:一心回乡任意门店"),
"huixiangtoutiao" : MessageLookupByLibrary.simpleMessage("回鄉頭條"), "huixiangtoutiao" : MessageLookupByLibrary.simpleMessage("回鄉頭條"),
"huixiangvipkazhuanxiang" : MessageLookupByLibrary.simpleMessage("回鄉VIP卡專享權益"), "huixiangvipkazhuanxiang" : MessageLookupByLibrary.simpleMessage("回鄉VIP卡專享權益"),
"huixiangxieyi" : MessageLookupByLibrary.simpleMessage("回鄉VIP會員卡規則協定"),
"huiyuandengji" : MessageLookupByLibrary.simpleMessage("會員等級"), "huiyuandengji" : MessageLookupByLibrary.simpleMessage("會員等級"),
"huiyuandengjishuoming" : MessageLookupByLibrary.simpleMessage("會員等級説明"), "huiyuandengjishuoming" : MessageLookupByLibrary.simpleMessage("會員等級説明"),
"huiyuanguize" : MessageLookupByLibrary.simpleMessage("會員規則説明"), "huiyuanguize" : MessageLookupByLibrary.simpleMessage("會員規則説明"),
@ -313,6 +314,7 @@ class MessageLookup extends MessageLookupByLibrary {
"huodongyue_" : m11, "huodongyue_" : m11,
"huodongzixun" : MessageLookupByLibrary.simpleMessage("活動資訊"), "huodongzixun" : MessageLookupByLibrary.simpleMessage("活動資訊"),
"huopinyisongda" : MessageLookupByLibrary.simpleMessage("貨品已送達"), "huopinyisongda" : MessageLookupByLibrary.simpleMessage("貨品已送達"),
"huozan" : MessageLookupByLibrary.simpleMessage("獲贊"),
"input_code" : MessageLookupByLibrary.simpleMessage("手機驗證碼"), "input_code" : MessageLookupByLibrary.simpleMessage("手機驗證碼"),
"input_code_hide" : MessageLookupByLibrary.simpleMessage("請輸入驗證碼"), "input_code_hide" : MessageLookupByLibrary.simpleMessage("請輸入驗證碼"),
"input_invite_code_hide" : MessageLookupByLibrary.simpleMessage("填寫邀請碼"), "input_invite_code_hide" : MessageLookupByLibrary.simpleMessage("填寫邀請碼"),
@ -385,6 +387,7 @@ class MessageLookup extends MessageLookupByLibrary {
"lijikaitong" : MessageLookupByLibrary.simpleMessage("立即開通"), "lijikaitong" : MessageLookupByLibrary.simpleMessage("立即開通"),
"lijilingqu" : MessageLookupByLibrary.simpleMessage("立即領取"), "lijilingqu" : MessageLookupByLibrary.simpleMessage("立即領取"),
"lijiqiandao" : MessageLookupByLibrary.simpleMessage("立即簽到"), "lijiqiandao" : MessageLookupByLibrary.simpleMessage("立即簽到"),
"lijishiyong" : MessageLookupByLibrary.simpleMessage("立即使用"),
"lijitiyan" : MessageLookupByLibrary.simpleMessage("立即體驗"), "lijitiyan" : MessageLookupByLibrary.simpleMessage("立即體驗"),
"likekaitong" : MessageLookupByLibrary.simpleMessage("立刻開通"), "likekaitong" : MessageLookupByLibrary.simpleMessage("立刻開通"),
"likexufei" : MessageLookupByLibrary.simpleMessage("立刻續費"), "likexufei" : MessageLookupByLibrary.simpleMessage("立刻續費"),
@ -402,6 +405,7 @@ class MessageLookup extends MessageLookupByLibrary {
"login_splash" : MessageLookupByLibrary.simpleMessage("歡迎來到一心回鄉"), "login_splash" : MessageLookupByLibrary.simpleMessage("歡迎來到一心回鄉"),
"lvbiyue" : MessageLookupByLibrary.simpleMessage("綠幣餘額"), "lvbiyue" : MessageLookupByLibrary.simpleMessage("綠幣餘額"),
"lvbiyue_" : m18, "lvbiyue_" : m18,
"lvbizhifu" : MessageLookupByLibrary.simpleMessage("綠幣支付"),
"main_menu1" : MessageLookupByLibrary.simpleMessage("淨弼"), "main_menu1" : MessageLookupByLibrary.simpleMessage("淨弼"),
"main_menu2" : MessageLookupByLibrary.simpleMessage("聯盟"), "main_menu2" : MessageLookupByLibrary.simpleMessage("聯盟"),
"main_menu3" : MessageLookupByLibrary.simpleMessage("有機生活"), "main_menu3" : MessageLookupByLibrary.simpleMessage("有機生活"),
@ -416,6 +420,7 @@ class MessageLookup extends MessageLookupByLibrary {
"meizhousangengxin" : MessageLookupByLibrary.simpleMessage("每週三更新"), "meizhousangengxin" : MessageLookupByLibrary.simpleMessage("每週三更新"),
"meizhousanquanbao" : MessageLookupByLibrary.simpleMessage("每週三更新劵包"), "meizhousanquanbao" : MessageLookupByLibrary.simpleMessage("每週三更新劵包"),
"mendianxuanzhe" : MessageLookupByLibrary.simpleMessage("门店选择"), "mendianxuanzhe" : MessageLookupByLibrary.simpleMessage("门店选择"),
"mendianyue" : MessageLookupByLibrary.simpleMessage("門店餘額"),
"menpaihao" : MessageLookupByLibrary.simpleMessage("請輸入門牌號"), "menpaihao" : MessageLookupByLibrary.simpleMessage("請輸入門牌號"),
"mi" : m21, "mi" : m21,
"mingxi" : MessageLookupByLibrary.simpleMessage("明細"), "mingxi" : MessageLookupByLibrary.simpleMessage("明細"),
@ -560,6 +565,7 @@ class MessageLookup extends MessageLookupByLibrary {
"shiyongriqi" : MessageLookupByLibrary.simpleMessage("使用日期"), "shiyongriqi" : MessageLookupByLibrary.simpleMessage("使用日期"),
"shiyongshuoming" : MessageLookupByLibrary.simpleMessage("使用说明"), "shiyongshuoming" : MessageLookupByLibrary.simpleMessage("使用说明"),
"shiyongtiaojian" : MessageLookupByLibrary.simpleMessage("使用条件"), "shiyongtiaojian" : MessageLookupByLibrary.simpleMessage("使用条件"),
"shiyongxiangqing" : MessageLookupByLibrary.simpleMessage("使用詳情"),
"shouhuodizhi" : MessageLookupByLibrary.simpleMessage("請輸入詳細收貨地址"), "shouhuodizhi" : MessageLookupByLibrary.simpleMessage("請輸入詳細收貨地址"),
"shouhuodizhi1" : MessageLookupByLibrary.simpleMessage("收貨地址"), "shouhuodizhi1" : MessageLookupByLibrary.simpleMessage("收貨地址"),
"shouhuorenshoujihao" : MessageLookupByLibrary.simpleMessage("請輸入收貨人手機號"), "shouhuorenshoujihao" : MessageLookupByLibrary.simpleMessage("請輸入收貨人手機號"),
@ -601,6 +607,7 @@ class MessageLookup extends MessageLookupByLibrary {
"wancheng" : MessageLookupByLibrary.simpleMessage("完成"), "wancheng" : MessageLookupByLibrary.simpleMessage("完成"),
"wancheng_" : m32, "wancheng_" : m32,
"wanchengyicixiadan" : MessageLookupByLibrary.simpleMessage("完成一次下單"), "wanchengyicixiadan" : MessageLookupByLibrary.simpleMessage("完成一次下單"),
"wangjimima" : MessageLookupByLibrary.simpleMessage("忘記密碼"),
"wanjiankang" : MessageLookupByLibrary.simpleMessage("玩健康"), "wanjiankang" : MessageLookupByLibrary.simpleMessage("玩健康"),
"wanshanshengrixinxi_nl" : MessageLookupByLibrary.simpleMessage("完善生日資訊後自動生成 "), "wanshanshengrixinxi_nl" : MessageLookupByLibrary.simpleMessage("完善生日資訊後自動生成 "),
"wanshanshengrixinxi_yhq" : MessageLookupByLibrary.simpleMessage("完善生日資訊得專屬優惠劵 "), "wanshanshengrixinxi_yhq" : MessageLookupByLibrary.simpleMessage("完善生日資訊得專屬優惠劵 "),
@ -670,6 +677,7 @@ class MessageLookup extends MessageLookupByLibrary {
"xiugaiyonghuming" : MessageLookupByLibrary.simpleMessage("修改用戶名"), "xiugaiyonghuming" : MessageLookupByLibrary.simpleMessage("修改用戶名"),
"xuanguige" : MessageLookupByLibrary.simpleMessage("選規格"), "xuanguige" : MessageLookupByLibrary.simpleMessage("選規格"),
"xuanji" : MessageLookupByLibrary.simpleMessage("選集"), "xuanji" : MessageLookupByLibrary.simpleMessage("選集"),
"xuanzeshangpinlingqufangshi" : MessageLookupByLibrary.simpleMessage("請選擇商品的領取方式"),
"xuefeihuiyuan" : MessageLookupByLibrary.simpleMessage("續費會員"), "xuefeihuiyuan" : MessageLookupByLibrary.simpleMessage("續費會員"),
"xuexijiankang" : MessageLookupByLibrary.simpleMessage("學習健康"), "xuexijiankang" : MessageLookupByLibrary.simpleMessage("學習健康"),
"xufeihuixiangVIP" : MessageLookupByLibrary.simpleMessage("續費回鄉VIP"), "xufeihuixiangVIP" : MessageLookupByLibrary.simpleMessage("續費回鄉VIP"),
@ -746,7 +754,7 @@ class MessageLookup extends MessageLookupByLibrary {
"zaixiankefu" : MessageLookupByLibrary.simpleMessage("在線客服"), "zaixiankefu" : MessageLookupByLibrary.simpleMessage("在線客服"),
"zanbuzhichixianshangdiancan" : MessageLookupByLibrary.simpleMessage("暫不支持線上點餐"), "zanbuzhichixianshangdiancan" : MessageLookupByLibrary.simpleMessage("暫不支持線上點餐"),
"zanweijiesuo" : MessageLookupByLibrary.simpleMessage("暫未解鎖"), "zanweijiesuo" : MessageLookupByLibrary.simpleMessage("暫未解鎖"),
"zanweikaifang" : MessageLookupByLibrary.simpleMessage("暂未开"), "zanweikaifang" : MessageLookupByLibrary.simpleMessage("暫未開"),
"zanweikaitong" : MessageLookupByLibrary.simpleMessage("暫未開通"), "zanweikaitong" : MessageLookupByLibrary.simpleMessage("暫未開通"),
"zanwupinglun" : MessageLookupByLibrary.simpleMessage("暫無評論,快去評論吧~"), "zanwupinglun" : MessageLookupByLibrary.simpleMessage("暫無評論,快去評論吧~"),
"zanwuxianshangjindian" : MessageLookupByLibrary.simpleMessage("暫無綫上門店"), "zanwuxianshangjindian" : MessageLookupByLibrary.simpleMessage("暫無綫上門店"),

8
lib/generated/intl/messages_zh_TW.dart

@ -291,6 +291,7 @@ class MessageLookup extends MessageLookupByLibrary {
"huixiangrenyimendian" : MessageLookupByLibrary.simpleMessage("适用于:一心回乡任意门店"), "huixiangrenyimendian" : MessageLookupByLibrary.simpleMessage("适用于:一心回乡任意门店"),
"huixiangtoutiao" : MessageLookupByLibrary.simpleMessage("回鄉頭條"), "huixiangtoutiao" : MessageLookupByLibrary.simpleMessage("回鄉頭條"),
"huixiangvipkazhuanxiang" : MessageLookupByLibrary.simpleMessage("回鄉VIP卡專享權益"), "huixiangvipkazhuanxiang" : MessageLookupByLibrary.simpleMessage("回鄉VIP卡專享權益"),
"huixiangxieyi" : MessageLookupByLibrary.simpleMessage("回鄉VIP會員卡規則協定"),
"huiyuandengji" : MessageLookupByLibrary.simpleMessage("會員等級"), "huiyuandengji" : MessageLookupByLibrary.simpleMessage("會員等級"),
"huiyuandengjishuoming" : MessageLookupByLibrary.simpleMessage("會員等級説明"), "huiyuandengjishuoming" : MessageLookupByLibrary.simpleMessage("會員等級説明"),
"huiyuanguize" : MessageLookupByLibrary.simpleMessage("會員規則説明"), "huiyuanguize" : MessageLookupByLibrary.simpleMessage("會員規則説明"),
@ -315,6 +316,7 @@ class MessageLookup extends MessageLookupByLibrary {
"huodongyue_" : m11, "huodongyue_" : m11,
"huodongzixun" : MessageLookupByLibrary.simpleMessage("活動資訊"), "huodongzixun" : MessageLookupByLibrary.simpleMessage("活動資訊"),
"huopinyisongda" : MessageLookupByLibrary.simpleMessage("貨品已送達"), "huopinyisongda" : MessageLookupByLibrary.simpleMessage("貨品已送達"),
"huozan" : MessageLookupByLibrary.simpleMessage("獲贊"),
"input_code" : MessageLookupByLibrary.simpleMessage("手機驗證碼"), "input_code" : MessageLookupByLibrary.simpleMessage("手機驗證碼"),
"input_code_hide" : MessageLookupByLibrary.simpleMessage("請輸入驗證碼"), "input_code_hide" : MessageLookupByLibrary.simpleMessage("請輸入驗證碼"),
"input_invite_code_hide" : MessageLookupByLibrary.simpleMessage("填寫邀請碼"), "input_invite_code_hide" : MessageLookupByLibrary.simpleMessage("填寫邀請碼"),
@ -387,6 +389,7 @@ class MessageLookup extends MessageLookupByLibrary {
"lijikaitong" : MessageLookupByLibrary.simpleMessage("立即開通"), "lijikaitong" : MessageLookupByLibrary.simpleMessage("立即開通"),
"lijilingqu" : MessageLookupByLibrary.simpleMessage("立即領取"), "lijilingqu" : MessageLookupByLibrary.simpleMessage("立即領取"),
"lijiqiandao" : MessageLookupByLibrary.simpleMessage("立即簽到"), "lijiqiandao" : MessageLookupByLibrary.simpleMessage("立即簽到"),
"lijishiyong" : MessageLookupByLibrary.simpleMessage("立即使用"),
"lijitiyan" : MessageLookupByLibrary.simpleMessage("立即體驗"), "lijitiyan" : MessageLookupByLibrary.simpleMessage("立即體驗"),
"likekaitong" : MessageLookupByLibrary.simpleMessage("立刻開通"), "likekaitong" : MessageLookupByLibrary.simpleMessage("立刻開通"),
"likexufei" : MessageLookupByLibrary.simpleMessage("立刻續費"), "likexufei" : MessageLookupByLibrary.simpleMessage("立刻續費"),
@ -404,6 +407,7 @@ class MessageLookup extends MessageLookupByLibrary {
"login_splash" : MessageLookupByLibrary.simpleMessage("歡迎來到一心回鄉"), "login_splash" : MessageLookupByLibrary.simpleMessage("歡迎來到一心回鄉"),
"lvbiyue" : MessageLookupByLibrary.simpleMessage("綠幣餘額"), "lvbiyue" : MessageLookupByLibrary.simpleMessage("綠幣餘額"),
"lvbiyue_" : m18, "lvbiyue_" : m18,
"lvbizhifu" : MessageLookupByLibrary.simpleMessage("綠幣支付"),
"main_menu1" : MessageLookupByLibrary.simpleMessage("淨弼"), "main_menu1" : MessageLookupByLibrary.simpleMessage("淨弼"),
"main_menu2" : MessageLookupByLibrary.simpleMessage("聯盟"), "main_menu2" : MessageLookupByLibrary.simpleMessage("聯盟"),
"main_menu3" : MessageLookupByLibrary.simpleMessage("有機生活"), "main_menu3" : MessageLookupByLibrary.simpleMessage("有機生活"),
@ -418,6 +422,7 @@ class MessageLookup extends MessageLookupByLibrary {
"meizhousangengxin" : MessageLookupByLibrary.simpleMessage("每週三更新"), "meizhousangengxin" : MessageLookupByLibrary.simpleMessage("每週三更新"),
"meizhousanquanbao" : MessageLookupByLibrary.simpleMessage("每週三更新劵包"), "meizhousanquanbao" : MessageLookupByLibrary.simpleMessage("每週三更新劵包"),
"mendianxuanzhe" : MessageLookupByLibrary.simpleMessage("门店选择"), "mendianxuanzhe" : MessageLookupByLibrary.simpleMessage("门店选择"),
"mendianyue" : MessageLookupByLibrary.simpleMessage("門店餘額"),
"menpaihao" : MessageLookupByLibrary.simpleMessage("請輸入門牌號"), "menpaihao" : MessageLookupByLibrary.simpleMessage("請輸入門牌號"),
"mi" : m21, "mi" : m21,
"mingxi" : MessageLookupByLibrary.simpleMessage("明細"), "mingxi" : MessageLookupByLibrary.simpleMessage("明細"),
@ -562,6 +567,7 @@ class MessageLookup extends MessageLookupByLibrary {
"shiyongriqi" : MessageLookupByLibrary.simpleMessage("使用日期"), "shiyongriqi" : MessageLookupByLibrary.simpleMessage("使用日期"),
"shiyongshuoming" : MessageLookupByLibrary.simpleMessage("使用说明"), "shiyongshuoming" : MessageLookupByLibrary.simpleMessage("使用说明"),
"shiyongtiaojian" : MessageLookupByLibrary.simpleMessage("使用条件"), "shiyongtiaojian" : MessageLookupByLibrary.simpleMessage("使用条件"),
"shiyongxiangqing" : MessageLookupByLibrary.simpleMessage("使用詳情"),
"shouhuodi" : MessageLookupByLibrary.simpleMessage("收貨地址"), "shouhuodi" : MessageLookupByLibrary.simpleMessage("收貨地址"),
"shouhuodizhi" : MessageLookupByLibrary.simpleMessage("請輸入詳細收貨地址"), "shouhuodizhi" : MessageLookupByLibrary.simpleMessage("請輸入詳細收貨地址"),
"shouhuodizhi1" : MessageLookupByLibrary.simpleMessage("收貨地址"), "shouhuodizhi1" : MessageLookupByLibrary.simpleMessage("收貨地址"),
@ -604,6 +610,7 @@ class MessageLookup extends MessageLookupByLibrary {
"wancheng" : MessageLookupByLibrary.simpleMessage("完成"), "wancheng" : MessageLookupByLibrary.simpleMessage("完成"),
"wancheng_" : m32, "wancheng_" : m32,
"wanchengyicixiadan" : MessageLookupByLibrary.simpleMessage("完成一次下單"), "wanchengyicixiadan" : MessageLookupByLibrary.simpleMessage("完成一次下單"),
"wangjimima" : MessageLookupByLibrary.simpleMessage("忘記密碼"),
"wanjiankang" : MessageLookupByLibrary.simpleMessage("玩健康"), "wanjiankang" : MessageLookupByLibrary.simpleMessage("玩健康"),
"wanshanshengrixinxi_nl" : MessageLookupByLibrary.simpleMessage("完善生日資訊後自動生成 "), "wanshanshengrixinxi_nl" : MessageLookupByLibrary.simpleMessage("完善生日資訊後自動生成 "),
"wanshanshengrixinxi_yhq" : MessageLookupByLibrary.simpleMessage("完善生日資訊得專屬優惠劵 "), "wanshanshengrixinxi_yhq" : MessageLookupByLibrary.simpleMessage("完善生日資訊得專屬優惠劵 "),
@ -673,6 +680,7 @@ class MessageLookup extends MessageLookupByLibrary {
"xiugaiyonghuming" : MessageLookupByLibrary.simpleMessage("修改用戶名"), "xiugaiyonghuming" : MessageLookupByLibrary.simpleMessage("修改用戶名"),
"xuanguige" : MessageLookupByLibrary.simpleMessage("選規格"), "xuanguige" : MessageLookupByLibrary.simpleMessage("選規格"),
"xuanji" : MessageLookupByLibrary.simpleMessage("選集"), "xuanji" : MessageLookupByLibrary.simpleMessage("選集"),
"xuanzeshangpinlingqufangshi" : MessageLookupByLibrary.simpleMessage("請選擇商品的領取方式"),
"xuefeihuiyuan" : MessageLookupByLibrary.simpleMessage("續費會員"), "xuefeihuiyuan" : MessageLookupByLibrary.simpleMessage("續費會員"),
"xuexijiankang" : MessageLookupByLibrary.simpleMessage("學習健康"), "xuexijiankang" : MessageLookupByLibrary.simpleMessage("學習健康"),
"xufeihuixiangVIP" : MessageLookupByLibrary.simpleMessage("續費回鄉VIP"), "xufeihuixiangVIP" : MessageLookupByLibrary.simpleMessage("續費回鄉VIP"),

80
lib/generated/l10n.dart

@ -6875,6 +6875,86 @@ class S {
); );
} }
/// `VIP会员卡规则协议`
String get huixiangxieyi {
return Intl.message(
'回乡VIP会员卡规则协议',
name: 'huixiangxieyi',
desc: '',
args: [],
);
}
/// ``
String get huozan {
return Intl.message(
'获赞',
name: 'huozan',
desc: '',
args: [],
);
}
/// `使`
String get shiyongxiangqing {
return Intl.message(
'使用详情',
name: 'shiyongxiangqing',
desc: '',
args: [],
);
}
/// `使`
String get lijishiyong {
return Intl.message(
'立即使用',
name: 'lijishiyong',
desc: '',
args: [],
);
}
/// ``
String get wangjimima {
return Intl.message(
'忘记密码',
name: 'wangjimima',
desc: '',
args: [],
);
}
/// ``
String get xuanzeshangpinlingqufangshi {
return Intl.message(
'请选择商品的领取方式',
name: 'xuanzeshangpinlingqufangshi',
desc: '',
args: [],
);
}
/// ``
String get mendianyue {
return Intl.message(
'门店余额',
name: 'mendianyue',
desc: '',
args: [],
);
}
/// `绿`
String get lvbizhifu {
return Intl.message(
'绿币支付',
name: 'lvbizhifu',
desc: '',
args: [],
);
}
/// `使` /// `使`
String get privacy_policy4 { String get privacy_policy4 {
return Intl.message( return Intl.message(

11
lib/home/home_page.dart

@ -111,10 +111,12 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
/// ///
posterShowAlertDialog(ActivityPos activityPos) { posterShowAlertDialog(ActivityPos activityPos) {
var today = DateTime.now().day;
SharedPreferences.getInstance().then((value) { SharedPreferences.getInstance().then((value) {
if((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);
// //
showDialog( showDialog(
context: context, context: context,
@ -503,7 +505,10 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
}, },
child: SingleChildScrollView( child: SingleChildScrollView(
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
child: Column( child: FutureBuilder(
future: queryHome(),
builder: (context, snapshot) {
return Column(
children: [ children: [
///banner ///banner
HomeBanner(bannerData, controller), HomeBanner(bannerData, controller),
@ -579,7 +584,7 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
}, },
), ),
], ],
), );})
), ),
), ),
), ),

90
lib/home/welfare_exchange.dart

@ -28,7 +28,8 @@ class WelfareExchange extends StatefulWidget {
} }
} }
class _WelfareExchange extends State<WelfareExchange> with SingleTickerProviderStateMixin, AutomaticKeepAliveClientMixin{ class _WelfareExchange extends State<WelfareExchange>
with SingleTickerProviderStateMixin, AutomaticKeepAliveClientMixin {
ApiService apiService; ApiService apiService;
final ScrollController scrollController = ScrollController(); final ScrollController scrollController = ScrollController();
final RefreshController refreshController = RefreshController(); final RefreshController refreshController = RefreshController();
@ -165,7 +166,7 @@ class _WelfareExchange extends State<WelfareExchange> with SingleTickerProvider
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
backgroundColor: Colors.transparent, backgroundColor: Colors.white,
body: NestedScrollView( body: NestedScrollView(
headerSliverBuilder: (context, inner) { headerSliverBuilder: (context, inner) {
return [ return [
@ -195,28 +196,28 @@ class _WelfareExchange extends State<WelfareExchange> with SingleTickerProvider
), ),
), ),
flexibleSpace: FlexibleSpaceBar( flexibleSpace: FlexibleSpaceBar(
background:Stack( background: Stack(
children: [ children: [
Container( Container(
// padding: EdgeInsets.only(top: 40.h), // padding: EdgeInsets.only(top: 40.h),
height: 172.h, height: 172.h,
decoration: BoxDecoration( decoration: BoxDecoration(
// border: Border.all(color: Colors.white,width: 0.5), // border: Border.all(color: Colors.white,width: 0.5),
color: Color(0xFF277D4B), color: Color(0xFF277D4B),
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
bottomRight: Radius.circular(40.r), bottomRight: Radius.circular(40.r),
bottomLeft: Radius.circular(40.r), bottomLeft: Radius.circular(40.r),
),
),
),
Container(
alignment: Alignment.topCenter,
margin: EdgeInsets.only(top: 110.h),
child: pointUser(),
), ),
], ),
)), ),
Container(
alignment: Alignment.topCenter,
margin: EdgeInsets.only(top: 110.h),
child: pointUser(),
),
],
)),
expandedHeight: 258.h, expandedHeight: 258.h,
bottom: PreferredSize( bottom: PreferredSize(
preferredSize: Size(double.infinity, 0), preferredSize: Size(double.infinity, 0),
@ -264,7 +265,7 @@ class _WelfareExchange extends State<WelfareExchange> with SingleTickerProvider
body: SmartRefresher( body: SmartRefresher(
controller: refreshController, controller: refreshController,
enablePullDown: true, enablePullDown: true,
enablePullUp: false, enablePullUp: true,
physics: ClampingScrollPhysics(), physics: ClampingScrollPhysics(),
header: MyHeader(), header: MyHeader(),
footer: CustomFooter( footer: CustomFooter(
@ -408,27 +409,28 @@ class _WelfareExchange extends State<WelfareExchange> with SingleTickerProvider
SizedBox( SizedBox(
height: 4.h, height: 4.h,
), ),
Expanded(child: Row( Expanded(
children: [ child: Row(
Text( children: [
(userInfo != null) ? "${userInfo.points}" : "", Text(
style: TextStyle( (userInfo != null) ? "${userInfo.points}" : "",
fontSize: 16.sp, style: TextStyle(
color: Color(0xFF32A060), fontSize: 16.sp,
fontFamily: 'JDZhengHT', color: Color(0xFF32A060),
fontWeight: MyFontWeight.medium, fontFamily: 'JDZhengHT',
), fontWeight: MyFontWeight.medium,
),
SizedBox(
width: 6.w,
), ),
Image.asset( ),
"assets/image/icon_gold_coin.webp", SizedBox(
width: 18, width: 6.w,
height: 18, ),
) Image.asset(
], "assets/image/icon_gold_coin.webp",
)) width: 18,
height: 18,
)
],
))
], ],
), ),
) )

55
lib/home/welfare_page.dart

@ -50,8 +50,7 @@ class _WelfarePage extends State<WelfarePage> {
super.initState(); super.initState();
SharedPreferences.getInstance().then((value) => { SharedPreferences.getInstance().then((value) => {
apiService = ApiService(Dio(), context: context, token: value.getString("token")), apiService = ApiService(Dio(), context: context, token: value.getString("token")),
queryGoods(), _onRefresh(),
queryCoupon(),
}); });
} }
@ -108,6 +107,8 @@ class _WelfarePage extends State<WelfarePage> {
"searchKey": "", "searchKey": "",
"state": 0 "state": 0
}).catchError((onError) { }).catchError((onError) {
SmartDialog.showToast(AppUtils.dioErrorTypeToString(onError.type),
alignment: Alignment.center);
refreshController.refreshFailed(); refreshController.refreshFailed();
refreshController.loadFailed(); refreshController.loadFailed();
}); });
@ -134,7 +135,7 @@ class _WelfarePage extends State<WelfarePage> {
_onRefresh(){ _onRefresh(){
queryGoods(); queryGoods();
// queryCoupon(); queryCoupon();
} }
@ -262,7 +263,13 @@ class _WelfarePage extends State<WelfarePage> {
), ),
], ],
)), )),
AspectRatio( coupon.length == 0?
NoDataView(
src: "assets/image/ka.webp",
isShowBtn: false,
text: S.of(context).haimeiyouyouhuiquankeyilingqu,
fontSize: 16.sp,
): AspectRatio(
aspectRatio: 1.10, aspectRatio: 1.10,
child: Swiper( child: Swiper(
onIndexChanged: (it){ onIndexChanged: (it){
@ -288,12 +295,11 @@ class _WelfarePage extends State<WelfarePage> {
children: [ children: [
Container( Container(
child: weekList(coupon[position]), child: weekList(coupon[position]),
// weekList(testList2[position]),
), ),
], ],
); );
}, },
itemCount:coupon.length, itemCount:coupon.length ?? 0,
), ),
) )
], ],
@ -302,27 +308,30 @@ class _WelfarePage extends State<WelfarePage> {
} }
Widget weekList(List<Coupon> cops){ Widget weekList(List<Coupon> cops){
return Expanded(child:(cops != null && cops.length > 0)?ListView.builder( return Expanded(
padding: EdgeInsets.zero, child:(cops == null && cops.length == 0)?
itemCount: cops.length, NoDataView(
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: BouncingScrollPhysics(),
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {
},
child: weekCoupon(cops[position]),
);
},
):NoDataView(
src: "assets/image/ka.webp", src: "assets/image/ka.webp",
isShowBtn: false, isShowBtn: false,
text: S.of(context).haimeiyouyouhuiquankeyilingqu, text: S.of(context).haimeiyouyouhuiquankeyilingqu,
fontSize: 16.sp, fontSize: 16.sp,
),); ):ListView.builder(
padding: EdgeInsets.zero,
itemCount: cops.length,
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: BouncingScrollPhysics(),
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {
},
child: weekCoupon(cops[position]),
);
},
),);
} }
///
Widget weekCoupon(Coupon cop) { Widget weekCoupon(Coupon cop) {
return Container( return Container(
height: 95.h, height: 95.h,
@ -396,6 +405,7 @@ class _WelfarePage extends State<WelfarePage> {
); );
} }
///
Widget weekWidget(Coupon cop) { Widget weekWidget(Coupon cop) {
if (cop.bizType == 1) { if (cop.bizType == 1) {
return Column( return Column(
@ -581,6 +591,7 @@ class _WelfarePage extends State<WelfarePage> {
} }
} }
///
Widget weekBtn(Coupon cop) { Widget weekBtn(Coupon cop) {
if(cop.status == 0) if(cop.status == 0)
return Align( return Align(
@ -645,6 +656,7 @@ class _WelfarePage extends State<WelfarePage> {
); );
} }
///
receiveCoupon(couponId) async { receiveCoupon(couponId) async {
couponIndex = swiperIndex; couponIndex = swiperIndex;
BaseData baseData = await apiService.receiveCoupon(couponId); BaseData baseData = await apiService.receiveCoupon(couponId);
@ -881,7 +893,6 @@ class _WelfarePage extends State<WelfarePage> {
); );
} }
String pointPrice(Goods goodsPrice){ String pointPrice(Goods goodsPrice){
if(goodsPrice == null) if(goodsPrice == null)
return ""; return "";

11
lib/l10n/intl_en.arb

@ -713,6 +713,17 @@
"canyingfuwu":"餐饮服务", "canyingfuwu":"餐饮服务",
"qiyetuanjian":"企业团建", "qiyetuanjian":"企业团建",
"zhunongjifen":"助农积分", "zhunongjifen":"助农积分",
"huixiangxieyi":"回乡VIP会员卡规则协议",
"zanweikaifang":"暂未开放",
"zanweijiesuo":"暂未解锁",
"huozan":"获赞",
"shiyongxiangqing":"使用详情",
"lijishiyong":"立即使用",
"wangjimima":"忘记密码",
"xuanzeshangpinlingqufangshi":"请选择商品的领取方式",
"mendianyue":"门店余额",
"lvbizhifu":"绿币支付",

10
lib/l10n/intl_en_US.arb

@ -714,6 +714,16 @@
"canyingfuwu":"catering service", "canyingfuwu":"catering service",
"qiyetuanjian":"Enterprise League Building", "qiyetuanjian":"Enterprise League Building",
"zhunongjifen":"Farming aid points", "zhunongjifen":"Farming aid points",
"huixiangxieyi":"Homecoming VIP Membership Card Rules Agreement",
"zanweikaifang":"Not open",
"zanweijiesuo":"Not unlocked",
"huozan":"liked",
"shiyongxiangqing":"Use Details",
"lijishiyong":"Use Now",
"wangjimima":"Forgot password",
"xuanzeshangpinlingqufangshi":"Please select the picking method of goods",
"mendianyue":"store balance",
"lvbizhifu":"green payment",

10
lib/l10n/intl_zh_CN.arb

@ -714,6 +714,16 @@
"canyingfuwu":"餐饮服务", "canyingfuwu":"餐饮服务",
"qiyetuanjian":"企业团建", "qiyetuanjian":"企业团建",
"zhunongjifen":"助农积分", "zhunongjifen":"助农积分",
"huixiangxieyi":"回乡VIP会员卡规则协议",
"zanweikaifang":"暂未开放",
"zanweijiesuo":"暂未解锁",
"huozan":"获赞",
"shiyongxiangqing":"使用详情",
"lijishiyong":"立即使用",
"wangjimima":"忘记密码",
"xuanzeshangpinlingqufangshi":"请选择商品的领取方式",
"mendianyue":"门店余额",
"lvbizhifu":"绿币支付",

10
lib/l10n/intl_zh_Hans_CN.arb

@ -714,6 +714,16 @@
"canyingfuwu":"餐饮服务", "canyingfuwu":"餐饮服务",
"qiyetuanjian":"企业团建", "qiyetuanjian":"企业团建",
"zhunongjifen":"助农积分", "zhunongjifen":"助农积分",
"huixiangxieyi":"回乡VIP会员卡规则协议",
"zanweikaifang":"暂未开放",
"zanweijiesuo":"暂未解锁",
"huozan":"获赞",
"shiyongxiangqing":"使用详情",
"lijishiyong":"立即使用",
"wangjimima":"忘记密码",
"xuanzeshangpinlingqufangshi":"请选择商品的领取方式",
"mendianyue":"门店余额",
"lvbizhifu":"绿币支付",

10
lib/l10n/intl_zh_Hant_CN.arb

@ -705,6 +705,16 @@
"canyingfuwu":"餐飲服務", "canyingfuwu":"餐飲服務",
"qiyetuanjian":"企業團建", "qiyetuanjian":"企業團建",
"zhunongjifen":"助農積分", "zhunongjifen":"助農積分",
"huixiangxieyi":"回鄉VIP會員卡規則協定",
"zanweikaifang":"暫未開放",
"zanweijiesuo":"暫未解鎖",
"huozan":"獲贊",
"shiyongxiangqing":"使用詳情",
"lijishiyong":"立即使用",
"wangjimima":"忘記密碼",
"xuanzeshangpinlingqufangshi":"請選擇商品的領取方式",
"mendianyue":"門店餘額",
"lvbizhifu":"綠幣支付",

10
lib/l10n/intl_zh_TW.arb

@ -707,6 +707,16 @@
"canyingfuwu":"餐飲服務", "canyingfuwu":"餐飲服務",
"qiyetuanjian":"企業團建", "qiyetuanjian":"企業團建",
"zhunongjifen":"助農積分", "zhunongjifen":"助農積分",
"huixiangxieyi":"回鄉VIP會員卡規則協定",
"zanweikaifang":"暫未開放",
"zanweijiesuo":"暫未解鎖",
"huozan":"獲贊",
"shiyongxiangqing":"使用詳情",
"lijishiyong":"立即使用",
"wangjimima":"忘記密碼",
"xuanzeshangpinlingqufangshi":"請選擇商品的領取方式",
"mendianyue":"門店餘額",
"lvbizhifu":"綠幣支付",

59
lib/login/new_login_page.dart

@ -123,7 +123,7 @@ class _NewLoginPage extends State<NewLoginPage> {
} }
if (_sendCodeStatus == 0) { if (_sendCodeStatus == 0) {
apiService apiService
.sendVerify(area,mobile) .sendVerify(area, mobile)
.then((value) => { .then((value) => {
if (value.isSuccess) if (value.isSuccess)
{_sendCodeStatus = 1, countdown()} {_sendCodeStatus = 1, countdown()}
@ -207,7 +207,12 @@ class _NewLoginPage extends State<NewLoginPage> {
return; return;
} }
var invite = _controllerInviteCode.text; var invite = _controllerInviteCode.text;
var param = {"capcha": code, "mobile": mobile, "invite": invite,"areaCode":area}; var param = {
"capcha": code,
"mobile": mobile,
"invite": invite,
"areaCode": area
};
EasyLoading.show(status: S.of(context).zhengzaijiazai); EasyLoading.show(status: S.of(context).zhengzaijiazai);
BaseData value = await apiService.memberLogin(param).catchError((error) { BaseData value = await apiService.memberLogin(param).catchError((error) {
print(error.message); print(error.message);
@ -217,7 +222,8 @@ class _NewLoginPage extends State<NewLoginPage> {
// EasyLoading.show(status: S.of(context).zhengzaijiazai); // EasyLoading.show(status: S.of(context).zhengzaijiazai);
if (value != null && value.isSuccess) { if (value != null && value.isSuccess) {
var userInfo = LoginInfo.fromJson(value.data); var userInfo = LoginInfo.fromJson(value.data);
ExamineInstance.instance.isExamine = userInfo.authInfo.account == "13800138000"; ExamineInstance.instance.isExamine =
userInfo.authInfo.account == "13800138000";
saveUserJson(userInfo.authInfo.toJson()); saveUserJson(userInfo.authInfo.toJson());
eventBus.fire(EventType(3)); eventBus.fire(EventType(3));
@ -257,7 +263,8 @@ class _NewLoginPage extends State<NewLoginPage> {
if (sharedPreferences.containsKey('token') && if (sharedPreferences.containsKey('token') &&
sharedPreferences.getString("token") != null && sharedPreferences.getString("token") != null &&
sharedPreferences.getString("token") != "") { sharedPreferences.getString("token") != "") {
ExamineInstance.instance.isExamine = sharedPreferences.getString("mobile") == "13800138000"; ExamineInstance.instance.isExamine =
sharedPreferences.getString("mobile") == "13800138000";
Navigator.of(context).popAndPushNamed('/router/main_page'); Navigator.of(context).popAndPushNamed('/router/main_page');
} else { } else {
initController(); initController();
@ -383,22 +390,24 @@ class _NewLoginPage extends State<NewLoginPage> {
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
GestureDetector( GestureDetector(
onTap: (){ onTap: () {
Navigator.of(context).pushNamed('/router/phone_address_page').then((value) { Navigator.of(context)
if(value != null) .pushNamed('/router/phone_address_page')
setState(() { .then((value) {
area = value; if (value != null)
setState(() {
area = value;
});
}); });
}); },
}, child: Text(
child: Text( area,
area, style: TextStyle(
style: TextStyle( fontWeight: MyFontWeight.regular,
fontWeight: MyFontWeight.regular, fontSize: 16.sp,
fontSize: 16.sp, color: Color(0xFF1A1A1A),
color: Color(0xFF1A1A1A), ),
), )),
)),
Icon( Icon(
Icons.keyboard_arrow_right, Icons.keyboard_arrow_right,
size: 18, size: 18,
@ -454,7 +463,9 @@ class _NewLoginPage extends State<NewLoginPage> {
height: 1.h, height: 1.h,
width: MediaQuery.of(context).size.width - 80.h, width: MediaQuery.of(context).size.width - 80.h,
// color: statusPhoneLineColor, // color: statusPhoneLineColor,
color: _controllerPhone.text== "" ? Color(0xFFE7E3E3):Color(0xFF32A060), color: _controllerPhone.text == ""
? Color(0xFFE7E3E3)
: Color(0xFF32A060),
), ),
SizedBox( SizedBox(
height: 30.h, height: 30.h,
@ -680,8 +691,8 @@ class _NewLoginPage extends State<NewLoginPage> {
// Navigator.of(context).pop(); // Navigator.of(context).pop();
// } else { // } else {
ExamineInstance.instance.isExamine = true; ExamineInstance.instance.isExamine = true;
Navigator.of(context) Navigator.of(context)
.popAndPushNamed('/router/main_page'); .popAndPushNamed('/router/main_page');
// } // }
}, },
child: Container( child: Container(
@ -732,7 +743,7 @@ class _NewLoginPage extends State<NewLoginPage> {
showDialog( showDialog(
context: context, context: context,
builder: (BuildContext context) { builder: (BuildContext context) {
return WillPopScope( return WillPopScope(
onWillPop: () async => false, onWillPop: () async => false,
child: SimpleDialog( child: SimpleDialog(
titlePadding: EdgeInsets.all(10), titlePadding: EdgeInsets.all(10),
@ -855,7 +866,7 @@ class _NewLoginPage extends State<NewLoginPage> {
}); });
SharesdkPlugin.uploadPrivacyPermissionStatus( SharesdkPlugin.uploadPrivacyPermissionStatus(
1, 1,
(success) => { (success) => {
Navigator.of(context).pop(), Navigator.of(context).pop(),
}, },
); );

10
lib/main.dart

@ -110,6 +110,8 @@ import 'mine/mine_vip/binding_assistant_card.dart';
import 'mine/mine_vip/legal_right_details.dart'; import 'mine/mine_vip/legal_right_details.dart';
import 'mine/mine_vip/mine_attainment_page.dart'; import 'mine/mine_vip/mine_attainment_page.dart';
import 'mine/mine_vip/mine_vip_core.dart'; import 'mine/mine_vip/mine_vip_core.dart';
import 'mine/scan_web.dart';
import 'mine/vip_pay_code.dart';
import 'order/bargain_group_order.dart'; import 'order/bargain_group_order.dart';
import 'mine/personal_page.dart'; import 'mine/personal_page.dart';
import 'order/exchange_write_off_page.dart'; import 'order/exchange_write_off_page.dart';
@ -323,7 +325,7 @@ Map<String, WidgetBuilder> routers = <String, WidgetBuilder>{
'/router/help_feedback_page': (context, {arguments}) => HelpFeedbackPage(), '/router/help_feedback_page': (context, {arguments}) => HelpFeedbackPage(),
'/router/founder_story_page': (context, {arguments}) => FounderStoryPage(), '/router/founder_story_page': (context, {arguments}) => FounderStoryPage(),
'/router/system_msg_page': (context, {arguments}) => SystemMessagePage(), '/router/system_msg_page': (context, {arguments}) => SystemMessagePage(),
'/router/edit_remarks_page': (context, {arguments}) => EditRemarksPage(), '/router/edit_remarks_page': (context, {arguments}) => EditRemarksPage(arguments: arguments),
// '/router/hot_article_page': (context, {arguments}) => HotArticlePage(), // '/router/hot_article_page': (context, {arguments}) => HotArticlePage(),
'/router/address_map_page': (context, {arguments}) => AddressMapPage(), '/router/address_map_page': (context, {arguments}) => AddressMapPage(),
'/router/roll_center_page': (context, {arguments}) => RollCenterPage(), '/router/roll_center_page': (context, {arguments}) => RollCenterPage(),
@ -348,7 +350,7 @@ Map<String, WidgetBuilder> routers = <String, WidgetBuilder>{
'/router/qr_share': (context, {arguments}) => QrSharePage(), '/router/qr_share': (context, {arguments}) => QrSharePage(),
'/router/main_page': (context, {arguments}) => MainPage(arguments: arguments), '/router/main_page': (context, {arguments}) => MainPage(arguments: arguments),
'/router/test_page': (context, {arguments}) => TestPage(), '/router/test_page': (context, {arguments}) => TestPage(),
'/router/communityFollow': (context, {arguments}) => CommunityFollow(), '/router/communityFollow': (context, {arguments}) => CommunityFollow(arguments:arguments),
'/router/releasePage': (context, {arguments}) => ReleasePage(), '/router/releasePage': (context, {arguments}) => ReleasePage(),
'/router/activity_list': (context, {arguments}) => ActivityList(), '/router/activity_list': (context, {arguments}) => ActivityList(),
'/router/class_details': (context, {arguments}) => '/router/class_details': (context, {arguments}) =>
@ -417,4 +419,8 @@ Map<String, WidgetBuilder> routers = <String, WidgetBuilder>{
UserVipServicePage(), UserVipServicePage(),
'/router/help_farmers_page': (context, {arguments}) => '/router/help_farmers_page': (context, {arguments}) =>
HelpFarmersPage(), HelpFarmersPage(),
'/router/scan_web': (context, {arguments}) =>
ScanWeb(arguments:arguments),
'/router/vip_pay_code': (context, {arguments}) =>
VipPayCode(),
}; };

6
lib/main_page.dart

@ -204,7 +204,7 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
myLocPlugin.authAK("ylW2QPlsbERkho7jOgU4GQSeawmdUIoR"); myLocPlugin.authAK("ylW2QPlsbERkho7jOgU4GQSeawmdUIoR");
BMFMapSDK.setApiKeyAndCoordType( BMFMapSDK.setApiKeyAndCoordType(
'ylW2QPlsbERkho7jOgU4GQSeawmdUIoR', 'ylW2QPlsbERkho7jOgU4GQSeawmdUIoR',
BMF_COORD_TYPE.COMMON, BMF_COORD_TYPE.BD09LL,
); );
} else if (Platform.isAndroid) { } else if (Platform.isAndroid) {
BMFMapSDK.setCoordType(BMF_COORD_TYPE.BD09LL); BMFMapSDK.setCoordType(BMF_COORD_TYPE.BD09LL);
@ -297,8 +297,10 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
params["activityId"] = pushMap["info"]; params["activityId"] = pushMap["info"];
break; break;
case 3: case 3:
routeName = "/router/union_detail_page"; routeName = "/router/store_order";
params["id"] = pushMap["info"]; params["id"] = pushMap["info"];
params["tenant"] = pushMap["tenant"];
params["storeName"] = pushMap["storeName"];
break; break;
case 4: case 4:
routeName = "/router/integral_store_page"; routeName = "/router/integral_store_page";

1034
lib/message/system_details.dart

File diff suppressed because it is too large Load Diff

712
lib/message/system_message.dart

@ -28,13 +28,13 @@ class _SystemMessagePage extends State<SystemMessagePage> {
ApiService apiService; ApiService apiService;
int pageNum = 1; int pageNum = 1;
List<Message> messages = []; List<Message> messages = [];
Map <String,int> msgNumber = { Map<String, int> msgNumber = {
"1":0, "1": 0,
"2":0, "2": 0,
"3":0, "3": 0,
"4":0, "4": 0,
"5":0, "5": 0,
"6":0, "6": 0,
}; };
int state = 0; int state = 0;
@ -75,7 +75,7 @@ class _SystemMessagePage extends State<SystemMessagePage> {
List<Message> message = []; List<Message> message = [];
message.addAll(baseData.data.list); message.addAll(baseData.data.list);
message.forEach((element) { message.forEach((element) {
if(element.typed==2 || element.typed==3){ if (element.typed == 2 || element.typed == 3) {
messages.add(element); messages.add(element);
} }
}); });
@ -102,14 +102,15 @@ class _SystemMessagePage extends State<SystemMessagePage> {
token: value.getString("token"), token: value.getString("token"),
); );
} }
BaseData<List<MsgStats>> baseData = await apiService.stats().catchError((onError) {}); BaseData<List<MsgStats>> baseData =
await apiService.stats().catchError((onError) {});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
setState(() { setState(() {
msgNumber.forEach((key, value) { msgNumber.forEach((key, value) {
msgNumber[key] = 0; msgNumber[key] = 0;
}); });
baseData.data.forEach((element) { baseData.data.forEach((element) {
if(msgNumber.containsKey(element.name)){ if (msgNumber.containsKey(element.name)) {
msgNumber[element.name] = element.number; msgNumber[element.name] = element.number;
} }
}); });
@ -124,40 +125,35 @@ class _SystemMessagePage extends State<SystemMessagePage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return WillPopScope( return Scaffold(
onWillPop: () async { // appBar: MyAppBar(
Navigator.of(context).pop(true); // background: Colors.white,
return false; // leadingColor: Colors.black,
}, // title: S.of(context).xiaoxi,
child:Scaffold( // titleSize: 18.sp,
appBar: MyAppBar( // titleColor: Colors.black,
background: Colors.white, // actions: [
leadingColor: Colors.black, // Container(
title: S.of(context).xiaoxi, // margin: EdgeInsets.only(right: 16.w),
titleSize: 18.sp, // alignment: Alignment.centerRight,
titleColor: Colors.black, // child: GestureDetector(
actions: [ // onTap: () {
Container( // setState(() {
margin: EdgeInsets.only(right: 16.w), // queryMsgStats();
alignment: Alignment.centerRight, // });
child: GestureDetector( // },
onTap: () { // child: Text(
setState(() { // S.of(context).biaoweiyidu,
queryMsgStats(); // style: TextStyle(
}); // fontSize: 16.sp,
}, // fontWeight:MyFontWeight.semi_bold,
child: Text( // color: Color(0xFF353535),
S.of(context).biaojiweiyidu, // ),
style: TextStyle( // ),
fontSize: 16.sp, // ),
fontWeight:MyFontWeight.semi_bold, // ),
color: Color(0xFF353535), // ],
), // ),
),
),
),
],
),
body: SmartRefresher( body: SmartRefresher(
enablePullDown: true, enablePullDown: true,
enablePullUp: true, enablePullUp: true,
@ -166,7 +162,7 @@ class _SystemMessagePage extends State<SystemMessagePage> {
footer: CustomFooter( footer: CustomFooter(
loadStyle: LoadStyle.ShowWhenLoading, loadStyle: LoadStyle.ShowWhenLoading,
builder: (BuildContext context, LoadStatus mode) { builder: (BuildContext context, LoadStatus mode) {
return (messages.length == 0)?Container():MyFooter(mode); return (messages.length == 0) ? Container() : MyFooter(mode);
}, },
), ),
controller: _refreshController, controller: _refreshController,
@ -180,264 +176,317 @@ class _SystemMessagePage extends State<SystemMessagePage> {
child: SingleChildScrollView( child: SingleChildScrollView(
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
child: Container( child: Container(
padding: EdgeInsets.only(bottom: 30.h),
child: Column( child: Column(
children: [ children: [
Container(
color: Colors.white,
padding: EdgeInsets.only(
top: MediaQuery.of(context).padding.top + 10.h,
bottom: 15.h,right: 16.w),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
Navigator.of(context).pop();
},
child: Container(
alignment: Alignment.centerRight,
margin: EdgeInsets.only(left: 12,),
padding: EdgeInsets.all(6),
child: Icon(
Icons.arrow_back_ios,
color: Colors.black,
size: 24,
),
),
),
Spacer(),
Expanded(
child: Text(
S.of(context).xiaoxi,
style: TextStyle(
color: Colors.black,
fontSize: 16.sp,
fontWeight: MyFontWeight.regular,
),
)),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
setState(() {
queryMsgStats();
});
},
child: Container(
padding: EdgeInsets.symmetric(horizontal: 10.w),
child: Text(
S.of(context).biaoweiyidu,
style: TextStyle(
color: Colors.black,
fontSize: 16.sp,
fontWeight: FontWeight.bold,
),
),
),
),
],
),
),
newsSurvey(), newsSurvey(),
SizedBox(height: 16.h,), SizedBox(
height: 16.h,
),
buildMessage(), buildMessage(),
], ],
), ),
), ),
), ),
), ),
), ),
)); );
} }
Widget newsSurvey(){ Widget newsSurvey() {
return Container( return Container(
color: Colors.white, color: Colors.white,
padding: EdgeInsets.only(top: 16.h,bottom: 16.h), padding: EdgeInsets.only(top: 16.h, bottom: 16.h),
child: Row( child: Row(
children: [ children: [
Expanded(child: GestureDetector( Expanded(
onTap: (){ child: GestureDetector(
Navigator.of(context) onTap: () {
.pushNamed('/router/system_details',arguments: {"msgType":5}).then((value) { Navigator.of(context).pushNamed('/router/system_details',
setState(() { arguments: {"msgType": 5}).then((value) {
msgNumber["5"] = 0; setState(() {
msgNumber["5"] = 0;
});
}); });
}); },
}, child: Column(
child:Column( children: [
children: [ Stack(
Stack( children: [
children: [ Image.asset(
Image.asset( "assets/image/icon_z.webp",
"assets/image/icon_z.webp", width: 40,
width: 40, height: 40,
height: 40,
),
if(msgNumber["5"].toString() != "0")
Container(
width:48,
alignment: Alignment.topRight,
child:Container(
width:20,
height:17,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(100),
border: Border.all(
width: 1,
color: Colors.white,
style: BorderStyle.solid,
),
color:Color(0xFFFF441A),
), ),
child:RoundButton( if (msgNumber["5"].toString() != "0")
text:msgNumber["5"].toString(), Container(
textColor: Colors.white, width: 48,
fontWeight: MyFontWeight.regular, alignment: Alignment.topRight,
backgroup: Color(0xFFFF441A), child: Container(
fontSize:8.sp, width: 20,
radius: 100, height: 17,
) decoration: BoxDecoration(
borderRadius: BorderRadius.circular(100),
border: Border.all(
width: 1,
color: Colors.white,
style: BorderStyle.solid,
),
color: Color(0xFFFF441A),
),
child: RoundButton(
text: msgNumber["5"].toString(),
textColor: Colors.white,
fontWeight: MyFontWeight.regular,
backgroup: Color(0xFFFF441A),
fontSize: 8.sp,
radius: 100,
)),
)
],
), ),
) SizedBox(height: 6.h),
], Text(
), S.of(context).dianzan,
SizedBox(height: 6.h), style: TextStyle(
Text( fontSize: 14.sp,
S.of(context).dianzan, fontWeight: MyFontWeight.medium,
style: TextStyle( color: Color(0xFF060606),
fontSize: 14.sp,
fontWeight:MyFontWeight.medium,
color: Color(0xFF060606),
),
)
],
)
)
),
Expanded(child:
GestureDetector(
onTap: (){
Navigator.of(context)
.pushNamed('/router/system_details',arguments: {"msgType":6}).then((value) {
setState(() {
msgNumber["6"] = 0;
});
});
},
child: Column(
children: [
Stack(
children: [
Image.asset(
"assets/image/icon_pl.webp",
width: 40,
height: 40,
), ),
if(msgNumber["6"].toString() != "0") )
Container( ],
width:48, ))),
alignment: Alignment.topRight, Expanded(
child:Container( child: GestureDetector(
width:16, onTap: () {
height:16, Navigator.of(context).pushNamed('/router/system_details',
decoration: BoxDecoration( arguments: {"msgType": 6}).then((value) {
borderRadius: BorderRadius.circular(100), setState(() {
border: Border.all( msgNumber["6"] = 0;
width: 1, });
color: Colors.white, });
style: BorderStyle.solid, },
), child: Column(
color:Color(0xFFFF441A), children: [
), Stack(
child:RoundButton( children: [
text: msgNumber["6"].toString(), Image.asset(
textColor: Colors.white, "assets/image/icon_pl.webp",
fontWeight: MyFontWeight.regular, width: 40,
backgroup: Color(0xFFFF441A), height: 40,
fontSize:8.sp,
radius: 100,
)
), ),
) if (msgNumber["6"].toString() != "0")
], Container(
), width: 48,
SizedBox(height: 6.h), alignment: Alignment.topRight,
Text( child: Container(
S.of(context).pinglun, width: 16,
style: TextStyle( height: 16,
fontSize: 14.sp, decoration: BoxDecoration(
fontWeight:MyFontWeight.medium, borderRadius: BorderRadius.circular(100),
color: Color(0xFF060606), border: Border.all(
width: 1,
color: Colors.white,
style: BorderStyle.solid,
),
color: Color(0xFFFF441A),
),
child: RoundButton(
text: msgNumber["6"].toString(),
textColor: Colors.white,
fontWeight: MyFontWeight.regular,
backgroup: Color(0xFFFF441A),
fontSize: 8.sp,
radius: 100,
)),
)
],
), ),
), SizedBox(height: 6.h),
], Text(
) S.of(context).pinglun,
)), style: TextStyle(
Expanded(child: fontSize: 14.sp,
GestureDetector( fontWeight: MyFontWeight.medium,
onTap: (){ color: Color(0xFF060606),
Navigator.of(context)
.pushNamed('/router/system_details',arguments: {"msgType":4}).then((value) {
setState(() {
msgNumber["4"] = 0;
});
});
},
child:Column(
children: [
Stack(
children: [
Image.asset(
"assets/image/icon_gz.webp",
width: 40,
height: 40,
), ),
if(msgNumber["4"].toString() != "0") ),
Container( ],
width:48, ))),
alignment: Alignment.topRight, Expanded(
child:Container( child: GestureDetector(
width:16, onTap: () {
height:16, Navigator.of(context).pushNamed('/router/system_details',
decoration: BoxDecoration( arguments: {"msgType": 4}).then((value) {
borderRadius: BorderRadius.circular(100), setState(() {
border: Border.all( msgNumber["4"] = 0;
width: 1, });
color: Colors.white, });
style: BorderStyle.solid, },
), child: Column(
color:Color(0xFFFF441A), children: [
), Stack(
child:RoundButton( children: [
text: msgNumber["4"].toString(), Image.asset(
textColor: Colors.white, "assets/image/icon_gz.webp",
fontWeight: MyFontWeight.regular, width: 40,
backgroup: Color(0xFFFF441A), height: 40,
fontSize:8.sp,
radius: 100,
)
), ),
) if (msgNumber["4"].toString() != "0")
], Container(
), width: 48,
SizedBox(height: 6.h), alignment: Alignment.topRight,
Text( child: Container(
S.of(context).guanzhu, width: 16,
style: TextStyle( height: 16,
fontSize: 14.sp, decoration: BoxDecoration(
fontWeight:MyFontWeight.medium, borderRadius: BorderRadius.circular(100),
color: Color(0xFF060606), border: Border.all(
width: 1,
color: Colors.white,
style: BorderStyle.solid,
),
color: Color(0xFFFF441A),
),
child: RoundButton(
text: msgNumber["4"].toString(),
textColor: Colors.white,
fontWeight: MyFontWeight.regular,
backgroup: Color(0xFFFF441A),
fontSize: 8.sp,
radius: 100,
)),
)
],
), ),
), SizedBox(height: 6.h),
], Text(
) S.of(context).guanzhu,
) style: TextStyle(
), fontSize: 14.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF060606),
),
),
],
))),
], ],
), ),
); );
} }
Widget buildMessage(){ Widget buildMessage() {
return Container( return Container(
color: Colors.white, color: Colors.white,
width: double.infinity, width: double.infinity,
padding: EdgeInsets.all(20.w), padding: EdgeInsets.all(20.w),
child:Column( child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
S.of(context).xitongxiaoxi, S.of(context).xitongxiaoxi,
style: TextStyle( style: TextStyle(
fontSize: 16.sp, fontSize: 16.sp,
fontWeight:MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
color: Colors.black, color: Colors.black,
),
), ),
), (messages == null || messages.length == 0)
(messages == null || messages.length == 0) ? NoDataView(
? NoDataView( src: "assets/image/icon_empty.webp",
src: "assets/image/icon_empty.webp", isShowBtn: false,
isShowBtn: false, text: S.of(context).haimeiyouxiaoxi,
text: S.of(context).haimeiyouxiaoxi, fontSize: 16.sp,
fontSize: 16.sp, margin: EdgeInsets.only(top: 120.h),
margin: EdgeInsets.only(top: 120.h), )
) : ListView.builder(
:ListView.builder( padding: EdgeInsets.only(top: 16),
padding: EdgeInsets.only(top: 16), itemCount: messages.length,
itemCount: messages.length, shrinkWrap: true,
shrinkWrap: true, physics: NeverScrollableScrollPhysics(),
physics: NeverScrollableScrollPhysics(), itemBuilder: (context, position) {
itemBuilder: (context, position) { return GestureDetector(
return GestureDetector( onTap: () {
onTap: () { if (messages[position].typed == 2)
if(messages[position].typed == 2) Navigator.of(context).pushNamed(
Navigator.of(context) '/router/system_details',
.pushNamed('/router/system_details',arguments: {"msgType":2}).then((value) { arguments: {"msgType": 2}).then((value) {
setState(() { setState(() {
msgNumber["2"] = 0; msgNumber["2"] = 0;
}); });
}); });
else if(messages[position].typed == 3) else if (messages[position].typed == 3)
Navigator.of(context) Navigator.of(context).pushNamed(
.pushNamed('/router/system_details',arguments: {"msgType":3}).then((value) { '/router/system_details',
setState(() { arguments: {"msgType": 3}).then((value) {
msgNumber["3"] = 0; setState(() {
}); msgNumber["3"] = 0;
}); });
}, });
child: buildMessageItem(messages[position]), },
); child: buildMessageItem(messages[position]),
}), );
], }),
) ],
); ));
} }
Widget buildMessageItem(Message message) { Widget buildMessageItem(Message message) {
@ -469,26 +518,28 @@ class _SystemMessagePage extends State<SystemMessagePage> {
(message.typed == 1) (message.typed == 1)
? "assets/image/icon_system_message.webp" ? "assets/image/icon_system_message.webp"
: (message.typed == 2) : (message.typed == 2)
? "assets/image/icon_system_message.webp" ? "assets/image/icon_system_message.webp"
: "assets/image/c_z.webp", : "assets/image/c_z.webp",
width: 40.w, width: 40.w,
height: 40.h, height: 40.h,
), ),
SizedBox( SizedBox(
width:12.w, width: 12.w,
), ),
Expanded(child:Column( Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Row( Row(
children: [ children: [
Expanded(child:Text( Expanded(
child: Text(
(message.typed == 1) (message.typed == 1)
? S.of(context).xitongtongzhi ? S.of(context).xitongtongzhi
: (message.typed == 2) : (message.typed == 2)
? S.of(context).dingdanxiaoxi ? S.of(context).dingdanxiaoxi
: S.of(context).chongzhixiaoxi, : S.of(context).chongzhixiaoxi,
style: TextStyle( style: TextStyle(
fontSize: 14.sp, fontSize: 14.sp,
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
@ -504,64 +555,67 @@ class _SystemMessagePage extends State<SystemMessagePage> {
), ),
], ],
), ),
SizedBox(height:4.h,), SizedBox(
(message.typed != 3) ? height: 4.h,
Row(
mainAxisAlignment: MainAxisAlignment.center,
// crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(child:
Text(
S.of(context).ninyouyigexindedingdan,
style: TextStyle(
fontSize: 10.sp,
color: Color(0xFF353535),
),
),),
if(msgNumber["2"].toString() != "0")
RoundButton(
width: 16,
height: 16,
text:msgNumber["2"].toString(),
textColor: Colors.white,
fontWeight: MyFontWeight.regular,
backgroup: Color(0xFFFF441A),
fontSize:10.sp,
radius: 100,
),
],
):
Row(
mainAxisAlignment: MainAxisAlignment.center,
// crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(child:
Text(
message.content,
style: TextStyle(
fontSize: 10.sp,
color: Color(0xFF353535),
),
)),
if(msgNumber["3"].toString() != "0")
RoundButton(
width: 16,
height: 16,
text:msgNumber["3"].toString(),
textColor: Colors.white,
fontWeight: MyFontWeight.regular,
backgroup: Color(0xFFFF441A),
fontSize:10.sp,
radius: 100,
),
],
), ),
(message.typed != 3)
? Row(
mainAxisAlignment: MainAxisAlignment.center,
// crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Text(
S.of(context).ninyouyigexindedingdan,
style: TextStyle(
fontSize: 10.sp,
color: Color(0xFF353535),
),
),
),
if (msgNumber["2"].toString() != "0")
RoundButton(
width: 16,
height: 16,
text: msgNumber["2"].toString(),
textColor: Colors.white,
fontWeight: MyFontWeight.regular,
backgroup: Color(0xFFFF441A),
fontSize: 10.sp,
radius: 100,
),
],
)
: Row(
mainAxisAlignment: MainAxisAlignment.center,
// crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Text(
message.content,
style: TextStyle(
fontSize: 10.sp,
color: Color(0xFF353535),
),
)),
if (msgNumber["3"].toString() != "0")
RoundButton(
width: 16,
height: 16,
text: msgNumber["3"].toString(),
textColor: Colors.white,
fontWeight: MyFontWeight.regular,
backgroup: Color(0xFFFF441A),
fontSize: 10.sp,
radius: 100,
),
],
),
], ],
)), )),
], ],
), ),
Container( Container(
margin: EdgeInsets.only(top: 16.h,bottom:8.h), margin: EdgeInsets.only(top: 16.h, bottom: 8.h),
height: 1.h, height: 1.h,
width: double.infinity, width: double.infinity,
color: Color(0xFFF7F7F7), color: Color(0xFFF7F7F7),

164
lib/mine/mine_page.dart

@ -8,6 +8,7 @@ import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/main.dart'; import 'package:huixiang/main.dart';
import 'package:huixiang/mine/mine_view/mine_calendar.dart'; import 'package:huixiang/mine/mine_view/mine_calendar.dart';
import 'package:huixiang/mine/mine_view/mine_navbar.dart';
import 'package:huixiang/mine/mine_view/mine_order.dart'; import 'package:huixiang/mine/mine_view/mine_order.dart';
import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/examine_instance.dart'; import 'package:huixiang/retrofit/data/examine_instance.dart';
@ -26,13 +27,15 @@ 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/coupon.dart';
import '../retrofit/data/page.dart';
import '../utils/flutter_utils.dart'; import '../utils/flutter_utils.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';
class MinePage extends StatefulWidget { class MinePage extends StatefulWidget {
MinePage(Key key) : super(key: key);
MinePage(Key key): super(key: key);
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
return MinePageState(); return MinePageState();
@ -46,17 +49,21 @@ class MinePageState extends State<MinePage> with AutomaticKeepAliveClientMixin {
SocialInfo infoNumber; SocialInfo infoNumber;
final RefreshController _refreshController = RefreshController(); final RefreshController _refreshController = RefreshController();
int totalMsg = 0; int totalMsg = 0;
String couponNum;
_toUserInfo() async { _toUserInfo() async {
SharedPreferences shared = await SharedPreferences.getInstance(); SharedPreferences shared = await SharedPreferences.getInstance();
if (shared.getString("token") == null || shared.getString("token") == "") { if (shared.getString("token") == null || shared.getString("token") == "") {
Navigator.of(context) Navigator.of(context).pushReplacementNamed('/router/new_login_page',
.pushReplacementNamed('/router/new_login_page', arguments: {"login": "login"}); arguments: {"login": "login"});
return; return;
} }
(Platform.isAndroid&&ExamineInstance.instance.isExamine)? (Platform.isAndroid && ExamineInstance.instance.isExamine)
await Navigator.of(context).pushNamed('/router/user_info_page'): ? await Navigator.of(context).pushNamed('/router/user_info_page')
await Navigator.of(context).pushNamed('/router/personal_page',arguments:{"memberId":"0",}); : await Navigator.of(context)
.pushNamed('/router/personal_page', arguments: {
"memberId": "0",
});
setState(() {}); setState(() {});
} }
@ -71,6 +78,7 @@ class MinePageState extends State<MinePage> with AutomaticKeepAliveClientMixin {
super.initState(); super.initState();
querySocialInfo(); querySocialInfo();
queryMsgStats(); queryMsgStats();
// queryCard();
eventBus.on<EventType>().listen((event) { eventBus.on<EventType>().listen((event) {
print("EventType: ${event.type}"); print("EventType: ${event.type}");
@ -101,8 +109,8 @@ class MinePageState extends State<MinePage> with AutomaticKeepAliveClientMixin {
BaseData<List<Rank>> rankData = BaseData<List<Rank>> rankData =
await apiService.rankList().catchError((onError) { await apiService.rankList().catchError((onError) {
SmartDialog.showToast(AppUtils.dioErrorTypeToString(onError.type), SmartDialog.showToast(AppUtils.dioErrorTypeToString(onError.type),
alignment: Alignment.center); alignment: Alignment.center);
_refreshController.refreshFailed(); _refreshController.refreshFailed();
}); });
if (rankData != null && rankData.isSuccess) { if (rankData != null && rankData.isSuccess) {
@ -110,6 +118,22 @@ class MinePageState extends State<MinePage> with AutomaticKeepAliveClientMixin {
ranks.addAll(rankData.data); ranks.addAll(rankData.data);
} }
BaseData<PageInfo<Coupon>> baseData = await apiService.queryCard({
"centre": true,
"pageNum": 1,
"pageSize": 10,
"searchKey": "",
"state": 1
}).catchError((error) {
_refreshController.refreshFailed();
});
if (baseData != null && baseData.isSuccess) {
couponNum = baseData.data.total;
_refreshController.refreshCompleted();
} else {
_refreshController.refreshFailed();
}
BaseData<UserInfo> baseDate = BaseData<UserInfo> baseDate =
await apiService.queryInfo().catchError((onError) { await apiService.queryInfo().catchError((onError) {
_refreshController.refreshFailed(); _refreshController.refreshFailed();
@ -165,7 +189,8 @@ class MinePageState extends State<MinePage> with AutomaticKeepAliveClientMixin {
token: value.getString("token"), token: value.getString("token"),
); );
} }
BaseData<List<MsgStats>> baseData = await apiService.stats().catchError((onError) {}); BaseData<List<MsgStats>> baseData =
await apiService.stats().catchError((onError) {});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
setState(() { setState(() {
totalMsg = 0; totalMsg = 0;
@ -199,57 +224,59 @@ class MinePageState extends State<MinePage> with AutomaticKeepAliveClientMixin {
child: SingleChildScrollView( child: SingleChildScrollView(
child: Container( child: Container(
child: Stack( child: Stack(
// alignment: Alignment.centerRight,
children: [ children: [
Container( Container(
height: 502.h, height: 306.h,
decoration: BoxDecoration( decoration: BoxDecoration(
// color: Color(0xFF32A060) // color: Color(0xFF32A060)
image: DecorationImage( image: DecorationImage(
fit: BoxFit.cover, fit: BoxFit.fill,
image: AssetImage("assets/image/settlement_bg.webp"), image: AssetImage("assets/image/settlement_bg.webp"),
),
), ),
),
), ),
FutureBuilder( FutureBuilder(
future: queryUserInfo(), future: queryUserInfo(),
builder: (context, snapshot) { builder: (context, snapshot) {
return Column( return Column(
children: [ children: [
/// ///
MineView( MineView(userInfo, () {
userInfo, _toUserInfo();
() { }, () {
_toUserInfo(); toIntegralPage();
}, }, () {
() { setState(() {
toIntegralPage(); totalMsg = 0;
}, });
(){ }, totalMsg,
setState(() { infoNumber,
totalMsg =0; ranks
});
},
totalMsg,
infoNumber
), ),
/// VIP等级信息 //////
MineVipEntry( MineNavbar(
tag: "vip", couponNum,
ranks: ranks, userInfo,
userInfo: userInfo, infoNumber,
rank: double.tryParse( () {
userInfo?.expendAmount ?? "0") toIntegralPage();
.toInt(), },
rankMax:
userInfo?.memberRankVo?.nextOrigin ?? 0,
createTime: userInfo?.createTime ?? "",
), ),
/// VIP等级信息
// MineVipEntry(
// tag: "vip",
// ranks: ranks,
// userInfo: userInfo,
// rank: double.tryParse(userInfo?.expendAmount ?? "0")
// .toInt(),
// rankMax: userInfo?.memberRankVo?.nextOrigin ?? 0,
// createTime: userInfo?.createTime ?? "",
// ),
/// ///
MineOrderView(), // MineOrderView(),
///广 ///广
spreadImage(), spreadImage(),
@ -265,7 +292,7 @@ class MinePageState extends State<MinePage> with AutomaticKeepAliveClientMixin {
// ///// // /////
// attention(), // attention(),
//
// /// // ///
// WalletCoupon(), // WalletCoupon(),
], ],
@ -286,15 +313,16 @@ class MinePageState extends State<MinePage> with AutomaticKeepAliveClientMixin {
Widget attainment() { Widget attainment() {
return GestureDetector( return GestureDetector(
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
onTap: (){ onTap: () {
Navigator.of(context).pushNamed( Navigator.of(context).pushNamed(
'/router/mine_attainment_page', '/router/mine_attainment_page',
arguments: {"userInfo": userInfo}, arguments: {"userInfo": userInfo},
); );
}, },
child:Container( child: Container(
margin: EdgeInsets.only(left:16.w,right:16.w,bottom:15.h), margin: EdgeInsets.only(left: 16.w, right: 16.w, bottom: 30.h),
padding: EdgeInsets.only(left:12.w, top:12.h, right:10.w,bottom: 17.h), padding:
EdgeInsets.only(left: 12.w, top: 12.h, right: 10.w, bottom: 17.h),
width: double.infinity, width: double.infinity,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
@ -320,34 +348,38 @@ class MinePageState extends State<MinePage> with AutomaticKeepAliveClientMixin {
color: Color(0xFF0D0D0D), color: Color(0xFF0D0D0D),
), ),
), ),
SizedBox(height: 9.h,), SizedBox(
height: 9.h,
),
Row( Row(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
Image.asset( Image.asset(
"assets/image/icon_attainment.webp", "assets/image/icon_attainment.webp",
width:54, width: 54,
height:54, height: 54,
fit: BoxFit.cover, fit: BoxFit.cover,
), ),
SizedBox(width: 7.w,), SizedBox(
Expanded(child: width: 7.w,
Column( ),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
Text( Text(
"已解锁${infoNumber != null "已解锁${infoNumber != null ? infoNumber.achievementNumber.toString() : "0"}个成就",
? infoNumber.achievementNumber.toString()
: "0"}",
style: TextStyle( style: TextStyle(
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
fontSize: 14.sp, fontSize: 14.sp,
color: Color(0xFF262626), color: Color(0xFF262626),
), ),
), ),
SizedBox(height:4.w,), SizedBox(
height: 4.w,
),
Text( Text(
"完成任务解锁更多成就", "完成任务解锁更多成就",
style: TextStyle( style: TextStyle(
@ -390,17 +422,17 @@ class MinePageState extends State<MinePage> with AutomaticKeepAliveClientMixin {
///广 ///广
Widget spreadImage() { Widget spreadImage() {
return Container( return Container(
margin: EdgeInsets.only(right:14.w,bottom:15.h,left: 14.w), margin: EdgeInsets.only(right: 14.w, bottom: 30.h, left: 14.w),
child: GestureDetector( child: GestureDetector(
onTap: (){ onTap: () {
Navigator.of(context).pushNamed('/router/invite_friends'); Navigator.of(context).pushNamed('/router/invite_friends');
}, },
child:ClipRRect( child: ClipRRect(
child:Image.asset( child: Image.asset(
"assets/image/welfare_spread.webp", "assets/image/welfare_spread.webp",
width:double.infinity, width: double.infinity,
fit: BoxFit.fill, fit: BoxFit.fill,
height:80.h, height: 80.h,
), ),
borderRadius: BorderRadius.circular(6.w), borderRadius: BorderRadius.circular(6.w),
), ),

8
lib/mine/mine_view/community_follow.dart

@ -14,6 +14,11 @@ import 'package:shared_preferences/shared_preferences.dart';
import '../fans_page.dart'; import '../fans_page.dart';
class CommunityFollow extends StatefulWidget { class CommunityFollow extends StatefulWidget {
final Map<String, dynamic> arguments;
CommunityFollow({this.arguments});
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
return _CommunityFollow(); return _CommunityFollow();
@ -24,11 +29,13 @@ class _CommunityFollow extends State<CommunityFollow>
with SingleTickerProviderStateMixin, AutomaticKeepAliveClientMixin { with SingleTickerProviderStateMixin, AutomaticKeepAliveClientMixin {
ApiService apiService; ApiService apiService;
SocialInfo infoNumber; SocialInfo infoNumber;
int status;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
querySocialInfo(); querySocialInfo();
status = widget.arguments["status"];
} }
///(//) ///(//)
@ -51,6 +58,7 @@ class _CommunityFollow extends State<CommunityFollow>
Widget build(BuildContext context) { Widget build(BuildContext context) {
return DefaultTabController( return DefaultTabController(
length: 2, length: 2,
initialIndex: status,
child: Scaffold( child: Scaffold(
appBar: MyAppBar( appBar: MyAppBar(
title: "", title: "",

2
lib/mine/mine_view/mine_item.dart

@ -20,7 +20,7 @@ class _MineItem extends State<MineItem> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
margin: EdgeInsets.fromLTRB(16.w,0.h, 16.w, 15.h), margin: EdgeInsets.fromLTRB(16.w,0.h, 16.w,30.h),
// padding: EdgeInsets.fromLTRB(20.w, 12.h, 20.w, 12.h), // padding: EdgeInsets.fromLTRB(20.w, 12.h, 20.w, 12.h),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,

301
lib/mine/mine_view/mine_navbar.dart

@ -0,0 +1,301 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/login_tips_dialog.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import '../../retrofit/data/social_info.dart';
import '../../retrofit/data/user_info.dart';
class MineNavbar extends StatefulWidget {
final String couponNum;
final UserInfo userInfo;
final SocialInfo infoNumber;
final GestureTapCallback toIntegralPage;
MineNavbar(this.couponNum,this.userInfo,this.infoNumber,this.toIntegralPage);
@override
State<StatefulWidget> createState() {
return _MineNavbar();
}
}
class _MineNavbar extends State<MineNavbar> {
@override
Widget build(BuildContext context) {
return Container(
margin: EdgeInsets.fromLTRB(13.5.w, 15.h, 13.5.w,30.h),
padding: EdgeInsets.only(
top: 26.h,
bottom: 24.h,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(6),
boxShadow: [
BoxShadow(
color: Color(0x08213303).withAlpha(12),
offset: Offset(0, 2),
blurRadius: 4,
spreadRadius: 0,
),
],
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
///
Expanded(
child: InkWell(
onTap: () {
SharedPreferences.getInstance().then((value) {
if (value.getString("token") == null ||
value.getString("token") == "") {
LoginTipsDialog().show(context);
return;
}
Navigator.of(context).pushNamed(
'/router/order_history_page',
arguments: {"status": 0});
});
},
child: mineTopItem(
S.of(context).dingdan,
"assets/image/mine_order.webp",
),
),
),
///
Expanded(
child: InkWell(
onTap: () {
SharedPreferences.getInstance().then((value) {
if (value.getString("token") == null ||
value.getString("token") == "") {
LoginTipsDialog().show(context);
return;
}
Navigator.of(context).pushNamed('/router/mine_wallet');
});
},
child: mineTopItem(
"钱包",
"assets/image/wallet.webp",
),
),
),
///
Expanded(
child: InkWell(
onTap: () {
SharedPreferences.getInstance().then((value) {
if (value.getString("token") == null ||
value.getString("token") == "") {
LoginTipsDialog().show(context);
return;
}
Navigator.of(context).pushNamed('/router/vip_pay_code');
});
},
child: mineTopItem(
"会员码",
"assets/image/vip_code.webp",
),
),
),
///
Expanded(
child: InkWell(
onTap: () {
SharedPreferences.getInstance().then((value) {
if (value.getString("token") == null ||
value.getString("token") == "") {
LoginTipsDialog().show(context);
return;
}
Navigator.of(context).pushNamed('/router/setting_page');
});
},
child: mineTopItem(
S.of(context).shezhi,
"assets/image/set.webp",
),
),
),
],
),
Container(
width: double.infinity,
margin: EdgeInsets.only(top:17.h,left: 16.w,right: 16.w,bottom: 27.h),
child: Flex(
children: List.generate(120, (_) {
return SizedBox(
width: 1,
height: 1,
child: DecoratedBox(
decoration: BoxDecoration(color: Color(0xFFEDEDED)),
),
);
}),
mainAxisAlignment: MainAxisAlignment.spaceBetween,
direction: Axis.horizontal,
),
),
Row(
children: [
///
Expanded(
child: InkWell(
onTap: () {
SharedPreferences.getInstance().then((value) {
if (value.getString("token") == null ||
value.getString("token") == "") {
LoginTipsDialog().show(context);
return;
}
Navigator.of(context).pushNamed('/router/coupon_page');
});
},
child: mineBottomItem(
widget?.couponNum ?? "0",
S.of(context).youhuiquan,
),
),
),
///
Expanded(
child: InkWell(
onTap: () {
SharedPreferences.getInstance().then((value) {
if (value.getString("token") == null ||
value.getString("token") == "") {
LoginTipsDialog().show(context);
return;
}
widget.toIntegralPage();
});
},
child: mineBottomItem(
widget?.userInfo?.points?? "0",
"积分",
),
),
),
///
Expanded(
child: InkWell(
onTap: () {
SharedPreferences.getInstance().then((value) {
if (value.getString("token") == null ||
value.getString("token") == "") {
LoginTipsDialog().show(context);
return;
}
Navigator.of(context).pushNamed('/router/communityFollow',arguments: {
"status":0
});
});},
child: mineBottomItem(
"${widget?.infoNumber?.follow ?? "0"}",
S.of(context).guanzhu,
),
),
),
///
Expanded(
child: InkWell(
onTap: () {
SharedPreferences.getInstance().then((value) {
if (value.getString("token") == null ||
value.getString("token") == "") {
LoginTipsDialog().show(context);
return;
}
Navigator.of(context).pushNamed('/router/communityFollow',arguments: {
"status":1
});
});
},
child: mineBottomItem(
"${widget?.infoNumber?.fans ?? "0"}",
S.of(context).fensi,
),
),
),
],
)
],
),
);
}
///
Widget mineTopItem(text, icon) {
return Container(
color: Colors.white,
margin: EdgeInsets.symmetric(vertical: 6.h),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Image.asset(
icon,
width: 23,
height: 23,
),
SizedBox(
height: 5.h,
),
Text(
text,
style: TextStyle(
fontWeight: MyFontWeight.semi_bold,
fontSize: 12.sp,
color: Color(0xFF0D0D0D),
),
),
],
),
);
}
///
Widget mineBottomItem(textTop, text) {
return Container(
color: Colors.white,
margin: EdgeInsets.symmetric(vertical: 6.h),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
textTop,
style: TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 18.sp,
color: Color(0xFF000000),
),
),
SizedBox(
height:11.h,
),
Text(
text,
style: TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 12.sp,
color: Color(0xFF4D4D4D),
),
),
],
),
);
}
}

214
lib/mine/mine_view/mine_view.dart

@ -3,12 +3,9 @@ import 'dart:convert';
import 'package:dio/dio.dart'; 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_easyloading/flutter_easyloading.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:flutter_svg/svg.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/msg_stats.dart';
import 'package:huixiang/retrofit/data/social_info.dart'; import 'package:huixiang/retrofit/data/social_info.dart';
import 'package:huixiang/retrofit/data/user_info.dart'; import 'package:huixiang/retrofit/data/user_info.dart';
import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/retrofit/retrofit_api.dart';
@ -21,6 +18,9 @@ import 'package:huixiang/view_widget/request_permission.dart';
import 'package:huixiang/view_widget/round_button.dart'; import 'package:huixiang/view_widget/round_button.dart';
import 'package:permission_handler/permission_handler.dart'; import 'package:permission_handler/permission_handler.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import '../../retrofit/data/rank.dart';
import '../../view_widget/mine_vip_entry.dart';
// import 'package:qrscan/qrscan.dart' as scanner; // import 'package:qrscan/qrscan.dart' as scanner;
class MineView extends StatefulWidget { class MineView extends StatefulWidget {
@ -29,9 +29,11 @@ class MineView extends StatefulWidget {
final GestureTapCallback toIntegralPage; final GestureTapCallback toIntegralPage;
final Function messageZero; final Function messageZero;
final int totalMsg; final int totalMsg;
final SocialInfo infoNumber; final SocialInfo infoNumber;
final List<Rank> ranks;
MineView(this.userInfo, this.toUserInfo, this.toIntegralPage,this.messageZero,this.totalMsg,this.infoNumber); MineView(this.userInfo, this.toUserInfo, this.toIntegralPage,
this.messageZero, this.totalMsg, this.infoNumber,this.ranks);
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
@ -41,6 +43,7 @@ class MineView extends StatefulWidget {
class _MineView extends State<MineView> { class _MineView extends State<MineView> {
ApiService apiService; ApiService apiService;
String levelText = "普通用户";
/// ///
queryWiped(memberCouponId) async { queryWiped(memberCouponId) async {
@ -60,8 +63,6 @@ class _MineView extends State<MineView> {
} }
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Column( return Column(
@ -77,28 +78,30 @@ class _MineView extends State<MineView> {
alignment: Alignment.center, alignment: Alignment.center,
child: GestureDetector( child: GestureDetector(
onTap: () { onTap: () {
Navigator.of(context).pushNamed('/router/system_msg_page').then((value) { Navigator.of(context)
.pushNamed('/router/system_msg_page')
.then((value) {
widget.messageZero(); widget.messageZero();
}); });
}, },
child: Container( child: Container(
height: 24.h, height: 24.h,
alignment:Alignment.center, alignment: Alignment.center,
child:Stack( child: Stack(
children: [ children: [
Image.asset( Image.asset(
"assets/image/icon_notices.webp", "assets/image/icon_notices.webp",
width:32, width: 32,
height: 32, height: 32,
color: Colors.white, color: Colors.white,
), ),
if(widget.totalMsg != 0) if (widget.totalMsg != 0)
Container( Container(
width:36.w, width: 36.w,
alignment: Alignment.topRight, alignment: Alignment.topRight,
child:Container( child: Container(
width:22.w, width: 22.w,
height:14.h, height: 14.h,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(100), borderRadius: BorderRadius.circular(100),
border: Border.all( border: Border.all(
@ -106,23 +109,20 @@ class _MineView extends State<MineView> {
color: Colors.white, color: Colors.white,
style: BorderStyle.solid, style: BorderStyle.solid,
), ),
color:Color(0xFFFF441A), color: Color(0xFFFF441A),
), ),
child:RoundButton( child: RoundButton(
text:widget.totalMsg.toString(), text: widget.totalMsg.toString(),
textColor: Colors.white, textColor: Colors.white,
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
backgroup: Color(0xFFFF441A), backgroup: Color(0xFFFF441A),
fontSize:8.sp, fontSize: 8.sp,
radius: 100, radius: 100,
) )),
),
) )
], ],
), ),
) ))),
)
),
InkWell( InkWell(
onTap: () { onTap: () {
toScan(); toScan();
@ -131,27 +131,27 @@ class _MineView extends State<MineView> {
padding: EdgeInsets.all(8.h), padding: EdgeInsets.all(8.h),
child: Image.asset( child: Image.asset(
"assets/image/icon_scan_qr_code.webp", "assets/image/icon_scan_qr_code.webp",
width:32,
height: 32,
color: Colors.white,
),
),
),
InkWell(
onTap: () {
Navigator.of(context).pushNamed('/router/setting_page');
},
child: Container(
padding: EdgeInsets.all(8.h),
margin: EdgeInsets.only(right: 12.w),
child: Image.asset(
"assets/image/icon_mine_setting.webp",
width: 32, width: 32,
height: 32, height: 32,
color: Colors.white, color: Colors.white,
), ),
), ),
), ),
// InkWell(
// onTap: () {
// Navigator.of(context).pushNamed('/router/setting_page');
// },
// child: Container(
// padding: EdgeInsets.all(8.h),
// margin: EdgeInsets.only(right: 12.w),
// child: Image.asset(
// "assets/image/icon_mine_setting.webp",
// width: 32,
// height: 32,
// color: Colors.white,
// ),
// ),
// ),
], ],
), ),
), ),
@ -184,11 +184,12 @@ class _MineView extends State<MineView> {
} else if (await Permission.camera.isGranted) { } else if (await Permission.camera.isGranted) {
// http://pos.app.gznl.top/placeorder/?tableId=1315903669597634560&tenantCode=1166&shopId=1300372027722432512 // http://pos.app.gznl.top/placeorder/?tableId=1315903669597634560&tenantCode=1166&shopId=1300372027722432512
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;
@ -213,6 +214,19 @@ class _MineView extends State<MineView> {
"tableId": int.tryParse(tableId), "tableId": int.tryParse(tableId),
}, },
); );
return;
}
String title = uri.queryParameters["title"];
if (result.toString().contains("http:") ||
result.toString().contains("https:")) {
///
Navigator.of(context).pushNamed(
'/router/scan_web',
arguments: {
"result": result,
"title":title,
},
);
} }
} else { } else {
await Permission.camera.request(); await Permission.camera.request();
@ -248,21 +262,21 @@ class _MineView extends State<MineView> {
MImage( MImage(
widget.userInfo == null ? "" : widget.userInfo.headimg, widget.userInfo == null ? "" : widget.userInfo.headimg,
isCircle: true, isCircle: true,
width: 58, width: 60,
height: 58, height: 60,
fit: BoxFit.cover, fit: BoxFit.cover,
errorSrc: "assets/image/default_user.webp", errorSrc: "assets/image/default_user.webp",
fadeSrc: "assets/image/default_user.webp", fadeSrc: "assets/image/default_user.webp",
), ),
Positioned( // Positioned(
bottom: 0, // bottom: 0,
right: 2.w, // right: 2.w,
child: Image.asset( // child: Image.asset(
"assets/image/icon_mine_edit.webp", // "assets/image/icon_mine_edit.webp",
width: 17, // width: 17,
height: 17, // height: 17,
), // ),
), // ),
], ],
), ),
), ),
@ -300,7 +314,7 @@ class _MineView extends State<MineView> {
child: Text( child: Text(
widget.userInfo == null widget.userInfo == null
? S.of(context).denglu ? S.of(context).denglu
: "${widget.userInfo.nickname??""}", : "${widget.userInfo.nickname == "" ? "回乡" : widget.userInfo.nickname}",
style: TextStyle( style: TextStyle(
fontSize: 16.sp, fontSize: 16.sp,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
@ -308,12 +322,12 @@ class _MineView extends State<MineView> {
), ),
), ),
), ),
if(widget.userInfo.level != 1) if (widget.userInfo.level != 1)
Image.asset( Image.asset(
"assets/image/icon_user.webp", "assets/image/icon_user.webp",
width: 18.w, width: 18.w,
height: 18.h, height: 18.h,
), ),
], ],
), ),
widget.userInfo == null widget.userInfo == null
@ -325,34 +339,35 @@ class _MineView extends State<MineView> {
color: Color(0xFFFFFFFF), color: Color(0xFFFFFFFF),
), ),
) )
: Row( : mineVip(),
children: [ // Row(
Text( // children: [
"${S.of(context).guanzhu} ${widget?.infoNumber?.follow ?? "0"}", // Text(
style: TextStyle( // "${S.of(context).guanzhu} ${widget?.infoNumber?.follow ?? "0"}",
fontSize: 12.sp, // style: TextStyle(
fontWeight: MyFontWeight.regular, // fontSize: 12.sp,
fontFamily: 'JDZhengHT', // fontWeight: MyFontWeight.regular,
color: Color(0xFFFFFFFF), // fontFamily: 'JDZhengHT',
), // color: Color(0xFFFFFFFF),
), // ),
Container( // ),
width: 1.w, // Container(
height: 12.h, // width: 1.w,
margin: EdgeInsets.symmetric(horizontal: 3.w), // height: 12.h,
color: Color(0xFFFFFFFF), // margin: EdgeInsets.symmetric(horizontal: 3.w),
), // color: Color(0xFFFFFFFF),
Text( // ),
"${S.of(context).fensi} ${widget?.infoNumber?.fans ?? "0"}", // Text(
style: TextStyle( // "${S.of(context).fensi} ${widget?.infoNumber?.fans ?? "0"}",
fontSize: 12.sp, // style: TextStyle(
fontFamily: 'JDZhengHT', // fontSize: 12.sp,
fontWeight: MyFontWeight.regular, // fontFamily: 'JDZhengHT',
color: Color(0xFFFFFFFF), // fontWeight: MyFontWeight.regular,
), // color: Color(0xFFFFFFFF),
), // ),
], // ),
), // ],
// ),
], ],
), ),
), ),
@ -375,12 +390,12 @@ class _MineView extends State<MineView> {
widget.toIntegralPage(); widget.toIntegralPage();
}, },
child: Container( child: Container(
padding: EdgeInsets.only(top: 4.h, bottom: 4.h, right: 16.w,left: 7.w), padding: EdgeInsets.only(
top: 4.h, bottom: 4.h, right: 16.w, left: 7.w),
margin: EdgeInsets.only(right: 14.w), margin: EdgeInsets.only(right: 14.w),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12),
color: Colors.white color: Colors.white),
),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
children: [ children: [
@ -410,4 +425,19 @@ class _MineView extends State<MineView> {
), ),
); );
} }
Widget mineVip(){
return Container(
child: MineVipEntry(
tag: "vip",
ranks: widget.ranks,
userInfo: widget.userInfo,
rank: double.tryParse(widget.userInfo?.expendAmount ?? "0")
.toInt(),
rankMax: widget.userInfo?.memberRankVo?.nextOrigin ?? 0,
createTime: widget.userInfo?.createTime ?? "",
),
);
}
} }

2
lib/mine/mine_wallet_page.dart

@ -458,7 +458,7 @@ class _MineWalletPage extends State<MineWalletPage> {
Expanded( Expanded(
flex: 7, flex: 7,
child: Text( child: Text(
userBill.title, userBill.type,
style: TextStyle( style: TextStyle(
color: Colors.black, color: Colors.black,
fontSize: 12.sp, fontSize: 12.sp,

691
lib/mine/personal_page.dart

@ -98,54 +98,52 @@ class _PersonalPage extends State<PersonalPage> with WidgetsBindingObserver {
/// ///
queryCommunity(String searchKey) async { queryCommunity(String searchKey) async {
if(!isRefresh){ if (!isRefresh) {
isRefresh = true; isRefresh = true;
return; return;
} }
if(isLoadingData){ if (isLoadingData) {
return; return;
} }
isLoadingData = true; isLoadingData = true;
if (apiService == null) { if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance(); SharedPreferences value = await SharedPreferences.getInstance();
userId = value.getString('userId'); userId = value.getString('userId');
apiService = ApiService( apiService = ApiService(Dio(),
Dio(),
context: context, context: context,
token: value.getString("token"), token: value.getString("token"),
showLoading: false showLoading: false);
);
} }
if(isLoadMore){ if (isLoadMore) {
pageNum += 1; pageNum += 1;
isLoadMore = false; isLoadMore = false;
} } else if (searchKey == null) pageNum = 1;
else if(searchKey == null)pageNum = 1;
BaseData<PageInfo<ComunityComment>> baseData = await apiService.trendList({ BaseData<PageInfo<ComunityComment>> baseData = await apiService.trendList({
"mid": memberId == "0" ? userId : memberId, "mid": memberId == "0" ? userId : memberId,
"onlyFollow": false, "onlyFollow": false,
"onlyMe": true, "onlyMe": true,
"pageNum": searchKey == null?pageNum:1, "pageNum": searchKey == null ? pageNum : 1,
"pageSize": 10, "pageSize": 10,
"searchKey": searchKey??"" "searchKey": searchKey ?? ""
}).catchError((error) { }).catchError((error) {
if(searchKey == null) { if (searchKey == null) {
refreshController.refreshFailed(); refreshController.refreshFailed();
refreshController.loadFailed(); refreshController.loadFailed();
} }
}); });
if(searchKey == null){ if (searchKey == null) {
refreshController.refreshCompleted(); refreshController.refreshCompleted();
refreshController.loadComplete(); refreshController.loadComplete();
} }
if (baseData.isSuccess) { if (baseData.isSuccess) {
if(searchKey != null){ if (searchKey != null) {
if(baseData?.data?.list != null && baseData.data.list.isNotEmpty) if (baseData?.data?.list != null && baseData.data.list.isNotEmpty)
articles.forEach((element) { articles.forEach((element) {
if(element.id == searchKey){ if (element.id == searchKey) {
element.content = jsonEncode(baseData.data.list[0].subjectInfo); element.content = jsonEncode(baseData.data.list[0].subjectInfo);
element.mainTitle =baseData.data.list[0].subject; element.mainTitle = baseData.data.list[0].subject;
element.followed = baseData.data.list[0].selfFollow; element.followed = baseData.data.list[0].selfFollow;
element.liked = baseData.data.list[0].selfLike;
element.authorHeadImg = baseData.data.list[0].memberInfo?.avatar; element.authorHeadImg = baseData.data.list[0].memberInfo?.avatar;
element.authorName = baseData.data.list[0].memberInfo?.nickname; element.authorName = baseData.data.list[0].memberInfo?.nickname;
element.location = baseData.data.list[0].location; element.location = baseData.data.list[0].location;
@ -155,12 +153,10 @@ class _PersonalPage extends State<PersonalPage> with WidgetsBindingObserver {
element.likes = baseData.data.list[0]?.likes; element.likes = baseData.data.list[0]?.likes;
element.comments = baseData.data.list[0]?.comments; element.comments = baseData.data.list[0]?.comments;
this.isRefresh = false; this.isRefresh = false;
setState(() { setState(() {});
});
} }
}); });
} } else {
else{
if (pageNum == 1) { if (pageNum == 1) {
articles.clear(); articles.clear();
} }
@ -168,8 +164,9 @@ class _PersonalPage extends State<PersonalPage> with WidgetsBindingObserver {
var article = Article(); var article = Article();
article.id = element.id; article.id = element.id;
article.content = jsonEncode(element.subjectInfo); article.content = jsonEncode(element.subjectInfo);
article.mainTitle =element.subject; article.mainTitle = element.subject;
article.followed = element.selfFollow; article.followed = element.selfFollow;
article.liked = element.selfLike;
article.authorHeadImg = element.memberInfo?.avatar; article.authorHeadImg = element.memberInfo?.avatar;
article.authorName = element.memberInfo?.nickname; article.authorName = element.memberInfo?.nickname;
article.location = element.location; article.location = element.location;
@ -180,8 +177,7 @@ class _PersonalPage extends State<PersonalPage> with WidgetsBindingObserver {
article.comments = element?.comments; article.comments = element?.comments;
articles.add(article); articles.add(article);
}); });
setState(() { setState(() {});
});
// comments.sort((a,b)=>b.createTime.compareTo(a.createTime)); // comments.sort((a,b)=>b.createTime.compareTo(a.createTime));
// print("comments: ${comments.length}"); // print("comments: ${comments.length}");
if (int.tryParse(baseData.data.total) < (pageNum * 10)) { if (int.tryParse(baseData.data.total) < (pageNum * 10)) {
@ -324,328 +320,333 @@ class _PersonalPage extends State<PersonalPage> with WidgetsBindingObserver {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return SmartRefresher( return Scaffold(
controller: refreshController, backgroundColor: Colors.white,
enablePullDown: true, body:SmartRefresher(
enablePullUp: true, controller: refreshController,
header: MyHeader(), enablePullDown: true,
footer: CustomFooter( enablePullUp: true,
builder: (context, mode) { header: MyHeader(),
return MyFooter(mode); footer: CustomFooter(
}, builder: (context, mode) {
), return MyFooter(mode);
onRefresh: _onRefresh, },
onLoading: () { ),
isLoadMore = true; onRefresh: _onRefresh,
setState(() { onLoading: () {
_onRefresh(); isLoadMore = true;
}); setState(() {
}, _onRefresh();
physics: BouncingScrollPhysics(), });
scrollController: scrollController, },
child: SingleChildScrollView(
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
child: Column( scrollController: scrollController,
mainAxisAlignment: MainAxisAlignment.spaceAround, child: SingleChildScrollView(
crossAxisAlignment: CrossAxisAlignment.start, physics: BouncingScrollPhysics(),
children: [ child: Column(
Container( mainAxisAlignment: MainAxisAlignment.spaceAround,
height: 248, crossAxisAlignment: CrossAxisAlignment.start,
color: Color(0xFFFFFFFF), children: [
// color: Colors.red, Container(
child: Stack( height: 248.h,
// alignment: Alignment.bottomLeft, color: Color(0xFFFFFFFF),
children: [ // color: Colors.red,
Positioned( child: Stack(
top: 0, // alignment: Alignment.bottomLeft,
left: 0, children: [
bottom: 36, Positioned(
right: 0, top: 0,
child: Stack( left: 0,
alignment: Alignment.bottomRight, bottom: 36.h,
children: [ right: 0,
Container( child: Stack(
color: Colors.black, alignment: Alignment.bottomRight,
child: Opacity( children: [
opacity: 0.9, Container(
child: MImage( color: Colors.black,
memberInfor?.background ?? "", child: Opacity(
width: double.infinity, opacity: 0.9,
height: 260.h, child: MImage(
fit: BoxFit.cover, memberInfor?.background ?? "",
errorSrc: "assets/image/default_1.webp", width: double.infinity,
fadeSrc: "assets/image/default_1.webp", height: 260.h,
))), fit: BoxFit.cover,
Container( errorSrc: "assets/image/default_1.webp",
margin: EdgeInsets.only( fadeSrc: "assets/image/default_1.webp",
top: 50.h, left: 16.w, right: 16.w), ))),
alignment: Alignment.topLeft, Container(
decoration: BoxDecoration( margin: EdgeInsets.only(
color: Colors.transparent, top: 50.h, left: 16.w, right: 16.w),
), alignment: Alignment.topLeft,
child: Column( decoration: BoxDecoration(
mainAxisAlignment: MainAxisAlignment.spaceBetween, color: Colors.transparent,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
GestureDetector(
child: Image.asset(
"assets/image/integral_return.webp",
width: 24,
height: 24,
),
onTap: () {
Navigator.of(context).pop();
},
), ),
], child: Column(
), mainAxisAlignment: MainAxisAlignment.spaceBetween,
), crossAxisAlignment: CrossAxisAlignment.center,
if (memberId == "0") children: [
Positioned( GestureDetector(
bottom: 9, child: Image.asset(
right: 16.w, "assets/image/integral_return.webp",
child: GestureDetector( width: 24,
onTap: () { height: 24,
showImagePicker(); ),
}, onTap: () {
child: Container( Navigator.of(context).pop();
padding: EdgeInsets.only(left: 2, right: 2), },
width: 59.w,
height: 23.h,
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(2),
color: Color(0x80000000),
),
child: Text(
S.of(context).genghuanbeijing,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFFFFFFFF),
), ),
), ],
), ),
), ),
), if (memberId == "0")
], Positioned(
), bottom: 9.h,
), right: 16.w,
homeInfo(), child: GestureDetector(
], onTap: () {
), showImagePicker();
), },
Container( child: Container(
color: Color(0xFFFFFFFF), padding: EdgeInsets.only(left: 2, right: 2),
child: Column( width: 59.w,
mainAxisAlignment: MainAxisAlignment.spaceAround, height: 23.h,
crossAxisAlignment: CrossAxisAlignment.start, alignment: Alignment.center,
children: [ decoration: BoxDecoration(
Container( borderRadius: BorderRadius.circular(2),
margin: EdgeInsets.only(left: 86, top: 12, right: 16), color: Color(0x80000000),
child: GestureDetector(
onTap: () {
setState(() {
isShrink = !isShrink;
});
},
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Expanded(
flex: 1,
child: Text(
memberId == "0"
? ((memberInfor?.signature == "")
? "还未编辑个性签名~"
: memberInfor?.signature ?? "")
: "个性签名: ${(memberInfor?.signature == "") ? "还未编辑个性签名~" : memberInfor?.signature ?? ""}",
overflow: isShrink
? TextOverflow.visible
: TextOverflow.ellipsis,
maxLines: isShrink ? 10 : 2,
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF868686),
fontWeight: MyFontWeight.regular,
height: 1.5),
)),
Icon(
(isShrink != null && !isShrink)
? Icons.chevron_right
: Icons.keyboard_arrow_up,
color: Colors.black,
size: 18,
),
],
),
)),
Container(
margin: EdgeInsets.only(left: 16, right: 16),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {},
child: Container(
color: Colors.transparent,
padding: EdgeInsets.all(16),
child: Column(
children: [
Text(
memberInfor != null
? memberInfor.follow.toString()
: "0",
style: TextStyle(
color: Color(0xFF353535),
fontSize: 16.sp,
fontWeight: MyFontWeight.semi_bold,
),
),
SizedBox(
height: 4,
),
Text(
S.of(context).guanzhu,
style: TextStyle(
color: Color(0xFF353535),
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
),
),
],
)),
),
),
Expanded(
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {},
child: Container(
color: Colors.transparent,
padding: EdgeInsets.all(16),
child: Column(
children: [
Text(
memberInfor != null
? memberInfor.fans.toString()
: "0",
style: TextStyle(
color: Color(0xFF353535),
fontSize: 16.sp,
fontWeight: MyFontWeight.semi_bold,
),
), ),
SizedBox( child: Text(
height: 4, S.of(context).genghuanbeijing,
), overflow: TextOverflow.ellipsis,
Text(
S.of(context).fensi,
style: TextStyle( style: TextStyle(
color: Color(0xFF353535),
fontSize: 12.sp, fontSize: 12.sp,
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
color: Color(0xFFFFFFFF),
), ),
), ),
], ),
)), ),
), ),
), ],
Expanded(
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {},
child: Container(
color: Colors.transparent,
padding: EdgeInsets.all(16),
child: Column(
children: [
Text(
(memberInfor?.trendTotal ?? 0)
.toString(),
style: TextStyle(
color: Color(0xFF353535),
fontSize: 16.sp,
fontWeight: MyFontWeight.semi_bold,
),
),
SizedBox(
height: 4,
),
Text(
S.of(context).dongtai,
style: TextStyle(
color: Color(0xFF353535),
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
),
),
],
)),
),
), ),
Expanded( ),
homeInfo(),
],
),
),
Container(
color: Color(0xFFFFFFFF),
margin: EdgeInsets.only(bottom: 30.h),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
margin:
EdgeInsets.only(left: 86.w, top: 12.h, right: 16.w),
child: GestureDetector( child: GestureDetector(
behavior: HitTestBehavior.opaque, onTap: () {
onTap: () {}, setState(() {
child: Container( isShrink = !isShrink;
color: Colors.transparent, });
padding: EdgeInsets.all(16), },
child: Column( child: Row(
children: [ mainAxisAlignment: MainAxisAlignment.start,
Text( crossAxisAlignment: CrossAxisAlignment.end,
(memberInfor?.gainLikeTotal ?? 0) children: [
.toString(), Expanded(
style: TextStyle( flex: 1,
color: Color(0xFF353535), child: Text(
fontSize: 16.sp, memberId == "0"
fontWeight: MyFontWeight.semi_bold, ? ((memberInfor?.signature == "")
), ? "还未编辑个性签名~"
), : memberInfor?.signature ?? "")
SizedBox( : "个性签名: ${(memberInfor?.signature == "") ? "还未编辑个性签名~" : memberInfor?.signature ?? ""}",
height: 4, overflow: isShrink
), ? TextOverflow.visible
Text( : TextOverflow.ellipsis,
"获赞", maxLines: isShrink ? 10 : 2,
style: TextStyle( style: TextStyle(
color: Color(0xFF353535), fontSize: 12.sp,
fontSize: 12.sp, color: Color(0xFF868686),
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
), height: 1.5.h),
), )),
], Icon(
)), (isShrink != null && !isShrink)
), ? Icons.chevron_right
: Icons.keyboard_arrow_up,
color: Colors.black,
size: 18,
),
],
),
)),
Container(
margin: EdgeInsets.only(left: 16.w, right: 16.w),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {},
child: Container(
color: Colors.transparent,
padding: EdgeInsets.all(16),
child: Column(
children: [
Text(
memberInfor != null
? memberInfor.follow.toString()
: "0",
style: TextStyle(
color: Color(0xFF353535),
fontSize: 16.sp,
fontWeight: MyFontWeight.semi_bold,
),
),
SizedBox(
height: 4.h,
),
Text(
S.of(context).guanzhu,
style: TextStyle(
color: Color(0xFF353535),
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
),
),
],
)),
),
),
Expanded(
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {},
child: Container(
color: Colors.transparent,
padding: EdgeInsets.all(16),
child: Column(
children: [
Text(
memberInfor != null
? memberInfor.fans.toString()
: "0",
style: TextStyle(
color: Color(0xFF353535),
fontSize: 16.sp,
fontWeight: MyFontWeight.semi_bold,
),
),
SizedBox(
height: 4.h,
),
Text(
S.of(context).fensi,
style: TextStyle(
color: Color(0xFF353535),
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
),
),
],
)),
),
),
Expanded(
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {},
child: Container(
color: Colors.transparent,
padding: EdgeInsets.all(16),
child: Column(
children: [
Text(
(memberInfor?.trendTotal ?? 0)
.toString(),
style: TextStyle(
color: Color(0xFF353535),
fontSize: 16.sp,
fontWeight: MyFontWeight.semi_bold,
),
),
SizedBox(
height: 4.h,
),
Text(
S.of(context).dongtai,
style: TextStyle(
color: Color(0xFF353535),
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
),
),
],
)),
),
),
Expanded(
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {},
child: Container(
color: Colors.transparent,
padding: EdgeInsets.all(16),
child: Column(
children: [
Text(
(memberInfor?.gainLikeTotal ?? 0)
.toString(),
style: TextStyle(
color: Color(0xFF353535),
fontSize: 16.sp,
fontWeight: MyFontWeight.semi_bold,
),
),
SizedBox(
height: 4.h,
),
Text(
S.of(context).huozan,
style: TextStyle(
color: Color(0xFF353535),
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
),
),
],
)),
),
),
],
), ),
], ),
), Container(
), margin: EdgeInsets.all(16),
Container( height: 1.h,
margin: EdgeInsets.all(16), color: Color(0xFFF7F7F7),
height: 1.h, ),
color: Color(0xFFF7F7F7), Padding(
padding: EdgeInsets.only(left: 16.w),
child: Text(
memberId != "0" ? "TA的动态" : "我的动态",
style: TextStyle(
color: Color(0xFF353535),
fontSize: 15.sp,
fontWeight: MyFontWeight.semi_bold,
),
)),
dynamicList(),
],
), ),
Padding( ),
padding: EdgeInsets.only(left: 16), ],
child: Text( )),
memberId != "0" ? "TA的动态" : "我的动态", )
style: TextStyle(
color: Color(0xFF353535),
fontSize: 15.sp,
fontWeight: MyFontWeight.semi_bold,
),
)),
dynamicList()
],
),
),
],
)),
); );
} }
@ -657,8 +658,8 @@ class _PersonalPage extends State<PersonalPage> with WidgetsBindingObserver {
right: 0, right: 0,
child: Container( child: Container(
padding: EdgeInsets.only( padding: EdgeInsets.only(
left: 16, left: 16.w,
right: 16, right: 16.w,
), ),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
@ -672,7 +673,7 @@ class _PersonalPage extends State<PersonalPage> with WidgetsBindingObserver {
builder: (context) => PhotoViewGalleryScreen( builder: (context) => PhotoViewGalleryScreen(
images: [ images: [
(memberInfor?.headimg ?? "").isEmpty (memberInfor?.headimg ?? "").isEmpty
? "https://lmg.jj20.com/up/allimg/tx30/09041130358711081.jpg" ? "https://i.postimg.cc/Pq6vjfnw/default-1.webp"
: memberInfor?.headimg : memberInfor?.headimg
], //list ], //list
index: 0, //index index: 0, //index
@ -691,7 +692,9 @@ class _PersonalPage extends State<PersonalPage> with WidgetsBindingObserver {
), ),
SizedBox(width: 10.w), SizedBox(width: 10.w),
Text( Text(
memberInfor?.nickname ?? "", ((memberInfor?.nickname ?? "") == "")
? "回乡"
: memberInfor?.nickname,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
fontSize: 16.sp, fontSize: 16.sp,
@ -714,14 +717,14 @@ class _PersonalPage extends State<PersonalPage> with WidgetsBindingObserver {
}); });
}, },
child: Container( child: Container(
height: 23, height: 23.h,
padding: padding: EdgeInsets.only(
EdgeInsets.only(left: 6, right: 6, bottom: 2, top: 2), left: 6.w, right: 6.w, bottom: 2.h, top: 2.h),
alignment: Alignment.center, alignment: Alignment.center,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(100), borderRadius: BorderRadius.circular(100),
border: Border.all( border: Border.all(
width: 1, width: 1.w,
color: Color(0xFF353535), color: Color(0xFF353535),
style: BorderStyle.solid, style: BorderStyle.solid,
), ),
@ -749,7 +752,7 @@ class _PersonalPage extends State<PersonalPage> with WidgetsBindingObserver {
isShowBtn: false, isShowBtn: false,
text: "目前暂无发布动态,要把开心的事讲出来哦~", text: "目前暂无发布动态,要把开心的事讲出来哦~",
fontSize: 16.sp, fontSize: 16.sp,
margin: EdgeInsets.only(left: 60.w, right: 60.w), margin: EdgeInsets.only(left: 60.w, right: 60.w, bottom:80.h),
) )
: ListView.builder( : ListView.builder(
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
@ -760,9 +763,9 @@ class _PersonalPage extends State<PersonalPage> with WidgetsBindingObserver {
articles[position], articles[position],
memberId == "0" ? 1 : 0, memberId == "0" ? 1 : 0,
exitFull: () { exitFull: () {
// setState(() { setState(() {
// _onRefresh(); _onRefresh();
// }); });
}, },
removalDynamic: () { removalDynamic: () {
setState(() { setState(() {

4
lib/mine/recharge_page.dart

@ -296,6 +296,7 @@ class _RechargePage extends State<RechargePage> {
), ),
), ),
GestureDetector( GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () { onTap: () {
setState(() { setState(() {
checkIndex = 2; checkIndex = 2;
@ -328,6 +329,7 @@ class _RechargePage extends State<RechargePage> {
), ),
SizedBox(height:10.h), SizedBox(height:10.h),
GestureDetector( GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () { onTap: () {
setState(() { setState(() {
checkIndex = 3; checkIndex = 3;
@ -632,7 +634,7 @@ class _RechargePage extends State<RechargePage> {
Widget checkView(var index) { Widget checkView(var index) {
return Container( return Container(
padding: EdgeInsets.only(right: 16.w), padding: EdgeInsets.only(right: 16.w,left: 46.w),
alignment: Alignment.center, alignment: Alignment.center,
child: Image.asset( child: Image.asset(
checkIndex != index checkIndex != index

58
lib/mine/scan_web.dart

@ -0,0 +1,58 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:webview_flutter/webview_flutter.dart';
class ScanWeb extends StatefulWidget {
final Map<String, dynamic> arguments;
ScanWeb({this.arguments});
@override
State<StatefulWidget> createState() {
return _ScanWeb();
}
}
class _ScanWeb extends State<ScanWeb> {
var controller = new ScrollController();
WebViewController webViewController;
String result;
String title;
@override
void initState() {
super.initState();
result = widget.arguments["result"];
title = widget.arguments["title"];
EasyLoading.show(status: S.current.zhengzaijiazai);
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: MyAppBar(
title:title ?? "",
titleColor: Colors.black,
background: Colors.transparent,
leadingColor: Colors.black,
),
body:
WebView(
initialUrl:result,
javascriptMode: JavascriptMode.unrestricted,
onWebViewCreated: (WebViewController controller){
webViewController =controller;
},
onProgress: (int progress) async {
if(widget.arguments["title"] != null)
return;
title = await webViewController?.getTitle();
setState((){});
EasyLoading.dismiss();
},
),
);
}
}

103
lib/mine/user_info_page.dart

@ -35,7 +35,7 @@ class _UserInfoPage extends State<UserInfoPage> {
"headimg": "", "headimg": "",
"nickname": "", "nickname": "",
"sex": "", "sex": "",
"signature":"" "signature": ""
}; };
@override @override
@ -52,7 +52,8 @@ class _UserInfoPage extends State<UserInfoPage> {
modifyInfo["sex"] = user.sex, modifyInfo["sex"] = user.sex,
age = AppUtils.getAgeByString(user.birth), age = AppUtils.getAgeByString(user.birth),
refresh(), refresh(),
apiService = ApiService(Dio(), context: context, token: value.getString('token')), apiService = ApiService(Dio(),
context: context, token: value.getString('token')),
}); });
} }
@ -89,7 +90,7 @@ class _UserInfoPage extends State<UserInfoPage> {
Widget userInfo() { Widget userInfo() {
return Container( return Container(
margin: EdgeInsets.only(left:14.w,right: 14.w), margin: EdgeInsets.only(left: 14.w, right: 14.w),
child: Column( child: Column(
children: [ children: [
InkWell( InkWell(
@ -97,7 +98,8 @@ class _UserInfoPage extends State<UserInfoPage> {
showImagePicker(); showImagePicker();
}, },
child: avatarItem(0, ""), child: avatarItem(0, ""),
),Container( ),
Container(
margin: EdgeInsets.symmetric(vertical: 12.h), margin: EdgeInsets.symmetric(vertical: 12.h),
width: double.infinity, width: double.infinity,
height: 1, height: 1,
@ -120,8 +122,11 @@ class _UserInfoPage extends State<UserInfoPage> {
onTap: () { onTap: () {
editSignature(); editSignature();
}, },
child:avatarItem(2, child: avatarItem(
(modifyInfo["signature"]) == "" ? "还未编辑个性签名~" : modifyInfo["signature"]), 2,
(modifyInfo["signature"]) == ""
? "还未编辑个性签名~"
: modifyInfo["signature"]),
), ),
Container( Container(
margin: EdgeInsets.symmetric(vertical: 12.h), margin: EdgeInsets.symmetric(vertical: 12.h),
@ -130,7 +135,7 @@ class _UserInfoPage extends State<UserInfoPage> {
color: Color(0xFFF2F2F2), color: Color(0xFFF2F2F2),
), ),
InkWell( InkWell(
onTap:(modifyInfo["birth"] == "")?showDateSelector:(){}, onTap: (modifyInfo["birth"] == "") ? showDateSelector : () {},
child: avatarItem( child: avatarItem(
3, 3,
(modifyInfo["birth"] != null && modifyInfo["birth"] != "") (modifyInfo["birth"] != null && modifyInfo["birth"] != "")
@ -171,7 +176,8 @@ class _UserInfoPage extends State<UserInfoPage> {
} }
editSignature() async { editSignature() async {
dynamic signature = await Navigator.of(context).pushNamed('/router/edit_signature', dynamic signature = await Navigator.of(context).pushNamed(
'/router/edit_signature',
arguments: {"signature": modifyInfo['signature']}); arguments: {"signature": modifyInfo['signature']});
if (signature != null && signature != "") { if (signature != null && signature != "") {
modifyInfo["signature"] = signature; modifyInfo["signature"] = signature;
@ -196,7 +202,7 @@ class _UserInfoPage extends State<UserInfoPage> {
builder: (_) { builder: (_) {
return CupertinoDatePickerWidget(); return CupertinoDatePickerWidget();
}); });
if (dateTime != null ) { if (dateTime != null) {
modifyInfo["birth"] = DateFormat("yyyy-MM-dd").format(dateTime); modifyInfo["birth"] = DateFormat("yyyy-MM-dd").format(dateTime);
user.birth = modifyInfo["birth"]; user.birth = modifyInfo["birth"];
age = AppUtils.getAge(dateTime); age = AppUtils.getAge(dateTime);
@ -295,38 +301,38 @@ class _UserInfoPage extends State<UserInfoPage> {
} }
// Future<File> cropImage(imagePath) async { // Future<File> cropImage(imagePath) async {
// File croppedFile = await ImageCropper.cropImage( // File croppedFile = await ImageCropper.cropImage(
// sourcePath: imagePath, // sourcePath: imagePath,
// aspectRatioPresets: [ // aspectRatioPresets: [
// CropAspectRatioPreset.square, // CropAspectRatioPreset.square,
// // CropAspectRatioPreset.ratio3x2, // // CropAspectRatioPreset.ratio3x2,
// // CropAspectRatioPreset.original, // // CropAspectRatioPreset.original,
// // CropAspectRatioPreset.ratio4x3, // // CropAspectRatioPreset.ratio4x3,
// // CropAspectRatioPreset.ratio16x9 // // CropAspectRatioPreset.ratio16x9
// ], // ],
// aspectRatio: CropAspectRatio(ratioX: 1, ratioY: 1), // aspectRatio: CropAspectRatio(ratioX: 1, ratioY: 1),
// androidUiSettings: AndroidUiSettings( // androidUiSettings: AndroidUiSettings(
// toolbarTitle: 'Cropper', // toolbarTitle: 'Cropper',
// toolbarColor: Colors.black, // toolbarColor: Colors.black,
// toolbarWidgetColor: Colors.white, // toolbarWidgetColor: Colors.white,
// initAspectRatio: CropAspectRatioPreset.square, // initAspectRatio: CropAspectRatioPreset.square,
// hideBottomControls: true, // hideBottomControls: true,
// lockAspectRatio: false), // lockAspectRatio: false),
// iosUiSettings: IOSUiSettings( // iosUiSettings: IOSUiSettings(
// minimumAspectRatio: 1.0, // minimumAspectRatio: 1.0,
// resetAspectRatioEnabled: false, // resetAspectRatioEnabled: false,
// aspectRatioPickerButtonHidden: true, // aspectRatioPickerButtonHidden: true,
// rectWidth: 500.w, // rectWidth: 500.w,
// rectHeight: 500.h, // rectHeight: 500.h,
// )); // ));
// return croppedFile; // return croppedFile;
// } // }
/// ///
modifyInfos() async { modifyInfos() async {
var info = await apiService.editInfo(modifyInfo).catchError((onError) {}); var info = await apiService.editInfo(modifyInfo).catchError((onError) {});
if (info.isSuccess) { if (info.isSuccess) {
SharedPreferences.getInstance().then((value){ SharedPreferences.getInstance().then((value) {
value.setString('user', jsonEncode(modifyInfo)); value.setString('user', jsonEncode(modifyInfo));
}); });
setState(() { setState(() {
@ -338,7 +344,9 @@ class _UserInfoPage extends State<UserInfoPage> {
/// ///
fileUpload() async { fileUpload() async {
if (filePath != null && filePath != "" && await File(filePath).exists()) { if (filePath != null && filePath != "" && await File(filePath).exists()) {
BaseData<UploadResult> baseData = await apiService.upload(File(filePath), 123123123,false).catchError((onError) {}); BaseData<UploadResult> baseData = await apiService
.upload(File(filePath), 123123123, false)
.catchError((onError) {});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
UploadResult uploadResult = baseData.data; UploadResult uploadResult = baseData.data;
modifyInfo["headimg"] = uploadResult.url; modifyInfo["headimg"] = uploadResult.url;
@ -347,8 +355,6 @@ class _UserInfoPage extends State<UserInfoPage> {
} }
} }
Widget avatarItem(type, value) { Widget avatarItem(type, value) {
print("object: $value"); print("object: $value");
return Container( return Container(
@ -366,7 +372,10 @@ class _UserInfoPage extends State<UserInfoPage> {
flex: 1, flex: 1,
), ),
buildValue(type, value), buildValue(type, value),
if (type != 5 && type != 4 && type != 3 && (((modifyInfo["birth"] == "")) || type != 3)) if (type != 5 &&
type != 4 &&
type != 3 &&
(((modifyInfo["birth"] == "")) || type != 3))
valueEnd(), valueEnd(),
], ],
), ),
@ -375,11 +384,10 @@ class _UserInfoPage extends State<UserInfoPage> {
Widget valueEnd() { Widget valueEnd() {
return Container( return Container(
child: Icon( child: Icon(
Icons.keyboard_arrow_right, Icons.keyboard_arrow_right,
size: 20.sp, size: 20.sp,
) ));
);
} }
Widget buildValue(type, value) { Widget buildValue(type, value) {
@ -411,7 +419,7 @@ class _UserInfoPage extends State<UserInfoPage> {
return Text( return Text(
value, value,
maxLines: 1, maxLines: 1,
overflow:TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
fontSize: 13.sp, fontSize: 13.sp,
@ -419,10 +427,11 @@ class _UserInfoPage extends State<UserInfoPage> {
), ),
); );
} else { } else {
return Expanded(child: Text( return Expanded(
child: Text(
value, value,
maxLines: 1, maxLines: 1,
overflow:TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
textAlign: TextAlign.right, textAlign: TextAlign.right,
style: TextStyle( style: TextStyle(
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,

192
lib/mine/vip_pay_code.dart

@ -0,0 +1,192 @@
import 'dart:async';
import 'dart:convert';
import 'package:barcode_widget/barcode_widget.dart';
import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bmflocation/flutter_bmflocation.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/product.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/utils/location.dart';
import 'package:huixiang/utils/painter_bg.dart';
import 'package:huixiang/view_widget/custom_image.dart';
import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:huixiang/view_widget/my_footer.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:qr_flutter/qr_flutter.dart';
import 'package:shared_preferences/shared_preferences.dart';
import '../retrofit/data/user_info.dart';
import '../view_widget/classic_header.dart';
class VipPayCode extends StatefulWidget {
@override
State<StatefulWidget> createState() {
return _VipPayCode();
}
}
class _VipPayCode extends State<VipPayCode> {
ApiService apiService;
@override
void dispose() {
super.dispose();
refreshController.dispose();
}
@override
void initState() {
super.initState();
queryUser();
}
UserInfo userInfo;
final RefreshController refreshController = RefreshController();
bool vipCodeText = false;
Timer _timer;
bool isDispose = false;
///
queryUser() async {
try{
SharedPreferences value = await SharedPreferences.getInstance();
if (apiService == null)
apiService = ApiService(
Dio(),
context: context,
token: value.getString("token"),
);
BaseData<UserInfo> baseData =
await apiService.queryInfo().catchError((onError) {
refreshController.refreshFailed();});
if (baseData != null && baseData.isSuccess) {
userInfo = baseData.data;
SharedPreferences.getInstance().then((value) => {
value.setString('user', jsonEncode(baseData.data)),
});
setState(() {});
refreshController.refreshCompleted();
}else{
refreshController.refreshFailed();
}
}finally{
refreshCode();
}
}
refreshCode(){
if (_timer != null) return;
const oneSec = const Duration(minutes: 2);
var callback = ((timer) {
if (isDispose) return;
queryUser();
});
_timer = Timer.periodic(oneSec, callback);
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: MyAppBar(
title: "会员码",
background: Color(0xFF32A060),
titleColor: Colors.white,
brightness: Brightness.dark,
leadingColor: Colors.white,
),
body: Container(
color: Color(0xFF32A060),
height: double.infinity,
padding: EdgeInsets.only(top: 45.h),
child: Stack(
alignment: Alignment.topCenter,
children: [
Container(
color: Color(0xFF32A060),
// height: 485.h,
padding: EdgeInsets.only(top: 47.h),
child: Container(
height: 438.h,
width: double.infinity,
decoration: BoxDecoration(
color: Colors.white,
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 2),
blurRadius: 14,
spreadRadius: 0,
),
],
borderRadius: BorderRadius.circular(6),
),
margin: EdgeInsets.symmetric(horizontal: 16.w,),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(height: 46.h,),
Text(
"请保持屏幕常亮,并对准扫码盒或枪口",
style: TextStyle(
fontWeight: MyFontWeight.regular,
fontSize: 12.sp,
color: Color(0xFF4D4D4D),
),
),
SizedBox(height: 30.h,),
QrImage(
data: userInfo != null
? (userInfo?.vipScanNo ?? "")
: "",
version: QrVersions.auto,
size: 200.w,
gapless: true,
),
],
),
),
),
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(56),
color: Color(0xFF32A060),
border: Border.all(
color: Color(0xFF32A060),
width: 8.w,
),
),
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(56),
color: Colors.white,
border: Border.all(
color: Colors.white,
width: 2.w,
),
),
child: MImage(
userInfo?.headimg ?? "",
width: 80,
height: 80,
radius: BorderRadius.circular(56),
fit: BoxFit.cover,
errorSrc: "assets/image/default_1.webp",
fadeSrc: "assets/image/default_1.webp",
),
),
),
],
),
),
);
}
}

17
lib/order/edit_remarks_page.dart

@ -5,6 +5,9 @@ import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
class EditRemarksPage extends StatefulWidget { class EditRemarksPage extends StatefulWidget {
final Map<String, dynamic> arguments;
EditRemarksPage({this.arguments});
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
return _EditRemarksPage(); return _EditRemarksPage();
@ -14,6 +17,14 @@ class EditRemarksPage extends StatefulWidget {
class _EditRemarksPage extends State<EditRemarksPage> { class _EditRemarksPage extends State<EditRemarksPage> {
TextEditingController commentTextController = TextEditingController(); TextEditingController commentTextController = TextEditingController();
@override
void initState() {
super.initState();
if((widget.arguments["remake"]??"") != "")
commentTextController.text = widget.arguments["remake"];
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
@ -75,7 +86,8 @@ class _EditRemarksPage extends State<EditRemarksPage> {
controller: commentTextController, controller: commentTextController,
keyboardType: TextInputType.multiline, keyboardType: TextInputType.multiline,
maxLines: 10, maxLines: 10,
decoration: InputDecoration( decoration:
InputDecoration(
isDense: true, isDense: true,
hintText: '请填写备注信息,例如:面包切一刀', hintText: '请填写备注信息,例如:面包切一刀',
hintStyle: TextStyle( hintStyle: TextStyle(
@ -97,7 +109,8 @@ class _EditRemarksPage extends State<EditRemarksPage> {
), ),
GestureDetector( GestureDetector(
onTap: (){ onTap: (){
Navigator.pop(context,commentTextController.text); String notes = commentTextController.text;
Navigator.pop(context,notes);
}, },
child: Container( child: Container(
padding: EdgeInsets.all(16.h), padding: EdgeInsets.all(16.h),

2
lib/order/exchange_order_page.dart

@ -878,7 +878,7 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
width: 10, width: 10,
), ),
Text( Text(
S.of(context).pingtaiyue, S.of(context).huixiangqianbao,
style: TextStyle( style: TextStyle(
fontSize: 14.sp, fontSize: 14.sp,
color: Color(0xff353535), color: Color(0xff353535),

6
lib/order/order_detail_page.dart

@ -34,11 +34,11 @@ class OrderDetailPage extends StatefulWidget {
class _OrderDetailPage extends State<OrderDetailPage> { class _OrderDetailPage extends State<OrderDetailPage> {
ApiService apiService; ApiService apiService;
MinApiService minService; MinApiService minService;
int jumpState;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
SharedPreferences.getInstance().then((value) { SharedPreferences.getInstance().then((value) {
apiService = ApiService( apiService = ApiService(
Dio(), Dio(),
@ -48,6 +48,7 @@ class _OrderDetailPage extends State<OrderDetailPage> {
); );
queryDetails(); queryDetails();
}); });
jumpState = widget.arguments["jumpState"];
} }
/// ///
@ -183,6 +184,7 @@ class _OrderDetailPage extends State<OrderDetailPage> {
paySelected, paySelected,
_orderCancel, _orderCancel,
orderInfo, orderInfo,
jumpState
), ),
/// ///
@ -225,7 +227,7 @@ class _OrderDetailPage extends State<OrderDetailPage> {
payResult(BaseData baseData) async{ payResult(BaseData baseData) async{
await queryDetails(); await queryDetails();
Future.delayed(Duration(milliseconds: 400), () { Future.delayed(Duration(milliseconds: 800), () {
EasyLoading.dismiss(); EasyLoading.dismiss();
SmartDialog.showToast(baseData?.msg == "ok" ?"订单支付成功" :baseData?.msg,alignment: Alignment.center); SmartDialog.showToast(baseData?.msg == "ok" ?"订单支付成功" :baseData?.msg,alignment: Alignment.center);
}); });

97
lib/order/order_history_page.dart

@ -70,42 +70,42 @@ class _OrderHistoryPage extends State<OrderHistoryPage>
bottom: PreferredSize( bottom: PreferredSize(
preferredSize: Size(double.infinity, 38.h), preferredSize: Size(double.infinity, 38.h),
child: Theme( child: Theme(
data: ThemeData( data: ThemeData(
splashColor: Colors.transparent, // splashColor: Colors.transparent, //
highlightColor: Colors.transparent, // highlightColor: Colors.transparent, //
),
child: TabBar(
controller: tabController,
isScrollable: false,
indicatorWeight: 2.w,
indicatorSize: TabBarIndicatorSize.label,
indicatorColor: Color(0xFF39B54A),
indicatorPadding: EdgeInsets.only(top: 3.h),
unselectedLabelStyle: TextStyle(
fontSize: 16.sp,
fontWeight: FontWeight.normal,
),
labelStyle: TextStyle(
color: Colors.black,
fontSize: 16.sp,
fontWeight: FontWeight.bold,
),
labelColor: Colors.black,
tabs: [
MyTab(
text: S.of(context).quanbu,
),
MyTab(
text: S.of(context).daifukuan,
),
MyTab(
text: S.of(context).weiwancheng,
), ),
MyTab( child: TabBar(
text: S.of(context).yiwancheng, controller: tabController,
) isScrollable: false,
], indicatorWeight: 2.w,
)), indicatorSize: TabBarIndicatorSize.label,
indicatorColor: Color(0xFF39B54A),
indicatorPadding: EdgeInsets.only(top: 3.h),
unselectedLabelStyle: TextStyle(
fontSize: 16.sp,
fontWeight: FontWeight.normal,
),
labelStyle: TextStyle(
color: Colors.black,
fontSize: 16.sp,
fontWeight: FontWeight.bold,
),
labelColor: Colors.black,
tabs: [
MyTab(
text: S.of(context).quanbu,
),
MyTab(
text: S.of(context).daifukuan,
),
MyTab(
text: S.of(context).weiwancheng,
),
MyTab(
text: S.of(context).yiwancheng,
)
],
)),
), ),
), ),
body: TabBarView( body: TabBarView(
@ -155,7 +155,7 @@ class _OrderHistoryList extends State<OrderHistoryList>
return InkWell( return InkWell(
onTap: () { onTap: () {
Navigator.of(context).pushNamed('/router/order_details', Navigator.of(context).pushNamed('/router/order_details',
arguments: {"id": orderInfos[position].id}); arguments: {"id": orderInfos[position].id,"jumpState":2});
}, },
child: orderItem(orderInfos[position]), child: orderItem(orderInfos[position]),
); );
@ -212,6 +212,7 @@ class _OrderHistoryList extends State<OrderHistoryList>
} }
setState(() {}); setState(() {});
} else { } else {
SmartDialog.showToast(baseData?.msg ?? "",alignment: Alignment.center);
refreshController.refreshFailed(); refreshController.refreshFailed();
refreshController.loadFailed(); refreshController.loadFailed();
} }
@ -230,9 +231,9 @@ class _OrderHistoryList extends State<OrderHistoryList>
}); });
} }
String orderAllGoods(OrderInfo orderInfo){ String orderAllGoods(OrderInfo orderInfo) {
int count = 0; int count = 0;
if(orderInfo.productList != null){ if (orderInfo.productList != null) {
orderInfo.productList.forEach((element) { orderInfo.productList.forEach((element) {
count += element.buyNum; count += element.buyNum;
}); });
@ -314,7 +315,7 @@ class _OrderHistoryList extends State<OrderHistoryList>
// ), // ),
// ), // ),
Container( Container(
margin: EdgeInsets.only(left: 5.w, top: 12.h), margin: EdgeInsets.only(left: 5.w, top: 12.h),
), ),
Expanded( Expanded(
child: Container( child: Container(
@ -468,6 +469,7 @@ class _OrderHistoryList extends State<OrderHistoryList>
text: orderInfo.finalPayPrice, text: orderInfo.finalPayPrice,
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.black, color: Colors.black,
), ),
@ -568,16 +570,11 @@ class _OrderHistoryList extends State<OrderHistoryList>
queryDetails(id) async { queryDetails(id) async {
if (apiService == null) { if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance(); SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService( apiService = ApiService(Dio(),
Dio(), context: context, token: value.getString("token"), showLoading: true);
context: context,
token: value.getString("token"),
showLoading: true
);
} }
BaseData<OrderInfo> baseData = await apiService BaseData<OrderInfo> baseData =
.orderDetail(id) await apiService.orderDetail(id).catchError((error) {});
.catchError((error) {});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
return baseData.data; return baseData.data;
} }
@ -598,7 +595,9 @@ class _OrderHistoryList extends State<OrderHistoryList>
minService, minService,
orderInfo, orderInfo,
(BaseData baseData) { (BaseData baseData) {
SmartDialog.showToast(baseData?.msg == "ok" ?"订单支付成功" :baseData?.msg,alignment: Alignment.center); SmartDialog.showToast(
baseData?.msg == "ok" ? "订单支付成功" : baseData?.msg,
alignment: Alignment.center);
Future.delayed(Duration(seconds: 3), () { Future.delayed(Duration(seconds: 3), () {
_onRefresh(); _onRefresh();
}); });

24
lib/order/order_view/order_address.dart

@ -22,6 +22,7 @@ class OrderAddress extends StatefulWidget {
final Function orderCancel; final Function orderCancel;
final Function() carryOnPay; final Function() carryOnPay;
final OrderInfo orderInfo; final OrderInfo orderInfo;
final int jumpState;
OrderAddress( OrderAddress(
this.orderStatus, this.orderStatus,
@ -33,7 +34,8 @@ class OrderAddress extends StatefulWidget {
this.center, this.center,
this.carryOnPay, this.carryOnPay,
this.orderCancel, this.orderCancel,
this.orderInfo,); this.orderInfo,
this.jumpState);
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
@ -271,14 +273,18 @@ class _OrderAddress extends State<OrderAddress> {
widget.orderInfo.storeVO.storeName, widget.orderInfo.storeVO.storeName,
); );
} else { } else {
Navigator.of(context).pushNamed( if(widget.jumpState == 1){
'/router/store_order', Navigator.of(context).pop();
arguments: { }else if(widget.jumpState == 2){
"id": widget.orderInfo.storeVO.id, Navigator.of(context).popAndPushNamed(
"tenant": widget.orderInfo.tenantCode, '/router/store_order',
"storeName": widget.orderInfo.storeVO.storeName arguments: {
}, "id": widget.orderInfo.storeVO.id,
); "tenant": widget.orderInfo.tenantCode,
"storeName": widget.orderInfo.storeVO.storeName
},
);
}
} }
} }

8
lib/order/order_view/order_pay_selected.dart

@ -70,7 +70,7 @@ class _OrderPaySelected extends State<OrderPaySelected> {
Expanded(child: Padding( Expanded(child: Padding(
padding: EdgeInsets.only(left: 8.w), padding: EdgeInsets.only(left: 8.w),
child:Text( child:Text(
"助农积分", S.of(context).zhunongjifen,
style: TextStyle( style: TextStyle(
fontSize: 14.sp, fontSize: 14.sp,
color: Color(0xff353535), color: Color(0xff353535),
@ -101,7 +101,7 @@ class _OrderPaySelected extends State<OrderPaySelected> {
Expanded(child: Padding( Expanded(child: Padding(
padding: EdgeInsets.only(left: 8.w), padding: EdgeInsets.only(left: 8.w),
child: Text( child: Text(
S.of(context).pingtaiyue, S.of(context).huixiangqianbao,
style: TextStyle( style: TextStyle(
fontSize: 14.sp, fontSize: 14.sp,
color: Color(0xff353535), color: Color(0xff353535),
@ -132,7 +132,7 @@ class _OrderPaySelected extends State<OrderPaySelected> {
Expanded(child: Padding( Expanded(child: Padding(
padding: EdgeInsets.only(left: 8.w), padding: EdgeInsets.only(left: 8.w),
child:Text( child:Text(
S.of(context).dianpuyue, S.of(context).mendianyue,
style: TextStyle( style: TextStyle(
fontSize: 14.sp, fontSize: 14.sp,
color: Color(0xff353535), color: Color(0xff353535),
@ -164,7 +164,7 @@ class _OrderPaySelected extends State<OrderPaySelected> {
Expanded(child: Padding( Expanded(child: Padding(
padding: EdgeInsets.only(left: 8.w), padding: EdgeInsets.only(left: 8.w),
child:Text( child:Text(
"绿币余额", S.of(context).lvbizhifu,
style: TextStyle( style: TextStyle(
fontSize: 14.sp, fontSize: 14.sp,
color: Color(0xff353535), color: Color(0xff353535),

715
lib/order/write_off_page.dart

@ -3,6 +3,7 @@ import 'dart:convert';
import 'package:barcode_widget/barcode_widget.dart'; import 'package:barcode_widget/barcode_widget.dart';
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_html/flutter_html.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/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/base_data.dart';
@ -13,9 +14,13 @@ import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:huixiang/view_widget/separator.dart'; import 'package:huixiang/view_widget/separator.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:qr_flutter/qr_flutter.dart'; import 'package:qr_flutter/qr_flutter.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import '../view_widget/classic_header.dart';
import '../view_widget/my_footer.dart';
class WriteOffPage extends StatefulWidget { class WriteOffPage extends StatefulWidget {
final arguments; final arguments;
@ -31,6 +36,7 @@ class _WriteOffPage extends State<WriteOffPage> {
dynamic coupon; dynamic coupon;
ApiService apiService; ApiService apiService;
CouponDetail queryCoupon; CouponDetail queryCoupon;
final RefreshController refreshController = RefreshController();
@override @override
void initState() { void initState() {
@ -79,248 +85,495 @@ class _WriteOffPage extends State<WriteOffPage> {
background: Color(0xFF32A060), background: Color(0xFF32A060),
leadingColor: Colors.white, leadingColor: Colors.white,
), ),
body: Container( body: SmartRefresher(
alignment: Alignment.topCenter, controller: refreshController,
child: Stack( enablePullDown: false,
alignment: Alignment.topCenter, enablePullUp: false,
children: [ header: MyHeader(),
Image.asset( footer: CustomFooter(
"assets/image/icon_write_off_bg.webp", builder: (context, mode) {
width: MediaQuery.of(context).size.width * 0.912, return MyFooter(mode);
fit: BoxFit.fill, },
), ),
LayoutBuilder(builder: (context, constraints) { physics: BouncingScrollPhysics(),
return Container( scrollController: ScrollController(),
width: constraints.constrainWidth() * 0.912, child: Container(
child: Column( child: SingleChildScrollView(
children: [ physics: BouncingScrollPhysics(),
Expanded( child: Column(
child: Container( children: [
child: Column( Container(
children: [ alignment: Alignment.topCenter,
Text( height: 530.h,
coupon != null ? coupon["couponName"] : "", child: Stack(
style: TextStyle( alignment: Alignment.topCenter,
fontSize: 16.sp, children: [
fontWeight: FontWeight.bold, Image.asset(
color: Color(0xFF353535)), "assets/image/write_off_bg.webp",
), width: MediaQuery.of(context).size.width * 0.912,
SizedBox( height: 540.h,
height: 8.h, fit: BoxFit.fill,
),
Text(
(coupon["useStartTime"] == null || coupon["useEndTime"] == null) ? "" : S.of(context).youxiaoqi(
"${coupon["useStartTime"].replaceAll("-", ".").split(" ")[0]}-${coupon["useEndTime"].replaceAll("-", ".").split(" ")[0]}"),
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF353535),
),
),
],
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
),
alignment: Alignment.center,
),
flex: 6,
),
Container(
margin: EdgeInsets.only(left: 20.w, right: 20.w),
child: MySeparator(
width: 5.w,
height: 1.h,
color: Color(0xFFA29E9E),
), ),
), LayoutBuilder(builder: (context, constraints) {
Expanded( return Container(
child: Container( alignment: Alignment.center,
alignment: Alignment.center, width: constraints.constrainWidth() * 0.912,
child: Column( padding:EdgeInsets.only(top: 24.h),
mainAxisAlignment: MainAxisAlignment.center, child: Column(
crossAxisAlignment: CrossAxisAlignment.center, children: [
children: [ Container(
Text( child: Column(
coupon != null children: [
? "${coupon["memberCouponId"].substring(0, 4)} " Text(
"${coupon["memberCouponId"].substring(4, 8)} " coupon != null ? coupon["couponName"] : "",
"${coupon["memberCouponId"].substring(8, 12)} " style: TextStyle(
"${coupon["memberCouponId"].substring(12, 16)} " fontSize: 16.sp,
"${coupon["memberCouponId"].substring(16, coupon["memberCouponId"].length)}" fontWeight: FontWeight.bold,
: "", color: Color(0xFF353535)),
style: TextStyle( ),
fontSize: 14.sp, SizedBox(
wordSpacing: coupon == null height:11.h,
? 10 ),
: (MediaQuery.of(context).size.width - Text(
64.w) / (coupon["useStartTime"] == null || coupon["useEndTime"] == null) ? "" : S.of(context).youxiaoqi(
(((coupon["memberCouponId"].length) * 4)), "${coupon["useStartTime"].replaceAll("-", ".").split(" ")[0]}-${coupon["useEndTime"].replaceAll("-", ".").split(" ")[0]}"),
letterSpacing: coupon == null style: TextStyle(
? 8 fontSize: 12.sp,
: (MediaQuery.of(context).size.width - color: Color(0xFF353535),
64.w) / ),
(((coupon["memberCouponId"].length) * 4)), ),
fontWeight: MyFontWeight.semi_bold, ],
color: Color(0xFF353535), mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
),
alignment: Alignment.center,
), ),
), Container(
SizedBox( margin: EdgeInsets.only(left: 20.w, right: 20.w,top:16.h,bottom:30.h),
height: 12.h, child: MySeparator(
), width: 5.w,
BarcodeWidget( height: 1.h,
barcode: Barcode.code128(useCode128C: true), color: Color(0xFFA29E9E),
data: coupon != null ? coupon["memberCouponId"] : "",
height: 72.h,
color: Colors.black,
drawText: false,
),
SizedBox(
height: 16.h,
),
Expanded(child: QrImage(
data: "{\"type\":\"wiped\",\"memberCouponId\":\"${coupon["memberCouponId"]}\"}",
version: QrVersions.auto,
size: 200.w,
gapless: true,
),),
SizedBox(
height: 35.h,
),
],
),
margin: EdgeInsets.symmetric(horizontal: 20.w),
),
flex: 27,
),
Container(
child: MySeparator(
width: 5.w,
height: 1.h,
color: Color(0xFFA29E9E),
),
margin: EdgeInsets.only(left: 20.w, right: 20.w),
),
Expanded(
child: Container(
padding: EdgeInsets.fromLTRB(20.w, 15.h, 20.w, 15.h),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
width: 3.w,
height: 15.h,
margin:
EdgeInsets.fromLTRB(4.w, 7.h, 4.w, 7.h),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(3),
color: Color(0xFF20662A),
),
), ),
Text( ),
S.of(context).shiyongtiaojian, Expanded(
style: TextStyle( child: Container(
fontWeight: FontWeight.bold, alignment: Alignment.center,
fontSize: 14.sp, child: Column(
color: Color(0xFF353535), mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
coupon != null
? "${coupon["memberCouponId"].substring(0, 4)} "
"${coupon["memberCouponId"].substring(4, 8)} "
"${coupon["memberCouponId"].substring(8, 12)} "
"${coupon["memberCouponId"].substring(12, 16)} "
"${coupon["memberCouponId"].substring(16, coupon["memberCouponId"].length)}"
: "",
style: TextStyle(
fontSize: 14.sp,
wordSpacing: coupon == null
? 10
: (MediaQuery.of(context).size.width -
64.w) /
(((coupon["memberCouponId"].length) * 4)),
letterSpacing: coupon == null
? 8
: (MediaQuery.of(context).size.width -
64.w) /
(((coupon["memberCouponId"].length) * 4)),
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF353535),
),
),
SizedBox(
height: 15.h,
),
BarcodeWidget(
barcode: Barcode.code128(useCode128C: true),
data: coupon != null ? coupon["memberCouponId"] : "",
height: 72.h,
color: Colors.black,
drawText: false,
),
SizedBox(
height: 16.h,
),
Expanded(child: QrImage(
data: "{\"type\":\"wiped\",\"memberCouponId\":\"${coupon["memberCouponId"]}\"}",
version: QrVersions.auto,
size: 200.w,
gapless: true,
),),
SizedBox(
height: 35.h,
),
],
), ),
margin: EdgeInsets.symmetric(horizontal: 20.w),
), ),
], flex: 27,
), ),
Row( Container(
mainAxisAlignment: MainAxisAlignment.start, child: MySeparator(
crossAxisAlignment: CrossAxisAlignment.center, width: 5.w,
children: [ height: 1.h,
SizedBox( color: Color(0xFFA29E9E),
width: 11.w,
),
Expanded(
child: Text(
S
.of(context)
.qianwanghuixiangmendianduihuanhexiao,
style: TextStyle(
textBaseline: TextBaseline.alphabetic,
fontSize: 14.sp,
color: Color(0xFF353535)),
),
flex: 1,
), ),
], margin: EdgeInsets.only(left: 20.w, right: 20.w,bottom:20.h),
),
],
),
);
}),
//
// LayoutBuilder(builder: (context, constraints) {
// return Container(
// width: constraints.constrainWidth() * 0.912,
// child: Column(
// children: [
// Expanded(
// child: Container(
// child: Column(
// children: [
// Text(
// coupon != null ? coupon["couponName"] : "",
// style: TextStyle(
// fontSize: 16.sp,
// fontWeight: FontWeight.bold,
// color: Color(0xFF353535)),
// ),
// SizedBox(
// height: 8.h,
// ),
// Text(
// (coupon["useStartTime"] == null || coupon["useEndTime"] == null) ? "" : S.of(context).youxiaoqi(
// "${coupon["useStartTime"].replaceAll("-", ".").split(" ")[0]}-${coupon["useEndTime"].replaceAll("-", ".").split(" ")[0]}"),
// style: TextStyle(
// fontSize: 12.sp,
// color: Color(0xFF353535),
// ),
// ),
// ],
// mainAxisAlignment: MainAxisAlignment.center,
// crossAxisAlignment: CrossAxisAlignment.center,
// ),
// alignment: Alignment.center,
// ),
// flex: 6,
// ),
// Container(
// margin: EdgeInsets.only(left: 20.w, right: 20.w),
// child: MySeparator(
// width: 5.w,
// height: 1.h,
// color: Color(0xFFA29E9E),
// ),
// ),
// Expanded(
// child: Container(
// alignment: Alignment.center,
// child: Column(
// mainAxisAlignment: MainAxisAlignment.center,
// crossAxisAlignment: CrossAxisAlignment.center,
// children: [
// SizedBox(height: 5.h,),
// Text(
// coupon != null
// ? "${coupon["memberCouponId"].substring(0, 4)} "
// "${coupon["memberCouponId"].substring(4, 8)} "
// "${coupon["memberCouponId"].substring(8, 12)} "
// "${coupon["memberCouponId"].substring(12, 16)} "
// "${coupon["memberCouponId"].substring(16, coupon["memberCouponId"].length)}"
// : "",
// style: TextStyle(
// fontSize: 14.sp,
// wordSpacing: coupon == null
// ? 10
// : (MediaQuery.of(context).size.width -
// 64.w) /
// (((coupon["memberCouponId"].length) * 4)),
// letterSpacing: coupon == null
// ? 8
// : (MediaQuery.of(context).size.width -
// 64.w) /
// (((coupon["memberCouponId"].length) * 4)),
// fontWeight: MyFontWeight.semi_bold,
// color: Color(0xFF353535),
// ),
// ),
// SizedBox(
// height: 12.h,
// ),
// BarcodeWidget(
// barcode: Barcode.code128(useCode128C: true),
// data: coupon != null ? coupon["memberCouponId"] : "",
// height: 72.h,
// color: Colors.black,
// drawText: false,
// ),
// SizedBox(
// height: 16.h,
// ),
// Expanded(child: QrImage(
// data: "{\"type\":\"wiped\",\"memberCouponId\":\"${coupon["memberCouponId"]}\"}",
// version: QrVersions.auto,
// size: 200.w,
// gapless: true,
// ),),
// SizedBox(
// height: 35.h,
// ),
// ],
// ),
// margin: EdgeInsets.symmetric(horizontal: 20.w),
// ),
// flex: 27,
// ),
// Container(
// child: MySeparator(
// width: 5.w,
// height: 1.h,
// color: Color(0xFFA29E9E),
// ),
// margin: EdgeInsets.only(left: 20.w, right: 20.w),
// ),
// Expanded(
// child: Container(
// padding: EdgeInsets.fromLTRB(20.w, 15.h, 20.w, 15.h),
// child: Column(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// crossAxisAlignment: CrossAxisAlignment.center,
// children: [
// Row(
// mainAxisAlignment: MainAxisAlignment.start,
// crossAxisAlignment: CrossAxisAlignment.center,
// children: [
// Container(
// width: 3.w,
// height: 15.h,
// margin:
// EdgeInsets.fromLTRB(4.w, 7.h, 4.w, 7.h),
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(3),
// color: Color(0xFF20662A),
// ),
// ),
// Text(
// S.of(context).shiyongtiaojian,
// style: TextStyle(
// fontWeight: FontWeight.bold,
// fontSize: 14.sp,
// color: Color(0xFF353535),
// ),
// ),
// ],
// ),
// Row(
// mainAxisAlignment: MainAxisAlignment.start,
// crossAxisAlignment: CrossAxisAlignment.center,
// children: [
// SizedBox(
// width: 11.w,
// ),
// Expanded(
// child: Text(
// S
// .of(context)
// .qianwanghuixiangmendianduihuanhexiao,
// style: TextStyle(
// textBaseline: TextBaseline.alphabetic,
// fontSize: 14.sp,
// color: Color(0xFF353535)),
// ),
// flex: 1,
// ),
// ],
// ),
// Row(
// mainAxisAlignment: MainAxisAlignment.start,
// crossAxisAlignment: CrossAxisAlignment.center,
// children: [
// Container(
// width: 3.w,
// height: 15.h,
// margin: EdgeInsets.fromLTRB(4, 7, 4, 7),
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(3),
// color: Color(0xFF20662A),
// ),
// ),
// Text(
// S.of(context).shiyongshuoming,
// style: TextStyle(
// fontWeight: FontWeight.bold,
// fontSize: 14.sp,
// color: Color(0xFF353535)),
// ),
// ],
// ),
// Row(
// mainAxisAlignment: MainAxisAlignment.start,
// crossAxisAlignment: CrossAxisAlignment.center,
// children: [
// SizedBox(
// width: 11.w,
// ),
// Text(
// S.of(context).zitiduihuanquan,
// style: TextStyle(
// textBaseline: TextBaseline.alphabetic,
// fontSize: 14.sp,
// color: Color(0xFF353535),
// ),
// ),
// ],
// ),
// Row(
// mainAxisAlignment: MainAxisAlignment.start,
// crossAxisAlignment: CrossAxisAlignment.center,
// children: [
// SizedBox(
// width: 11.w,
// ),
// Text(
// S.of(context).huixiangrenyimendian,
// style: TextStyle(
// textBaseline: TextBaseline.alphabetic,
// fontSize: 14.sp,
// color: Color(0xFF353535),
// ),
// ),
// ],
// ),
// ],
// ),
// ),
// flex: 13,
// ),
// Expanded(
// child: Container(),
// flex: 3,
// ),
// ],
// ),
// );
// })
],
),
),
Container(
width: MediaQuery.of(context).size.width * 0.912,
padding: EdgeInsets.only(left:18.w, bottom:15.h, right:18.w),
margin:EdgeInsets.only(bottom: 21.h),
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(6),
bottomRight: Radius.circular(6),),
color: Colors.white,
boxShadow: [
BoxShadow(
color: Color(0x08213303).withAlpha(12),
offset: Offset(0, 2),
blurRadius: 3,
spreadRadius: 0,
),
],
),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
width: 3.w,
height: 15.h,
margin:
EdgeInsets.fromLTRB(4.w, 7.h, 4.w, 7.h),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(3),
color: Color(0xFF20662A),
), ),
Row( ),
mainAxisAlignment: MainAxisAlignment.start, Text(
crossAxisAlignment: CrossAxisAlignment.center, S.of(context).shiyongtiaojian,
children: [ style: TextStyle(
Container( fontWeight: FontWeight.bold,
width: 3.w, fontSize: 14.sp,
height: 15.h, color: Color(0xFF353535),
margin: EdgeInsets.fromLTRB(4, 7, 4, 7),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(3),
color: Color(0xFF20662A),
),
),
Text(
S.of(context).shiyongshuoming,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 14.sp,
color: Color(0xFF353535)),
),
],
), ),
Row( ),
mainAxisAlignment: MainAxisAlignment.start, ],
crossAxisAlignment: CrossAxisAlignment.center, ),
children: [ SizedBox(height:12.h,),
SizedBox( Row(
width: 11.w, mainAxisAlignment: MainAxisAlignment.start,
), crossAxisAlignment: CrossAxisAlignment.center,
Text( children: [
S.of(context).zitiduihuanquan, SizedBox(
style: TextStyle( width: 11.w,
textBaseline: TextBaseline.alphabetic, ),
fontSize: 14.sp, Expanded(
color: Color(0xFF353535), child: Text(
), S
), .of(context)
], .qianwanghuixiangmendianduihuanhexiao,
style: TextStyle(
textBaseline: TextBaseline.alphabetic,
fontSize: 14.sp,
height: 1.5.h,
color: Color(0xFF353535)),
), ),
Row( flex: 1,
mainAxisAlignment: MainAxisAlignment.start, ),
crossAxisAlignment: CrossAxisAlignment.center, ],
children: [ ),
SizedBox( SizedBox(height:16.h,),
width: 11.w, Row(
), mainAxisAlignment: MainAxisAlignment.start,
Text( crossAxisAlignment: CrossAxisAlignment.center,
S.of(context).huixiangrenyimendian, children: [
style: TextStyle( Container(
textBaseline: TextBaseline.alphabetic, width: 3.w,
fontSize: 14.sp, height: 15.h,
color: Color(0xFF353535), margin: EdgeInsets.fromLTRB(4.w, 7.h, 4.w, 7.h),
), decoration: BoxDecoration(
), borderRadius: BorderRadius.circular(3),
], color: Color(0xFF20662A),
), ),
], ),
), Text(
S.of(context).shiyongshuoming,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 14.sp,
color: Color(0xFF353535)),
),
],
), ),
flex: 13, Container(
), child: Html(
Expanded( data:
child: Container(), coupon != null ? coupon["remark"] : "",
flex: 3, customImageRenders: {
), networkSourceMatcher(): networkImageRender(
], loadingWidget: () {
), return Container();
); },
}) ),
], },
),
)
],
),
)
],
),
),
), ),
), ),
); );

86
lib/qr/qr_code_scan.dart

@ -57,31 +57,81 @@ class _QrCodeScanPage extends State<QrCodeScanPage> {
right: 0, right: 0,
), ),
Positioned( Positioned(
child: MyAppBar( child: Container(
title: "扫码", margin: EdgeInsets.only(left:12.w,right: 16.w,top: 16.h),
titleColor: Colors.white, child:Row(
leadingColor: Colors.white, mainAxisAlignment: MainAxisAlignment.spaceBetween,
brightness: Brightness.dark, crossAxisAlignment: CrossAxisAlignment.center,
background: Colors.transparent, children: [
action: Container( GestureDetector(
alignment: Alignment.center, behavior: HitTestBehavior.opaque,
margin: EdgeInsets.only(right: 16.w), onTap: (){
child: GestureDetector( Navigator.of(context).pop();
onTap: () { },
pickImage(); child: Container(
}, padding: EdgeInsets.symmetric(horizontal:10.w),
child: Text( alignment: Alignment.centerLeft,
S.of(context).xiangce, child: Image.asset(
"assets/image/return_left.webp",
fit: BoxFit.fill,
color: Colors.white,
),
),
),
Spacer(),
Expanded(child:Text(
S.of(context).saoma,
style: TextStyle( style: TextStyle(
color: Colors.black, color: Colors.white,
fontSize: 18.sp, fontSize: 18.sp,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
)),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
pickImage();
},
child:Container(
padding: EdgeInsets.symmetric(horizontal:10.w),
child: Text(
S.of(context).xiangce,
style: TextStyle(
color: Colors.black,
fontSize: 18.sp,
fontWeight: FontWeight.bold,
),
),
),
), ),
), ],
), ),
), ),
top: 0, // MyAppBar(
// title: "扫码",
// titleColor: Colors.white,
// leadingColor: Colors.white,
// brightness: Brightness.dark,
// background: Colors.transparent,
// action: Container(
// alignment: Alignment.center,
// margin: EdgeInsets.only(right: 16.w),
// child: GestureDetector(
// onTap: () {
// pickImage();
// },
// child: Text(
// S.of(context).xiangce,
// style: TextStyle(
// color: Colors.black,
// fontSize: 18.sp,
// fontWeight: FontWeight.bold,
// ),
// ),
// ),
// ),
// ),
top:MediaQuery.of(context).padding.top,
left: 0, left: 0,
right: 0, right: 0,
), ),

8
lib/retrofit/data/settleOrderInfo.dart

@ -543,6 +543,7 @@ class MemberVo {
String money, String money,
String activityMoney, String activityMoney,
String greenMoney, String greenMoney,
String raiseMoney,
String expendAmount, String expendAmount,
dynamic organic, dynamic organic,
String points, String points,
@ -577,6 +578,7 @@ class MemberVo {
_money = money; _money = money;
_activityMoney = activityMoney; _activityMoney = activityMoney;
_greenMoney = greenMoney; _greenMoney = greenMoney;
_raiseMoney = raiseMoney;
_expendAmount = expendAmount; _expendAmount = expendAmount;
_organic = organic; _organic = organic;
_points = points; _points = points;
@ -614,6 +616,7 @@ class MemberVo {
_money = json['money']; _money = json['money'];
_activityMoney = json['activityMoney']; _activityMoney = json['activityMoney'];
_greenMoney = json['greenMoney']; _greenMoney = json['greenMoney'];
_raiseMoney = json['raiseMoney'];
_expendAmount = json['expendAmount']; _expendAmount = json['expendAmount'];
_organic = json['organic']; _organic = json['organic'];
_points = json['points']; _points = json['points'];
@ -649,6 +652,7 @@ class MemberVo {
String _money; String _money;
String _activityMoney; String _activityMoney;
String _greenMoney; String _greenMoney;
String _raiseMoney;
String _expendAmount; String _expendAmount;
dynamic _organic; dynamic _organic;
String _points; String _points;
@ -683,6 +687,7 @@ class MemberVo {
String money, String money,
String activityMoney, String activityMoney,
String greenMoney, String greenMoney,
String raiseMoney,
String expendAmount, String expendAmount,
dynamic organic, dynamic organic,
String points, String points,
@ -717,6 +722,7 @@ class MemberVo {
money: money ?? _money, money: money ?? _money,
activityMoney: activityMoney ?? _activityMoney, activityMoney: activityMoney ?? _activityMoney,
greenMoney: greenMoney ?? _greenMoney, greenMoney: greenMoney ?? _greenMoney,
raiseMoney: raiseMoney ?? _raiseMoney,
expendAmount: expendAmount ?? _expendAmount, expendAmount: expendAmount ?? _expendAmount,
organic: organic ?? _organic, organic: organic ?? _organic,
points: points ?? _points, points: points ?? _points,
@ -752,6 +758,7 @@ class MemberVo {
String get money => _money; String get money => _money;
String get activityMoney => _activityMoney; String get activityMoney => _activityMoney;
String get greenMoney => _greenMoney; String get greenMoney => _greenMoney;
String get raiseMoney => _raiseMoney;
String get expendAmount => _expendAmount; String get expendAmount => _expendAmount;
dynamic get organic => _organic; dynamic get organic => _organic;
String get points => _points; String get points => _points;
@ -789,6 +796,7 @@ class MemberVo {
map['money'] = _money; map['money'] = _money;
map['activityMoney'] = _activityMoney; map['activityMoney'] = _activityMoney;
map['greenMoney'] = _greenMoney; map['greenMoney'] = _greenMoney;
map['raiseMoney'] = _raiseMoney;
map['expendAmount'] = _expendAmount; map['expendAmount'] = _expendAmount;
map['organic'] = _organic; map['organic'] = _organic;
map['points'] = _points; map['points'] = _points;

3
lib/retrofit/data/user_info.dart

@ -20,6 +20,7 @@ class UserInfo {
UserInfo(); UserInfo();
String vipNo; String vipNo;
String vipScanNo;
String nickname; String nickname;
String headimg; String headimg;
bool userType; bool userType;
@ -54,6 +55,7 @@ class UserInfo {
factory UserInfo.fromJson(Map<String, dynamic> json) => factory UserInfo.fromJson(Map<String, dynamic> json) =>
UserInfo() UserInfo()
..vipNo = json['vipNo'] as String ..vipNo = json['vipNo'] as String
..vipScanNo =json['vipScanNo'] as String
..nickname = json['nickname'] as String ..nickname = json['nickname'] as String
..headimg = json['headimg'] as String ..headimg = json['headimg'] as String
..userType = json['userType'] as bool ..userType = json['userType'] as bool
@ -87,6 +89,7 @@ class UserInfo {
Map<String, dynamic> toJson() => <String, dynamic>{ Map<String, dynamic> toJson() => <String, dynamic>{
'vipNo': this.vipNo, 'vipNo': this.vipNo,
'vipScanNo':this.vipScanNo,
'nickname': this.nickname, 'nickname': this.nickname,
'headimg': this.headimg, 'headimg': this.headimg,
'userType': this.userType, 'userType': this.userType,

2
lib/retrofit/retrofit_api.dart

@ -497,7 +497,7 @@ abstract class ApiService {
Future<BaseData> wiped(@Path("memberCouponId") String memberCouponId); Future<BaseData> wiped(@Path("memberCouponId") String memberCouponId);
/// ///
@GET("/coupon/detail/") @GET("/coupon/detail/{memberCouponId}")
Future<BaseData<CouponDetail>> couponDetail(@Path("") String memberCouponId); Future<BaseData<CouponDetail>> couponDetail(@Path("") String memberCouponId);
/// ///

4
lib/retrofit/retrofit_api.g.dart

@ -866,7 +866,7 @@ 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) => PageInfo<OrderInfo>.fromJson( (json) => ((json??"") == "")?null:PageInfo<OrderInfo>.fromJson(
json, json,
(json) => OrderInfo.fromJson(json), (json) => OrderInfo.fromJson(json),
), ),
@ -1862,7 +1862,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>>('coupon/detail/', final _result = await _dio.request<Map<String, dynamic>>('coupon/detail/$memberCouponId',
queryParameters: queryParameters, queryParameters: queryParameters,
options: RequestOptions( options: RequestOptions(
method: 'GET', method: 'GET',

6
lib/setting/logout_ing.dart

@ -422,7 +422,7 @@ class _LogoutIng extends State<LogoutIng> {
Padding( Padding(
padding: EdgeInsets.only(bottom: 13), padding: EdgeInsets.only(bottom: 13),
child: Text( child: Text(
(balance == "0.00" && money == "0.00") ? "由于当于帐号已注销,系统将自动退出登录":"您的平台余额及店铺余额未使用完!", (balance == "0.00" && money == "0.00") ? "由于当于帐号已注销,系统将自动退出登录":"您的回乡钱包余额及门店余额未使用完!",
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
fontSize: 16.sp, fontSize: 16.sp,
@ -434,7 +434,7 @@ class _LogoutIng extends State<LogoutIng> {
), ),
if(balance != "0.00" && money != "0.00" || balance != "0.00" || money != "0.00") if(balance != "0.00" && money != "0.00" || balance != "0.00" || money != "0.00")
Text( Text(
"${S.of(context).pingtaiyue}$money", "${S.of(context).huixiangqianbao}$money",
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
fontSize: 16.sp, fontSize: 16.sp,
@ -444,7 +444,7 @@ class _LogoutIng extends State<LogoutIng> {
), ),
if(balance != "0.00" && money != "0.00" || balance != "0.00" || money != "0.00") if(balance != "0.00" && money != "0.00" || balance != "0.00" || money != "0.00")
Text( Text(
"${S.of(context).dianpuyue}:¥ $balance", "${S.of(context).mendianyue}:¥ $balance",
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
fontSize: 16.sp, fontSize: 16.sp,

22
lib/settlement/settlement.dart

@ -82,7 +82,7 @@ class _Settlement extends State<Settlement> {
int count1 = 0; int count1 = 0;
String productId; String productId;
bool orderButton = false; bool orderButton = false;
bool useVipPriceSelect = false; bool useVipPriceSelect = true;
bool showVipTips = false; bool showVipTips = false;
bool isRaiseChannel = false; bool isRaiseChannel = false;
@ -122,6 +122,7 @@ class _Settlement extends State<Settlement> {
storeId: storeId, storeId: storeId,
showLoading: false showLoading: false
); );
queryMemberInfo();
if (promotions != null && promotions != "" && tableId <= 0) { if (promotions != null && promotions != "" && tableId <= 0) {
queryOrderInfo( queryOrderInfo(
address != null ? address.id : null, address != null ? address.id : null,
@ -256,6 +257,20 @@ class _Settlement extends State<Settlement> {
} }
} }
///
queryMemberInfo() async {
BaseData baseData = await minService.memberInfo().catchError((error) {
debugPrint(error);
});
if (baseData != null && baseData.isSuccess) {
SharedPreferences.getInstance().then(
(value) => {
value.setString('minMember', jsonEncode(baseData.data)),
},
);
}
}
/// ///
queryOrderDetails(id) async { queryOrderDetails(id) async {
BaseData<MinOrderInfo> baseData = await minService.getOrderDetails({ BaseData<MinOrderInfo> baseData = await minService.getOrderDetails({
@ -683,6 +698,7 @@ class _Settlement extends State<Settlement> {
'/router/order_details', '/router/order_details',
arguments: { arguments: {
"id": orderId, "id": orderId,
"jumpState":1,
}, },
); );
// Navigator.of(context).pop(); // Navigator.of(context).pop();
@ -756,7 +772,7 @@ class _Settlement extends State<Settlement> {
payChannel, payChannel,
tableId ?? 0); tableId ?? 0);
}, queryAddress, storeInfo, address, }, queryAddress, storeInfo, address,
selectedAddress, pageType), selectedAddress, pageType,widget.arguments["distance"]),
SizedBox( SizedBox(
height: 16, height: 16,
@ -795,7 +811,7 @@ class _Settlement extends State<Settlement> {
() { () {
Navigator.of(context).pushNamed( Navigator.of(context).pushNamed(
'/router/edit_remarks_page', '/router/edit_remarks_page',
arguments: {}, arguments: {"remake":remakers}
).then((value) => { ).then((value) => {
setState(() { setState(() {
if (value != null) remakers = value; if (value != null) remakers = value;

6
lib/settlement/settlement_view/activity_coupon_remarks.dart

@ -47,7 +47,7 @@ class ActivityCouponRemarks extends StatefulWidget {
} }
class _ActivityCouponRemarks extends State<ActivityCouponRemarks> { class _ActivityCouponRemarks extends State<ActivityCouponRemarks> {
bool vipSelect = false; bool vipSelect = true;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -76,7 +76,7 @@ class _ActivityCouponRemarks extends State<ActivityCouponRemarks> {
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
if(!(widget?.settleOrderInfo?.isRaise ?? false)) if(!(widget?.settleOrderInfo?.isRaise ?? false) && (widget?.settleOrderInfo?.memberVO?.isVip ?? false))
Row( Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
@ -84,7 +84,7 @@ class _ActivityCouponRemarks extends State<ActivityCouponRemarks> {
Expanded( Expanded(
flex: 1, flex: 1,
child: Text( child: Text(
"VIP价格", "VIP权益",
style: TextStyle( style: TextStyle(
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
fontSize: 14.sp, fontSize: 14.sp,

42
lib/settlement/settlement_view/distribution.dart

@ -26,9 +26,10 @@ class DistributionMode extends StatefulWidget {
final StoreInfo storeInfo; final StoreInfo storeInfo;
final Address address; final Address address;
final String pageType; final String pageType;
final double distance;
DistributionMode(this.queryOrderInfo, this.queryAddress, this.storeInfo, DistributionMode(this.queryOrderInfo, this.queryAddress, this.storeInfo,
this.address, this.selectedNewAddress, this.pageType); this.address, this.selectedNewAddress, this.pageType, this.distance);
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
@ -56,7 +57,7 @@ class _DistributionMode extends State<DistributionMode> {
/// ///
void startLocation() async { void startLocation() async {
Location.getInstance().startLocation(context, (BaiduLocation result){ Location.getInstance().startLocation(context, (BaiduLocation result) {
if (result != null && if (result != null &&
result.latitude != null && result.latitude != null &&
result.longitude != null) { result.longitude != null) {
@ -261,11 +262,21 @@ class _DistributionMode extends State<DistributionMode> {
Column( Column(
children: [ children: [
RoundButton( RoundButton(
// width: 41.w,
height: 13, height: 13,
text: distance.length > 3 text: distance.length > 3
? "${distance}km" ? ((widget.distance ?? 0) > 1000
: "距离您${distance}km", ? "${((widget.distance ?? 0) / 1000 * 100).toInt() / 100.0}km"
: S.of(context).mi(
((widget.distance ?? 0) *
100)
.toInt() /
100.0))
: "距离您${(widget.distance ?? 0) > 1000 ?
"${((widget.distance ?? 0) / 1000 * 100).toInt() / 100.0}km"
: S.of(context).mi(((widget.distance ?? 0) * 100).toInt() / 100.0)}",
// distance.length > 3
// ? "${distance}km"
// : "距离您${distance}km",
textColor: Color(0xFF34A262), textColor: Color(0xFF34A262),
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
radius: 7.5, radius: 7.5,
@ -310,16 +321,17 @@ class _DistributionMode extends State<DistributionMode> {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
(widget.storeInfo.storeName == "一心回乡商城") ? (widget.storeInfo.storeName == "一心回乡商城")
Icon( ? Icon(
Icons.local_shipping, Icons.local_shipping,
color: Color(0xFF727272), color: Color(0xFF727272),
size: 24, size: 24,
):Image.asset( )
"assets/image/icon_permission_location.webp", : Image.asset(
height: 24.h, "assets/image/icon_permission_location.webp",
width: 24.w, height: 24.h,
), width: 24.w,
),
SizedBox(width: 5), SizedBox(width: 5),
Text( Text(
widget?.address?.username ?? "", widget?.address?.username ?? "",

13
lib/settlement/settlement_view/pay_method.dart

@ -90,6 +90,7 @@ class _PayMethod extends State<PayMethod> {
), ),
if(!(widget.settleOrderInfo?.isRaise ?? false)) if(!(widget.settleOrderInfo?.isRaise ?? false))
GestureDetector( GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () { onTap: () {
setState(() { setState(() {
checkIndex = 1; checkIndex = 1;
@ -118,7 +119,7 @@ class _PayMethod extends State<PayMethod> {
width: 10, width: 10,
), ),
Text( Text(
S.of(context).pingtaiyue, S.of(context).huixiangqianbao,
style: TextStyle( style: TextStyle(
fontSize: 14.sp, fontSize: 14.sp,
color: Color(0xff353535), color: Color(0xff353535),
@ -134,6 +135,7 @@ class _PayMethod extends State<PayMethod> {
), ),
if(!(widget.settleOrderInfo?.isRaise ?? false)) if(!(widget.settleOrderInfo?.isRaise ?? false))
GestureDetector( GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () { onTap: () {
setState(() { setState(() {
checkIndex = 2; checkIndex = 2;
@ -162,7 +164,7 @@ class _PayMethod extends State<PayMethod> {
width: 10, width: 10,
), ),
Text( Text(
S.of(context).dianpuyue, S.of(context).mendianyue,
style: TextStyle( style: TextStyle(
fontSize: 14.sp, fontSize: 14.sp,
color: Color(0xff353535), color: Color(0xff353535),
@ -178,6 +180,7 @@ class _PayMethod extends State<PayMethod> {
), ),
if(mGreenMoney!="0.00" && !(widget.settleOrderInfo?.isRaise ?? false)) if(mGreenMoney!="0.00" && !(widget.settleOrderInfo?.isRaise ?? false))
GestureDetector( GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () { onTap: () {
setState(() { setState(() {
checkIndex = 3; checkIndex = 3;
@ -215,7 +218,7 @@ class _PayMethod extends State<PayMethod> {
width: 10, width: 10,
), ),
Text( Text(
"绿币余额", S.of(context).lvbizhifu,
style: TextStyle( style: TextStyle(
fontSize: 14.sp, fontSize: 14.sp,
color: Color(0xff353535), color: Color(0xff353535),
@ -231,6 +234,7 @@ class _PayMethod extends State<PayMethod> {
), ),
if(mRaiseMoney!="0" && (widget.settleOrderInfo?.isRaise ?? false)) if(mRaiseMoney!="0" && (widget.settleOrderInfo?.isRaise ?? false))
GestureDetector( GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () { onTap: () {
setState(() { setState(() {
checkIndex = 4; checkIndex = 4;
@ -284,6 +288,7 @@ class _PayMethod extends State<PayMethod> {
), ),
if(!(widget.settleOrderInfo?.isRaise ?? false)) if(!(widget.settleOrderInfo?.isRaise ?? false))
GestureDetector( GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () { onTap: () {
setState(() { setState(() {
checkIndex = 5; checkIndex = 5;
@ -320,7 +325,7 @@ class _PayMethod extends State<PayMethod> {
Widget checkView(var index) { Widget checkView(var index) {
return Container( return Container(
padding: EdgeInsets.only(right: 16.w), padding: EdgeInsets.only(right:36.w),
alignment: Alignment.center, alignment: Alignment.center,
child: Image.asset( child: Image.asset(
checkIndex != index checkIndex != index

2
lib/settlement/settlement_view/settlement_order_commodity.dart

@ -105,7 +105,7 @@ class _SettlementOrderCommodity extends State<SettlementOrderCommodity> {
); );
} }
if(widget.useVipPriceSelect ){ if(widget.useVipPriceSelect && widget.settleOrderInfo.memberVO.isVip && (!widget.settleOrderInfo.isRaise) && (widget?.settleOrderInfo?.discountAmount!= "0")){
widgets.add(vipItem(Color(0xFFFF7A1A), "VIP优惠", widget?.settleOrderInfo?.discountAmount ?? "")); widgets.add(vipItem(Color(0xFFFF7A1A), "VIP优惠", widget?.settleOrderInfo?.discountAmount ?? ""));
} }

357
lib/store/shop_details_page.dart

@ -65,6 +65,7 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
String storeId; String storeId;
String parentId; String parentId;
int numberOfPeople = 0; int numberOfPeople = 0;
int index;
@override @override
void initState() { void initState() {
@ -91,7 +92,6 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
buildCount(); buildCount();
} }
/// ///
queryStoreInfo() async { queryStoreInfo() async {
SharedPreferences value = await SharedPreferences.getInstance(); SharedPreferences value = await SharedPreferences.getInstance();
@ -152,7 +152,6 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
}); });
} }
/// ///
queryMiNiDetail(id) async { queryMiNiDetail(id) async {
BaseData<MiNiDetail> baseData = BaseData<MiNiDetail> baseData =
@ -938,10 +937,8 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
child: Container( child: Container(
margin: EdgeInsets.only(left: 16, top: 52), margin: EdgeInsets.only(left: 16, top: 52),
padding: EdgeInsets.all(5), padding: EdgeInsets.all(5),
child: Icon( child: Image.asset(
Icons.arrow_back_ios, "assets/image/integral_return.webp",
size: 24,
color: Color(0xFF353535),
), ),
), ),
), ),
@ -959,205 +956,199 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
context, context,
state, state,
) { ) {
return WillPopScope( return Container(
onWillPop: () async => false, alignment: Alignment.topCenter,
child:Container( padding: EdgeInsets.symmetric(horizontal: 14.w,vertical: 16),
alignment: Alignment.topCenter, height: MediaQuery.of(context).size.height / 3 * 2,
padding: EdgeInsets.symmetric(horizontal: 14.w,vertical: 16), width: double.infinity,
height: MediaQuery.of(context).size.height / 3 * 2, decoration: BoxDecoration(
width: double.infinity, color: Color(0xFFFAFAFA),
decoration: BoxDecoration( borderRadius: BorderRadius.only(
color: Color(0xFFFAFAFA), topLeft: Radius.circular(8),
borderRadius: BorderRadius.only( topRight: Radius.circular(8),
topLeft: Radius.circular(8), ),
topRight: Radius.circular(8), ),
), child: Column(
), mainAxisAlignment: MainAxisAlignment.start,
child: Column( crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Row( ClipRRect(
mainAxisAlignment: MainAxisAlignment.start, child: MImage(
crossAxisAlignment: CrossAxisAlignment.start, miNiDetail.imgs[0],
children: [ fit: BoxFit.cover,
ClipRRect( width: 70,
child: MImage( height: 70,
miNiDetail.imgs[0], errorSrc: "assets/image/default_2_1.webp",
fit: BoxFit.cover, fadeSrc: "assets/image/default_2_1.webp",
width: 70, ),
height: 70, borderRadius: BorderRadius.circular(4),
errorSrc: "assets/image/default_2_1.webp", ),
fadeSrc: "assets/image/default_2_1.webp", SizedBox(
), width: 10.w,
borderRadius: BorderRadius.circular(4), ),
), Expanded(
SizedBox( child: Container(
width: 10.w, height: 70,
), child: Column(
Expanded( mainAxisAlignment: MainAxisAlignment.spaceBetween,
child: Container( crossAxisAlignment: CrossAxisAlignment.start,
height: 70, children: [
child: Column( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
miNiDetail?.productName ?? "",
style: TextStyle(
fontSize: 13.sp,
fontWeight: FontWeight.bold,
color: Color(0xFF000000),
),
),
GestureDetector(
onTap: () {
Navigator.of(context).pop();
},
child: Image.asset(
"assets/image/cancel.webp",
fit: BoxFit.cover,
height: 24,
width: 24,
),
),
],
),
Text( Text(
"${miNiDetail?.price ?? ""}", miNiDetail?.productName ?? "",
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 13.sp,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Color(0xFFF65720), color: Color(0xFF000000),
),
),
GestureDetector(
onTap: () {
Navigator.of(context).pop();
},
child: Image.asset(
"assets/image/cancel.webp",
fit: BoxFit.cover,
height: 24,
width: 24,
), ),
), ),
], ],
), ),
)), Text(
], "${miNiDetail?.price ?? ""}",
), style: TextStyle(
if (miNiDetail.attrList != null && fontSize: 12.sp,
miNiDetail.attrList.length > 0) fontWeight: FontWeight.bold,
SizedBox( color: Color(0xFFF65720),
height: 10, ),
), ),
if (miNiDetail.attrList != null && ],
miNiDetail.attrList.length > 0) ),
Expanded( )),
child: ListView.builder( ],
itemCount: miNiDetail.attrList.length, ),
scrollDirection: Axis.vertical, if (miNiDetail.attrList != null &&
physics: BouncingScrollPhysics(), miNiDetail.attrList.length > 0)
padding: EdgeInsets.zero, SizedBox(
itemBuilder: (context, position) { height: 10,
return attrItem( ),
(attrValue) { if (miNiDetail.attrList != null &&
state(() { miNiDetail.attrList.length > 0)
// if(selectSkus.length > position) Expanded(
selectSkus[position] = attrValue; child: ListView.builder(
buildCount(); itemCount: miNiDetail.attrList.length,
}); scrollDirection: Axis.vertical,
}, physics: BouncingScrollPhysics(),
miNiDetail.attrList[position], padding: EdgeInsets.zero,
position, itemBuilder: (context, position) {
); return attrItem(
(attrValue) {
state(() {
// if(selectSkus.length > position)
selectSkus[position] = attrValue;
buildCount();
});
}, },
), miNiDetail.attrList[position],
position,
);
},
),
),
SizedBox(
height: 24,
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text(
"数量",
style: TextStyle(
color: Color(0xFFB3B3B3),
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
), ),
),
SizedBox( SizedBox(
height: 24, height: 10,
), ),
Column( Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
Text( InkWell(
"数量", onTap: () {
style: TextStyle( state(() {
color: Color(0xFFB3B3B3), if (counts > 1)
fontSize: 12.sp, setState(() {
fontWeight: MyFontWeight.regular, counts -= 1;
),
),
SizedBox(
height: 10,
),
Row(
children: [
InkWell(
onTap: () {
state(() {
if (counts > 1)
setState(() {
counts -= 1;
});
reduce(miNiDetail, selectSkus);
}); });
}, // reduce(miNiDetail, selectSkus);
child: Icon( });
Icons.remove, },
color: Color(0xFF32A060), child: Icon(
size: 24, Icons.remove,
) color: Color(0xFF32A060),
// Image.asset( size: 24,
// "assets/image/reduce.webp", )
// width: 22, ),
// height: 22, Padding(
// ), padding: EdgeInsets.only(left: 8, right: 8),
), child: Text(
Padding( "$counts",
padding: EdgeInsets.only(left: 8, right: 8), style: TextStyle(
child: Text( color: Colors.black,
"$counts", fontSize: 14.sp,
style: TextStyle( fontWeight: MyFontWeight.medium,
color: Colors.black,
fontSize: 14.sp,
fontWeight: MyFontWeight.medium,
),
),
), ),
InkWell( ),
onTap: () { ),
state(() { InkWell(
counts += 1; onTap: () {
add(miNiDetail, selectSkus); state(() {
}); counts += 1;
}, // add(miNiDetail, selectSkus);
child: Icon( });
Icons.add, },
color: Color(0xFF32A060), child: Icon(
size: 24, Icons.add,
)), color: Color(0xFF32A060),
], size: 24,
) )),
], ],
), )
SizedBox(
height: 24,
),
RoundButton(
width: double.infinity,
height: 54.h,
text: "加入购物车",
textColor: Colors.white,
fontWeight: MyFontWeight.semi_bold,
radius: 27,
backgroup: Color(0xFF32A060),
fontSize: 16.sp,
callback: () {
state(() {
_addShopCar(miNiDetail, selectSkus, counts);
Navigator.of(context).pop();
});
},
),
], ],
), ),
)); SizedBox(
height: 24,
),
RoundButton(
width: double.infinity,
height: 54.h,
text: "加入购物车",
textColor: Colors.white,
fontWeight: MyFontWeight.semi_bold,
radius: 27,
backgroup: Color(0xFF32A060),
fontSize: 16.sp,
callback: () {
state(() {
_addShopCar(miNiDetail, selectSkus, counts);
counts = 1;
Navigator.of(context).pop();
});
},
),
],
),
);
}); });
}, },
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,

66
lib/store/store_order.dart

@ -515,12 +515,12 @@ class _StoreOrderPage extends State<StoreOrderPage>
Spacer(), Spacer(),
GestureDetector( GestureDetector(
onTap: () { onTap: () {
// if(AppUtils.compareTime(storeInfo.openStartTime,DateFormat('HH:mm:ss').format(DateTime.now())) if(AppUtils.compareTime(storeInfo.openStartTime,DateFormat('HH:mm:ss').format(DateTime.now()))
// &&(!AppUtils.compareTime(storeInfo.openEndTime,DateFormat('HH:mm:ss').format(DateTime.now())))){ &&(!AppUtils.compareTime(storeInfo.openEndTime,DateFormat('HH:mm:ss').format(DateTime.now())))){
toDownOrder(); toDownOrder();
// } }
// else else
// SmartDialog.showToast("营业时间:${storeInfo.openStartTime}-${storeInfo.openEndTime}", alignment: Alignment.center); SmartDialog.showToast("营业时间:${storeInfo.openStartTime}-${storeInfo.openEndTime}", alignment: Alignment.center);
}, },
child: RoundButton( child: RoundButton(
width: 103.w, width: 103.w,
@ -649,6 +649,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
"cid": cid, "cid": cid,
"shoppingCart": shopCarGoods, "shoppingCart": shopCarGoods,
"numberOfPeople": numberOfPeople, "numberOfPeople": numberOfPeople,
"distance":widget.arguments["distance"],
}, },
); );
if (tableId > 0) { if (tableId > 0) {
@ -737,15 +738,16 @@ 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);
if (count < 0) { if (count < 0) {
shopCarGoods.shoppingCartSkuItemList.forEach((element) { shopCarGoods.shoppingCartSkuItemList.forEach((element) async{
if (element.productId == id) { if (element.productId == id) {
shopCartReduce(element); await shopCartReduce(element);
setState(() {}); setState(() {});
} }
}); });
return; return;
} }
BaseData<MiNiDetail> baseData = await minService.miNiDetail(id); BaseData<MiNiDetail> baseData = await minService.miNiDetail(id);
EasyLoading.dismiss();
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
showStoreSelector(baseData.data, id, count); showStoreSelector(baseData.data, id, count);
} }
@ -758,20 +760,19 @@ class _StoreOrderPage extends State<StoreOrderPage>
} else { } else {
EasyLoading.dismiss(); EasyLoading.dismiss();
dialogShowing = true; dialogShowing = true;
SmartDialog.show( showModalBottomSheet(
widget: ProductSku( backgroundColor: Colors.transparent,
miNiDetail, context: context,
shopCarGoods, builder: (_) {
id, return ProductSku(
_addShopCar, miNiDetail,
add, shopCarGoods,
reduce, id,
), _addShopCar,
onDismiss: () { add,
dialogShowing = false; reduce,
}, );
alignmentTemp: Alignment.bottomCenter, });
);
} }
} }
@ -822,12 +823,10 @@ class _StoreOrderPage extends State<StoreOrderPage>
}, },
], ],
}); });
EasyLoading.dismiss(); // EasyLoading.dismiss();
if (baseDate != null && baseDate.isSuccess) { if (baseDate != null && baseDate.isSuccess) {
queryShopCar().then((value) { this.shopCarGoods = await queryShopCar();
this.shopCarGoods = value; setState(() {});
setState(() {});
});
} else { } else {
SmartDialog.showToast(baseDate?.msg, alignment: Alignment.center); SmartDialog.showToast(baseDate?.msg, alignment: Alignment.center);
} }
@ -917,7 +916,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
if (productSku == null) return; if (productSku == null) return;
String skuId = productSku.id; String skuId = productSku.id;
if (shopCarGoods == null) { if (shopCarGoods == null) {
await _addShopCar(miNiDetail, selectSkus, 2); await _addShopCar(miNiDetail, selectSkus, 1);
return; return;
} }
int shopSkuIndex = shopCarGoods.shoppingCartSkuItemList int shopSkuIndex = shopCarGoods.shoppingCartSkuItemList
@ -932,17 +931,16 @@ class _StoreOrderPage extends State<StoreOrderPage>
.firstWhere((element) => skuId == element.id); .firstWhere((element) => skuId == element.id);
shopCarTemp["shoppingCartSkuItemList"] = [cartSkuItem.toJson()]; shopCarTemp["shoppingCartSkuItemList"] = [cartSkuItem.toJson()];
} else { } else {
await _addShopCar(miNiDetail, selectSkus, 2); await _addShopCar(miNiDetail, selectSkus, 1);
return; return;
} }
BaseData<List<ShoppingCart>> baseDate = BaseData<List<ShoppingCart>> baseDate =
await minService.shoppingCartSingle(shopCarTemp); await minService.shoppingCartSingle(shopCarTemp);
if (baseDate.isSuccess) { if (baseDate.isSuccess) {
queryShopCar().then((value) { this.shopCarGoods = await queryShopCar();
this.shopCarGoods = value; debugPrint("count.toString()");
setState(() {}); setState(() {});
});
} }
} }
@ -956,7 +954,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
if (productSku == null) return; if (productSku == null) return;
String skuId = productSku.id; String skuId = productSku.id;
if (shopCarGoods == null) { if (shopCarGoods == null) {
await _addShopCar(miNiDetail, selectSkus, 2); await _addShopCar(miNiDetail, selectSkus, 1);
return; return;
} }
ShoppingCartSkuItemListBean shopSkuItem = shopCarGoods ShoppingCartSkuItemListBean shopSkuItem = shopCarGoods
@ -970,7 +968,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
shopCarGoods.shoppingCartSkuItemList[shopSkuIndex].buyNum -= 1; shopCarGoods.shoppingCartSkuItemList[shopSkuIndex].buyNum -= 1;
} }
} else { } else {
await _addShopCar(miNiDetail, selectSkus, 2); await _addShopCar(miNiDetail, selectSkus, 1);
return; return;
} }
shopCarGoods.tableId = "$tableId"; shopCarGoods.tableId = "$tableId";

630
lib/store/store_view/product_sku.dart

@ -1,4 +1,5 @@
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:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
@ -9,24 +10,18 @@ import 'package:huixiang/view_widget/custom_image.dart';
import 'package:huixiang/view_widget/round_button.dart'; import 'package:huixiang/view_widget/round_button.dart';
class ProductSku extends StatefulWidget { class ProductSku extends StatefulWidget {
final MiNiDetail miNiDetail; final MiNiDetail miNiDetail;
final String productId; final String productId;
final Function(MiNiDetail miNiDetail, List<String> selectSkus, int count) addShopCar; final Function(MiNiDetail miNiDetail, List<String> selectSkus, int count)
addShopCar;
final Function(MiNiDetail miNiDetail, List<String> selectSkus) add; final Function(MiNiDetail miNiDetail, List<String> selectSkus) add;
final Function(MiNiDetail miNiDetail, List<String> selectSkus) reduce; final Function(MiNiDetail miNiDetail, List<String> selectSkus) reduce;
final ShoppingCart shopCarGoods; final ShoppingCart shopCarGoods;
final int buttonType; final int buttonType;
ProductSku( ProductSku(this.miNiDetail, this.shopCarGoods, this.productId,
this.miNiDetail, this.addShopCar, this.add, this.reduce,
this.shopCarGoods, {this.buttonType});
this.productId,
this.addShopCar,
this.add,
this.reduce,
{ this.buttonType}
);
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
@ -36,8 +31,9 @@ class ProductSku extends StatefulWidget {
class _ProductSku extends State<ProductSku> { class _ProductSku extends State<ProductSku> {
List<String> selectSkus = []; List<String> selectSkus = [];
int count = 1; int count = 1, realCount = 0;
String selectedPrice = ""; String selectedPrice = "";
bool _isTapEd = false;
@override @override
void initState() { void initState() {
@ -57,16 +53,19 @@ class _ProductSku extends State<ProductSku> {
productSku = widget.miNiDetail.productSkuVOList.firstWhere((element) { productSku = widget.miNiDetail.productSkuVOList.firstWhere((element) {
return skuY(element, selectSkus); return skuY(element, selectSkus);
}); });
}catch(ex){ } catch (ex) {
return; return;
} }
if (productSku == null) return; if (productSku == null) return;
selectedPrice = productSku.skuPrice; selectedPrice = productSku.skuPrice;
String skuId = productSku.id; String skuId = productSku.id;
if (widget.shopCarGoods == null || widget.shopCarGoods.shoppingCartSkuItemList == null) return; if (widget.shopCarGoods == null ||
int shopSkuIndex = widget.shopCarGoods.shoppingCartSkuItemList.indexWhere((element) => skuId == element.id); widget.shopCarGoods.shoppingCartSkuItemList == null) return;
int shopSkuIndex = widget.shopCarGoods.shoppingCartSkuItemList
.indexWhere((element) => skuId == element.id);
if (shopSkuIndex >= 0) { if (shopSkuIndex >= 0) {
count = widget.shopCarGoods.shoppingCartSkuItemList[shopSkuIndex].buyNum; count = widget.shopCarGoods.shoppingCartSkuItemList[shopSkuIndex].buyNum;
realCount = count;
} }
} }
@ -81,19 +80,19 @@ class _ProductSku extends State<ProductSku> {
return gg; return gg;
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return WillPopScope( return WillPopScope(
onWillPop: () async { onWillPop: () async {
debugPrint("ssssasdadsasdadasd"); // debugPrint("ssssasdadsasdadasd");
SmartDialog.dismiss(); // SmartDialog.dismiss();
Navigator.of(context).pop();
return true; return true;
}, },
child: StatefulBuilder(builder: (context1, state) { child: StatefulBuilder(builder: (context1, state) {
return Container( return Container(
alignment: Alignment.topCenter, alignment: Alignment.topCenter,
padding: EdgeInsets.symmetric(horizontal: 14.w,vertical: 16), padding: EdgeInsets.symmetric(horizontal: 14.w, vertical: 16),
height: MediaQuery.of(context).size.height / 3 * 2, height: MediaQuery.of(context).size.height / 3 * 2,
width: double.infinity, width: double.infinity,
decoration: BoxDecoration( decoration: BoxDecoration(
@ -124,7 +123,8 @@ class _ProductSku extends State<ProductSku> {
SizedBox( SizedBox(
width: 10, width: 10,
), ),
Expanded(child:Column( Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -136,12 +136,15 @@ class _ProductSku extends State<ProductSku> {
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,
), ),
), ),
if(widget.miNiDetail.attrList[0].attrName!="") if (widget.miNiDetail.attrList[0].attrName != "")
Padding( Padding(
padding: EdgeInsets.only(top: 4, bottom: 7), padding: EdgeInsets.only(top: 4, bottom: 7),
child: Text( child: Text(
"已选: " + "已选: " +
(selectSkus.map((e) => "$e").toList().toString()), (selectSkus
.map((e) => "$e")
.toList()
.toString()),
maxLines: 1, maxLines: 1,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
@ -175,8 +178,8 @@ class _ProductSku extends State<ProductSku> {
)), )),
InkWell( InkWell(
onTap: () { onTap: () {
// Navigator.of(context).pop(); Navigator.of(context).pop();
SmartDialog.dismiss(); // SmartDialog.dismiss();
}, },
child: Image.asset( child: Image.asset(
"assets/image/cancel.webp", "assets/image/cancel.webp",
@ -187,11 +190,14 @@ class _ProductSku extends State<ProductSku> {
), ),
], ],
), ),
if (widget.miNiDetail.attrList != null && widget.miNiDetail.attrList.length > 0) if (widget.miNiDetail.attrList != null &&
widget.miNiDetail.attrList.length > 0)
SizedBox( SizedBox(
height:10, height: 10,
), ),
if (widget.miNiDetail.attrList != null && widget.miNiDetail.attrList.length > 0 && widget.miNiDetail.attrList[0].attrName!="") if (widget.miNiDetail.attrList != null &&
widget.miNiDetail.attrList.length > 0 &&
widget.miNiDetail.attrList[0].attrName != "")
Expanded( Expanded(
child: ListView.builder( child: ListView.builder(
itemCount: widget.miNiDetail.attrList.length, itemCount: widget.miNiDetail.attrList.length,
@ -200,7 +206,7 @@ class _ProductSku extends State<ProductSku> {
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
itemBuilder: (context, position) { itemBuilder: (context, position) {
return attrItem( return attrItem(
(attrValue) { (attrValue) {
state(() { state(() {
selectSkus[position] = attrValue; selectSkus[position] = attrValue;
buildCount(); buildCount();
@ -212,8 +218,8 @@ class _ProductSku extends State<ProductSku> {
}, },
), ),
), ),
if (widget.miNiDetail.attrList[0].attrName=="") if (widget.miNiDetail.attrList[0].attrName == "")
Expanded(child: Container()), Expanded(child: Container()),
SizedBox( SizedBox(
height: 24, height: 24,
), ),
@ -231,12 +237,15 @@ class _ProductSku extends State<ProductSku> {
), ),
), ),
InkWell( InkWell(
onTap: () { onTap: () async {
if (count > 1) if(count == 1)
setState(() { return;
count -= 1; _isTapEd = true;
}); EasyLoading.show(status: S.current.zhengzaijiazai);
widget.reduce(widget.miNiDetail, selectSkus); await widget.reduce(widget.miNiDetail, selectSkus);
count -= 1;
setState(() {});
EasyLoading.dismiss();
}, },
child: Image.asset( child: Image.asset(
"assets/image/reduce.webp", "assets/image/reduce.webp",
@ -256,11 +265,17 @@ class _ProductSku extends State<ProductSku> {
), ),
), ),
InkWell( InkWell(
onTap: () { onTap: () async {
setState(() { _isTapEd = true;
count += 1; EasyLoading.show(status: S.current.zhengzaijiazai);
}); if (count == 1 && realCount == 0)
widget.add(widget.miNiDetail, selectSkus); await widget.addShopCar(
widget.miNiDetail, selectSkus, 2);
else
await widget.add(widget.miNiDetail, selectSkus);
count += 1;
setState(() {});
EasyLoading.dismiss();
}, },
child: Image.asset( child: Image.asset(
"assets/image/add.webp", "assets/image/add.webp",
@ -273,7 +288,7 @@ class _ProductSku extends State<ProductSku> {
SizedBox( SizedBox(
height: 24, height: 24,
), ),
if(widget.buttonType != 1) if (widget.buttonType != 1)
RoundButton( RoundButton(
width: double.infinity, width: double.infinity,
height: 54.h, height: 54.h,
@ -284,12 +299,13 @@ class _ProductSku extends State<ProductSku> {
backgroup: Color(0xFF32A060), backgroup: Color(0xFF32A060),
fontSize: 16.sp, fontSize: 16.sp,
callback: () { callback: () {
// Navigator.of(context).pop(); Navigator.of(context).pop();
SmartDialog.dismiss(); // SmartDialog.dismiss();
widget.addShopCar(widget.miNiDetail, selectSkus, 1); if (!_isTapEd)
widget.addShopCar(widget.miNiDetail, selectSkus, 1);
}, },
), ),
if(widget.buttonType == 1) if (widget.buttonType == 1)
RoundButton( RoundButton(
width: double.infinity, width: double.infinity,
height: 54.h, height: 54.h,
@ -300,72 +316,21 @@ class _ProductSku extends State<ProductSku> {
backgroup: Color(0xFF32A060), backgroup: Color(0xFF32A060),
fontSize: 16.sp, fontSize: 16.sp,
callback: () { callback: () {
// Navigator.of(context).pop(); Navigator.of(context).pop();
SmartDialog.dismiss(); // SmartDialog.dismiss();
widget.addShopCar(widget.miNiDetail, selectSkus,count); widget.addShopCar(widget.miNiDetail, selectSkus, count);
}, },
), ),
/// ///
if(widget.buttonType == 2) if (widget.buttonType == 2)
Row( Row(
children: [ children: [
Expanded(child: GestureDetector( Expanded(
onTap: (){ child: GestureDetector(
Navigator.of(context).pushReplacementNamed('/router/group_details'); onTap: () {
}, Navigator.of(context)
child: Container( .pushReplacementNamed('/router/group_details');
alignment: Alignment.center,
width: 120.w,
height:40.h,
margin: EdgeInsets.only(left: 6.w),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(16),
border: Border.all(
width: 1,
color: Color(0xFF32A060),
style: BorderStyle.solid,
),
),
child: Column(
children: [
Text.rich(
TextSpan(
children: [
TextSpan(
text: "",
style: TextStyle(
fontSize: 7.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF32A060),
),
),
TextSpan(
text: "284.00",
style: TextStyle(
fontSize: 10.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF32A060),
),
),
],
),
),
Expanded(child:
Text(
"原价购买",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF32A060),
),
)),
],
),
),
),),
Expanded(child: GestureDetector(
onTap: (){
Navigator.of(context).popAndPushNamed('/router/bargain_details');
}, },
child: Container( child: Container(
alignment: Alignment.center, alignment: Alignment.center,
@ -373,16 +338,12 @@ class _ProductSku extends State<ProductSku> {
height: 40.h, height: 40.h,
margin: EdgeInsets.only(left: 6.w), margin: EdgeInsets.only(left: 6.w),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Color(0xFF32A060),
borderRadius: BorderRadius.circular(16), borderRadius: BorderRadius.circular(16),
boxShadow: [ border: Border.all(
BoxShadow( width: 1,
color: Colors.black.withAlpha(12), color: Color(0xFF32A060),
offset: Offset(0, 3), style: BorderStyle.solid,
blurRadius: 14, ),
spreadRadius: 0,
),
],
), ),
child: Column( child: Column(
children: [ children: [
@ -394,7 +355,7 @@ class _ProductSku extends State<ProductSku> {
style: TextStyle( style: TextStyle(
fontSize: 7.sp, fontSize: 7.sp,
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,
color: Colors.white, color: Color(0xFF32A060),
), ),
), ),
TextSpan( TextSpan(
@ -402,89 +363,99 @@ class _ProductSku extends State<ProductSku> {
style: TextStyle( style: TextStyle(
fontSize: 10.sp, fontSize: 10.sp,
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,
color: Colors.white, color: Color(0xFF32A060),
), ),
), ),
], ],
), ),
), ),
Expanded(child: Expanded(
Text( child: Text(
"我要砍价", "原价购买",
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,
color: Colors.white, color: Color(0xFF32A060),
), ),
),), )),
], ],
), ),
)),),
],
),
///
if(widget.buttonType == 3)
Row(
children: [
Expanded(child:GestureDetector(
onTap: (){
Navigator.of(context).popAndPushNamed('/router/group_details');
},
child: Container(
alignment: Alignment.center,
width: 120.w,
height:40.h,
margin: EdgeInsets.only(left: 6.w),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(16),
border: Border.all(
width: 1,
color: Color(0xFF32A060),
style: BorderStyle.solid,
),
), ),
child: Column( ),
children: [ ),
Text.rich( Expanded(
TextSpan( child: GestureDetector(
children: [ onTap: () {
Navigator.of(context)
.popAndPushNamed('/router/bargain_details');
},
child: Container(
alignment: Alignment.center,
width: 120.w,
height: 40.h,
margin: EdgeInsets.only(left: 6.w),
decoration: BoxDecoration(
color: Color(0xFF32A060),
borderRadius: BorderRadius.circular(16),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
),
],
),
child: Column(
children: [
Text.rich(
TextSpan( TextSpan(
text: "", children: [
style: TextStyle( TextSpan(
fontSize: 7.sp, text: "",
fontWeight: MyFontWeight.medium, style: TextStyle(
color: Color(0xFF32A060), fontSize: 7.sp,
), fontWeight: MyFontWeight.medium,
color: Colors.white,
),
),
TextSpan(
text: "284.00",
style: TextStyle(
fontSize: 10.sp,
fontWeight: MyFontWeight.medium,
color: Colors.white,
),
),
],
), ),
TextSpan( ),
text: "284.00", Expanded(
child: Text(
"我要砍价",
style: TextStyle( style: TextStyle(
fontSize: 10.sp, fontSize: 12.sp,
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,
color: Color(0xFF32A060), color: Colors.white,
), ),
), ),
], ),
), ],
), ),
Expanded(child: )),
Text( ),
"原价购买", ],
style: TextStyle( ),
fontSize: 12.sp,
fontWeight: MyFontWeight.medium, ///
color: Color(0xFF32A060), if (widget.buttonType == 3)
), Row(
)), children: [
], Expanded(
), child: GestureDetector(
), onTap: () {
),), Navigator.of(context)
Expanded(child:GestureDetector( .popAndPushNamed('/router/group_details');
onTap: (){
Navigator.of(context).popAndPushNamed('/router/bargain_details');
}, },
child: Container( child: Container(
alignment: Alignment.center, alignment: Alignment.center,
@ -492,16 +463,12 @@ class _ProductSku extends State<ProductSku> {
height: 40.h, height: 40.h,
margin: EdgeInsets.only(left: 6.w), margin: EdgeInsets.only(left: 6.w),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Color(0xFF32A060),
borderRadius: BorderRadius.circular(16), borderRadius: BorderRadius.circular(16),
boxShadow: [ border: Border.all(
BoxShadow( width: 1,
color: Colors.black.withAlpha(12), color: Color(0xFF32A060),
offset: Offset(0, 3), style: BorderStyle.solid,
blurRadius: 14, ),
spreadRadius: 0,
),
],
), ),
child: Column( child: Column(
children: [ children: [
@ -513,7 +480,7 @@ class _ProductSku extends State<ProductSku> {
style: TextStyle( style: TextStyle(
fontSize: 7.sp, fontSize: 7.sp,
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,
color: Colors.white, color: Color(0xFF32A060),
), ),
), ),
TextSpan( TextSpan(
@ -521,87 +488,99 @@ class _ProductSku extends State<ProductSku> {
style: TextStyle( style: TextStyle(
fontSize: 10.sp, fontSize: 10.sp,
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,
color: Colors.white, color: Color(0xFF32A060),
), ),
), ),
], ],
), ),
), ),
Expanded(child: Expanded(
Text( child: Text(
"我要秒杀", "原价购买",
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,
color: Colors.white, color: Color(0xFF32A060),
), ),
),), )),
], ],
), ),
)),),
],
),
///
if(widget.buttonType == 4)
Row(
children: [
Expanded(child: GestureDetector(
onTap: (){
Navigator.of(context).popAndPushNamed('/router/group_details');
},
child: Container(
alignment: Alignment.center,
width: 120.w,
height:40.h,
margin: EdgeInsets.only(left: 6.w),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(16),
border: Border.all(
width: 1,
color: Color(0xFF32A060),
style: BorderStyle.solid,
), ),
), ),
child: Column( ),
children: [ Expanded(
Text.rich( child: GestureDetector(
TextSpan( onTap: () {
Navigator.of(context)
.popAndPushNamed('/router/bargain_details');
},
child: Container(
alignment: Alignment.center,
width: 120.w,
height: 40.h,
margin: EdgeInsets.only(left: 6.w),
decoration: BoxDecoration(
color: Color(0xFF32A060),
borderRadius: BorderRadius.circular(16),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
),
],
),
child: Column(
children: [ children: [
TextSpan( Text.rich(
text: "", TextSpan(
style: TextStyle( children: [
fontSize: 7.sp, TextSpan(
fontWeight: MyFontWeight.medium, text: "",
color: Color(0xFF32A060), style: TextStyle(
fontSize: 7.sp,
fontWeight: MyFontWeight.medium,
color: Colors.white,
),
),
TextSpan(
text: "284.00",
style: TextStyle(
fontSize: 10.sp,
fontWeight: MyFontWeight.medium,
color: Colors.white,
),
),
],
), ),
), ),
TextSpan( Expanded(
text: "284.00", child: Text(
style: TextStyle( "我要秒杀",
fontSize: 10.sp, style: TextStyle(
fontWeight: MyFontWeight.medium, fontSize: 12.sp,
color: Color(0xFF32A060), fontWeight: MyFontWeight.medium,
color: Colors.white,
),
), ),
), ),
], ],
), ),
),
Expanded(child:
Text(
"单人购买",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF32A060),
),
)), )),
],
),
), ),
)), ],
Expanded(child:GestureDetector( ),
onTap: (){
Navigator.of(context).popAndPushNamed('/router/bargain_details'); ///
if (widget.buttonType == 4)
Row(
children: [
Expanded(
child: GestureDetector(
onTap: () {
Navigator.of(context)
.popAndPushNamed('/router/group_details');
}, },
child: Container( child: Container(
alignment: Alignment.center, alignment: Alignment.center,
@ -609,16 +588,12 @@ class _ProductSku extends State<ProductSku> {
height: 40.h, height: 40.h,
margin: EdgeInsets.only(left: 6.w), margin: EdgeInsets.only(left: 6.w),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Color(0xFF32A060),
borderRadius: BorderRadius.circular(16), borderRadius: BorderRadius.circular(16),
boxShadow: [ border: Border.all(
BoxShadow( width: 1,
color: Colors.black.withAlpha(12), color: Color(0xFF32A060),
offset: Offset(0, 3), style: BorderStyle.solid,
blurRadius: 14, ),
spreadRadius: 0,
),
],
), ),
child: Column( child: Column(
children: [ children: [
@ -630,7 +605,7 @@ class _ProductSku extends State<ProductSku> {
style: TextStyle( style: TextStyle(
fontSize: 7.sp, fontSize: 7.sp,
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,
color: Colors.white, color: Color(0xFF32A060),
), ),
), ),
TextSpan( TextSpan(
@ -638,26 +613,88 @@ class _ProductSku extends State<ProductSku> {
style: TextStyle( style: TextStyle(
fontSize: 10.sp, fontSize: 10.sp,
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,
color: Colors.white, color: Color(0xFF32A060),
), ),
), ),
], ],
), ),
), ),
Expanded(child: Expanded(
Text( child: Text(
"我要开团", "单人购买",
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,
color: Colors.white, color: Color(0xFF32A060),
), ),
),), )),
], ],
), ),
)),), ),
], )),
), Expanded(
child: GestureDetector(
onTap: () {
Navigator.of(context)
.popAndPushNamed('/router/bargain_details');
},
child: Container(
alignment: Alignment.center,
width: 120.w,
height: 40.h,
margin: EdgeInsets.only(left: 6.w),
decoration: BoxDecoration(
color: Color(0xFF32A060),
borderRadius: BorderRadius.circular(16),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
),
],
),
child: Column(
children: [
Text.rich(
TextSpan(
children: [
TextSpan(
text: "",
style: TextStyle(
fontSize: 7.sp,
fontWeight: MyFontWeight.medium,
color: Colors.white,
),
),
TextSpan(
text: "284.00",
style: TextStyle(
fontSize: 10.sp,
fontWeight: MyFontWeight.medium,
color: Colors.white,
),
),
],
),
),
Expanded(
child: Text(
"我要开团",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
color: Colors.white,
),
),
),
],
),
)),
),
],
),
SizedBox( SizedBox(
height: 21.h, height: 21.h,
), ),
@ -669,7 +706,8 @@ class _ProductSku extends State<ProductSku> {
} }
Widget attrItem(Function fc, AttrListBean attrListBean, position) { Widget attrItem(Function fc, AttrListBean attrListBean, position) {
if (attrListBean.attrValueList != null && attrListBean.attrValueList.length > 0) if (attrListBean.attrValueList != null &&
attrListBean.attrValueList.length > 0)
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -684,7 +722,7 @@ class _ProductSku extends State<ProductSku> {
), ),
), ),
), ),
sweetnessStore(fc,attrListBean.attrValueList, position), sweetnessStore(fc, attrListBean.attrValueList, position),
// sweetnessStore(fc, attrListBean.attrValueList, position), // sweetnessStore(fc, attrListBean.attrValueList, position),
], ],
); );
@ -723,16 +761,17 @@ class _ProductSku extends State<ProductSku> {
// ); // );
// } // }
Widget sweetnessStore(Function fc,List<AttrValueListBean> arrays, position){ Widget sweetnessStore(Function fc, List<AttrValueListBean> arrays, position) {
return Wrap( return Wrap(
runSpacing: 10.0, runSpacing: 10.0,
spacing: 10.0, spacing: 10.0,
children: arrays.take(arrays.length).map<Widget>((AttrValueListBean tag) { children:
arrays.take(arrays.length).map<Widget>((AttrValueListBean tag) {
return GestureDetector( return GestureDetector(
onTap: () { onTap: () {
fc(tag.attrValue); fc(tag.attrValue);
}, },
child:sweetnessItem( child: sweetnessItem(
tag.attrValue, tag.attrValue,
(tag.attrValue == selectSkus[position]) ?? false, (tag.attrValue == selectSkus[position]) ?? false,
)); ));
@ -741,27 +780,26 @@ class _ProductSku extends State<ProductSku> {
Widget sweetnessItem(String name, bool isCheck) { Widget sweetnessItem(String name, bool isCheck) {
return Container( return Container(
padding: const EdgeInsets.symmetric(vertical:5.0,horizontal: 12.0), padding: const EdgeInsets.symmetric(vertical: 5.0, horizontal: 12.0),
decoration: BoxDecoration( decoration: BoxDecoration(
color: !isCheck ? Color(0xFFF2F2F2) : Color(0xFFF0FAF4), color: !isCheck ? Color(0xFFF2F2F2) : Color(0xFFF0FAF4),
border: Border.all( border: Border.all(
width: !isCheck ? 0:1, width: !isCheck ? 0 : 1,
color: !isCheck ? Color(0xFFF2F2F2):Color(0xFF32A060), color: !isCheck ? Color(0xFFF2F2F2) : Color(0xFF32A060),
style: BorderStyle.solid, style: BorderStyle.solid,
), ),
borderRadius: const BorderRadius.all( borderRadius: const BorderRadius.all(
Radius.circular(4.0), Radius.circular(4.0),
), ),
),
child: Text(
name,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color:!isCheck ? Color(0xFF4D4D4D) : Color(0xFF32A060),
fontSize: 14.sp,
fontWeight: MyFontWeight.regular,
), ),
)); child: Text(
name,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: !isCheck ? Color(0xFF4D4D4D) : Color(0xFF32A060),
fontSize: 14.sp,
fontWeight: MyFontWeight.regular,
),
));
} }
} }

148
lib/store/store_view/shop_goods.dart

@ -94,10 +94,10 @@ class _ShopGoods extends State<ShopGoods> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
color: Colors.white, color: Colors.white,
padding: EdgeInsets.only( // padding: EdgeInsets.only(
right: 16.w, // right: 16.w,
// bottom: 20.h, // // bottom: 20.h,
), // ),
height: 123.h, height: 123.h,
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -125,7 +125,8 @@ class _ShopGoods extends State<ShopGoods> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Row( Padding(padding: EdgeInsets.only(right: 16.w),
child: Row(
children: [ children: [
Expanded( Expanded(
child: Text( child: Text(
@ -156,11 +157,12 @@ class _ShopGoods extends State<ShopGoods> {
// ), // ),
// ), // ),
], ],
), ),),
SizedBox( SizedBox(
height: 2.h, height: 2.h,
), ),
Row( Padding(padding: EdgeInsets.only(right: 16.w),
child: Row(
children: [ children: [
Expanded( Expanded(
child: Text( child: Text(
@ -180,11 +182,12 @@ class _ShopGoods extends State<ShopGoods> {
width: 10, width: 10,
), ),
], ],
), )),
SizedBox( SizedBox(
height: 7.h, height: 7.h,
), ),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Row( Row(
children: [ children: [
@ -219,35 +222,38 @@ class _ShopGoods extends State<ShopGoods> {
// ), // ),
], ],
), ),
Spacer(),
if (!widget.isShopCart && if (!widget.isShopCart &&
(widget.productListBean?.attrStyle ?? 0) == 1) (widget.productListBean?.attrStyle ?? 0) == 1)
Stack( GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () async{
if(widget.storeInfo.posType.code == "NORMALSTORE"&& widget.tableId == 0){
showDeleteDialog();
}else{
widget.queryMiNiDetail(
widget.productListBean != null
? widget.productListBean.id
: widget.shoppingCartSkuItemListBean
.productId,
0);
}
},
child:Container(
padding: EdgeInsets.only(right: 16.w),
child: Stack(
children: [ children: [
Container( Container(
margin: EdgeInsets.only(right: 8, top: 4), padding: EdgeInsets.only(left:35.w,top: 4.h,bottom: 4.h,),
child: RoundButton( margin: EdgeInsets.only(right: 8, top: 4),
// width: 49.w, child: RoundButton(
text: S.of(context).xuanguige, text: S.of(context).xuanguige,
textColor: Colors.white, textColor: Colors.white,
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,
radius: 3, radius: 3,
backgroup: Color(0xFF32A060), backgroup: Color(0xFF32A060),
fontSize: 11.sp, fontSize: 11.sp,
padding: EdgeInsets.symmetric(vertical: 5.h,horizontal: 3.w), padding: EdgeInsets.symmetric(vertical: 5.h,horizontal: 3.w),
callback: () { ),
if(widget.storeInfo.posType.code == "NORMALSTORE"&& widget.tableId == 0){
showDeleteDialog();
}else{
widget.queryMiNiDetail(
widget.productListBean != null
? widget.productListBean.id
: widget.shoppingCartSkuItemListBean
.productId,
0);
}
},
),
), ),
Positioned( Positioned(
right: 0, right: 0,
@ -266,26 +272,32 @@ class _ShopGoods extends State<ShopGoods> {
), ),
), ),
], ],
), ),)),
if (widget.isShopCart || if (widget.isShopCart ||
(widget.productListBean?.attrStyle ?? 0) == 0) (widget.productListBean?.attrStyle ?? 0) == 0)
InkWell( Spacer(),
onTap: () { if (widget.isShopCart ||
if(widget.storeInfo.posType.code == "NORMALSTORE" && widget.tableId == 0){ (widget.productListBean?.attrStyle ?? 0) == 0)
showDeleteDialog(); GestureDetector(
}else{ behavior: HitTestBehavior.opaque,
widget.reduce(widget.shoppingCartSkuItemListBean);} onTap: () async{
}, if(widget.storeInfo.posType.code == "NORMALSTORE" && widget.tableId == 0){
child: Image.asset( showDeleteDialog();
"assets/image/reduce.webp", }else{
width: 22, widget.reduce(widget.shoppingCartSkuItemListBean);}
height: 22.h, },
child: Container(
padding: EdgeInsets.only(left: 15.w,right: 6.w),
child: Image.asset(
"assets/image/reduce.webp",
width: 22,
height: 22.h,
),
), ),
), ),
if (widget.isShopCart || if (widget.isShopCart ||
(widget.productListBean?.attrStyle ?? 0) == 0) (widget.productListBean?.attrStyle ?? 0) == 0)
Container( Container(
width: 30,
alignment: Alignment.center, alignment: Alignment.center,
child: Text( child: Text(
"${widget.count}", "${widget.count}",
@ -298,31 +310,35 @@ class _ShopGoods extends State<ShopGoods> {
), ),
if (widget.isShopCart || if (widget.isShopCart ||
(widget.productListBean?.attrStyle ?? 0) == 0) (widget.productListBean?.attrStyle ?? 0) == 0)
GestureDetector( GestureDetector(
onTap: () async{ behavior: HitTestBehavior.opaque,
if(widget.storeInfo.posType.code == "NORMALSTORE" && widget.tableId == 0){ onTap: () async{
showDeleteDialog(); if(widget.storeInfo.posType.code == "NORMALSTORE" && widget.tableId == 0){
}else{ showDeleteDialog();
if(_jumpType == -1) }else{
queryMiNiDetail(widget.productListBean.id); if(_jumpType == -1)
else if(_jumpType == 0) queryMiNiDetail(widget.productListBean.id);
widget.add(widget.shoppingCartSkuItemListBean); else if(_jumpType == 0)
else if(_jumpType == 1) widget.add(widget.shoppingCartSkuItemListBean);
await Navigator.of(context) else if(_jumpType == 1)
.pushNamed('/router/product_meals_sku', arguments: { await Navigator.of(context)
"id":widget.productListBean.id, .pushNamed('/router/product_meals_sku', arguments: {
"storeId":widget.productListBean.storeId, "id":widget.productListBean.id,
"tableId":widget.tableId "storeId":widget.productListBean.storeId,
}); "tableId":widget.tableId
widget.queryShoppingCart(); });
widget.queryShoppingCart();
} }
}, },
child: Image.asset( child: Container(
padding: EdgeInsets.only(left: 6.w,right:16.w),
child: Image.asset(
"assets/image/add.webp", "assets/image/add.webp",
width: 22, width: 22,
height: 22.h, height: 22.h,
), ),
), ),
),
], ],
), ),
SizedBox( SizedBox(

3
lib/union/union_list.dart

@ -87,7 +87,8 @@ class _UnionList extends State<UnionList> {
arguments: { arguments: {
"id": widget.storeList[position].id, "id": widget.storeList[position].id,
"tenant": widget.storeList[position].tenantCode, "tenant": widget.storeList[position].tenantCode,
"storeName": widget.storeList[position].storeName "storeName": widget.storeList[position].storeName,
"distance":widget.storeList[position].distance
}, },
); );
} }

2
lib/union/union_page.dart

@ -257,6 +257,8 @@ class UnionPageState extends State<UnionPage>
? "DRINKSTORE" ? "DRINKSTORE"
: "HAPPYSTORE")), : "HAPPYSTORE")),
}).catchError((error) { }).catchError((error) {
SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type),
alignment: Alignment.center);
if (index == -1) tabRefresh().refreshFailed(); if (index == -1) tabRefresh().refreshFailed();
}); });
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {

4
lib/view_widget/activity_coupons.dart

@ -11,6 +11,8 @@ import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/utils/font_weight.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import '../generated/l10n.dart';
class ActivityCoupons extends StatefulWidget { class ActivityCoupons extends StatefulWidget {
final String result; final String result;
@ -196,7 +198,7 @@ class _ActivityCoupons extends State<ActivityCoupons> {
), ),
if (listData["type"] == 3) if (listData["type"] == 3)
Text( Text(
"兑换券", S.of(context).duihuanquan,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
maxLines: 2, maxLines: 2,
style: TextStyle( style: TextStyle(

6
lib/view_widget/activity_poster.dart

@ -22,7 +22,9 @@ class ActivityPoster extends StatefulWidget {
class _ActivityPoster extends State<ActivityPoster> { class _ActivityPoster extends State<ActivityPoster> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return WillPopScope(
onWillPop: () async => false,
child:Container(
width: double.infinity, width: double.infinity,
alignment: Alignment.center, alignment: Alignment.center,
margin: EdgeInsets.only( margin: EdgeInsets.only(
@ -69,7 +71,7 @@ class _ActivityPoster extends State<ActivityPoster> {
) ) ) )
], ],
), ),
); ));
} }
/// contentType 0123,4:,5: /// contentType 0123,4:,5:

2
lib/view_widget/coupon_details_dialog.dart

@ -49,7 +49,7 @@ class _CouponDetailsWidget extends State<CouponDetailsWidget> {
alignment: Alignment.center, alignment: Alignment.center,
margin: EdgeInsets.symmetric(vertical: 12), margin: EdgeInsets.symmetric(vertical: 12),
child: Text( child: Text(
"使用详情", S.of(context).shiyongxiangqing,
style: TextStyle( style: TextStyle(
fontWeight: MyFontWeight.bold, fontWeight: MyFontWeight.bold,
fontSize: 15.sp, fontSize: 15.sp,

2
lib/view_widget/cupertino_date_picker.dart

@ -33,7 +33,7 @@ class CupertinoDatePickerWidget extends StatelessWidget {
}, },
child: Container( child: Container(
child: Text( child: Text(
"取消", S.of(context).quxiao,
style: TextStyle( style: TextStyle(
fontSize: 16, fontSize: 16,
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,

244
lib/view_widget/mine_vip_entry.dart

@ -32,6 +32,9 @@ class MineVipEntry extends StatelessWidget {
String topLeft = ""; String topLeft = "";
String levelText = "普通用户"; String levelText = "普通用户";
Color logoColor = Color(0xFFCACACA);
Color levelTextColor = Color(0xFFCACACA);
Color levelTextBackdrop = Color(0xFFFFF8EC);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -54,109 +57,188 @@ class MineVipEntry extends StatelessWidget {
case 1: case 1:
{ {
levelText = "${S.of(context).yinkahuiyuan}"; levelText = "${S.of(context).yinkahuiyuan}";
logoColor = Color(0xFFA0C4E7);
levelTextColor = Color(0xFF61ABF3);
levelTextBackdrop = Color(0xFFC1DBF4);
break; break;
} }
case 2: case 2:
{ {
levelText = "${S.of(context).jinkahuiyuan}"; levelText = "${S.of(context).jinkahuiyuan}";
logoColor = Color(0xFFFBB43A);
levelTextColor = Color(0xFFFBB43A);
levelTextBackdrop = Color(0xFFFFECD2);
break; break;
} }
case 3: case 3:
{ {
levelText = "${S.of(context).gongchuanghuiyuan}"; levelText = "${S.of(context).gongchuanghuiyuan}";
logoColor = Color(0xFF352822);
levelTextColor = Color(0xFF92755D);
levelTextBackdrop = Color(0xFFFFECD2);
break; break;
} }
} }
Widget widget = Container( Widget widget = Container(
width: double.infinity, height:20.h,
padding: EdgeInsets.only(top: 12.h, bottom: 22.h, left: 12.w, right: 12.w), width: double.infinity,
margin: EdgeInsets.only(top: 23.h,left: 13.5.w,right: 13.5.w,bottom:15.h), child: Row(
decoration: BoxDecoration( children: [
color: Color(0xFF3D3D5D), Container(
borderRadius: BorderRadius.circular(6), height: double.infinity,
boxShadow: [ padding: EdgeInsets.symmetric(horizontal:3.w,vertical:4.h),
BoxShadow( decoration: BoxDecoration(
color: Colors.black.withAlpha(12), color: logoColor,
offset: Offset(0, 3), borderRadius: BorderRadius.only(
blurRadius: 14, topLeft: Radius.circular(4),
spreadRadius: 0, bottomLeft: Radius.circular(4),),
) boxShadow: [
], BoxShadow(
), color: Color(0x08213303).withAlpha(12),
child: Column( offset: Offset(0, 2),
mainAxisAlignment: MainAxisAlignment.start, blurRadius: 4,
crossAxisAlignment: CrossAxisAlignment.start, spreadRadius: 0,
children: [
Row(
children: [
Image.asset(
"assets/image/vip_logo.webp",
width: 24,
height: 24,
),
SizedBox(
width: 5.w,
), ),
Expanded(
child: Text(
levelText,
style: TextStyle(
fontSize: 16.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFFFFEAD2)),
)),
Container(
padding: EdgeInsets.fromLTRB(9.w, 4.h, 8.w, 4.h),
decoration: BoxDecoration(
color: Color(0xFFFFECD2),
borderRadius: BorderRadius.circular(10),
),
child: Text(
S.of(context).chakanquanyi,
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF92755D),
),
),
)
], ],
), ),
SizedBox( child: Image.asset(
height: 16.h, "assets/image/mine_vip_logo.webp",
fit: BoxFit.cover,
// width: 13.w,
// height: 11.h,
), ),
Container( ),
height: 4.h, Container(
child: ClipRRect( height: double.infinity,
borderRadius: BorderRadius.circular(6.5), padding: EdgeInsets.symmetric(horizontal:3.w,vertical:3.h),
child: LinearProgressIndicator( decoration: BoxDecoration(
value: rankMax > (rank ?? 0) color: levelTextBackdrop,
? ((vipLevel < curLevel) borderRadius: BorderRadius.only(
? rankMax / rankMax topRight: Radius.circular(4),
: (rank ?? 0) / rankMax) bottomRight: Radius.circular(4),),
: 0, boxShadow: [
backgroundColor: Color(0xFF222233), BoxShadow(
color: Color(0xFFFFECD2), color: Color(0x08213303).withAlpha(12),
offset: Offset(0, 2),
blurRadius: 4,
spreadRadius: 0,
), ),
), ],
), ),
SizedBox( child:Row(
height: 8.h, children: [
Text(
levelText,
textAlign: TextAlign.center,
style: TextStyle(
color: levelTextColor,
fontSize: 10.sp,
fontWeight: MyFontWeight.regular,
),
),
Image.asset(
"assets/image/icon_right.webp",
fit: BoxFit.cover,
width: 8,
height: 8,
color: levelTextColor,
),
],
), ),
Text( )
rank > rankMax ],
? S.of(context).dangqiandengji ),
: "消费金额¥${rank.toStringAsFixed(2).toString()}${S.of(context).xiayidengji}还需¥${(rankMax - (rank ?? 0)).toStringAsFixed(2)}", );
style: TextStyle( // Container(
color: Color(0xFFFFEAD2), // width: double.infinity,
fontWeight: MyFontWeight.light, // padding: EdgeInsets.only(top: 12.h, bottom: 22.h, left: 12.w, right: 12.w),
fontFamily: 'JDZhengHT', // margin: EdgeInsets.only(top: 23.h,left: 13.5.w,right: 13.5.w,bottom:15.h),
fontSize: 14.sp, // decoration: BoxDecoration(
), // color: Color(0xFF3D3D5D),
) // borderRadius: BorderRadius.circular(6),
], // boxShadow: [
)); // BoxShadow(
// color: Colors.black.withAlpha(12),
// offset: Offset(0, 3),
// blurRadius: 14,
// spreadRadius: 0,
// )
// ],
// ),
// child: Column(
// mainAxisAlignment: MainAxisAlignment.start,
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Row(
// children: [
// Image.asset(
// "assets/image/vip_logo.webp",
// width: 24,
// height: 24,
// ),
// SizedBox(
// width: 5.w,
// ),
// Expanded(
// child: Text(
// levelText,
// style: TextStyle(
// fontSize: 16.sp,
// fontWeight: MyFontWeight.semi_bold,
// color: Color(0xFFFFEAD2)),
// )),
// Container(
// padding: EdgeInsets.fromLTRB(9.w, 4.h, 8.w, 4.h),
// decoration: BoxDecoration(
// color: Color(0xFFFFECD2),
// borderRadius: BorderRadius.circular(10),
// ),
// child: Text(
// S.of(context).chakanquanyi,
// style: TextStyle(
// fontSize: 12.sp,
// fontWeight: MyFontWeight.semi_bold,
// color: Color(0xFF92755D),
// ),
// ),
// )
// ],
// ),
// SizedBox(
// height: 16.h,
// ),
// Container(
// height: 4.h,
// child: ClipRRect(
// borderRadius: BorderRadius.circular(6.5),
// child: LinearProgressIndicator(
// value: rankMax > (rank ?? 0)
// ? ((vipLevel < curLevel)
// ? rankMax / rankMax
// : (rank ?? 0) / rankMax)
// : 0,
// backgroundColor: Color(0xFF222233),
// color: Color(0xFFFFECD2),
// ),
// ),
// ),
// SizedBox(
// height: 8.h,
// ),
// Text(
// rank > rankMax
// ? S.of(context).dangqiandengji
// : "消费金额¥${rank.toStringAsFixed(2).toString()}${S.of(context).xiayidengji}还需¥${(rankMax - (rank ?? 0)).toStringAsFixed(2)}",
// style: TextStyle(
// color: Color(0xFFFFEAD2),
// fontWeight: MyFontWeight.light,
// fontFamily: 'JDZhengHT',
// fontSize: 14.sp,
// ),
// )
// ],
// ));
return GestureDetector( return GestureDetector(
onTap: () { onTap: () {

4
lib/view_widget/my_appbar.dart

@ -16,6 +16,7 @@ class MyAppBar extends StatelessWidget implements PreferredSizeWidget {
final Size preferredSize; final Size preferredSize;
final double toolbarHeight; final double toolbarHeight;
final bool leading; final bool leading;
final bool centerTitle;
final Brightness brightness; final Brightness brightness;
final Function exit; final Function exit;
@ -34,6 +35,7 @@ class MyAppBar extends StatelessWidget implements PreferredSizeWidget {
this.titleSize = 18, this.titleSize = 18,
this.brightness = Brightness.light, this.brightness = Brightness.light,
this.leading = true, this.leading = true,
this.centerTitle = false,
this.exit this.exit
}) : preferredSize = Size.fromHeight(toolbarHeight ?? kToolbarHeight), }) : preferredSize = Size.fromHeight(toolbarHeight ?? kToolbarHeight),
super(key: key) { super(key: key) {
@ -79,7 +81,7 @@ class MyAppBar extends StatelessWidget implements PreferredSizeWidget {
) )
: Container(), : Container(),
titleSpacing: 2, titleSpacing: 2,
centerTitle: false, centerTitle: centerTitle,
leadingWidth: leading ? 56 : 10.w, leadingWidth: leading ? 56 : 10.w,
title: ((title == null || title == "") && titleChild != null) title: ((title == null || title == "") && titleChild != null)
? titleChild ? titleChild

4
lib/view_widget/new_coupon_widget.dart

@ -156,7 +156,7 @@ class NewCouponWidget extends StatelessWidget {
child: Row( child: Row(
children: [ children: [
Text( Text(
"使用详情", S.of(context).shiyongxiangqing,
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
@ -639,7 +639,7 @@ class NewCouponWidget extends StatelessWidget {
), ),
alignment: Alignment.center, alignment: Alignment.center,
child:Text( child:Text(
"立即使用", S.of(context).lijishiyong,
maxLines: 1, maxLines: 1,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(

4
lib/view_widget/pay_selected_dialog.dart

@ -52,7 +52,7 @@ class _PaySelectedDialog extends State<PaySelectedDialog> {
child: Align( child: Align(
alignment: Alignment.center, alignment: Alignment.center,
child: Text( child: Text(
"请输入支付密码", S.of(context).qingshuruzhifumima,
style: TextStyle( style: TextStyle(
fontWeight: MyFontWeight.bold, fontWeight: MyFontWeight.bold,
fontSize: 15.sp, fontSize: 15.sp,
@ -94,7 +94,7 @@ class _PaySelectedDialog extends State<PaySelectedDialog> {
GestureDetector( GestureDetector(
onTap: (){}, onTap: (){},
child: Text( child: Text(
"忘记密码", "${S.of(context).wangjimima}",
style: TextStyle( style: TextStyle(
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,
fontSize: 12.sp, fontSize: 12.sp,

2
lib/view_widget/receiving_method_dialog.dart

@ -52,7 +52,7 @@ class _ReceivingMethodDialog extends State<ReceivingMethodDialog> {
child: Column( child: Column(
children: [ children: [
Text( Text(
"请选择商品的领取方式", S.of(context).xuanzeshangpinlingqufangshi,
style: TextStyle( style: TextStyle(
fontSize: 14.sp, fontSize: 14.sp,
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,

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

Loading…
Cancel
Save