diff --git a/assets/image/2x/my_trading.webp b/assets/image/2x/my_trading.webp new file mode 100644 index 00000000..7240a438 Binary files /dev/null and b/assets/image/2x/my_trading.webp differ diff --git a/assets/image/2x/trading_detail.webp b/assets/image/2x/trading_detail.webp new file mode 100644 index 00000000..91afce70 Binary files /dev/null and b/assets/image/2x/trading_detail.webp differ diff --git a/assets/image/2x/trading_history.webp b/assets/image/2x/trading_history.webp new file mode 100644 index 00000000..f00a188b Binary files /dev/null and b/assets/image/2x/trading_history.webp differ diff --git a/assets/image/2x/trading_logo.webp b/assets/image/2x/trading_logo.webp new file mode 100644 index 00000000..f961a524 Binary files /dev/null and b/assets/image/2x/trading_logo.webp differ diff --git a/assets/image/2x/trading_text.webp b/assets/image/2x/trading_text.webp new file mode 100644 index 00000000..9dfcb0d8 Binary files /dev/null and b/assets/image/2x/trading_text.webp differ diff --git a/assets/image/2x/vip_cz.webp b/assets/image/2x/vip_cz.webp new file mode 100644 index 00000000..38dd9d09 Binary files /dev/null and b/assets/image/2x/vip_cz.webp differ diff --git a/assets/image/2x/welfare_yz.webp b/assets/image/2x/welfare_yz.webp new file mode 100644 index 00000000..8a01148f Binary files /dev/null and b/assets/image/2x/welfare_yz.webp differ diff --git a/assets/image/3x/my_trading.webp b/assets/image/3x/my_trading.webp new file mode 100644 index 00000000..f3342502 Binary files /dev/null and b/assets/image/3x/my_trading.webp differ diff --git a/assets/image/3x/trading_detail.webp b/assets/image/3x/trading_detail.webp new file mode 100644 index 00000000..71935eae Binary files /dev/null and b/assets/image/3x/trading_detail.webp differ diff --git a/assets/image/3x/trading_history.webp b/assets/image/3x/trading_history.webp new file mode 100644 index 00000000..8687b821 Binary files /dev/null and b/assets/image/3x/trading_history.webp differ diff --git a/assets/image/3x/trading_logo.webp b/assets/image/3x/trading_logo.webp new file mode 100644 index 00000000..b75ee79a Binary files /dev/null and b/assets/image/3x/trading_logo.webp differ diff --git a/assets/image/3x/trading_text.webp b/assets/image/3x/trading_text.webp new file mode 100644 index 00000000..455dd3bc Binary files /dev/null and b/assets/image/3x/trading_text.webp differ diff --git a/assets/image/3x/vip_cz.webp b/assets/image/3x/vip_cz.webp new file mode 100644 index 00000000..9816e2a0 Binary files /dev/null and b/assets/image/3x/vip_cz.webp differ diff --git a/assets/image/3x/welfare_yz.webp b/assets/image/3x/welfare_yz.webp new file mode 100644 index 00000000..314fa564 Binary files /dev/null and b/assets/image/3x/welfare_yz.webp differ diff --git a/assets/image/my_trading.webp b/assets/image/my_trading.webp new file mode 100644 index 00000000..50f22266 Binary files /dev/null and b/assets/image/my_trading.webp differ diff --git a/assets/image/trading_detail.webp b/assets/image/trading_detail.webp new file mode 100644 index 00000000..a2d8e4e7 Binary files /dev/null and b/assets/image/trading_detail.webp differ diff --git a/assets/image/trading_history.webp b/assets/image/trading_history.webp new file mode 100644 index 00000000..60be2592 Binary files /dev/null and b/assets/image/trading_history.webp differ diff --git a/assets/image/trading_logo.webp b/assets/image/trading_logo.webp new file mode 100644 index 00000000..cb06d3ac Binary files /dev/null and b/assets/image/trading_logo.webp differ diff --git a/assets/image/trading_text.webp b/assets/image/trading_text.webp new file mode 100644 index 00000000..2dff605d Binary files /dev/null and b/assets/image/trading_text.webp differ diff --git a/assets/image/vip_cz.webp b/assets/image/vip_cz.webp new file mode 100644 index 00000000..52daeb87 Binary files /dev/null and b/assets/image/vip_cz.webp differ diff --git a/assets/image/welfare_yz.webp b/assets/image/welfare_yz.webp new file mode 100644 index 00000000..0cf94b3a Binary files /dev/null and b/assets/image/welfare_yz.webp differ diff --git a/lib/community/community_child_page.dart b/lib/community/community_child_page.dart index 6982bc7a..07155e72 100644 --- a/lib/community/community_child_page.dart +++ b/lib/community/community_child_page.dart @@ -17,6 +17,7 @@ import 'package:shared_preferences/shared_preferences.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import '../utils/flutter_utils.dart'; +import '../utils/font_weight.dart'; class CommunityChildPage extends StatefulWidget { final String typeStr; @@ -43,12 +44,18 @@ class CommunityChildPageState extends State bool isLoadingData = false; ScrollController sc = ScrollController(); List
articles = []; + int _currentIndex = 0; @override void initState() { super.initState(); sc.addListener(() { widget.onScroll(); + if (sc.offset >= 500) { + _currentIndex =1; + }else if(sc.offset <= 500){ + _currentIndex = 0; + } }); onRefresh(); } @@ -196,9 +203,11 @@ class CommunityChildPageState extends State userId: userId, isList: true, exitFull: () { - setState(() { - onRefresh(); - }); + // setState(() { + // onRefresh(); + // }); + + queryCommunity(articles[position].id); }, ), onTap: () { @@ -209,10 +218,11 @@ class CommunityChildPageState extends State "userId": userId, }, ).then((value) { - onRefresh(); - setState(() {}); + // onRefresh(); + // setState(() {}); + queryCommunity(articles[position].id); }); - setState(() {}); + // setState(() {}); }, ); @@ -232,7 +242,38 @@ class CommunityChildPageState extends State height: 55, ), ), - ) + ), + if(_currentIndex == 1) + GestureDetector( + onTap: () { + sc.jumpTo(0); + setState(() {}); + }, + child: Container( + margin: EdgeInsets.only(bottom:120.h, right: 14.w), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(100), + color: Colors.white, + ), + height:48, + width: 48, + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Icon(Icons.arrow_upward,size: 16,color: Color(0xFF808080),), + Text( + "顶部", + textAlign: TextAlign.center, + style: TextStyle( + color: Color(0xFF808080), + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + ), + ), + ], + ), + ), + ), ], ); }, diff --git a/lib/community/community_details.dart b/lib/community/community_details.dart index 2d4ce3fd..e4cacff3 100644 --- a/lib/community/community_details.dart +++ b/lib/community/community_details.dart @@ -2,6 +2,7 @@ import 'dart:ui'; import 'package:dio/dio.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/community/community_view/community_dynamic.dart'; import 'package:huixiang/generated/l10n.dart'; @@ -15,8 +16,12 @@ import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:huixiang/view_widget/tips_dialog.dart'; import 'package:huixiang/web/web_view/comment_list.dart'; import 'package:huixiang/web/web_view/input_comment.dart'; +import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:shared_preferences/shared_preferences.dart'; +import '../view_widget/classic_header.dart'; +import '../view_widget/my_footer.dart'; + class CommunityDetails extends StatefulWidget { final Map arguments; @@ -54,6 +59,7 @@ class _CommunityDetails extends State double keyboard = -1; bool needShowSmiley = false; bool needHideSmiley = false; + final RefreshController refreshController = RefreshController(); void didChangeMetrics() { WidgetsBinding.instance.addPostFrameCallback((_) { @@ -94,11 +100,21 @@ class _CommunityDetails extends State void initState() { super.initState(); // comunity = widget.arguments["comment"]; + EasyLoading.show(status: S.current.zhengzaijiazai); businessId = widget.arguments["businessId"]; WidgetsBinding.instance.addObserver(this); commentFocus.addListener(_focusNodeListener); - - _queryMemberCommentList(); + scrollController.addListener(() { + //滚动监听,键盘如果弹起,滚动时收起 + if(MediaQuery.of(context).viewInsets.bottom > 0) + FocusScope.of(context).requestFocus(FocusNode()); + if(needShowSmiley && window.viewInsets.bottom > 0.1) + needHideSmiley = false; + setState(() { + emojiShowing = false; + }); + }); + _queryMemberCommentList(true); queryDetails(businessId); } @@ -130,9 +146,10 @@ class _CommunityDetails extends State @override void dispose(){ + super.dispose(); WidgetsBinding.instance.removeObserver(this); commentFocus.removeListener(_focusNodeListener); - super.dispose(); + refreshController.dispose(); } ///详情接口 @@ -147,14 +164,24 @@ class _CommunityDetails extends State BaseData
baseData = await apiService.informationInfo(id).catchError((onError) { debugPrint(onError.toString()); + refreshController.refreshFailed(); }); if (baseData != null && baseData.isSuccess) { setState(() { article = baseData.data; + EasyLoading.dismiss(); + refreshController.refreshCompleted(); }); + }else { + refreshController.refreshFailed(); } } + _onRefresh() { + queryDetails(businessId); + _queryMemberCommentList(true); + } + @override Widget build(BuildContext context) { double h = MediaQuery.of(context).viewInsets.bottom; @@ -186,61 +213,81 @@ class _CommunityDetails extends State child: Column( children: [ Expanded( - child: SingleChildScrollView( - physics: BouncingScrollPhysics(), - child: Column( - children: [ - if (article != null) - CommunityDynamic( - article, - 0, - exitFull: () { - setState(() {}); - }, - userId: widget.arguments != null - ? widget.arguments["userId"] - : widget.arguments["mid"], - itemCount: 3, - isDetails: true, - heightFun: (height) { - this.height = height + - MediaQuery.of(context).padding.top + - kToolbarHeight + - 24; - if (mounted) setState(() {}); + child: SmartRefresher( + controller: refreshController, + enablePullDown: true, + enablePullUp: false, + header: MyHeader(), + footer: CustomFooter( + builder: (context, mode) { + return MyFooter(mode); + }, + ), + onRefresh: () { + setState(() { + emojiShowing = false; + isKeyBoardShow = emojiShowing; + FocusScope.of(context).requestFocus(FocusNode()); + _onRefresh(); + }); + }, + scrollController:scrollController, + child: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Column( + children: [ + if (article != null) + CommunityDynamic( + article, + 0, + exitFull: () { + setState(() {}); + }, + userId: widget.arguments != null + ? widget.arguments["userId"] + : widget.arguments["mid"], + itemCount: 3, + isDetails: true, + heightFun: (height) { + this.height = height + + MediaQuery.of(context).padding.top + + kToolbarHeight + + 24; + if (mounted) setState(() {}); + }, + ), + CommentList( + commentKey, + article?.likes ?? 0, + businessId, + 4, + isKeyBoardShow, + _reply, + _delCommentTips, + 12.sp, + requestApiFinish: (total) { + setState(() { + commentTotal = total; + }); }, ), - 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), + 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, @@ -299,7 +346,7 @@ class _CommunityDetails extends State state.queryMemberCommentList(); commentTextController.text = ""; FocusScope.of(context).unfocus(); - _queryMemberCommentList(); + _queryMemberCommentList(false); } } @@ -351,14 +398,15 @@ class _CommunityDetails extends State } ///评论列表 - _queryMemberCommentList() async { + _queryMemberCommentList(bool isOnRefresh) async { + if (!isOnRefresh) EasyLoading.show(status: S.current.zhengzaijiazai); SharedPreferences sharedPreferences = await SharedPreferences.getInstance(); if (apiService == null) apiService = ApiService( Dio(), context: context, token: sharedPreferences.getString("token"), - showLoading: true, + // showLoading: true, ); BaseData> baseData = await apiService.memberCommentList({ @@ -372,6 +420,9 @@ class _CommunityDetails extends State memberList = baseData.data.list; contentHeight(); if (mounted) setState(() {}); + EasyLoading.dismiss(); + }else { + refreshController.refreshFailed(); } } } diff --git a/lib/community/photo_view_gallery_screen.dart b/lib/community/photo_view_gallery_screen.dart index 5b301b22..1ae25e9d 100644 --- a/lib/community/photo_view_gallery_screen.dart +++ b/lib/community/photo_view_gallery_screen.dart @@ -2,6 +2,7 @@ import 'dart:io'; import 'package:flutter/material.dart'; import 'package:huixiang/utils/ImgCachePath.dart'; import 'package:network_to_file_image/network_to_file_image.dart'; +import 'package:photo_view/photo_view.dart'; import 'package:photo_view/photo_view_gallery.dart'; import 'package:path/path.dart' as p; @@ -58,6 +59,9 @@ class _PhotoViewGalleryScreenState extends State { .replaceAll("https://pos.upload.gznl.top/", "").replaceAll("/", "")), debug: true, ), + //图片的缩放级别 + maxScale: PhotoViewComputedScale.contained *2.5, + minScale: PhotoViewComputedScale.contained *1, ); }, itemCount: widget.images.length, diff --git a/lib/community/release_dynamic.dart b/lib/community/release_dynamic.dart index 5268345a..496d24e6 100644 --- a/lib/community/release_dynamic.dart +++ b/lib/community/release_dynamic.dart @@ -381,6 +381,8 @@ class _ReleaseDynamic extends State { maxLines: 5, style: TextStyle( fontSize: 14.sp, + height: 1.3, + letterSpacing:1, fontWeight: MyFontWeight.medium, color: Color(0xFF4C4C4C), ), diff --git a/lib/generated/intl/messages_en.dart b/lib/generated/intl/messages_en.dart index 4c5041a4..7d2968d0 100644 --- a/lib/generated/intl/messages_en.dart +++ b/lib/generated/intl/messages_en.dart @@ -81,31 +81,33 @@ class MessageLookup extends MessageLookupByLibrary { static m30(jifen) => "实付积分 ${jifen}积分"; - static m31(sui) => "${sui}岁"; + static m31(jihuanka) => "实付集换卡 ${jihuanka}集换卡"; - static m32(num) => "完成${num}"; + static m32(sui) => "${sui}岁"; - static m33(time) => "下单时间:${time}"; + static m33(num) => "完成${num}"; - static m34(xihuan) => "喜欢(${xihuan})"; + static m34(time) => "下单时间:${time}"; - static m35(shoujihao) => "邀请人手机号:${shoujihao}"; + static m35(xihuan) => "喜欢(${xihuan})"; - static m36(jian) => "已兑换${jian}件"; + static m36(shoujihao) => "邀请人手机号:${shoujihao}"; - static m37(time) => "营业时间: ${time}"; + static m37(jian) => "已兑换${jian}件"; - static m38(date) => "有效期:${date}"; + static m38(time) => "营业时间: ${time}"; - static m39(date) => "有效期至${date}"; + static m39(date) => "有效期:${date}"; - static m40(yuan) => "${yuan}元"; + static m40(date) => "有效期至${date}"; - static m41(yue) => "余额${yue}"; + static m41(yuan) => "${yuan}元"; - static m42(yue) => "余额 ${yue}"; + static m42(yue) => "余额${yue}"; - static m43(zuozhe) => "作者:${zuozhe}"; + static m43(yue) => "余额 ${yue}"; + + static m44(zuozhe) => "作者:${zuozhe}"; final messages = _notInlinedMessages(_notInlinedMessages); static _notInlinedMessages(_) => { @@ -114,6 +116,7 @@ class MessageLookup extends MessageLookupByLibrary { "baiyinhuiyuan" : MessageLookupByLibrary.simpleMessage("白银会员"), "banben" : m0, "bangdingfuka" : MessageLookupByLibrary.simpleMessage("绑定副卡"), + "bangdingshouji" : MessageLookupByLibrary.simpleMessage("绑定手机"), "bangong" : MessageLookupByLibrary.simpleMessage("办公"), "bangzhuyufankui" : MessageLookupByLibrary.simpleMessage("帮助与反馈"), "baocun" : MessageLookupByLibrary.simpleMessage("保存"), @@ -257,6 +260,7 @@ class MessageLookup extends MessageLookupByLibrary { "gengduo" : MessageLookupByLibrary.simpleMessage("更多"), "gengduohaoquan" : MessageLookupByLibrary.simpleMessage("更多好券"), "gengduoyouhuiquan" : MessageLookupByLibrary.simpleMessage("更多优惠券"), + "genggaibangdingshoujihao" : MessageLookupByLibrary.simpleMessage("更改绑定手机号"), "genghuanbeijing" : MessageLookupByLibrary.simpleMessage("更换背景"), "genghuantouxiang" : MessageLookupByLibrary.simpleMessage("更换头像"), "gengyouhui" : MessageLookupByLibrary.simpleMessage("更优惠"), @@ -346,6 +350,7 @@ class MessageLookup extends MessageLookupByLibrary { "jifenmingxi" : MessageLookupByLibrary.simpleMessage("积分明细"), "jifenshangcheng" : MessageLookupByLibrary.simpleMessage("积分商城"), "jifenxiangqing" : MessageLookupByLibrary.simpleMessage("积分详情"), + "jihuanka" : MessageLookupByLibrary.simpleMessage("集换卡"), "jingbilianmenghuiyuandian" : MessageLookupByLibrary.simpleMessage("净弼联盟会员店"), "jingxuanhaowen" : MessageLookupByLibrary.simpleMessage("精选好文"), "jingxuanhuodong" : MessageLookupByLibrary.simpleMessage("精选活动"), @@ -569,6 +574,7 @@ class MessageLookup extends MessageLookupByLibrary { "shifangjiazaigengduo" : MessageLookupByLibrary.simpleMessage("释放加载更多"), "shifangshuaxin" : MessageLookupByLibrary.simpleMessage("释放刷新"), "shifujifen" : m30, + "shifujihuanka" : m31, "shimingrenzheng" : MessageLookupByLibrary.simpleMessage("实名认证"), "shixiaoquan" : MessageLookupByLibrary.simpleMessage("失效券"), "shixiaoyouhuiquan" : MessageLookupByLibrary.simpleMessage("失效优惠券"), @@ -595,7 +601,7 @@ class MessageLookup extends MessageLookupByLibrary { "shuliang" : MessageLookupByLibrary.simpleMessage("数量"), "shurushouhuorendizhi" : MessageLookupByLibrary.simpleMessage("请输入收货人地址"), "shuruzhifumima" : MessageLookupByLibrary.simpleMessage("输入支付密码"), - "sui" : m31, + "sui" : m32, "tangshi" : MessageLookupByLibrary.simpleMessage("堂食"), "tebieshengming" : MessageLookupByLibrary.simpleMessage("特别声明"), "tehuizhuanqu" : MessageLookupByLibrary.simpleMessage("特惠专区"), @@ -621,7 +627,7 @@ class MessageLookup extends MessageLookupByLibrary { "waisong" : MessageLookupByLibrary.simpleMessage("外送"), "wan" : MessageLookupByLibrary.simpleMessage("玩"), "wancheng" : MessageLookupByLibrary.simpleMessage("完成"), - "wancheng_" : m32, + "wancheng_" : m33, "wanchengyicixiadan" : MessageLookupByLibrary.simpleMessage("完成一次下单"), "wangjimima" : MessageLookupByLibrary.simpleMessage("忘记密码"), "wanjiankang" : MessageLookupByLibrary.simpleMessage("玩健康"), @@ -665,7 +671,7 @@ class MessageLookup extends MessageLookupByLibrary { "wuliuxinxi" : MessageLookupByLibrary.simpleMessage("物流信息"), "wuliuzhuangtai" : MessageLookupByLibrary.simpleMessage("物流状态:"), "xiadanshijian" : MessageLookupByLibrary.simpleMessage("下单时间"), - "xiadanshijian_" : m33, + "xiadanshijian_" : m34, "xiadanzhuanjifen" : MessageLookupByLibrary.simpleMessage("下单赚积分"), "xialashuaxin" : MessageLookupByLibrary.simpleMessage("下拉刷新"), "xiangce" : MessageLookupByLibrary.simpleMessage("相册"), @@ -678,17 +684,19 @@ class MessageLookup extends MessageLookupByLibrary { "xianxiashiyong" : MessageLookupByLibrary.simpleMessage("线下使用"), "xiaofei" : MessageLookupByLibrary.simpleMessage("消费"), "xiaofeijifen" : MessageLookupByLibrary.simpleMessage("消费积分"), + "xiaofeijihuanka" : MessageLookupByLibrary.simpleMessage("消费集换卡"), "xiaofeijilu" : MessageLookupByLibrary.simpleMessage("消费记录"), "xiaoxi" : MessageLookupByLibrary.simpleMessage("消息"), "xiayidengji" : MessageLookupByLibrary.simpleMessage("下一等级"), "xiazaiwancheng" : MessageLookupByLibrary.simpleMessage("加载完成"), "xiedongtai" : MessageLookupByLibrary.simpleMessage("写动态"), "xieyitanchuang" : MessageLookupByLibrary.simpleMessage("一心回乡用户隐私政策"), - "xihuan_" : m34, + "xihuan_" : m35, "xindianhuodong" : MessageLookupByLibrary.simpleMessage("星店活动"), "xingming" : MessageLookupByLibrary.simpleMessage("姓名"), "xitongtongzhi" : MessageLookupByLibrary.simpleMessage("系统通知"), "xitongxiaoxi" : MessageLookupByLibrary.simpleMessage("系统消息"), + "xiugai" : MessageLookupByLibrary.simpleMessage("修改"), "xiugaichenggong" : MessageLookupByLibrary.simpleMessage("修改成功"), "xiugaiyonghuming" : MessageLookupByLibrary.simpleMessage("修改用户名"), "xuanguige" : MessageLookupByLibrary.simpleMessage("选规格"), @@ -703,11 +711,11 @@ class MessageLookup extends MessageLookupByLibrary { "yanzhengma" : MessageLookupByLibrary.simpleMessage("验证码"), "yaoqinghaoyou" : MessageLookupByLibrary.simpleMessage("邀请好友"), "yaoqinghaoyoudefen" : MessageLookupByLibrary.simpleMessage("邀请好友得分"), - "yaoqingrenshoujihao_" : m35, + "yaoqingrenshoujihao_" : m36, "yaoqingwancheng" : MessageLookupByLibrary.simpleMessage("邀请完成"), "yibangfuka" : MessageLookupByLibrary.simpleMessage("已绑副卡"), "yiduihuan" : MessageLookupByLibrary.simpleMessage("已兑换"), - "yiduihuanjian" : m36, + "yiduihuanjian" : m37, "yifahuo" : MessageLookupByLibrary.simpleMessage("已发货"), "yiguanzhu" : MessageLookupByLibrary.simpleMessage("已关注"), "yihouzaishuo" : MessageLookupByLibrary.simpleMessage("以后再说"), @@ -725,7 +733,7 @@ class MessageLookup extends MessageLookupByLibrary { "yindaoye3" : MessageLookupByLibrary.simpleMessage("会员活动专区"), "yindaoye4" : MessageLookupByLibrary.simpleMessage("过健康有机生活"), "yingwen" : MessageLookupByLibrary.simpleMessage("英文"), - "yingyeshijian" : m37, + "yingyeshijian" : m38, "yinkahuiyuan" : MessageLookupByLibrary.simpleMessage("银卡会员"), "yinshi" : MessageLookupByLibrary.simpleMessage("饮食"), "yinsishengming" : MessageLookupByLibrary.simpleMessage("隐私声明"), @@ -755,15 +763,15 @@ class MessageLookup extends MessageLookupByLibrary { "youhuiquanlingqu" : MessageLookupByLibrary.simpleMessage("优惠券领取"), "youhuiquanwufajileijifen" : MessageLookupByLibrary.simpleMessage("优惠金额无法累积积分,订单撤销或其他原因造成的未成功支付的订单,无法获得对应的积分。"), "youkedenglu" : MessageLookupByLibrary.simpleMessage("游客登录"), - "youxiaoqi" : m38, + "youxiaoqi" : m39, "youxiaoqixian" : MessageLookupByLibrary.simpleMessage("有效期限:"), - "youxiaoqizhi" : m39, + "youxiaoqizhi" : m40, "yuan" : MessageLookupByLibrary.simpleMessage("元"), - "yuan_" : m40, + "yuan_" : m41, "yuanjia" : MessageLookupByLibrary.simpleMessage("原价"), "yue" : MessageLookupByLibrary.simpleMessage("余额"), - "yue_" : m41, - "yue__" : m42, + "yue_" : m42, + "yue__" : m43, "yuemingxi" : MessageLookupByLibrary.simpleMessage("余额明细"), "yuliudianhua" : MessageLookupByLibrary.simpleMessage("预留电话"), "yunfei" : MessageLookupByLibrary.simpleMessage("运费"), @@ -814,6 +822,6 @@ class MessageLookup extends MessageLookupByLibrary { "zuanshihuiyuan" : MessageLookupByLibrary.simpleMessage("钻石会员"), "zuixinwenzhang" : MessageLookupByLibrary.simpleMessage("最新文章"), "zuorenwudejifen" : MessageLookupByLibrary.simpleMessage("做任务得积分"), - "zuozhe" : m43 + "zuozhe" : m44 }; } diff --git a/lib/generated/intl/messages_en_US.dart b/lib/generated/intl/messages_en_US.dart index fbe012ad..c0f7c5af 100644 --- a/lib/generated/intl/messages_en_US.dart +++ b/lib/generated/intl/messages_en_US.dart @@ -81,31 +81,33 @@ class MessageLookup extends MessageLookupByLibrary { static m30(jifen) => "Paid in integral ${jifen}integral"; - static m31(sui) => "${sui}years old"; + static m31(jihuanka) => "paid-in trading card ${jihuanka}trading card"; - static m32(num) => "Finish${num}"; + static m32(sui) => "${sui}years old"; - static m33(time) => "Ordering time:${time}"; + static m33(num) => "Finish${num}"; - static m34(xihuan) => "Like(${xihuan})"; + static m34(time) => "Ordering time:${time}"; - static m35(shoujihao) => "Inviter\'s mobile number:${shoujihao}"; + static m35(xihuan) => "Like(${xihuan})"; - static m36(jian) => "${jian}pieces redeemed"; + static m36(shoujihao) => "Inviter\'s mobile number:${shoujihao}"; - static m37(time) => "Business hours: ${time}"; + static m37(jian) => "${jian}pieces redeemed"; - static m38(date) => "Validity:${date}"; + static m38(time) => "Business hours: ${time}"; - static m39(date) => "Valid until ${date}"; + static m39(date) => "Validity:${date}"; - static m40(yuan) => "${yuan}yuan"; + static m40(date) => "Valid until ${date}"; - static m41(yue) => "Balance ${yue}"; + static m41(yuan) => "${yuan}yuan"; static m42(yue) => "Balance ${yue}"; - static m43(zuozhe) => "Author:${zuozhe}"; + static m43(yue) => "Balance ${yue}"; + + static m44(zuozhe) => "Author:${zuozhe}"; final messages = _notInlinedMessages(_notInlinedMessages); static _notInlinedMessages(_) => { @@ -114,6 +116,7 @@ class MessageLookup extends MessageLookupByLibrary { "baiyinhuiyuan" : MessageLookupByLibrary.simpleMessage("Silver Member"), "banben" : m0, "bangdingfuka" : MessageLookupByLibrary.simpleMessage("binding sub card"), + "bangdingshouji" : MessageLookupByLibrary.simpleMessage("bind phone"), "bangong" : MessageLookupByLibrary.simpleMessage("Office"), "bangzhuyufankui" : MessageLookupByLibrary.simpleMessage("Help"), "baocun" : MessageLookupByLibrary.simpleMessage("Save"), @@ -257,6 +260,7 @@ class MessageLookup extends MessageLookupByLibrary { "gengduo" : MessageLookupByLibrary.simpleMessage("more"), "gengduohaoquan" : MessageLookupByLibrary.simpleMessage("more good coupons"), "gengduoyouhuiquan" : MessageLookupByLibrary.simpleMessage("more coupons"), + "genggaibangdingshoujihao" : MessageLookupByLibrary.simpleMessage("modify bind phone"), "genghuanbeijing" : MessageLookupByLibrary.simpleMessage("Changing the background"), "genghuantouxiang" : MessageLookupByLibrary.simpleMessage("Changing the avatar"), "gengyouhui" : MessageLookupByLibrary.simpleMessage("More preferential"), @@ -346,6 +350,7 @@ class MessageLookup extends MessageLookupByLibrary { "jifenmingxi" : MessageLookupByLibrary.simpleMessage("Integral Details"), "jifenshangcheng" : MessageLookupByLibrary.simpleMessage("Points Mall"), "jifenxiangqing" : MessageLookupByLibrary.simpleMessage("Points Details"), + "jihuanka" : MessageLookupByLibrary.simpleMessage("trading card"), "jingbilianmenghuiyuandian" : MessageLookupByLibrary.simpleMessage("Jingbi League Member Store"), "jingxuanhaowen" : MessageLookupByLibrary.simpleMessage("Selected good articles "), "jingxuanhuodong" : MessageLookupByLibrary.simpleMessage("Selected Activities"), @@ -455,7 +460,7 @@ class MessageLookup extends MessageLookupByLibrary { "pinglun" : MessageLookupByLibrary.simpleMessage("Comment"), "pinglun_" : m23, "pingtaiyue" : MessageLookupByLibrary.simpleMessage("Platform Balance"), - "pingtaizhifumima" : MessageLookupByLibrary.simpleMessage("Platform Payment Password"), + "pingtaizhifumima" : MessageLookupByLibrary.simpleMessage("Platform payment password"), "pingtaizongyue" : m24, "pinpai" : MessageLookupByLibrary.simpleMessage("brand"), "pinpaijieshao" : MessageLookupByLibrary.simpleMessage("Brand Introduction"), @@ -569,6 +574,7 @@ class MessageLookup extends MessageLookupByLibrary { "shifangjiazaigengduo" : MessageLookupByLibrary.simpleMessage("Release Load More"), "shifangshuaxin" : MessageLookupByLibrary.simpleMessage("Release Refresh"), "shifujifen" : m30, + "shifujihuanka" : m31, "shimingrenzheng" : MessageLookupByLibrary.simpleMessage("Real name authentication"), "shixiaoquan" : MessageLookupByLibrary.simpleMessage("Invalid coupon"), "shixiaoyouhuiquan" : MessageLookupByLibrary.simpleMessage("Invalid coupon"), @@ -595,7 +601,7 @@ class MessageLookup extends MessageLookupByLibrary { "shuliang" : MessageLookupByLibrary.simpleMessage("number"), "shurushouhuorendizhi" : MessageLookupByLibrary.simpleMessage("Please enter the consignee address"), "shuruzhifumima" : MessageLookupByLibrary.simpleMessage("Enter payment password"), - "sui" : m31, + "sui" : m32, "tangshi" : MessageLookupByLibrary.simpleMessage("tang shi"), "tebieshengming" : MessageLookupByLibrary.simpleMessage("Special statement"), "tehuizhuanqu" : MessageLookupByLibrary.simpleMessage("Special offer area"), @@ -621,7 +627,7 @@ class MessageLookup extends MessageLookupByLibrary { "waisong" : MessageLookupByLibrary.simpleMessage("sending out"), "wan" : MessageLookupByLibrary.simpleMessage("Play"), "wancheng" : MessageLookupByLibrary.simpleMessage("finish"), - "wancheng_" : m32, + "wancheng_" : m33, "wanchengyicixiadan" : MessageLookupByLibrary.simpleMessage("Place an order once"), "wangjimima" : MessageLookupByLibrary.simpleMessage("Forgot password"), "wanjiankang" : MessageLookupByLibrary.simpleMessage("Play healthy"), @@ -665,7 +671,7 @@ class MessageLookup extends MessageLookupByLibrary { "wuliuxinxi" : MessageLookupByLibrary.simpleMessage("Logistics Information"), "wuliuzhuangtai" : MessageLookupByLibrary.simpleMessage("Logistics status:"), "xiadanshijian" : MessageLookupByLibrary.simpleMessage("Order placement time"), - "xiadanshijian_" : m33, + "xiadanshijian_" : m34, "xiadanzhuanjifen" : MessageLookupByLibrary.simpleMessage("Place orders integral"), "xialashuaxin" : MessageLookupByLibrary.simpleMessage("Pull down Refresh"), "xiangce" : MessageLookupByLibrary.simpleMessage("album"), @@ -678,17 +684,19 @@ class MessageLookup extends MessageLookupByLibrary { "xianxiashiyong" : MessageLookupByLibrary.simpleMessage("offline use"), "xiaofei" : MessageLookupByLibrary.simpleMessage("consumption"), "xiaofeijifen" : MessageLookupByLibrary.simpleMessage("Consumption Points"), + "xiaofeijihuanka" : MessageLookupByLibrary.simpleMessage("consume trading card"), "xiaofeijilu" : MessageLookupByLibrary.simpleMessage("Consumption Record"), "xiaoxi" : MessageLookupByLibrary.simpleMessage("Messages"), "xiayidengji" : MessageLookupByLibrary.simpleMessage("Next Level"), "xiazaiwancheng" : MessageLookupByLibrary.simpleMessage("Loading completed"), "xiedongtai" : MessageLookupByLibrary.simpleMessage("Write dynamic"), "xieyitanchuang" : MessageLookupByLibrary.simpleMessage("privacy policy for returning home users"), - "xihuan_" : m34, + "xihuan_" : m35, "xindianhuodong" : MessageLookupByLibrary.simpleMessage("Star Store Activity"), "xingming" : MessageLookupByLibrary.simpleMessage("name"), "xitongtongzhi" : MessageLookupByLibrary.simpleMessage("System Notification"), "xitongxiaoxi" : MessageLookupByLibrary.simpleMessage("System Messages"), + "xiugai" : MessageLookupByLibrary.simpleMessage("modify"), "xiugaichenggong" : MessageLookupByLibrary.simpleMessage("Modification succeeded"), "xiugaiyonghuming" : MessageLookupByLibrary.simpleMessage("Modify User Name"), "xuanguige" : MessageLookupByLibrary.simpleMessage("Select specs"), @@ -703,11 +711,11 @@ class MessageLookup extends MessageLookupByLibrary { "yanzhengma" : MessageLookupByLibrary.simpleMessage("verification code"), "yaoqinghaoyou" : MessageLookupByLibrary.simpleMessage("Invite friends"), "yaoqinghaoyoudefen" : MessageLookupByLibrary.simpleMessage("Invite friends to score"), - "yaoqingrenshoujihao_" : m35, + "yaoqingrenshoujihao_" : m36, "yaoqingwancheng" : MessageLookupByLibrary.simpleMessage("Invitation completed"), "yibangfuka" : MessageLookupByLibrary.simpleMessage("bound sub card"), "yiduihuan" : MessageLookupByLibrary.simpleMessage("redeemed"), - "yiduihuanjian" : m36, + "yiduihuanjian" : m37, "yifahuo" : MessageLookupByLibrary.simpleMessage("Shipped"), "yiguanzhu" : MessageLookupByLibrary.simpleMessage("Followed"), "yihouzaishuo" : MessageLookupByLibrary.simpleMessage("Talk Later"), @@ -725,7 +733,7 @@ class MessageLookup extends MessageLookupByLibrary { "yindaoye3" : MessageLookupByLibrary.simpleMessage("Member activity zone"), "yindaoye4" : MessageLookupByLibrary.simpleMessage("Live a healthy and organic life"), "yingwen" : MessageLookupByLibrary.simpleMessage("United States"), - "yingyeshijian" : m37, + "yingyeshijian" : m38, "yinkahuiyuan" : MessageLookupByLibrary.simpleMessage("Silver card member"), "yinshi" : MessageLookupByLibrary.simpleMessage("diet"), "yinsishengming" : MessageLookupByLibrary.simpleMessage("Privacy Statement"), @@ -755,15 +763,15 @@ class MessageLookup extends MessageLookupByLibrary { "youhuiquanlingqu" : MessageLookupByLibrary.simpleMessage("coupon collection"), "youhuiquanwufajileijifen" : MessageLookupByLibrary.simpleMessage("The preferential amount cannot accumulate points, and the corresponding points cannot be obtained for orders that are not successfully paid due to order cancellation or other reasons。"), "youkedenglu" : MessageLookupByLibrary.simpleMessage("Visitor login"), - "youxiaoqi" : m38, + "youxiaoqi" : m39, "youxiaoqixian" : MessageLookupByLibrary.simpleMessage("Valid Period:"), - "youxiaoqizhi" : m39, + "youxiaoqizhi" : m40, "yuan" : MessageLookupByLibrary.simpleMessage("yuan"), - "yuan_" : m40, + "yuan_" : m41, "yuanjia" : MessageLookupByLibrary.simpleMessage("original price"), "yue" : MessageLookupByLibrary.simpleMessage("Balance"), - "yue_" : m41, - "yue__" : m42, + "yue_" : m42, + "yue__" : m43, "yuemingxi" : MessageLookupByLibrary.simpleMessage("Balance Details"), "yuliudianhua" : MessageLookupByLibrary.simpleMessage("Reserved telephone"), "yunfei" : MessageLookupByLibrary.simpleMessage("Freight"), @@ -814,6 +822,6 @@ class MessageLookup extends MessageLookupByLibrary { "zuanshihuiyuan" : MessageLookupByLibrary.simpleMessage("Diamond Member"), "zuixinwenzhang" : MessageLookupByLibrary.simpleMessage("Latest Articles"), "zuorenwudejifen" : MessageLookupByLibrary.simpleMessage("Score points for doing tasks"), - "zuozhe" : m43 + "zuozhe" : m44 }; } diff --git a/lib/generated/intl/messages_zh_CN.dart b/lib/generated/intl/messages_zh_CN.dart index 73bdfbd8..4c5a3f81 100644 --- a/lib/generated/intl/messages_zh_CN.dart +++ b/lib/generated/intl/messages_zh_CN.dart @@ -81,31 +81,33 @@ class MessageLookup extends MessageLookupByLibrary { static m30(jifen) => "实付积分 ${jifen}积分"; - static m31(sui) => "${sui}岁"; + static m31(jihuanka) => "实付集换卡 ${jihuanka}集换卡"; - static m32(num) => "完成${num}"; + static m32(sui) => "${sui}岁"; - static m33(time) => "下单时间:${time}"; + static m33(num) => "完成${num}"; - static m34(xihuan) => "喜欢(${xihuan})"; + static m34(time) => "下单时间:${time}"; - static m35(shoujihao) => "邀请人手机号:${shoujihao}"; + static m35(xihuan) => "喜欢(${xihuan})"; - static m36(jian) => "已兑换${jian}件"; + static m36(shoujihao) => "邀请人手机号:${shoujihao}"; - static m37(time) => "营业时间: ${time}"; + static m37(jian) => "已兑换${jian}件"; - static m38(date) => "有效期:${date}"; + static m38(time) => "营业时间: ${time}"; - static m39(date) => "有效期至${date}"; + static m39(date) => "有效期:${date}"; - static m40(yuan) => "${yuan}元"; + static m40(date) => "有效期至${date}"; - static m41(yue) => "余额${yue}"; + static m41(yuan) => "${yuan}元"; - static m42(yue) => "余额 ${yue}"; + static m42(yue) => "余额${yue}"; - static m43(zuozhe) => "作者:${zuozhe}"; + static m43(yue) => "余额 ${yue}"; + + static m44(zuozhe) => "作者:${zuozhe}"; final messages = _notInlinedMessages(_notInlinedMessages); static _notInlinedMessages(_) => { @@ -114,6 +116,7 @@ class MessageLookup extends MessageLookupByLibrary { "baiyinhuiyuan" : MessageLookupByLibrary.simpleMessage("白银会员"), "banben" : m0, "bangdingfuka" : MessageLookupByLibrary.simpleMessage("绑定副卡"), + "bangdingshouji" : MessageLookupByLibrary.simpleMessage("绑定手机"), "bangong" : MessageLookupByLibrary.simpleMessage("办公"), "bangzhuyufankui" : MessageLookupByLibrary.simpleMessage("帮助与反馈"), "baocun" : MessageLookupByLibrary.simpleMessage("保存"), @@ -257,6 +260,7 @@ class MessageLookup extends MessageLookupByLibrary { "gengduo" : MessageLookupByLibrary.simpleMessage("更多"), "gengduohaoquan" : MessageLookupByLibrary.simpleMessage("更多好券"), "gengduoyouhuiquan" : MessageLookupByLibrary.simpleMessage("更多优惠券"), + "genggaibangdingshoujihao" : MessageLookupByLibrary.simpleMessage("更改绑定手机号"), "genghuanbeijing" : MessageLookupByLibrary.simpleMessage("更换背景"), "genghuantouxiang" : MessageLookupByLibrary.simpleMessage("更换头像"), "gengyouhui" : MessageLookupByLibrary.simpleMessage("更优惠"), @@ -346,6 +350,7 @@ class MessageLookup extends MessageLookupByLibrary { "jifenmingxi" : MessageLookupByLibrary.simpleMessage("积分明细"), "jifenshangcheng" : MessageLookupByLibrary.simpleMessage("积分商城"), "jifenxiangqing" : MessageLookupByLibrary.simpleMessage("积分详情"), + "jihuanka" : MessageLookupByLibrary.simpleMessage("集换卡"), "jingbilianmenghuiyuandian" : MessageLookupByLibrary.simpleMessage("净弼联盟会员店"), "jingxuanhaowen" : MessageLookupByLibrary.simpleMessage("精选好文"), "jingxuanhuodong" : MessageLookupByLibrary.simpleMessage("精选活动"), @@ -569,6 +574,7 @@ class MessageLookup extends MessageLookupByLibrary { "shifangjiazaigengduo" : MessageLookupByLibrary.simpleMessage("释放加载更多"), "shifangshuaxin" : MessageLookupByLibrary.simpleMessage("释放刷新"), "shifujifen" : m30, + "shifujihuanka" : m31, "shimingrenzheng" : MessageLookupByLibrary.simpleMessage("实名认证"), "shixiaoquan" : MessageLookupByLibrary.simpleMessage("失效券"), "shixiaoyouhuiquan" : MessageLookupByLibrary.simpleMessage("失效优惠券"), @@ -595,7 +601,7 @@ class MessageLookup extends MessageLookupByLibrary { "shuliang" : MessageLookupByLibrary.simpleMessage("数量"), "shurushouhuorendizhi" : MessageLookupByLibrary.simpleMessage("请输入收货人地址"), "shuruzhifumima" : MessageLookupByLibrary.simpleMessage("输入支付密码"), - "sui" : m31, + "sui" : m32, "tangshi" : MessageLookupByLibrary.simpleMessage("堂食"), "tebieshengming" : MessageLookupByLibrary.simpleMessage("特别声明"), "tehuizhuanqu" : MessageLookupByLibrary.simpleMessage("特惠专区"), @@ -621,7 +627,7 @@ class MessageLookup extends MessageLookupByLibrary { "waisong" : MessageLookupByLibrary.simpleMessage("外送"), "wan" : MessageLookupByLibrary.simpleMessage("玩"), "wancheng" : MessageLookupByLibrary.simpleMessage("完成"), - "wancheng_" : m32, + "wancheng_" : m33, "wanchengyicixiadan" : MessageLookupByLibrary.simpleMessage("完成一次下单"), "wangjimima" : MessageLookupByLibrary.simpleMessage("忘记密码"), "wanjiankang" : MessageLookupByLibrary.simpleMessage("玩健康"), @@ -665,7 +671,7 @@ class MessageLookup extends MessageLookupByLibrary { "wuliuxinxi" : MessageLookupByLibrary.simpleMessage("物流信息"), "wuliuzhuangtai" : MessageLookupByLibrary.simpleMessage("物流状态:"), "xiadanshijian" : MessageLookupByLibrary.simpleMessage("下单时间"), - "xiadanshijian_" : m33, + "xiadanshijian_" : m34, "xiadanzhuanjifen" : MessageLookupByLibrary.simpleMessage("下单赚积分"), "xialashuaxin" : MessageLookupByLibrary.simpleMessage("下拉刷新"), "xiangce" : MessageLookupByLibrary.simpleMessage("相册"), @@ -678,17 +684,19 @@ class MessageLookup extends MessageLookupByLibrary { "xianxiashiyong" : MessageLookupByLibrary.simpleMessage("线下使用"), "xiaofei" : MessageLookupByLibrary.simpleMessage("消费"), "xiaofeijifen" : MessageLookupByLibrary.simpleMessage("消费积分"), + "xiaofeijihuanka" : MessageLookupByLibrary.simpleMessage("消费集换卡"), "xiaofeijilu" : MessageLookupByLibrary.simpleMessage("消费记录"), "xiaoxi" : MessageLookupByLibrary.simpleMessage("消息"), "xiayidengji" : MessageLookupByLibrary.simpleMessage("下一等级"), "xiazaiwancheng" : MessageLookupByLibrary.simpleMessage("加载完成"), "xiedongtai" : MessageLookupByLibrary.simpleMessage("写动态"), "xieyitanchuang" : MessageLookupByLibrary.simpleMessage("一心回乡用户隐私政策"), - "xihuan_" : m34, + "xihuan_" : m35, "xindianhuodong" : MessageLookupByLibrary.simpleMessage("星店活动"), "xingming" : MessageLookupByLibrary.simpleMessage("姓名"), "xitongtongzhi" : MessageLookupByLibrary.simpleMessage("系统通知"), "xitongxiaoxi" : MessageLookupByLibrary.simpleMessage("系统消息"), + "xiugai" : MessageLookupByLibrary.simpleMessage("修改"), "xiugaichenggong" : MessageLookupByLibrary.simpleMessage("修改成功"), "xiugaiyonghuming" : MessageLookupByLibrary.simpleMessage("修改用户名"), "xuanguige" : MessageLookupByLibrary.simpleMessage("选规格"), @@ -703,11 +711,11 @@ class MessageLookup extends MessageLookupByLibrary { "yanzhengma" : MessageLookupByLibrary.simpleMessage("验证码"), "yaoqinghaoyou" : MessageLookupByLibrary.simpleMessage("邀请好友"), "yaoqinghaoyoudefen" : MessageLookupByLibrary.simpleMessage("邀请好友得分"), - "yaoqingrenshoujihao_" : m35, + "yaoqingrenshoujihao_" : m36, "yaoqingwancheng" : MessageLookupByLibrary.simpleMessage("邀请完成"), "yibangfuka" : MessageLookupByLibrary.simpleMessage("已绑副卡"), "yiduihuan" : MessageLookupByLibrary.simpleMessage("已兑换"), - "yiduihuanjian" : m36, + "yiduihuanjian" : m37, "yifahuo" : MessageLookupByLibrary.simpleMessage("已发货"), "yiguanzhu" : MessageLookupByLibrary.simpleMessage("已关注"), "yihouzaishuo" : MessageLookupByLibrary.simpleMessage("以后再说"), @@ -725,7 +733,7 @@ class MessageLookup extends MessageLookupByLibrary { "yindaoye3" : MessageLookupByLibrary.simpleMessage("会员活动专区"), "yindaoye4" : MessageLookupByLibrary.simpleMessage("过健康有机生活"), "yingwen" : MessageLookupByLibrary.simpleMessage("英文"), - "yingyeshijian" : m37, + "yingyeshijian" : m38, "yinkahuiyuan" : MessageLookupByLibrary.simpleMessage("银卡会员"), "yinshi" : MessageLookupByLibrary.simpleMessage("饮食"), "yinsishengming" : MessageLookupByLibrary.simpleMessage("隐私声明"), @@ -755,15 +763,15 @@ class MessageLookup extends MessageLookupByLibrary { "youhuiquanlingqu" : MessageLookupByLibrary.simpleMessage("优惠券领取"), "youhuiquanwufajileijifen" : MessageLookupByLibrary.simpleMessage("优惠金额无法累积积分,订单撤销或其他原因造成的未成功支付的订单,无法获得对应的积分。"), "youkedenglu" : MessageLookupByLibrary.simpleMessage("游客登录"), - "youxiaoqi" : m38, + "youxiaoqi" : m39, "youxiaoqixian" : MessageLookupByLibrary.simpleMessage("有效期限:"), - "youxiaoqizhi" : m39, + "youxiaoqizhi" : m40, "yuan" : MessageLookupByLibrary.simpleMessage("元"), - "yuan_" : m40, + "yuan_" : m41, "yuanjia" : MessageLookupByLibrary.simpleMessage("原价"), "yue" : MessageLookupByLibrary.simpleMessage("余额"), - "yue_" : m41, - "yue__" : m42, + "yue_" : m42, + "yue__" : m43, "yuemingxi" : MessageLookupByLibrary.simpleMessage("余额明细"), "yuliudianhua" : MessageLookupByLibrary.simpleMessage("预留电话"), "yunfei" : MessageLookupByLibrary.simpleMessage("运费"), @@ -814,6 +822,6 @@ class MessageLookup extends MessageLookupByLibrary { "zuanshihuiyuan" : MessageLookupByLibrary.simpleMessage("钻石会员"), "zuixinwenzhang" : MessageLookupByLibrary.simpleMessage("最新文章"), "zuorenwudejifen" : MessageLookupByLibrary.simpleMessage("做任务得积分"), - "zuozhe" : m43 + "zuozhe" : m44 }; } diff --git a/lib/generated/intl/messages_zh_Hans_CN.dart b/lib/generated/intl/messages_zh_Hans_CN.dart index 796db711..18dd5d2c 100644 --- a/lib/generated/intl/messages_zh_Hans_CN.dart +++ b/lib/generated/intl/messages_zh_Hans_CN.dart @@ -81,31 +81,33 @@ class MessageLookup extends MessageLookupByLibrary { static m30(jifen) => "实付积分 ${jifen}积分"; - static m31(sui) => "${sui}岁"; + static m31(jihuanka) => "实付集换卡 ${jihuanka}集换卡"; - static m32(num) => "完成${num}"; + static m32(sui) => "${sui}岁"; - static m33(time) => "下单时间:${time}"; + static m33(num) => "完成${num}"; - static m34(xihuan) => "喜欢(${xihuan})"; + static m34(time) => "下单时间:${time}"; - static m35(shoujihao) => "邀请人手机号:${shoujihao}"; + static m35(xihuan) => "喜欢(${xihuan})"; - static m36(jian) => "已兑换${jian}件"; + static m36(shoujihao) => "邀请人手机号:${shoujihao}"; - static m37(time) => "营业时间: ${time}"; + static m37(jian) => "已兑换${jian}件"; - static m38(date) => "有效期:${date}"; + static m38(time) => "营业时间: ${time}"; - static m39(date) => "有效期至${date}"; + static m39(date) => "有效期:${date}"; - static m40(yuan) => "${yuan}元"; + static m40(date) => "有效期至${date}"; - static m41(yue) => "余额${yue}"; + static m41(yuan) => "${yuan}元"; - static m42(yue) => "余额 ${yue}"; + static m42(yue) => "余额${yue}"; - static m43(zuozhe) => "作者:${zuozhe}"; + static m43(yue) => "余额 ${yue}"; + + static m44(zuozhe) => "作者:${zuozhe}"; final messages = _notInlinedMessages(_notInlinedMessages); static _notInlinedMessages(_) => { @@ -114,6 +116,7 @@ class MessageLookup extends MessageLookupByLibrary { "baiyinhuiyuan" : MessageLookupByLibrary.simpleMessage("白银会员"), "banben" : m0, "bangdingfuka" : MessageLookupByLibrary.simpleMessage("绑定副卡"), + "bangdingshouji" : MessageLookupByLibrary.simpleMessage("绑定手机"), "bangong" : MessageLookupByLibrary.simpleMessage("办公"), "bangzhuyufankui" : MessageLookupByLibrary.simpleMessage("帮助与反馈"), "baocun" : MessageLookupByLibrary.simpleMessage("保存"), @@ -257,6 +260,7 @@ class MessageLookup extends MessageLookupByLibrary { "gengduo" : MessageLookupByLibrary.simpleMessage("更多"), "gengduohaoquan" : MessageLookupByLibrary.simpleMessage("更多好券"), "gengduoyouhuiquan" : MessageLookupByLibrary.simpleMessage("更多优惠券"), + "genggaibangdingshoujihao" : MessageLookupByLibrary.simpleMessage("更改绑定手机号"), "genghuanbeijing" : MessageLookupByLibrary.simpleMessage("更换背景"), "genghuantouxiang" : MessageLookupByLibrary.simpleMessage("更换头像"), "gengyouhui" : MessageLookupByLibrary.simpleMessage("更优惠"), @@ -346,6 +350,7 @@ class MessageLookup extends MessageLookupByLibrary { "jifenmingxi" : MessageLookupByLibrary.simpleMessage("积分明细"), "jifenshangcheng" : MessageLookupByLibrary.simpleMessage("积分商城"), "jifenxiangqing" : MessageLookupByLibrary.simpleMessage("积分详情"), + "jihuanka" : MessageLookupByLibrary.simpleMessage("集换卡"), "jingbilianmenghuiyuandian" : MessageLookupByLibrary.simpleMessage("净弼联盟会员店"), "jingxuanhaowen" : MessageLookupByLibrary.simpleMessage("精选好文"), "jingxuanhuodong" : MessageLookupByLibrary.simpleMessage("精选活动"), @@ -569,6 +574,7 @@ class MessageLookup extends MessageLookupByLibrary { "shifangjiazaigengduo" : MessageLookupByLibrary.simpleMessage("释放加载更多"), "shifangshuaxin" : MessageLookupByLibrary.simpleMessage("释放刷新"), "shifujifen" : m30, + "shifujihuanka" : m31, "shimingrenzheng" : MessageLookupByLibrary.simpleMessage("实名认证"), "shixiaoquan" : MessageLookupByLibrary.simpleMessage("失效券"), "shixiaoyouhuiquan" : MessageLookupByLibrary.simpleMessage("失效优惠券"), @@ -595,7 +601,7 @@ class MessageLookup extends MessageLookupByLibrary { "shuliang" : MessageLookupByLibrary.simpleMessage("数量"), "shurushouhuorendizhi" : MessageLookupByLibrary.simpleMessage("请输入收货人地址"), "shuruzhifumima" : MessageLookupByLibrary.simpleMessage("输入支付密码"), - "sui" : m31, + "sui" : m32, "tangshi" : MessageLookupByLibrary.simpleMessage("堂食"), "tebieshengming" : MessageLookupByLibrary.simpleMessage("特别声明"), "tehuizhuanqu" : MessageLookupByLibrary.simpleMessage("特惠专区"), @@ -621,7 +627,7 @@ class MessageLookup extends MessageLookupByLibrary { "waisong" : MessageLookupByLibrary.simpleMessage("外送"), "wan" : MessageLookupByLibrary.simpleMessage("玩"), "wancheng" : MessageLookupByLibrary.simpleMessage("完成"), - "wancheng_" : m32, + "wancheng_" : m33, "wanchengyicixiadan" : MessageLookupByLibrary.simpleMessage("完成一次下单"), "wangjimima" : MessageLookupByLibrary.simpleMessage("忘记密码"), "wanjiankang" : MessageLookupByLibrary.simpleMessage("玩健康"), @@ -665,7 +671,7 @@ class MessageLookup extends MessageLookupByLibrary { "wuliuxinxi" : MessageLookupByLibrary.simpleMessage("物流信息"), "wuliuzhuangtai" : MessageLookupByLibrary.simpleMessage("物流状态:"), "xiadanshijian" : MessageLookupByLibrary.simpleMessage("下单时间"), - "xiadanshijian_" : m33, + "xiadanshijian_" : m34, "xiadanzhuanjifen" : MessageLookupByLibrary.simpleMessage("下单赚积分"), "xialashuaxin" : MessageLookupByLibrary.simpleMessage("下拉刷新"), "xiangce" : MessageLookupByLibrary.simpleMessage("相册"), @@ -678,17 +684,19 @@ class MessageLookup extends MessageLookupByLibrary { "xianxiashiyong" : MessageLookupByLibrary.simpleMessage("线下使用"), "xiaofei" : MessageLookupByLibrary.simpleMessage("消费"), "xiaofeijifen" : MessageLookupByLibrary.simpleMessage("消费积分"), + "xiaofeijihuanka" : MessageLookupByLibrary.simpleMessage("消费集换卡"), "xiaofeijilu" : MessageLookupByLibrary.simpleMessage("消费记录"), "xiaoxi" : MessageLookupByLibrary.simpleMessage("消息"), "xiayidengji" : MessageLookupByLibrary.simpleMessage("下一等级"), "xiazaiwancheng" : MessageLookupByLibrary.simpleMessage("加载完成"), "xiedongtai" : MessageLookupByLibrary.simpleMessage("写动态"), "xieyitanchuang" : MessageLookupByLibrary.simpleMessage("一心回乡用户隐私政策"), - "xihuan_" : m34, + "xihuan_" : m35, "xindianhuodong" : MessageLookupByLibrary.simpleMessage("星店活动"), "xingming" : MessageLookupByLibrary.simpleMessage("姓名"), "xitongtongzhi" : MessageLookupByLibrary.simpleMessage("系统通知"), "xitongxiaoxi" : MessageLookupByLibrary.simpleMessage("系统消息"), + "xiugai" : MessageLookupByLibrary.simpleMessage("修改"), "xiugaichenggong" : MessageLookupByLibrary.simpleMessage("修改成功"), "xiugaiyonghuming" : MessageLookupByLibrary.simpleMessage("修改用户名"), "xuanguige" : MessageLookupByLibrary.simpleMessage("选规格"), @@ -703,11 +711,11 @@ class MessageLookup extends MessageLookupByLibrary { "yanzhengma" : MessageLookupByLibrary.simpleMessage("验证码"), "yaoqinghaoyou" : MessageLookupByLibrary.simpleMessage("邀请好友"), "yaoqinghaoyoudefen" : MessageLookupByLibrary.simpleMessage("邀请好友得分"), - "yaoqingrenshoujihao_" : m35, + "yaoqingrenshoujihao_" : m36, "yaoqingwancheng" : MessageLookupByLibrary.simpleMessage("邀请完成"), "yibangfuka" : MessageLookupByLibrary.simpleMessage("已绑副卡"), "yiduihuan" : MessageLookupByLibrary.simpleMessage("已兑换"), - "yiduihuanjian" : m36, + "yiduihuanjian" : m37, "yifahuo" : MessageLookupByLibrary.simpleMessage("已发货"), "yiguanzhu" : MessageLookupByLibrary.simpleMessage("已关注"), "yihouzaishuo" : MessageLookupByLibrary.simpleMessage("以后再说"), @@ -725,7 +733,7 @@ class MessageLookup extends MessageLookupByLibrary { "yindaoye3" : MessageLookupByLibrary.simpleMessage("会员活动专区"), "yindaoye4" : MessageLookupByLibrary.simpleMessage("过健康有机生活"), "yingwen" : MessageLookupByLibrary.simpleMessage("英文"), - "yingyeshijian" : m37, + "yingyeshijian" : m38, "yinkahuiyuan" : MessageLookupByLibrary.simpleMessage("银卡会员"), "yinshi" : MessageLookupByLibrary.simpleMessage("饮食"), "yinsishengming" : MessageLookupByLibrary.simpleMessage("隐私声明"), @@ -755,15 +763,15 @@ class MessageLookup extends MessageLookupByLibrary { "youhuiquanlingqu" : MessageLookupByLibrary.simpleMessage("优惠券领取"), "youhuiquanwufajileijifen" : MessageLookupByLibrary.simpleMessage("优惠金额无法累积积分,订单撤销或其他原因造成的未成功支付的订单,无法获得对应的积分。"), "youkedenglu" : MessageLookupByLibrary.simpleMessage("游客登录"), - "youxiaoqi" : m38, + "youxiaoqi" : m39, "youxiaoqixian" : MessageLookupByLibrary.simpleMessage("有效期限:"), - "youxiaoqizhi" : m39, + "youxiaoqizhi" : m40, "yuan" : MessageLookupByLibrary.simpleMessage("元"), - "yuan_" : m40, + "yuan_" : m41, "yuanjia" : MessageLookupByLibrary.simpleMessage("原价"), "yue" : MessageLookupByLibrary.simpleMessage("余额"), - "yue_" : m41, - "yue__" : m42, + "yue_" : m42, + "yue__" : m43, "yuemingxi" : MessageLookupByLibrary.simpleMessage("余额明细"), "yuliudianhua" : MessageLookupByLibrary.simpleMessage("预留电话"), "yunfei" : MessageLookupByLibrary.simpleMessage("运费"), @@ -814,6 +822,6 @@ class MessageLookup extends MessageLookupByLibrary { "zuanshihuiyuan" : MessageLookupByLibrary.simpleMessage("钻石会员"), "zuixinwenzhang" : MessageLookupByLibrary.simpleMessage("最新文章"), "zuorenwudejifen" : MessageLookupByLibrary.simpleMessage("做任务得积分"), - "zuozhe" : m43 + "zuozhe" : m44 }; } diff --git a/lib/generated/intl/messages_zh_Hant_CN.dart b/lib/generated/intl/messages_zh_Hant_CN.dart index 68b11d59..4d9a3ac2 100644 --- a/lib/generated/intl/messages_zh_Hant_CN.dart +++ b/lib/generated/intl/messages_zh_Hant_CN.dart @@ -79,31 +79,33 @@ class MessageLookup extends MessageLookupByLibrary { static m30(jifen) => "實付積分 ${jifen}積分"; - static m31(sui) => "${sui}嵗"; + static m31(jihuanka) => "實付集換卡 ${jihuanka}集換卡"; - static m32(num) => "完成${num}"; + static m32(sui) => "${sui}嵗"; - static m33(time) => "下單時間:${time}"; + static m33(num) => "完成${num}"; - static m34(xihuan) => "喜歡(${xihuan})"; + static m34(time) => "下單時間:${time}"; - static m35(shoujihao) => "邀请人手機號:${shoujihao}"; + static m35(xihuan) => "喜歡(${xihuan})"; - static m36(jian) => "已兌換${jian}件"; + static m36(shoujihao) => "邀请人手機號:${shoujihao}"; - static m37(time) => "營業時間: ${time}"; + static m37(jian) => "已兌換${jian}件"; - static m38(date) => "有效期:${date}"; + static m38(time) => "營業時間: ${time}"; - static m39(date) => "有效期至${date}"; + static m39(date) => "有效期:${date}"; - static m40(yuan) => "${yuan}元"; + static m40(date) => "有效期至${date}"; - static m41(yue) => "餘額${yue}"; + static m41(yuan) => "${yuan}元"; - static m42(yue) => "餘額 ${yue}"; + static m42(yue) => "餘額${yue}"; - static m43(zuozhe) => "作者:${zuozhe}"; + static m43(yue) => "餘額 ${yue}"; + + static m44(zuozhe) => "作者:${zuozhe}"; final messages = _notInlinedMessages(_notInlinedMessages); static _notInlinedMessages(_) => { @@ -112,6 +114,7 @@ class MessageLookup extends MessageLookupByLibrary { "baiyinhuiyuan" : MessageLookupByLibrary.simpleMessage("白銀會員"), "banben" : m0, "bangdingfuka" : MessageLookupByLibrary.simpleMessage("綁定副卡"), + "bangdingshouji" : MessageLookupByLibrary.simpleMessage("綁定手機"), "bangong" : MessageLookupByLibrary.simpleMessage("辦公"), "bangzhuyufankui" : MessageLookupByLibrary.simpleMessage("幫助與反饋"), "baocun" : MessageLookupByLibrary.simpleMessage("保存"), @@ -253,6 +256,7 @@ class MessageLookup extends MessageLookupByLibrary { "gengduo" : MessageLookupByLibrary.simpleMessage("更多"), "gengduohaoquan" : MessageLookupByLibrary.simpleMessage("更多好券"), "gengduoyouhuiquan" : MessageLookupByLibrary.simpleMessage("更多優惠券"), + "genggaibangdingshoujihao" : MessageLookupByLibrary.simpleMessage("更改綁定手機號"), "genghuanbeijing" : MessageLookupByLibrary.simpleMessage("更換背景"), "genghuantouxiang" : MessageLookupByLibrary.simpleMessage("更换头像"), "gengyouhui" : MessageLookupByLibrary.simpleMessage("更優惠"), @@ -342,6 +346,7 @@ class MessageLookup extends MessageLookupByLibrary { "jifenmingxi" : MessageLookupByLibrary.simpleMessage("積分明細"), "jifenshangcheng" : MessageLookupByLibrary.simpleMessage("積分商城"), "jifenxiangqing" : MessageLookupByLibrary.simpleMessage("積分詳情"), + "jihuanka" : MessageLookupByLibrary.simpleMessage("集換卡"), "jingbilianmenghuiyuandian" : MessageLookupByLibrary.simpleMessage("淨弼聯盟會員店"), "jingxuanhaowen" : MessageLookupByLibrary.simpleMessage("精選好文"), "jingxuanhuodong" : MessageLookupByLibrary.simpleMessage("精選活動"), @@ -564,6 +569,7 @@ class MessageLookup extends MessageLookupByLibrary { "shifangjiazaigengduo" : MessageLookupByLibrary.simpleMessage("釋放加載更多"), "shifangshuaxin" : MessageLookupByLibrary.simpleMessage("釋放刷新"), "shifujifen" : m30, + "shifujihuanka" : m31, "shimingrenzheng" : MessageLookupByLibrary.simpleMessage("實名認證"), "shixiaoquan" : MessageLookupByLibrary.simpleMessage("失效券"), "shixiaoyouhuiquan" : MessageLookupByLibrary.simpleMessage("失效优惠券"), @@ -589,7 +595,7 @@ class MessageLookup extends MessageLookupByLibrary { "shuliang" : MessageLookupByLibrary.simpleMessage("數量"), "shurushouhuorendizhi" : MessageLookupByLibrary.simpleMessage("請輸入收貨人地址"), "shuruzhifumima" : MessageLookupByLibrary.simpleMessage("輸入支付密碼"), - "sui" : m31, + "sui" : m32, "tangshi" : MessageLookupByLibrary.simpleMessage("堂食"), "tebieshengming" : MessageLookupByLibrary.simpleMessage("特別聲明"), "tehuizhuanqu" : MessageLookupByLibrary.simpleMessage("特惠專區"), @@ -615,7 +621,7 @@ class MessageLookup extends MessageLookupByLibrary { "waisong" : MessageLookupByLibrary.simpleMessage("外送"), "wan" : MessageLookupByLibrary.simpleMessage("玩"), "wancheng" : MessageLookupByLibrary.simpleMessage("完成"), - "wancheng_" : m32, + "wancheng_" : m33, "wanchengyicixiadan" : MessageLookupByLibrary.simpleMessage("完成一次下單"), "wangjimima" : MessageLookupByLibrary.simpleMessage("忘記密碼"), "wanjiankang" : MessageLookupByLibrary.simpleMessage("玩健康"), @@ -659,7 +665,7 @@ class MessageLookup extends MessageLookupByLibrary { "wuliuxinxi" : MessageLookupByLibrary.simpleMessage("物流信息"), "wuliuzhuangtai" : MessageLookupByLibrary.simpleMessage("物流狀態:"), "xiadanshijian" : MessageLookupByLibrary.simpleMessage("下單時間"), - "xiadanshijian_" : m33, + "xiadanshijian_" : m34, "xiadanzhuanjifen" : MessageLookupByLibrary.simpleMessage("下單賺積分"), "xialashuaxin" : MessageLookupByLibrary.simpleMessage("下拉刷新"), "xiangce" : MessageLookupByLibrary.simpleMessage("相冊"), @@ -672,17 +678,19 @@ class MessageLookup extends MessageLookupByLibrary { "xianxiashiyong" : MessageLookupByLibrary.simpleMessage("線下使用"), "xiaofei" : MessageLookupByLibrary.simpleMessage("消費"), "xiaofeijifen" : MessageLookupByLibrary.simpleMessage("消费积分"), + "xiaofeijihuanka" : MessageLookupByLibrary.simpleMessage("消費集換卡"), "xiaofeijilu" : MessageLookupByLibrary.simpleMessage("消費記錄"), "xiaoxi" : MessageLookupByLibrary.simpleMessage("消息"), "xiayidengji" : MessageLookupByLibrary.simpleMessage("下一等級"), "xiazaiwancheng" : MessageLookupByLibrary.simpleMessage("加載完成"), "xiedongtai" : MessageLookupByLibrary.simpleMessage("寫動態"), "xieyitanchuang" : MessageLookupByLibrary.simpleMessage("一心回鄉用戶隱私協議"), - "xihuan_" : m34, + "xihuan_" : m35, "xindianhuodong" : MessageLookupByLibrary.simpleMessage("星店活動"), "xingming" : MessageLookupByLibrary.simpleMessage("姓名"), "xitongtongzhi" : MessageLookupByLibrary.simpleMessage("系統通知"), "xitongxiaoxi" : MessageLookupByLibrary.simpleMessage("系統消息"), + "xiugai" : MessageLookupByLibrary.simpleMessage("修改"), "xiugaichenggong" : MessageLookupByLibrary.simpleMessage("修改成功"), "xiugaiyonghuming" : MessageLookupByLibrary.simpleMessage("修改用戶名"), "xuanguige" : MessageLookupByLibrary.simpleMessage("選規格"), @@ -697,11 +705,11 @@ class MessageLookup extends MessageLookupByLibrary { "yanzhengma" : MessageLookupByLibrary.simpleMessage("驗證碼"), "yaoqinghaoyou" : MessageLookupByLibrary.simpleMessage("邀請好友"), "yaoqinghaoyoudefen" : MessageLookupByLibrary.simpleMessage("邀請好友得分"), - "yaoqingrenshoujihao_" : m35, + "yaoqingrenshoujihao_" : m36, "yaoqingwancheng" : MessageLookupByLibrary.simpleMessage("邀請完成"), "yibangfuka" : MessageLookupByLibrary.simpleMessage("已綁副卡"), "yiduihuan" : MessageLookupByLibrary.simpleMessage("已兌換"), - "yiduihuanjian" : m36, + "yiduihuanjian" : m37, "yifahuo" : MessageLookupByLibrary.simpleMessage("已發貨"), "yiguanzhu" : MessageLookupByLibrary.simpleMessage("已關注"), "yihouzaishuo" : MessageLookupByLibrary.simpleMessage("以後再說"), @@ -719,7 +727,7 @@ class MessageLookup extends MessageLookupByLibrary { "yindaoye3" : MessageLookupByLibrary.simpleMessage("會員活動專區"), "yindaoye4" : MessageLookupByLibrary.simpleMessage("過健康有機生活"), "yingwen" : MessageLookupByLibrary.simpleMessage("英文"), - "yingyeshijian" : m37, + "yingyeshijian" : m38, "yinkahuiyuan" : MessageLookupByLibrary.simpleMessage("银卡会员"), "yinshi" : MessageLookupByLibrary.simpleMessage("飲食"), "yinsishengming" : MessageLookupByLibrary.simpleMessage("隱私聲明"), @@ -749,15 +757,15 @@ class MessageLookup extends MessageLookupByLibrary { "youhuiquanlingqu" : MessageLookupByLibrary.simpleMessage("優惠券領取"), "youhuiquanwufajileijifen" : MessageLookupByLibrary.simpleMessage("優惠金額無法累積積分,訂單撤銷或其他原因造成的未成功支付的訂單,無法獲得對應的積分。"), "youkedenglu" : MessageLookupByLibrary.simpleMessage("遊客登錄"), - "youxiaoqi" : m38, + "youxiaoqi" : m39, "youxiaoqixian" : MessageLookupByLibrary.simpleMessage("有效期限:"), - "youxiaoqizhi" : m39, + "youxiaoqizhi" : m40, "yuan" : MessageLookupByLibrary.simpleMessage("元"), - "yuan_" : m40, + "yuan_" : m41, "yuanjia" : MessageLookupByLibrary.simpleMessage("原價"), "yue" : MessageLookupByLibrary.simpleMessage("餘額"), - "yue_" : m41, - "yue__" : m42, + "yue_" : m42, + "yue__" : m43, "yuemingxi" : MessageLookupByLibrary.simpleMessage("餘額明細"), "yuliudianhua" : MessageLookupByLibrary.simpleMessage("預留電話"), "yunfei" : MessageLookupByLibrary.simpleMessage("運費"), @@ -808,6 +816,6 @@ class MessageLookup extends MessageLookupByLibrary { "zuanshihuiyuan" : MessageLookupByLibrary.simpleMessage("鑽石會員"), "zuixinwenzhang" : MessageLookupByLibrary.simpleMessage("最新文章"), "zuorenwudejifen" : MessageLookupByLibrary.simpleMessage("做任務得積分"), - "zuozhe" : m43 + "zuozhe" : m44 }; } diff --git a/lib/generated/intl/messages_zh_TW.dart b/lib/generated/intl/messages_zh_TW.dart index 7456c2e0..ab37c6d0 100644 --- a/lib/generated/intl/messages_zh_TW.dart +++ b/lib/generated/intl/messages_zh_TW.dart @@ -79,31 +79,33 @@ class MessageLookup extends MessageLookupByLibrary { static m30(jifen) => "實付積分 ${jifen}積分"; - static m31(sui) => "${sui}嵗"; + static m31(jihuanka) => "實付集換卡 ${jihuanka}集換卡"; - static m32(num) => "完成${num}"; + static m32(sui) => "${sui}嵗"; - static m33(time) => "下單時間:${time}"; + static m33(num) => "完成${num}"; - static m34(xihuan) => "喜歡(${xihuan})"; + static m34(time) => "下單時間:${time}"; - static m35(shoujihao) => "邀请人手機號:${shoujihao}"; + static m35(xihuan) => "喜歡(${xihuan})"; - static m36(jian) => "已兌換${jian}件"; + static m36(shoujihao) => "邀请人手機號:${shoujihao}"; - static m37(time) => "營業時間: ${time}"; + static m37(jian) => "已兌換${jian}件"; - static m38(date) => "有效期:${date}"; + static m38(time) => "營業時間: ${time}"; - static m39(date) => "有效期至${date}"; + static m39(date) => "有效期:${date}"; - static m40(yuan) => "${yuan}元"; + static m40(date) => "有效期至${date}"; - static m41(yue) => "餘額${yue}"; + static m41(yuan) => "${yuan}元"; - static m42(yue) => "餘額 ${yue}"; + static m42(yue) => "餘額${yue}"; - static m43(zuozhe) => "作者:${zuozhe}"; + static m43(yue) => "餘額 ${yue}"; + + static m44(zuozhe) => "作者:${zuozhe}"; final messages = _notInlinedMessages(_notInlinedMessages); static _notInlinedMessages(_) => { @@ -112,6 +114,7 @@ class MessageLookup extends MessageLookupByLibrary { "baiyinhuiyuan" : MessageLookupByLibrary.simpleMessage("白銀會員"), "banben" : m0, "bangdingfuka" : MessageLookupByLibrary.simpleMessage("綁定副卡"), + "bangdingshouji" : MessageLookupByLibrary.simpleMessage("綁定手機"), "bangong" : MessageLookupByLibrary.simpleMessage("辦公"), "bangzhuyufankui" : MessageLookupByLibrary.simpleMessage("幫助與反饋"), "baocun" : MessageLookupByLibrary.simpleMessage("保存"), @@ -255,6 +258,7 @@ class MessageLookup extends MessageLookupByLibrary { "gengduo" : MessageLookupByLibrary.simpleMessage("更多"), "gengduohaoquan" : MessageLookupByLibrary.simpleMessage("更多好券"), "gengduoyouhuiquan" : MessageLookupByLibrary.simpleMessage("更多優惠券"), + "genggaibangdingshoujihao" : MessageLookupByLibrary.simpleMessage("更改綁定手機號"), "genghuanbeijing" : MessageLookupByLibrary.simpleMessage("更換背景"), "genghuantouxiang" : MessageLookupByLibrary.simpleMessage("更換頭像"), "gengyouhui" : MessageLookupByLibrary.simpleMessage("更優惠"), @@ -344,6 +348,7 @@ class MessageLookup extends MessageLookupByLibrary { "jifenmingxi" : MessageLookupByLibrary.simpleMessage("積分明細"), "jifenshangcheng" : MessageLookupByLibrary.simpleMessage("積分商城"), "jifenxiangqing" : MessageLookupByLibrary.simpleMessage("積分詳情"), + "jihuanka" : MessageLookupByLibrary.simpleMessage("集換卡"), "jingbilianmenghuiyuandian" : MessageLookupByLibrary.simpleMessage("淨弼聯盟會員店"), "jingxuanhaowen" : MessageLookupByLibrary.simpleMessage("精選好文"), "jingxuanhuodong" : MessageLookupByLibrary.simpleMessage("精選活動"), @@ -566,6 +571,7 @@ class MessageLookup extends MessageLookupByLibrary { "shifangjiazaigengduo" : MessageLookupByLibrary.simpleMessage("釋放加載更多"), "shifangshuaxin" : MessageLookupByLibrary.simpleMessage("釋放刷新"), "shifujifen" : m30, + "shifujihuanka" : m31, "shimingrenzheng" : MessageLookupByLibrary.simpleMessage("實名認證"), "shixiaoquan" : MessageLookupByLibrary.simpleMessage("失效券"), "shixiaoyouhuiquan" : MessageLookupByLibrary.simpleMessage("失效优惠券"), @@ -592,7 +598,7 @@ class MessageLookup extends MessageLookupByLibrary { "shuliang" : MessageLookupByLibrary.simpleMessage("數量"), "shurushouhuorendizhi" : MessageLookupByLibrary.simpleMessage("請輸入收貨人地址"), "shuruzhifumima" : MessageLookupByLibrary.simpleMessage("輸入支付密碼"), - "sui" : m31, + "sui" : m32, "tangshi" : MessageLookupByLibrary.simpleMessage("堂食"), "tebieshengming" : MessageLookupByLibrary.simpleMessage("特別聲明"), "tehuizhuanqu" : MessageLookupByLibrary.simpleMessage("特惠專區"), @@ -618,7 +624,7 @@ class MessageLookup extends MessageLookupByLibrary { "waisong" : MessageLookupByLibrary.simpleMessage("外送"), "wan" : MessageLookupByLibrary.simpleMessage("玩"), "wancheng" : MessageLookupByLibrary.simpleMessage("完成"), - "wancheng_" : m32, + "wancheng_" : m33, "wanchengyicixiadan" : MessageLookupByLibrary.simpleMessage("完成一次下單"), "wangjimima" : MessageLookupByLibrary.simpleMessage("忘記密碼"), "wanjiankang" : MessageLookupByLibrary.simpleMessage("玩健康"), @@ -662,7 +668,7 @@ class MessageLookup extends MessageLookupByLibrary { "wuliuxinxi" : MessageLookupByLibrary.simpleMessage("物流信息"), "wuliuzhuangtai" : MessageLookupByLibrary.simpleMessage("物流狀態:"), "xiadanshijian" : MessageLookupByLibrary.simpleMessage("下單時間"), - "xiadanshijian_" : m33, + "xiadanshijian_" : m34, "xiadanzhuanjifen" : MessageLookupByLibrary.simpleMessage("下單賺積分"), "xialashuaxin" : MessageLookupByLibrary.simpleMessage("下拉刷新"), "xiangce" : MessageLookupByLibrary.simpleMessage("相冊"), @@ -675,17 +681,19 @@ class MessageLookup extends MessageLookupByLibrary { "xianxiashiyong" : MessageLookupByLibrary.simpleMessage("線下使用"), "xiaofei" : MessageLookupByLibrary.simpleMessage("消費"), "xiaofeijifen" : MessageLookupByLibrary.simpleMessage("消费积分"), + "xiaofeijihuanka" : MessageLookupByLibrary.simpleMessage("消費集換卡"), "xiaofeijilu" : MessageLookupByLibrary.simpleMessage("消費記錄"), "xiaoxi" : MessageLookupByLibrary.simpleMessage("消息"), "xiayidengji" : MessageLookupByLibrary.simpleMessage("下一等級"), "xiazaiwancheng" : MessageLookupByLibrary.simpleMessage("加載完成"), "xiedongtai" : MessageLookupByLibrary.simpleMessage("寫動態"), "xieyitanchuang" : MessageLookupByLibrary.simpleMessage("一心回鄉用戶隱私協議"), - "xihuan_" : m34, + "xihuan_" : m35, "xindianhuodong" : MessageLookupByLibrary.simpleMessage("星店活動"), "xingming" : MessageLookupByLibrary.simpleMessage("姓名"), "xitongtongzhi" : MessageLookupByLibrary.simpleMessage("系統通知"), "xitongxiaoxi" : MessageLookupByLibrary.simpleMessage("系統消息"), + "xiugai" : MessageLookupByLibrary.simpleMessage("修改"), "xiugaichenggong" : MessageLookupByLibrary.simpleMessage("修改成功"), "xiugaiyonghuming" : MessageLookupByLibrary.simpleMessage("修改用戶名"), "xuanguige" : MessageLookupByLibrary.simpleMessage("選規格"), @@ -700,11 +708,11 @@ class MessageLookup extends MessageLookupByLibrary { "yanzhengma" : MessageLookupByLibrary.simpleMessage("驗證碼"), "yaoqinghaoyou" : MessageLookupByLibrary.simpleMessage("邀請好友"), "yaoqinghaoyoudefen" : MessageLookupByLibrary.simpleMessage("邀請好友得分"), - "yaoqingrenshoujihao_" : m35, + "yaoqingrenshoujihao_" : m36, "yaoqingwancheng" : MessageLookupByLibrary.simpleMessage("邀請完成"), "yibangfuka" : MessageLookupByLibrary.simpleMessage("已綁副卡"), "yiduihuan" : MessageLookupByLibrary.simpleMessage("已兌換"), - "yiduihuanjian" : m36, + "yiduihuanjian" : m37, "yifahuo" : MessageLookupByLibrary.simpleMessage("已發貨"), "yiguanzhu" : MessageLookupByLibrary.simpleMessage("已關注"), "yihouzaishuo" : MessageLookupByLibrary.simpleMessage("以後再說"), @@ -722,7 +730,7 @@ class MessageLookup extends MessageLookupByLibrary { "yindaoye3" : MessageLookupByLibrary.simpleMessage("會員活動專區"), "yindaoye4" : MessageLookupByLibrary.simpleMessage("過健康有機生活"), "yingwen" : MessageLookupByLibrary.simpleMessage("英文"), - "yingyeshijian" : m37, + "yingyeshijian" : m38, "yinkahuiyuan" : MessageLookupByLibrary.simpleMessage("银卡会员"), "yinshi" : MessageLookupByLibrary.simpleMessage("飲食"), "yinsishengming" : MessageLookupByLibrary.simpleMessage("隱私聲明"), @@ -752,15 +760,15 @@ class MessageLookup extends MessageLookupByLibrary { "youhuiquanlingqu" : MessageLookupByLibrary.simpleMessage("優惠券領取"), "youhuiquanwufajileijifen" : MessageLookupByLibrary.simpleMessage("優惠金額無法累積積分,訂單撤銷或其他原因造成的未成功支付的訂單,無法獲得對應的積分。"), "youkedenglu" : MessageLookupByLibrary.simpleMessage("遊客登錄"), - "youxiaoqi" : m38, + "youxiaoqi" : m39, "youxiaoqixian" : MessageLookupByLibrary.simpleMessage("有效期限:"), - "youxiaoqizhi" : m39, + "youxiaoqizhi" : m40, "yuan" : MessageLookupByLibrary.simpleMessage("元"), - "yuan_" : m40, + "yuan_" : m41, "yuanjia" : MessageLookupByLibrary.simpleMessage("原價"), "yue" : MessageLookupByLibrary.simpleMessage("餘額"), - "yue_" : m41, - "yue__" : m42, + "yue_" : m42, + "yue__" : m43, "yuemingxi" : MessageLookupByLibrary.simpleMessage("餘額明細"), "yuliudianhua" : MessageLookupByLibrary.simpleMessage("預留電話"), "yunfei" : MessageLookupByLibrary.simpleMessage("運費"), @@ -811,6 +819,6 @@ class MessageLookup extends MessageLookupByLibrary { "zuanshihuiyuan" : MessageLookupByLibrary.simpleMessage("鑽石會員"), "zuixinwenzhang" : MessageLookupByLibrary.simpleMessage("最新文章"), "zuorenwudejifen" : MessageLookupByLibrary.simpleMessage("做任務得積分"), - "zuozhe" : m43 + "zuozhe" : m44 }; } diff --git a/lib/generated/l10n.dart b/lib/generated/l10n.dart index 0567a9c1..c670ed50 100644 --- a/lib/generated/l10n.dart +++ b/lib/generated/l10n.dart @@ -7085,6 +7085,66 @@ class S { ); } + /// `实付集换卡 {jihuanka}集换卡` + String shifujihuanka(Object jihuanka) { + return Intl.message( + '实付集换卡 $jihuanka集换卡', + name: 'shifujihuanka', + desc: '', + args: [jihuanka], + ); + } + + /// `集换卡` + String get jihuanka { + return Intl.message( + '集换卡', + name: 'jihuanka', + desc: '', + args: [], + ); + } + + /// `消费集换卡` + String get xiaofeijihuanka { + return Intl.message( + '消费集换卡', + name: 'xiaofeijihuanka', + desc: '', + args: [], + ); + } + + /// `修改` + String get xiugai { + return Intl.message( + '修改', + name: 'xiugai', + desc: '', + args: [], + ); + } + + /// `绑定手机` + String get bangdingshouji { + return Intl.message( + '绑定手机', + name: 'bangdingshouji', + desc: '', + args: [], + ); + } + + /// `更改绑定手机号` + String get genggaibangdingshoujihao { + return Intl.message( + '更改绑定手机号', + name: 'genggaibangdingshoujihao', + desc: '', + args: [], + ); + } + /// `并使用本机号码登录` String get privacy_policy4 { return Intl.message( diff --git a/lib/home/home_page.dart b/lib/home/home_page.dart index e93687b5..d5a996c4 100644 --- a/lib/home/home_page.dart +++ b/lib/home/home_page.dart @@ -602,26 +602,55 @@ class HomePageState extends State with AutomaticKeepAliveClientMixin { Widget spread(){ return Container( width: double.infinity, - height: 80.h, - margin: EdgeInsets.symmetric(horizontal: 14.w), - child: GestureDetector( - onTap: (){ - Navigator.of(context).pushNamed('/router/invite_friends'); - // Navigator.of(context).pushNamed('/router/mine_greenery'); - }, - child: ClipRRect( - child:Image.asset( - "assets/image/welfare_spread.webp", - width:double.infinity, - fit: BoxFit.fill, - height:double.infinity, + height: 85.h, + child: Swiper( + pagination: SwiperPagination( + alignment: Alignment.bottomCenter, + margin: EdgeInsets.only(top: 5.h), + builder: DotSwiperPaginationBuilder( + size: 8.w, + activeSize: 8.w, + space: 5.w, + activeColor: Colors.white, + color: Colors.white.withAlpha(76), ), - borderRadius: BorderRadius.circular(6.w), ), + autoplay:true, + duration: 1000, + autoplayDelay: 2000, + itemBuilder: (context, position) { + return GestureDetector( + onTap: (){ + if(position == 0){ + Navigator.of(context).pushNamed('/router/invite_friends'); + }else if(position == 1){ + Navigator.of(context).pushNamed('/router/trading_card_page'); + } + }, + child:Container( + margin: EdgeInsets.symmetric(horizontal:14.w), + child: ClipRRect( + child:Image.asset( + spreadItem[position], + width:double.infinity, + fit: BoxFit.fill, + height:double.infinity, + ), + borderRadius: BorderRadius.circular(6.w), + ), + ), + ); + }, + itemCount:2, ), ); } + final List spreadItem = [ + "assets/image/welfare_spread.webp", + "assets/image/welfare_yz.webp", + ]; + ///扫码 toScan() async { if (await Permission.camera.isPermanentlyDenied) { diff --git a/lib/home/points_mall_view/points_goods_view.dart b/lib/home/points_mall_view/points_goods_view.dart index 18ae03d2..bd09122d 100644 --- a/lib/home/points_mall_view/points_goods_view.dart +++ b/lib/home/points_mall_view/points_goods_view.dart @@ -22,6 +22,9 @@ class PointGoods extends StatefulWidget { class _PointGoods extends State { String pointPrice(Goods goods) { if (goods == null) return ""; + if (goods?.oneBean != null && goods?.oneBean != "0") { + return "${goods?.oneBean}集换卡"; + } if (goods?.onePrice != null && goods?.onePrice != "0") { return S.of(context).jifen_(goods?.onePrice); } else if ((goods?.onePrice == null || goods?.onePrice == "0") && diff --git a/lib/home/trading_card_page.dart b/lib/home/trading_card_page.dart new file mode 100644 index 00000000..e6778fb9 --- /dev/null +++ b/lib/home/trading_card_page.dart @@ -0,0 +1,322 @@ +import 'dart:convert'; + +import 'package:dio/dio.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; +import 'package:huixiang/retrofit/data/base_data.dart'; +import 'package:huixiang/retrofit/retrofit_api.dart'; +import 'package:huixiang/utils/font_weight.dart'; +import 'package:huixiang/view_widget/my_appbar.dart'; +import 'package:pull_to_refresh/pull_to_refresh.dart'; +import 'package:shared_preferences/shared_preferences.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; + +import '../retrofit/data/user_info.dart'; +import '../view_widget/classic_header.dart'; +import '../view_widget/my_footer.dart'; + +class TradingCardPage extends StatefulWidget { + @override + State createState() { + return _TradingCardPage(); + } +} + +class _TradingCardPage extends State { + ApiService apiService; + final RefreshController refreshController = RefreshController(); + UserInfo userInfo; + + @override + void initState() { + super.initState(); + SharedPreferences.getInstance().then((value) { + apiService = + ApiService(Dio(), context: context, token: value.getString("token")); + queryUserBalance(); + }); + } + + @override + void dispose() { + super.dispose(); + refreshController.dispose(); + } + + ///查询会员信息 + queryUserBalance() async { + BaseData baseData = + await apiService.queryInfo().catchError((onError) { + refreshController.refreshFailed(); + refreshController.loadFailed();}); + if (baseData != null && baseData.isSuccess) { + userInfo = baseData.data; + if (mounted) setState(() {}); + refreshController.refreshCompleted(); + refreshController.loadComplete(); + }else { + SmartDialog.showToast(baseData.msg, alignment: Alignment.center); + refreshController.refreshFailed(); + refreshController.loadFailed(); + } + } + + @override + Widget build(BuildContext context) { + return Container( + color: Colors.white, + child: Stack( + children: [ + Container( + decoration: BoxDecoration( + image: DecorationImage( + fit: BoxFit.fill, + image: AssetImage("assets/image/settlement_bg.webp"), + ), + ), + width: double.infinity, + height: 306.h, + ), + Scaffold( + backgroundColor: Colors.transparent, + appBar: MyAppBar( + title: "", + titleColor: Colors.white, + background: Colors.transparent, + leadingColor: Colors.white, + brightness: Brightness.dark, + ), + body: SmartRefresher( + controller: refreshController, + enablePullDown: true, + enablePullUp: false, + header: MyHeader( + color: Colors.white, + ), + footer: CustomFooter( + builder: (context, mode) { + return MyFooter(mode); + }, + ), + onRefresh: () { + queryUserBalance(); + }, + physics: BouncingScrollPhysics(), + scrollController: ScrollController(), + child: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child:Container( + margin: EdgeInsets.symmetric(horizontal:14.w), + child:Column( + children: [ + Container( + width: double.infinity, + padding:EdgeInsets.only(top:24.h,bottom: 27.h) , + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 4), + blurRadius: 8, + spreadRadius: 8, + ) + ], + ), + child: Column( + children:[ + Image.asset( + "assets/image/my_trading.webp", + width:200.w, + fit: BoxFit.fill, + height:22.h, + ), + SizedBox(height:28.h), + Image.asset( + "assets/image/trading_logo.webp", + width:196.w, + fit: BoxFit.fill, + height:150.h, + ), + Padding(padding:EdgeInsets.only(top: 21.h,bottom: 17.h), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + "我已收集", + style: TextStyle( + color: Colors.black, + fontSize: 14.sp, + fontWeight: MyFontWeight.regular), + ), + SizedBox(width: 12.w,), + Text( + (userInfo?.happyBean ?? 0).toString(), + style: TextStyle( + color: Color(0xFF32A060), + fontSize: 18.sp, + fontWeight: MyFontWeight.regular), + ) + ], + ),), + Padding(padding:EdgeInsets.only(bottom:31.h), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Padding(padding:EdgeInsets.only(right:1.w), + child: GestureDetector( + onTap: (){ + Navigator.of(context).pushNamed('/router/welfare_exchange'); + }, + child: Text( + "兑换区逛逛", + style: TextStyle( + color: Color(0xFF32A060), + fontSize: 15.sp, + fontWeight: MyFontWeight.regular), + ), + )), + Image.asset( + "assets/image/icon_right_z.webp", + width:16, + fit: BoxFit.fill, + height:16, + color: Color(0xFF32A060), + ) + ], + ),), + Image.asset( + "assets/image/trading_text.webp", + width:314.w, + fit: BoxFit.cover, + height:98.h, + ), + ] + ), + ), + Container( + width: double.infinity, + padding:EdgeInsets.symmetric(vertical: 17.h,horizontal: 32.w) , + margin: EdgeInsets.only(top:16.h), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 4), + blurRadius: 8, + spreadRadius: 8, + ) + ], + ), + child: Row( + children: [ + Image.asset( + "assets/image/trading_history.webp", + width:16.h, + fit: BoxFit.fill, + height:16.h, + ), + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap:(){ + Navigator.of(context) + .pushNamed('/router/exchange_history_page'); + }, + child: Padding(padding:EdgeInsets.only(left: 4.w), + child: Text( + "兑换记录", + style: TextStyle( + color: Color(0xFF0D0D0D), + fontSize: 12.sp, + fontWeight: MyFontWeight.regular), + )), + ), + Spacer(), + Container( + width: 1.w, + height: 35.5.h, + margin: EdgeInsets.symmetric(), + color:Color(0xFFD8D8D8)), + Spacer(), + Image.asset( + "assets/image/trading_detail.webp", + width:16.h, + fit: BoxFit.fill, + height:16.h, + ), + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: (){ + Navigator.of(context).pushNamed('/router/integral_detailed_page',arguments:{"titleType":1}); + }, + child: Padding(padding:EdgeInsets.only(left: 4.w), + child: Text( + "印章明细", + style: TextStyle( + color: Color(0xFF0D0D0D), + fontSize: 12.sp, + fontWeight: MyFontWeight.regular), + )),) + ], + ), + ), + Container( + width: double.infinity, + padding:EdgeInsets.symmetric(vertical:12.h,horizontal: 11.w) , + margin: EdgeInsets.only(top:16.h), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 4), + blurRadius: 8, + spreadRadius: 8, + ) + ], + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding(padding:EdgeInsets.only(bottom:14.h), + child: Text( + "规则介绍", + style: TextStyle( + color: Color(0xFF0D0D0D), + fontSize: 15.sp, + fontWeight: MyFontWeight.semi_bold), + ),), + Padding(padding:EdgeInsets.only(bottom:12.h), + child: Text( + "(1) 商品中所要求的印章达到方可兑换", + style: TextStyle( + color: Color(0xFF353535), + fontSize: 12.sp, + fontWeight: MyFontWeight.regular), + ),), + Text( + "(2) 印章卡仅兑换商城指定商品,不能折算现金或兑换其他非指定商品项目", + style: TextStyle( + color: Color(0xFF353535), + fontSize: 12.sp, + height: 1.5.h, + fontWeight: MyFontWeight.regular), + ), + ], + ), + ) + ], + ), + ), + ), + ), + ) + ], + ), + ); + } +} diff --git a/lib/home/welfare_exchange.dart b/lib/home/welfare_exchange.dart index 890ca54f..003d1f26 100644 --- a/lib/home/welfare_exchange.dart +++ b/lib/home/welfare_exchange.dart @@ -211,7 +211,7 @@ class _WelfareExchange extends State ), ], )), - expandedHeight: 258.h, + expandedHeight: MediaQuery.of(context).size.height >= 750 ? 245.h : 258.h, bottom: PreferredSize( preferredSize: Size(double.infinity, 0), child: DefaultTabController( @@ -269,7 +269,7 @@ class _WelfareExchange extends State onRefresh: _onRefresh, child: Container( color: Colors.white, - padding: EdgeInsets.only(top: 19.h), + padding: EdgeInsets.only(top: 15.h), child: pointList(), )), ), @@ -323,7 +323,7 @@ class _WelfareExchange extends State userInfo.nickname, style: TextStyle( fontSize: 16.sp, - fontWeight: MyFontWeight.medium, + fontWeight: MyFontWeight.bold, color: Color(0xFF353535), ), ), @@ -365,65 +365,71 @@ class _WelfareExchange extends State height: 50.h, child: Column( mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.end, + crossAxisAlignment: CrossAxisAlignment.start, children: [ - GestureDetector( - onTap: () { - Navigator.of(context) - .pushNamed('/router/integral_detailed_page'); - }, - child: Row( - children: [ - Text( - S.of(context).jifenmingxi, - style: TextStyle( - fontSize: 14.sp, - fontWeight: MyFontWeight.medium, - color: Color(0xFF4C4C4C), - ), + Row( + children: [ + Text( + "总积分", + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFF4C4C4C), ), - Container( - width: 20, - height: 20, - margin: EdgeInsets.only(left: 4), - decoration: BoxDecoration( - color: Color(0xFF32A060), - borderRadius: BorderRadius.circular(10), - ), - child: Icon( - Icons.keyboard_arrow_right, - size: 20, - color: Colors.white, - ), + ), + Padding(padding:EdgeInsets.only(left:2.w), + child: Text( + (userInfo != null) ? "${userInfo.points}" : "", + style: TextStyle( + fontSize: 16.sp, + color: Color(0xFF32A060), + fontFamily: 'JDZhengHT', + fontWeight: MyFontWeight.medium, ), - ], - ), + ),), + SizedBox( + width: 4.w, + ), + Image.asset( + "assets/image/icon_gold_coin.webp", + width: 18, + height: 18, + ) + ], ), SizedBox( height: 4.h, ), - Expanded( - child: Row( + Row( children: [ Text( - (userInfo != null) ? "${userInfo.points}" : "", + "总印章", style: TextStyle( - fontSize: 16.sp, - color: Color(0xFF32A060), - fontFamily: 'JDZhengHT', + fontSize: 14.sp, fontWeight: MyFontWeight.medium, + color: Color(0xFF4C4C4C), ), ), + Padding(padding:EdgeInsets.only(left:2.w), + child: Text( + (userInfo != null) ? "${userInfo?.happyBean ?? 0}" : "", + style: TextStyle( + fontSize: 16.sp, + color: Color(0xFF32A060), + fontFamily: 'JDZhengHT', + fontWeight: MyFontWeight.medium, + ), + ),), SizedBox( - width: 6.w, + width:4.w, ), Image.asset( - "assets/image/icon_gold_coin.webp", + "assets/image/trading_logo.webp", width: 18, height: 18, ) ], - )) + ), ], ), ) @@ -561,7 +567,9 @@ class _WelfareExchange extends State String pointPrice(Goods goods) { if (goods == null) return ""; - if (goods?.onePrice != null && goods?.onePrice != "0") { + if(goods?.oneBean!=null && goods?.oneBean!="0"){ + return "${goods?.oneBean}集换卡"; + } else if (goods?.onePrice != null && goods?.onePrice != "0") { return S.of(context).jifen_(goods?.onePrice); } else if ((goods?.onePrice == null || goods?.onePrice == "0") && ((goods?.price != null && goods?.price != "0") || diff --git a/lib/home/welfare_page.dart b/lib/home/welfare_page.dart index 44298662..7864722e 100644 --- a/lib/home/welfare_page.dart +++ b/lib/home/welfare_page.dart @@ -145,15 +145,20 @@ class _WelfarePage extends State { Widget build(BuildContext context) { return Stack( children: [ - Container( - decoration: BoxDecoration( - image: DecorationImage( - fit: BoxFit.fill, - image: AssetImage("assets/image/welfare_zx.webp"), + Column( + children: [ + Container( + decoration: BoxDecoration( + image: DecorationImage( + fit: BoxFit.fill, + image: AssetImage("assets/image/welfare_zx.webp"), + ), + ), + width: double.infinity, + height: 236.h, ), - ), - width: double.infinity, - height: 236.h, + Expanded(child: Container(color: Colors.white,)) + ], ), Scaffold( backgroundColor: Colors.transparent, @@ -183,7 +188,21 @@ class _WelfarePage extends State { physics: BouncingScrollPhysics(), scrollController: ScrollController(), child: Container( - // margin: EdgeInsets.only(top:30.h,left: 14,right: 14), + decoration: BoxDecoration( + borderRadius: BorderRadius.only( + topLeft: Radius.circular(6), + topRight: Radius.circular(6),), + color: Colors.white, + boxShadow: [ + BoxShadow( + color: Color(0x08213303).withAlpha(12), + offset: Offset(0, 2), + blurRadius: 3, + spreadRadius: 0, + ), + ], + ), + margin: EdgeInsets.only(top: 95.h), child: SingleChildScrollView( physics: BouncingScrollPhysics(), child: Column( @@ -220,7 +239,6 @@ class _WelfarePage extends State { Widget weekCoupons() { return Container( width: double.infinity, - margin: EdgeInsets.only(top: 95.h), decoration: BoxDecoration( borderRadius: BorderRadius.only( topLeft: Radius.circular(6), @@ -235,7 +253,6 @@ class _WelfarePage extends State { ), ], ), - // margin: EdgeInsets.only(top: 139.h), child: Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, @@ -898,7 +915,9 @@ class _WelfarePage extends State { String pointPrice(Goods goodsPrice){ if(goodsPrice == null) return ""; - if(goodsPrice?.onePrice!=null && goodsPrice?.onePrice!="0"){ + if(goodsPrice?.oneBean!=null && goodsPrice?.oneBean!="0"){ + return "${goodsPrice?.oneBean}集换卡"; + } else if(goodsPrice?.onePrice!=null && goodsPrice?.onePrice!="0"){ return S.of(context).jifen_(goodsPrice?.onePrice); }else if((goodsPrice?.onePrice == null || goodsPrice?.onePrice == "0") && ((goodsPrice?.price != null && goodsPrice?.price != "0") || (goodsPrice?.money != null && goodsPrice?.money != "0.00"))){ return (goodsPrice?.price== "0"|| goodsPrice?.price == null ? "" : S.of(context).jifen_(goodsPrice?.price)) + (goodsPrice?.money== "0"|| goodsPrice?.money == null ? "" : " + ${AppUtils.calculateDouble(double.tryParse(goodsPrice?.money) ?? 0)}元"); diff --git a/lib/integral/integral_detailed_page.dart b/lib/integral/integral_detailed_page.dart index 0f6e7990..c557eac6 100644 --- a/lib/integral/integral_detailed_page.dart +++ b/lib/integral/integral_detailed_page.dart @@ -10,14 +10,18 @@ import 'package:huixiang/retrofit/data/user_info.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/view_widget/classic_header.dart'; -import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:huixiang/view_widget/my_footer.dart'; import 'package:huixiang/view_widget/my_tab.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import '../view_widget/no_data_view.dart'; + class IntegralDetailedPage extends StatefulWidget { + final arguments; + IntegralDetailedPage({this.arguments}); + @override State createState() { return _IntegralDetailedPage(); @@ -34,19 +38,19 @@ class _IntegralDetailedPage extends State super.didChangeDependencies(); _tabs = [ MyTab( - text: S.of(context).huode, + text: widget.arguments["titleType"] == 1 ? "印章获得" : S.of(context).huode, ), MyTab( - text: S.of(context).xiaofei, + text: widget.arguments["titleType"] == 1 ? "印章使用" : S.of(context).xiaofei, ), ]; tabController = TabController(length: 2, vsync: this) ..addListener(() { current = 1; if (tabController.index == 0) { - queryDetail("bill_cate_point_get"); + queryDetail(widget.arguments["titleType"] == 1 ? "" : "bill_cate_point_get",widget.arguments["titleType"] == 1 ?"BILL_TYPE_BEAN_ADD" :""); } else { - queryDetail("bill_cate_point_sub"); + queryDetail(widget.arguments["titleType"] == 1 ? "" : "bill_cate_point_sub",widget.arguments["titleType"] == 1 ?"BILL_TYPE_BEAN_SUB" :""); } }); } @@ -67,17 +71,17 @@ class _IntegralDetailedPage extends State apiService = ApiService(Dio(), context: context, token: value.getString("token")), userInfo = UserInfo.fromJson(jsonDecode(value.getString('user'))), - queryDetail("bill_cate_point_get"), + queryDetail(widget.arguments["titleType"] == 1 ? "" : "bill_cate_point_get",widget.arguments["titleType"] == 1 ?"BILL_TYPE_BEAN_ADD" :""), }); } int current = 1; List userBill = []; - queryDetail(category) async { + queryDetail(category,type) async { BaseData> baseData = await apiService.queryBillInfo({ "current": current, - "model": {"category": category, "title": "bill_title_point", "type": ""}, + "model": {"category": category, "title": widget.arguments["titleType"] == 1 ? "":"bill_title_point", "type": type}, "order": "descending", "size": 10, "sort": "id" @@ -107,17 +111,17 @@ class _IntegralDetailedPage extends State _onRefresh() { current = 1; if (tabController.index == 0) { - queryDetail("bill_cate_point_get"); + queryDetail(widget.arguments["titleType"] == 1 ? "" : "bill_cate_point_get",widget.arguments["titleType"] == 1 ?"BILL_TYPE_BEAN_ADD" :""); } else { - queryDetail("bill_cate_point_sub"); + queryDetail(widget.arguments["titleType"] == 1 ? "" : "bill_cate_point_sub",widget.arguments["titleType"] == 1 ?"BILL_TYPE_BEAN_SUB" :""); } } _loadMore() { if (tabController.index == 0) { - queryDetail("bill_cate_point_get"); + queryDetail(widget.arguments["titleType"] == 1 ? "" : "bill_cate_point_get",widget.arguments["titleType"] == 1 ?"BILL_TYPE_BEAN_SUB" :""); } else { - queryDetail("bill_cate_point_sub"); + queryDetail(widget.arguments["titleType"] == 1 ? "" : "bill_cate_point_sub",widget.arguments["titleType"] == 1 ?"BILL_TYPE_BEAN_SUB" :""); } } @@ -155,29 +159,39 @@ class _IntegralDetailedPage extends State titleSpacing: 2, leadingWidth: 56, flexibleSpace: FlexibleSpaceBar( - background: Container( - alignment: Alignment.center, - margin: EdgeInsets.only(top: 56.h), - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Text( - userInfo != null ? userInfo.points : "0", - style: TextStyle( - color: Colors.white, - fontWeight: MyFontWeight.medium, - fontSize: 48.sp), - ), - Text( - S.of(context).wodejifenzhi, - style: TextStyle( - color: Color(0xFFF2F2F2), - fontSize: 12.sp, - fontWeight: MyFontWeight.regular), + background: Stack( + children: [ + Image.asset( + "assets/image/ming_xi.webp", + width:double.infinity, + fit: BoxFit.fill, + height:259.h, + ), + Container( + alignment: Alignment.center, + margin: EdgeInsets.only(top: 56.h), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + userInfo != null ? (widget.arguments["titleType"] == 1 ? (userInfo?.happyBean ?? 0) : userInfo.points) : "0", + style: TextStyle( + color: Colors.white, + fontWeight: MyFontWeight.medium, + fontSize: 48.sp), + ), + Text( + widget.arguments["titleType"] == 1 ? "我的集卡券" : S.of(context).wodejifenzhi, + style: TextStyle( + color: Color(0xFFF2F2F2), + fontSize: 12.sp, + fontWeight: MyFontWeight.regular), + ), + ], ), - ], - ), + ) + ], ), ), expandedHeight: 228, @@ -220,74 +234,125 @@ class _IntegralDetailedPage extends State ), onRefresh: _onRefresh, onLoading: _loadMore, - child: ListView.builder( + child: (userBill == null || userBill.length == 0) + ? NoDataView( + src: "assets/image/xiao_fei.webp", + isShowBtn: false, + text: "当前暂无记录哦~", + fontSize: 16.sp, + margin: EdgeInsets.all(60.h), + ):ListView.builder( itemCount: userBill != null ? userBill.length : 0, padding: EdgeInsets.only(top: 8, bottom: 8), itemBuilder: (context, position) { return Container( margin: EdgeInsets.fromLTRB(16, 8, 16, 8), - padding: EdgeInsets.fromLTRB(14, 7, 16, 7), + padding: EdgeInsets.all(12), decoration: BoxDecoration( color: Colors.white, - borderRadius: BorderRadius.all(Radius.circular(2)), + borderRadius: BorderRadius.all(Radius.circular(6)), boxShadow: [ BoxShadow( color: Colors.black.withAlpha(25), - offset: Offset(0, 1), - blurRadius: 12, + offset: Offset(0, 2), + blurRadius: 3, spreadRadius: 0, ) ]), child: Row( mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, children: [ - Image.asset( - "assets/image/icon_intergral_sign.webp", - width: 36.w, - height: 34.h, - ), - SizedBox( - width: 15, - ), Expanded( child: Container( - // height: 34.h, - alignment: Alignment.centerLeft, - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceAround, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - userBill[position].name ?? "", - // S.of(context).qiandao, - style: TextStyle( - color: Colors.black, - fontSize: 12.sp, - fontWeight: FontWeight.w400), + // height: 34.h, + alignment: Alignment.centerLeft, + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding(padding: EdgeInsets.only(bottom: 8.h), + child: Text( + userBill[position].type ?? "", + // S.of(context).qiandao, + style: TextStyle( + color: Colors.black, + fontSize: 14.sp, + fontWeight: FontWeight.bold), + ),), + Text( + userBill[position].createTime ?? "", + style: TextStyle( + color: Color(0xFF4D4D4D), + fontSize: 12.sp, + fontWeight: MyFontWeight.regular), + ) + ], ), - Text( - userBill[position].createTime ?? "", - style: TextStyle( - color: Color(0xFF727272), - fontSize: 10.sp, - fontWeight: MyFontWeight.regular), - ) - ], - ), - )), + )), Container( margin: EdgeInsets.only(top: 2.h), child: Text( "${tabController.index == 0 ? "+" : "-"}${double.tryParse(userBill[position].number ?? "0").toInt().toString()}", style: TextStyle( - color: Color(0xFF727272), - fontSize: 12.sp, + color: Color(0xFF4D4D4D), + fontSize: 14.sp, + fontFamily: 'JDZhengHT', fontWeight: MyFontWeight.regular), ), ) ], - ), + ) + // Row( + // mainAxisAlignment: MainAxisAlignment.start, + // crossAxisAlignment: CrossAxisAlignment.center, + // children: [ + // Image.asset( + // "assets/image/icon_intergral_sign.webp", + // width: 36.w, + // height: 34.h, + // ), + // SizedBox( + // width: 15, + // ), + // Expanded( + // child: Container( + // // height: 34.h, + // alignment: Alignment.centerLeft, + // child: Column( + // mainAxisAlignment: MainAxisAlignment.spaceAround, + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // Text( + // userBill[position].type ?? "", + // // S.of(context).qiandao, + // style: TextStyle( + // color: Colors.black, + // fontSize: 12.sp, + // fontWeight: FontWeight.w400), + // ), + // Text( + // userBill[position].createTime ?? "", + // style: TextStyle( + // color: Color(0xFF727272), + // fontSize: 10.sp, + // fontWeight: MyFontWeight.regular), + // ) + // ], + // ), + // )), + // Container( + // margin: EdgeInsets.only(top: 2.h), + // child: Text( + // "${tabController.index == 0 ? "+" : "-"}${double.tryParse(userBill[position].number ?? "0").toInt().toString()}", + // style: TextStyle( + // color: Color(0xFF727272), + // fontSize: 12.sp, + // fontWeight: MyFontWeight.regular), + // ), + // ) + // ], + // ), ); }), ), diff --git a/lib/integral/integral_page.dart b/lib/integral/integral_page.dart index fe3d9724..06ae97a7 100644 --- a/lib/integral/integral_page.dart +++ b/lib/integral/integral_page.dart @@ -124,7 +124,7 @@ class _IntegralPage extends State { margin: EdgeInsets.only(right: 16.w), child: GestureDetector( onTap: () { - Navigator.of(context).pushNamed('/router/integral_detailed_page'); + Navigator.of(context).pushNamed('/router/integral_detailed_page',arguments:{"titleType":2}); }, child: Text( S.of(context).mingxi, diff --git a/lib/integral_store/integral_store_details_page.dart b/lib/integral_store/integral_store_details_page.dart index 8ad55829..764b886c 100644 --- a/lib/integral_store/integral_store_details_page.dart +++ b/lib/integral_store/integral_store_details_page.dart @@ -34,6 +34,7 @@ class IntegralStoreDetailsPage extends StatefulWidget { class _IntegralStoreDetailsPage extends State { ApiService apiService; String points; + String happyBean; int payType = 0; final ScrollController scrollController = ScrollController(); final RefreshController refreshController = RefreshController(); @@ -48,6 +49,7 @@ class _IntegralStoreDetailsPage extends State { queryGoodsById(); if (value.getString('user') != null) { points = UserInfo.fromJson(jsonDecode(value.getString('user'))).points; + happyBean = UserInfo.fromJson(jsonDecode(value.getString('user'))).happyBean; } }); } @@ -62,15 +64,18 @@ class _IntegralStoreDetailsPage extends State { if (baseData != null && baseData.isSuccess) { setState(() { goods = baseData.data; - if(goods != null && points != null && double.tryParse(goods.onePrice) - != 0 && double.tryParse(goods.onePrice) <= double.tryParse(points)){ + if(goods != null && happyBean != null && double.tryParse(goods?.oneBean ?? "0") + != 0 && double.tryParse(goods?.oneBean ?? "0") <= double.tryParse(happyBean)){ payType = 1; + } else if(goods != null && points != null && double.tryParse(goods.onePrice) + != 0 && double.tryParse(goods.onePrice) <= double.tryParse(points)){ + payType = 2; } else if (goods != null && points != null && double.tryParse(goods.price) != 0 && double.tryParse(goods.price) <= double.tryParse(points) && double.tryParse(goods.money) != 0.00){ - payType = 2; + payType = 3; } else if (goods != null && points != null && double.tryParse(goods.oneMoney) != 0.00){ - payType = 3; + payType = 4; } refreshController.refreshCompleted(); }); @@ -82,7 +87,9 @@ class _IntegralStoreDetailsPage extends State { String pointPrice(){ if(goods == null) return ""; - if(goods?.onePrice!=null && goods?.onePrice!="0"){ + if(goods?.oneBean!=null && goods?.oneBean!="0"){ + return "${goods?.oneBean}集换卡"; + }else if(goods?.onePrice!=null && goods?.onePrice!="0"){ return S.of(context).jifen_(goods?.onePrice); }else if((goods?.onePrice == null || goods?.onePrice == "0") && ((goods?.price != null && goods?.price != "0") || (goods?.money != null && goods?.money != "0.00"))){ return (goods?.price== "0"|| goods?.price == null ? "" : S.of(context).jifen_(goods?.price)) + (goods?.money== "0"|| goods?.money == null ? "" : " + ${AppUtils.calculateDouble(double.tryParse(goods?.money) ?? 0)}元"); @@ -168,7 +175,7 @@ class _IntegralStoreDetailsPage extends State { if(payType > 0){ toExchangeOrder(); }else{ - SmartDialog.showToast("您的积分不足!", alignment: Alignment.center); + SmartDialog.showToast(pointPrice().contains("集换卡")?"您的集换卡数量不足!" : "您的积分不足!", alignment: Alignment.center); return; } }, @@ -187,7 +194,7 @@ class _IntegralStoreDetailsPage extends State { child: Text( (payType > 0) ? "立即兑换" - : S.of(context).jifenbuzu, + : pointPrice().contains("集换卡")?"您的集换卡数量不足" :S.of(context).jifenbuzu, // "兑换功能暂未开放", style: TextStyle( fontSize: 16.sp, @@ -211,6 +218,7 @@ class _IntegralStoreDetailsPage extends State { "money": goods.money, "onePrice":goods.onePrice, "oneMoney":goods.oneMoney, + "oneBean":goods.oneBean, "price": goods.price, "image": goods.mainImgPath, "payType":payType, diff --git a/lib/l10n/intl_en.arb b/lib/l10n/intl_en.arb index d491ec54..a76bd403 100644 --- a/lib/l10n/intl_en.arb +++ b/lib/l10n/intl_en.arb @@ -736,6 +736,14 @@ "xuanhaola":"选好啦", "qudaolaiyuan":"渠道来源", "shuliang":"数量", + "shifujihuanka": "实付集换卡 {jihuanka}集换卡", + "jihuanka":"集换卡", + "xiaofeijihuanka":"消费集换卡", + "pingtaizhifumima":"平台支付密码", + "xiugai":"修改", + "bangdingshouji":"绑定手机", + "genggaibangdingshoujihao":"更改绑定手机号", + diff --git a/lib/l10n/intl_en_US.arb b/lib/l10n/intl_en_US.arb index c0c5958e..bc843241 100644 --- a/lib/l10n/intl_en_US.arb +++ b/lib/l10n/intl_en_US.arb @@ -737,6 +737,13 @@ "xuanhaola":"select success", "qudaolaiyuan":"channel source", "shuliang":"number", + "shifujihuanka": "paid-in trading card {jihuanka}trading card", + "jihuanka":"trading card", + "xiaofeijihuanka":"consume trading card", + "pingtaizhifumima":"Platform payment password", + "xiugai":"modify", + "bangdingshouji":"bind phone", + "genggaibangdingshoujihao":"modify bind phone", diff --git a/lib/l10n/intl_zh_CN.arb b/lib/l10n/intl_zh_CN.arb index 88016c60..e512dfa7 100644 --- a/lib/l10n/intl_zh_CN.arb +++ b/lib/l10n/intl_zh_CN.arb @@ -737,6 +737,13 @@ "xuanhaola":"选好啦", "qudaolaiyuan":"渠道来源", "shuliang":"数量", + "shifujihuanka": "实付集换卡 {jihuanka}集换卡", + "jihuanka":"集换卡", + "xiaofeijihuanka":"消费集换卡", + "pingtaizhifumima":"平台支付密码", + "xiugai":"修改", + "bangdingshouji":"绑定手机", + "genggaibangdingshoujihao":"更改绑定手机号", diff --git a/lib/l10n/intl_zh_Hans_CN.arb b/lib/l10n/intl_zh_Hans_CN.arb index 67abe33f..a044111d 100644 --- a/lib/l10n/intl_zh_Hans_CN.arb +++ b/lib/l10n/intl_zh_Hans_CN.arb @@ -737,6 +737,13 @@ "xuanhaola":"选好啦", "qudaolaiyuan":"渠道来源", "shuliang":"数量", + "shifujihuanka": "实付集换卡 {jihuanka}集换卡", + "jihuanka":"集换卡", + "xiaofeijihuanka":"消费集换卡", + "pingtaizhifumima":"平台支付密码", + "xiugai":"修改", + "bangdingshouji":"绑定手机", + "genggaibangdingshoujihao":"更改绑定手机号", diff --git a/lib/l10n/intl_zh_Hant_CN.arb b/lib/l10n/intl_zh_Hant_CN.arb index 722581f7..de7201af 100644 --- a/lib/l10n/intl_zh_Hant_CN.arb +++ b/lib/l10n/intl_zh_Hant_CN.arb @@ -728,6 +728,13 @@ "xuanhaola":"選好啦", "qudaolaiyuan":"渠道來源", "shuliang":"數量", + "shifujihuanka": "實付集換卡 {jihuanka}集換卡", + "jihuanka":"集換卡", + "xiaofeijihuanka":"消費集換卡", + "pingtaizhifumima":"平臺支付密碼", + "xiugai":"修改", + "bangdingshouji":"綁定手機", + "genggaibangdingshoujihao":"更改綁定手機號", diff --git a/lib/l10n/intl_zh_TW.arb b/lib/l10n/intl_zh_TW.arb index 8c6ac070..658a8398 100644 --- a/lib/l10n/intl_zh_TW.arb +++ b/lib/l10n/intl_zh_TW.arb @@ -730,6 +730,13 @@ "xuanhaola":"選好啦", "qudaolaiyuan":"渠道來源", "shuliang":"數量", + "shifujihuanka": "實付集換卡 {jihuanka}集換卡", + "jihuanka":"集換卡", + "xiaofeijihuanka":"消費集換卡", + "pingtaizhifumima":"平臺支付密碼", + "xiugai":"修改", + "bangdingshouji":"綁定手機", + "genggaibangdingshoujihao":"更改綁定手機號", diff --git a/lib/login/new_login_page.dart b/lib/login/new_login_page.dart index 8c99d87b..c4d5f9b1 100644 --- a/lib/login/new_login_page.dart +++ b/lib/login/new_login_page.dart @@ -445,7 +445,7 @@ class _NewLoginPage extends State { Container( height: 30.h, width: MediaQuery.of(context).size.width - 100.w, - margin: EdgeInsets.only(bottom:10.h), + margin: EdgeInsets.only(bottom:Platform.isIOS ? 10.h:5.h), child: TextField( style: TextStyle( height: 1.h, diff --git a/lib/main.dart b/lib/main.dart index 4c4993b4..ad3481b1 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -47,6 +47,7 @@ import 'package:huixiang/qr/qr_share.dart'; import 'package:huixiang/retrofit/data/examine_instance.dart'; import 'package:huixiang/setting/about_page.dart'; import 'package:huixiang/setting/account_security_page.dart'; +import 'package:huixiang/setting/binding_phone_page.dart'; import 'package:huixiang/setting/help_feedback_page.dart'; import 'package:huixiang/setting/logout_ing.dart'; import 'package:huixiang/setting/logout_page.dart'; @@ -94,6 +95,7 @@ import 'home/guide_page.dart'; import 'home/help_farmers/help_farmers_page.dart'; import 'home/home_view/activity_list.dart'; import 'home/start_page.dart'; +import 'home/trading_card_page.dart'; import 'home/welfare_exchange.dart'; import 'home/welfare_page.dart'; import 'login/login_store_select.dart'; @@ -309,7 +311,7 @@ Map routers = { '/router/settlement': (context, {arguments}) => Settlement(arguments: arguments), '/router/integral_detailed_page': (context, {arguments}) => - IntegralDetailedPage(), + IntegralDetailedPage(arguments:arguments), '/router/write_off_success_page': (context, {arguments}) => WriteOffSuccessPage(), '/router/exchange_history_page': (context, {arguments}) => @@ -434,4 +436,8 @@ Map routers = { StoreHtml(arguments:arguments), '/router/login_store_select': (context, {arguments}) => LoginStoreSelect(arguments:arguments), + '/router/binding_phone_page': (context, {arguments}) => + BindingPhonePage(arguments:arguments), + '/router/trading_card_page': (context, {arguments}) => + TradingCardPage(), }; diff --git a/lib/main_page.dart b/lib/main_page.dart index bfcbc3ea..678a4389 100644 --- a/lib/main_page.dart +++ b/lib/main_page.dart @@ -55,6 +55,7 @@ class _MainPage extends State with WidgetsBindingObserver { final GlobalKey minePageKey = GlobalKey(); final GlobalKey unionPageKey = GlobalKey(); final GlobalKey vipPageKey = GlobalKey(); + // List iconn; ApiService apiService; int lastTime = DateTime.now().millisecondsSinceEpoch; @@ -73,11 +74,13 @@ class _MainPage extends State with WidgetsBindingObserver { break; case AppLifecycleState.resumed: //从后台切换前台,界面可见 pushRoute(); - if(DateTime.now().millisecondsSinceEpoch - lastTime > 420000) - Navigator.of(context).popAndPushNamed('/router/start_page'); + if (DateTime.now().millisecondsSinceEpoch - lastTime > 420000) + //处于后台**分钟后刷新应用 + // Navigator.of(context).popAndPushNamed('/router/start_page'); + setState((){}); break; case AppLifecycleState.paused: // 界面不可见,后台 - lastTime = DateTime.now().millisecondsSinceEpoch; + lastTime = DateTime.now().millisecondsSinceEpoch; break; case AppLifecycleState.detached: // APP结束时调用 break; @@ -87,8 +90,12 @@ class _MainPage extends State with WidgetsBindingObserver { @override void initState() { super.initState(); - pageController = PageController(initialPage: widget.arguments != null && widget.arguments["index"] != null ? widget.arguments["index"]:0); - if(widget.arguments != null && widget.arguments["index"] != null) + pageController = PageController( + initialPage: + widget.arguments != null && widget.arguments["index"] != null + ? widget.arguments["index"] + : 0); + if (widget.arguments != null && widget.arguments["index"] != null) clickIndex = widget.arguments["index"]; WidgetsBinding.instance.addObserver(this); EasyLoading.instance @@ -103,7 +110,6 @@ class _MainPage extends State with WidgetsBindingObserver { ..userInteractions = false ..dismissOnTap = false; - initSdk(); pushRoute(); @@ -112,32 +118,43 @@ class _MainPage extends State with WidgetsBindingObserver { var interviewCouponList; var firstLoginCouponList; - if(widget.arguments != null && (widget.arguments["invite"]??"") != "" - && widget.arguments["interviewCouponList"] != null ){ + if (widget.arguments != null && + (widget.arguments["invite"] ?? "") != "" && + widget.arguments["interviewCouponList"] != null) { invite = widget.arguments["invite"]; interviewCouponList = widget.arguments["interviewCouponList"]; } - if(widget.arguments != null && widget.arguments["firstLoginCouponList"] != null ){ + if (widget.arguments != null && + widget.arguments["firstLoginCouponList"] != null) { firstLoginCouponList = widget.arguments["firstLoginCouponList"]; } _widgetOptions = [ // BrandPage(), - HomePage(homePageKey,(index,jpIndex) { - if(index == 1){ - if(unionPageKey?.currentState != null) { - UnionPageState state = unionPageKey.currentState; - state.jumpIndex(jpIndex); - }else _widgetOptions[1] = UnionPage(unionPageKey,jpIndex); - } - setState(() { - pageController.jumpToPage(index); - }); - },invite:invite,interviewCouponList:interviewCouponList,firstLoginCouponList:firstLoginCouponList,), + HomePage( + homePageKey, + (index, jpIndex) { + if (index == 1) { + if (unionPageKey?.currentState != null) { + UnionPageState state = unionPageKey.currentState; + state.jumpIndex(jpIndex); + } else + _widgetOptions[1] = UnionPage(unionPageKey, jpIndex); + } + setState(() { + pageController.jumpToPage(index); + }); + }, + invite: invite, + interviewCouponList: interviewCouponList, + firstLoginCouponList: firstLoginCouponList, + ), // MainHomePage(), - UnionPage(unionPageKey,0), + UnionPage(unionPageKey, 0), VipPage(vipPageKey), - Platform.isAndroid ? (ExamineInstance.instance.isExamine?OrderPage():CommunityPage()) :CommunityPage(), + Platform.isAndroid + ? (ExamineInstance.instance.isExamine ? OrderPage() : CommunityPage()) + : CommunityPage(), // CommunityPage(), MinePage(minePageKey), ]; @@ -167,9 +184,12 @@ class _MainPage extends State with WidgetsBindingObserver { ///App自动更新 appAutoUpdate(); } + final XgFlutterPlugin xgFlutterPlugin = XgFlutterPlugin(); + initSdk() async { xgFlutterPlugin.stopXg(); + ///ios 调用startXg前需要调用此方法 xgFlutterPlugin.configureClusterDomainName("tpns.sh.tencent.com"); xgFlutterPlugin.setEnableDebug(true); @@ -217,7 +237,7 @@ class _MainPage extends State with WidgetsBindingObserver { if (Platform.isAndroid) { xgFlutterPlugin.getXgAndroidApi().addNativeEventHandler( MyNativeEventHandler( - (String title, String message, String customContent, int type) { + (String title, String message, String customContent, int type) { print("xgPushClickAction2: $customContent"); SharedPreferences.getInstance().then((value) { value.setString("pushData", customContent); @@ -234,7 +254,7 @@ class _MainPage extends State with WidgetsBindingObserver { if (Platform.isAndroid ? (event["actionType"] == 0) : (event["xg"]["msgtype"] == 1) && - event[Platform.isAndroid ? "customMessage" : "custom"] != null) { + event[Platform.isAndroid ? "customMessage" : "custom"] != null) { SharedPreferences.getInstance().then((value) { value.setString("pushData", event[Platform.isAndroid ? "customMessage" : "custom"]); @@ -249,15 +269,15 @@ class _MainPage extends State with WidgetsBindingObserver { } return event; }, onReceiveNotificationResponse: (event) async { - try{ - if(jsonDecode(event["customMessage"])["typed"] == 6){ + try { + if (jsonDecode(event["customMessage"])["typed"] == 6) { // HomePageState state = homePageKey.currentState; // state.queryMsgStats(); MinePageState state = minePageKey.currentState; state.queryMsgStats(); } - }catch(ex){} + } catch (ex) {} print("onReceiveNotificationResponse: ${event.toString()}"); return event; }, onReceiveMessage: (event) async { @@ -277,7 +297,7 @@ class _MainPage extends State with WidgetsBindingObserver { if (sharedPreferences.getString("token") == null || sharedPreferences.getString("token") == "") return; String startIntent; - if(Platform.isAndroid) startIntent= await Bridge.getStartIntent(); + if (Platform.isAndroid) startIntent = await Bridge.getStartIntent(); print("intent:$startIntent"); String pushData = ""; if (startIntent != null && startIntent != "") { @@ -292,37 +312,45 @@ class _MainPage extends State with WidgetsBindingObserver { String routeName = ""; Map params = {}; switch (pushMap["typed"].toString()) { - case "1":case "ARTICLE": + case "1": + case "ARTICLE": routeName = "/router/web_page"; params["articleId"] = pushMap["info"]; break; - case "2":case "ACTIVITY": + case "2": + case "ACTIVITY": routeName = "/router/web_page"; params["activityId"] = pushMap["info"]; break; - case "3":case "SHOP": + case "3": + case "SHOP": routeName = "/router/store_order"; params["id"] = pushMap["info"]; params["tenant"] = pushMap["tenant"]; params["storeName"] = pushMap["storeName"]; break; - case "4":case "CREDIT_GOODS": + case "4": + case "CREDIT_GOODS": routeName = "/router/integral_store_page"; params["goodsId"] = pushMap["info"]; break; - case "5":case "ORDER": + case "5": + case "ORDER": routeName = "/router/order_details"; params["id"] = pushMap["info"]; break; - case "6":case "MEMBER": + case "6": + case "MEMBER": routeName = "/router/community_details"; params["businessId"] = pushMap["info"]; break; - case "8":case "WALLET": + case "8": + case "WALLET": routeName = "/router/mine_wallet"; params["id"] = pushMap["info"]; break; - case "9":case "WELFARE": + case "9": + case "WELFARE": routeName = "/router/welfare_page"; params["id"] = pushMap["info"]; break; @@ -346,6 +374,7 @@ class _MainPage extends State with WidgetsBindingObserver { ).queryInfo().catchError((onError) {}); sharedPreferences.setString('user', jsonEncode(baseDate.data)); + //用户登录时,注册推送的标识是手机号 String mobile = baseDate.data.phone; if (mobile != null && mobile != "") { xgFlutterPlugin.setAccount(mobile, AccountType.PHONE_NUMBER); @@ -366,35 +395,37 @@ class _MainPage extends State with WidgetsBindingObserver { SharedPreferences value = await SharedPreferences.getInstance(); if (apiService == null) { apiService = ApiService( - Dio(), - context: context, - token: value.getString("token"), + Dio(), + context: context, + token: value.getString("token"), ); } PackageInfo packageInfo = await PackageInfo.fromPlatform(); - BaseData baseData = await apiService.appVersion().catchError((onError) {}); + BaseData baseData = + await apiService.appVersion().catchError((onError) {}); if (baseData != null && baseData.isSuccess) { // baseData.data.appLastVersion = "2.0.17"; // baseData.data.appLastVersionUp = "1.0.1"; - if(AppUtils.versionCompare(packageInfo.version,baseData.data?.appLastVersion) - && AppUtils.versionCompare(value.getString("appLastVersion")??"1.0.0",baseData.data?.appLastVersion)){ + if (AppUtils.versionCompare( + packageInfo.version, baseData.data?.appLastVersion) && + AppUtils.versionCompare(value.getString("appLastVersion") ?? "1.0.0", + baseData.data?.appLastVersion)) { showDialog( context: context, barrierDismissible: false, builder: (BuildContext context) { return WillPopScope( - child:UpdateDialog(packageInfo.version,baseData.data), + child: UpdateDialog(packageInfo.version, baseData.data), onWillPop: () async { return Future.value(false); }); }, ); - }else{ + } else { return; } - }else{ - SmartDialog.showToast(baseData.msg, - alignment: Alignment.center); + } else { + SmartDialog.showToast(baseData.msg, alignment: Alignment.center); Navigator.of(context).pop(); } } @@ -443,7 +474,13 @@ class _MainPage extends State with WidgetsBindingObserver { bottomNavigationItem(S.of(context).main_menu2, 1), // bottomNavigationItem(S.of(context).main_menu3 , 2), bottomNavigationItem(S.of(context).main_menu5, 2), - bottomNavigationItem(Platform.isAndroid ? (ExamineInstance.instance.isExamine?"订单":S.of(context).main_menu3) :S.of(context).main_menu3, 3), + bottomNavigationItem( + Platform.isAndroid + ? (ExamineInstance.instance.isExamine + ? "订单" + : S.of(context).main_menu3) + : S.of(context).main_menu3, + 3), bottomNavigationItem(S.of(context).main_menu4, 4), ], ), @@ -525,72 +562,72 @@ class _MainPage extends State with WidgetsBindingObserver { ); } - // Widget bottomNavigationBigItem(text, index) { - // var isSelected = index == clickIndex; - // return Expanded( - // child: InkWell( - // onTap: () { - // setState(() { - // clickIndex = index; - // pageController.jumpToPage(clickIndex); - // }); - // }, - // child: Container( - // width: 45.w, - // alignment: Alignment.center, - // child: AnimatedCrossFade( - // firstCurve: Curves.easeIn, - // secondCurve: Curves.ease, - // sizeCurve: Curves.easeInOut, - // duration: Duration(milliseconds: 50), - // firstChild: Container( - // padding: EdgeInsets.all(4), - // height: 82.h, - // alignment: - // Platform.isAndroid ? Alignment.center : Alignment.topCenter, - // child: Image.asset( - // icons[index], - // width: 45, - // height: 45, - // fit: BoxFit.contain, - // ), - // ), - // secondChild: Column( - // mainAxisAlignment: Platform.isAndroid - // ? MainAxisAlignment.center - // : MainAxisAlignment.start, - // crossAxisAlignment: CrossAxisAlignment.center, - // children: [ - // if (Platform.isIOS) - // SizedBox( - // height: 4.h, - // ), - // Image.asset( - // iconn[index], - // width: 30, - // height: 30, - // fit: BoxFit.contain, - // ), - // SizedBox( - // height: 1.h, - // ), - // Text( - // text, - // style: TextStyle( - // fontSize: 10.sp, - // fontWeight: MyFontWeight.semi_bold, - // color: Color(isSelected ? 0xFF4C4C4C : 0xFFA29E9E), - // ), - // ), - // ], - // ), - // crossFadeState: isSelected - // ? CrossFadeState.showFirst - // : CrossFadeState.showSecond, - // ), - // ), - // ), - // flex: 1, - // ); - // } +// Widget bottomNavigationBigItem(text, index) { +// var isSelected = index == clickIndex; +// return Expanded( +// child: InkWell( +// onTap: () { +// setState(() { +// clickIndex = index; +// pageController.jumpToPage(clickIndex); +// }); +// }, +// child: Container( +// width: 45.w, +// alignment: Alignment.center, +// child: AnimatedCrossFade( +// firstCurve: Curves.easeIn, +// secondCurve: Curves.ease, +// sizeCurve: Curves.easeInOut, +// duration: Duration(milliseconds: 50), +// firstChild: Container( +// padding: EdgeInsets.all(4), +// height: 82.h, +// alignment: +// Platform.isAndroid ? Alignment.center : Alignment.topCenter, +// child: Image.asset( +// icons[index], +// width: 45, +// height: 45, +// fit: BoxFit.contain, +// ), +// ), +// secondChild: Column( +// mainAxisAlignment: Platform.isAndroid +// ? MainAxisAlignment.center +// : MainAxisAlignment.start, +// crossAxisAlignment: CrossAxisAlignment.center, +// children: [ +// if (Platform.isIOS) +// SizedBox( +// height: 4.h, +// ), +// Image.asset( +// iconn[index], +// width: 30, +// height: 30, +// fit: BoxFit.contain, +// ), +// SizedBox( +// height: 1.h, +// ), +// Text( +// text, +// style: TextStyle( +// fontSize: 10.sp, +// fontWeight: MyFontWeight.semi_bold, +// color: Color(isSelected ? 0xFF4C4C4C : 0xFFA29E9E), +// ), +// ), +// ], +// ), +// crossFadeState: isSelected +// ? CrossFadeState.showFirst +// : CrossFadeState.showSecond, +// ), +// ), +// ), +// flex: 1, +// ); +// } } diff --git a/lib/mine/mine_page.dart b/lib/mine/mine_page.dart index a3e73b64..c1e2f4e8 100644 --- a/lib/mine/mine_page.dart +++ b/lib/mine/mine_page.dart @@ -5,6 +5,7 @@ import 'package:flutter/cupertino.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_swiper/flutter_swiper.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/main.dart'; import 'package:huixiang/mine/mine_view/mine_calendar.dart'; @@ -427,24 +428,57 @@ class MinePageState extends State with AutomaticKeepAliveClientMixin { ///推广图 Widget spreadImage() { return Container( - margin: EdgeInsets.only(right: 14.w, bottom: 30.h, left: 14.w), - child: GestureDetector( - onTap: () { - Navigator.of(context).pushNamed('/router/invite_friends'); - }, - child: ClipRRect( - child: Image.asset( - "assets/image/welfare_spread.webp", - width: double.infinity, - fit: BoxFit.fill, - height: 80.h, + margin: EdgeInsets.only(bottom: 30.h,), + width: double.infinity, + height: 85.h, + child: Swiper( + pagination: SwiperPagination( + alignment: Alignment.bottomCenter, + margin: EdgeInsets.only(top: 5.h), + builder: DotSwiperPaginationBuilder( + size: 8.w, + activeSize: 8.w, + space: 5.w, + activeColor: Colors.white, + color: Colors.white.withAlpha(76), ), - borderRadius: BorderRadius.circular(6.w), ), + autoplay:true, + duration: 1000, + autoplayDelay: 2000, + itemBuilder: (context, position) { + return GestureDetector( + onTap: (){ + if(position == 0){ + Navigator.of(context).pushNamed('/router/invite_friends'); + }else if(position == 1){ + Navigator.of(context).pushNamed('/router/trading_card_page'); + } + }, + child:Container( + margin: EdgeInsets.symmetric(horizontal:14.w), + child: ClipRRect( + child:Image.asset( + spreadItem[position], + width:double.infinity, + fit: BoxFit.fill, + height:double.infinity, + ), + borderRadius: BorderRadius.circular(6.w), + ), + ), + ); + }, + itemCount:2, ), ); } + final List spreadItem = [ + "assets/image/welfare_spread.webp", + "assets/image/welfare_yz.webp", + ]; + ///横向的提示 Widget buildNotice() { return Container( diff --git a/lib/mine/mine_vip/mine_vip_core.dart b/lib/mine/mine_vip/mine_vip_core.dart index 953ea947..b32cd89e 100644 --- a/lib/mine/mine_vip/mine_vip_core.dart +++ b/lib/mine/mine_vip/mine_vip_core.dart @@ -23,8 +23,13 @@ import 'package:huixiang/view_widget/mine_vip_view.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:huixiang/view_widget/vip_dialog.dart'; +import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:shared_preferences/shared_preferences.dart'; +import '../../retrofit/data/user_info.dart'; +import '../../view_widget/classic_header.dart'; +import '../../view_widget/my_footer.dart'; + class MineVipCore extends StatefulWidget { final Map arguments; @@ -42,27 +47,30 @@ class _MineVipCore extends State { List vipBenefitList = []; VipRuleDetails vipRuleDetails; int checkIndex = 0; + UserInfo userInfo; + int rankNameIndex; + final RefreshController refreshController = RefreshController(); final SwiperController controller = SwiperController(); @override void initState() { super.initState(); - + userInfo = widget.arguments["userInfo"]; SharedPreferences.getInstance().then((value) { - if (widget.arguments["rankLevel"] == 1 && - !(value.getBool("FirstYinKa") ?? false)) { - showAlertDialog("银卡会员"); - value.setBool("FirstYinKa", true); - } else if (widget.arguments["rankLevel"] == 2 && - !(value.getBool("FirstJinKa") ?? false)) { - showAlertDialog("金卡会员"); - value.setBool("FirstJinKa", true); - } else if (widget.arguments["rankLevel"] == 3 && - !(value.getBool("FirstGongC") ?? false)) { - showAlertDialog("共创会员"); - value.setBool("FirstGongC", true); - } + // if (widget.arguments["rankLevel"] == 1 && + // !(value.getBool("FirstYinKa") ?? false)) { + // showAlertDialog("银卡会员"); + // value.setBool("FirstYinKa", true); + // } else if (widget.arguments["rankLevel"] == 2 && + // !(value.getBool("FirstJinKa") ?? false)) { + // showAlertDialog("金卡会员"); + // value.setBool("FirstJinKa", true); + // } else if (widget.arguments["rankLevel"] == 3 && + // !(value.getBool("FirstGongC") ?? false)) { + // showAlertDialog("共创会员"); + // value.setBool("FirstGongC", true); + // } apiService = ApiService(Dio(), context: context, token: value.getString("token")); queryVipLevel(); @@ -82,29 +90,59 @@ class _MineVipCore extends State { }); } + String levelTipsName(int position){ + if(userInfo.memberRankVo.rankName == ranks[position].rankName) + return S.of(context).dangqiandengji; + else { + int userLevelIndex = ranks.indexWhere((element) => element.rankName == userInfo.memberRankVo.rankName); + if(userLevelIndex+1 == position) + return "下一等级"; + else if(userLevelIndex-1 > position) + return "已达到"; + else if(userLevelIndex-1 == position) + return "上一等级"; + else + return S.of(context).zanweikaitong; + } + } + + ///会员等级列表 queryVipLevel() async { - BaseData> rankData = await apiService.rankList().catchError((onError) {}); + BaseData> rankData = await apiService.rankList().catchError((onError) { + refreshController.refreshFailed(); + refreshController.loadFailed();}); if (rankData != null && rankData.isSuccess) { ranks.clear(); ranks.addAll(rankData.data); + rankNameIndex = ranks.indexWhere((element) => element.rankName == userInfo.memberRankVo.rankName); + if(rankNameIndex != -1) + checkIndex = rankNameIndex; setState(() { controller.move((widget.arguments["rankLevel"] - 1), animation: false); }); + refreshController.refreshCompleted(); + refreshController.loadComplete(); } else { - SmartDialog.showToast(rankData.msg, alignment: Alignment.center); + SmartDialog.showToast(rankData?.msg??"", alignment: Alignment.center); + refreshController.refreshFailed(); + refreshController.loadFailed(); } } ///会员权益列表 queryBenefitList() async { BaseData> baseData = - await apiService.benefitList().catchError((onError) {}); + await apiService.benefitList().catchError((onError) { + refreshController.refreshFailed(); + refreshController.loadFailed();}); if (baseData != null && baseData.isSuccess) { setState(() { vipBenefitList.clear(); vipBenefitList.addAll(baseData.data); vipBenefitList.sort((a, b) => (a.sort).compareTo(b.sort)); }); + refreshController.refreshCompleted(); + refreshController.loadComplete(); } EasyLoading.dismiss(); } @@ -112,11 +150,15 @@ class _MineVipCore extends State { ///会员权益介绍/规则/说明/储值说明 queryRuleDetails() async { BaseData baseData = - await apiService.vipBenefit().catchError((onError) {}); + await apiService.vipBenefit().catchError((onError) { + refreshController.refreshFailed(); + refreshController.loadFailed();}); if (baseData != null && baseData.isSuccess) { setState(() { vipRuleDetails = baseData.data; }); + refreshController.refreshCompleted(); + refreshController.loadComplete(); } EasyLoading.dismiss(); } @@ -156,6 +198,13 @@ class _MineVipCore extends State { } } + _onRefresh() async { + await queryVipLevel(); + await queryBenefitList(); + await queryRuleDetails(); + } + + @override Widget build(BuildContext context) { return Container( @@ -213,7 +262,7 @@ class _MineVipCore extends State { ), )), ), - if(widget?.arguments["userInfo"] != null) + if(userInfo.masterCardRankName != null) Container( alignment: Alignment.center, margin: EdgeInsets.only(right: 16.w), @@ -222,7 +271,7 @@ class _MineVipCore extends State { // Navigator.of(context).pushNamed('/router/integral_detailed_page'); }, child: Text( - "${S.of(context).dangqianzhukadengji} : ${widget?.arguments["userInfo"]??""}", + "${S.of(context).dangqianzhukadengji} : ${userInfo.masterCardRankName??""}", style: TextStyle( color: Colors.white, fontSize: 16.sp, @@ -235,304 +284,328 @@ class _MineVipCore extends State { ), ), Expanded(child: - SingleChildScrollView( + SmartRefresher( + controller: refreshController, + enablePullDown: true, + enablePullUp: false, + header: MyHeader( + color: Colors.white, + ), + footer: CustomFooter( + builder: (context, mode) { + return MyFooter(mode); + }, + ), + onRefresh: () { + _onRefresh(); + }, physics: BouncingScrollPhysics(), - child: Column( - children: [ - ///会员卡 - if(ranks.length > 0) - Container( - height: (MediaQuery.of(context).size.width) / - 1.78 * - AppUtils.textScale(context), - child: Swiper( - viewportFraction: 0.95, - loop: false, - physics: BouncingScrollPhysics(), - controller: controller, - onIndexChanged: (index) { - setState(() { - checkIndex = index; - }); - }, - itemBuilder: (context, position) { - return MineVipView( - vipLevel: !(ranks != null && ranks.isNotEmpty) - ? widget.arguments["rankLevel"] - : position + 1, - curLevel: widget.arguments["rankLevel"], - tag: (widget.arguments["rankLevel"] == (position + 1) || - !(ranks != null && ranks.isNotEmpty)) - ? "vip" - : "", - padding: 6.w, - // rank: !(ranks != null && ranks.isNotEmpty) - // ? 0 - // : widget.arguments["expendAmount"] ?? 0, - rankMax: !(ranks != null && ranks.isNotEmpty) - ? 0 - : ranks[position].rankOrigin, - createTime: widget.arguments["createTime"], - showRank: false, - price: !(ranks != null && ranks.isNotEmpty) - ? "0" - : ranks[position].price, - ); - }, - itemCount: - (ranks != null && ranks.isNotEmpty) ? ranks.length : 1, + scrollController: ScrollController(), + child: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Column( + children: [ + ///会员卡 + if(ranks.length > 0) + Container( + height: (MediaQuery.of(context).size.width) / + 1.78 * + AppUtils.textScale(context), + child: Swiper( + viewportFraction: 0.95, + loop: false, + physics: BouncingScrollPhysics(), + index: checkIndex, + controller: controller, + onIndexChanged: (index) { + setState(() { + checkIndex = index; + }); + }, + itemBuilder: (context, position) { + return vipCar(position); + // MineVipView( + // vipLevel: !(ranks != null && ranks.isNotEmpty) + // ? widget.arguments["rankLevel"] + // : position + 1, + // curLevel: widget.arguments["rankLevel"], + // tag: (widget.arguments["rankLevel"] == (position + 1) || + // !(ranks != null && ranks.isNotEmpty)) + // ? "vip" + // : "", + // padding: 6.w, + // // rank: !(ranks != null && ranks.isNotEmpty) + // // ? 0 + // // : widget.arguments["expendAmount"] ?? 0, + // rankMax: !(ranks != null && ranks.isNotEmpty) + // ? 0 + // : ranks[position].rankOrigin, + // createTime: widget.arguments["createTime"], + // showRank: false, + // price: !(ranks != null && ranks.isNotEmpty) + // ? "0" + // : ranks[position].price, + // ); + }, + itemCount: + (ranks != null && ranks.isNotEmpty) ? ranks.length : 1, + ), ), - ), - ///会员权益 - Container( - margin: EdgeInsets.fromLTRB(0, 16.h, 0, 0), - padding: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 16.h), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.only( - topLeft: Radius.circular(8), - topRight: Radius.circular(8), - ), - ), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( + ///会员权益 + if(vipBenefitList != null) + Container( + margin: EdgeInsets.fromLTRB(0, 16.h, 0, 0), + padding: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 16.h), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(8), + topRight: Radius.circular(8), + ), + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Container( - width: 4.w, - height: 18.h, - decoration: BoxDecoration( - gradient: new LinearGradient( - begin: Alignment.bottomCenter, - end: Alignment.topCenter, - colors: [ - Color(0xFF000000), - Color(0xFF585858), - ]), - ), + Row( + children: [ + Container( + width: 4.w, + height: 18.h, + decoration: BoxDecoration( + gradient: new LinearGradient( + begin: Alignment.bottomCenter, + end: Alignment.topCenter, + colors: [ + Color(0xFF000000), + Color(0xFF585858), + ]), + ), + ), + SizedBox( + width: 4.w, + ), + Text( + S.of(context).huiyuanquanyi, + style: TextStyle( + fontWeight: MyFontWeight.medium, + fontSize: 16.sp, + color: Colors.black, + ), + ), + ], ), SizedBox( - width: 4.w, - ), - Text( - S.of(context).huiyuanquanyi, - style: TextStyle( - fontWeight: MyFontWeight.medium, - fontSize: 16.sp, - color: Colors.black, - ), + height: 12.h, ), + vipLegalRight(), ], ), - SizedBox( - height: 12.h, - ), - vipLegalRight(), - ], - ), - ), - - ///会员规则说明 - Container( - margin: EdgeInsets.fromLTRB(0, 16.h, 0, 0), - padding: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 16.h), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.only( - topLeft: Radius.circular(8), - topRight: Radius.circular(8), ), - ), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( + + ///会员规则说明 + if(vipRuleDetails != null) + Container( + margin: EdgeInsets.fromLTRB(0, 16.h, 0, 0), + padding: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 16.h), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(8), + topRight: Radius.circular(8), + ), + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Container( - width: 4.w, - height: 18.h, - decoration: BoxDecoration( - gradient: new LinearGradient( - begin: Alignment.bottomCenter, - end: Alignment.topCenter, - colors: [ - Color(0xFF000000), - Color(0xFF585858), - ]), - ), + Row( + children: [ + Container( + width: 4.w, + height: 18.h, + decoration: BoxDecoration( + gradient: new LinearGradient( + begin: Alignment.bottomCenter, + end: Alignment.topCenter, + colors: [ + Color(0xFF000000), + Color(0xFF585858), + ]), + ), + ), + SizedBox( + width: 4.w, + ), + Text( + S.of(context).huiyuanguize, + style: TextStyle( + fontWeight: MyFontWeight.medium, + fontSize: 16.sp, + color: Colors.black, + ), + ), + ], ), SizedBox( - width: 4.w, + height: 12.h, ), - Text( - S.of(context).huiyuanguize, - style: TextStyle( - fontWeight: MyFontWeight.medium, - fontSize: 16.sp, - color: Colors.black, + if (vipRuleDetails?.qa != null && vipRuleDetails.qa != "") + Container( + color: Colors.white, + padding: EdgeInsets.only(left: 8.w), + child: Html( + data: vipRuleDetails?.qa ?? "", + customImageRenders: { + networkSourceMatcher(): networkImageRender( + loadingWidget: () { + return Container(); + }, + ), + }, + ), ), - ), ], ), - SizedBox( - height: 12.h, - ), - if (vipRuleDetails?.qa != null && vipRuleDetails.qa != "") - Container( - color: Colors.white, - padding: EdgeInsets.only(left: 8.w), - child: Html( - data: vipRuleDetails?.qa ?? "", - customImageRenders: { - networkSourceMatcher(): networkImageRender( - loadingWidget: () { - return Container(); - }, - ), - }, - ), - ), - ], - ), - ), - - ///会员级别对照表 - Container( - margin: EdgeInsets.fromLTRB(0, 16.h, 0, 0), - padding: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 16.h), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.only( - topLeft: Radius.circular(8), - topRight: Radius.circular(8), ), - ), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( + + ///会员级别对照表 + if(vipRuleDetails != null) + Container( + margin: EdgeInsets.fromLTRB(0, 16.h, 0, 0), + padding: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 16.h), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(8), + topRight: Radius.circular(8), + ), + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Container( - width: 4.w, - height: 18.h, - decoration: BoxDecoration( - gradient: new LinearGradient( - begin: Alignment.bottomCenter, - end: Alignment.topCenter, - colors: [ - Color(0xFF000000), - Color(0xFF585858), - ]), - ), + Row( + children: [ + Container( + width: 4.w, + height: 18.h, + decoration: BoxDecoration( + gradient: new LinearGradient( + begin: Alignment.bottomCenter, + end: Alignment.topCenter, + colors: [ + Color(0xFF000000), + Color(0xFF585858), + ]), + ), + ), + SizedBox( + width: 4.w, + ), + Text( + S.of(context).huiyuanjibieduizhao, + style: TextStyle( + fontWeight: MyFontWeight.medium, + fontSize: 16.sp, + color: Colors.black, + ), + ), + ], ), SizedBox( - width: 4.w, + height: 12.h, ), - Text( - S.of(context).huiyuanjibieduizhao, - style: TextStyle( - fontWeight: MyFontWeight.medium, - fontSize: 16.sp, - color: Colors.black, - ), + MImage( + vipRuleDetails?.contrast ?? "", + width: double.infinity, + height: 281.h, + errorSrc: "assets/image/default_1.webp", + fadeSrc: "assets/image/default_1.webp", + ), + SizedBox( + height: 16.h, ), ], ), - SizedBox( - height: 12.h, - ), - MImage( - vipRuleDetails?.contrast ?? "", - width: double.infinity, - height: 281.h, - errorSrc: "assets/image/default_1.webp", - fadeSrc: "assets/image/default_1.webp", - ), - SizedBox( - height: 16.h, - ), - ], - ), - ), - - ///会员如何获得积分 - Container( - margin: EdgeInsets.fromLTRB(0, 16.h, 0, 0), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.only( - topLeft: Radius.circular(8), - topRight: Radius.circular(8), ), - ), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - padding: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 16.h), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( + + ///会员如何获得积分 + if(vipRuleDetails != null) + Container( + margin: EdgeInsets.fromLTRB(0, 16.h, 0, 0), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(8), + topRight: Radius.circular(8), + ), + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + padding: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 16.h), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Container( - width: 4.w, - height: 18.h, - decoration: BoxDecoration( - gradient: new LinearGradient( - begin: Alignment.bottomCenter, - end: Alignment.topCenter, - colors: [ - Color(0xFF000000), - Color(0xFF585858), - ]), - ), + Row( + children: [ + Container( + width: 4.w, + height: 18.h, + decoration: BoxDecoration( + gradient: new LinearGradient( + begin: Alignment.bottomCenter, + end: Alignment.topCenter, + colors: [ + Color(0xFF000000), + Color(0xFF585858), + ]), + ), + ), + SizedBox( + width: 4.w, + ), + Text( + S.of(context).huiyuanhuodejifen, + style: TextStyle( + fontWeight: MyFontWeight.medium, + fontSize: 16.sp, + color: Colors.black, + ), + ), + ], ), SizedBox( - width: 4.w, + height: 12.h, ), - Text( - S.of(context).huiyuanhuodejifen, - style: TextStyle( - fontWeight: MyFontWeight.medium, - fontSize: 16.sp, - color: Colors.black, + if (vipRuleDetails?.rule != null && + vipRuleDetails.rule != "") + Container( + color: Colors.white, + child: Html( + data: vipRuleDetails?.rule ?? "", + customImageRenders: { + networkSourceMatcher(): networkImageRender( + loadingWidget: () { + return Container(); + }, + ), + }, + ), ), - ), ], ), - SizedBox( - height: 12.h, - ), - if (vipRuleDetails?.rule != null && - vipRuleDetails.rule != "") - Container( - color: Colors.white, - child: Html( - data: vipRuleDetails?.rule ?? "", - customImageRenders: { - networkSourceMatcher(): networkImageRender( - loadingWidget: () { - return Container(); - }, - ), - }, - ), - ), - ], - ), + ), + ], ), - ], - ), - ), - ], + ), + ], + ), ), )), ], @@ -559,7 +632,6 @@ class _MineVipCore extends State { ]), ), width: MediaQuery.of(context).size.width, - padding: EdgeInsets.all(16), height: 54.h, alignment: Alignment.center, child: Text( @@ -577,8 +649,194 @@ class _MineVipCore extends State { ], ), ); + } - + Widget vipCar(int position){ + return Container( + margin:EdgeInsets.fromLTRB(16.w, 16.h, 8.w, 8.h), + width: MediaQuery.of(context).size.width - 32.w, + height: ((MediaQuery.of(context).size.width - 32.w) / + 2.11 * + AppUtils.textScale(context)), + decoration: BoxDecoration( + gradient: LinearGradient( + colors: [ + AppUtils.getLighterColor(ranks[position]?.color ?? "#85C9DD"), + Color(int.parse((ranks[position]?.color ?? "#85C9DD").replaceAll("#", "FF"), radix: 16)), + ], + begin: Alignment.topLeft, + end: Alignment.bottomRight, + ), + borderRadius:BorderRadius.circular(8), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ), + ], + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + height: 86.w, + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + padding: EdgeInsets.fromLTRB(9.w, 4.h, 8.w, 4.h), + decoration: BoxDecoration( + color: Color(int.parse((ranks[position]?.color ?? "").replaceAll("#", "FF"), radix: 16)), + borderRadius: BorderRadius.only( + topLeft: Radius.circular(8), + bottomRight: Radius.circular(8), + ), + ), + child: Text(levelTipsName(position), + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.semi_bold, + color: Color(int.parse((ranks[position]?.textColor ?? "").replaceAll("#", "FF"), radix: 16)), + ), + ), + ), + Container( + margin: EdgeInsets.only(left: 13.w), + child: Text( + "VIP ${ranks[position].rankName ?? ""}", + style: TextStyle( + color: Color(int.parse((ranks[position]?.textColor ?? "").replaceAll("#", "FF"), radix: 16)), + fontWeight: MyFontWeight.semi_bold, + fontSize:22.sp, + ), + ), + ), + ], + ), + ), + Container( + margin: EdgeInsets.only(right: 11.w, bottom: 9.h), + child: Image.asset( + "assets/image/icon_mine_huixiang_logo.webp", + width: 86.w, + height: 86.w, + fit: BoxFit.contain, + ), + ), + ], + ), + Expanded( + child: Container( + margin: EdgeInsets.only( + left: 13.w, + right: 12.w, + bottom: 12.h, + ), + child: Column( + mainAxisAlignment: + MainAxisAlignment.spaceAround, + children: [ + if(userInfo?.memberRankVo?.rankName != ranks[position].rankName || (userInfo?.memberRankVo?.rankName == "共创会员" && ranks[position].rankName == "共创会员")) + Align(alignment: Alignment.centerRight, + child: Text( + (ranks[position].rankName == "共创会员") ? "永久VIP" : (ranks[position]?.originScore ?? 0).toString(), + overflow: TextOverflow.ellipsis, + style: TextStyle( + color:Color(int.parse((ranks[position]?.textColor ?? "").replaceAll("#", "FF"), radix: 16)), + fontWeight: ranks[position].rankName == "共创会员" ? MyFontWeight.regular : MyFontWeight.bold, + fontSize: ranks[position].rankName == "共创会员" ? 14.sp : 20.sp, + ), + ),), + if(userInfo?.memberRankVo?.rankName == ranks[position].rankName && (userInfo?.memberRankVo?.rankName != "共创会员" && ranks[position].rankName != "共创会员")) + Padding(padding:EdgeInsets.only(bottom: 12.h), + child: Row( + children: [ + Expanded(child: + Text( + "消费满 ¥${userInfo.memberRankVo.nextOrigin ?? "0"} 升级为 ${userInfo?.memberRankVo?.nextName ?? ""}", + overflow: TextOverflow.ellipsis, + style: TextStyle( + color:Color(int.parse((ranks[position]?.textColor ?? "").replaceAll("#", "FF"), radix: 16)), + fontWeight:MyFontWeight.regular, + fontSize: 14.sp, + ), + ) + ), + Text.rich( + TextSpan( + children: [ + TextSpan( + text:"${AppUtils.calculateDouble(double.tryParse(userInfo.expendAmount??"0"))}", + style: TextStyle( + fontSize: 24.sp, + fontWeight: MyFontWeight.medium, + color: Color(int.parse((ranks[position]?.textColor ?? "").replaceAll("#", "FF"), radix: 16)), + ), + ), + TextSpan( + text: "/${userInfo.memberRankVo.nextOrigin ?? "0"}", + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + color: Color(int.parse((ranks[position]?.textColor ?? "").replaceAll("#", "FF"), radix: 16)), + ), + ), + ], + ), + ), + ], + ),), + if(userInfo?.memberRankVo?.rankName == ranks[position].rankName && (userInfo?.memberRankVo?.rankName != "共创会员" && ranks[position].rankName != "共创会员")) + Container( + height: 8.h, + child: ClipRRect( + borderRadius: BorderRadius.circular(6.5), + child: LinearProgressIndicator( + value: (userInfo?.memberRankVo?.nextOrigin ?? 0) > (double.tryParse(userInfo?.expendAmount ?? "0").toInt())? ((checkIndex < rankNameIndex) ? + (userInfo?.memberRankVo?.nextOrigin ?? 0)/(userInfo?.memberRankVo?.nextOrigin ?? 0): (double.tryParse(userInfo?.expendAmount ?? "0").toInt()) / (userInfo?.memberRankVo?.nextOrigin ?? 0)) : 0, + backgroundColor: Colors.white, + color: AppUtils.getLighterColor(ranks[position]?.color ?? ""), + ), + ), + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + S.of(context).kaitongriqi( + (widget.arguments["createTime"] != null && widget.arguments["createTime"] != "") + ? widget.arguments["createTime"].split(" ")[0] + : widget.arguments["createTime"] + ), + style: TextStyle( + fontWeight: MyFontWeight.regular, + fontSize: 12.sp, + color: Color(int.parse((ranks[position]?.textColor ?? "").replaceAll("#", "FF"), radix: 16)) + ), + ), + Icon( + Icons.qr_code, + size: 24, + color: Color(int.parse((ranks[position]?.textColor ?? "").replaceAll("#", "FF"), radix: 16)), + ), + ], + ), + ], + ), + ), + flex: 1, + ), + ], + ), + ); } ///vip diff --git a/lib/mine/user_info_page.dart b/lib/mine/user_info_page.dart index e9f76880..669ba568 100644 --- a/lib/mine/user_info_page.dart +++ b/lib/mine/user_info_page.dart @@ -44,7 +44,7 @@ class _UserInfoPage extends State { SharedPreferences.getInstance().then((value) => { print(value.getString('user')), user = UserInfo.fromJson(jsonDecode(value.getString('user'))), - mobile = value.getString('mobile'), + mobile = user.phone, modifyInfo["nickname"] = user.nickname, modifyInfo["signature"] = user.signature, modifyInfo["birth"] = user.birth, diff --git a/lib/order/exchange_history_page.dart b/lib/order/exchange_history_page.dart index 51eec9aa..1d71da2b 100644 --- a/lib/order/exchange_history_page.dart +++ b/lib/order/exchange_history_page.dart @@ -445,12 +445,12 @@ class _ExchangeHistoryList extends State Text( exchangeOrder?.amount == null || exchangeOrder.amount == "0" ? "" - : S.of(context).shifujifen((exchangeOrder.amount)) + + : exchangeOrder.payType == 2 ? S.of(context).shifujihuanka(exchangeOrder.amount):(S.of(context).shifujifen(exchangeOrder.amount) + ( exchangeOrder?.creditOrderDetailList[0]?.money == null || exchangeOrder?.creditOrderDetailList[0]?.money == "0.00" ? "" - : " + ${double.parse(exchangeOrder?.creditOrderDetailList[0]?.money.toString()) * exchangeOrder?.creditOrderDetailList[0].goodsNumber}元"), + : " + ${double.parse(exchangeOrder?.creditOrderDetailList[0]?.money.toString()) * exchangeOrder?.creditOrderDetailList[0].goodsNumber}元")), style: TextStyle( fontSize: 12.sp, fontWeight: MyFontWeight.semi_bold, diff --git a/lib/order/exchange_order_page.dart b/lib/order/exchange_order_page.dart index 2d348dba..cf9670a3 100644 --- a/lib/order/exchange_order_page.dart +++ b/lib/order/exchange_order_page.dart @@ -41,6 +41,8 @@ class _ExchangeOrderPage extends State { UserInfo userInfo; dynamic payListen; dynamic mBalance = 0; + String happyBean; + String points; @override void initState() { @@ -49,8 +51,8 @@ class _ExchangeOrderPage extends State { SharedPreferences.getInstance().then((value) => { apiService = ApiService(Dio(), context: context, token: value.getString("token")), - points = - UserInfo.fromJson(jsonDecode(value.getString('user'))).points, + points = UserInfo.fromJson(jsonDecode(value.getString('user'))).points, + happyBean = UserInfo.fromJson(jsonDecode(value.getString('user'))).happyBean, queryUserBalance(), }); @@ -62,8 +64,11 @@ class _ExchangeOrderPage extends State { '/router/exchange_order_success_page', arguments: { "id": widget.arguments["goodsId"], - "price": realPay.contains("积分") ? realPay.substring(0,realPay.indexOf("积分")) : "0", + "price": realPay.contains("积分") + ? realPay.substring(0, realPay.indexOf("积分")) + : "0", "points": points, + "happyBean":happyBean, "realPay": realPay, "payChannel": widget.arguments["payChannel"], }, @@ -73,18 +78,17 @@ class _ExchangeOrderPage extends State { return; } }); - } @override void dispose() { super.dispose(); - if(payListen!=null) - payListen.cancel(); + if (payListen != null) payListen.cancel(); } queryUserBalance() async { - BaseData baseData = await apiService.queryInfo().catchError((onError) {}); + BaseData baseData = + await apiService.queryInfo().catchError((onError) {}); if (baseData != null && baseData.isSuccess) { userInfo = baseData.data; mBalance = double.tryParse(userInfo.money); @@ -92,8 +96,6 @@ class _ExchangeOrderPage extends State { } } - String points; - @override Widget build(BuildContext context) { return Scaffold( @@ -112,435 +114,424 @@ class _ExchangeOrderPage extends State { children: [ // widget.arguments["useTyped"] == 1 ? Container( - margin: EdgeInsets.only( - left: 16, right: 16, top: 26, bottom: 8), - padding: EdgeInsets.all(20), - decoration: BoxDecoration( - color: Colors.white, - boxShadow: [ - BoxShadow( - color: Colors.black.withAlpha(12), - offset: Offset(0, 3), - blurRadius: 14, - spreadRadius: 0, - ) - ], - borderRadius: - BorderRadius.all(Radius.circular(8)), - ), - child: Column( + margin: EdgeInsets.only( + left: 16, right: 16, top: 26, bottom: 8), + padding: EdgeInsets.all(20), + decoration: BoxDecoration( + color: Colors.white, + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ) + ], + borderRadius: BorderRadius.all(Radius.circular(8)), + ), + child: Column( + children: [ + Row( + children: [ + Image.asset( + "assets/image/icon_order_exchange_info.webp", + width: 24, + height: 24, + ), + SizedBox(width: 4), + Text( + S.of(context).duihuanxinxi, + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 16, + color: Color(0xFF353535)), + ), + ], + ), + SizedBox( + height: 18.h, + ), + GestureDetector( + onTap: () { + setState(() { + // showAlertDialog(); + }); + }, + child: Row( children: [ - Row( - children: [ - Image.asset( - "assets/image/icon_order_exchange_info.webp", - width: 24, - height: 24, - ), - SizedBox(width: 4), - Text( - S.of(context).duihuanxinxi, - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 16, - color: Color(0xFF353535)), - ), - ], + Text( + S.of(context).lingqufangshi, + style: TextStyle( + fontSize: 14.sp, + color: Color(0xFF353535), + ), ), SizedBox( - height: 18.h, - ), - GestureDetector( - onTap: () { - setState(() { - // showAlertDialog(); - }); - }, - child: Row( - children: [ - Text( - S.of(context).lingqufangshi, - style: TextStyle( - fontSize: 14.sp, - color: Color(0xFF353535), - ), - ), - SizedBox( - width: 12.w, - ), - Expanded( - child: Text( - widget.arguments["useTyped"] == 1 - ? S.of(context).ziti - : widget.arguments["useTyped"] == 2 - ? S.of(context).peisong - : S.of(context).xianshangfafang, - style: TextStyle( - fontSize: 14.sp, - color: Color(0xFF353535), - ), - )), - // Icon( - // Icons.keyboard_arrow_right, - // size: 16, - // color: Color(0xFF32A060), - // ), - ], - ), + width: 12.w, ), - Visibility( - child: SizedBox( - height: 13.h, + Expanded( + child: Text( + widget.arguments["useTyped"] == 1 + ? S.of(context).ziti + : widget.arguments["useTyped"] == 2 + ? S.of(context).peisong + : S.of(context).xianshangfafang, + style: TextStyle( + fontSize: 14.sp, + color: Color(0xFF353535), ), - visible: widget.arguments["useTyped"] != 3, - ), - Visibility( - child: Row( - children: [ - Text( - S.of(context).zitidizhi, - style: TextStyle( - fontSize: 14.sp, - color: Color(0xFF353535), - ), - ), - SizedBox( - width: 12.w, - ), - Expanded( - child: GestureDetector( - onTap: () { - toAddressPicker(); - }, - child: Row( - mainAxisAlignment: - MainAxisAlignment.end, - crossAxisAlignment: - CrossAxisAlignment.end, - mainAxisSize: MainAxisSize.min, - children: [ - Expanded( - child: Text( - (address != null && - address != "") - ? address - : widget.arguments[ - "useTyped"] == - 1 - ? S - .of(context) - .qingxuanzhemendian - : widget.arguments[ - "useTyped"] == - 2 - ? S - .of(context) - .qingxuanzeshouhuodizhi - : S - .of(context) - .xuni, - overflow: - TextOverflow.ellipsis, - style: TextStyle( - fontSize: 14.sp, - color: Color(0xFF32A060), - ), - ), - flex: 1, - ), - Icon( - Icons.keyboard_arrow_right, - size: 16, - color: Color(0xFF32A060), - ), - ], - ), - ), - flex: 1, - ), - ], + )), + // Icon( + // Icons.keyboard_arrow_right, + // size: 16, + // color: Color(0xFF32A060), + // ), + ], + ), + ), + Visibility( + child: SizedBox( + height: 13.h, + ), + visible: widget.arguments["useTyped"] != 3, + ), + Visibility( + child: Row( + children: [ + Text( + S.of(context).zitidizhi, + style: TextStyle( + fontSize: 14.sp, + color: Color(0xFF353535), ), - visible: widget.arguments["useTyped"] != 3, ), SizedBox( - height: 12.h, + width: 12.w, ), - Row( - children: [ - Visibility( - visible: - widget.arguments["useTyped"] != 3, - child: Text( - S.of(context).zitishijian, - style: TextStyle( - fontSize: 14.sp, - color: Color(0xFF353535)), - ), - ), - Visibility( - visible: - widget.arguments["useTyped"] != 3, - child: SizedBox( - width: 12.w, - ), - ), - Text( - widget.arguments["useTyped"] == 1 - ? S - .of(context) - .duihuanhouwugegongzuori - : widget.arguments["useTyped"] == 2 - ? S.of(context).duihuanhoufahuo - : S.of(context).feishiwushangpin, - style: TextStyle( - fontSize: 14.sp, - color: - widget.arguments["useTyped"] == 3 - ? Color(0xFF32A060) - : Color(0xFF353535)), + Expanded( + child: GestureDetector( + onTap: () { + toAddressPicker(); + }, + child: Row( + mainAxisAlignment: MainAxisAlignment.end, + crossAxisAlignment: + CrossAxisAlignment.end, + mainAxisSize: MainAxisSize.min, + children: [ + Expanded( + child: Text( + (address != null && address != "") + ? address + : widget.arguments[ + "useTyped"] == + 1 + ? S + .of(context) + .qingxuanzhemendian + : widget.arguments[ + "useTyped"] == + 2 + ? S + .of(context) + .qingxuanzeshouhuodizhi + : S.of(context).xuni, + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 14.sp, + color: Color(0xFF32A060), + ), + ), + flex: 1, + ), + Icon( + Icons.keyboard_arrow_right, + size: 16, + color: Color(0xFF32A060), + ), + ], ), - ], + ), + flex: 1, ), ], ), + visible: widget.arguments["useTyped"] != 3, ), - // : - // // Container( - // // margin: - // // EdgeInsets.only(left: 16, right: 16, top: 26, bottom: 8), - // // padding: EdgeInsets.all(20), - // // decoration: BoxDecoration( - // // color: Colors.white, - // // boxShadow: [ - // // BoxShadow( - // // color: Colors.black.withAlpha(12), - // // offset: Offset(0, 3), - // // blurRadius: 14, - // // spreadRadius: 0, - // // ) - // // ], - // // borderRadius: BorderRadius.all(Radius.circular(8)), - // // ), - // // child: Column( - // // mainAxisAlignment: MainAxisAlignment.spaceAround, - // // crossAxisAlignment: CrossAxisAlignment.start, - // // children: [ - // // Row( - // // children: [ - // // Image.asset( - // // "assets/image/icon_order_exchange_info.webp", - // // width: 24, - // // height: 24, - // // ), - // // SizedBox(width: 4), - // // Text( - // // S.of(context).duihuanxinxi, - // // style: TextStyle( - // // fontWeight: FontWeight.bold, - // // fontSize: 16, - // // color: Color(0xFF353535)), - // // ), - // // ], - // // ), - // // SizedBox( - // // height: 18.h, - // // ), - // // Row( - // // children: [ - // // Text( - // // S.of(context).lingqufangshi, - // // style: TextStyle( - // // fontSize: 14.sp, - // // color: Color(0xFF353535), - // // ), - // // ), - // // SizedBox( - // // width: 12.w, - // // ), - // // Text( - // // widget.arguments["useTyped"] == 1 - // // ? S.of(context).ziti - // // : widget.arguments["useTyped"] == 2 - // // ? S.of(context).peisong - // // : S.of(context).xianshangfafang, - // // style: TextStyle( - // // fontSize: 14.sp, - // // color: Color(0xFF353535), - // // ), - // // ), - // // ], - // // ), - // // SizedBox( - // // height: 12.h, - // // ), - // // Text( - // // "非实物商品兑换后领取到卡包即可使用!", - // // style: TextStyle( - // // fontSize: 14.sp, - // // color: Color(0xFF32A060), - // // fontWeight: MyFontWeight.medium - // // ), - // // ), - // // ], - // // ), - // // ), - // Container( - // margin: EdgeInsets.only( - // left: 16, right: 16, top: 26, bottom: 8), - // padding: EdgeInsets.all(20), - // decoration: BoxDecoration( - // color: Colors.white, - // boxShadow: [ - // BoxShadow( - // color: Colors.black.withAlpha(12), - // offset: Offset(0, 3), - // blurRadius: 14, - // spreadRadius: 0, - // ) - // ], - // borderRadius: - // BorderRadius.all(Radius.circular(8)), - // ), - // child: Column( - // children: [ - // Row( - // children: [ - // Image.asset( - // "assets/image/icon_order_exchange_info.webp", - // width: 24, - // height: 24, - // ), - // SizedBox(width: 4), - // Text( - // S.of(context).duihuanxinxi, - // style: TextStyle( - // fontWeight: FontWeight.bold, - // fontSize: 16, - // color: Color(0xFF353535)), - // ), - // ], - // ), - // SizedBox( - // height: 18.h, - // ), - // GestureDetector( - // onTap: () { - // setState(() { - // showAlertDialog(); - // }); - // }, - // child: Row( - // children: [ - // Text( - // S.of(context).lingqufangshi, - // style: TextStyle( - // fontSize: 14.sp, - // color: Color(0xFF353535), - // ), - // ), - // SizedBox( - // width: 12.w, - // ), - // Expanded( - // child: Text( - // widget.arguments["useTyped"] == 1 - // ? S.of(context).ziti - // : widget.arguments["useTyped"] == 2 - // ? S.of(context).peisong - // : S.of(context).xianshangfafang, - // style: TextStyle( - // fontSize: 14.sp, - // color: Color(0xFF353535), - // ), - // )), - // Icon( - // Icons.keyboard_arrow_right, - // size: 16, - // color: Color(0xFF32A060), - // ), - // ], - // ), - // ), - // Visibility( - // child: SizedBox( - // height: 13.h, - // ), - // visible: widget.arguments["useTyped"] != 3, - // ), - // Visibility( - // child: Row( - // children: [ - // Text( - // "收货地址", - // style: TextStyle( - // fontSize: 14.sp, - // color: Color(0xFF353535), - // ), - // ), - // SizedBox( - // width: 12.w, - // ), - // Expanded( - // child: GestureDetector( - // onTap: () { - // toAddressPicker(); - // }, - // child: Row( - // mainAxisAlignment: - // MainAxisAlignment.end, - // crossAxisAlignment: - // CrossAxisAlignment.end, - // mainAxisSize: MainAxisSize.min, - // children: [ - // Expanded( - // child: Text( - // (address != null && - // address != "") - // ? address - // : widget.arguments[ - // "useTyped"] == - // 1 - // ? S - // .of(context) - // .qingxuanzhemendian - // : widget.arguments[ - // "useTyped"] == - // 2 - // ? S - // .of(context) - // .qingxuanzeshouhuodizhi - // : S - // .of(context) - // .xuni, - // overflow: - // TextOverflow.ellipsis, - // style: TextStyle( - // fontSize: 14.sp, - // color: Color(0xFF32A060), - // ), - // ), - // flex: 1, - // ), - // Icon( - // Icons.keyboard_arrow_right, - // size: 16, - // color: Color(0xFF32A060), - // ), - // ], - // ), - // ), - // flex: 1, - // ), - // ], - // ), - // visible: widget.arguments["useTyped"] != 3, - // ), - // SizedBox( - // height: 12.h, - // ), - // ], - // ), - // ), + SizedBox( + height: 12.h, + ), + Row( + children: [ + Visibility( + visible: widget.arguments["useTyped"] != 3, + child: Text( + S.of(context).zitishijian, + style: TextStyle( + fontSize: 14.sp, + color: Color(0xFF353535)), + ), + ), + Visibility( + visible: widget.arguments["useTyped"] != 3, + child: SizedBox( + width: 12.w, + ), + ), + Text( + widget.arguments["useTyped"] == 1 + ? S.of(context).duihuanhouwugegongzuori + : widget.arguments["useTyped"] == 2 + ? S.of(context).duihuanhoufahuo + : S.of(context).feishiwushangpin, + style: TextStyle( + fontSize: 14.sp, + color: widget.arguments["useTyped"] == 3 + ? Color(0xFF32A060) + : Color(0xFF353535)), + ), + ], + ), + ], + ), + ), + // : + // // Container( + // // margin: + // // EdgeInsets.only(left: 16, right: 16, top: 26, bottom: 8), + // // padding: EdgeInsets.all(20), + // // decoration: BoxDecoration( + // // color: Colors.white, + // // boxShadow: [ + // // BoxShadow( + // // color: Colors.black.withAlpha(12), + // // offset: Offset(0, 3), + // // blurRadius: 14, + // // spreadRadius: 0, + // // ) + // // ], + // // borderRadius: BorderRadius.all(Radius.circular(8)), + // // ), + // // child: Column( + // // mainAxisAlignment: MainAxisAlignment.spaceAround, + // // crossAxisAlignment: CrossAxisAlignment.start, + // // children: [ + // // Row( + // // children: [ + // // Image.asset( + // // "assets/image/icon_order_exchange_info.webp", + // // width: 24, + // // height: 24, + // // ), + // // SizedBox(width: 4), + // // Text( + // // S.of(context).duihuanxinxi, + // // style: TextStyle( + // // fontWeight: FontWeight.bold, + // // fontSize: 16, + // // color: Color(0xFF353535)), + // // ), + // // ], + // // ), + // // SizedBox( + // // height: 18.h, + // // ), + // // Row( + // // children: [ + // // Text( + // // S.of(context).lingqufangshi, + // // style: TextStyle( + // // fontSize: 14.sp, + // // color: Color(0xFF353535), + // // ), + // // ), + // // SizedBox( + // // width: 12.w, + // // ), + // // Text( + // // widget.arguments["useTyped"] == 1 + // // ? S.of(context).ziti + // // : widget.arguments["useTyped"] == 2 + // // ? S.of(context).peisong + // // : S.of(context).xianshangfafang, + // // style: TextStyle( + // // fontSize: 14.sp, + // // color: Color(0xFF353535), + // // ), + // // ), + // // ], + // // ), + // // SizedBox( + // // height: 12.h, + // // ), + // // Text( + // // "非实物商品兑换后领取到卡包即可使用!", + // // style: TextStyle( + // // fontSize: 14.sp, + // // color: Color(0xFF32A060), + // // fontWeight: MyFontWeight.medium + // // ), + // // ), + // // ], + // // ), + // // ), + // Container( + // margin: EdgeInsets.only( + // left: 16, right: 16, top: 26, bottom: 8), + // padding: EdgeInsets.all(20), + // decoration: BoxDecoration( + // color: Colors.white, + // boxShadow: [ + // BoxShadow( + // color: Colors.black.withAlpha(12), + // offset: Offset(0, 3), + // blurRadius: 14, + // spreadRadius: 0, + // ) + // ], + // borderRadius: + // BorderRadius.all(Radius.circular(8)), + // ), + // child: Column( + // children: [ + // Row( + // children: [ + // Image.asset( + // "assets/image/icon_order_exchange_info.webp", + // width: 24, + // height: 24, + // ), + // SizedBox(width: 4), + // Text( + // S.of(context).duihuanxinxi, + // style: TextStyle( + // fontWeight: FontWeight.bold, + // fontSize: 16, + // color: Color(0xFF353535)), + // ), + // ], + // ), + // SizedBox( + // height: 18.h, + // ), + // GestureDetector( + // onTap: () { + // setState(() { + // showAlertDialog(); + // }); + // }, + // child: Row( + // children: [ + // Text( + // S.of(context).lingqufangshi, + // style: TextStyle( + // fontSize: 14.sp, + // color: Color(0xFF353535), + // ), + // ), + // SizedBox( + // width: 12.w, + // ), + // Expanded( + // child: Text( + // widget.arguments["useTyped"] == 1 + // ? S.of(context).ziti + // : widget.arguments["useTyped"] == 2 + // ? S.of(context).peisong + // : S.of(context).xianshangfafang, + // style: TextStyle( + // fontSize: 14.sp, + // color: Color(0xFF353535), + // ), + // )), + // Icon( + // Icons.keyboard_arrow_right, + // size: 16, + // color: Color(0xFF32A060), + // ), + // ], + // ), + // ), + // Visibility( + // child: SizedBox( + // height: 13.h, + // ), + // visible: widget.arguments["useTyped"] != 3, + // ), + // Visibility( + // child: Row( + // children: [ + // Text( + // "收货地址", + // style: TextStyle( + // fontSize: 14.sp, + // color: Color(0xFF353535), + // ), + // ), + // SizedBox( + // width: 12.w, + // ), + // Expanded( + // child: GestureDetector( + // onTap: () { + // toAddressPicker(); + // }, + // child: Row( + // mainAxisAlignment: + // MainAxisAlignment.end, + // crossAxisAlignment: + // CrossAxisAlignment.end, + // mainAxisSize: MainAxisSize.min, + // children: [ + // Expanded( + // child: Text( + // (address != null && + // address != "") + // ? address + // : widget.arguments[ + // "useTyped"] == + // 1 + // ? S + // .of(context) + // .qingxuanzhemendian + // : widget.arguments[ + // "useTyped"] == + // 2 + // ? S + // .of(context) + // .qingxuanzeshouhuodizhi + // : S + // .of(context) + // .xuni, + // overflow: + // TextOverflow.ellipsis, + // style: TextStyle( + // fontSize: 14.sp, + // color: Color(0xFF32A060), + // ), + // ), + // flex: 1, + // ), + // Icon( + // Icons.keyboard_arrow_right, + // size: 16, + // color: Color(0xFF32A060), + // ), + // ], + // ), + // ), + // flex: 1, + // ), + // ], + // ), + // visible: widget.arguments["useTyped"] != 3, + // ), + // SizedBox( + // height: 12.h, + // ), + // ], + // ), + // ), Container( margin: EdgeInsets.only( left: 16, right: 16, top: 8, bottom: 16), @@ -644,20 +635,30 @@ class _ExchangeOrderPage extends State { width: 12, ), Text( - widget.arguments["payType"] == 1 - ? "${(double.parse(widget.arguments["onePrice"]) * buyNum).toInt()}积分" - : ((widget.arguments["price"] == null || - widget.arguments["price"] == "0" - ? "" - : "${(double.parse(widget.arguments["price"]) * buyNum).toInt()}积分") + - (widget.arguments["money"] == null || - widget.arguments["money"] == - "0.00" - ? "" - : " + ${AppUtils.calculateDouble(double.tryParse(widget.arguments["money"]) * buyNum) ?? 0}元")), + // widget.arguments["payType"] == 1 + // ? "${(double.parse(widget.arguments["oneBean"] ?? "0") * buyNum).toInt()}印章" + // : (widget.arguments["payType"] == 2 ?"${(double.parse(widget.arguments["onePrice"]) * buyNum).toInt()}积分" + // :((widget.arguments["price"] == null || + // widget.arguments["price"] == "0" + // ? (widget.arguments["oneBean"] != "0" && double.parse(userInfo?.happyBean ?? "0") <= double.parse(widget.arguments["oneBean"] ??"0") + // ? "${AppUtils.calculateDouble(double.parse(widget.arguments["oneBean"] ?? "0") * buyNum)}印章" + // :(widget.arguments["onePrice"] != "0" && double.parse(userInfo?.points ?? "0") <= double.parse(widget.arguments["onePrice"]) + // ?"${AppUtils.calculateDouble(double.parse(widget.arguments["onePrice"]) * buyNum)}积分" + // :"${AppUtils.calculateDouble(double.parse(widget.arguments["oneMoney"]) * buyNum)}元")) + // : "${(double.parse(widget.arguments["price"]) * buyNum).toInt()}积分") + + // (widget.arguments["money"] == null || + // widget.arguments["money"] == + // "0.00" + // ? "" + // : " + ${AppUtils.calculateDouble(double.tryParse(widget.arguments["money"]) * buyNum) ?? 0}元"))), + payableAmount(), style: TextStyle( fontSize: 12, - decoration: (widget.arguments["payType"] == 3) + decoration: (widget.arguments["payType"] == + 4 && + ((widget.arguments["price"] != "0" && widget.arguments["money"] != "0.00" + || (widget.arguments["oneBean"] ?? "0") != "0" + || widget.arguments["onePrice"] != "0"))) ? TextDecoration.lineThrough : TextDecoration.none, fontFamily: 'JDZhengHT', @@ -669,13 +670,17 @@ class _ExchangeOrderPage extends State { SizedBox( height: 12, ), - if (widget.arguments["payType"] == 3) + if (widget.arguments["payType"] == 4 && + (widget.arguments["price"] != "0" && + widget.arguments["money"] != "0.00" || + (widget.arguments["oneBean"] ?? "0") != "0" || + widget.arguments["onePrice"] != "0")) Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.center, children: [ Text( - "现金抵扣积分", + payableAmount().contains(S.of(context).jihuanka)? "现金抵扣集换卡":"现金抵扣积分", style: TextStyle( fontSize: 14, color: Color(0xFF353535), @@ -685,7 +690,7 @@ class _ExchangeOrderPage extends State { width: 12, ), Text( - "${double.parse(widget.arguments["oneMoney"]) * buyNum}元", + "${AppUtils.calculateDouble(double.parse(widget.arguments["oneMoney"]) * buyNum)}元", style: TextStyle( fontSize: 12, fontFamily: 'JDZhengHT', @@ -715,7 +720,8 @@ class _ExchangeOrderPage extends State { handleNeedPay(), style: TextStyle( fontFamily: 'JDZhengHT', - fontSize: 12.sp, color: Color(0xFF32A060)), + fontSize: 12.sp, + color: Color(0xFF32A060)), ), ], ), @@ -778,16 +784,23 @@ class _ExchangeOrderPage extends State { setState(() { if (widget.arguments["payType"] == 1 ? (double.parse(widget - .arguments["onePrice"]) * + .arguments["oneBean"]) * (buyNum + 1)) > - double.parse(points) - : (widget.arguments["price"] == null || - widget.arguments["price"] == "0" - ? false - : (double.parse(widget - .arguments["price"]) * + double.parse(happyBean) + : (widget.arguments["payType"] == 2 + ? (double.parse(widget.arguments[ + "onePrice"]) * (buyNum + 1)) > - double.parse(points))) { + double.parse(points) + : (widget.arguments["price"] == + null || + widget.arguments["price"] == + "0" + ? false + : (double.parse(widget + .arguments["price"]) * + (buyNum + 1)) > + double.parse(points)))) { SmartDialog.showToast("您的积分不足", alignment: Alignment.center); return; @@ -806,8 +819,8 @@ class _ExchangeOrderPage extends State { ], ), ), - if (widget.arguments["payType"] == 3 || - (widget.arguments["payType"] == 2 && + if (widget.arguments["payType"] == 4 || + (widget.arguments["payType"] == 3 && widget.arguments["money"] != "0.00")) Container( width: double.infinity, @@ -889,7 +902,7 @@ class _ExchangeOrderPage extends State { ), ), SizedBox( - height: 10, + height: 10.h, ), // GestureDetector( // onTap: () { @@ -929,7 +942,7 @@ class _ExchangeOrderPage extends State { // ), // ), SizedBox( - height: 10, + height: 10.h, ), GestureDetector( onTap: () { @@ -962,7 +975,7 @@ class _ExchangeOrderPage extends State { ], ), ), - SizedBox(height:100.h) + SizedBox(height: 100.h) ], )), Align( @@ -971,11 +984,10 @@ class _ExchangeOrderPage extends State { height: 54.h, decoration: BoxDecoration( color: Colors.white, - borderRadius: BorderRadius.circular( - 45 - ), + borderRadius: BorderRadius.circular(45), ), - margin: EdgeInsets.only(bottom:20.h,left: 16.w,right: 16.w), + margin: + EdgeInsets.only(bottom: 20.h, left: 16.w, right: 16.w), child: Row( children: [ Spacer(), @@ -1018,18 +1030,19 @@ class _ExchangeOrderPage extends State { topRight: Radius.circular(45), ), ), - child: Text( - widget.arguments["payType"] == 3 || - (widget.arguments["payType"] == 2 && - widget.arguments["money"] != "0.00") - ? S.current.jiesuan - : S.current.duihuan, - style: TextStyle( - fontSize: 16.sp, - fontWeight: MyFontWeight.regular, - color: Colors.white, + child: Text( + widget.arguments["payType"] == 4 || + (widget.arguments["payType"] == 3 && + widget.arguments["money"] != "0.00") + ? S.current.jiesuan + : S.current.duihuan, + style: TextStyle( + fontSize: 16.sp, + fontWeight: MyFontWeight.regular, + color: Colors.white, + ), ), - ),), + ), ), ], ), @@ -1053,21 +1066,48 @@ class _ExchangeOrderPage extends State { ); } + ///应付数额价格显示 + String payableAmount() { + if (widget.arguments["payType"] == 0) return ""; + if (widget.arguments["payType"] == 1) { + return "${(double.parse(widget.arguments["oneBean"] ?? "0") * buyNum).toInt()}集换卡"; + } else if (widget.arguments["payType"] == 2) { + return "${(double.parse(widget.arguments["onePrice"]) * buyNum).toInt()}积分"; + } else if (widget.arguments["payType"] == 3) { + return "${(double.parse(widget.arguments["price"]) * buyNum).toInt()}积分" + " + ${AppUtils.calculateDouble(double.tryParse(widget.arguments["money"]) * buyNum) ?? 0}元"; + } else if (widget.arguments["payType"] == 4) { + if ((widget.arguments["oneBean"] ?? "0") != "0") { + return "${AppUtils.calculateDouble(double.parse(widget.arguments["oneBean"] ?? "0") * buyNum)}集换卡"; + } else if (widget.arguments["onePrice"] != "0") { + return "${AppUtils.calculateDouble(double.parse(widget.arguments["onePrice"]) * buyNum)}积分"; + } else if ((widget.arguments["price"] != null || widget.arguments["price"] != "0") && (widget.arguments["money"] != null || widget.arguments["money"] != "0.00")) { + if(widget.arguments["price"] == "0"){ + return "${AppUtils.calculateDouble(double.parse(widget.arguments["oneMoney"]) * buyNum)}元"; + } + return "${(double.parse(widget.arguments["price"]) * buyNum).toInt()}积分" + " + ${AppUtils.calculateDouble(double.tryParse(widget.arguments["money"]) * buyNum) ?? 0}元"; + } + } + } + + ///总价支付价格 String handleNeedPay() { - if(widget.arguments["payType"] == 0) - return ""; - if(widget.arguments["payType"] == 1){ - return S.of(context).jifen_((double.parse(widget.arguments["onePrice"]) * buyNum).toInt()); - }else if(widget.arguments["payType"] ==2){ + if (widget.arguments["payType"] == 0) return ""; + if (widget.arguments["payType"] == 1) { + return "${(double.parse(widget.arguments["oneBean"]) * buyNum).toInt()}集换卡"; + } + if (widget.arguments["payType"] == 2) { + return S.of(context).jifen_( + (double.parse(widget.arguments["onePrice"]) * buyNum).toInt()); + } else if (widget.arguments["payType"] == 3) { return (widget.arguments["price"] == null || - widget.arguments["price"] == "0" - ? "" - : "${(double.parse(widget.arguments["price"]) * buyNum).toInt()}积分") + + widget.arguments["price"] == "0" + ? "" + : "${(double.parse(widget.arguments["price"]) * buyNum).toInt()}积分") + (widget.arguments["money"] == null || - widget.arguments["money"] == "0.00" + widget.arguments["money"] == "0.00" ? "" : " + ${AppUtils.calculateDouble(double.tryParse(widget.arguments["money"]) * buyNum) ?? 0}元"); - }else if(widget.arguments["payType"] == 3){ + } else if (widget.arguments["payType"] == 4) { return "${AppUtils.calculateDouble(double.tryParse(widget.arguments["oneMoney"]) * buyNum) ?? 0}元"; } } @@ -1123,8 +1163,13 @@ class _ExchangeOrderPage extends State { } BaseData baseDate = await apiService.creditOrder({ "goodsId": widget.arguments["goodsId"], - "isOneSell": widget.arguments["payType"] != 2, - "isPoints": !handleNeedPay().contains("元"), + "isOneSell": widget.arguments["payType"] != 3, + + ///增加集换卡,该字段去掉改用payType + // "isPoints": !handleNeedPay().contains("元"), + "payType": (widget.arguments["payType"] == 1) + ? 2 + : ((widget.arguments["payType"] == 2) ? 1 : 3), "number": buyNum, "useTyped": widget.arguments["useTyped"], "payChannel": @@ -1134,8 +1179,8 @@ class _ExchangeOrderPage extends State { }); if (baseDate.isSuccess) { String realPay = handleNeedPay(); - if ((widget.arguments["payType"] == 3 || - (widget.arguments["payType"] == 2 && + if ((widget.arguments["payType"] == 4 || + (widget.arguments["payType"] == 3 && widget.arguments["money"] != "0.00")) && checkIndex == 3) { // if(Platform.isAndroid){ @@ -1165,14 +1210,20 @@ class _ExchangeOrderPage extends State { } await Navigator.of(context) .pushNamed('/router/exchange_order_success_page', arguments: { - "price": realPay.contains("积分") ? realPay.substring(0,realPay.indexOf("积分")) : "0", + "price": realPay.contains(S.of(context).jifen) + ? realPay.substring(0, realPay.indexOf(S.of(context).jifen)) + : "0", + "happyBeanPrice":realPay.contains(S.of(context).jihuanka) + ? realPay.substring(0, realPay.indexOf(S.of(context).jihuanka)) + : "0", "realPay": realPay, "points": points, + "happyBean":happyBean, "payChannel": widget.arguments["payChannel"], "id": baseDate.data }); - points = - "${int.tryParse(points) - int.tryParse(widget.arguments["price"])}"; + points = "${int.tryParse(points) - int.tryParse(widget.arguments["price"])}"; + happyBean = "${int.tryParse(happyBean) - int.tryParse(widget.arguments["price"])}"; Navigator.of(context).pop(); } else { SmartDialog.showToast(baseDate.msg, alignment: Alignment.center); diff --git a/lib/order/exchange_order_success_page.dart b/lib/order/exchange_order_success_page.dart index 50f4d462..0a24e2e4 100644 --- a/lib/order/exchange_order_success_page.dart +++ b/lib/order/exchange_order_success_page.dart @@ -26,17 +26,21 @@ class ExchangeOrderSuccessPage extends StatefulWidget { class _ExchangeOrderSuccessPage extends State { int price = 0; ApiService apiService; + int happyBeanPrice= 0; @override void initState() { super.initState(); price = double.parse((widget.arguments["points"] ?? "0").toString()).toInt() - double.parse((widget.arguments["price"] ?? "0").toString()).toInt(); + happyBeanPrice = double.parse((widget.arguments["happyBean"] ?? "0").toString()).toInt() - + double.parse((widget.arguments["happyBeanPrice"] ?? "0").toString()).toInt(); UserInfo userInfo; SharedPreferences.getInstance().then((value){ apiService = ApiService(Dio(), context: context, token: value.getString("token")); userInfo = UserInfo.fromJson(jsonDecode(value.getString('user'))); userInfo.points = "$price"; + userInfo.happyBean = "$happyBeanPrice"; value.setString('user', jsonEncode(userInfo.toJson())); }); @@ -79,7 +83,28 @@ class _ExchangeOrderSuccessPage extends State { fontWeight: MyFontWeight.semi_bold), ), SizedBox( - height: 70.h, + height:45.h, + ), + Text( + widget.arguments["realPay"].toString().contains(S.of(context).xiaofeijihuanka) ? + S.of(context).xiaofeijihuanka: (widget.arguments["realPay"].toString().contains(S.of(context).jifen) ? S.of(context).xiaofeijifen : "消费金额"), + style: TextStyle( + color: Color(0xFF727272), + fontSize: 14.sp, + ), + ), + SizedBox( + height: 5.h, + ), + Text( + widget.arguments["realPay"], + style: TextStyle( + color: Color(0xFF32A060), + fontSize: 21.sp, + fontWeight: MyFontWeight.bold), + ), + SizedBox( + height: 34.h, ), Row( children: [ @@ -87,53 +112,53 @@ class _ExchangeOrderSuccessPage extends State { child: Column( children: [ Text( - widget.arguments["realPay"], + "可用集换卡", style: TextStyle( - color: Colors.black, - fontSize: 21.sp, - fontWeight: MyFontWeight.semi_bold), + color: Color(0xFF727272), + fontSize: 14.sp, + ), ), SizedBox( height: 14.h, ), Text( - S.of(context).xiaofeijifen, + "$happyBeanPrice", style: TextStyle( - color: Color(0xFF727272), - fontSize: 14.sp, - ), - ) + color: Colors.black, + fontSize: 21.sp, + fontWeight: MyFontWeight.regular), + ), ], ), flex: 1, ), Container( - width: 2.w, - height: 34.h, - color: Color(0xFFABABAB), + width: 1.w, + height: 53.h, + color: Color(0xFFD8D8D8), margin: EdgeInsets.only(top: 18.h, bottom: 7.h), ), Expanded( child: Column( children: [ Text( - "$price", + S.of(context).keyongjifen, style: TextStyle( - color: Colors.black, - fontSize: 21.sp, - fontWeight: MyFontWeight.semi_bold, + color: Color(0xFF727272), + fontSize: 14.sp, ), ), SizedBox( height: 14.h, ), Text( - S.of(context).keyongjifen, + "$price", style: TextStyle( - color: Color(0xFF727272), - fontSize: 14.sp, + color: Colors.black, + fontSize: 21.sp, + fontWeight: MyFontWeight.regular, ), - ) + ), ], ), flex: 1, diff --git a/lib/order/order_view/order_commodity.dart b/lib/order/order_view/order_commodity.dart index 1fc95527..f251faa5 100644 --- a/lib/order/order_view/order_commodity.dart +++ b/lib/order/order_view/order_commodity.dart @@ -9,6 +9,8 @@ import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/view_widget/custom_image.dart'; import 'package:huixiang/view_widget/separator.dart'; +import '../../utils/flutter_utils.dart'; + class OrderCommodity extends StatefulWidget { final OrderInfo orderInfo; @@ -87,6 +89,18 @@ class _OrderCommodity extends State { ); } + if (widget.orderInfo.isTakeOut == 3) { + //打包费 + widgets.add( + discountItem( + Color(0xFFFF7A1A), + "打包费", + "", + "+ ${widget.orderInfo?.totalPackagingFee ?? "0"}", + ), + ); + } + if (widget.orderInfo.benefitDiscountAmount != "0.00") { // 优惠券 widgets.add( @@ -169,12 +183,14 @@ class _OrderCommodity extends State { return Container( margin: EdgeInsets.only(top: 8.h, bottom: 8.h), child: Row( + crossAxisAlignment: CrossAxisAlignment.center, children: [ MImage( productList.skuImg, - width: 44.w, - height: 44, + width: 49, + height: 49, fit: BoxFit.cover, + radius: BorderRadius.circular(2), errorSrc: "assets/image/default_1.webp", fadeSrc: "assets/image/default_1.webp", ), @@ -182,68 +198,74 @@ class _OrderCommodity extends State { flex: 1, child: Container( margin: EdgeInsets.only( - left: 16.w, + left: 8.w, ), // height: 44.h, child: Column( mainAxisAlignment: MainAxisAlignment.spaceAround, crossAxisAlignment: CrossAxisAlignment.start, children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Expanded(child:Text( - productList.productName, - maxLines: 1, - overflow: TextOverflow.ellipsis, - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 14.sp, - color: Color(0xFF353535), - ), - )), - Text( - "x${productList.buyNum}", - style: TextStyle( - fontSize: 12.sp, - color: Color(0xFF727272), - ), - ), - ], + Text( + productList.productName, + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 14.sp, + color: Color(0xFF353535), + ), + ), + SizedBox( + height: 4.h, ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Expanded( - flex: 1, - child: Text( - productList.skuNameStr != null - ? "${productList.skuNameStr}" - : "", - overflow: TextOverflow.ellipsis, - style: TextStyle( - fontSize: 12.sp, - color: Color(0xFFA29E9E), - ), - ), - ), - Text( - S.of(context).yuan_(productList.sellPrice), - style: TextStyle( - fontWeight: MyFontWeight.medium, - fontSize: 12.sp, - fontFamily: 'JDZhengHT', - color: Color(0xFF4C4C4C), - ), - ) - ], + Text( + productList.skuNameStr != null + ? "${productList.skuNameStr ?? ""}" + : "", + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 10.sp, + color: Color(0xFFA29E9E), + ), + ), + Text( + "x${productList.buyNum}", + style: TextStyle( + fontSize: 12.sp, + color: Color(0xFF727272), + ), ), ], ), ), ), + Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Text( + productList.buyNum > 1 + ? S.of(context).yuan_(AppUtils.calculateDouble(double.tryParse(productList.sellPrice ?? "0") - AppUtils.stringAsFixedDouble2((double.tryParse(productList.discountAmount ?? "0") / productList.buyNum)))) + : S.of(context).yuan_(AppUtils.calculateDouble(double.tryParse(productList.sellPrice ?? "0") - double.tryParse(productList.discountAmount ?? "0"))), + style: TextStyle( + fontWeight: MyFontWeight.medium, + fontSize: 14.sp, + color: Color(0xFF4C4C4C), + ), + ), + if (productList.discountAmount != null && productList.discountAmount != "0") + Text( + S.of(context).yuan_(productList.sellPrice), + style: TextStyle( + fontWeight: MyFontWeight.regular, + fontSize: 12.sp, + fontFamily: 'JDZhengHT', + decoration: TextDecoration.lineThrough, + color: Color(0xFFA29E9E), + ), + ) + ], + ), ], ), ); diff --git a/lib/retrofit/data/exchange_order.dart b/lib/retrofit/data/exchange_order.dart index 9204c407..64267fff 100644 --- a/lib/retrofit/data/exchange_order.dart +++ b/lib/retrofit/data/exchange_order.dart @@ -14,6 +14,7 @@ class ExchangeOrder { String amount; String money; int payStatus; + int payType; int sendStatus; String address; String recAddress; @@ -34,6 +35,7 @@ class ExchangeOrder { ..amount = json['amount'] as String ..money = json['money'] as String ..payStatus = json['payStatus'] as int + ..payType = json['payType'] as int ..sendStatus = json['sendStatus'] as int ..address = json['address'] as String ..recAddress = json['recAddress'] as String @@ -58,6 +60,7 @@ class ExchangeOrder { 'amount': this.amount, 'money': this.money, 'payStatus': this.payStatus, + 'payType':this.payType, 'sendStatus': this.sendStatus, 'address': this.address, 'recAddress': this.recAddress, diff --git a/lib/retrofit/data/findMiNiGroupList.dart b/lib/retrofit/data/findMiNiGroupList.dart index de60e3cb..8b22f8f5 100644 --- a/lib/retrofit/data/findMiNiGroupList.dart +++ b/lib/retrofit/data/findMiNiGroupList.dart @@ -103,6 +103,7 @@ class ProductListBean { String printerFlag; dynamic markProductNone; SubscribeParam subscribeParam; + bool isSetMeal; static ProductListBean fromJson(Map map) { if (map == null) return null; @@ -137,6 +138,7 @@ class ProductListBean { productListBean.printerFlag = map['printerFlag']; productListBean.markProductNone = map['markProductNone']; productListBean.subscribeParam = SubscribeParam.fromJson(map['subscribeParam']); + productListBean.isSetMeal = map['isSetMeal']; return productListBean; } @@ -171,6 +173,7 @@ class ProductListBean { "printerFlag": printerFlag, "markProductNone": markProductNone, "subscribeParam": subscribeParam, + "isSetMeal": isSetMeal, }; } diff --git a/lib/retrofit/data/goods.dart b/lib/retrofit/data/goods.dart index e19934b4..6a3065a0 100644 --- a/lib/retrofit/data/goods.dart +++ b/lib/retrofit/data/goods.dart @@ -42,6 +42,7 @@ class Goods { String money, String onePrice, String oneMoney, + String oneBean, String orderId, int stock, int sales, @@ -69,6 +70,7 @@ class Goods { _money = money; _onePrice = onePrice; _oneMoney = oneMoney; + _oneBean = oneBean; _orderId = orderId; _stock = stock; _sales = sales; @@ -99,6 +101,7 @@ class Goods { _money = json['money']; _onePrice = json['onePrice']; _oneMoney = json['oneMoney']; + _oneBean = json['oneBean']; _orderId = json['orderId']; _stock = json['stock']; _sales = json['sales']; @@ -127,6 +130,7 @@ class Goods { String _money; String _onePrice; String _oneMoney; + String _oneBean; String _orderId; int _stock; int _sales; @@ -155,6 +159,7 @@ class Goods { String get money => _money; String get onePrice => _onePrice; String get oneMoney => _oneMoney; + String get oneBean => _oneBean; String get orderId => _orderId; int get stock => _stock; int get sales => _sales; @@ -185,6 +190,7 @@ class Goods { map['money'] = _money; map['onePrice'] = _onePrice; map['oneMoney'] = _oneMoney; + map['oneBean'] = _oneBean; map['orderId'] = _orderId; map['stock'] = _stock; map['sales'] = _sales; diff --git a/lib/retrofit/data/min_order_info.dart b/lib/retrofit/data/min_order_info.dart index 384bc124..c4aac5c2 100644 --- a/lib/retrofit/data/min_order_info.dart +++ b/lib/retrofit/data/min_order_info.dart @@ -61,6 +61,7 @@ class MinOrderInfo { String activityNoPrice, String activityDiscountPrice, String totalDiscountPrice, + String totalPackagingFee, String benefitDiscountAmount, int orderSource, dynamic address, @@ -145,6 +146,7 @@ class MinOrderInfo { this.activityNoPrice = activityNoPrice; this.activityDiscountPrice = activityDiscountPrice; this.totalDiscountPrice = totalDiscountPrice; + this.totalPackagingFee = totalPackagingFee; this.benefitDiscountAmount = benefitDiscountAmount; this.orderSource = orderSource; this.address = address; @@ -232,6 +234,7 @@ class MinOrderInfo { this.activityNoPrice = json['activityNoPrice']; this.activityDiscountPrice = json['activityDiscountPrice']; this.totalDiscountPrice = json['totalDiscountPrice']; + this.totalPackagingFee = json['totalPackagingFee']; this.benefitDiscountAmount = json['benefitDiscountAmount']; this.orderSource = json['orderSource']; this.address = json['address']; @@ -322,6 +325,7 @@ class MinOrderInfo { String activityNoPrice; String activityDiscountPrice; String totalDiscountPrice; + String totalPackagingFee; String benefitDiscountAmount; int orderSource; dynamic address; @@ -409,6 +413,7 @@ class MinOrderInfo { map['activityNoPrice'] = this.activityNoPrice; map['activityDiscountPrice'] = this.activityDiscountPrice; map['totalDiscountPrice'] = this.totalDiscountPrice; + map['totalPackagingFee'] = this.totalPackagingFee; map['benefitDiscountAmount'] = this.benefitDiscountAmount; map['orderSource'] = this.orderSource; map['address'] = this.address; diff --git a/lib/retrofit/data/order_info.dart b/lib/retrofit/data/order_info.dart index 3d1a2f3f..b2139368 100644 --- a/lib/retrofit/data/order_info.dart +++ b/lib/retrofit/data/order_info.dart @@ -122,6 +122,7 @@ class OrderInfo { String activityDiscountPrice; String vipDiscountPrice; String totalDiscountPrice; + String totalPackagingFee; int orderSource; StoreVO storeVO; OrderDetail orderDetail; @@ -186,6 +187,7 @@ class OrderInfo { String activityDiscountPrice, String vipDiscountPrice, String totalDiscountPrice, + String totalPackagingFee, int orderSource, StoreVO storeVO, OrderDetail orderDetail, @@ -248,6 +250,7 @@ class OrderInfo { this.activityDiscountPrice = activityDiscountPrice; this.vipDiscountPrice = vipDiscountPrice; this.totalDiscountPrice = totalDiscountPrice; + this.totalPackagingFee = totalPackagingFee; this.orderSource = orderSource; this.storeVO = storeVO; this.orderDetail = orderDetail; @@ -315,6 +318,7 @@ class OrderInfo { this.activityDiscountPrice = json["activityDiscountPrice"]; this.vipDiscountPrice = json["vipDiscountPrice"]; this.totalDiscountPrice = json["totalDiscountPrice"]; + this.totalPackagingFee =json["totalPackagingFee"]; this.orderSource = json["orderSource"]; this.storeVO = json["storeVO"] != null ? StoreVO.fromJson(json["storeVO"]) : null; @@ -391,6 +395,7 @@ class OrderInfo { map["activityDiscountPrice"] = this.activityDiscountPrice; map["vipDiscountPrice"] = this.vipDiscountPrice; map["totalDiscountPrice"] = this.totalDiscountPrice; + map["totalPackagingFee"] = this.totalPackagingFee; map["orderSource"] = this.orderSource; if (this.storeVO != null) { map["storeVO"] = this.storeVO.toJson(); diff --git a/lib/retrofit/data/order_product_vo.dart b/lib/retrofit/data/order_product_vo.dart index b0c75db1..64259663 100644 --- a/lib/retrofit/data/order_product_vo.dart +++ b/lib/retrofit/data/order_product_vo.dart @@ -19,7 +19,8 @@ class OrderProductVOList { String skuId, String skuImg, String skuNameStr, - List setMealDataList + List setMealDataList, + String packagingFee, }) { this.actInfo = actInfo; this.additionalComment = additionalComment; @@ -39,6 +40,7 @@ class OrderProductVOList { this.skuImg = skuImg; this.skuNameStr = skuNameStr; this.setMealDataList = setMealDataList; + this.packagingFee = packagingFee; } OrderProductVOList.fromJson(dynamic json) { @@ -66,6 +68,7 @@ class OrderProductVOList { this.setMealDataList = []..addAll( (json['setMealDataList'] as List ?? []) .map((o) => SetMealDataList.fromJson(o))); + this.packagingFee = json['packagingFee']; } ActInfo actInfo; @@ -86,7 +89,7 @@ class OrderProductVOList { String skuImg; String skuNameStr; List setMealDataList; - + String packagingFee; Map toJson() { final map = {}; @@ -114,6 +117,7 @@ class OrderProductVOList { map['skuImg'] = this.skuImg; map['skuNameStr'] = this.skuNameStr; map['setMealDataList']=this.setMealDataList; + map['packagingFee'] = this.packagingFee; return map; } diff --git a/lib/retrofit/data/rank.dart b/lib/retrofit/data/rank.dart index 1f7c8bc0..0c1ab3b1 100644 --- a/lib/retrofit/data/rank.dart +++ b/lib/retrofit/data/rank.dart @@ -22,6 +22,10 @@ class Rank { bool _status; String _updateTime; String _updateUser; + String _color; + String _textColor; + int _originScore; + int _demotionScore; String get createTime => _createTime; String get createUser => _createUser; @@ -35,14 +39,18 @@ class Rank { bool get status => _status; String get updateTime => _updateTime; String get updateUser => _updateUser; + String get color => _color; + String get textColor => _textColor; + int get originScore => _originScore; + int get demotionScore => _demotionScore; Rank({ String createTime, String createUser, String id, - String rankContent, - String rankImg, - String rankName, + String rankContent, + String rankImg, + String rankName, int rankOrigin, int level, bool status, @@ -60,6 +68,10 @@ class Rank { _status = status; _updateTime = updateTime; _updateUser = updateUser; + _color = color; + _textColor = textColor; + _originScore = originScore; + _demotionScore = demotionScore; } Rank.fromJson(dynamic json) { @@ -75,6 +87,10 @@ class Rank { _status = json["status"]; _updateTime = json["updateTime"]; _updateUser = json["updateUser"]; + _color = json["color"]; + _textColor = json["textColor"]; + _originScore = json["originScore"]; + _demotionScore = json["demotionScore"]; } Map toJson() { @@ -91,6 +107,10 @@ class Rank { map["status"] = _status; map["updateTime"] = _updateTime; map["updateUser"] = _updateUser; + map["color"] = _color; + map["textColor"] = _textColor; + map["originScore"] = _originScore; + map["demotionScore"] = _demotionScore; return map; } diff --git a/lib/retrofit/data/settleOrderInfo.dart b/lib/retrofit/data/settleOrderInfo.dart index 06c74d0b..4b7d6ccf 100644 --- a/lib/retrofit/data/settleOrderInfo.dart +++ b/lib/retrofit/data/settleOrderInfo.dart @@ -25,6 +25,7 @@ class SettleOrderInfo { String vipDiscountAmount; String totalDiscountAmount; String discountType; + String totalPackagingFee; static SettleOrderInfo fromJson(Map map) { @@ -58,6 +59,7 @@ class SettleOrderInfo { settleOrderInfoBean.vipDiscountAmount = map['vipDiscountAmount']; settleOrderInfoBean.totalDiscountAmount = map['totalDiscountAmount']; settleOrderInfoBean.discountType = map['discountType']; + settleOrderInfoBean.totalPackagingFee = map['totalPackagingFee']; return settleOrderInfoBean; } @@ -84,6 +86,7 @@ class SettleOrderInfo { "vipDiscountAmount":vipDiscountAmount, "totalDiscountAmount": totalDiscountAmount, "discountType":discountType, + "packagingFee" : totalPackagingFee, }; diff --git a/lib/retrofit/data/user_info.dart b/lib/retrofit/data/user_info.dart index 1c1c03ad..ed70e0cd 100644 --- a/lib/retrofit/data/user_info.dart +++ b/lib/retrofit/data/user_info.dart @@ -49,8 +49,8 @@ class UserInfo { String signature; String background; bool hasPayPassword; - - + String happyBean; + bool isVip; factory UserInfo.fromJson(Map json) => UserInfo() @@ -83,6 +83,8 @@ class UserInfo { ..signature = json['signature'] as String ..background = json['background'] as String ..hasPayPassword = json['hasPayPassword'] as bool + ..happyBean = json['happyBean'] as String + ..isVip = json['isVip'] as bool ..memberRankVo = json['memberRankVo'] == null ? null : MemberRank.fromJson(json['memberRankVo'] as Map); @@ -117,6 +119,8 @@ class UserInfo { 'signature' : this.signature, 'background' : this.background, 'hasPayPassword' : this.hasPayPassword, + 'happyBean':this.happyBean, + 'isVip':this.isVip, 'memberRankVo': this.memberRankVo == null ? "" : this.memberRankVo.toJson(), }; } diff --git a/lib/retrofit/min_api.dart b/lib/retrofit/min_api.dart index dc0384e3..286a292b 100644 --- a/lib/retrofit/min_api.dart +++ b/lib/retrofit/min_api.dart @@ -27,7 +27,7 @@ import 'data/shopping_home_config.dart'; part 'min_api.g.dart'; const localBaseUrl = "http://192.168.10.78:8765/app/";///本地 -// const localBaseUrl = "https://2946-27-19-77-115.jp.ngrok.io/app/";///本地 +// const localBaseUrl = "http://pos-test.api.lotus-wallet.com/app/";///测试 const serviceBaseUrl = "https://pos.api.lotus-wallet.com/app/";///线上 diff --git a/lib/retrofit/min_api.g.dart b/lib/retrofit/min_api.g.dart index b27f12ef..a1aac3c6 100644 --- a/lib/retrofit/min_api.g.dart +++ b/lib/retrofit/min_api.g.dart @@ -194,7 +194,7 @@ class _MinApiService implements MinApiService { data: _data); final value = BaseData>.fromJson( _result.data, - (json) => (json as List) + (json) => ((json??"") == "")?null:(json as List) .map( (i) => ShoppingCart.fromJson(i as Map)) .toList()); diff --git a/lib/retrofit/retrofit_api.dart b/lib/retrofit/retrofit_api.dart index f03753ed..78a38906 100644 --- a/lib/retrofit/retrofit_api.dart +++ b/lib/retrofit/retrofit_api.dart @@ -67,7 +67,7 @@ import 'data/wx_pay.dart'; part 'retrofit_api.g.dart'; const localBaseUrl = "http://192.168.10.78:8766/app/";///本地 -// const localBaseUrl = "https://2946-27-19-77-115.jp.ngrok.io/app/";///本地 +// const localBaseUrl = "http://platform.test.api.lotus-wallet.com/app/";///测试 const serviceBaseUrl = "https://pos.platform.lotus-wallet.com/app/";///线上 @RestApi(baseUrl: localBaseUrl) @@ -553,4 +553,12 @@ abstract class ApiService { ///通过code获取设置/助农列表 @GET("/raise/products") Future>> getConfig(); + + ///更换账户手机号码 + @POST("/auth/changePhone") + Future changePhone(@Body() Map param); + + ///修改手机号-发送验证码 + @GET("/auth/sendVerify/{mobile}") + Future changeSendVerify(@Path("mobile") String mobile); } diff --git a/lib/retrofit/retrofit_api.g.dart b/lib/retrofit/retrofit_api.g.dart index 19fb1bdf..4939dc2e 100644 --- a/lib/retrofit/retrofit_api.g.dart +++ b/lib/retrofit/retrofit_api.g.dart @@ -2153,4 +2153,48 @@ class _ApiService implements ApiService { .toList()); return value; } + + @override + Future> changePhone(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>('/auth/changePhone', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => json as dynamic, + ); + return value; + } + + @override + Future> changeSendVerify(mobile) async { + ArgumentError.checkNotNull(mobile, 'mobile'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + final _result = await _dio.request>( + '/auth/sendVerify//$mobile', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => json as dynamic, + ); + return value; + } } diff --git a/lib/setting/account_security_page.dart b/lib/setting/account_security_page.dart index bc5a6ab6..bb9e859d 100644 --- a/lib/setting/account_security_page.dart +++ b/lib/setting/account_security_page.dart @@ -3,6 +3,7 @@ import 'dart:convert'; import 'package:dio/dio.dart'; 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/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/user_info.dart'; @@ -25,9 +26,10 @@ class _AccountSecurityPage extends State { @override void initState() { super.initState(); + EasyLoading.show(status: S.current.zhengzaijiazai); SharedPreferences.getInstance().then((value) => { apiService = ApiService(Dio(), - context: context, token: value.getString("token")), + context: context, token: value.getString("token"),), queryUser(), }); @@ -45,6 +47,7 @@ class _AccountSecurityPage extends State { value.setString('user', jsonEncode(baseDate.data)), }, ); + EasyLoading.dismiss(); } } @@ -83,6 +86,49 @@ class _AccountSecurityPage extends State { crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.max, children: [ + GestureDetector( + onTap: () { + Navigator.of(context).pushNamed('/router/binding_phone_page',arguments:{"userInfo":userInfo}).then((value) => { + queryUser(), + }); + }, + child: Container( + padding: EdgeInsets.all(15), + margin: EdgeInsets.only(top: 14.h), + decoration: BoxDecoration( + color: Colors.white, + ), + child: Row( + children: [ + Expanded( + child: Text( + S.of(context).bangdingshouji, + style: TextStyle( + fontWeight: MyFontWeight.semi_bold, + fontSize: 15.sp, + color: Color(0xFF353535), + ), + ), + flex: 1, + ), + Text( + "+86 ${userInfo?.phone ?? ""}", + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF4D4D4D)), + ), + SizedBox( + width:8.w, + ), + Icon( + Icons.keyboard_arrow_right, + size: 20, + ), + ], + ), + ), + ), GestureDetector( onTap: () { Navigator.of(context).pushReplacementNamed('/router/platform_code_page',arguments:{"userInfo":userInfo}); @@ -108,7 +154,7 @@ class _AccountSecurityPage extends State { ), if(userInfo?.hasPayPassword != null) Text( - (userInfo?.hasPayPassword ?? true)? "修改" :"设置", + (userInfo?.hasPayPassword ?? true)? S.of(context).xiugai :S.of(context).shezhi, style: TextStyle( fontSize: 14.sp, fontWeight: MyFontWeight.regular, diff --git a/lib/setting/binding_phone_page.dart b/lib/setting/binding_phone_page.dart new file mode 100644 index 00000000..497dc562 --- /dev/null +++ b/lib/setting/binding_phone_page.dart @@ -0,0 +1,806 @@ +import 'dart:async'; +import 'dart:io'; + +import 'package:dio/dio.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; +import 'package:huixiang/generated/l10n.dart'; +import 'package:huixiang/retrofit/data/base_data.dart'; +import 'package:huixiang/retrofit/data/user_info.dart'; +import 'package:huixiang/retrofit/retrofit_api.dart'; +import 'package:huixiang/utils/font_weight.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:shared_preferences/shared_preferences.dart'; + +import '../view_widget/border_text.dart'; + +class BindingPhonePage extends StatefulWidget { + final Map arguments; + + BindingPhonePage({this.arguments}); + + @override + State createState() { + return _BindingPhonePage(); + } +} + +class _BindingPhonePage extends State { + ApiService apiService; + String area = "+86"; + var _controllerPhone = TextEditingController(); + var _controllerNewPhone = TextEditingController(); + var _controllerCode = TextEditingController(); + var _controllerNewCode = TextEditingController(); + Color statusCodeTextColor = Color(0xFF353535); + var verifyStatus = 0; + var mobileStatus = 0; + var btnText = "获取验证码"; + var _sendCodeStatus = 0; + Timer _timer; + UserInfo userInfo; + int phoneState = 1; + + @override + void initState() { + super.initState(); + userInfo = widget.arguments['userInfo']; + } + + @override + void dispose() { + if (_timer != null && _timer.isActive) _timer.cancel(); + super.dispose(); + } + + ///修改绑定手机号码 + modifyPhoneCode(int state) async { + var mobile = _controllerPhone.text; + if (mobile == ""&& phoneState == 1) { + SmartDialog.showToast(S.of(context).qingshurushoujihao, alignment: Alignment.center); + return; + } + var newMobile = _controllerNewPhone.text; + if (newMobile == ""&& phoneState == 2) { + SmartDialog.showToast(S.of(context).qingshurushoujihao, alignment: Alignment.center); + return; + } + var code = _controllerCode.text; + if (code == "" && phoneState == 1) { + SmartDialog.showToast(S.of(context).qingshuruyanzhengma, alignment: Alignment.center); + return; + } + var newCode = _controllerNewCode.text; + if (newCode == "" && phoneState == 2) { + SmartDialog.showToast(S.of(context).qingshuruyanzhengma, alignment: Alignment.center); + return; + } + if (code.length != 6 && phoneState==1) { + SmartDialog.showToast(S.of(context).code_error, alignment: Alignment.center); + return; + } + if (newCode.length != 6 && phoneState == 2) { + SmartDialog.showToast(S.of(context).code_error, alignment: Alignment.center); + return; + } + if (apiService == null) { + SharedPreferences value = await SharedPreferences.getInstance(); + apiService = ApiService(Dio(), + context: context, token: value.getString("token"), showLoading: false); + } + BaseData baseData = await apiService.changePhone({ + "areaCode": area, + "capcha": phoneState == 1 ? code:newCode, + "mobile1": mobile, + "mobile2": newMobile, + "state": state, + }).catchError((error) {}); + if (baseData != null && baseData.isSuccess) { + if(state == 1){ + _timer.cancel(); + btnText = "获取验证码"; + _sendCodeStatus = 0; + phoneState = 2; + }else if(state == 2){ + phoneState = 3;} + setState(() {}); + } else { + setState(() {}); + SmartDialog.showToast(baseData.msg, alignment: Alignment.center); + } + } + + ///验证验证码 + verificationCode() async { + var mobile = _controllerPhone.text; + if (mobile == "" && phoneState == 1) { + SmartDialog.showToast(S.of(context).qingshurushoujihao, alignment: Alignment.center); + return; + } + var newMobile = _controllerNewPhone.text; + if (newMobile == "" && phoneState == 2) { + SmartDialog.showToast(S.of(context).qingshurushoujihao, alignment: Alignment.center); + return; + } + if (apiService == null) { + SharedPreferences value = await SharedPreferences.getInstance(); + apiService = ApiService(Dio(), + context: context, token: value.getString("token"), showLoading: false); + } + BaseData baseData = await apiService.changeSendVerify(mobile).catchError((error) {}); + if (baseData != null && baseData.isSuccess) { + _sendCodeStatus = 1; + countdown(); + SmartDialog.showToast(baseData.data ?? false, alignment: Alignment.center); + } else { + SmartDialog.showToast(baseData.msg, alignment: Alignment.center); + } + } + + countdown() { + if (_timer != null && _timer.isActive) return; + int countdown = 60; + _timer = Timer.periodic(Duration(seconds: 1), (timer) { + countdown--; + if (countdown == 0) { + btnText = "重新发送"; + _sendCodeStatus = 0; + _timer.cancel(); + } else { + btnText = "${countdown}s"; + } + setState(() {}); + }); + } + + bool isPhone(mobile) { + RegExp exp = RegExp( + r'^((13[0-9])|(14[0-9])|(15[0-9])|(16[0-9])|(17[0-9])|(18[0-9])|(19[0-9]))\d{8}$'); + return exp.hasMatch(mobile); + } + + @override + Widget build(BuildContext context) { + return GestureDetector( + behavior: HitTestBehavior.translucent, + onTap: () { + FocusScope.of(context).requestFocus(FocusNode()); + }, + child: Scaffold( + resizeToAvoidBottomInset: false, + appBar: AppBar( + backgroundColor: Colors.white, + leading: GestureDetector( + child: Icon( + Icons.arrow_back_ios, + color: Colors.black, + ), + onTap: () { + Navigator.of(context).pop(); + }), + title: Text( + S.of(context).genggaibangdingshoujihao, + style: TextStyle( + fontWeight: MyFontWeight.regular, + fontSize: 17.sp, + color: Color(0xFF0D0D0D), + ), + ), + centerTitle: true, + elevation: 0.0, + ), + body: Container( + margin: EdgeInsets.only(top: 12.h), + padding: EdgeInsets.symmetric(horizontal:16.w), + color: Colors.white, + width: double.infinity, + child:Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + topSequence(), + if(phoneState != 3) + Align(alignment: Alignment.center, + child: Text( + phoneState == 1 ?"现手机号验证":"修改成新号码", + textAlign: TextAlign.center, + style: TextStyle( + color: Color(0xFF353535), + fontSize: 18.sp, + letterSpacing:1, + fontWeight: MyFontWeight.bold, + ),)), + if(phoneState == 2) + Padding(padding:EdgeInsets.only(top: 14.h), + child: Text( + "当前手机号为${area + " ${userInfo?.phone ?? ""}"} 请输入新手机号:", + style: TextStyle( + color: Color(0xFFA29E9E), + fontSize: 14.sp, + letterSpacing:0.5, + fontWeight: MyFontWeight.medium, + ),)), + if(phoneState == 1) + inputPhone(), + if(phoneState == 2) + newInputPhone(), + if(phoneState == 3) + bindingSuccess(), + ], + ), + ), + )); + } + + ///头部手机号流程顺序 + Widget topSequence(){ + return Container( + margin:EdgeInsets.only(top:35.h,bottom: 31.h), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Container( + decoration:BoxDecoration( + borderRadius: BorderRadius.circular(100.w), + color: Color(0xFF34995E), + ), + padding: EdgeInsets.symmetric(horizontal:8.5.w,vertical:5.h), + child: Text( + "1", + textAlign: TextAlign.center, + style: TextStyle( + color: Colors.white, + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + ),), + ), + Container( + height: 1.h, + width: 74.w, + color: Color(0xFF34995E), + margin: EdgeInsets.symmetric(horizontal:8.w), + ), + Container( + decoration:BoxDecoration( + borderRadius: BorderRadius.circular(100.w), + color: phoneState == 1?Color(0xFFB7D3C3) : Color(0xFF34995E), + ), + padding: EdgeInsets.symmetric(horizontal:8.5.w,vertical:5.h), + child: Text( + "2", + textAlign: TextAlign.center, + style: TextStyle( + color: Colors.white, + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + ),), + ), + Container( + height: 1.h, + width: 74.w, + color: Color(0xFF34995E), + margin: EdgeInsets.symmetric(horizontal:8.w), + ), + Container( + decoration:BoxDecoration( + borderRadius: BorderRadius.circular(100.w), + color: (phoneState !=3)?Color(0xFFB7D3C3) : Color(0xFF34995E), + ), + padding: EdgeInsets.symmetric(horizontal:8.5.w,vertical:5.h), + child: Text( + "3", + textAlign: TextAlign.center, + style: TextStyle( + color: Colors.white, + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + ),), + ) + ], + ), + ); + } + + ///输入现在的手机号 + Widget inputPhone(){ + return Container( + margin:EdgeInsets.only(top:phoneState == 1?15.h:12.h,bottom:21.h,), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding(padding:EdgeInsets.only(bottom: 10.h), + child: Text( + "手机号", + style: TextStyle( + color: Color(0xFF181818), + fontSize: 16.sp, + fontWeight: MyFontWeight.bold, + ),)), + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + GestureDetector( + onTap: () { + Navigator.of(context) + .pushNamed('/router/phone_address_page') + .then((value) { + if (value != null) + setState(() { + area = value; + }); + }); + }, + child: Text( + area, + style: TextStyle( + fontWeight: MyFontWeight.regular, + fontSize: 16.sp, + color: Color(0xFF1A1A1A), + ), + )), + Icon( + Icons.keyboard_arrow_right, + size: 18, + color: Color(0xFF1A1A1A), + ), + Container( + height: 30.h, + width: MediaQuery.of(context).size.width - 100.w, + margin: EdgeInsets.only(bottom:Platform.isIOS ? 10.h:0), + child: TextField( + style: TextStyle( + height: 1.h, + fontSize: 16.sp, + color: Color(0xFF353535), + ), + onChanged: (value) { + if (value != null && value.isNotEmpty) { + if (isPhone(value)) { + mobileStatus = 1; + } else { + mobileStatus = 2; + } + } else { + mobileStatus = 0; + } + setState(() {}); + }, + controller: _controllerPhone, + keyboardType: TextInputType.phone, + decoration: InputDecoration( + errorBorder: InputBorder.none, + focusedBorder: InputBorder.none, + enabledBorder: InputBorder.none, + hintText: S.of(context).qingshurushoujihao, + // contentPadding: EdgeInsets.only(top: 12, bottom: 12, left: 12), + hintStyle: TextStyle( + fontSize: 14.sp, + color: Color(0xFFA29E9E), + ), + ), + textInputAction: TextInputAction.next, + inputFormatters: [ + LengthLimitingTextInputFormatter(11) + ], + cursorColor: Colors.grey, + maxLines: 1, + ), + ), + ], + ), + Container( + height: 1.h, + width: MediaQuery.of(context).size.width - 80.h, + color: _controllerPhone.text == "" + ? Color(0xFFE7E3E3) + : Color(0xFF32A060), + margin: EdgeInsets.only(top: 10.h), + ), + SizedBox( + height: 30.h, + ), + Padding(padding:EdgeInsets.only(bottom: 10.h), + child: Text( + S.of(context).yanzhengma, + style: TextStyle( + fontWeight: MyFontWeight.bold, + fontSize: 16.sp, + color: Color(0xFF181818), + ), + )), + Container( + height: 30.h, + width: MediaQuery.of(context).size.width - 30.h, + child: Row( + mainAxisAlignment: MainAxisAlignment.end, + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Expanded( + child: TextField( + style: TextStyle( + height: 1.h, + fontSize: 16.sp, + color: statusCodeTextColor, + ), + onChanged: (value) { + if (value != null && + value.isNotEmpty) { + if (value.length == 6) { + verifyStatus = 1; + } else { + verifyStatus = 2; + } + } else { + verifyStatus = 0; + } + setState(() {}); + }, + controller: _controllerCode, + keyboardType: TextInputType.phone, + decoration: InputDecoration( + errorBorder: InputBorder.none, + focusedBorder: InputBorder.none, + enabledBorder: InputBorder.none, + hintText:S.of(context).input_code_hide, + hintStyle: TextStyle( + fontSize: 14.sp, + color: Color(0xFFA29E9E), + ), + ), + textInputAction: TextInputAction.next, + inputFormatters: [ + LengthLimitingTextInputFormatter(6) + ], + cursorColor: Colors.grey, + maxLines: 1, + ), + flex: 4, + ), + Expanded( + child: Container( + alignment: Alignment.bottomCenter, + child: InkWell( + onTap: (){ + verificationCode(); + }, + child: BorderText( + text: btnText, + borderColor: Colors.transparent, + borderWidth: 1.w, + radius: 2, + padding: EdgeInsets.only( + left: 6.w, + right: 6.w, + ), + fontSize: 14.sp, + fontWeight: MyFontWeight.bold, + textColor: _sendCodeStatus == 0 + ? Color(0xFF32A060) + : Color(0xFFA29E9E), + ), + ), + ), + flex: 2, + ) + ], + ), + ), + Container( + height: 1.h, + width: MediaQuery.of(context).size.width - 10.h, + color: _controllerNewCode.text == "" + ? Color(0xFFE7E3E3) + : Color(0xFF32A060), + margin: EdgeInsets.only(top: 10.h), + ), + SizedBox( + height: 54.h, + ), + Align(alignment: Alignment.center, + child: GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: (){ + modifyPhoneCode(1); + }, + child: Container( + decoration:BoxDecoration( + borderRadius: BorderRadius.circular(23), + color: Color(0xFF34995E), + ), + padding: EdgeInsets.symmetric(vertical: 12.h,horizontal:65.w), + child: Text( + S.of(context).queding, + style: TextStyle( + color: Color(0xFFFFFFFF), + fontSize: 16.sp, + fontWeight: MyFontWeight.regular, + ),), + ), + ),), + ], + ), + ); + } + + ///输入新的手机号 + Widget newInputPhone(){ + return Container( + margin:EdgeInsets.only(top:15.h,bottom:21.h,), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + ///手机号 + Padding(padding:EdgeInsets.only(bottom: 10.h), + child: Text( + "手机号", + style: TextStyle( + color: Color(0xFF181818), + fontSize: 16.sp, + fontWeight: MyFontWeight.bold, + ),)), + Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + GestureDetector( + onTap: () { + Navigator.of(context) + .pushNamed('/router/phone_address_page') + .then((value) { + if (value != null) + setState(() { + area = value; + }); + }); + }, + child: Text( + area, + style: TextStyle( + fontWeight: MyFontWeight.regular, + fontSize: 16.sp, + color: Color(0xFF1A1A1A), + ), + )), + Icon( + Icons.keyboard_arrow_right, + size: 18, + color: Color(0xFF1A1A1A), + ), + Container( + height: 30.h, + width: MediaQuery.of(context).size.width - 100.w, + margin: EdgeInsets.only(bottom:Platform.isIOS ? 10.h:0), + child: TextField( + style: TextStyle( + height: 1.h, + fontSize: 16.sp, + color: Color(0xFF353535), + ), + onChanged: (value) { + if (value != null && value.isNotEmpty) { + if (isPhone(value)) { + mobileStatus = 1; + } else { + mobileStatus = 2; + } + } else { + mobileStatus = 0; + } + setState(() {}); + }, + controller: _controllerNewPhone, + keyboardType: TextInputType.phone, + decoration: InputDecoration( + errorBorder: InputBorder.none, + focusedBorder: InputBorder.none, + enabledBorder: InputBorder.none, + hintText: S.of(context).qingshurushoujihao, + // contentPadding: EdgeInsets.only(top: 12, bottom: 12, left: 12), + hintStyle: TextStyle( + fontSize: 14.sp, + color: Color(0xFFA29E9E), + ), + ), + textInputAction: TextInputAction.next, + inputFormatters: [ + LengthLimitingTextInputFormatter(11) + ], + cursorColor: Colors.grey, + maxLines: 1, + ), + ), + ], + ), + Container( + height: 1.h, + width: MediaQuery.of(context).size.width - 10.h, + color: _controllerNewPhone.text == "" + ? Color(0xFFE7E3E3) + : Color(0xFF32A060), + margin: EdgeInsets.only(top: 10.h), + ), + SizedBox( + height: 30.h, + ), + ///验证码 + Padding(padding:EdgeInsets.only(bottom: 10.h), + child: Text( + S.of(context).yanzhengma, + style: TextStyle( + fontWeight: MyFontWeight.bold, + fontSize: 16.sp, + color: Color(0xFF181818), + ), + )), + Container( + height: 30.h, + width: MediaQuery.of(context).size.width - 30.h, + child: Row( + mainAxisAlignment: MainAxisAlignment.end, + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Expanded( + child: TextField( + style: TextStyle( + height: 1.h, + fontSize: 16.sp, + color: statusCodeTextColor, + ), + onChanged: (value) { + if (value != null && + value.isNotEmpty) { + if (value.length == 6) { + verifyStatus = 1; + } else { + verifyStatus = 2; + } + } else { + verifyStatus = 0; + } + setState(() {}); + }, + controller: _controllerNewCode, + keyboardType: TextInputType.phone, + decoration: InputDecoration( + errorBorder: InputBorder.none, + focusedBorder: InputBorder.none, + enabledBorder: InputBorder.none, + hintText:S.of(context).input_code_hide, + hintStyle: TextStyle( + fontSize: 14.sp, + color: Color(0xFFA29E9E), + ), + ), + textInputAction: TextInputAction.next, + inputFormatters: [ + LengthLimitingTextInputFormatter(6) + ], + cursorColor: Colors.grey, + maxLines: 1, + ), + flex: 4, + ), + Expanded( + child: Container( + alignment: Alignment.bottomCenter, + child: InkWell( + onTap:(){ + verificationCode(); + }, + child: BorderText( + text: btnText, + borderColor: Colors.transparent, + borderWidth: 1.w, + radius: 2, + padding: EdgeInsets.only( + left: 6.w, + right: 6.w, + ), + fontSize: 14.sp, + fontWeight: MyFontWeight.bold, + textColor: _sendCodeStatus == 0 + ? Color(0xFF32A060) + : Color(0xFFA29E9E), + ), + ), + ), + flex: 2, + ) + ], + ), + ), + Container( + height: 1.h, + width: MediaQuery.of(context).size.width - 10.h, + color: _controllerNewCode.text == "" + ? Color(0xFFE7E3E3) + : Color(0xFF32A060), + margin: EdgeInsets.only(top: 10.h), + ), + SizedBox( + height: 54.h, + ), + Align(alignment: Alignment.center, + child: GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: (){ + modifyPhoneCode(2); + }, + child: Container( + decoration:BoxDecoration( + borderRadius: BorderRadius.circular(23), + color: Color(0xFF34995E), + ), + padding: EdgeInsets.symmetric(vertical: 12.h,horizontal:65.w), + child: Text( + "下一步", + style: TextStyle( + color: Color(0xFFFFFFFF), + fontSize: 16.sp, + fontWeight: MyFontWeight.regular, + ),), + ), + ),), + ], + ), + ); + } + + Widget bindingSuccess(){ + return Container( + alignment: Alignment.center, + margin: EdgeInsets.only(top: 31.h), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Image.asset( + "assets/image/icon_order_success.webp", + fit: BoxFit.cover, + width: 76, + height: 76, + ), + SizedBox( + height: 16.h, + ), + Text( + "新号码绑定成功", + style: TextStyle( + fontWeight: MyFontWeight.semi_bold, + fontSize: 18.sp, + color: Color(0xFF353535), + ), + ), + SizedBox( + height: 99.h, + ), + GestureDetector( + onTap: () { + Navigator.of(context).pop(); + }, + child: Container( + decoration:BoxDecoration( + borderRadius: BorderRadius.circular(23), + color: Color(0xFF34995E), + ), + padding: EdgeInsets.symmetric(vertical: 14.h,horizontal:65.w), + child: Text( + S.of(context).queren, + style: TextStyle( + color: Color(0xFFFFFFFF), + fontSize: 16.sp, + fontWeight: MyFontWeight.regular, + ),), + ), + ) + ], + ), + ); + } +} diff --git a/lib/settlement/settlement.dart b/lib/settlement/settlement.dart index 397d44a9..fc61328c 100644 --- a/lib/settlement/settlement.dart +++ b/lib/settlement/settlement.dart @@ -141,7 +141,9 @@ class _Settlement extends State { if (promotions != null && promotions != "" && tableId <= 0) { queryOrderInfo( address != null ? address.id : null, - selectedBtn, + ((storeInfo?.pickupType?.dineInTakeStatus ?? false) == true && (subscribeParam?.isEnableSubscribe ?? false) == false && selectedBtn != 1 && selectedBtn != 2) + ? diningStatus + : selectedBtn, 0, 0, widget.arguments["pid"] ?? (productId ?? 0), @@ -157,7 +159,9 @@ class _Settlement extends State { } else if (coupons != null && coupons != "" && tableId <= 0) { queryOrderInfo( address != null ? address.id : null, - selectedBtn, + ((storeInfo?.pickupType?.dineInTakeStatus ?? false) == true && (subscribeParam?.isEnableSubscribe ?? false) == false && selectedBtn != 1 && selectedBtn != 2) + ? diningStatus + : selectedBtn, widget.arguments["cid"], 0, productId ?? 0, @@ -173,17 +177,17 @@ class _Settlement extends State { } else queryOrderInfo( null, - selectedBtn, + ((storeInfo?.pickupType?.dineInTakeStatus ?? false) == true && (subscribeParam?.isEnableSubscribe ?? false) == false && selectedBtn != 1 && selectedBtn != 2) + ? diningStatus + : selectedBtn, 0, 0, productId ?? 0, productSkuId ?? "", actProductId ?? "", actProductSkuId ?? "", - (isVips == false || !placeOrder) - ? ((vipLevelName == "黄金会员" && placeOrder) - ? "MEMBER_RANK" - : "NONE") + (!placeOrder) + ? "NONE" : "AUTO", // useVipPriceSelect, // (useVipPriceSelect == true && isVips) ? false:useBenefitSelect, @@ -268,7 +272,9 @@ class _Settlement extends State { isRaiseChannel = true; queryOrderInfo( address?.id, - selectedBtn, + ((storeInfo?.pickupType?.dineInTakeStatus ?? false) == true && (subscribeParam?.isEnableSubscribe ?? false) == false && selectedBtn != 1 && selectedBtn != 2) + ? diningStatus + : selectedBtn, couponListBean?.id, 0, promotion?.id ?? productId, @@ -360,7 +366,9 @@ class _Settlement extends State { if (address != null) { queryOrderInfo( address.id, - selectedBtn, + ((storeInfo?.pickupType?.dineInTakeStatus ?? false) == true && (subscribeParam?.isEnableSubscribe ?? false) == false && selectedBtn != 1 && selectedBtn != 2) + ? diningStatus + : selectedBtn, null, 0, productId ?? null, @@ -414,7 +422,9 @@ class _Settlement extends State { } await queryOrderInfo( address.id, - selectedBtn, + ((storeInfo?.pickupType?.dineInTakeStatus ?? false) == true && (subscribeParam?.isEnableSubscribe ?? false) == false && selectedBtn != 1 && selectedBtn != 2) + ? diningStatus + : selectedBtn, null, 0, productId ?? null, @@ -444,7 +454,9 @@ class _Settlement extends State { queryOrderInfo( address.id, - selectedBtn, + ((storeInfo?.pickupType?.dineInTakeStatus ?? false) == true && (subscribeParam?.isEnableSubscribe ?? false) == false && selectedBtn != 1 && selectedBtn != 2) + ? diningStatus + : selectedBtn, 0, 0, productId ?? 0, @@ -542,10 +554,7 @@ class _Settlement extends State { ? true : false; //是否预约 placeOrderFirst.isTakeOut = - ((storeInfo?.pickupType?.dineInTakeStatus ?? false) == true && - (subscribeParam?.isEnableSubscribe ?? false) == false && - selectedBtn != 1 && - selectedBtn != 2) + ((storeInfo?.pickupType?.dineInTakeStatus ?? false) == true && (subscribeParam?.isEnableSubscribe ?? false) == false && selectedBtn != 1 && selectedBtn != 2) ? diningStatus : selectedBtn; placeOrderFirst.notes = remakers + @@ -837,7 +846,9 @@ class _Settlement extends State { }); queryOrderInfo( addressId, - isTake, + ((storeInfo?.pickupType?.dineInTakeStatus ?? false) == true && (subscribeParam?.isEnableSubscribe ?? false) == false && selectedBtn != 1 && selectedBtn != 2) + ? diningStatus + : selectedBtn, memberCouponId, orderId, promotionId ?? (productId ?? 0), @@ -863,6 +874,7 @@ class _Settlement extends State { height: 16.h, ), + ///堂食/打包 if ((storeInfo?.pickupType?.dineInTakeStatus ?? false) == true && @@ -885,6 +897,7 @@ class _Settlement extends State { minOrderInfo != null) SettlementOrderCommodity( selectedBtn, + diningStatus, settleOrderInfo, minOrderInfo, tableId, @@ -1081,6 +1094,27 @@ class _Settlement extends State { onTap: () { setState(() { diningStatus = 4; + queryOrderInfo( + address?.id, + ((storeInfo?.pickupType?.dineInTakeStatus ?? false) == true && (subscribeParam?.isEnableSubscribe ?? false) == false && selectedBtn != 1 && selectedBtn != 2) + ? diningStatus + : selectedBtn, + (settleOrderInfo.isRaise || payChannel == 5) + ? "" + : couponListBean?.id, + 0, + (settleOrderInfo.isRaise || payChannel == 5) + ? "" + : promotion?.id ?? productId, + productSkuId ?? "", + actProductId ?? "", + actProductSkuId ?? "", + ((promotion?.id ?? productId ?? "") != "") ? "ACTIVITY" : ((couponListBean?.id ?? "") != "" ? "COUPON":"AUTO"), + // useVipPriceSelect, + // useBenefitSelect, + count1, + payChannel, + tableId); }); }, child: Container( @@ -1146,6 +1180,27 @@ class _Settlement extends State { onTap: () { setState(() { diningStatus = 3; + queryOrderInfo( + address?.id, + ((storeInfo?.pickupType?.dineInTakeStatus ?? false) == true && (subscribeParam?.isEnableSubscribe ?? false) == false && selectedBtn != 1 && selectedBtn != 2) + ? diningStatus + : selectedBtn, + (settleOrderInfo.isRaise || payChannel == 5) + ? "" + : couponListBean?.id, + 0, + (settleOrderInfo.isRaise || payChannel == 5) + ? "" + : promotion?.id ?? productId, + productSkuId ?? "", + actProductId ?? "", + actProductSkuId ?? "", + ((promotion?.id ?? productId ?? "") != "") ? "ACTIVITY" : ((couponListBean?.id ?? "") != "" ? "COUPON":"AUTO"), + // useVipPriceSelect, + // useBenefitSelect, + count1, + payChannel, + tableId); }); }, child: Container( @@ -1216,7 +1271,9 @@ class _Settlement extends State { } else { queryOrderInfo( address?.id, - selectedBtn, + ((storeInfo?.pickupType?.dineInTakeStatus ?? false) == true && (subscribeParam?.isEnableSubscribe ?? false) == false && selectedBtn != 1 && selectedBtn != 2) + ? diningStatus + : selectedBtn, (settleOrderInfo.isRaise || payChannel == 5) ? "" : couponListBean?.id, @@ -1227,15 +1284,16 @@ class _Settlement extends State { productSkuId ?? "", actProductId ?? "", actProductSkuId ?? "", - (settleOrderInfo.isRaise || payChannel == 5) - ? "NONE" - : ((useVipPriceSelect == false && - couponListBean?.id != "" && - ((promotion?.id ?? productId) != "")) - ? "MEMBER_RANK" - : (isVips == false && vipLevelName == "黄金会员") - ? "MEMBER_RANK" - : "AUTO"), + // (settleOrderInfo.isRaise || payChannel == 5) + // ? "NONE" + // : ((useVipPriceSelect == false && + // couponListBean?.id != "" && + // ((promotion?.id ?? productId) != "")) + // ? "MEMBER_RANK" + // : (isVips == false && vipLevelName == "黄金会员") + // ? "MEMBER_RANK" + // : "AUTO"), + preferentialType(), // (settleOrderInfo.isRaise || payChannel == 5 || ((payChannel == 4 && settleOrderInfo.usePlateMoney == false))) ? false :useVipPriceSelect, // (settleOrderInfo.isRaise || payChannel == 5 || ((payChannel == 4 && settleOrderInfo.usePlateMoney == false)) || useVipPriceSelect == true) ? false :useBenefitSelect, count1, @@ -1244,6 +1302,22 @@ class _Settlement extends State { } } + String preferentialType(){ + if(settleOrderInfo.isRaise || payChannel == 5) + return "NONE"; + if((((promotion?.id ?? productId) ?? "") != "") && (couponListBean?.id ?? "") == ""){ + return "ACTIVITY"; + }else if((couponListBean?.id ?? "") != "" && (((promotion?.id ?? productId) ?? "") == "")){ + return "COUPON"; + }else if(useVipPriceSelect == true && (couponListBean?.id ?? "") == "" && ((promotion?.id ?? productId ??"") == "")){ + return "VIP"; + }if(useVipPriceSelect == false && (couponListBean?.id ?? "") == "" && ((promotion?.id ?? productId ?? "") == "")){ + return "MEMBER_RANK"; + }else { + return "AUTO"; + } + } + vipPriceSelect(bool useVipPriceSelect) { this.useVipPriceSelect = useVipPriceSelect; if (tableId > 0) { @@ -1251,7 +1325,9 @@ class _Settlement extends State { } else { queryOrderInfo( address?.id, - selectedBtn, + ((storeInfo?.pickupType?.dineInTakeStatus ?? false) == true && (subscribeParam?.isEnableSubscribe ?? false) == false && selectedBtn != 1 && selectedBtn != 2) + ? diningStatus + : selectedBtn, 0, 0, productId ?? 0, @@ -1275,7 +1351,9 @@ class _Settlement extends State { } else { queryOrderInfo( address?.id, - selectedBtn, + ((storeInfo?.pickupType?.dineInTakeStatus ?? false) == true && (subscribeParam?.isEnableSubscribe ?? false) == false && selectedBtn != 1 && selectedBtn != 2) + ? diningStatus + : selectedBtn, null, 0, productId ?? null, @@ -1333,7 +1411,9 @@ class _Settlement extends State { } else { queryOrderInfo( address?.id, - selectedBtn, + ((storeInfo?.pickupType?.dineInTakeStatus ?? false) == true && (subscribeParam?.isEnableSubscribe ?? false) == false && selectedBtn != 1 && selectedBtn != 2) + ? diningStatus + : selectedBtn, couponBean?.id, 0, productId ?? 0, @@ -1341,7 +1421,7 @@ class _Settlement extends State { actProductId ?? "", actProductSkuId ?? "", (couponBean?.id ?? 0) == 0 - ? ((isVips == false && vipLevelName == "黄金会员") + ? ((isVips == false) ? "MEMBER_RANK" : "AUTO") : "COUPON", @@ -1372,7 +1452,9 @@ class _Settlement extends State { // this.couponListBean = null; queryOrderInfo( address?.id, - selectedBtn, + ((storeInfo?.pickupType?.dineInTakeStatus ?? false) == true && (subscribeParam?.isEnableSubscribe ?? false) == false && selectedBtn != 1 && selectedBtn != 2) + ? diningStatus + : selectedBtn, 0, 0, (pro?.id ?? 0) ?? productId, @@ -1380,7 +1462,7 @@ class _Settlement extends State { actProductId ?? "", actProductSkuId ?? "", ((pro?.id ?? 0) ?? productId) == 0 - ? ((isVips == false && vipLevelName == "黄金会员") + ? ((isVips == false) ? "MEMBER_RANK" : "AUTO") : "ACTIVITY", diff --git a/lib/settlement/settlement_view/activity_coupon_remarks.dart b/lib/settlement/settlement_view/activity_coupon_remarks.dart index a8630df5..fd510c3b 100644 --- a/lib/settlement/settlement_view/activity_coupon_remarks.dart +++ b/lib/settlement/settlement_view/activity_coupon_remarks.dart @@ -122,7 +122,7 @@ class _ActivityCouponRemarks extends State { (widget.coupons != null && widget.coupons != "" || widget.promotions != null && widget.promotions != "" || - widget.payChannell == 5 || widget.payChannell == 7 ||(widget?.settleOrderInfo?.discountType ?? "") == "MEMBER_RANK" ||(widget.payChannell == 4 && widget.settleOrderInfo.promotionInfoList.length <=0 && widget.settleOrderInfo.couponList.length <= 0)) + widget.payChannell == 5 || widget.payChannell == 7 || ((widget?.settleOrderInfo?.discountType ?? "") == "MEMBER_RANK" || (widget?.settleOrderInfo?.discountType ?? "") == "SURPRISE") ) ? false : vipSelect, materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, @@ -179,7 +179,8 @@ class _ActivityCouponRemarks extends State { widget.promotions != null && widget.promotions != "" || widget.payChannell == 5 || - widget.payChannell == 7 ||(widget?.settleOrderInfo?.discountType ?? "") == "MEMBER_RANK"|| (widget.payChannell == 4 && widget.settleOrderInfo.promotionInfoList.length <=0 && widget.settleOrderInfo.couponList.length <= 0)) + widget.payChannell == 7 ||((widget?.settleOrderInfo?.discountType ?? "") == "MEMBER_RANK" || (widget?.settleOrderInfo?.discountType ?? "") == "SURPRISE") + || (widget.payChannell == 4 && widget.settleOrderInfo.promotionInfoList.length <=0 && widget.settleOrderInfo.couponList.length <= 0)) ? false : vipSelect) ? "assets/image/vip_price.webp" @@ -278,7 +279,7 @@ class _ActivityCouponRemarks extends State { // ), // ), if (widget.placeOrder && - (widget?.settleOrderInfo?.discountType == "MEMBER_RANK" && widget?.settleOrderInfo?.benefitDiscountAmount != null && + ((widget?.settleOrderInfo?.discountType == "MEMBER_RANK" || widget?.settleOrderInfo?.discountType == "SURPRISE") && widget?.settleOrderInfo?.benefitDiscountAmount != null && widget?.settleOrderInfo?.benefitDiscountAmount != "0")) Container( margin: EdgeInsets.only(bottom: 13), diff --git a/lib/settlement/settlement_view/settlement_order_commodity.dart b/lib/settlement/settlement_view/settlement_order_commodity.dart index d10f7b40..8aeab279 100644 --- a/lib/settlement/settlement_view/settlement_order_commodity.dart +++ b/lib/settlement/settlement_view/settlement_order_commodity.dart @@ -10,8 +10,11 @@ import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/view_widget/custom_image.dart'; import 'package:huixiang/view_widget/separator.dart'; +import '../../retrofit/data/shoppingCart.dart'; + class SettlementOrderCommodity extends StatefulWidget { final int isTakeOut; + final int diningStatus; final int tableId; final SettleOrderInfo settleOrderInfo; @@ -24,6 +27,7 @@ class SettlementOrderCommodity extends StatefulWidget { SettlementOrderCommodity( this.isTakeOut, + this.diningStatus, this.settleOrderInfo, this.minOrderInfo, this.tableId, @@ -114,18 +118,52 @@ class _SettlementOrderCommodity extends State { ); } + if (widget.diningStatus == 3) { + //打包费 + widgets.add( + discountItem( + Color(0xFFFF7A1A), + "打包费", + "", + (widget.minOrderInfo != null) + ? "+ ${widget.minOrderInfo?.totalPackagingFee ?? "0"}" + : "+ ${widget.settleOrderInfo?.totalPackagingFee ?? "0"}", + ), + ); + } + if (widget.useVipPriceSelect && widget.settleOrderInfo.memberVO.isVip && - (widget.tableId > 0 ? !(widget?.minOrderInfo?.isRaise ?? false) : !(widget?.settleOrderInfo?.isRaise ?? false)) && - (widget?.settleOrderInfo?.discountType == "VIP" && widget?.settleOrderInfo?.vipDiscountAmount != "0")) { - widgets.add(vipItem(Color(0xFFFF7A1A), "VIP优惠", - (widget.minOrderInfo != null && widget.minOrderInfo.orderProductVOList != null) ? (widget.minOrderInfo?.discountAmount ?? ""):(widget?.settleOrderInfo?.vipDiscountAmount ?? ""))); + (widget.tableId > 0 + ? !(widget?.minOrderInfo?.isRaise ?? false) + : !(widget?.settleOrderInfo?.isRaise ?? false)) && + (widget?.settleOrderInfo?.discountType == "VIP" && + widget?.settleOrderInfo?.vipDiscountAmount != "0")) { + widgets.add(vipItem( + Color(0xFFFF7A1A), + "VIP优惠", + AppUtils.calculateDouble(double.tryParse( + (widget.minOrderInfo != null && + widget.minOrderInfo.orderProductVOList != null) + ? (widget.minOrderInfo?.discountAmount ?? "") + : (widget?.settleOrderInfo?.vipDiscountAmount ?? ""))))); } if (widget.useBenefitSelect && - (widget?.settleOrderInfo?.discountType == "MEMBER_RANK" && widget?.settleOrderInfo?.benefitDiscountAmount != "0") && ((widget.tableId > 0 ? !(widget?.minOrderInfo?.isRaise ?? false) : !(widget?.settleOrderInfo?.isRaise ?? false)))) { - widgets.add(vipItem(Color(0xFFFF7A1A), "会员优惠金额", - (widget.minOrderInfo != null && widget.minOrderInfo.orderProductVOList != null) ? (widget.minOrderInfo?.benefitDiscountAmount ?? "") :(widget?.settleOrderInfo?.benefitDiscountAmount ?? ""))); + ((widget?.settleOrderInfo?.discountType == "MEMBER_RANK" || + widget?.settleOrderInfo?.discountType == "SURPRISE") && + widget?.settleOrderInfo?.benefitDiscountAmount != "0") && + ((widget.tableId > 0 + ? !(widget?.minOrderInfo?.isRaise ?? false) + : !(widget?.settleOrderInfo?.isRaise ?? false)))) { + widgets.add(vipItem( + Color(0xFFFF7A1A), + "会员优惠金额", + AppUtils.calculateDouble(double.tryParse( + (widget.minOrderInfo != null && + widget.minOrderInfo.orderProductVOList != null) + ? (widget.minOrderInfo?.benefitDiscountAmount ?? "") + : (widget?.settleOrderInfo?.benefitDiscountAmount ?? ""))))); } if (widget.showVipTips) { @@ -181,92 +219,165 @@ class _SettlementOrderCommodity extends State { Widget commodityItem(OrderProductVOList productList) { return Container( margin: EdgeInsets.only(top: 8.h, bottom: 8.h), - child: Row( + child: Column( children: [ - MImage( - productList.skuImg, - width: 55, - height: 55, - fit: BoxFit.cover, - radius: BorderRadius.circular(4), - errorSrc: "assets/image/default_1.webp", - fadeSrc: "assets/image/default_1.webp", - ), - Expanded( - flex: 1, - child: Container( - margin: EdgeInsets.only( - left: 8.w, + Row( + children: [ + MImage( + productList.skuImg, + width: 55, + height: 55, + fit: BoxFit.cover, + radius: BorderRadius.circular(4), + errorSrc: "assets/image/default_1.webp", + fadeSrc: "assets/image/default_1.webp", ), - // height: 44.h, - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceAround, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - productList.productName, - maxLines: 1, - overflow: TextOverflow.ellipsis, - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 14.sp, - color: Color(0xFF353535), - ), + Expanded( + flex: 1, + child: Container( + margin: EdgeInsets.only( + left: 8.w, ), - SizedBox( - height: 4.h, - ), - Text( - productList.skuNameStr != null - ? "${productList.skuNameStr ?? ""}" - : "", - overflow: TextOverflow.ellipsis, - style: TextStyle( - fontSize: 10.sp, - color: Color(0xFFA29E9E), - ), + // height: 44.h, + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + productList.productName, + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 14.sp, + color: Color(0xFF353535), + ), + ), + SizedBox( + height: 4.h, + ), + Text( + productList.skuNameStr != null + ? "${productList.skuNameStr ?? ""}" + : "", + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 10.sp, + color: Color(0xFFA29E9E), + ), + ), + Text( + "x${productList.buyNum}", + style: TextStyle( + fontSize: 12.sp, + color: Color(0xFF727272), + ), + ), + ], ), + ), + ), + Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.end, + children: [ Text( - "x${productList.buyNum}", + productList.buyNum > 1 + ? S.of(context).yuan_(AppUtils.calculateDouble( + double.tryParse(productList.sellPrice ?? "0") - + AppUtils.stringAsFixedDouble2((double.tryParse( + productList.discountAmount ?? "0") / + productList.buyNum)))) + : S.of(context).yuan_(AppUtils.calculateDouble( + double.tryParse(productList.sellPrice ?? "0") - + double.tryParse( + productList.discountAmount ?? "0"))), style: TextStyle( - fontSize: 12.sp, - color: Color(0xFF727272), + fontWeight: MyFontWeight.medium, + fontSize: 14.sp, + color: Color(0xFF4C4C4C), ), ), + if (productList.discountAmount != null && + productList.discountAmount != "0") + Text( + S.of(context).yuan_(productList.sellPrice), + style: TextStyle( + fontWeight: MyFontWeight.regular, + fontSize: 12.sp, + fontFamily: 'JDZhengHT', + decoration: TextDecoration.lineThrough, + color: Color(0xFFA29E9E), + ), + ) ], ), - ), + ], ), - Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - Text( - productList.buyNum > 1 - ? S.of(context).yuan_(AppUtils.calculateDouble(double.tryParse(productList.sellPrice ?? "0") - AppUtils.stringAsFixedDouble2((double.tryParse(productList.discountAmount ?? "0") / productList.buyNum)))) - : S.of(context).yuan_(AppUtils.calculateDouble(double.tryParse(productList.sellPrice ?? "0") - double.tryParse(productList.discountAmount ?? "0"))), + if (productList.setMealDataList.length != 0) + ListView.builder( + itemCount: productList.setMealDataList.length, + scrollDirection: Axis.vertical, + physics: BouncingScrollPhysics(), + shrinkWrap: true, + padding: EdgeInsets.zero, + itemBuilder: (context, index) { + return orderMealsItem(productList.setMealDataList[index]); + }, + ), + ], + ), + ); + } + + Widget orderMealsItem(SetMealDataList setMealDataList) { + return Column(children: setMealDataList.productInfoList.map((e) { + return Container( + margin: EdgeInsets.symmetric( + vertical: 10.h, + ), + child: Row( + children: [ + Expanded( + flex: 2, + child: Text( + e.productName, + overflow: TextOverflow.ellipsis, + maxLines: 1, style: TextStyle( - fontWeight: MyFontWeight.medium, + color: Color(0xffA29E9E), fontSize: 14.sp, - color: Color(0xFF4C4C4C), + fontWeight: MyFontWeight.regular, ), ), - if (productList.discountAmount != null && productList.discountAmount != "0") - Text( - S.of(context).yuan_(productList.sellPrice), - style: TextStyle( - fontWeight: MyFontWeight.regular, - fontSize: 12.sp, - fontFamily: 'JDZhengHT', - decoration: TextDecoration.lineThrough, - color: Color(0xFFA29E9E), - ), - ) - ], - ) - ], - ), - ); + ), + Expanded( + flex: 3, + child: Text( + "${(e.skuName == "") ? "" : e.skuName}", + overflow: TextOverflow.ellipsis, + maxLines: 1, + style: TextStyle( + color: Color(0xffA29E9E), + fontSize: 13.sp, + fontWeight: MyFontWeight.regular, + ), + ), + ), + Text( + "x${e.buyNumber.toString()}", + overflow: TextOverflow.ellipsis, + maxLines: 1, + style: TextStyle( + color: Color(0xffFF7A1A), + fontSize: 13.sp, + fontWeight: MyFontWeight.regular, + ), + ), + ], + ), + ); + }).toList(),); } Widget discountItem(Color color, textName, condition, amount) { @@ -464,7 +575,7 @@ class _SettlementOrderCommodity extends State { ), Container( child: Text( - "已优惠:¥${(widget.tableId > 0 ? (widget?.minOrderInfo?.isRaise ?? false) : (widget?.settleOrderInfo?.isRaise ?? false)) ? "0": discountPrice()}", + "已优惠:¥${(widget.tableId > 0 ? (widget?.minOrderInfo?.isRaise ?? false) : (widget?.settleOrderInfo?.isRaise ?? false)) ? "0" : discountPrice()}", style: TextStyle( fontSize: 12.sp, fontFamily: 'JDZhengHT', @@ -507,20 +618,24 @@ class _SettlementOrderCommodity extends State { ///已优惠金额 String discountPrice() { if (widget.minOrderInfo != null) { - return AppUtils.calculateDouble(double.tryParse(widget.minOrderInfo?.totalDiscountPrice ?? "0")); + return AppUtils.calculateDouble( + double.tryParse(widget.minOrderInfo?.totalDiscountPrice ?? "0")); } else if (widget.tableId < 0) { return "0"; } else { - return AppUtils.calculateDouble(double.tryParse(widget?.settleOrderInfo?.totalDiscountAmount ?? "0")); + return AppUtils.calculateDouble( + double.tryParse(widget?.settleOrderInfo?.totalDiscountAmount ?? "0")); } } String totalPrice() { if (widget.minOrderInfo != null && widget.minOrderInfo.orderProductVOList != null) { - return "¥${widget.minOrderInfo.finalPayPrice}"; + return "¥${AppUtils.calculateDouble( + double.tryParse(widget.minOrderInfo.finalPayPrice))}"; } if (widget.settleOrderInfo.orderProductList == null) return ""; - return "¥${widget.settleOrderInfo.price}"; + return "¥${AppUtils.calculateDouble( + double.tryParse(widget.settleOrderInfo.price ?? ""))}"; } } diff --git a/lib/store/shop_details_page.dart b/lib/store/shop_details_page.dart index c27d2d8b..0b3815ce 100644 --- a/lib/store/shop_details_page.dart +++ b/lib/store/shop_details_page.dart @@ -64,12 +64,14 @@ class _ShopDetailsPage extends State { String parentId; int numberOfPeople = 0; int index; + bool isSetMeal; @override void initState() { super.initState(); id = widget.arguments["id"]; storeId = widget.arguments["storeId"]; + isSetMeal = widget.arguments["isSetMeal"] ?? false; // SharedPreferences.getInstance().then((value) { // String minToken = value.getString("minToken"); // String tenant = value.getString("tenant"); @@ -841,10 +843,22 @@ class _ShopDetailsPage extends State { ), )), GestureDetector( - onTap: () { + onTap: () async { if (storeInfo.posType.code == "NORMALSTORE" && tableId == 0) { showDeleteDialog(); + } else if (isSetMeal == true) { + await Navigator.of(context).pushNamed( + '/router/product_meals_sku', + arguments: { + "id": id, + "storeId": storeId, + "tableId": tableId + }); + queryShopCar().then((value) { + this.shopCarGoods = value; + setState(() {}); + }); } else { _queryMiNiDetail(id, counts); } @@ -875,7 +889,9 @@ class _ShopDetailsPage extends State { false) == true) ? S.of(context).lijiyuyue - : "加入购物车", + : (isSetMeal ?? false) == true + ? "选套餐" + : "加入购物车", style: TextStyle( fontSize: 12.sp, fontWeight: MyFontWeight.regular, diff --git a/lib/store/store_order.dart b/lib/store/store_order.dart index e0d1e416..5fcddbc3 100644 --- a/lib/store/store_order.dart +++ b/lib/store/store_order.dart @@ -92,7 +92,6 @@ class _StoreOrderPage extends State SharedPreferences.getInstance().then((value) { minLogin(value); - queryStoreInfo(); }); } @@ -426,6 +425,7 @@ class _StoreOrderPage extends State ]; }, body: + ///点餐 TabBarView( physics: NeverScrollableScrollPhysics(), @@ -656,9 +656,9 @@ class _StoreOrderPage extends State "cid": cid, "shoppingCart": shopCarGoods, "numberOfPeople": numberOfPeople, - "distance":widget.arguments["distance"], - "vipLevelName":memberVo.memberRankVo.rankName, - "isVips":memberVo.isVip, + "distance": widget.arguments["distance"], + "vipLevelName": memberVo?.memberRankVo?.rankName ??"", + "isVips": memberVo?.isVip ?? false, "distance": widget.arguments["distance"], "subscribeParam": miNiDetail?.subscribeParam, }, @@ -693,7 +693,7 @@ class _StoreOrderPage extends State color: Colors.white.withAlpha(76), ), ), - autoplay: (storeInfo?.bannerList?.length ?? 0) == 0 ? false :true, + autoplay: (storeInfo?.bannerList?.length ?? 0) == 0 ? false : true, duration: 1000, autoplayDelay: 2000, itemBuilder: (context, position) { @@ -969,6 +969,8 @@ class _StoreOrderPage extends State this.shopCarGoods = await queryShopCar(); debugPrint("count.toString()"); setState(() {}); + } else { + SmartDialog.showToast(baseDate.msg, alignment: Alignment.center); } } @@ -1014,6 +1016,8 @@ class _StoreOrderPage extends State this.shopCarGoods = value; setState(() {}); }); + } else { + SmartDialog.showToast(baseDate.msg, alignment: Alignment.center); } } diff --git a/lib/store/store_view/product_meals_sku.dart b/lib/store/store_view/product_meals_sku.dart index 3d2a7e57..48e69a00 100644 --- a/lib/store/store_view/product_meals_sku.dart +++ b/lib/store/store_view/product_meals_sku.dart @@ -93,7 +93,8 @@ class _ProductMealsSku extends State { "productId": ele.productId, "skuId": ele.skuInfoList.length == 1 ? ele.skuInfoList.first.id - : ele.skuInfoList.firstWhere((e2) => e2.isSelected).id + : ele.skuInfoList.firstWhere((e2) => e2.isSelected).id, + // "buyNumber":1, }); } }); @@ -316,6 +317,7 @@ class _ProductMealsSku extends State { return Container( margin: EdgeInsets.symmetric(vertical: 16.h), child: Row( + crossAxisAlignment: CrossAxisAlignment.start, children: [ MImage( productSetMeals[position].productInfoList[index].productImg ?? "", @@ -332,60 +334,63 @@ class _ProductMealsSku extends State { mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ - Row( - children: [ - Expanded( - child: Text( - productSetMeals[position] - .productInfoList[index] - .productName ?? - "", - overflow: TextOverflow.ellipsis, - maxLines: 1, - style: TextStyle( - color: Colors.black, - fontSize: 13.sp, - fontWeight: MyFontWeight.semi_bold, - ), - ), - ), - if (productSetMeals[position] - .productInfoList[index] - .productAttrInfoList[0] - .attrName != - "") - GestureDetector( + Padding( + padding: EdgeInsets.symmetric(vertical: 8.h), + child: Row( + children: [ + Expanded( child: Text( - S.of(context).xuanguige, + productSetMeals[position] + .productInfoList[index] + .productName ?? + "", + overflow: TextOverflow.ellipsis, + maxLines: 1, style: TextStyle( color: Colors.black, fontSize: 13.sp, - fontWeight: MyFontWeight.regular, + fontWeight: MyFontWeight.semi_bold, ), ), - onTap: () { - showSkuDialog(position, index); - }, ), - if (productSetMeals[position] - .productInfoList[index] - .productAttrInfoList[0] - .attrName != - "") - GestureDetector( - onTap: () { - showSkuDialog(position, index); - }, - child: Icon( - Icons.chevron_right, - color: Colors.black, - size: 18, + if (productSetMeals[position] + .productInfoList[index] + .productAttrInfoList[0] + .attrName != + "") + GestureDetector( + child: Text( + S.of(context).xuanguige, + style: TextStyle( + color: Colors.black, + fontSize: 13.sp, + fontWeight: MyFontWeight.regular, + ), + ), + onTap: () { + showSkuDialog(position, index); + }, ), - ) - ], + if (productSetMeals[position] + .productInfoList[index] + .productAttrInfoList[0] + .attrName != + "") + GestureDetector( + onTap: () { + showSkuDialog(position, index); + }, + child: Icon( + Icons.chevron_right, + color: Colors.black, + size: 18, + ), + ) + ], + ), ), - SizedBox(height: 8.h), Row( + mainAxisAlignment: MainAxisAlignment.center, children: [ if (productSetMeals[position] .productInfoList[index] @@ -410,77 +415,123 @@ class _ProductMealsSku extends State { ), ), Spacer(), - InkWell( - onTap: () { - setState(() { - if (productSetMeals[position] - .productInfoList[index] - .count >= - 1) - productSetMeals[position] - .productInfoList[index] - .count -= 1; - }); - }, - child: Image.asset( - "assets/image/reduce.webp", - width: 22, - height: 22.h, - ), - ), - Container( - width: 30, - alignment: Alignment.center, - child: Text( - productSetMeals[position] + if (productSetMeals[position] .productInfoList[index] - .count - .toString(), - style: TextStyle( - color: Colors.black, - fontSize: 14.sp, - fontWeight: MyFontWeight.medium, + .skuInfoList + .where((element) => element.isSelected) + .isNotEmpty && + productSetMeals[position].productInfoList[index].count > + 0) + Padding( + padding: EdgeInsets.only(right: 4.w), + child: Text( + "x${productSetMeals[position].productInfoList[index].count}", + overflow: TextOverflow.ellipsis, + maxLines: 1, + style: TextStyle( + color: Color(0xffFF7A1A), + fontSize: 13.sp, + fontWeight: MyFontWeight.regular, + ), ), ), - ), - GestureDetector( - onTap: () { - setState(() { - if (productSetMeals[position] + if (productSetMeals[position] + .productInfoList[index] + .productAttrInfoList[0] + .attrName == + "") + InkWell( + onTap: () { + setState(() { + if (productSetMeals[position] + .productInfoList[index] + .count >= + 1) + productSetMeals[position] .productInfoList[index] - .productAttrInfoList[0] - .attrName != - "") { - showSkuDialog(position, index); - return; - } - int total = 0; - productSetMeals[position] - .productInfoList - .forEach((element) { - total += element.count; + .count -= 1; }); - if (total >= - productSetMeals[position].optionalNumber) { - SmartDialog.showToast("抱歉,无法加购更多", - alignment: Alignment.center); - return; - } - if (productSetMeals[position] + }, + child: Image.asset( + "assets/image/reduce.webp", + width: 22, + height: 22.h, + ), + ), + if (productSetMeals[position] + .productInfoList[index] + .productAttrInfoList[0] + .attrName == + "") + Container( + width: 30, + alignment: Alignment.center, + child: Text( + (productSetMeals[position].totalNumber > 1 && + productSetMeals[position].totalNumber != + productSetMeals[position].optionalNumber) + ? productSetMeals[position] .productInfoList[index] - .count == - 0) + .count + .toString() + : (productSetMeals[position] + .productInfoList[index] + .count = 1) + .toString(), + style: TextStyle( + color: Colors.black, + fontSize: 14.sp, + fontWeight: MyFontWeight.medium, + ), + ), + ), + if (productSetMeals[position] + .productInfoList[index] + .productAttrInfoList[0] + .attrName == + "") + GestureDetector( + onTap: () { + setState(() { + if (productSetMeals[position] + .productInfoList[index] + .productAttrInfoList[0] + .attrName != + "") { + showSkuDialog(position, index); + return; + } + int total = 0; productSetMeals[position] - .productInfoList[index] - .count += 1; - }); - }, - child: Image.asset( - "assets/image/add.webp", - width: 22, - height: 22.h, + .productInfoList + .forEach((element) { + total += element.count; + }); + if (total >= + productSetMeals[position].optionalNumber || + productSetMeals[position] + .productInfoList[index] + .count >= + 1) { + SmartDialog.showToast("抱歉,无法加购更多", + alignment: Alignment.center); + return; + } + if (productSetMeals[position] + .productInfoList[index] + .count == + 0) + productSetMeals[position] + .productInfoList[index] + .count += 1; + }); + }, + child: Image.asset( + "assets/image/add.webp", + width: 22, + height: 22.h, + ), ), - ), ], ), SizedBox( diff --git a/lib/store/store_view/product_sku.dart b/lib/store/store_view/product_sku.dart index 14c03d45..45144057 100644 --- a/lib/store/store_view/product_sku.dart +++ b/lib/store/store_view/product_sku.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:huixiang/retrofit/data/miNiDetail.dart'; @@ -56,7 +57,7 @@ class _ProductSku extends State { return; } if (productSku == null) return; - selectedPrice = productSku.vipPrice; + selectedPrice = productSku.vipPrice ?? productSku.skuPrice ?? ""; String skuId = productSku.id; if (widget.shopCarGoods == null || widget.shopCarGoods.shoppingCartSkuItemList == null) return; @@ -237,9 +238,11 @@ class _ProductSku extends State { ), InkWell( onTap: () async { - if(count == 1) - return; - if((widget?.miNiDetail?.subscribeParam?.isEnableSubscribe ?? false) == false){ + if (count == 1) return; + if ((widget?.miNiDetail?.subscribeParam + ?.isEnableSubscribe ?? + false) == + false) { _isTapEd = true; EasyLoading.show(status: S.current.zhengzaijiazai); await widget.reduce(widget.miNiDetail, selectSkus); @@ -267,7 +270,10 @@ class _ProductSku extends State { ), InkWell( onTap: () async { - if((widget?.miNiDetail?.subscribeParam?.isEnableSubscribe ?? false) == false){ + if ((widget?.miNiDetail?.subscribeParam + ?.isEnableSubscribe ?? + false) == + false) { _isTapEd = true; EasyLoading.show(status: S.current.zhengzaijiazai); if (count == 1 && realCount == 0) @@ -276,7 +282,16 @@ class _ProductSku extends State { else await widget.add(widget.miNiDetail, selectSkus); } - count += 1; + if ((widget?.miNiDetail?.oversold ?? 0) == 0 && + count >= + (widget?.miNiDetail?.productSkuVOList[0] + ?.skuStock ?? + 0)) { + SmartDialog.showToast("库存不足", + alignment: Alignment.center); + } else { + count += 1; + } setState(() {}); EasyLoading.dismiss(); }, @@ -295,7 +310,12 @@ class _ProductSku extends State { RoundButton( width: double.infinity, height: 54.h, - text: (widget?.miNiDetail?.subscribeParam?.isEnableSubscribe ?? false) == true ? S.of(context).lijiyuyue:"加入购物车", + text: + (widget?.miNiDetail?.subscribeParam?.isEnableSubscribe ?? + false) == + true + ? S.of(context).lijiyuyue + : "加入购物车", textColor: Colors.white, fontWeight: MyFontWeight.semi_bold, radius: 27, @@ -305,7 +325,15 @@ class _ProductSku extends State { Navigator.of(context).pop(); // SmartDialog.dismiss(); if (!_isTapEd) - widget.addShopCar(widget.miNiDetail, selectSkus,((widget?.miNiDetail?.subscribeParam?.isEnableSubscribe ?? false) == false) ? 1 : count); + widget.addShopCar( + widget.miNiDetail, + selectSkus, + ((widget?.miNiDetail?.subscribeParam + ?.isEnableSubscribe ?? + false) == + false) + ? 1 + : count); }, ), if (widget.buttonType == 1) diff --git a/lib/store/store_view/shop_goods.dart b/lib/store/store_view/shop_goods.dart index fac29938..10b28b56 100644 --- a/lib/store/store_view/shop_goods.dart +++ b/lib/store/store_view/shop_goods.dart @@ -1,6 +1,7 @@ import 'package:dio/dio.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/findMiNiGroupList.dart'; import 'package:huixiang/retrofit/data/shoppingCart.dart'; @@ -232,7 +233,8 @@ class _ShopGoods extends State { (widget.productListBean?.attrStyle ?? 0) == 1 && !(widget?.productListBean?.subscribeParam ?.isEnableSubscribe ?? - false)) + false) && + !(widget?.productListBean?.isSetMeal ?? false)) GestureDetector( behavior: HitTestBehavior.opaque, onTap: () async { @@ -249,58 +251,57 @@ class _ShopGoods extends State { 0); } }, - child: Container( - // padding: EdgeInsets.only(right: 16.w), - child: Stack( - children: [ - Container( - padding: EdgeInsets.only( - left: 35.w, - top: 4.h, - bottom: 4.h, - ), - margin: EdgeInsets.only(right:8.w,top: 4.h), - child: RoundButton( - text: S.of(context).xuanguige, - textColor: Colors.white, - fontWeight: MyFontWeight.medium, - radius: 3, - backgroup: Color(0xFF32A060), - fontSize: 11.sp, - padding: EdgeInsets.symmetric( - vertical: 5.h, horizontal: 3.w), - ), + child: Stack( + children: [ + Container( + padding: EdgeInsets.only( + left: 35.w, + top: 4.h, + bottom: 4.h, + ), + margin: EdgeInsets.only(right: 8.w, top: 4.h), + child: RoundButton( + text: S.of(context).xuanguige, + textColor: Colors.white, + fontWeight: MyFontWeight.medium, + radius: 3, + backgroup: Color(0xFF32A060), + fontSize: 11.sp, + padding: EdgeInsets.symmetric( + vertical: 5.h, horizontal: 3.w), ), - Positioned( - right: 0, - child: Visibility( - visible: widget.count > 0, - child: RoundButton( - width: 17, - height: 17.h, - text: "${widget.count}", - textColor: Color(0xFF32A060), - fontWeight: MyFontWeight.regular, - backgroup: Colors.white, - fontSize: 12.sp, - radius: 100, - ), + ), + Positioned( + right: 0, + child: Visibility( + visible: widget.count > 0, + child: RoundButton( + width: 17, + height: 17.h, + text: "${widget.count}", + textColor: Color(0xFF32A060), + fontWeight: MyFontWeight.regular, + backgroup: Colors.white, + fontSize: 12.sp, + radius: 100, ), ), - ], - ), + ), + ], )), if (widget.isShopCart || (widget.productListBean?.attrStyle ?? 0) == 0 && !(widget?.productListBean?.subscribeParam ?.isEnableSubscribe ?? - false)) + false) && + !(widget?.productListBean?.isSetMeal ?? false)) Spacer(), if (widget.isShopCart || (widget.productListBean?.attrStyle ?? 0) == 0 && !(widget?.productListBean?.subscribeParam ?.isEnableSubscribe ?? - false)) + false) && + !(widget?.productListBean?.isSetMeal ?? false)) GestureDetector( behavior: HitTestBehavior.opaque, onTap: () async { @@ -324,7 +325,8 @@ class _ShopGoods extends State { (widget.productListBean?.attrStyle ?? 0) == 0 && !(widget?.productListBean?.subscribeParam ?.isEnableSubscribe ?? - false)) + false) && + !(widget?.productListBean?.isSetMeal ?? false)) Container( alignment: Alignment.center, child: Text( @@ -340,7 +342,8 @@ class _ShopGoods extends State { (widget.productListBean?.attrStyle ?? 0) == 0 && !(widget?.productListBean?.subscribeParam ?.isEnableSubscribe ?? - false)) + false) && + !(widget?.productListBean?.isSetMeal ?? false)) GestureDetector( behavior: HitTestBehavior.opaque, onTap: () async { @@ -348,7 +351,15 @@ class _ShopGoods extends State { widget.tableId == 0) { showDeleteDialog(); } else { - if (_jumpType == -1) + // if ((widget?.productListBean?.oversold ?? 0) == 0 && + // widget.count >= + // (widget?.shoppingCartSkuItemListBean + // ?.skuStock ?? + // 0)) { + // SmartDialog.showToast("库存不足", + // alignment: Alignment.center); + // } else + if (_jumpType == -1) queryMiNiDetail(widget.productListBean.id); else if (_jumpType == 0) widget.add(widget.shoppingCartSkuItemListBean); @@ -364,7 +375,7 @@ class _ShopGoods extends State { } }, child: Container( - padding: EdgeInsets.only(left: 6.w, right:9.w), + padding: EdgeInsets.only(left: 6.w, right: 9.w), child: Image.asset( "assets/image/add.webp", width: 22, @@ -401,7 +412,7 @@ class _ShopGoods extends State { top: 4.h, bottom: 4.h, ), - margin: EdgeInsets.only(right:8.w,top: 4), + margin: EdgeInsets.only(right: 8.w, top: 4), child: RoundButton( text: S.of(context).lijiyuyue, textColor: Colors.white, @@ -413,41 +424,110 @@ class _ShopGoods extends State { vertical: 5.h, horizontal: 3.w), ), )), + if ((widget.productListBean.isSetMeal ?? false) == true) + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () async { + if (widget.storeInfo.posType.code == + "NORMALSTORE" && + widget.tableId == 0) { + showDeleteDialog(); + } + // else if ((widget?.productListBean?.oversold ?? + // 0) == + // 0 && + // widget.count >= + // (widget?.shoppingCartSkuItemListBean + // ?.skuStock ?? + // 0)) { + // SmartDialog.showToast("库存不足", + // alignment: Alignment.center); + // } + else { + await Navigator.of(context).pushNamed( + '/router/product_meals_sku', + arguments: { + "id": widget.productListBean.id, + "storeId": widget.productListBean.storeId, + "tableId": widget.tableId + }); + widget.queryShoppingCart(); + } + }, + child: Stack( + children: [ + Container( + padding: EdgeInsets.only( + left: 35.w, + top: 4.h, + bottom: 4.h, + ), + margin: EdgeInsets.only(right: 8.w, top: 4.h), + child: RoundButton( + text: "选套餐", + textColor: Colors.white, + fontWeight: MyFontWeight.medium, + radius: 3, + backgroup: Color(0xFF32A060), + fontSize: 11.sp, + padding: EdgeInsets.symmetric( + vertical: 5.h, horizontal: 3.w), + ), + ), + Positioned( + right: 0, + child: Visibility( + visible: widget.count > 0, + child: RoundButton( + width: 17, + height: 17.h, + text: "${widget.count}", + textColor: Color(0xFF32A060), + fontWeight: MyFontWeight.regular, + backgroup: Colors.white, + fontSize: 12.sp, + radius: 100, + ), + ), + ), + ], + )) ], ), SizedBox( height: 4.h, ), - if (widget.productListBean.vipPrice != null) - Row( - children: [ - Container( - alignment: Alignment.center, - padding: EdgeInsets.symmetric(horizontal: 2.w), - margin: EdgeInsets.only(right: 4.w), - decoration: new BoxDecoration( - color: Color(0xff32A060), - borderRadius: BorderRadius.circular(4)), - child: Text( - "VIP", - style: TextStyle( - fontSize: 12.sp, - fontWeight: MyFontWeight.medium, - color: Color(0xFFFFFFFF), - ), - ), - ), - Text( - "¥${AppUtils.calculateDouble(double.tryParse(widget.productListBean.vipPrice ?? "0") ?? 0)}", - style: TextStyle( - fontSize: 14.sp, - fontWeight: MyFontWeight.medium, - fontFamily: 'JDZhengHT', - color: Color(0xff32A060), - ), - ), - ], - ), + ///VIP价格(暂时弃用) + // if (widget.productListBean.vipPrice != null) + // Row( + // children: [ + // Container( + // alignment: Alignment.center, + // padding: EdgeInsets.symmetric(horizontal: 2.w), + // margin: EdgeInsets.only(right: 4.w), + // decoration: new BoxDecoration( + // color: Color(0xff32A060), + // borderRadius: BorderRadius.circular(4)), + // child: Text( + // "VIP", + // style: TextStyle( + // fontSize: 12.sp, + // fontWeight: MyFontWeight.medium, + // color: Color(0xFFFFFFFF), + // ), + // ), + // ), + // Text( + // "¥${AppUtils.calculateDouble(double.tryParse(widget.productListBean.vipPrice ?? "0") ?? 0)}", + // style: TextStyle( + // fontSize: 14.sp, + // fontWeight: MyFontWeight.medium, + // fontFamily: 'JDZhengHT', + // color: Color(0xff32A060), + // ), + // ), + // ], + // ), // Text( // "¥${AppUtils.calculateDouble(double.tryParse(widget.isShopCart ? widget.shoppingCartSkuItemListBean.skuPrice : widget.productListBean.applyPrice) ?? 0)}", // style: TextStyle( diff --git a/lib/store/store_view/shop_goods_car.dart b/lib/store/store_view/shop_goods_car.dart index 084aa832..f9d82847 100644 --- a/lib/store/store_view/shop_goods_car.dart +++ b/lib/store/store_view/shop_goods_car.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/findMiNiGroupList.dart'; import 'package:huixiang/retrofit/data/shoppingCart.dart'; @@ -12,21 +13,21 @@ class ShopGoodsCar extends StatefulWidget { final Function(String id, int count) queryMiNiDetail; final Function(ShoppingCartSkuItemListBean shoppingCartSkuItemListBean) add; final Function(ShoppingCartSkuItemListBean shoppingCartSkuItemListBean) - reduce; + reduce; final ProductListBean productListBean; final ShoppingCartSkuItemListBean shoppingCartSkuItemListBean; final int count; final bool isShopCart; ShopGoodsCar( - this.add, - this.reduce, { - this.productListBean, - this.count = 0, - this.isShopCart = false, - this.queryMiNiDetail, - this.shoppingCartSkuItemListBean, - }); + this.add, + this.reduce, { + this.productListBean, + this.count = 0, + this.isShopCart = false, + this.queryMiNiDetail, + this.shoppingCartSkuItemListBean, + }); @override State createState() { @@ -38,296 +39,310 @@ class _ShopGoodsCar extends State { @override Widget build(BuildContext context) { return Container( - color: Colors.white, - padding: EdgeInsets.only( - right: 16.w, - // bottom: 20.h, - ), - child:Column( - children: [ - Row( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.start, - mainAxisSize: MainAxisSize.max, - children: [ - SizedBox(width: 12.w), - MImage( - widget.productListBean != null - ? widget.productListBean.imgPath - : (widget.shoppingCartSkuItemListBean != null - ? widget.shoppingCartSkuItemListBean.skuImg - : ""), - width: 70.h, - height: 70.h, - radius: BorderRadius.circular(4), - fit: BoxFit.cover, - errorSrc: "assets/image/default_1.webp", - fadeSrc: "assets/image/default_1.webp", - ), - SizedBox( - width: 10, - ), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - Expanded( - child: Text( - widget.productListBean != null - ? widget.productListBean.productName - : widget.shoppingCartSkuItemListBean.productName, - overflow: TextOverflow.ellipsis, - maxLines: 2, - style: TextStyle( - color: Colors.black, - fontSize: 13.sp, - fontWeight: MyFontWeight.medium, - ), - ), - ), - // Image.asset( - // "assets/image/green_leaf.webp", - // fit: BoxFit.cover, - // width: 12, - // height: 12, - // ), - // Text( - // "X300", - // style: TextStyle( - // color: Color(0xFF55BC51), - // fontSize: 10.sp, - // fontWeight: MyFontWeight.semi_bold, - // ), - // ), - ], - ), - SizedBox( - height: 2.h, - ), - Row( - children: [ - Expanded( - child: Text( - (widget.productListBean != null - ? widget.productListBean.shortName - : ((widget.shoppingCartSkuItemListBean.skuName == "0") ? "": widget.shoppingCartSkuItemListBean.skuName ) ?? ""), - overflow: TextOverflow.ellipsis, - maxLines: 2, - style: TextStyle( - color: Color(0xFF4C4C4C), - fontSize: 10.sp, - fontWeight: MyFontWeight.regular, - ), - ), - ), - SizedBox( - width: 10, - ), - ], - ), - SizedBox( - height: 7.h, - ), - Row( - children: [ - Row( - children: [ - Text( - "¥${AppUtils.calculateDouble(double.tryParse(widget.isShopCart ? widget.shoppingCartSkuItemListBean.skuPrice : widget.productListBean.price) ?? 0)}", + color: Colors.white, + padding: EdgeInsets.only( + right: 16.w, + // bottom: 20.h, + ), + child: Column( + children: [ + Row( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + SizedBox(width: 12.w), + MImage( + widget.productListBean != null + ? widget.productListBean.imgPath + : (widget.shoppingCartSkuItemListBean != null + ? widget.shoppingCartSkuItemListBean.skuImg + : ""), + width: 70.h, + height: 70.h, + radius: BorderRadius.circular(4), + fit: BoxFit.cover, + errorSrc: "assets/image/default_1.webp", + fadeSrc: "assets/image/default_1.webp", + ), + SizedBox( + width: 10, + ), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Expanded( + child: Text( + widget.productListBean != null + ? widget.productListBean.productName + : widget + .shoppingCartSkuItemListBean.productName, + overflow: TextOverflow.ellipsis, + maxLines: 2, style: TextStyle( - color: Color(0xFFFF7A1A), - fontSize: 16.sp, - fontFamily: 'JDZhengHT', + color: Colors.black, + fontSize: 13.sp, fontWeight: MyFontWeight.medium, ), ), - SizedBox( - width: 2.w, + ), + // Image.asset( + // "assets/image/green_leaf.webp", + // fit: BoxFit.cover, + // width: 12, + // height: 12, + // ), + // Text( + // "X300", + // style: TextStyle( + // color: Color(0xFF55BC51), + // fontSize: 10.sp, + // fontWeight: MyFontWeight.semi_bold, + // ), + // ), + ], + ), + SizedBox( + height: 2.h, + ), + Row( + children: [ + Expanded( + child: Text( + (widget.productListBean != null + ? widget.productListBean.shortName + : ((widget.shoppingCartSkuItemListBean + .skuName == + "0") + ? "" + : widget.shoppingCartSkuItemListBean + .skuName) ?? + ""), + overflow: TextOverflow.ellipsis, + maxLines: 2, + style: TextStyle( + color: Color(0xFF4C4C4C), + fontSize: 10.sp, + fontWeight: MyFontWeight.regular, + ), ), - // Container( - // width: 44.w, - // height: 18.h, - // decoration: BoxDecoration( - // color: Color(0xFFFF4500), - // borderRadius: BorderRadius.circular(2), - // ), - // alignment: Alignment.center, - // child: Text( - // "APP专享", - // style: TextStyle( - // color: Color(0xFFFFFFFF), - // fontSize: 10.sp, - // fontWeight: MyFontWeight.medium, - // ), - // ), - // ), - ], - ), - Spacer(), - if (!widget.isShopCart && - (widget.productListBean?.attrStyle ?? 0) == 1) - Stack( + ), + SizedBox( + width: 10, + ), + ], + ), + SizedBox( + height: 7.h, + ), + Row( + children: [ + Row( children: [ - Container( - margin: EdgeInsets.only(right: 8, top: 4), - child: RoundButton( - width: 49.w, - text: S.of(context).xuanguige, - textColor: Colors.white, + Text( + "¥${AppUtils.calculateDouble(double.tryParse(widget.isShopCart ? widget.shoppingCartSkuItemListBean.skuPrice : widget.productListBean.price) ?? 0)}", + style: TextStyle( + color: Color(0xFFFF7A1A), + fontSize: 16.sp, + fontFamily: 'JDZhengHT', fontWeight: MyFontWeight.medium, - radius: 3, - backgroup: Color(0xFF32A060), - fontSize: 11.sp, - padding: EdgeInsets.symmetric(vertical: 5.h), - callback: () { - widget.queryMiNiDetail( - widget.productListBean != null - ? widget.productListBean.id - : widget.shoppingCartSkuItemListBean - .productId, - 0); - }, ), ), - Positioned( - right: 0, - child: Visibility( - visible: widget.count > 0, + SizedBox( + width: 2.w, + ), + // Container( + // width: 44.w, + // height: 18.h, + // decoration: BoxDecoration( + // color: Color(0xFFFF4500), + // borderRadius: BorderRadius.circular(2), + // ), + // alignment: Alignment.center, + // child: Text( + // "APP专享", + // style: TextStyle( + // color: Color(0xFFFFFFFF), + // fontSize: 10.sp, + // fontWeight: MyFontWeight.medium, + // ), + // ), + // ), + ], + ), + Spacer(), + if (!widget.isShopCart && + (widget.productListBean?.attrStyle ?? 0) == 1) + Stack( + children: [ + Container( + margin: EdgeInsets.only(right: 8, top: 4), child: RoundButton( - width: 17, - height: 17.h, - text: "${widget.count}", - textColor: Color(0xFF32A060), - fontWeight: MyFontWeight.regular, - backgroup: Colors.white, - fontSize: 12.sp, - radius: 100, + width: 49.w, + text: S.of(context).xuanguige, + textColor: Colors.white, + fontWeight: MyFontWeight.medium, + radius: 3, + backgroup: Color(0xFF32A060), + fontSize: 11.sp, + padding: + EdgeInsets.symmetric(vertical: 5.h), + callback: () { + widget.queryMiNiDetail( + widget.productListBean != null + ? widget.productListBean.id + : widget + .shoppingCartSkuItemListBean + .productId, + 0); + }, ), ), + Positioned( + right: 0, + child: Visibility( + visible: widget.count > 0, + child: RoundButton( + width: 17, + height: 17.h, + text: "${widget.count}", + textColor: Color(0xFF32A060), + fontWeight: MyFontWeight.regular, + backgroup: Colors.white, + fontSize: 12.sp, + radius: 100, + ), + ), + ), + ], + ), + if (widget.isShopCart || + (widget.productListBean?.attrStyle ?? 0) == 0) + InkWell( + onTap: () { + widget + .reduce(widget.shoppingCartSkuItemListBean); + }, + child: Image.asset( + "assets/image/reduce.webp", + width: 22, + height: 22.h, ), - ], - ), - if (widget.isShopCart || - (widget.productListBean?.attrStyle ?? 0) == 0) - InkWell( - onTap: () { - widget.reduce(widget.shoppingCartSkuItemListBean); - }, - child: Image.asset( - "assets/image/reduce.webp", - width: 22, - height: 22.h, ), - ), - if (widget.isShopCart || - (widget.productListBean?.attrStyle ?? 0) == 0) - Container( - width: 30, - alignment: Alignment.center, - child: Text( - "${widget.count}", - style: TextStyle( - color: Colors.black, - fontSize: 14.sp, - fontWeight: MyFontWeight.medium, + if (widget.isShopCart || + (widget.productListBean?.attrStyle ?? 0) == 0) + Container( + width: 30, + alignment: Alignment.center, + child: Text( + "${widget.count}", + style: TextStyle( + color: Colors.black, + fontSize: 14.sp, + fontWeight: MyFontWeight.medium, + ), ), ), - ), - if (widget.isShopCart || - (widget.productListBean?.attrStyle ?? 0) == 0) - GestureDetector( - onTap: () { - widget.add(widget.shoppingCartSkuItemListBean); - }, - child: Image.asset( - "assets/image/add.webp", - width: 22, - height: 22.h, + if (widget.isShopCart || + (widget.productListBean?.attrStyle ?? 0) == 0) + GestureDetector( + onTap: () { + widget.add(widget.shoppingCartSkuItemListBean); + }, + child: Image.asset( + "assets/image/add.webp", + width: 22, + height: 22.h, + ), ), - ), - ], - ), - SizedBox( - height: 4.h, - ), - Text( - "¥${AppUtils.calculateDouble(double.tryParse(widget.isShopCart ? widget.shoppingCartSkuItemListBean.skuPrice : widget.productListBean.applyPrice) ?? 0)}", - style: TextStyle( - color: Color(0xFFA29E9E), - fontSize: 12.sp, - fontFamily: 'JDZhengHT', - decoration: TextDecoration.lineThrough, - fontWeight: MyFontWeight.regular, + ], + ), + SizedBox( + height: 4.h, + ), + Text( + "¥${AppUtils.calculateDouble(double.tryParse(widget.isShopCart ? widget.shoppingCartSkuItemListBean.skuPrice : widget.productListBean.applyPrice) ?? 0)}", + style: TextStyle( + color: Color(0xFFA29E9E), + fontSize: 12.sp, + fontFamily: 'JDZhengHT', + decoration: TextDecoration.lineThrough, + fontWeight: MyFontWeight.regular, + ), ), - ), - ], + ], + ), ), - ), - ], - ), - if(widget.shoppingCartSkuItemListBean.setMealDataList.length != 0) - ListView.builder( - itemCount: widget.shoppingCartSkuItemListBean.setMealDataList.length, - scrollDirection: Axis.vertical, - physics: BouncingScrollPhysics(), - shrinkWrap: true, - padding: EdgeInsets.zero, - itemBuilder: (context, index) { - return shopCarMealsItem(widget.shoppingCartSkuItemListBean.setMealDataList[index]); - }, + ], ), - SizedBox(height:15.h,) - ], - ) - ); + if (widget.shoppingCartSkuItemListBean.setMealDataList.length != 0) + ListView.builder( + itemCount: + widget.shoppingCartSkuItemListBean.setMealDataList.length, + scrollDirection: Axis.vertical, + physics: BouncingScrollPhysics(), + shrinkWrap: true, + padding: EdgeInsets.zero, + itemBuilder: (context, index) { + return shopCarMealsItem(widget + .shoppingCartSkuItemListBean.setMealDataList[index]); + }, + ), + SizedBox( + height: 15.h, + ) + ], + )); } - Widget shopCarMealsItem(SetMealDataList setMealDataList) { - return Container( - margin: EdgeInsets.symmetric(vertical:10.h,horizontal: 16.w), - child: Row( - children: [ - Expanded( - flex:2, - child: Text( - setMealDataList.productInfoList[0].productName, - overflow: TextOverflow.ellipsis, - maxLines: 1, - style: TextStyle( - color: Color(0xffA29E9E), - fontSize: 14.sp, - fontWeight: MyFontWeight.regular, + return Column(children: setMealDataList.productInfoList.map((e) { + return Container( + margin: EdgeInsets.symmetric(vertical: 10.h, horizontal: 16.w), + child: Row( + children: [ + Expanded( + flex: 2, + child: Text( + e.productName, + overflow: TextOverflow.ellipsis, + maxLines: 1, + style: TextStyle( + color: Color(0xffA29E9E), + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + ), ), ), - ), - Expanded(flex:3, - child: Text( - "${(setMealDataList.productInfoList[0].skuName == "") ? "默认": setMealDataList.productInfoList[0].skuName}", + Expanded( + flex: 3, + child: Text( + "${(e.skuName == "") ? "默认" : e.skuName}", + overflow: TextOverflow.ellipsis, + maxLines: 1, + style: TextStyle( + color: Color(0xffA29E9E), + fontSize: 13.sp, + fontWeight: MyFontWeight.regular, + ), + ), + ), + Text( + "x${e.buyNumber.toString()}", overflow: TextOverflow.ellipsis, maxLines: 1, style: TextStyle( - color: Color(0xffA29E9E), + color: Color(0xffFF7A1A), fontSize: 13.sp, fontWeight: MyFontWeight.regular, ), ), - ), - Text( - setMealDataList.productInfoList[0].buyNumber.toString(), - overflow: TextOverflow.ellipsis, - maxLines: 1, - style: TextStyle( - color: Color(0xffFF7A1A), - fontSize: 13.sp, - fontWeight: MyFontWeight.regular, - ), - ), - ], - ), - ); + ], + ), + ); + }).toList(),); } - } diff --git a/lib/store/store_view/store_order_list.dart b/lib/store/store_view/store_order_list.dart index 35a26cd7..4e6a99ce 100644 --- a/lib/store/store_view/store_order_list.dart +++ b/lib/store/store_view/store_order_list.dart @@ -189,6 +189,7 @@ class _StoreOrderListPage extends State { .pushNamed('/router/shop_details_page', arguments: { "id": e.id, "storeId": e.storeId, + "isSetMeal":e.isSetMeal }); widget.queryShoppingCart(); } diff --git a/lib/utils/flutter_utils.dart b/lib/utils/flutter_utils.dart index 6d5d5ead..2811d185 100644 --- a/lib/utils/flutter_utils.dart +++ b/lib/utils/flutter_utils.dart @@ -28,6 +28,25 @@ class AppUtils { return double.tryParse(valueStr.substring(0, valueStr.indexOf(".") + 3))??0; } + ///使用16进制色值并返回对应色值的方法 + static Color getLighterColor(String hexColor) { + // 将16进制颜色值转换为Color对象 + Color color = Color(int.parse(hexColor.replaceAll("#", "FF"), radix: 16)); + + // 计算颜色的RGB值 + int red = color.red + 95; + int green = color.green + 95; + int blue = color.blue + 95; + + // 确保RGB值不超过255 + red = red > 255 ? 255 : red; + green = green > 255 ? 255 : green; + blue = blue > 255 ? 255 : blue; + + // 返回较浅的颜色值 + return Color.fromARGB(255, red, green, blue); + } + ///版本号 static bool versionCompare(String localVersion, String serverVersion) { try { diff --git a/lib/utils/upload_async.dart b/lib/utils/upload_async.dart index b4fb5339..8711fa3f 100644 --- a/lib/utils/upload_async.dart +++ b/lib/utils/upload_async.dart @@ -5,6 +5,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; +import 'package:image_pickers/image_pickers.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:thumbnails/thumbnails.dart'; @@ -12,23 +13,65 @@ import '../community/release_dynamic.dart'; import '../retrofit/data/base_data.dart'; import '../retrofit/data/upload_result.dart'; import '../retrofit/retrofit_api.dart'; +import '../view_widget/custom_image.dart'; +import 'font_weight.dart'; class UploadAsync { static void upload(int dynamicType, List mediaPaths, String addressText, String dynamicText) async { SmartDialog.show( - widget: Container( - alignment: Alignment.centerRight, - margin: EdgeInsets.only( - right: 10.w, - ), - child: CircularProgressIndicator( - strokeWidth: 4.0, - backgroundColor: Colors.green, - // value: 0.4, - valueColor: new AlwaysStoppedAnimation(Colors.grey), - ), + widget: Container( + alignment: Alignment.centerRight, + margin: EdgeInsets.only( + right: 10.w, ), + child: Stack( + alignment: Alignment.center, + children: [ + Container( + width: 50.h, + height: 70.h, + decoration: BoxDecoration( + color: Colors.grey, borderRadius: BorderRadius.circular(2)), + child: dynamicType == 0 + ? Expanded(child: Column( + children: [ + Text( + dynamicText, + maxLines: 5, + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontWeight: MyFontWeight.semi_bold, + fontSize: dynamicText.length > 10 ? (dynamicText.length > 20?8.sp:10.sp):15.sp, + color: Color(0xFFCDCCCC), + ), + ), + Expanded(child: + Container( + height: 20.h, + )) + ])) + : ClipRRect( + borderRadius: BorderRadius.circular(2), + child: Image.file( + File(mediaPaths[0].galleryMode == GalleryMode.video + ? mediaPaths[0].thumbPath + : mediaPaths[0].path), + fit: BoxFit.cover, + width: double.infinity, + height: double.infinity, + ), + ), + ), + CircularProgressIndicator( + strokeWidth: 3.0, + backgroundColor: Colors.white, + // value: 0.4, + valueColor: new AlwaysStoppedAnimation(Colors.grey), + ), + ], + ), + ), maskWidgetTemp: SizedBox(), ); var sp = await SharedPreferences.getInstance(); @@ -162,7 +205,7 @@ class UploadInstance { return _instance; } - void notifyAllObservers(){ + void notifyAllObservers() { _uploadObserverList.forEach((element) { element.onUploadFinish(); }); diff --git a/lib/view_widget/mine_vip_entry.dart b/lib/view_widget/mine_vip_entry.dart index 932d2bd1..f931d0de 100644 --- a/lib/view_widget/mine_vip_entry.dart +++ b/lib/view_widget/mine_vip_entry.dart @@ -31,7 +31,7 @@ class MineVipEntry extends StatelessWidget { this.createTime = ""}); String topLeft = ""; - String levelText = "普通用户"; + String levelText = "普卡用户"; Color logoColor = Color(0xFFCACACA); Color levelTextColor = Color(0xFFCACACA); Color levelTextBackdrop = Color(0xFFFFF8EC); @@ -39,206 +39,315 @@ class MineVipEntry extends StatelessWidget { @override Widget build(BuildContext context) { if (userInfo != null && - userInfo.memberRankVo != null && - ranks != null && - ranks.length > 0) { - curLevel = (ranks.indexWhere((element) => element.id == userInfo.memberRankVo.id) + 1); - vipLevel = curLevel; - } + userInfo.memberRankVo != null && + ranks != null && + ranks.length > 0) { + curLevel = (ranks + .indexWhere((element) => element.id == userInfo.memberRankVo.id) + + 1); + vipLevel = curLevel; + } - if (curLevel == vipLevel) { - topLeft = S.of(context).dangqiandengji; - } else if (vipLevel < curLevel) { - topLeft = S.of(context).shangyidengji; - } else { - topLeft = S.of(context).zanweikaitong; - } + if (curLevel == vipLevel) { + topLeft = S.of(context).dangqiandengji; + } else if (vipLevel < curLevel) { + topLeft = S.of(context).shangyidengji; + } else { + topLeft = S.of(context).zanweikaitong; + } switch (vipLevel) { - case 1: + case 2: { - levelText = "${S.of(context).yinkahuiyuan}"; - logoColor = Color(0xFFA0C4E7); - levelTextColor = Color(0xFF61ABF3); - levelTextBackdrop = Color(0xFFC1DBF4); + levelText = ranks[1].rankName; + logoColor = Color(int.parse( + (ranks[1].textColor ?? "").replaceAll("#", "FF"), + radix: 16)); + levelTextColor = Color(int.parse( + (ranks[1].textColor ?? "").replaceAll("#", "FF"), + radix: 16)); + levelTextBackdrop = Color(int.parse( + (ranks[1].color ?? "").replaceAll("#", "FF"), + radix: 16)); break; } - case 2: + case 3: { - levelText = "${S.of(context).jinkahuiyuan}"; - logoColor = Color(0xFFFBB43A); - levelTextColor = Color(0xFFFBB43A); - levelTextBackdrop = Color(0xFFFFECD2); + levelText = ranks[2].rankName; + logoColor = Color(int.parse( + (ranks[2].textColor ?? "").replaceAll("#", "FF"), + radix: 16)); + levelTextColor = Color(int.parse( + (ranks[2].textColor ?? "").replaceAll("#", "FF"), + radix: 16)); + levelTextBackdrop = Color(int.parse( + (ranks[2].color ?? "").replaceAll("#", "FF"), + radix: 16)); break; } - case 3: + case 4: + { + levelText = ranks[3].rankName; + logoColor = Color(int.parse( + (ranks[3].textColor ?? "").replaceAll("#", "FF"), + radix: 16)); + levelTextColor = Color(int.parse( + (ranks[3].textColor ?? "").replaceAll("#", "FF"), + radix: 16)); + levelTextBackdrop = Color(int.parse( + (ranks[3].color ?? "").replaceAll("#", "FF"), + radix: 16)); + break; + } + case 5: { - levelText = "${S.of(context).gongchuanghuiyuan}"; - logoColor = Color(0xFF352822); - levelTextColor = Color(0xFF92755D); - levelTextBackdrop = Color(0xFFFFECD2); + levelText = ranks[4].rankName; + logoColor = Color(int.parse( + (ranks[4].textColor ?? "").replaceAll("#", "FF"), + radix: 16)); + levelTextColor = Color(int.parse( + (ranks[4].textColor ?? "").replaceAll("#", "FF"), + radix: 16)); + levelTextBackdrop = Color(int.parse( + (ranks[4].color ?? "").replaceAll("#", "FF"), + radix: 16)); break; } } - Widget widget = Container( - height:20.h, - width: double.infinity, - child: Row( - children: [ - Container( - height: double.infinity, - padding: EdgeInsets.symmetric(horizontal:3.w,vertical:4.h), - decoration: BoxDecoration( - color: logoColor, - borderRadius: BorderRadius.only( - topLeft: Radius.circular(4), - bottomLeft: Radius.circular(4),), - boxShadow: [ - BoxShadow( - color: Color(0x08213303).withAlpha(12), - offset: Offset(0, 2), - blurRadius: 4, - spreadRadius: 0, - ), - ], - ), - child: Image.asset( - "assets/image/mine_vip_logo.webp", - fit: BoxFit.cover, - // width: 13.w, - // height: 11.h, - ), - ), - Container( - height: double.infinity, - padding: EdgeInsets.symmetric(horizontal:3.w,vertical:3.h), - decoration: BoxDecoration( - color: levelTextBackdrop, - borderRadius: BorderRadius.only( - topRight: Radius.circular(4), - bottomRight: Radius.circular(4),), - boxShadow: [ - BoxShadow( - color: Color(0x08213303).withAlpha(12), - offset: Offset(0, 2), - blurRadius: 4, - spreadRadius: 0, + Widget widget = userInfo.memberRankVo.rankName != null + ? Container( + height: 20.h, + width: double.infinity, + child: Row( + children: [ + Container( + height: double.infinity, + padding: EdgeInsets.symmetric(horizontal: 3.w, vertical: 4.h), + decoration: BoxDecoration( + color: logoColor, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(4), + bottomLeft: Radius.circular(4), + ), + boxShadow: [ + BoxShadow( + color: Color(0x08213303).withAlpha(12), + offset: Offset(0, 2), + blurRadius: 4, + spreadRadius: 0, + ), + ], + ), + child: Image.asset( + "assets/image/mine_vip_logo.webp", + fit: BoxFit.cover, + // width: 13.w, + // height: 11.h, + ), ), + Container( + height: double.infinity, + padding: EdgeInsets.symmetric(horizontal: 3.w, vertical: 3.h), + decoration: BoxDecoration( + color: levelTextBackdrop, + borderRadius: BorderRadius.only( + topRight: Radius.circular(4), + bottomRight: Radius.circular(4), + ), + boxShadow: [ + BoxShadow( + color: Color(0x08213303).withAlpha(12), + offset: Offset(0, 2), + blurRadius: 4, + spreadRadius: 0, + ), + ], + ), + child: Row( + 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, + ), + ], + ), + ) ], ), - child:Row( + ) + : Container( + height: 20.h, + width: double.infinity, + child: Row( children: [ - Text( - levelText, - textAlign: TextAlign.center, - style: TextStyle( - color: levelTextColor, - fontSize: 10.sp, - fontWeight: MyFontWeight.regular, + Container( + height: double.infinity, + padding: EdgeInsets.symmetric(horizontal: 3.w, vertical: 4.h), + decoration: BoxDecoration( + color: Color(0xFFCACACA), + borderRadius: BorderRadius.only( + topLeft: Radius.circular(4), + bottomLeft: Radius.circular(4), + ), + boxShadow: [ + BoxShadow( + color: Color(0x08213303).withAlpha(12), + offset: Offset(0, 2), + blurRadius: 4, + spreadRadius: 0, + ), + ], + ), + child: Image.asset( + "assets/image/mine_vip_logo.webp", + fit: BoxFit.cover, + // width: 13.w, + // height: 11.h, ), ), - Image.asset( - "assets/image/icon_right.webp", - fit: BoxFit.cover, - width: 8, - height: 8, - color: levelTextColor, - ), + Container( + height: double.infinity, + padding: EdgeInsets.symmetric(horizontal: 3.w, vertical: 3.h), + decoration: BoxDecoration( + color: Color(0xFFFFF8EC), + borderRadius: BorderRadius.only( + topRight: Radius.circular(4), + bottomRight: Radius.circular(4), + ), + boxShadow: [ + BoxShadow( + color: Color(0x08213303).withAlpha(12), + offset: Offset(0, 2), + blurRadius: 4, + spreadRadius: 0, + ), + ], + ), + child: Row( + children: [ + Text( + "开通会员", + textAlign: TextAlign.center, + style: TextStyle( + color: Color(0xFFCACACA), + fontSize: 10.sp, + fontWeight: MyFontWeight.regular, + ), + ), + Image.asset( + "assets/image/icon_right.webp", + fit: BoxFit.cover, + width: 8, + height: 8, + color: Color(0xFFCACACA), + ), + ], + ), + ) ], ), - ) - ], - ), - ); - // Container( - // width: double.infinity, - // padding: EdgeInsets.only(top: 12.h, bottom: 22.h, left: 12.w, right: 12.w), - // margin: EdgeInsets.only(top: 23.h,left: 13.5.w,right: 13.5.w,bottom:15.h), - // 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, - // ), - // ) - // ], - // )); + ); + // Container( + // width: double.infinity, + // padding: EdgeInsets.only(top: 12.h, bottom: 22.h, left: 12.w, right: 12.w), + // margin: EdgeInsets.only(top: 23.h,left: 13.5.w,right: 13.5.w,bottom:15.h), + // 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( onTap: () { @@ -258,7 +367,7 @@ class MineVipEntry extends StatelessWidget { Navigator.of(context) .pushNamed('/router/mine_vip_core', arguments: { "rankLevel": curLevel, - "userInfo": userInfo.masterCardRankName, + "userInfo": userInfo, "createTime": (userInfo != null) ? "${userInfo.createTime}" : "", "expendAmount": double.tryParse(userInfo?.expendAmount ?? "0").toInt(), diff --git a/lib/vip/vip_page.dart b/lib/vip/vip_page.dart index 2b4939b6..cddee8a4 100644 --- a/lib/vip/vip_page.dart +++ b/lib/vip/vip_page.dart @@ -11,9 +11,12 @@ import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:shared_preferences/shared_preferences.dart'; +import '../generated/l10n.dart'; import '../retrofit/data/base_data.dart'; +import '../retrofit/data/user_info.dart'; import '../retrofit/retrofit_api.dart'; import '../utils/flutter_utils.dart'; +import '../utils/font_weight.dart'; import '../view_widget/my_appbar.dart'; @@ -30,6 +33,7 @@ class _VipPageState extends State with AutomaticKeepAliveClientMixin { final RefreshController _refreshController = RefreshController(); ApiService apiService; VipCardHome vipHome; + UserInfo userInfo; @override @@ -41,9 +45,41 @@ class _VipPageState extends State with AutomaticKeepAliveClientMixin { @override void initState() { super.initState(); - queryVipHome(); + // queryVipHome(); + queryUserBalance(); + } + ///查询会员信息 + queryUserBalance() async { + try{ + if (apiService == null) { + SharedPreferences value = await SharedPreferences.getInstance(); + apiService = ApiService( + Dio(), + context: context, + token: value.getString("token"), + showLoading: true + ); + } + BaseData baseData = + await apiService.queryInfo().catchError((onError) { + _refreshController.refreshFailed(); + _refreshController.loadFailed();}); + if (baseData != null && baseData.isSuccess) { + userInfo = baseData.data; + if (mounted) setState(() {}); + _refreshController.refreshCompleted(); + _refreshController.loadComplete(); + }else { + SmartDialog.showToast(baseData.msg, alignment: Alignment.center); + _refreshController.refreshFailed(); + _refreshController.loadFailed(); + } + }finally{ + setState((){}); + } } + ///Vip季卡,月卡,首页接口(暂不用) queryVipHome() async { try{ if (apiService == null) { @@ -68,6 +104,8 @@ class _VipPageState extends State with AutomaticKeepAliveClientMixin { _refreshController.loadComplete(); }else{ SmartDialog.showToast(baseData.msg ?? "", alignment: Alignment.center); + _refreshController.loadFailed(); + _refreshController.refreshFailed(); } }finally{ setState((){}); @@ -88,7 +126,7 @@ class _VipPageState extends State with AutomaticKeepAliveClientMixin { header: MyHeader(), physics: BouncingScrollPhysics(), onRefresh: () { - queryVipHome(); + queryUserBalance(); }, child: SingleChildScrollView( child: Container( @@ -96,14 +134,16 @@ class _VipPageState extends State with AutomaticKeepAliveClientMixin { mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ - VipTop(vipHome,(){ - queryVipHome(); - }), + VipTop(vipHome, + // (){queryVipHome();} + ), + + // if(vipHome !=null) + // VipGoodsDiscount(vipHome), - if(vipHome !=null) - VipGoodsDiscount(vipHome), + ExclusiveCoupon(userInfo), - ExclusiveCoupon(), + vipRule(), SizedBox(height: 24.h,) ], @@ -115,6 +155,83 @@ class _VipPageState extends State with AutomaticKeepAliveClientMixin { ); } + ///会员卡规则说明 + Widget vipRule(){ + return Container( + margin: EdgeInsets.only(left: 14.w, right: 14.w, bottom:40.h,top:8.h), + width: double.infinity, + padding: EdgeInsets.only(top:14.h, left:20.h, bottom:8.h, right:20.w), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(6.w), + color: Colors.white, + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ) + ], + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Image.asset( + "assets/image/vip_title.webp", + fit: BoxFit.fill, //填充剩余空间 + height: 13.h, + width: 27.w, + ), + SizedBox( + width: 4.w, + ), + Text( + "会员卡说明", + style: TextStyle( + color: Colors.black, + fontSize: 15.sp, + fontWeight: MyFontWeight.semi_bold, + ), + ), + ], + ), + SizedBox(height: 12.h,), + Padding(padding:EdgeInsets.symmetric(vertical: 12.h), + child:Text( + "1.仅限使用储值金额消费时享受VIP权益(使用优惠券及其他支付方式均不享受VIP权益);", + style: TextStyle( + color: Color(0xFF6A6A6A), + fontSize: 13.sp, + height: 1.5.h, + fontWeight: MyFontWeight.regular, + ), + )), + Padding(padding:EdgeInsets.symmetric(vertical:6.h), + child:Text( + "2.储值余额不足时不享受VIP权益;", + style: TextStyle( + color: Color(0xFF6A6A6A), + fontSize: 13.sp, + height: 1.5.h, + fontWeight: MyFontWeight.regular, + ), + )), + Padding(padding:EdgeInsets.symmetric(vertical: 12.h), + child:Text( + "3.2023年6月1日前储值余额不享受VIP价格;", + style: TextStyle( + color: Color(0xFF6A6A6A), + fontSize: 13.sp, + height: 1.5.h, + fontWeight: MyFontWeight.regular, + ), + )), + ], + ),); + } + @override bool get wantKeepAlive => true; } diff --git a/lib/vip/vip_view/exclusive_coupon.dart b/lib/vip/vip_view/exclusive_coupon.dart index a755ffaf..5d6691d5 100644 --- a/lib/vip/vip_view/exclusive_coupon.dart +++ b/lib/vip/vip_view/exclusive_coupon.dart @@ -4,9 +4,13 @@ import 'package:huixiang/utils/font_weight.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import '../../generated/l10n.dart'; +import '../../retrofit/data/user_info.dart'; import '../../view_widget/my_appbar.dart'; class ExclusiveCoupon extends StatefulWidget { + final UserInfo userInfo; + + ExclusiveCoupon(this.userInfo); @override State createState() { return _ExclusiveCoupon(); @@ -16,291 +20,351 @@ class ExclusiveCoupon extends StatefulWidget { class _ExclusiveCoupon extends State { @override Widget build(BuildContext context) { - return Container( - margin: EdgeInsets.only(left: 14.w, right: 14.w, bottom: 40.h), - width: double.infinity, - padding: - EdgeInsets.only(top: 20.h, left: 20.h, bottom: 10.h, right: 20.w), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(6.w), - color: Colors.white, - 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: [ - SizedBox( - width: 7.w, - ), - Image.asset( - "assets/image/vip_title.webp", - fit: BoxFit.fill, //填充剩余空间 - height: 13.h, - width: 27.w, - ), - SizedBox( - width: 4.w, + return Column( + children: [ + (widget?.userInfo?.isVip ?? false) + ? Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Image.asset( + "assets/image/vip_discount_left.webp", + width: 21.w, + height: 39.h, + fit: BoxFit.fill, + ), + SizedBox( + width: 11.w, + ), + Text( + S.of(context).huixiangvipkazhuanxiang, + style: TextStyle( + color: Color(0xff32A060), + fontSize: 15.sp, + fontWeight: MyFontWeight.semi_bold, ), - Text( - S.of(context).zhuanxiangyouhuiquan, - style: TextStyle( - color: Colors.black, - fontSize: 15.sp, - fontWeight: MyFontWeight.semi_bold, - ), + ), + SizedBox( + width: 11.w, + ), + Image.asset( + "assets/image/vip_discount_right.webp", + width: 21.w, + height: 39.h, + fit: BoxFit.fill, + ), + ], + ) + : Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Image.asset( + "assets/image/vip_lock.webp", + width: 20, + height: 20, + fit: BoxFit.cover, + ), + SizedBox( + width: 2.w, + ), + Text( + "解锁回乡VIP卡获取更多权益", + style: TextStyle( + color: Colors.black, + fontSize: 15.sp, + fontWeight: MyFontWeight.semi_bold, ), - GestureDetector( - behavior: HitTestBehavior.translucent, - onTap: () { - showAlertDialog(); - }, - child: Container( - padding: EdgeInsets.only( - left: 8.w, right: 30.w, top: 3.h, bottom: 3.h), - child: Image.asset( - "assets/image/vip_tips.webp", + ), + ], + ), + Container( + margin: EdgeInsets.only(left: 14.w, right: 14.w, bottom:16.h,top: 17.h), + width: double.infinity, + padding: + EdgeInsets.only(top: 20.h, left: 20.h, bottom: 10.h, right: 20.w), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(6.w), + color: Colors.white, + 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: [ + SizedBox( + width: 7.w, + ), + Image.asset( + "assets/image/vip_title.webp", fit: BoxFit.fill, //填充剩余空间 - height: 14, - width: 14, + height: 13.h, + width: 27.w, ), - ), + SizedBox( + width: 4.w, + ), + Text( + "会员卡专享", + style: TextStyle( + color: Colors.black, + fontSize: 15.sp, + fontWeight: MyFontWeight.semi_bold, + ), + ), + // GestureDetector( + // behavior: HitTestBehavior.translucent, + // onTap: () { + // showAlertDialog(); + // }, + // child: Container( + // padding: EdgeInsets.only( + // left: 8.w, right: 30.w, top: 3.h, bottom: 3.h), + // child: Image.asset( + // "assets/image/vip_tips.webp", + // fit: BoxFit.fill, //填充剩余空间 + // height: 14, + // width: 14, + // ), + // ), + // ), + ], ), - ], - ), - SizedBox( - height: 10.h, - ), - Container( - height: 124.h, - margin: EdgeInsets.only(bottom: 16.h), - child: Stack( - children: [ - Image.asset( - "assets/image/vip_shop_bj.webp", - fit: BoxFit.fill, //填充剩余空间 - height: double.infinity, - width: double.infinity, - ), - Container( - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Expanded( - child: Padding( - padding: EdgeInsets.only(top: 25.h, left: 19.w), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - "海峡姐妹饮品券", - style: TextStyle( - color: Color(0xff32A060), - fontSize: 15.sp, - fontWeight: MyFontWeight.semi_bold, - ), - ), - SizedBox( - height: 5.h, - ), - Text.rich( - TextSpan( - children: [ - TextSpan( - text: "6", - style: TextStyle( - fontWeight: MyFontWeight.extra_bold, - fontSize: 36.sp, - fontFamily: 'JDZhengHT', - color: Color(0xffFF7E12), + SizedBox( + height: 10.h, + ), + Container( + height: 124.h, + margin: EdgeInsets.only(bottom: 16.h), + child: Stack( + children: [ + Image.asset( + "assets/image/vip_shop_bj.webp", + fit: BoxFit.fill, //填充剩余空间 + height: double.infinity, + width: double.infinity, + ), + Container( + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Expanded( + child: Padding( + padding: EdgeInsets.only(top: 25.h, left: 19.w), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "海峡姐妹饮品券", + style: TextStyle( + color: Color(0xff32A060), + fontSize: 15.sp, + fontWeight: MyFontWeight.semi_bold, + ), ), - ), - TextSpan( - text: " 折", - style: TextStyle( - fontSize: 24.sp, - color: Color(0xffFF7E12), - fontWeight: MyFontWeight.semi_bold, + SizedBox( + height: 5.h, ), - ), - ], - ), - textDirection: TextDirection.ltr, - ), - ], - ), - )), - Image.asset( - "assets/image/vip_shop_hx.webp", - fit: BoxFit.fill, //填充剩余空间 - height: 85, - width: 85, + Text.rich( + TextSpan( + children: [ + TextSpan( + text: "6", + style: TextStyle( + fontWeight: MyFontWeight.extra_bold, + fontSize: 36.sp, + fontFamily: 'JDZhengHT', + color: Color(0xffFF7E12), + ), + ), + TextSpan( + text: " 折", + style: TextStyle( + fontSize: 24.sp, + color: Color(0xffFF7E12), + fontWeight: MyFontWeight.semi_bold, + ), + ), + ], + ), + textDirection: TextDirection.ltr, + ), + ], + ), + )), + Image.asset( + "assets/image/vip_shop_hx.webp", + fit: BoxFit.fill, //填充剩余空间 + height: 85, + width: 85, + ), + ], ), - ], - ), - ) - ], - ), - ), - Container( - height: 124.h, - margin: EdgeInsets.only(bottom: 16.h), - child: Stack( - children: [ - Image.asset( - "assets/image/vip_shop_bj.webp", - fit: BoxFit.fill, //填充剩余空间 - height: double.infinity, - width: double.infinity, + ) + ], ), - Container( - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Expanded( - child: Padding( - padding: EdgeInsets.only(top: 25.h, left: 19.w), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - "前进麦味烘焙券", - style: TextStyle( - color: Color(0xff32A060), - fontSize: 15.sp, - fontWeight: MyFontWeight.semi_bold, - ), - ), - SizedBox( - height: 5.h, - ), - Text.rich( - TextSpan( - children: [ - TextSpan( - text: "7", - style: TextStyle( - fontWeight: MyFontWeight.extra_bold, - fontSize: 36.sp, - fontFamily: 'JDZhengHT', - color: Color(0xffFF7E12), + ), + Container( + height: 124.h, + margin: EdgeInsets.only(bottom: 16.h), + child: Stack( + children: [ + Image.asset( + "assets/image/vip_shop_bj.webp", + fit: BoxFit.fill, //填充剩余空间 + height: double.infinity, + width: double.infinity, + ), + Container( + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Expanded( + child: Padding( + padding: EdgeInsets.only(top: 25.h, left: 19.w), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "前进麦味烘焙券", + style: TextStyle( + color: Color(0xff32A060), + fontSize: 15.sp, + fontWeight: MyFontWeight.semi_bold, + ), ), - ), - TextSpan( - text: " 折", - style: TextStyle( - fontSize: 24.sp, - color: Color(0xffFF7E12), - fontWeight: MyFontWeight.semi_bold, + SizedBox( + height: 5.h, ), - ), - ], - ), - textDirection: TextDirection.ltr, - ), - ], - ), - )), - Image.asset( - "assets/image/vip_shop_qj.webp", - fit: BoxFit.fill, //填充剩余空间 - height: 85, - width: 85, + Text.rich( + TextSpan( + children: [ + TextSpan( + text: "7", + style: TextStyle( + fontWeight: MyFontWeight.extra_bold, + fontSize: 36.sp, + fontFamily: 'JDZhengHT', + color: Color(0xffFF7E12), + ), + ), + TextSpan( + text: " 折", + style: TextStyle( + fontSize: 24.sp, + color: Color(0xffFF7E12), + fontWeight: MyFontWeight.semi_bold, + ), + ), + ], + ), + textDirection: TextDirection.ltr, + ), + ], + ), + )), + Image.asset( + "assets/image/vip_shop_qj.webp", + fit: BoxFit.fill, //填充剩余空间 + height: 85, + width: 85, + ), + ], ), - ], - ), - ) - ], - ), - ), - Container( - height: 124.h, - margin: EdgeInsets.only(bottom: 22.h), - child: Stack( - children: [ - Image.asset( - "assets/image/vip_shop_bj.webp", - fit: BoxFit.fill, //填充剩余空间 - height: double.infinity, - width: double.infinity, + ) + ], ), - Container( - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Expanded( - child: Padding( - padding: EdgeInsets.only(top: 25.h, left: 19.w), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - "门店火锅券", - style: TextStyle( - color: Color(0xff32A060), - fontSize: 15.sp, - fontWeight: MyFontWeight.semi_bold, - ), - ), - SizedBox( - height: 5.h, - ), - Text.rich( - TextSpan( - children: [ - TextSpan( - text: "8", - style: TextStyle( - fontWeight: MyFontWeight.extra_bold, - fontSize: 36.sp, - fontFamily: 'JDZhengHT', - color: Color(0xffFF7E12), + ), + Container( + height: 124.h, + margin: EdgeInsets.only(bottom: 22.h), + child: Stack( + children: [ + Image.asset( + "assets/image/vip_shop_bj.webp", + fit: BoxFit.fill, //填充剩余空间 + height: double.infinity, + width: double.infinity, + ), + Container( + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Expanded( + child: Padding( + padding: EdgeInsets.only(top: 25.h, left: 19.w), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "门店火锅券", + style: TextStyle( + color: Color(0xff32A060), + fontSize: 15.sp, + fontWeight: MyFontWeight.semi_bold, + ), ), - ), - TextSpan( - text: " 折", - style: TextStyle( - fontSize: 24.sp, - color: Color(0xffFF7E12), - fontWeight: MyFontWeight.semi_bold, + SizedBox( + height: 5.h, ), - ), - ], - ), - textDirection: TextDirection.ltr, - ), - ], - ), - )), - Image.asset( - "assets/image/vip_shop_hg.webp", - fit: BoxFit.fill, //填充剩余空间 - height: 85, - width: 85, + Text.rich( + TextSpan( + children: [ + TextSpan( + text: "8", + style: TextStyle( + fontWeight: MyFontWeight.extra_bold, + fontSize: 36.sp, + fontFamily: 'JDZhengHT', + color: Color(0xffFF7E12), + ), + ), + TextSpan( + text: " 折", + style: TextStyle( + fontSize: 24.sp, + color: Color(0xffFF7E12), + fontWeight: MyFontWeight.semi_bold, + ), + ), + ], + ), + textDirection: TextDirection.ltr, + ), + ], + ), + )), + Image.asset( + "assets/image/vip_shop_hg.webp", + fit: BoxFit.fill, //填充剩余空间 + height: 85, + width: 85, + ), + ], ), - ], - ), - ) - ], - ), + ) + ], + ), + ), + ], ), - ], - ), + ) + ], ); } diff --git a/lib/vip/vip_view/vip_top.dart b/lib/vip/vip_view/vip_top.dart index 7ec08ba6..5fa77df1 100644 --- a/lib/vip/vip_view/vip_top.dart +++ b/lib/vip/vip_view/vip_top.dart @@ -20,9 +20,9 @@ import 'package:tobias/tobias.dart' as tobias; class VipTop extends StatefulWidget { final VipCardHome vipCardHome; - final Function queryVipHome; + // final Function queryVipHome; - VipTop(this.vipCardHome, this.queryVipHome); + VipTop(this.vipCardHome); @override State createState() { @@ -39,16 +39,16 @@ class _VipTop extends State { @override void initState() { super.initState(); - payListen = weChatResponseEventHandler.listen((event) async { - print("payCallback: ${event.errCode}"); - if (event.errCode == 0) { - widget.queryVipHome(); - SmartDialog.showToast("支付成功", alignment: Alignment.center); - } else { - SmartDialog.showToast("支付失败", alignment: Alignment.center); - return; - } - }); + // payListen = weChatResponseEventHandler.listen((event) async { + // print("payCallback: ${event.errCode}"); + // if (event.errCode == 0) { + // widget.queryVipHome(); + // SmartDialog.showToast("支付成功", alignment: Alignment.center); + // } else { + // SmartDialog.showToast("支付失败", alignment: Alignment.center); + // return; + // } + // }); } rechargeVIP() async { @@ -96,7 +96,7 @@ class _VipTop extends State { tobias.aliPay(baseData.data["body"]).then((payRes) { if (payRes['resultStatus'] == 9000 || payRes['resultStatus'] == '9000') { - widget.queryVipHome(); + // widget.queryVipHome(); SmartDialog.showToast("支付成功", alignment: Alignment.center); } else { @@ -129,131 +129,132 @@ class _VipTop extends State { child: Column( children: [ vipCard(), - if(widget?.vipCardHome?.cards?.length != 0) - SizedBox( - height: 15.h, - ), - (!(widget?.vipCardHome?.member?.isVip ?? false)) - ? (widget?.vipCardHome?.cards?.length == 0 ? Container():vipCardList()) - : Padding( - padding: EdgeInsets.symmetric(horizontal: 16.w), - child: Row( - children: [ - Expanded( - child: Container( - alignment: Alignment.center, - padding: EdgeInsets.symmetric( - horizontal: 10.w, vertical: 15.h), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(4.w), - color: Color(0xffffffff), - boxShadow: [ - BoxShadow( - color: Colors.black.withAlpha(12), - offset: Offset(0, 3), - blurRadius: 14, - spreadRadius: 0, - ) - ], - ), - child: Text.rich( - TextSpan( - children: [ - TextSpan( - text: S - .of(context) - .yixianghuiyuanquanyi, - style: TextStyle( - fontWeight: MyFontWeight.semi_bold, - fontSize: 15.sp, - color: Color(0xff32A060), - ), - ), - TextSpan( - text: widget?.vipCardHome?.member - ?.vipDuration - .toString() ?? - "0", - style: TextStyle( - fontWeight: MyFontWeight.semi_bold, - fontSize: 18.sp, - color: Color(0xffF96519), - ), - ), - TextSpan( - text: " 天", - style: TextStyle( - fontWeight: MyFontWeight.semi_bold, - fontSize: 15.sp, - color: Color(0xff32A060), - ), - ), - ], - ), - textDirection: TextDirection.ltr, - ))), - SizedBox( - width: 10.w, - ), - Expanded( - child: GestureDetector( - onTap: () { - setState(() { - vipRenewShowBottomSheet(); - }); - }, - child: Container( - alignment: Alignment.center, - padding: EdgeInsets.symmetric( - horizontal: 10.w, vertical: 15.h), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(4.w), - color: Color(0xffffffff), - boxShadow: [ - BoxShadow( - color: Colors.black.withAlpha(12), - offset: Offset(0, 3), - blurRadius: 14, - spreadRadius: 0, - ) - ], - ), - child: Row( - mainAxisAlignment: - MainAxisAlignment.center, - crossAxisAlignment: - CrossAxisAlignment.center, - children: [ - Text( - "${(widget?.vipCardHome?.member?.isVipSubscribe ?? false) ? "已开通自动续费" : "续费回乡VIP"}", - style: TextStyle( - color: Color((widget - ?.vipCardHome - ?.member - ?.isVipSubscribe ?? - false) - ? 0xff3A3936 - : 0xff32A060), - fontSize: 15.sp, - fontWeight: MyFontWeight.semi_bold, - ), - ), - SizedBox( - width: 6.w, - ), - Image.asset( - "${(widget?.vipCardHome?.member?.isVipSubscribe ?? false) ? "assets/image/vip_xf.webp" : "assets/image/icon_right.webp"}", - width: 16, - height: 16, - fit: BoxFit.fill, - color: Color(0xff32A060), - ), - ], - ))), - ) - ], - ), - ), + // if(widget?.vipCardHome?.cards?.length != 0) + // SizedBox( + // height: 15.h, + // ), + // (!(widget?.vipCardHome?.member?.isVip ?? false)) + // ? (widget?.vipCardHome?.cards?.length == 0 ? Container():vipCardList()) + // : Padding( + // padding: EdgeInsets.symmetric(horizontal: 16.w), + // child: Row( + // children: [ + // Expanded( + // child: Container( + // alignment: Alignment.center, + // padding: EdgeInsets.symmetric( + // horizontal: 10.w, vertical: 15.h), + // decoration: BoxDecoration( + // borderRadius: BorderRadius.circular(4.w), + // color: Color(0xffffffff), + // boxShadow: [ + // BoxShadow( + // color: Colors.black.withAlpha(12), + // offset: Offset(0, 3), + // blurRadius: 14, + // spreadRadius: 0, + // ) + // ], + // ), + // child: Text.rich( + // TextSpan( + // children: [ + // TextSpan( + // text: S + // .of(context) + // .yixianghuiyuanquanyi, + // style: TextStyle( + // fontWeight: MyFontWeight.semi_bold, + // fontSize: 15.sp, + // color: Color(0xff32A060), + // ), + // ), + // TextSpan( + // text: widget?.vipCardHome?.member + // ?.vipDuration + // .toString() ?? + // "0", + // style: TextStyle( + // fontWeight: MyFontWeight.semi_bold, + // fontSize: 18.sp, + // color: Color(0xffF96519), + // ), + // ), + // TextSpan( + // text: " 天", + // style: TextStyle( + // fontWeight: MyFontWeight.semi_bold, + // fontSize: 15.sp, + // color: Color(0xff32A060), + // ), + // ), + // ], + // ), + // textDirection: TextDirection.ltr, + // ))), + // SizedBox( + // width: 10.w, + // ), + // Expanded( + // child: GestureDetector( + // onTap: () { + // setState(() { + // vipRenewShowBottomSheet(); + // }); + // }, + // child: Container( + // alignment: Alignment.center, + // padding: EdgeInsets.symmetric( + // horizontal: 10.w, vertical: 15.h), + // decoration: BoxDecoration( + // borderRadius: BorderRadius.circular(4.w), + // color: Color(0xffffffff), + // boxShadow: [ + // BoxShadow( + // color: Colors.black.withAlpha(12), + // offset: Offset(0, 3), + // blurRadius: 14, + // spreadRadius: 0, + // ) + // ], + // ), + // child: Row( + // mainAxisAlignment: + // MainAxisAlignment.center, + // crossAxisAlignment: + // CrossAxisAlignment.center, + // children: [ + // Text( + // "${(widget?.vipCardHome?.member?.isVipSubscribe ?? false) ? "已开通自动续费" : "续费回乡VIP"}", + // style: TextStyle( + // color: Color((widget + // ?.vipCardHome + // ?.member + // ?.isVipSubscribe ?? + // false) + // ? 0xff3A3936 + // : 0xff32A060), + // fontSize: 15.sp, + // fontWeight: MyFontWeight.semi_bold, + // ), + // ), + // SizedBox( + // width: 6.w, + // ), + // Image.asset( + // "${(widget?.vipCardHome?.member?.isVipSubscribe ?? false) ? "assets/image/vip_xf.webp" : "assets/image/icon_right.webp"}", + // width: 16, + // height: 16, + // fit: BoxFit.fill, + // color: Color(0xff32A060), + // ), + // ], + // ))), + // ) + // ], + // ), + // ), + rechargeGuide(), ], ), ) @@ -261,6 +262,136 @@ class _VipTop extends State { ); } + ///充值引导 + Widget rechargeGuide() { + return Container( + margin: EdgeInsets.only(left: 14.w, right: 14.w, bottom:21.h,top:16.h), + width: double.infinity, + padding: EdgeInsets.only(top:14.h, left:12.h, bottom:8.h, right:14.w), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(6.w), + color: Colors.white, + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ) + ], + ), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded(child: + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text.rich( + TextSpan( + children: [ + TextSpan( + text: "充值", + style: TextStyle( + fontWeight: MyFontWeight.extra_bold, + fontSize: 18.sp, + fontFamily: 'JDZhengHT', + color: Color(0xFF262626), + ), + ), + TextSpan( + text: "¥200以上", + style: TextStyle( + fontSize: 18.sp, + color: Color(0xffFF7E12), + fontWeight: MyFontWeight.semi_bold, + ), + ), + TextSpan( + text: "即开通回乡VIP卡", + style: TextStyle( + fontSize: 18.sp, + color: Color(0xFF262626), + fontWeight: MyFontWeight.semi_bold, + ), + ), + ], + ), + textDirection: TextDirection.ltr, + ), + Padding( + padding: EdgeInsets.only(top: 6.h, bottom: 10.h), + child: Text( + "享受多门店商品9.2折优惠价!", + style: TextStyle( + color: Color(0xFF32A060), + fontSize: 15.sp, + fontWeight: MyFontWeight.semi_bold, + ), + )), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + "*活动一切解释权归海峡姐妹品牌公司所有", + style: TextStyle( + color: Color(0xFF151515), + fontSize: 8.sp, + fontWeight: MyFontWeight.semi_bold, + ), + ), + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: (){ + Navigator.of(context).pushNamed('/router/recharge_page'); + }, + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(100)), + border: Border.all( + width: 1.w, + color: Color(0xFF32A060), + style: BorderStyle.solid, + ), + color: Color(0xFFFFFFFF), + ), + padding: EdgeInsets.symmetric(vertical: 4.h,horizontal: 12.w), + child: Row(children: [ + Text( + "去储值", + style: TextStyle( + color: Color(0xFF32A060), + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + ), + ), + Image.asset( + "assets/image/icon_right.webp", + width:13, + fit: BoxFit.fill, + height:13, + color: Color(0xFF32A060), + ) + ]), + ), + ) + ], + ) + ], + )), + SizedBox(width: 11.h,), + Padding(padding:EdgeInsets.only(top:4.h), + child: Image.asset( + "assets/image/vip_cz.webp", + fit: BoxFit.fill, //填充剩余空间 + height:50.w, + width: 54.h, + ),) + ], + ), + ); + } + ///vip卡 Widget vipCard() { return Container( diff --git a/lib/web/web_view/comment_list.dart b/lib/web/web_view/comment_list.dart index f77fd774..6a5481a6 100644 --- a/lib/web/web_view/comment_list.dart +++ b/lib/web/web_view/comment_list.dart @@ -128,7 +128,7 @@ class CommentListState extends State { ); }, ), - if (memberList != null && memberList.length > 0) + if (memberList != null && memberList.length >= 1) Container( decoration: BoxDecoration( color: Color(0xFFF2F2F2), diff --git a/lib/web/web_view/input_comment.dart b/lib/web/web_view/input_comment.dart index 7f919d07..09a616ba 100644 --- a/lib/web/web_view/input_comment.dart +++ b/lib/web/web_view/input_comment.dart @@ -126,6 +126,7 @@ class _InputComment extends State { ), if (widget.isKeyBoardShow) GestureDetector( + behavior: HitTestBehavior.opaque, onTap: () { var commentText = widget.commentTextController.text; if (commentText.trim() == "") { @@ -134,7 +135,7 @@ class _InputComment extends State { widget.queryMemberComment(commentText); }, child: Container( - padding: EdgeInsets.symmetric(horizontal: 20.w), + padding: EdgeInsets.symmetric(horizontal: 20.w,vertical:15.h), child: Text( S.of(context).fasong, style: TextStyle( diff --git a/lib/web/web_view/web_header.dart b/lib/web/web_view/web_header.dart index ae67f404..d4356941 100644 --- a/lib/web/web_view/web_header.dart +++ b/lib/web/web_view/web_header.dart @@ -47,8 +47,8 @@ class _WebHeader extends State { InkWell( child: Text( "${widget.activity != null ? (widget.activity.storeName ?? "") - : (widget.article != null && widget.article.author != null) - ? (widget.article.author.name ?? "") : ""}", + : ((widget.article != null && widget.article.author != null) + ? (widget.article.author.name ?? "") : "")}", style: TextStyle( fontWeight: FontWeight.normal, fontSize: widget.fontSize - 2, @@ -85,6 +85,7 @@ class _WebHeader extends State { } }, ), + if((widget?.activity?.storeName ?? "") != "" || (widget?.article?.author?.name ?? "") != "") SizedBox( width: 10.w, ), diff --git a/pubspec.yaml b/pubspec.yaml index f42e0a03..52eb1c90 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -3,7 +3,7 @@ description: 一心回乡. publish_to: 'none' # Remove this line if you wish to publish to pub.dev -version: 3.2.13+57 +version: 3.2.14+58 environment: sdk: ">=2.7.0 <3.0.0"