diff --git a/assets/image/2x/icon_mine_promotion_code.png b/assets/image/2x/icon_mine_promotion_code.png new file mode 100644 index 00000000..b6f43839 Binary files /dev/null and b/assets/image/2x/icon_mine_promotion_code.png differ diff --git a/assets/image/2x/icon_sign_success.png b/assets/image/2x/icon_sign_success.png index c0100e30..176b7014 100644 Binary files a/assets/image/2x/icon_sign_success.png and b/assets/image/2x/icon_sign_success.png differ diff --git a/assets/image/3x/icon_mine_promotion_code.png b/assets/image/3x/icon_mine_promotion_code.png new file mode 100644 index 00000000..10dfa2e1 Binary files /dev/null and b/assets/image/3x/icon_mine_promotion_code.png differ diff --git a/assets/image/3x/icon_sign_success.png b/assets/image/3x/icon_sign_success.png index 63e23946..e9275beb 100644 Binary files a/assets/image/3x/icon_sign_success.png and b/assets/image/3x/icon_sign_success.png differ diff --git a/assets/image/icon_mine_promotion_code.png b/assets/image/icon_mine_promotion_code.png new file mode 100644 index 00000000..8915a509 Binary files /dev/null and b/assets/image/icon_mine_promotion_code.png differ diff --git a/lib/generated/intl/messages_en.dart b/lib/generated/intl/messages_en.dart index 4cc02bd2..af2cf5d6 100644 --- a/lib/generated/intl/messages_en.dart +++ b/lib/generated/intl/messages_en.dart @@ -461,6 +461,7 @@ class MessageLookup extends MessageLookupByLibrary { "tongzhitishixinxi" : MessageLookupByLibrary.simpleMessage("为了您可以及时收到我们的活动信息,推荐您在使用HISAPP时打开通知的接收"), "touxiang" : MessageLookupByLibrary.simpleMessage("头像"), "tuichudenglu" : MessageLookupByLibrary.simpleMessage("退出登录"), + "tuiguangma" : MessageLookupByLibrary.simpleMessage("推广码"), "tuikuan" : MessageLookupByLibrary.simpleMessage("退款"), "waimai" : MessageLookupByLibrary.simpleMessage("外卖"), "waimaipeisong" : MessageLookupByLibrary.simpleMessage("外卖配送"), @@ -486,6 +487,7 @@ class MessageLookup extends MessageLookupByLibrary { "wenzhang" : MessageLookupByLibrary.simpleMessage("文章"), "wenzhangxiangqing" : MessageLookupByLibrary.simpleMessage("文章详情"), "weulingqu" : MessageLookupByLibrary.simpleMessage("未领取"), + "wodegongju" : MessageLookupByLibrary.simpleMessage("我的工具"), "wodehuiyuandengji" : MessageLookupByLibrary.simpleMessage("我的会员等级"), "wodejifenzhi" : MessageLookupByLibrary.simpleMessage("我的积分值"), "wodekaquan" : MessageLookupByLibrary.simpleMessage("我的卡券"), diff --git a/lib/generated/intl/messages_zh_CN.dart b/lib/generated/intl/messages_zh_CN.dart index cd48417d..19f9c5c8 100644 --- a/lib/generated/intl/messages_zh_CN.dart +++ b/lib/generated/intl/messages_zh_CN.dart @@ -460,6 +460,7 @@ class MessageLookup extends MessageLookupByLibrary { "tongzhitishixinxi" : MessageLookupByLibrary.simpleMessage("为了您可以及时收到我们的活动信息,推荐您在使用HISAPP时打开通知的接收"), "touxiang" : MessageLookupByLibrary.simpleMessage("头像"), "tuichudenglu" : MessageLookupByLibrary.simpleMessage("退出登录"), + "tuiguangma" : MessageLookupByLibrary.simpleMessage("推广码"), "tuikuan" : MessageLookupByLibrary.simpleMessage("退款"), "waimai" : MessageLookupByLibrary.simpleMessage("外卖"), "waimaipeisong" : MessageLookupByLibrary.simpleMessage("外卖配送"), @@ -485,6 +486,7 @@ class MessageLookup extends MessageLookupByLibrary { "wenzhang" : MessageLookupByLibrary.simpleMessage("文章"), "wenzhangxiangqing" : MessageLookupByLibrary.simpleMessage("文章详情"), "weulingqu" : MessageLookupByLibrary.simpleMessage("未领取"), + "wodegongju" : MessageLookupByLibrary.simpleMessage("我的工具"), "wodehuiyuandengji" : MessageLookupByLibrary.simpleMessage("我的会员等级"), "wodejifenzhi" : MessageLookupByLibrary.simpleMessage("我的积分值"), "wodekaquan" : MessageLookupByLibrary.simpleMessage("我的卡券"), diff --git a/lib/generated/intl/messages_zh_Hans_CN.dart b/lib/generated/intl/messages_zh_Hans_CN.dart index 95117124..d48518c8 100644 --- a/lib/generated/intl/messages_zh_Hans_CN.dart +++ b/lib/generated/intl/messages_zh_Hans_CN.dart @@ -460,6 +460,7 @@ class MessageLookup extends MessageLookupByLibrary { "tongzhitishixinxi" : MessageLookupByLibrary.simpleMessage("为了您可以及时收到我们的活动信息,推荐您在使用HISAPP时打开通知的接收"), "touxiang" : MessageLookupByLibrary.simpleMessage("头像"), "tuichudenglu" : MessageLookupByLibrary.simpleMessage("退出登录"), + "tuiguangma" : MessageLookupByLibrary.simpleMessage("推广码"), "tuikuan" : MessageLookupByLibrary.simpleMessage("退款"), "waimai" : MessageLookupByLibrary.simpleMessage("外卖"), "waimaipeisong" : MessageLookupByLibrary.simpleMessage("外卖配送"), @@ -485,6 +486,7 @@ class MessageLookup extends MessageLookupByLibrary { "wenzhang" : MessageLookupByLibrary.simpleMessage("文章"), "wenzhangxiangqing" : MessageLookupByLibrary.simpleMessage("文章详情"), "weulingqu" : MessageLookupByLibrary.simpleMessage("未领取"), + "wodegongju" : MessageLookupByLibrary.simpleMessage("我的工具"), "wodehuiyuandengji" : MessageLookupByLibrary.simpleMessage("我的会员等级"), "wodejifenzhi" : MessageLookupByLibrary.simpleMessage("我的积分值"), "wodekaquan" : MessageLookupByLibrary.simpleMessage("我的卡券"), diff --git a/lib/generated/intl/messages_zh_Hant_CN.dart b/lib/generated/intl/messages_zh_Hant_CN.dart index 8e218e41..9d6d4e99 100644 --- a/lib/generated/intl/messages_zh_Hant_CN.dart +++ b/lib/generated/intl/messages_zh_Hant_CN.dart @@ -460,6 +460,7 @@ class MessageLookup extends MessageLookupByLibrary { "tongzhitishixinxi" : MessageLookupByLibrary.simpleMessage("為了您可以及時收到我們的活動資訊,推薦您在使用HISAPP時打開通知的接收 "), "touxiang" : MessageLookupByLibrary.simpleMessage("頭像"), "tuichudenglu" : MessageLookupByLibrary.simpleMessage("退出登錄"), + "tuiguangma" : MessageLookupByLibrary.simpleMessage("推廣碼"), "tuikuan" : MessageLookupByLibrary.simpleMessage("退款"), "waimai" : MessageLookupByLibrary.simpleMessage("外賣"), "waimaipeisong" : MessageLookupByLibrary.simpleMessage("外賣配送"), @@ -485,6 +486,7 @@ class MessageLookup extends MessageLookupByLibrary { "wenzhang" : MessageLookupByLibrary.simpleMessage("文章"), "wenzhangxiangqing" : MessageLookupByLibrary.simpleMessage("文章詳情"), "weulingqu" : MessageLookupByLibrary.simpleMessage("未領取"), + "wodegongju" : MessageLookupByLibrary.simpleMessage("我的工具"), "wodehuiyuandengji" : MessageLookupByLibrary.simpleMessage("我的會員等級"), "wodejifenzhi" : MessageLookupByLibrary.simpleMessage("我的積分值"), "wodekaquan" : MessageLookupByLibrary.simpleMessage("我的卡券"), diff --git a/lib/generated/intl/messages_zh_TW.dart b/lib/generated/intl/messages_zh_TW.dart index 52485a17..c9502bd0 100644 --- a/lib/generated/intl/messages_zh_TW.dart +++ b/lib/generated/intl/messages_zh_TW.dart @@ -460,6 +460,7 @@ class MessageLookup extends MessageLookupByLibrary { "tongzhitishixinxi" : MessageLookupByLibrary.simpleMessage("為了您可以及時收到我們的活動資訊,推薦您在使用HISAPP時打開通知的接收 "), "touxiang" : MessageLookupByLibrary.simpleMessage("頭像"), "tuichudenglu" : MessageLookupByLibrary.simpleMessage("退出登錄"), + "tuiguangma" : MessageLookupByLibrary.simpleMessage("推廣碼"), "tuikuan" : MessageLookupByLibrary.simpleMessage("退款"), "waimai" : MessageLookupByLibrary.simpleMessage("外賣"), "waimaipeisong" : MessageLookupByLibrary.simpleMessage("外賣配送"), @@ -485,6 +486,7 @@ class MessageLookup extends MessageLookupByLibrary { "wenzhang" : MessageLookupByLibrary.simpleMessage("文章"), "wenzhangxiangqing" : MessageLookupByLibrary.simpleMessage("文章詳情"), "weulingqu" : MessageLookupByLibrary.simpleMessage("未領取"), + "wodegongju" : MessageLookupByLibrary.simpleMessage("我的工具"), "wodehuiyuandengji" : MessageLookupByLibrary.simpleMessage("我的會員等級"), "wodejifenzhi" : MessageLookupByLibrary.simpleMessage("我的積分值"), "wodekaquan" : MessageLookupByLibrary.simpleMessage("我的卡券"), diff --git a/lib/generated/l10n.dart b/lib/generated/l10n.dart index 59a0a299..32291b52 100644 --- a/lib/generated/l10n.dart +++ b/lib/generated/l10n.dart @@ -5065,6 +5065,26 @@ class S { ); } + /// `推广码` + String get tuiguangma { + return Intl.message( + '推广码', + name: 'tuiguangma', + desc: '', + args: [], + ); + } + + /// `我的工具` + String get wodegongju { + return Intl.message( + '我的工具', + name: 'wodegongju', + desc: '', + args: [], + ); + } + /// `并使用本机号码登录` String get privacy_policy4 { return Intl.message( diff --git a/lib/home/home_view/home_integral_store.dart b/lib/home/home_view/home_integral_store.dart index fc3ba1b2..1ed0bcfd 100644 --- a/lib/home/home_view/home_integral_store.dart +++ b/lib/home/home_view/home_integral_store.dart @@ -102,7 +102,7 @@ class _HomeIntegralStore extends State { Widget integralStore() { return GridView.builder( - itemCount: widget.gooods != null ? widget.gooods.length : 0, + itemCount: (widget.gooods != null && widget.gooods.length > 0) ? (widget.gooods.length > 2 ? 2 : widget.gooods.length) : 0, padding: EdgeInsets.all(13.w), shrinkWrap: true, physics: NeverScrollableScrollPhysics(), @@ -118,7 +118,7 @@ class _HomeIntegralStore extends State { ? (1 - ((AppUtils.textScale(context) - 1))) : 0.85, ), - itemBuilder: (contetx, index) { + itemBuilder: (context, index) { return GestureDetector( onTap: () { Navigator.of(context).pushNamed('/router/integral_store_page', diff --git a/lib/l10n/intl_en.arb b/lib/l10n/intl_en.arb index d270bbbf..8fe8422a 100644 --- a/lib/l10n/intl_en.arb +++ b/lib/l10n/intl_en.arb @@ -524,6 +524,8 @@ "waimaipeisong": "外卖配送", "kuaidiwuliu": "快递物流", "yuliudianhua": "预留电话", + "tuiguangma": "推广码", + "wodegongju": "我的工具", diff --git a/lib/l10n/intl_zh_CN.arb b/lib/l10n/intl_zh_CN.arb index ba61b092..b228e43c 100644 --- a/lib/l10n/intl_zh_CN.arb +++ b/lib/l10n/intl_zh_CN.arb @@ -526,6 +526,8 @@ "waimaipeisong": "外卖配送", "kuaidiwuliu": "快递物流", "yuliudianhua": "预留电话", + "tuiguangma": "推广码", + "wodegongju": "我的工具", diff --git a/lib/l10n/intl_zh_Hans_CN.arb b/lib/l10n/intl_zh_Hans_CN.arb index ba61b092..b228e43c 100644 --- a/lib/l10n/intl_zh_Hans_CN.arb +++ b/lib/l10n/intl_zh_Hans_CN.arb @@ -526,6 +526,8 @@ "waimaipeisong": "外卖配送", "kuaidiwuliu": "快递物流", "yuliudianhua": "预留电话", + "tuiguangma": "推广码", + "wodegongju": "我的工具", diff --git a/lib/l10n/intl_zh_Hant_CN.arb b/lib/l10n/intl_zh_Hant_CN.arb index 2b6d9c34..44b88d43 100644 --- a/lib/l10n/intl_zh_Hant_CN.arb +++ b/lib/l10n/intl_zh_Hant_CN.arb @@ -519,6 +519,8 @@ "waimaipeisong": "外賣配送", "kuaidiwuliu": "快遞物流", "yuliudianhua": "預留電話", + "tuiguangma": "推廣碼", + "wodegongju": "我的工具", diff --git a/lib/l10n/intl_zh_TW.arb b/lib/l10n/intl_zh_TW.arb index b14ae378..906fb2b5 100644 --- a/lib/l10n/intl_zh_TW.arb +++ b/lib/l10n/intl_zh_TW.arb @@ -518,6 +518,8 @@ "waimaipeisong": "外賣配送", "kuaidiwuliu": "快遞物流", "yuliudianhua": "預留電話", + "tuiguangma": "推廣碼", + "wodegongju": "我的工具", diff --git a/lib/main.dart b/lib/main.dart index 84db48ec..74b55996 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -52,6 +52,7 @@ import 'package:huixiang/setting/help_feedback_page.dart'; import 'package:huixiang/setting/permission_setting_page.dart'; import 'package:huixiang/setting/setting_page.dart'; import 'package:huixiang/setting/treaty_page.dart'; +// import 'package:huixiang/store/settlement.dart'; import 'package:huixiang/store/store_order.dart'; import 'package:huixiang/store/store_view/settlement.dart'; import 'package:huixiang/union/location_map_page.dart'; @@ -212,76 +213,56 @@ class MyApp extends StatelessWidget { } Map routers = { - '/router/guide_Page': (context, {arguments}) => GuidePage(), - '/router/login_page': (context, {arguments}) => - LoginPage(arguments: arguments), - '/router/main_page': (context, {arguments}) => MainPage(), - '/router/msg_page': (context, {arguments}) => MainMessagePage(), - '/router/system_msg_page': (context, {arguments}) => SystemMessagePage(), - '/router/exchange_order_details': (context, {arguments}) => - ExchangeOrderDetailPage(), - '/router/integral_page': (context, {arguments}) => IntegralPage(), - '/router/integral_detailed_page': (context, {arguments}) => - IntegralDetailedPage(), - '/router/mine_wallet': (context, {arguments}) => MineWalletPage(), - '/router/user_info_page': (context, {arguments}) => UserInfoPage(), - '/router/mine_card': (context, {arguments}) => MineCardPage(), + '/router/exchange_order_success_page': (context, {arguments}) => ExchangeOrderSuccessPage(arguments: arguments), + '/router/logistics_information_page': (context, {arguments}) => LogisticsInformationPage(arguments: arguments), + '/router/integral_store_page': (context, {arguments}) => IntegralStoreDetailsPage(arguments: arguments), + '/router/manage_address_page': (context, {arguments}) => ManageAddressPage(arguments: arguments), + '/router/exchange_order_page': (context, {arguments}) => ExchangeOrderPage(arguments: arguments), + '/router/mine_vip_level_page': (context, {arguments}) => MineVipLevelPage(arguments: arguments), + '/router/order_history_page': (context, {arguments}) => OrderHistoryPage(arguments: arguments), + '/router/union_detail_page': (context, {arguments}) => UnionDetailsPage(arguments: arguments), + '/router/address_edit_page': (context, {arguments}) => EditAddressPage(arguments: arguments), + '/router/vip_details_page': (context, {arguments}) => VipDetailPage(arguments: arguments), + '/router/order_details': (context, {arguments}) => OrderDetailPage(arguments: arguments), + // '/router/hot_article_details_page': (context, {arguments}) => HotArticleDetailsPage(), + '/router/write_off_page': (context, {arguments}) => WriteOffPage(arguments: arguments), + '/router/hot_article_details_page': (context, {arguments}) => HotArticleDetailsPage(), + '/router/store_order': (context, {arguments}) => StoreOrderPage(arguments: arguments), + '/router/vip_balance': (context, {arguments}) => VipBalancePage(arguments: arguments), + '/router/exchange_order_details': (context, {arguments}) => ExchangeOrderDetailPage(), + '/router/location_map': (context, {arguments}) => LocationMap(arguments: arguments), + // '/router/settlement': (context, {arguments}) => Settlement(arguments: arguments), + '/router/integral_detailed_page': (context, {arguments}) => IntegralDetailedPage(), + '/router/write_off_success_page': (context, {arguments}) => WriteOffSuccessPage(), + '/router/exchange_history_page': (context, {arguments}) => ExchangeHistoryPage(), + '/router/permission_setting': (context, {arguments}) => PermissionSettingPage(), + '/router/login_page': (context, {arguments}) => LoginPage(arguments: arguments), + '/router/edit_name': (context, {arguments}) => EditName(arguments: arguments), '/router/mine_card_invalid': (context, {arguments}) => MineCardInvalidPage(), - '/router/vip_card_page': (context, {arguments}) => VipCardPage(), - '/router/vip_details_page': (context, {arguments}) => - VipDetailPage(arguments: arguments), - '/router/vip_balance': (context, {arguments}) => - VipBalancePage(arguments: arguments), - '/router/coupons_page': (context, {arguments}) => CouponsPage(), - '/router/permission_setting': (context, {arguments}) => - PermissionSettingPage(), - '/router/manage_address_page': (context, {arguments}) => - ManageAddressPage(arguments: arguments), - '/router/setting_page': (context, {arguments}) => SettingPage(), - '/router/about_page': (context, {arguments}) => AboutPage(), - '/router/help_feedback_page': (context, {arguments}) => HelpFeedbackPage(), - '/router/treaty_page': (context, {arguments}) => TreatyPage(), - '/router/union_detail_page': (context, {arguments}) => - UnionDetailsPage(arguments: arguments), - '/router/web_page': (context, {arguments}) => WebPage(arguments: arguments), - '/router/integral_store_page': (context, {arguments}) => - IntegralStoreDetailsPage(arguments: arguments), - '/router/exchange_order_page': (context, {arguments}) => - ExchangeOrderPage(arguments: arguments), '/router/store_selector_page': (context, {arguments}) => StoreSelectorPage(), - '/router/exchange_order_success_page': (context, {arguments}) => - ExchangeOrderSuccessPage(arguments: arguments), - '/router/mine_vip_level_page': (context, {arguments}) => - MineVipLevelPage(arguments: arguments), - '/router/exchange_history_page': (context, {arguments}) => - ExchangeHistoryPage(), - '/router/write_off_page': (context, {arguments}) => - WriteOffPage(arguments: arguments), - '/router/write_off_success_page': (context, {arguments}) => - WriteOffSuccessPage(), - '/router/order_history_page': (context, {arguments}) => OrderHistoryPage(arguments: arguments), - '/router/order_details': (context, {arguments}) => - OrderDetailPage(arguments: arguments), - '/router/settlement': (context, {arguments}) => - Settlement(arguments: arguments), - '/router/recharge_page': (context, {arguments}) => RechargePage(), + '/router/video_playback_page': (context, {arguments}) => VideoPlaybackPage(), + '/router/web_page': (context, {arguments}) => WebPage(arguments: arguments), + '/router/help_feedback_page': (context, {arguments}) => HelpFeedbackPage(), + '/router/founder_story_page': (context, {arguments}) => FounderStoryPage(), + '/router/system_msg_page': (context, {arguments}) => SystemMessagePage(), + '/router/edit_remarks_page': (context, {arguments}) => EditRemarksPage(), '/router/hot_article_page': (context, {arguments}) => HotArticlePage(), - '/router/address_edit_page': (context, {arguments}) => - EditAddressPage(arguments: arguments), '/router/address_map_page': (context, {arguments}) => AddressMapPage(), - '/router/logistics_information_page': (context, {arguments}) => - LogisticsInformationPage(arguments: arguments), - '/router/hot_article_details_page': (context, {arguments}) => - HotArticleDetailsPage(), - '/router/founder_story_page': (context, {arguments}) => FounderStoryPage(), - '/router/video_playback_page': (context, {arguments}) => VideoPlaybackPage(), '/router/roll_center_page': (context, {arguments}) => RollCenterPage(), - '/router/edit_remarks_page': (context, {arguments}) => EditRemarksPage(), - '/router/edit_name': (context, {arguments}) => EditName(arguments: arguments), - '/router/location_map': (context, {arguments}) => LocationMap(arguments: arguments), + '/router/user_info_page': (context, {arguments}) => UserInfoPage(), + '/router/recharge_page': (context, {arguments}) => RechargePage(), + '/router/mine_wallet': (context, {arguments}) => MineWalletPage(), + '/router/integral_page': (context, {arguments}) => IntegralPage(), + '/router/vip_card_page': (context, {arguments}) => VipCardPage(), + '/router/msg_page': (context, {arguments}) => MainMessagePage(), + '/router/coupons_page': (context, {arguments}) => CouponsPage(), + '/router/setting_page': (context, {arguments}) => SettingPage(), '/router/qr_scan': (context, {arguments}) => QrCodeScanPage(), + '/router/treaty_page': (context, {arguments}) => TreatyPage(), + '/router/mine_card': (context, {arguments}) => MineCardPage(), + '/router/guide_Page': (context, {arguments}) => GuidePage(), + '/router/about_page': (context, {arguments}) => AboutPage(), '/router/qr_share': (context, {arguments}) => QrSharePage(), - '/router/store_order': (context, {arguments}) => StoreOrderPage(arguments: arguments), - // '/router/hot_article_details_page': (context, {arguments}) => HotArticleDetailsPage(), + '/router/main_page': (context, {arguments}) => MainPage(), // '/router/ui_test': (context, {arguments}) => UITest(), }; diff --git a/lib/mine/mine_view/mine_item.dart b/lib/mine/mine_view/mine_item.dart index 6bfb504d..4f392be2 100644 --- a/lib/mine/mine_view/mine_item.dart +++ b/lib/mine/mine_view/mine_item.dart @@ -52,7 +52,7 @@ class _MineItem extends State { Container( padding: EdgeInsets.symmetric(vertical: 4.h), child: Text( - "我的工具", + S.of(context).wodegongju, style: TextStyle( color: Color(0xFF353535), fontWeight: MyFontWeight.semi_bold, @@ -109,15 +109,15 @@ class _MineItem extends State { "assets/image/icon_location_address.png", ), ), - // InkWell( - // onTap: () { - // Navigator.of(context).pushNamed('/router/setting_page'); - // }, - // child: mineItem( - // S.of(context).shezhi, - // "assets/image/icon_mine_setting.png", - // ), - // ), + InkWell( + onTap: () { + Navigator.of(context).pushNamed('/router/qr_share', arguments: {}); + }, + child: mineItem( + S.of(context).tuiguangma, + "assets/image/icon_mine_promotion_code.png", + ), + ), // mineItem( // S.of(context).bangzhuyufankui, // "assets/image/icon_mine_feedback.png", diff --git a/lib/mine/mine_view/mine_view.dart b/lib/mine/mine_view/mine_view.dart index 1116b541..f75b1af5 100644 --- a/lib/mine/mine_view/mine_view.dart +++ b/lib/mine/mine_view/mine_view.dart @@ -36,7 +36,7 @@ class _MineView extends State { children: [ InkWell( onTap: () { - // toScan(); + toScan(); }, child: Container( padding: EdgeInsets.all(8.h), @@ -64,12 +64,7 @@ class _MineView extends State { ], ), ), - InkWell( - onTap: () { - widget.toUserInfo(); - }, - child: mineView(), - ), + mineView(), SizedBox( height: 12.h, ), @@ -111,27 +106,32 @@ class _MineView extends State { mainAxisAlignment: MainAxisAlignment.spaceEvenly, crossAxisAlignment: CrossAxisAlignment.start, children: [ - Stack( - children: [ - MImage( - widget.userInfo == null ? "" : widget.userInfo.headimg, - isCircle: true, - width: 50, - height: 50, - fit: BoxFit.cover, - errorSrc: "assets/image/default_user.png", - fadeSrc: "assets/image/default_user.png", - ), - Positioned( - bottom: 0, - right: 2.w, - child: Image.asset( - "assets/image/icon_mine_edit.png", - width: 17.w, - height: 17.w, - ), + InkWell( + onTap: () { + widget.toUserInfo(); + }, + child: Stack( + children: [ + MImage( + widget.userInfo == null ? "" : widget.userInfo.headimg, + isCircle: true, + width: 50, + height: 50, + fit: BoxFit.cover, + errorSrc: "assets/image/default_user.png", + fadeSrc: "assets/image/default_user.png", + ), + Positioned( + bottom: 0, + right: 2.w, + child: Image.asset( + "assets/image/icon_mine_edit.png", + width: 17.w, + height: 17.w, + ), + ), + ], ), - ], ), SizedBox( width: 10.w, diff --git a/lib/qr/qr_code_scan.dart b/lib/qr/qr_code_scan.dart index 9b3e40fb..3fae8dfd 100644 --- a/lib/qr/qr_code_scan.dart +++ b/lib/qr/qr_code_scan.dart @@ -24,7 +24,7 @@ class _QrCodeScanPage extends State { void initState() { super.initState(); - readerHeight = MediaQuery.of(context).size.height; + readerHeight = 812; Future.delayed(Duration(seconds: 1), () { buildReaderView(); }); @@ -39,12 +39,14 @@ class _QrCodeScanPage extends State { Positioned( child: qrReaderView != null ? Column( - children: [ - Expanded(child: qrReaderView, flex: readerHeight.toInt(),), - // Expanded(child: qrReaderView, flex: readerHeight,), - - ], - ) + children: [ + Expanded( + child: qrReaderView, + flex: readerHeight.toInt(), + ), + // Expanded(child: qrReaderView, flex: readerHeight,), + ], + ) : Container( width: MediaQuery.of(context).size.width, height: MediaQuery.of(context).size.height, @@ -90,7 +92,7 @@ class _QrCodeScanPage extends State { } QrReaderView qrReaderView; - double readerHeight ; + double readerHeight; buildReaderView() async { double screenWidth = MediaQuery.of(context).size.width; diff --git a/lib/qr/qr_share_image.dart b/lib/qr/qr_share_image.dart index 4b0f3b27..94f265e6 100644 --- a/lib/qr/qr_share_image.dart +++ b/lib/qr/qr_share_image.dart @@ -199,10 +199,10 @@ class _QrShareImagePage extends State { SharesdkPlugin.share(ShareSDKPlatforms.wechatSession, params, (state, userData, contentEntity, error) { - print("share state !$state"); - print("share userData !$userData"); - print("share contentEntity !$contentEntity"); - print("share error !$error"); + print("share state !$state"); + print("share userData !$userData"); + print("share contentEntity !$contentEntity"); + print("share error !$error"); }); } } diff --git a/lib/retrofit/retrofit_api.dart b/lib/retrofit/retrofit_api.dart index 5545e91d..c6b0b692 100644 --- a/lib/retrofit/retrofit_api.dart +++ b/lib/retrofit/retrofit_api.dart @@ -37,8 +37,12 @@ import 'data/wx_pay.dart'; part 'retrofit_api.g.dart'; -const base_url = "https://pos.platform.lotus-wallet.com/app/"; ///正式 -const baseUrl = "https://pos.platform.lotus-wallet.com/app/"; ///正式 +const base_url = "https://pos.platform.lotus-wallet.com/app/"; + +///正式 +const baseUrl = "https://pos.platform.lotus-wallet.com/app/"; + +///正式 // const base_url = "http://192.168.10.236:8766/app/"; ///费韬 // const baseUrl = "http://192.168.10.236:8766/app/"; ///费韬 @@ -48,12 +52,14 @@ const baseUrl = "https://pos.platform.lotus-wallet.com/app/"; ///正式 @RestApi(baseUrl: baseUrl) abstract class ApiService { - factory ApiService(Dio dio, - {String baseUrl, - BuildContext context, - String token, - bool showLoading = true, - bool pay = false}) { + factory ApiService( + Dio dio, { + String baseUrl, + BuildContext context, + String token, + bool showLoading = true, + bool pay = false, + }) { Map headers = (token == null || token == "") ? {} : {'token': "Bearer $token"}; if (pay) { @@ -356,5 +362,5 @@ abstract class ApiService { ///继续付款? @POST("/order/settlement") - Future> settlement(@Body() Map map); + Future> settlement(@Body() Map map); } diff --git a/lib/store/store_order.dart b/lib/store/store_order.dart index 65849d74..388d8120 100644 --- a/lib/store/store_order.dart +++ b/lib/store/store_order.dart @@ -1,5 +1,6 @@ import 'package:dio/dio.dart'; import 'package:flutter/cupertino.dart'; +import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_swiper/flutter_swiper.dart'; @@ -9,6 +10,7 @@ import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/store_info.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/store/store_view/store_info.dart'; +import 'package:huixiang/store/store_view/store_order_page.dart'; import 'package:huixiang/union/union_view/union_coupon.dart'; import 'package:huixiang/union/union_view/vip.dart'; import 'package:huixiang/utils/font_weight.dart'; @@ -32,32 +34,12 @@ class StoreOrderPage extends StatefulWidget { } } -class testModel { - String name; - bool isSelected; - - testModel(String name) { - this.name = name; - this.isSelected = false; - } -} - class _StoreOrderPage extends State with TickerProviderStateMixin /*, AutomaticKeepAliveClientMixin */ { TabController tabcontroller; ApiService apiService; StoreInfo storeInfo; RefreshController refreshController; - List temperatureStoreList = [ - testModel("正常冰"), - testModel("少冰"), - testModel("多冰"), - testModel("去冰") - ]; - List sweetnessStoreList = [testModel("正常糖"), testModel("5分糖")]; - int isSelected = 0; - int isChoice = 0; - int tempClickIndex = 0; @override void initState() { @@ -90,6 +72,8 @@ class _StoreOrderPage extends State } } + ScrollController controller = ScrollController(); + @override Widget build(BuildContext context) { return Stack( @@ -108,12 +92,12 @@ class _StoreOrderPage extends State queryStoreInfo(); }, child: NestedScrollView( - headerSliverBuilder: - (BuildContext context, bool innerBoxIsScrolled) { + controller: controller, + dragStartBehavior: DragStartBehavior.start, + headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) { return [ SliverOverlapAbsorber( - handle: NestedScrollView.sliverOverlapAbsorberHandleFor( - context), + handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context), sliver: SliverAppBar( title: Text( widget.storeInfo != null @@ -131,6 +115,7 @@ class _StoreOrderPage extends State : 365.h, floating: false, snap: false, + pinned: true, leading: GestureDetector( onTap: () { Navigator.of(context).pop(); @@ -146,7 +131,6 @@ class _StoreOrderPage extends State ), ), ), - pinned: true, flexibleSpace: FlexibleSpaceBar( background: Stack( children: [ @@ -177,7 +161,7 @@ class _StoreOrderPage extends State child: Column( children: [ ///门店信息 - StoreInfoView(), + StoreInfoView(storeInfo), ///门店对应优惠券 if (storeInfo != null && @@ -188,6 +172,10 @@ class _StoreOrderPage extends State coupon: true, ), + SizedBox( + height: 8, + ), + ///门店对应VIP信息 Vip(storeInfo, () {}, false), ], @@ -249,17 +237,11 @@ class _StoreOrderPage extends State body: TabBarView( physics: BouncingScrollPhysics(), children: [ - Container( - color: Colors.white, - width: MediaQuery.of(context).size.width, - height: MediaQuery.of(context).size.width, - child: order(), - ), + StoreOrderListPage(widget.arguments, widget.activitys, storeInfo, controller), Container( color: Colors.black, width: MediaQuery.of(context).size.width, - height: MediaQuery.of(context).size.width, - ) + ), ], controller: tabcontroller, ), @@ -323,13 +305,14 @@ class _StoreOrderPage extends State InkWell( onTap: () { setState(() { - showShoppingCart(); + // showShoppingCart(); }); }, child: Image.asset( - "assets/image/shopp.png", + "assets/image/icon_shop.png", width: 88, height: 88, + fit: BoxFit.fitWidth, ), ), Positioned( @@ -356,902 +339,6 @@ class _StoreOrderPage extends State ); } - ///星店活动 - Widget starGoodsItem() { - return Container( - child: Swiper( - viewportFraction: 0.95, - loop: false, - itemBuilder: (context, position) { - return InkWell( - onTap: () { - if (widget.arguments["source"] != null && - widget.arguments["source"] == widget.activitys[position].id) { - Navigator.of(context).pop(); - } else { - Navigator.of(context).pushNamed('/router/web_page', arguments: { - "activityId": widget.activitys[position].id, - "source": widget.arguments["id"] - }); - } - }, - child: Container( - margin: EdgeInsets.symmetric(horizontal: 5.w), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(8), - boxShadow: [ - BoxShadow( - color: Color(0x0D000000), - offset: Offset(0, 3), - blurRadius: 14, - spreadRadius: 0, - ) - ], - ), - child: Stack( - children: [ - Container( - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.max, - children: [ - MImage( - (widget.activitys != null && - widget.activitys.length > position) - ? widget.activitys[position].coverImg - : "", - aspectRatio: 2.2, - radius: BorderRadius.vertical( - top: Radius.circular(8), - ), - fit: BoxFit.cover, - errorSrc: "assets/image/default_2_1.png", - fadeSrc: "assets/image/default_2_1.png", - ), - Container( - padding: EdgeInsets.all(8), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - (widget.activitys != null && - widget.activitys.length > position) - ? widget.activitys[position].storeName - : "", - style: TextStyle( - fontSize: 14.sp, - fontWeight: MyFontWeight.semi_bold, - color: Color(0xFF000000), - ), - ), - SizedBox( - height: 4.h, - ), - Text( - (widget.activitys != null && - widget.activitys.length > position) - ? widget.activitys[position].mainTitle - : "", - style: TextStyle( - fontSize: 12.sp, - fontWeight: MyFontWeight.semi_bold, - color: Color(0xFF727272), - ), - ), - ], - ), - ), - ], - ), - ), - Positioned( - top: 0, - right: 0, - child: Container( - padding: EdgeInsets.symmetric( - vertical: 4.h, - horizontal: 8.w, - ), - decoration: BoxDecoration( - color: Colors.black.withAlpha(76), - borderRadius: BorderRadius.only( - bottomLeft: Radius.circular(8), - topRight: Radius.circular(8), - ), - ), - child: Text( - (widget.activitys != null && - widget.activitys.length > position) - ? widget.activitys[position].startTime.split(" ")[0] - : "", - style: TextStyle( - fontWeight: MyFontWeight.semi_bold, - fontSize: 12.sp, - color: Color(0xD9FFFFFF), - ), - ), - ), - ), - ], - ), - ), - ); - }, - itemCount: (widget.activitys != null && widget.activitys.length > 0) - ? widget.activitys.length - : 0, - ), - ); - } - - ///点餐 - Widget order() { - return Container( - width: double.infinity, - child: Row( - children: [ - Container( - // decoration: BoxDecoration( - // color: Color(0xFFFAFAFA), - // boxShadow: [ - // BoxShadow( - // color: Color(0x0D000000), - // offset: Offset(0, 3), - // blurRadius: 14, - // spreadRadius: 0, - // ) - // ], - // ), - width: 104.w, - // height: 300.h, - child: ListView.builder( - itemCount: 15, - shrinkWrap: true, - // physics: NeverScrollableScrollPhysics(), - itemBuilder: (context, position) { - return orderItem(position); - }), - ), - Expanded( - flex: 1, - child: Container( - child: ListView.builder( - itemCount: 15, - shrinkWrap: true, - // physics: NeverScrollableScrollPhysics(), - itemBuilder: (context, position) { - return goodsItem(); - }), - )), - ], - ), - ); - } - - Widget orderItem(int index) { - return Container( - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceAround, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - GestureDetector( - onTap: () { - setState(() { - isSelected = index; - }); - }, - child: Container( - color: isSelected != index ? Color(0xFFFAFAFA) : Colors.white, - child: Padding( - padding: - EdgeInsets.only(left: 16, right: 28, top: 12, bottom: 16), - child: Row( - children: [ - Container( - color: isSelected != index - ? Color(0xFFFAFAFA) - : Color(0xFF32A060), - width: 2.w, - height: 17.h, - ), - SizedBox( - width: 10.w, - ), - Text( - "人气推荐", - textAlign: TextAlign.center, - style: TextStyle( - color: isSelected != index - ? Color(0xFF202020) - : Color(0xFF000000), - fontSize: 12.sp, - fontWeight: MyFontWeight.medium, - ), - ), - ], - ), - ), - ), - ), - ], - ), - ); - } - - Widget goodsItem() { - return Container( - color: Colors.white, - padding: EdgeInsets.only(right: 16.w, bottom: 10, top: 10), - child: Row( - // mainAxisAlignment: MainAxisAlignment.spaceAround, - // crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox(width: 12.w), - MImage( - "assets/image/default_1.png", - width: 70, - height: 70, - fit: BoxFit.cover, - errorSrc: "assets/image/default_1.png", - fadeSrc: "assets/image/default_1.png", - ), - SizedBox(width: 10), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - "手工啵啵奶茶", - style: TextStyle( - color: Colors.black, - fontSize: 13.sp, - fontWeight: MyFontWeight.medium, - ), - ), - SizedBox(height: 2), - Row( - children: [ - Text( - "无香精", - style: TextStyle( - color: Color(0xFF4C4C4C), - fontSize: 10.sp, - fontWeight: MyFontWeight.regular, - ), - ), - SizedBox(width: 10), - Text( - "无香精", - style: TextStyle( - color: Color(0xFF4C4C4C), - fontSize: 10.sp, - fontWeight: MyFontWeight.regular, - ), - ) - ], - ), - SizedBox(height: 7), - Row( - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - Text( - "会员价", - style: TextStyle( - color: Color(0xFFFF7A1A), - fontSize: 10.sp, - fontWeight: MyFontWeight.medium, - ), - ), - Text( - "¥19.00", - style: TextStyle( - color: Color(0xFFFF7A1A), - fontSize: 11.sp, - fontWeight: MyFontWeight.medium, - ), - ) - ], - ), - Row( - children: [ - Text( - "原价", - style: TextStyle( - color: Color(0xFFA29E9E), - fontSize: 9.sp, - fontWeight: MyFontWeight.regular, - ), - ), - SizedBox(width: 10), - Text( - "¥19.00", - style: TextStyle( - color: Color(0xFFA29E9E), - fontSize: 10.sp, - fontWeight: MyFontWeight.regular, - ), - ) - ], - ), - ], - ), - Spacer(), - true - ? GestureDetector( - onTap: () { - setState(() { - showStoreSelector(); - }); - }, - child: RoundButton( - width: 49.w, - text: "选规格", - textColor: Colors.white, - fontWeight: MyFontWeight.medium, - radius: 11, - backgroup: Color(0xFF32A060), - fontSize: 11.sp, - padding: EdgeInsets.symmetric(vertical: 5.h), - ), - ) - : InkWell( - onTap: () {}, - child: Image.asset( - "assets/image/reduce.png", - width: 22, - height: 22, - ), - ), - if (false) - Padding( - padding: EdgeInsets.only(left: 8, right: 8), - child: Text( - "1", - style: TextStyle( - color: Colors.black, - fontSize: 14.sp, - fontWeight: MyFontWeight.medium, - ), - ), - ), - if (false) - InkWell( - onTap: () {}, - child: Image.asset( - "assets/image/add.png", - width: 22, - height: 22, - ), - ), - ], - ), - ], - ), - ) - ], - ), - ); - } - - ///选规格弹窗 - showStoreSelector() { - showModalBottomSheet( - context: context, - backgroundColor: Colors.transparent, - builder: (context) { - return StatefulBuilder(builder: (context1, state) { - return Container( - alignment: Alignment.topCenter, - padding: EdgeInsets.only(top: 16, left: 16, right: 16), - width: double.infinity, - decoration: BoxDecoration( - color: Color(0xFFFAFAFA), - borderRadius: BorderRadius.only( - topLeft: Radius.circular(8), topRight: Radius.circular(8)), - ), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - MImage( - "", - width: 70, - height: 70, - fit: BoxFit.cover, - errorSrc: "assets/image/default_1.png", - fadeSrc: "assets/image/default_1.png", - ), - SizedBox(width: 10), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - "手工啵啵奶茶", - style: TextStyle( - color: Colors.black, - fontSize: 16.sp, - fontWeight: MyFontWeight.medium, - ), - ), - Padding( - padding: EdgeInsets.only(top: 4, bottom: 7), - child: Text( - "已选:正常冰", - style: TextStyle( - color: Color(0xFF727272), - fontSize: 11.sp, - fontWeight: MyFontWeight.regular, - ), - ), - ), - Row( - children: [ - Text( - "会员价", - style: TextStyle( - color: Color(0xFFFF7A1A), - fontSize: 13.sp, - fontWeight: MyFontWeight.medium, - ), - ), - Text( - "¥19.00", - style: TextStyle( - color: Color(0xFFFF7A1A), - fontSize: 14.sp, - fontWeight: MyFontWeight.medium, - ), - ) - ], - ), - ], - ), - Spacer(), - InkWell( - onTap: () { - Navigator.of(context).pop(); - }, - child: Image.asset( - "assets/image/cancel.png", - width: 22, - height: 22, - ), - ), - ], - ), - SizedBox( - height: 23, - ), - Text( - "温度", - style: TextStyle( - color: Colors.black, - fontSize: 14.sp, - fontWeight: MyFontWeight.regular, - ), - ), - SizedBox( - height: 15, - ), - sweetnessStore(() { - state(() { - for (var i = 0; i < temperatureStoreList.length; i++) { - if (tempClickIndex == i) - temperatureStoreList[i].isSelected = true; - else - temperatureStoreList[i].isSelected = false; - } - }); - }, temperatureStoreList), - SizedBox( - height: 24, - ), - Text( - "甜度", - style: TextStyle( - color: Colors.black, - fontSize: 14.sp, - fontWeight: MyFontWeight.regular, - ), - ), - SizedBox( - height: 15, - ), - sweetnessStore(() { - state(() { - for (var i = 0; i < sweetnessStoreList.length; i++) { - if (tempClickIndex == i) - sweetnessStoreList[i].isSelected = true; - else - sweetnessStoreList[i].isSelected = false; - } - }); - }, sweetnessStoreList), - SizedBox( - height: 24, - ), - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Text( - "数量", - style: TextStyle( - color: Colors.black, - fontSize: 14.sp, - fontWeight: MyFontWeight.regular, - ), - )), - InkWell( - onTap: () {}, - child: Image.asset( - "assets/image/reduce.png", - width: 22, - height: 22, - ), - ), - Padding( - padding: EdgeInsets.only(left: 8, right: 8), - child: Text( - "1", - style: TextStyle( - color: Colors.black, - fontSize: 14.sp, - fontWeight: MyFontWeight.medium, - ), - ), - ), - InkWell( - onTap: () {}, - child: Image.asset( - "assets/image/add.png", - width: 22, - height: 22, - ), - ), - ], - ), - 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, - // padding: EdgeInsets.symmetric(vertical: 5.h), - ), - ], - ), - ); - }); - }, - ); - } - - Widget sweetnessStore(Function fc, List arrays) { - return GridView.builder( - itemCount: arrays.length, - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( - //一行的Widget数量 - crossAxisCount: 4, - //水平子Widget之间间距 - crossAxisSpacing: 6.w, - //垂直子Widget之间间距 - mainAxisSpacing: 12.w, - //垂直单个子Widget之间间距 - childAspectRatio: 3 / 1), - itemBuilder: (contetx, index) { - return GestureDetector( - onTap: () { - tempClickIndex = index; - fc(); - }, - child: sweetnessItem(arrays[index].name, arrays[index].isSelected), - ); - }, - ); - } - - Widget sweetnessItem(String name, bool isCheck) { - return Container( - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - RoundButton( - width: 68.w, - height: 29.h, - text: name, - textColor: !isCheck ? Color(0xFF727272) : Colors.white, - fontWeight: MyFontWeight.regular, - radius: 4, - backgroup: !isCheck ? Color(0xFFE5E5E5) : Color(0xFF32A060), - fontSize: 12.sp, - ), - ], - ), - ); - } - - ///购物车弹窗 - showShoppingCart() { - showModalBottomSheet( - context: context, - backgroundColor: Colors.transparent, - builder: (context) { - return StatefulBuilder(builder: (context1, state) { - return Container( - alignment: Alignment.topCenter, - width: double.infinity, - decoration: BoxDecoration( - color: Color(0xFFFAFAFA), - borderRadius: BorderRadius.only( - topLeft: Radius.circular(8), topRight: Radius.circular(8)), - ), - child: Stack( - children: [ - Container( - padding: EdgeInsets.only(top: 16, left: 16, right: 16), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - "已选商品", - style: TextStyle( - color: Colors.black, - fontSize: 14.sp, - fontWeight: MyFontWeight.medium, - ), - ), - InkWell( - onTap: () {}, - child: Image.asset( - "assets/image/delete.png", - width: 22, - height: 22, - ), - ), - ], - ), - SizedBox(height: 24.h), - Expanded( - child: Container( - child: ListView.builder( - itemCount: 10, - shrinkWrap: true, - // physics:NeverScrollableScrollPhysics(), - itemBuilder: (context, position) { - return shoppGoodsItem(); - }), - ), - ) - ], - ), - ), - Positioned( - bottom: 0, - left: 0, - right: 0, - child: Stack( - alignment: Alignment.bottomLeft, - children: [ - Container( - height: 54.h, - color: Color(0xFFFAFAFA), - child: Row( - // mainAxisAlignment: MainAxisAlignment.end, - // crossAxisAlignment: CrossAxisAlignment.end, - children: [ - Spacer(), - Text( - S.of(context).heji, - style: TextStyle( - fontSize: 12.sp, - fontWeight: MyFontWeight.regular, - color: Colors.black, - ), - ), - Text( - "¥19.00", - style: TextStyle( - fontSize: 20.sp, - fontWeight: MyFontWeight.medium, - color: Color(0xFF32A060), - ), - ), - Spacer(), - RoundButton( - width: 103.w, - height: 54.h, - text: S.current.jiesuan, - textColor: Colors.white, - fontWeight: MyFontWeight.regular, - backgroup: Color(0xFF32A060), - fontSize: 16.sp, - padding: EdgeInsets.symmetric(vertical: 5.h), - ) - ], - ), - ), - Stack( - children: [ - InkWell( - onTap: () { - setState(() { - Navigator.of(context).pop(); - }); - }, - child: Image.asset( - "assets/image/shopp.png", - width: 88, - height: 88, - ), - ), - Positioned( - right: 15, - top: 14, - child: RoundButton( - width: 17, - height: 17, - text: "1", - textColor: Colors.white, - fontWeight: MyFontWeight.regular, - backgroup: Color(0xFF32A060), - fontSize: 12.sp, - radius: 100, - // padding: EdgeInsets.symmetric(vertical: 5.h), - ), - ) - ], - ), - ], - ), - ) - ], - ), - ); - }); - }, - ); - } - - Widget shoppGoodsItem() { - return Container( - padding: EdgeInsets.only(bottom: 10), - child: Row( - children: [ - MImage( - "assets/image/default_1.png", - width: 60, - height: 60, - fit: BoxFit.cover, - errorSrc: "assets/image/default_1.png", - fadeSrc: "assets/image/default_1.png", - ), - SizedBox(width: 10), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - "手工啵啵奶茶", - style: TextStyle( - color: Colors.black, - fontSize: 12.sp, - fontWeight: MyFontWeight.medium, - ), - ), - SizedBox(height: 2), - Row( - children: [ - Text( - "无香精", - style: TextStyle( - color: Color(0xFF4C4C4C), - fontSize: 11.sp, - fontWeight: MyFontWeight.regular, - ), - ), - SizedBox(width: 10), - Text( - "无香精", - style: TextStyle( - color: Color(0xFF4C4C4C), - fontSize: 11.sp, - fontWeight: MyFontWeight.regular, - ), - ) - ], - ), - SizedBox(height: 6), - Row( - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - Text( - "会员价", - style: TextStyle( - color: Color(0xFFFF7A1A), - fontSize: 13.sp, - fontWeight: MyFontWeight.medium, - ), - ), - Text( - "¥19.00", - style: TextStyle( - color: Color(0xFFFF7A1A), - fontSize: 14.sp, - fontWeight: MyFontWeight.medium, - ), - ) - ], - ), - ], - ), - Spacer(), - InkWell( - onTap: () {}, - child: Image.asset( - "assets/image/reduce.png", - width: 22, - height: 22, - ), - ), - Padding( - padding: EdgeInsets.only(left: 8, right: 8), - child: Text( - "1", - style: TextStyle( - color: Colors.black, - fontSize: 14.sp, - fontWeight: MyFontWeight.medium, - ), - ), - ), - InkWell( - onTap: () {}, - child: Image.asset( - "assets/image/add.png", - width: 22, - height: 22, - ), - ), - ], - ), - ], - ), - ) - ], - ), - ); - } - // @override // bool get wantKeepAlive => true; } diff --git a/lib/store/store_view/store_info.dart b/lib/store/store_view/store_info.dart index 298e61b0..0db4086b 100644 --- a/lib/store/store_view/store_info.dart +++ b/lib/store/store_view/store_info.dart @@ -1,11 +1,17 @@ import 'package:flutter/material.dart'; import 'package:huixiang/generated/l10n.dart'; +import 'package:huixiang/retrofit/data/store_info.dart'; import 'package:huixiang/utils/flutter_utils.dart'; import 'package:huixiang/utils/font_weight.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:huixiang/view_widget/round_button.dart'; class StoreInfoView extends StatefulWidget { + + final StoreInfo storeInfo; + + StoreInfoView(this.storeInfo); + @override State createState() { return _StoreInfoView(); @@ -49,7 +55,7 @@ class _StoreInfoView extends State { Container( alignment: Alignment.centerLeft, child: Text( - "百年川椒", + widget.storeInfo != null ? (widget.storeInfo.storeName ?? "") : "", overflow: TextOverflow.ellipsis, style: TextStyle( fontSize: 18.sp, diff --git a/lib/store/store_view/store_order_page.dart b/lib/store/store_view/store_order_page.dart new file mode 100644 index 00000000..d6c27bae --- /dev/null +++ b/lib/store/store_view/store_order_page.dart @@ -0,0 +1,927 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_swiper/flutter_swiper.dart'; +import 'package:huixiang/generated/l10n.dart'; +import 'package:huixiang/retrofit/data/activity.dart'; +import 'package:huixiang/retrofit/data/store_info.dart'; +import 'package:huixiang/utils/font_weight.dart'; +import 'package:huixiang/view_widget/custom_image.dart'; +import 'package:huixiang/view_widget/round_button.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; + +class StoreOrderListPage extends StatefulWidget { + final Map arguments; + final List activitys; + final StoreInfo storeInfo; + final ScrollController controller; + + StoreOrderListPage( + this.arguments, this.activitys, this.storeInfo, this.controller); + + @override + State createState() { + return _StoreOrderListPage(); + } +} + +class testModel { + String name; + bool isSelected; + + testModel(String name) { + this.name = name; + this.isSelected = false; + } +} + +class _StoreOrderListPage extends State { + List temperatureStoreList = [ + testModel("正常冰"), + testModel("少冰"), + testModel("多冰"), + testModel("去冰") + ]; + List sweetnessStoreList = [testModel("正常糖"), testModel("5分糖")]; + int isSelected = 0; + int isChoice = 0; + int tempClickIndex = 0; + + @override + void initState() { + super.initState(); + + widget.controller.addListener(() {}); + } + + @override + Widget build(BuildContext context) { + return Container( + width: MediaQuery.of(context).size.width, + height: MediaQuery.of(context).size.height, + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + Container( + width: 100.w, + height: MediaQuery.of(context).size.height, + child: ListView.builder( + itemCount: 28, + controller: widget.controller, + itemBuilder: (context, position) { + return orderItem(position); + }, + ), + ), + Container( + width: MediaQuery.of(context).size.width - 100.w, + child: ListView.builder( + itemCount: 15, + padding: EdgeInsets.only(top: 25, bottom: 50), + // controller: widget.controller, + itemBuilder: (context, position) { + return goodsItem(); + }, + ), + ), + ], + ), + ); + } + + ScrollController controller1 = ScrollController(); + ScrollController controller2 = ScrollController(); + + Widget orderItem(int index) { + return Container( + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + GestureDetector( + onTap:() { + setState(() { + isSelected = index; + }); + }, + child: Container( + color: isSelected != index ? Color(0xFFFAFAFA) : Colors.white, + alignment: Alignment.center, + padding: EdgeInsets.all(15), + child: Text( + "人气推荐", + textAlign: TextAlign.center, + style: TextStyle( + color: isSelected != index + ? Color(0xFF202020) + : Color(0xFF000000), + fontSize: 12.sp, + fontWeight: MyFontWeight.medium, + ), + ), + ), + ), + ], + ), + ); + } + + Widget goodsItem() { + return Container( + color: Colors.white, + padding: EdgeInsets.only(right: 16.w, bottom: 10, top: 10), + child: Row( + // mainAxisAlignment: MainAxisAlignment.spaceAround, + // crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox(width: 12.w), + Image.asset( + "assets/image/default_1.png", + width: 70, + height: 70, + fit: BoxFit.cover, + ), + SizedBox(width: 10), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "手工啵啵奶茶", + style: TextStyle( + color: Colors.black, + fontSize: 13.sp, + fontWeight: MyFontWeight.medium, + ), + ), + SizedBox(height: 2), + Row( + children: [ + Text( + "无香精", + style: TextStyle( + color: Color(0xFF4C4C4C), + fontSize: 10.sp, + fontWeight: MyFontWeight.regular, + ), + ), + SizedBox(width: 10), + Text( + "无香精", + style: TextStyle( + color: Color(0xFF4C4C4C), + fontSize: 10.sp, + fontWeight: MyFontWeight.regular, + ), + ) + ], + ), + SizedBox(height: 7), + Row( + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Text( + "会员价", + style: TextStyle( + color: Color(0xFFFF7A1A), + fontSize: 10.sp, + fontWeight: MyFontWeight.medium, + ), + ), + Text( + "¥19.00", + style: TextStyle( + color: Color(0xFFFF7A1A), + fontSize: 11.sp, + fontWeight: MyFontWeight.medium, + ), + ) + ], + ), + Row( + children: [ + Text( + "原价", + style: TextStyle( + color: Color(0xFFA29E9E), + fontSize: 9.sp, + fontWeight: MyFontWeight.regular, + ), + ), + SizedBox(width: 10), + Text( + "¥19.00", + style: TextStyle( + color: Color(0xFFA29E9E), + fontSize: 10.sp, + fontWeight: MyFontWeight.regular, + ), + ) + ], + ), + ], + ), + Spacer(), + true + ? GestureDetector( + onTap: () { + setState(() { + showStoreSelector(); + }); + }, + child: RoundButton( + width: 49.w, + text: "选规格", + textColor: Colors.white, + fontWeight: MyFontWeight.medium, + radius: 11, + backgroup: Color(0xFF32A060), + fontSize: 11.sp, + padding: EdgeInsets.symmetric(vertical: 5.h), + ), + ) + : InkWell( + onTap: () {}, + child: Image.asset( + "assets/image/reduce.png", + width: 22, + height: 22, + ), + ), + if (false) + Padding( + padding: EdgeInsets.only(left: 8, right: 8), + child: Text( + "1", + style: TextStyle( + color: Colors.black, + fontSize: 14.sp, + fontWeight: MyFontWeight.medium, + ), + ), + ), + if (false) + InkWell( + onTap: () {}, + child: Image.asset( + "assets/image/add.png", + width: 22, + height: 22, + ), + ), + ], + ), + ], + ), + ) + ], + ), + ); + } + + ///星店活动 + Widget starGoodsItem() { + return Container( + child: Swiper( + viewportFraction: 0.95, + loop: false, + itemBuilder: (context, position) { + return InkWell( + onTap: () { + if (widget.arguments["source"] != null && + widget.arguments["source"] == widget.activitys[position].id) { + Navigator.of(context).pop(); + } else { + Navigator.of(context).pushNamed('/router/web_page', arguments: { + "activityId": widget.activitys[position].id, + "source": widget.arguments["id"] + }); + } + }, + child: Container( + margin: EdgeInsets.symmetric(horizontal: 5.w), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8), + boxShadow: [ + BoxShadow( + color: Color(0x0D000000), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ) + ], + ), + child: Stack( + children: [ + Container( + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + MImage( + (widget.activitys != null && + widget.activitys.length > position) + ? widget.activitys[position].coverImg + : "", + aspectRatio: 2.2, + radius: BorderRadius.vertical( + top: Radius.circular(8), + ), + fit: BoxFit.cover, + errorSrc: "assets/image/default_2_1.png", + fadeSrc: "assets/image/default_2_1.png", + ), + Container( + padding: EdgeInsets.all(8), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + (widget.activitys != null && + widget.activitys.length > position) + ? widget.activitys[position].storeName + : "", + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.semi_bold, + color: Color(0xFF000000), + ), + ), + SizedBox( + height: 4.h, + ), + Text( + (widget.activitys != null && + widget.activitys.length > position) + ? widget.activitys[position].mainTitle + : "", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.semi_bold, + color: Color(0xFF727272), + ), + ), + ], + ), + ), + ], + ), + ), + Positioned( + top: 0, + right: 0, + child: Container( + padding: EdgeInsets.symmetric( + vertical: 4.h, + horizontal: 8.w, + ), + decoration: BoxDecoration( + color: Colors.black.withAlpha(76), + borderRadius: BorderRadius.only( + bottomLeft: Radius.circular(8), + topRight: Radius.circular(8), + ), + ), + child: Text( + (widget.activitys != null && + widget.activitys.length > position) + ? widget.activitys[position].startTime.split(" ")[0] + : "", + style: TextStyle( + fontWeight: MyFontWeight.semi_bold, + fontSize: 12.sp, + color: Color(0xD9FFFFFF), + ), + ), + ), + ), + ], + ), + ), + ); + }, + itemCount: (widget.activitys != null && widget.activitys.length > 0) + ? widget.activitys.length + : 0, + ), + ); + } + + ///选规格弹窗 + showStoreSelector() { + showModalBottomSheet( + context: context, + backgroundColor: Colors.transparent, + builder: (context) { + return StatefulBuilder(builder: (context1, state) { + return Container( + alignment: Alignment.topCenter, + padding: EdgeInsets.only(top: 16, left: 16, right: 16), + width: double.infinity, + decoration: BoxDecoration( + color: Color(0xFFFAFAFA), + borderRadius: BorderRadius.only( + topLeft: Radius.circular(8), + topRight: Radius.circular(8), + ), + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + MImage( + "", + width: 70, + height: 70, + fit: BoxFit.cover, + errorSrc: "assets/image/default_1.png", + fadeSrc: "assets/image/default_1.png", + ), + SizedBox(width: 10), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "手工啵啵奶茶", + style: TextStyle( + color: Colors.black, + fontSize: 16.sp, + fontWeight: MyFontWeight.medium, + ), + ), + Padding( + padding: EdgeInsets.only(top: 4, bottom: 7), + child: Text( + "已选:正常冰", + style: TextStyle( + color: Color(0xFF727272), + fontSize: 11.sp, + fontWeight: MyFontWeight.regular, + ), + ), + ), + Row( + children: [ + Text( + "会员价", + style: TextStyle( + color: Color(0xFFFF7A1A), + fontSize: 13.sp, + fontWeight: MyFontWeight.medium, + ), + ), + Text( + "¥19.00", + style: TextStyle( + color: Color(0xFFFF7A1A), + fontSize: 14.sp, + fontWeight: MyFontWeight.medium, + ), + ) + ], + ), + ], + ), + Spacer(), + InkWell( + onTap: () { + Navigator.of(context).pop(); + }, + child: Image.asset( + "assets/image/icon_order_cancel.png", + width: 22, + height: 22, + ), + ), + ], + ), + SizedBox( + height: 23, + ), + Text( + "温度", + style: TextStyle( + color: Colors.black, + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + ), + ), + SizedBox( + height: 15, + ), + sweetnessStore(() { + state(() { + for (var i = 0; i < temperatureStoreList.length; i++) { + if (tempClickIndex == i) + temperatureStoreList[i].isSelected = true; + else + temperatureStoreList[i].isSelected = false; + } + }); + }, temperatureStoreList), + SizedBox( + height: 24, + ), + Text( + "甜度", + style: TextStyle( + color: Colors.black, + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + ), + ), + SizedBox( + height: 15, + ), + sweetnessStore(() { + state(() { + for (var i = 0; i < sweetnessStoreList.length; i++) { + if (tempClickIndex == i) + sweetnessStoreList[i].isSelected = true; + else + sweetnessStoreList[i].isSelected = false; + } + }); + }, sweetnessStoreList), + SizedBox( + height: 24, + ), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: Text( + "数量", + style: TextStyle( + color: Colors.black, + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + ), + )), + InkWell( + onTap: () {}, + child: Image.asset( + "assets/image/reduce.png", + width: 22, + height: 22, + ), + ), + Padding( + padding: EdgeInsets.only(left: 8, right: 8), + child: Text( + "1", + style: TextStyle( + color: Colors.black, + fontSize: 14.sp, + fontWeight: MyFontWeight.medium, + ), + ), + ), + InkWell( + onTap: () {}, + child: Image.asset( + "assets/image/add.png", + width: 22, + height: 22, + ), + ), + ], + ), + 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, + // padding: EdgeInsets.symmetric(vertical: 5.h), + ), + ], + ), + ); + }); + }, + ); + } + + Widget sweetnessStore(Function fc, List arrays) { + return GridView.builder( + itemCount: arrays.length, + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( + //一行的Widget数量 + crossAxisCount: 4, + //水平子Widget之间间距 + crossAxisSpacing: 6.w, + //垂直子Widget之间间距 + mainAxisSpacing: 12.w, + //垂直单个子Widget之间间距 + childAspectRatio: 3 / 1), + itemBuilder: (contetx, index) { + return GestureDetector( + onTap: () { + tempClickIndex = index; + fc(); + }, + child: sweetnessItem(arrays[index].name, arrays[index].isSelected), + ); + }, + ); + } + + Widget sweetnessItem(String name, bool isCheck) { + return Container( + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + RoundButton( + width: 68.w, + height: 29.h, + text: name, + textColor: !isCheck ? Color(0xFF727272) : Colors.white, + fontWeight: MyFontWeight.regular, + radius: 4, + backgroup: !isCheck ? Color(0xFFE5E5E5) : Color(0xFF32A060), + fontSize: 12.sp, + ), + ], + ), + ); + } + + ///购物车弹窗 + showShoppingCart() { + showModalBottomSheet( + context: context, + backgroundColor: Colors.transparent, + builder: (context) { + return StatefulBuilder(builder: (context1, state) { + return Container( + alignment: Alignment.topCenter, + width: double.infinity, + decoration: BoxDecoration( + color: Color(0xFFFAFAFA), + borderRadius: BorderRadius.only( + topLeft: Radius.circular(8), topRight: Radius.circular(8)), + ), + child: Stack( + children: [ + Container( + padding: EdgeInsets.only(top: 16, left: 16, right: 16), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "已选商品", + style: TextStyle( + color: Colors.black, + fontSize: 14.sp, + fontWeight: MyFontWeight.medium, + ), + ), + InkWell( + onTap: () {}, + child: Image.asset( + "assets/image/delete.png", + width: 22, + height: 22, + ), + ), + ], + ), + SizedBox(height: 24.h), + Expanded( + child: Container( + child: ListView.builder( + itemCount: 10, + shrinkWrap: true, + // physics:NeverScrollableScrollPhysics(), + itemBuilder: (context, position) { + return shoppGoodsItem(); + }), + ), + ) + ], + ), + ), + Positioned( + bottom: 0, + left: 0, + right: 0, + child: Stack( + alignment: Alignment.bottomLeft, + children: [ + Container( + height: 54.h, + color: Color(0xFFFAFAFA), + child: Row( + // mainAxisAlignment: MainAxisAlignment.end, + // crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Spacer(), + Text( + S.of(context).heji, + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Colors.black, + ), + ), + Text( + "¥19.00", + style: TextStyle( + fontSize: 20.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFF32A060), + ), + ), + Spacer(), + RoundButton( + width: 103.w, + height: 54.h, + text: S.current.jiesuan, + textColor: Colors.white, + fontWeight: MyFontWeight.regular, + backgroup: Color(0xFF32A060), + fontSize: 16.sp, + padding: EdgeInsets.symmetric(vertical: 5.h), + ) + ], + ), + ), + Stack( + children: [ + InkWell( + onTap: () { + setState(() { + Navigator.of(context).pop(); + }); + }, + child: Image.asset( + "assets/image/shop.png", + width: 88, + height: 88, + ), + ), + Positioned( + right: 15, + top: 14, + child: RoundButton( + width: 17, + height: 17, + text: "1", + textColor: Colors.white, + fontWeight: MyFontWeight.regular, + backgroup: Color(0xFF32A060), + fontSize: 12.sp, + radius: 100, + // padding: EdgeInsets.symmetric(vertical: 5.h), + ), + ) + ], + ), + ], + ), + ) + ], + ), + ); + }); + }, + ); + } + + Widget shoppGoodsItem() { + return Container( + padding: EdgeInsets.only(bottom: 10), + child: Row( + children: [ + Image.asset( + "assets/image/default_1.png", + width: 60, + height: 60, + fit: BoxFit.cover, + ), + SizedBox(width: 10), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "手工啵啵奶茶", + style: TextStyle( + color: Colors.black, + fontSize: 12.sp, + fontWeight: MyFontWeight.medium, + ), + ), + SizedBox(height: 2), + Row( + children: [ + Text( + "无香精", + style: TextStyle( + color: Color(0xFF4C4C4C), + fontSize: 11.sp, + fontWeight: MyFontWeight.regular, + ), + ), + SizedBox(width: 10), + Text( + "无香精", + style: TextStyle( + color: Color(0xFF4C4C4C), + fontSize: 11.sp, + fontWeight: MyFontWeight.regular, + ), + ) + ], + ), + SizedBox(height: 6), + Row( + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Text( + "会员价", + style: TextStyle( + color: Color(0xFFFF7A1A), + fontSize: 13.sp, + fontWeight: MyFontWeight.medium, + ), + ), + Text( + "¥19.00", + style: TextStyle( + color: Color(0xFFFF7A1A), + fontSize: 14.sp, + fontWeight: MyFontWeight.medium, + ), + ) + ], + ), + ], + ), + Spacer(), + InkWell( + onTap: () {}, + child: Image.asset( + "assets/image/reduce.png", + width: 22, + height: 22, + ), + ), + Padding( + padding: EdgeInsets.only(left: 8, right: 8), + child: Text( + "1", + style: TextStyle( + color: Colors.black, + fontSize: 14.sp, + fontWeight: MyFontWeight.medium, + ), + ), + ), + InkWell( + onTap: () {}, + child: Image.asset( + "assets/image/add.png", + width: 22, + height: 22, + ), + ), + ], + ), + ], + ), + ) + ], + ), + ); + } +} diff --git a/lib/union/union_view/union_coupon.dart b/lib/union/union_view/union_coupon.dart index 3b5f5b31..55c9f7be 100644 --- a/lib/union/union_view/union_coupon.dart +++ b/lib/union/union_view/union_coupon.dart @@ -1,3 +1,7 @@ + + + + import 'package:flutter/material.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/store_info.dart'; @@ -60,8 +64,7 @@ class _UnionCoupon extends State { return Container( height: 109.h, child: ListView.builder( - itemCount: - (widget.storeInfo != null && widget.storeInfo.couponVOList != null) + itemCount: (widget.storeInfo != null && widget.storeInfo.couponVOList != null) ? widget.storeInfo.couponVOList.length : 0, physics: BouncingScrollPhysics(parent: PageScrollPhysics()), @@ -98,8 +101,7 @@ class _UnionCoupon extends State { text: (widget.storeInfo != null && widget.storeInfo.couponVOList != null && widget.storeInfo.couponVOList[position] - .bizType == - 1) + .bizType == 1) ? "¥" : "", style: TextStyle( diff --git a/lib/union/union_view/vip.dart b/lib/union/union_view/vip.dart index 485d2005..1b408321 100644 --- a/lib/union/union_view/vip.dart +++ b/lib/union/union_view/vip.dart @@ -1,6 +1,3 @@ - - - import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:huixiang/generated/l10n.dart'; @@ -9,27 +6,23 @@ import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/view_widget/round_button.dart'; class Vip extends StatefulWidget { - final StoreInfo storeInfo; final Function receiveVip; final bool isReceive; + Vip(this.storeInfo, this.receiveVip, this.isReceive); @override State createState() { return _Vip(); } - } class _Vip extends State { - @override Widget build(BuildContext context) { return Container( - margin: EdgeInsets.symmetric( - vertical: (widget.storeInfo != null && widget.storeInfo.isVip) ? 12.h : 20.h, - horizontal: 16.w), + margin: EdgeInsets.symmetric(vertical: 2.h, horizontal: 16.w), padding: EdgeInsets.all(16), decoration: BoxDecoration( image: DecorationImage( @@ -39,132 +32,134 @@ class _Vip extends State { ), child: (widget.storeInfo != null && widget.storeInfo.isVip) ? Column( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - mainAxisSize: MainAxisSize.max, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.baseline, - textBaseline: TextBaseline.alphabetic, - children: [ - Text( - S.of(context).huiyuanyue, - style: TextStyle( - fontSize: 16.sp, - fontWeight: MyFontWeight.medium, - color: Colors.white, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisSize: MainAxisSize.max, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.baseline, + textBaseline: TextBaseline.alphabetic, + children: [ + Text( + S.of(context).huiyuanyue, + style: TextStyle( + fontSize: 16.sp, + fontWeight: MyFontWeight.medium, + color: Colors.white, + ), + ), + SizedBox( + width: 8.w, + ), + Text( + "¥${(widget.storeInfo != null && widget.storeInfo.memberSource != null) ? widget.storeInfo.memberSource.balance : ""}", + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.medium, + color: Colors.white, + ), + ), + ], ), - ), - SizedBox( - width: 8.w, - ), - Text( - "¥${(widget.storeInfo != null && widget.storeInfo.memberSource != null) ? widget.storeInfo.memberSource.balance : ""}", - style: TextStyle( - fontSize: 14.sp, - fontWeight: MyFontWeight.medium, + Container( color: Colors.white, + width: 1.w, + height: 20.h, ), - ), - ], - ), - Container( - color: Colors.white, - width: 1.w, - height: 20.h, - ), - Row( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.baseline, - textBaseline: TextBaseline.alphabetic, - children: [ - Text( - S.of(context).huiyuanjifen, - style: TextStyle( - fontSize: 16.sp, - fontWeight: MyFontWeight.medium, - color: Colors.white, + Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.baseline, + textBaseline: TextBaseline.alphabetic, + children: [ + Text( + S.of(context).huiyuanjifen, + style: TextStyle( + fontSize: 16.sp, + fontWeight: MyFontWeight.medium, + color: Colors.white, + ), + ), + SizedBox( + width: 8.w, + ), + Text( + (widget.storeInfo != null && + widget.storeInfo.memberSource != null) + ? "${widget.storeInfo.memberSource.integral}" + : "", + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.medium, + color: Colors.white, + ), + ), + ], ), - ), - SizedBox( - width: 8.w, - ), - Text( - (widget.storeInfo != null && widget.storeInfo.memberSource != null) - ? "${widget.storeInfo.memberSource.integral}" - : "", - style: TextStyle( - fontSize: 14.sp, - fontWeight: MyFontWeight.medium, - color: Colors.white, - ), - ), - ], - ), - ], - ), - SizedBox( - height: 10.h, - ), - Text( - S.of(context).gongxinichengweibendianhuiyuan, - style: TextStyle( - fontSize: 10.sp, - fontWeight: MyFontWeight.medium, - color: Color(0xFFEDC98E), - ), - ) - ], - ) - : Row( - children: [ - Expanded( - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Image.asset( - "assets/image/icon_vip.png", - width: 36.w, - height: 20.h, + ], ), SizedBox( - height: 2.h, + height: 10.h, ), Text( - S.of(context).chengweidianpuzhuanshuhuiyuan, + S.of(context).gongxinichengweibendianhuiyuan, style: TextStyle( fontSize: 10.sp, - color: Color(0xCFFFFFFF), - fontWeight: MyFontWeight.semi_bold, + fontWeight: MyFontWeight.medium, + color: Color(0xFFEDC98E), + ), + ) + ], + ) + : Row( + children: [ + Expanded( + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Image.asset( + "assets/image/icon_vip.png", + width: 36.w, + height: 20.h, + ), + SizedBox( + height: 2.h, + ), + Text( + S.of(context).chengweidianpuzhuanshuhuiyuan, + style: TextStyle( + fontSize: 10.sp, + color: Color(0xCFFFFFFF), + fontWeight: MyFontWeight.semi_bold, + ), + ), + ], + ), + flex: 1, + ), + InkWell( + onTap: () { + widget.receiveVip(); + }, + child: RoundButton( + text: widget.isReceive + ? S.of(context).dianwolingqu + : S.of(context).yilingqu, + textColor: + widget.isReceive ? Colors.white : Color(0xFF484D66), + backgroup: + widget.isReceive ? Color(0xFF242B45) : Colors.white, + padding: + EdgeInsets.symmetric(vertical: 5.h, horizontal: 16.w), + radius: 14, ), ), ], ), - flex: 1, - ), - InkWell( - onTap: () { - widget.receiveVip(); - }, - child: RoundButton( - text: widget.isReceive - ? S.of(context).dianwolingqu - : S.of(context).yilingqu, - textColor: widget.isReceive ? Colors.white : Color(0xFF484D66), - backgroup: widget.isReceive ? Color(0xFF242B45) : Colors.white, - padding: - EdgeInsets.symmetric(vertical: 5.h, horizontal: 16.w), - radius: 14, - ), - ), - ], - ), ); } - -} \ No newline at end of file +} diff --git a/lib/view_widget/sign_in_widget.dart b/lib/view_widget/sign_in_widget.dart index 9bc19e8a..2d88fe30 100644 --- a/lib/view_widget/sign_in_widget.dart +++ b/lib/view_widget/sign_in_widget.dart @@ -68,28 +68,28 @@ class _SignInWidget extends State { fontWeight: MyFontWeight.regular, ), ), - Row( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Image.asset( - "assets/image/icon_gold_coin.png", - width: 16, - height: 16, + Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Image.asset( + "assets/image/icon_gold_coin.png", + width: 16, + height: 16, + ), + SizedBox( + width: 4.h, + ), + Text( + S.of(context).jiajifen(widget.integral), + style: TextStyle( + color: Color(0xFFEE9905), + fontSize: 14.sp, + fontWeight: MyFontWeight.semi_bold, ), - SizedBox( - width: 4.h, - ), - Text( - S.of(context).jiajifen(widget.integral), - style: TextStyle( - color: Color(0xFFEE9905), - fontSize: 14.sp, - fontWeight: MyFontWeight.semi_bold, - ), - ), - ], - ), + ), + ], + ), // Text( // S.of(context).jiajifen(widget.integral), // style: TextStyle( diff --git a/lib/web/web_view/comment_list.dart b/lib/web/web_view/comment_list.dart index 41b543ac..4f438915 100644 --- a/lib/web/web_view/comment_list.dart +++ b/lib/web/web_view/comment_list.dart @@ -214,6 +214,7 @@ class _CommentList extends State { Dio(), context: context, token: sharedPreferences.getString("token"), + showLoading: false, ); BaseData> baseData = await apiService.memberCommentList({ "pageNum": 1,