diff --git a/android/tmpmob/ShareSDK/assets/ShareSDK.xml b/android/tmpmob/ShareSDK/assets/ShareSDK.xml index e0ea956f..5eb238e7 100644 --- a/android/tmpmob/ShareSDK/assets/ShareSDK.xml +++ b/android/tmpmob/ShareSDK/assets/ShareSDK.xml @@ -55,4 +55,5 @@ + \ No newline at end of file diff --git a/assets/fonts/APPHT.ttf b/assets/fonts/APPHT.ttf new file mode 100644 index 00000000..61d491d8 Binary files /dev/null and b/assets/fonts/APPHT.ttf differ diff --git a/assets/image/2x/farmers_bg.webp b/assets/image/2x/farmers_bg.webp new file mode 100644 index 00000000..2e613c9e Binary files /dev/null and b/assets/image/2x/farmers_bg.webp differ diff --git a/assets/image/2x/farmers_cg.webp b/assets/image/2x/farmers_cg.webp new file mode 100644 index 00000000..30634780 Binary files /dev/null and b/assets/image/2x/farmers_cg.webp differ diff --git a/assets/image/2x/farmers_cy.webp b/assets/image/2x/farmers_cy.webp new file mode 100644 index 00000000..901aeb5d Binary files /dev/null and b/assets/image/2x/farmers_cy.webp differ diff --git a/assets/image/2x/farmers_tj.webp b/assets/image/2x/farmers_tj.webp new file mode 100644 index 00000000..d3cf75db Binary files /dev/null and b/assets/image/2x/farmers_tj.webp differ diff --git a/assets/image/2x/farmers_zp.webp b/assets/image/2x/farmers_zp.webp new file mode 100644 index 00000000..16484956 Binary files /dev/null and b/assets/image/2x/farmers_zp.webp differ diff --git a/assets/image/2x/help_farmers_logo.webp b/assets/image/2x/help_farmers_logo.webp new file mode 100644 index 00000000..a708b712 Binary files /dev/null and b/assets/image/2x/help_farmers_logo.webp differ diff --git a/assets/image/2x/return_left.webp b/assets/image/2x/return_left.webp new file mode 100644 index 00000000..e530d7c2 Binary files /dev/null and b/assets/image/2x/return_left.webp differ diff --git a/assets/image/2x/tips_white.webp b/assets/image/2x/tips_white.webp new file mode 100644 index 00000000..d5bc544f Binary files /dev/null and b/assets/image/2x/tips_white.webp differ diff --git a/assets/image/2x/wallet_logo.webp b/assets/image/2x/wallet_logo.webp new file mode 100644 index 00000000..75842e19 Binary files /dev/null and b/assets/image/2x/wallet_logo.webp differ diff --git a/assets/image/2x/zhu_n.webp b/assets/image/2x/zhu_n.webp new file mode 100644 index 00000000..dde9e802 Binary files /dev/null and b/assets/image/2x/zhu_n.webp differ diff --git a/assets/image/3x/farmers_bg.webp b/assets/image/3x/farmers_bg.webp new file mode 100644 index 00000000..36b923b8 Binary files /dev/null and b/assets/image/3x/farmers_bg.webp differ diff --git a/assets/image/3x/farmers_cg.webp b/assets/image/3x/farmers_cg.webp new file mode 100644 index 00000000..9debe0ec Binary files /dev/null and b/assets/image/3x/farmers_cg.webp differ diff --git a/assets/image/3x/farmers_cy.webp b/assets/image/3x/farmers_cy.webp new file mode 100644 index 00000000..ff41f711 Binary files /dev/null and b/assets/image/3x/farmers_cy.webp differ diff --git a/assets/image/3x/farmers_tj.webp b/assets/image/3x/farmers_tj.webp new file mode 100644 index 00000000..fa155d45 Binary files /dev/null and b/assets/image/3x/farmers_tj.webp differ diff --git a/assets/image/3x/farmers_zp.webp b/assets/image/3x/farmers_zp.webp new file mode 100644 index 00000000..056de93c Binary files /dev/null and b/assets/image/3x/farmers_zp.webp differ diff --git a/assets/image/3x/help_farmers_logo.webp b/assets/image/3x/help_farmers_logo.webp new file mode 100644 index 00000000..e187adb4 Binary files /dev/null and b/assets/image/3x/help_farmers_logo.webp differ diff --git a/assets/image/3x/return_left.webp b/assets/image/3x/return_left.webp new file mode 100644 index 00000000..6ed57ed6 Binary files /dev/null and b/assets/image/3x/return_left.webp differ diff --git a/assets/image/3x/tips_white.webp b/assets/image/3x/tips_white.webp new file mode 100644 index 00000000..49ea35fa Binary files /dev/null and b/assets/image/3x/tips_white.webp differ diff --git a/assets/image/3x/wallet_logo.webp b/assets/image/3x/wallet_logo.webp new file mode 100644 index 00000000..7e165aec Binary files /dev/null and b/assets/image/3x/wallet_logo.webp differ diff --git a/assets/image/3x/zhu_n.webp b/assets/image/3x/zhu_n.webp new file mode 100644 index 00000000..8fab8a96 Binary files /dev/null and b/assets/image/3x/zhu_n.webp differ diff --git a/assets/image/farmers_bg.webp b/assets/image/farmers_bg.webp new file mode 100644 index 00000000..f18ebdf6 Binary files /dev/null and b/assets/image/farmers_bg.webp differ diff --git a/assets/image/farmers_cg.webp b/assets/image/farmers_cg.webp new file mode 100644 index 00000000..34e38ad4 Binary files /dev/null and b/assets/image/farmers_cg.webp differ diff --git a/assets/image/farmers_cy.webp b/assets/image/farmers_cy.webp new file mode 100644 index 00000000..51b17789 Binary files /dev/null and b/assets/image/farmers_cy.webp differ diff --git a/assets/image/farmers_tj.webp b/assets/image/farmers_tj.webp new file mode 100644 index 00000000..68f02c14 Binary files /dev/null and b/assets/image/farmers_tj.webp differ diff --git a/assets/image/farmers_zp.webp b/assets/image/farmers_zp.webp new file mode 100644 index 00000000..42f34b52 Binary files /dev/null and b/assets/image/farmers_zp.webp differ diff --git a/assets/image/help_farmers_logo.webp b/assets/image/help_farmers_logo.webp new file mode 100644 index 00000000..1d907d8c Binary files /dev/null and b/assets/image/help_farmers_logo.webp differ diff --git a/assets/image/integral_return.webp b/assets/image/integral_return.webp deleted file mode 100644 index 15aa52d2..00000000 Binary files a/assets/image/integral_return.webp and /dev/null differ diff --git a/assets/image/return_left.webp b/assets/image/return_left.webp new file mode 100644 index 00000000..c8d65876 Binary files /dev/null and b/assets/image/return_left.webp differ diff --git a/assets/image/tips_white.webp b/assets/image/tips_white.webp new file mode 100644 index 00000000..ba95c1b5 Binary files /dev/null and b/assets/image/tips_white.webp differ diff --git a/assets/image/wallet_logo.webp b/assets/image/wallet_logo.webp new file mode 100644 index 00000000..1da70482 Binary files /dev/null and b/assets/image/wallet_logo.webp differ diff --git a/assets/image/zhu_n.webp b/assets/image/zhu_n.webp new file mode 100644 index 00000000..40808599 Binary files /dev/null and b/assets/image/zhu_n.webp differ diff --git a/lib/community/community_view/class_details.dart b/lib/community/community_view/class_details.dart index 47ef0969..3d5191a8 100644 --- a/lib/community/community_view/class_details.dart +++ b/lib/community/community_view/class_details.dart @@ -1,3 +1,5 @@ +import 'dart:convert'; + import 'package:dio/dio.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -16,6 +18,11 @@ import 'package:huixiang/web/web_view/comment_list.dart'; import 'package:huixiang/web/web_view/input_comment.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:sharesdk_plugin/sharesdk_defines.dart'; +import 'package:sharesdk_plugin/sharesdk_interface.dart'; +import 'package:sharesdk_plugin/sharesdk_map.dart'; + +import '../../view_widget/share_dialog.dart'; class ClassDetails extends StatefulWidget { final Map arguments; @@ -246,7 +253,18 @@ class _ClassDetails extends State with WidgetsBindingObserver { ), ), flex: 1, - ) + ), + GestureDetector( + onTap: () { + // share(); + }, + child: Icon( + Icons.share, + size: 24, + color: Colors.black, + ), + ), + SizedBox(width: 15.w,), ], ), SizedBox( @@ -316,27 +334,15 @@ class _ClassDetails extends State with WidgetsBindingObserver { isShowMore = !isShowMore; }); }, - child: Row( - mainAxisAlignment: MainAxisAlignment.end, - crossAxisAlignment: CrossAxisAlignment.center, - mainAxisSize: MainAxisSize.max, - children: [ - Text( - S.of(context).gengduo, - style: TextStyle( - fontSize: 12.sp, - fontWeight: MyFontWeight.regular, - color: Colors.black, - ), - ), - Icon( - (isShowMore != null && !isShowMore) - ? Icons.chevron_right - : Icons.keyboard_arrow_up, - color: Colors.black, - size: 18, - ), - ], + child:Align( + alignment: Alignment.center, + child: Icon( + (isShowMore != null && !isShowMore) + ? Icons.keyboard_arrow_down + : Icons.keyboard_arrow_up, + color: Colors.black, + size: 24, + ), ), ), SizedBox(height: 3.h), @@ -553,4 +559,48 @@ class _ClassDetails extends State with WidgetsBindingObserver { delComment(memberComment); })); } + + share() async { + SSDKMap params = SSDKMap() + ..setGeneral( + course.subject != null + ? course.subject + : "", + course != null ? course.introduce : "", + [ + chapterList[chapterIndex].content.coverImg != null + ? chapterList[chapterIndex].content.coverImg:"", + ], + chapterList[chapterIndex].content.fileUrl != null + ? chapterList[chapterIndex].content.fileUrl:"", + "", + buildShareUrl(), + "", + "", + "", + "", + SSDKContentTypes.webpage, + ); + + showModalBottomSheet( + context: context, + backgroundColor: Colors.transparent, + builder: (context) { + return ShareDialog((platform) { + if (platform == ShareSDKPlatforms.line) { + params.map["type"] = SSDKContentTypes.text.value; + params.map["text"] = + "${course.subject ?? ""} ${buildShareUrl()}"; + } + SharesdkPlugin.share(platform, params, + (state, userData, contentEntity, error) { + print("share!$state"); + }); + }); + }); + } + + String buildShareUrl() { + return "https://hx.lotus-wallet.com/index.html?id=${widget.arguments["id"]}&type=${"article"}"; + } } diff --git a/lib/generated/intl/messages_en.dart b/lib/generated/intl/messages_en.dart index 119270bc..1486d54c 100644 --- a/lib/generated/intl/messages_en.dart +++ b/lib/generated/intl/messages_en.dart @@ -132,6 +132,7 @@ class MessageLookup extends MessageLookupByLibrary { "bojin" : MessageLookupByLibrary.simpleMessage("铂金"), "brand_yixinhuixiang" : MessageLookupByLibrary.simpleMessage("一心回乡"), "buzhichikaipiao" : MessageLookupByLibrary.simpleMessage("不支持开票"), + "canyingfuwu" : MessageLookupByLibrary.simpleMessage("餐饮服务"), "chakan" : MessageLookupByLibrary.simpleMessage("查看"), "chakangengduo" : MessageLookupByLibrary.simpleMessage("查看更多"), "chakanhexiaoma" : MessageLookupByLibrary.simpleMessage("查看核销码"), @@ -308,6 +309,7 @@ class MessageLookup extends MessageLookupByLibrary { "huode" : MessageLookupByLibrary.simpleMessage("获得"), "huodequanyi" : MessageLookupByLibrary.simpleMessage("获得权益"), "huodong" : MessageLookupByLibrary.simpleMessage("活动"), + "huodongguize" : MessageLookupByLibrary.simpleMessage("活动规则"), "huodongjianmianpeisongfei" : m10, "huodongjinxingzhong" : MessageLookupByLibrary.simpleMessage("活动进行中"), "huodongliebiao" : MessageLookupByLibrary.simpleMessage("活动列表"), @@ -346,6 +348,7 @@ class MessageLookup extends MessageLookupByLibrary { "jinkahuiyuan" : MessageLookupByLibrary.simpleMessage("金卡会员"), "jinrihuiyuanrenwu" : MessageLookupByLibrary.simpleMessage("今日会员任务"), "jinrushangdian" : MessageLookupByLibrary.simpleMessage("进入商店"), + "jinruzhuanqu" : MessageLookupByLibrary.simpleMessage("进入专区"), "jinxingbangdingfuka" : MessageLookupByLibrary.simpleMessage("进行绑定副卡"), "jinxingfukabangding" : MessageLookupByLibrary.simpleMessage("进行副卡绑定"), "jinxingzhanghaozhuxiao" : MessageLookupByLibrary.simpleMessage("进行账号注销"), @@ -374,6 +377,7 @@ class MessageLookup extends MessageLookupByLibrary { "kongtiao" : MessageLookupByLibrary.simpleMessage("空调"), "kuaidi" : MessageLookupByLibrary.simpleMessage("快递"), "kuaidiwuliu" : MessageLookupByLibrary.simpleMessage("快递物流"), + "kuailezhunong" : MessageLookupByLibrary.simpleMessage("快乐助农"), "lianxikefu" : MessageLookupByLibrary.simpleMessage("联系客服"), "lianxishoujihao" : MessageLookupByLibrary.simpleMessage("联系手机号"), "lianxuqiandaolingqushuangbeijifen" : MessageLookupByLibrary.simpleMessage("连续签到领取双倍积分"), @@ -381,6 +385,7 @@ class MessageLookup extends MessageLookupByLibrary { "liaojiejiankang" : MessageLookupByLibrary.simpleMessage("了解健康"), "lijicanjia" : MessageLookupByLibrary.simpleMessage("立即参加"), "lijichongzhi" : MessageLookupByLibrary.simpleMessage("立即充值"), + "lijigengxin" : MessageLookupByLibrary.simpleMessage("立即更新"), "lijikaitong" : MessageLookupByLibrary.simpleMessage("立即开通"), "lijilingqu" : MessageLookupByLibrary.simpleMessage("立即领取"), "lijiqiandao" : MessageLookupByLibrary.simpleMessage("立即签到"), @@ -480,6 +485,7 @@ class MessageLookup extends MessageLookupByLibrary { "qishoupeisongzhongyujisongdashijian" : MessageLookupByLibrary.simpleMessage("骑手配送中,预计送达时间"), "qishouyijiedanquhuozhong" : MessageLookupByLibrary.simpleMessage("骑手已接单、取货中"), "qita" : MessageLookupByLibrary.simpleMessage("其他"), + "qiyetuanjian" : MessageLookupByLibrary.simpleMessage("企业团建"), "quanbao" : MessageLookupByLibrary.simpleMessage("券包"), "quanbu" : MessageLookupByLibrary.simpleMessage("全部"), "quanbudingdan" : MessageLookupByLibrary.simpleMessage("全部订单"), @@ -539,10 +545,12 @@ class MessageLookup extends MessageLookupByLibrary { "shangjiayifahuo" : MessageLookupByLibrary.simpleMessage("商家已发货"), "shangjiazhengzaipeican" : MessageLookupByLibrary.simpleMessage("商家正在配餐"), "shanglajiazai" : MessageLookupByLibrary.simpleMessage("上拉加载"), + "shangpincaigou" : MessageLookupByLibrary.simpleMessage("商品采购"), "shangpinjifen" : m29, "shangpinxiangqing" : MessageLookupByLibrary.simpleMessage("商品详情"), "shangyidengji" : MessageLookupByLibrary.simpleMessage("上一等级"), "shenghuoyule" : MessageLookupByLibrary.simpleMessage("生活娱乐"), + "shengxianzhaipei" : MessageLookupByLibrary.simpleMessage("生鲜宅配"), "shenmijifendali" : MessageLookupByLibrary.simpleMessage("神秘积分大礼"), "shenqingtuikuan" : MessageLookupByLibrary.simpleMessage("申请退款"), "shezhi" : MessageLookupByLibrary.simpleMessage("设置"), @@ -632,6 +640,7 @@ class MessageLookup extends MessageLookupByLibrary { "wodeqianbao" : MessageLookupByLibrary.simpleMessage("我的钱包"), "wodeshengri" : MessageLookupByLibrary.simpleMessage("我的生日"), "wodexiaoxi" : MessageLookupByLibrary.simpleMessage("我的消息"), + "wodeyaoqing" : MessageLookupByLibrary.simpleMessage("我的邀请"), "wodeyaoqingma" : MessageLookupByLibrary.simpleMessage("我的邀请码"), "woyouyaoqingma" : MessageLookupByLibrary.simpleMessage("我有邀请码"), "wuliudanhao" : MessageLookupByLibrary.simpleMessage("物流单号:"), @@ -681,6 +690,7 @@ class MessageLookup extends MessageLookupByLibrary { "yiduihuanjian" : m36, "yifahuo" : MessageLookupByLibrary.simpleMessage("已发货"), "yiguanzhu" : MessageLookupByLibrary.simpleMessage("已关注"), + "yihouzaishuo" : MessageLookupByLibrary.simpleMessage("以后再说"), "yihuide" : MessageLookupByLibrary.simpleMessage("已获得"), "yihujiaoqishou" : MessageLookupByLibrary.simpleMessage("已呼叫骑手"), "yikaitongzidongxufei" : MessageLookupByLibrary.simpleMessage("已开通自动续费"), @@ -769,6 +779,9 @@ class MessageLookup extends MessageLookupByLibrary { "zhongwenjianti" : MessageLookupByLibrary.simpleMessage("简体中文"), "zhuanlan" : MessageLookupByLibrary.simpleMessage("专栏"), "zhuanxiangyouhuiquan" : MessageLookupByLibrary.simpleMessage("专享优惠券"), + "zhunong1" : MessageLookupByLibrary.simpleMessage("爱在回乡 快乐助农"), + "zhunongjifen" : MessageLookupByLibrary.simpleMessage("助农积分"), + "zhunongzhuanqu" : MessageLookupByLibrary.simpleMessage("助农专区"), "zhuxiaotixing" : MessageLookupByLibrary.simpleMessage("再次提醒:注销帐号后不可恢复,相关数据和信息会永久删除。"), "ziqu" : MessageLookupByLibrary.simpleMessage("自取"), "ziti" : MessageLookupByLibrary.simpleMessage("自提"), diff --git a/lib/generated/intl/messages_en_US.dart b/lib/generated/intl/messages_en_US.dart index 609cf071..0bddbe0b 100644 --- a/lib/generated/intl/messages_en_US.dart +++ b/lib/generated/intl/messages_en_US.dart @@ -132,6 +132,7 @@ class MessageLookup extends MessageLookupByLibrary { "bojin" : MessageLookupByLibrary.simpleMessage("platinum"), "brand_yixinhuixiang" : MessageLookupByLibrary.simpleMessage("going back home with one heart"), "buzhichikaipiao" : MessageLookupByLibrary.simpleMessage("Invoicing is not supported"), + "canyingfuwu" : MessageLookupByLibrary.simpleMessage("catering service"), "chakan" : MessageLookupByLibrary.simpleMessage("View"), "chakangengduo" : MessageLookupByLibrary.simpleMessage("See more"), "chakanhexiaoma" : MessageLookupByLibrary.simpleMessage("View Write off Code"), @@ -308,6 +309,7 @@ class MessageLookup extends MessageLookupByLibrary { "huode" : MessageLookupByLibrary.simpleMessage("get"), "huodequanyi" : MessageLookupByLibrary.simpleMessage("acquire interests"), "huodong" : MessageLookupByLibrary.simpleMessage("activity"), + "huodongguize" : MessageLookupByLibrary.simpleMessage("Activity Rules"), "huodongjianmianpeisongfei" : m10, "huodongjinxingzhong" : MessageLookupByLibrary.simpleMessage("Activity in Progress"), "huodongliebiao" : MessageLookupByLibrary.simpleMessage("Activity List"), @@ -346,6 +348,7 @@ class MessageLookup extends MessageLookupByLibrary { "jinkahuiyuan" : MessageLookupByLibrary.simpleMessage("Gold Card Member"), "jinrihuiyuanrenwu" : MessageLookupByLibrary.simpleMessage("Today\'s Member Task"), "jinrushangdian" : MessageLookupByLibrary.simpleMessage("Enter the store"), + "jinruzhuanqu" : MessageLookupByLibrary.simpleMessage("Enter the zone"), "jinxingbangdingfuka" : MessageLookupByLibrary.simpleMessage("Bind sub card"), "jinxingfukabangding" : MessageLookupByLibrary.simpleMessage("Associate card binding"), "jinxingzhanghaozhuxiao" : MessageLookupByLibrary.simpleMessage("Account cancellation"), @@ -374,6 +377,7 @@ class MessageLookup extends MessageLookupByLibrary { "kongtiao" : MessageLookupByLibrary.simpleMessage("Air conditioner"), "kuaidi" : MessageLookupByLibrary.simpleMessage("express"), "kuaidiwuliu" : MessageLookupByLibrary.simpleMessage("express logistics"), + "kuailezhunong" : MessageLookupByLibrary.simpleMessage("Helping farmers happily"), "lianxikefu" : MessageLookupByLibrary.simpleMessage("Service"), "lianxishoujihao" : MessageLookupByLibrary.simpleMessage("Contact phone number"), "lianxuqiandaolingqushuangbeijifen" : MessageLookupByLibrary.simpleMessage("Sign in continuously to receive double points"), @@ -381,6 +385,7 @@ class MessageLookup extends MessageLookupByLibrary { "liaojiejiankang" : MessageLookupByLibrary.simpleMessage("Understanding Health"), "lijicanjia" : MessageLookupByLibrary.simpleMessage("Join now"), "lijichongzhi" : MessageLookupByLibrary.simpleMessage("Recharge Now"), + "lijigengxin" : MessageLookupByLibrary.simpleMessage("Update Now"), "lijikaitong" : MessageLookupByLibrary.simpleMessage("Open now"), "lijilingqu" : MessageLookupByLibrary.simpleMessage("Get it now"), "lijiqiandao" : MessageLookupByLibrary.simpleMessage("Sign in immediately"), @@ -480,6 +485,7 @@ class MessageLookup extends MessageLookupByLibrary { "qishoupeisongzhongyujisongdashijian" : MessageLookupByLibrary.simpleMessage("The rider is in delivery, and the estimated delivery time"), "qishouyijiedanquhuozhong" : MessageLookupByLibrary.simpleMessage("The rider has received the order and is picking up goods"), "qita" : MessageLookupByLibrary.simpleMessage("Other"), + "qiyetuanjian" : MessageLookupByLibrary.simpleMessage("Enterprise League Building"), "quanbao" : MessageLookupByLibrary.simpleMessage("coupon package"), "quanbu" : MessageLookupByLibrary.simpleMessage("All"), "quanbudingdan" : MessageLookupByLibrary.simpleMessage("All Orders"), @@ -539,10 +545,12 @@ class MessageLookup extends MessageLookupByLibrary { "shangjiayifahuo" : MessageLookupByLibrary.simpleMessage("Merchant has delivered goods"), "shangjiazhengzaipeican" : MessageLookupByLibrary.simpleMessage("The merchant is preparing meals"), "shanglajiazai" : MessageLookupByLibrary.simpleMessage("pull-up loading"), + "shangpincaigou" : MessageLookupByLibrary.simpleMessage("Commodity buy"), "shangpinjifen" : m29, "shangpinxiangqing" : MessageLookupByLibrary.simpleMessage("Product Details"), "shangyidengji" : MessageLookupByLibrary.simpleMessage("Previous Level"), "shenghuoyule" : MessageLookupByLibrary.simpleMessage("life entertainment"), + "shengxianzhaipei" : MessageLookupByLibrary.simpleMessage("Fresh House"), "shenmijifendali" : MessageLookupByLibrary.simpleMessage("Mysterious integral gift"), "shenqingtuikuan" : MessageLookupByLibrary.simpleMessage("Apply for refund"), "shezhi" : MessageLookupByLibrary.simpleMessage("Settings"), @@ -632,6 +640,7 @@ class MessageLookup extends MessageLookupByLibrary { "wodeqianbao" : MessageLookupByLibrary.simpleMessage("My wallet"), "wodeshengri" : MessageLookupByLibrary.simpleMessage("My birthday"), "wodexiaoxi" : MessageLookupByLibrary.simpleMessage("My Message"), + "wodeyaoqing" : MessageLookupByLibrary.simpleMessage("My invitation"), "wodeyaoqingma" : MessageLookupByLibrary.simpleMessage("My invitation code"), "woyouyaoqingma" : MessageLookupByLibrary.simpleMessage("I have an invitation code"), "wuliudanhao" : MessageLookupByLibrary.simpleMessage("Logistics Doc No:"), @@ -681,6 +690,7 @@ class MessageLookup extends MessageLookupByLibrary { "yiduihuanjian" : m36, "yifahuo" : MessageLookupByLibrary.simpleMessage("Shipped"), "yiguanzhu" : MessageLookupByLibrary.simpleMessage("Followed"), + "yihouzaishuo" : MessageLookupByLibrary.simpleMessage("Talk Later"), "yihuide" : MessageLookupByLibrary.simpleMessage("acquired"), "yihujiaoqishou" : MessageLookupByLibrary.simpleMessage("Called rider"), "yikaitongzidongxufei" : MessageLookupByLibrary.simpleMessage("Automatic renewal has been activated"), @@ -769,6 +779,9 @@ class MessageLookup extends MessageLookupByLibrary { "zhongwenjianti" : MessageLookupByLibrary.simpleMessage("Simplified Chinese"), "zhuanlan" : MessageLookupByLibrary.simpleMessage("Column"), "zhuanxiangyouhuiquan" : MessageLookupByLibrary.simpleMessage("Exclusive coupon"), + "zhunong1" : MessageLookupByLibrary.simpleMessage("Love returns home and helps farmers happily"), + "zhunongjifen" : MessageLookupByLibrary.simpleMessage("Farming aid points"), + "zhunongzhuanqu" : MessageLookupByLibrary.simpleMessage("Special Area for Agricultural Aid"), "zhuxiaotixing" : MessageLookupByLibrary.simpleMessage("Reminder again: After the account is logged off, it cannot be recovered, and relevant data and information will be permanently deleted。"), "ziqu" : MessageLookupByLibrary.simpleMessage("self fetching"), "ziti" : MessageLookupByLibrary.simpleMessage("Self mention"), diff --git a/lib/generated/intl/messages_zh_CN.dart b/lib/generated/intl/messages_zh_CN.dart index ea23c98b..11f7b57c 100644 --- a/lib/generated/intl/messages_zh_CN.dart +++ b/lib/generated/intl/messages_zh_CN.dart @@ -132,6 +132,7 @@ class MessageLookup extends MessageLookupByLibrary { "bojin" : MessageLookupByLibrary.simpleMessage("铂金"), "brand_yixinhuixiang" : MessageLookupByLibrary.simpleMessage("一心回乡"), "buzhichikaipiao" : MessageLookupByLibrary.simpleMessage("不支持开票"), + "canyingfuwu" : MessageLookupByLibrary.simpleMessage("餐饮服务"), "chakan" : MessageLookupByLibrary.simpleMessage("查看"), "chakangengduo" : MessageLookupByLibrary.simpleMessage("查看更多"), "chakanhexiaoma" : MessageLookupByLibrary.simpleMessage("查看核销码"), @@ -308,6 +309,7 @@ class MessageLookup extends MessageLookupByLibrary { "huode" : MessageLookupByLibrary.simpleMessage("获得"), "huodequanyi" : MessageLookupByLibrary.simpleMessage("获得权益"), "huodong" : MessageLookupByLibrary.simpleMessage("活动"), + "huodongguize" : MessageLookupByLibrary.simpleMessage("活动规则"), "huodongjianmianpeisongfei" : m10, "huodongjinxingzhong" : MessageLookupByLibrary.simpleMessage("活动进行中"), "huodongliebiao" : MessageLookupByLibrary.simpleMessage("活动列表"), @@ -346,6 +348,7 @@ class MessageLookup extends MessageLookupByLibrary { "jinkahuiyuan" : MessageLookupByLibrary.simpleMessage("金卡会员"), "jinrihuiyuanrenwu" : MessageLookupByLibrary.simpleMessage("今日会员任务"), "jinrushangdian" : MessageLookupByLibrary.simpleMessage("进入商店"), + "jinruzhuanqu" : MessageLookupByLibrary.simpleMessage("进入专区"), "jinxingbangdingfuka" : MessageLookupByLibrary.simpleMessage("进行绑定副卡"), "jinxingfukabangding" : MessageLookupByLibrary.simpleMessage("进行副卡绑定"), "jinxingzhanghaozhuxiao" : MessageLookupByLibrary.simpleMessage("进行账号注销"), @@ -374,6 +377,7 @@ class MessageLookup extends MessageLookupByLibrary { "kongtiao" : MessageLookupByLibrary.simpleMessage("空调"), "kuaidi" : MessageLookupByLibrary.simpleMessage("快递"), "kuaidiwuliu" : MessageLookupByLibrary.simpleMessage("快递物流"), + "kuailezhunong" : MessageLookupByLibrary.simpleMessage("快乐助农"), "lianxikefu" : MessageLookupByLibrary.simpleMessage("联系客服"), "lianxishoujihao" : MessageLookupByLibrary.simpleMessage("联系手机号"), "lianxuqiandaolingqushuangbeijifen" : MessageLookupByLibrary.simpleMessage("连续签到领取双倍积分"), @@ -381,6 +385,7 @@ class MessageLookup extends MessageLookupByLibrary { "liaojiejiankang" : MessageLookupByLibrary.simpleMessage("了解健康"), "lijicanjia" : MessageLookupByLibrary.simpleMessage("立即参加"), "lijichongzhi" : MessageLookupByLibrary.simpleMessage("立即充值"), + "lijigengxin" : MessageLookupByLibrary.simpleMessage("立即更新"), "lijikaitong" : MessageLookupByLibrary.simpleMessage("立即开通"), "lijilingqu" : MessageLookupByLibrary.simpleMessage("立即领取"), "lijiqiandao" : MessageLookupByLibrary.simpleMessage("立即签到"), @@ -480,6 +485,7 @@ class MessageLookup extends MessageLookupByLibrary { "qishoupeisongzhongyujisongdashijian" : MessageLookupByLibrary.simpleMessage("骑手配送中,预计送达时间"), "qishouyijiedanquhuozhong" : MessageLookupByLibrary.simpleMessage("骑手已接单、取货中"), "qita" : MessageLookupByLibrary.simpleMessage("其他"), + "qiyetuanjian" : MessageLookupByLibrary.simpleMessage("企业团建"), "quanbao" : MessageLookupByLibrary.simpleMessage("券包"), "quanbu" : MessageLookupByLibrary.simpleMessage("全部"), "quanbudingdan" : MessageLookupByLibrary.simpleMessage("全部订单"), @@ -539,10 +545,12 @@ class MessageLookup extends MessageLookupByLibrary { "shangjiayifahuo" : MessageLookupByLibrary.simpleMessage("商家已发货"), "shangjiazhengzaipeican" : MessageLookupByLibrary.simpleMessage("商家正在配餐"), "shanglajiazai" : MessageLookupByLibrary.simpleMessage("上拉加载"), + "shangpincaigou" : MessageLookupByLibrary.simpleMessage("商品采购"), "shangpinjifen" : m29, "shangpinxiangqing" : MessageLookupByLibrary.simpleMessage("商品详情"), "shangyidengji" : MessageLookupByLibrary.simpleMessage("上一等级"), "shenghuoyule" : MessageLookupByLibrary.simpleMessage("生活娱乐"), + "shengxianzhaipei" : MessageLookupByLibrary.simpleMessage("生鲜宅配"), "shenmijifendali" : MessageLookupByLibrary.simpleMessage("神秘积分大礼"), "shenqingtuikuan" : MessageLookupByLibrary.simpleMessage("申请退款"), "shezhi" : MessageLookupByLibrary.simpleMessage("设置"), @@ -632,6 +640,7 @@ class MessageLookup extends MessageLookupByLibrary { "wodeqianbao" : MessageLookupByLibrary.simpleMessage("我的钱包"), "wodeshengri" : MessageLookupByLibrary.simpleMessage("我的生日"), "wodexiaoxi" : MessageLookupByLibrary.simpleMessage("我的消息"), + "wodeyaoqing" : MessageLookupByLibrary.simpleMessage("我的邀请"), "wodeyaoqingma" : MessageLookupByLibrary.simpleMessage("我的邀请码"), "woyouyaoqingma" : MessageLookupByLibrary.simpleMessage("我有邀请码"), "wuliudanhao" : MessageLookupByLibrary.simpleMessage("物流单号:"), @@ -681,6 +690,7 @@ class MessageLookup extends MessageLookupByLibrary { "yiduihuanjian" : m36, "yifahuo" : MessageLookupByLibrary.simpleMessage("已发货"), "yiguanzhu" : MessageLookupByLibrary.simpleMessage("已关注"), + "yihouzaishuo" : MessageLookupByLibrary.simpleMessage("以后再说"), "yihuide" : MessageLookupByLibrary.simpleMessage("已获得"), "yihujiaoqishou" : MessageLookupByLibrary.simpleMessage("已呼叫骑手"), "yikaitongzidongxufei" : MessageLookupByLibrary.simpleMessage("已开通自动续费"), @@ -769,6 +779,9 @@ class MessageLookup extends MessageLookupByLibrary { "zhongwenjianti" : MessageLookupByLibrary.simpleMessage("简体中文"), "zhuanlan" : MessageLookupByLibrary.simpleMessage("专栏"), "zhuanxiangyouhuiquan" : MessageLookupByLibrary.simpleMessage("专享优惠券"), + "zhunong1" : MessageLookupByLibrary.simpleMessage("爱在回乡 快乐助农"), + "zhunongjifen" : MessageLookupByLibrary.simpleMessage("助农积分"), + "zhunongzhuanqu" : MessageLookupByLibrary.simpleMessage("助农专区"), "zhuxiaotixing" : MessageLookupByLibrary.simpleMessage("再次提醒:注销帐号后不可恢复,相关数据和信息会永久删除。"), "ziqu" : MessageLookupByLibrary.simpleMessage("自取"), "ziti" : MessageLookupByLibrary.simpleMessage("自提"), diff --git a/lib/generated/intl/messages_zh_Hans_CN.dart b/lib/generated/intl/messages_zh_Hans_CN.dart index 543d805d..59c93d09 100644 --- a/lib/generated/intl/messages_zh_Hans_CN.dart +++ b/lib/generated/intl/messages_zh_Hans_CN.dart @@ -132,6 +132,7 @@ class MessageLookup extends MessageLookupByLibrary { "bojin" : MessageLookupByLibrary.simpleMessage("铂金"), "brand_yixinhuixiang" : MessageLookupByLibrary.simpleMessage("一心回乡"), "buzhichikaipiao" : MessageLookupByLibrary.simpleMessage("不支持开票"), + "canyingfuwu" : MessageLookupByLibrary.simpleMessage("餐饮服务"), "chakan" : MessageLookupByLibrary.simpleMessage("查看"), "chakangengduo" : MessageLookupByLibrary.simpleMessage("查看更多"), "chakanhexiaoma" : MessageLookupByLibrary.simpleMessage("查看核销码"), @@ -308,6 +309,7 @@ class MessageLookup extends MessageLookupByLibrary { "huode" : MessageLookupByLibrary.simpleMessage("获得"), "huodequanyi" : MessageLookupByLibrary.simpleMessage("获得权益"), "huodong" : MessageLookupByLibrary.simpleMessage("活动"), + "huodongguize" : MessageLookupByLibrary.simpleMessage("活动规则"), "huodongjianmianpeisongfei" : m10, "huodongjinxingzhong" : MessageLookupByLibrary.simpleMessage("活动进行中"), "huodongliebiao" : MessageLookupByLibrary.simpleMessage("活动列表"), @@ -346,6 +348,7 @@ class MessageLookup extends MessageLookupByLibrary { "jinkahuiyuan" : MessageLookupByLibrary.simpleMessage("金卡会员"), "jinrihuiyuanrenwu" : MessageLookupByLibrary.simpleMessage("今日会员任务"), "jinrushangdian" : MessageLookupByLibrary.simpleMessage("进入商店"), + "jinruzhuanqu" : MessageLookupByLibrary.simpleMessage("进入专区"), "jinxingbangdingfuka" : MessageLookupByLibrary.simpleMessage("进行绑定副卡"), "jinxingfukabangding" : MessageLookupByLibrary.simpleMessage("进行副卡绑定"), "jinxingzhanghaozhuxiao" : MessageLookupByLibrary.simpleMessage("进行账号注销"), @@ -374,6 +377,7 @@ class MessageLookup extends MessageLookupByLibrary { "kongtiao" : MessageLookupByLibrary.simpleMessage("空调"), "kuaidi" : MessageLookupByLibrary.simpleMessage("快递"), "kuaidiwuliu" : MessageLookupByLibrary.simpleMessage("快递物流"), + "kuailezhunong" : MessageLookupByLibrary.simpleMessage("快乐助农"), "lianxikefu" : MessageLookupByLibrary.simpleMessage("联系客服"), "lianxishoujihao" : MessageLookupByLibrary.simpleMessage("联系手机号"), "lianxuqiandaolingqushuangbeijifen" : MessageLookupByLibrary.simpleMessage("连续签到领取双倍积分"), @@ -381,6 +385,7 @@ class MessageLookup extends MessageLookupByLibrary { "liaojiejiankang" : MessageLookupByLibrary.simpleMessage("了解健康"), "lijicanjia" : MessageLookupByLibrary.simpleMessage("立即参加"), "lijichongzhi" : MessageLookupByLibrary.simpleMessage("立即充值"), + "lijigengxin" : MessageLookupByLibrary.simpleMessage("立即更新"), "lijikaitong" : MessageLookupByLibrary.simpleMessage("立即开通"), "lijilingqu" : MessageLookupByLibrary.simpleMessage("立即领取"), "lijiqiandao" : MessageLookupByLibrary.simpleMessage("立即签到"), @@ -480,6 +485,7 @@ class MessageLookup extends MessageLookupByLibrary { "qishoupeisongzhongyujisongdashijian" : MessageLookupByLibrary.simpleMessage("骑手配送中,预计送达时间"), "qishouyijiedanquhuozhong" : MessageLookupByLibrary.simpleMessage("骑手已接单、取货中"), "qita" : MessageLookupByLibrary.simpleMessage("其他"), + "qiyetuanjian" : MessageLookupByLibrary.simpleMessage("企业团建"), "quanbao" : MessageLookupByLibrary.simpleMessage("券包"), "quanbu" : MessageLookupByLibrary.simpleMessage("全部"), "quanbudingdan" : MessageLookupByLibrary.simpleMessage("全部订单"), @@ -539,10 +545,12 @@ class MessageLookup extends MessageLookupByLibrary { "shangjiayifahuo" : MessageLookupByLibrary.simpleMessage("商家已发货"), "shangjiazhengzaipeican" : MessageLookupByLibrary.simpleMessage("商家正在配餐"), "shanglajiazai" : MessageLookupByLibrary.simpleMessage("上拉加载"), + "shangpincaigou" : MessageLookupByLibrary.simpleMessage("商品采购"), "shangpinjifen" : m29, "shangpinxiangqing" : MessageLookupByLibrary.simpleMessage("商品详情"), "shangyidengji" : MessageLookupByLibrary.simpleMessage("上一等级"), "shenghuoyule" : MessageLookupByLibrary.simpleMessage("生活娱乐"), + "shengxianzhaipei" : MessageLookupByLibrary.simpleMessage("生鲜宅配"), "shenmijifendali" : MessageLookupByLibrary.simpleMessage("神秘积分大礼"), "shenqingtuikuan" : MessageLookupByLibrary.simpleMessage("申请退款"), "shezhi" : MessageLookupByLibrary.simpleMessage("设置"), @@ -632,6 +640,7 @@ class MessageLookup extends MessageLookupByLibrary { "wodeqianbao" : MessageLookupByLibrary.simpleMessage("我的钱包"), "wodeshengri" : MessageLookupByLibrary.simpleMessage("我的生日"), "wodexiaoxi" : MessageLookupByLibrary.simpleMessage("我的消息"), + "wodeyaoqing" : MessageLookupByLibrary.simpleMessage("我的邀请"), "wodeyaoqingma" : MessageLookupByLibrary.simpleMessage("我的邀请码"), "woyouyaoqingma" : MessageLookupByLibrary.simpleMessage("我有邀请码"), "wuliudanhao" : MessageLookupByLibrary.simpleMessage("物流单号:"), @@ -681,6 +690,7 @@ class MessageLookup extends MessageLookupByLibrary { "yiduihuanjian" : m36, "yifahuo" : MessageLookupByLibrary.simpleMessage("已发货"), "yiguanzhu" : MessageLookupByLibrary.simpleMessage("已关注"), + "yihouzaishuo" : MessageLookupByLibrary.simpleMessage("以后再说"), "yihuide" : MessageLookupByLibrary.simpleMessage("已获得"), "yihujiaoqishou" : MessageLookupByLibrary.simpleMessage("已呼叫骑手"), "yikaitongzidongxufei" : MessageLookupByLibrary.simpleMessage("已开通自动续费"), @@ -769,6 +779,9 @@ class MessageLookup extends MessageLookupByLibrary { "zhongwenjianti" : MessageLookupByLibrary.simpleMessage("简体中文"), "zhuanlan" : MessageLookupByLibrary.simpleMessage("专栏"), "zhuanxiangyouhuiquan" : MessageLookupByLibrary.simpleMessage("专享优惠券"), + "zhunong1" : MessageLookupByLibrary.simpleMessage("爱在回乡 快乐助农"), + "zhunongjifen" : MessageLookupByLibrary.simpleMessage("助农积分"), + "zhunongzhuanqu" : MessageLookupByLibrary.simpleMessage("助农专区"), "zhuxiaotixing" : MessageLookupByLibrary.simpleMessage("再次提醒:注销帐号后不可恢复,相关数据和信息会永久删除。"), "ziqu" : MessageLookupByLibrary.simpleMessage("自取"), "ziti" : MessageLookupByLibrary.simpleMessage("自提"), diff --git a/lib/generated/intl/messages_zh_Hant_CN.dart b/lib/generated/intl/messages_zh_Hant_CN.dart index fbb56b35..e4a0deaf 100644 --- a/lib/generated/intl/messages_zh_Hant_CN.dart +++ b/lib/generated/intl/messages_zh_Hant_CN.dart @@ -128,6 +128,7 @@ class MessageLookup extends MessageLookupByLibrary { "bojin" : MessageLookupByLibrary.simpleMessage("铂金"), "brand_yixinhuixiang" : MessageLookupByLibrary.simpleMessage("一心回鄉"), "buzhichikaipiao" : MessageLookupByLibrary.simpleMessage("不支持開票"), + "canyingfuwu" : MessageLookupByLibrary.simpleMessage("餐飲服務"), "chakan" : MessageLookupByLibrary.simpleMessage("查看"), "chakangengduo" : MessageLookupByLibrary.simpleMessage("查看更多"), "chakanhexiaoma" : MessageLookupByLibrary.simpleMessage("查看核銷碼"), @@ -304,6 +305,7 @@ class MessageLookup extends MessageLookupByLibrary { "huode" : MessageLookupByLibrary.simpleMessage("獲得"), "huodequanyi" : MessageLookupByLibrary.simpleMessage("獲得權益"), "huodong" : MessageLookupByLibrary.simpleMessage("活動"), + "huodongguize" : MessageLookupByLibrary.simpleMessage("活動規則"), "huodongjianmianpeisongfei" : m10, "huodongjinxingzhong" : MessageLookupByLibrary.simpleMessage("活動進行中"), "huodongliebiao" : MessageLookupByLibrary.simpleMessage("活動列表"), @@ -342,6 +344,7 @@ class MessageLookup extends MessageLookupByLibrary { "jinkahuiyuan" : MessageLookupByLibrary.simpleMessage("金卡会员"), "jinrihuiyuanrenwu" : MessageLookupByLibrary.simpleMessage("今日會員任務"), "jinrushangdian" : MessageLookupByLibrary.simpleMessage("進入商店"), + "jinruzhuanqu" : MessageLookupByLibrary.simpleMessage("進入專區"), "jinxingbangdingfuka" : MessageLookupByLibrary.simpleMessage("進行綁定副卡"), "jinxingfukabangding" : MessageLookupByLibrary.simpleMessage("進行副卡綁定"), "jinxingzhanghaozhuxiao" : MessageLookupByLibrary.simpleMessage("進行賬號注銷"), @@ -370,6 +373,7 @@ class MessageLookup extends MessageLookupByLibrary { "kongtiao" : MessageLookupByLibrary.simpleMessage("空調"), "kuaidi" : MessageLookupByLibrary.simpleMessage("快遞"), "kuaidiwuliu" : MessageLookupByLibrary.simpleMessage("快遞物流"), + "kuailezhunong" : MessageLookupByLibrary.simpleMessage("快樂助農"), "lianxikefu" : MessageLookupByLibrary.simpleMessage("聯系客服"), "lianxishoujihao" : MessageLookupByLibrary.simpleMessage("聯繫手機號"), "lianxuqiandaolingqushuangbeijifen" : MessageLookupByLibrary.simpleMessage("連續簽到領取雙倍積分"), @@ -377,6 +381,7 @@ class MessageLookup extends MessageLookupByLibrary { "liaojiejiankang" : MessageLookupByLibrary.simpleMessage("瞭解健康"), "lijicanjia" : MessageLookupByLibrary.simpleMessage("立即參加"), "lijichongzhi" : MessageLookupByLibrary.simpleMessage("立即充值"), + "lijigengxin" : MessageLookupByLibrary.simpleMessage("立即更新"), "lijikaitong" : MessageLookupByLibrary.simpleMessage("立即開通"), "lijilingqu" : MessageLookupByLibrary.simpleMessage("立即領取"), "lijiqiandao" : MessageLookupByLibrary.simpleMessage("立即簽到"), @@ -475,6 +480,7 @@ class MessageLookup extends MessageLookupByLibrary { "qishoupeisongzhongyujisongdashijian" : MessageLookupByLibrary.simpleMessage("騎手配送中,預計送達時間"), "qishouyijiedanquhuozhong" : MessageLookupByLibrary.simpleMessage("騎手已接單、取貨中"), "qita" : MessageLookupByLibrary.simpleMessage("其他"), + "qiyetuanjian" : MessageLookupByLibrary.simpleMessage("企業團建"), "quanbao" : MessageLookupByLibrary.simpleMessage("券包"), "quanbu" : MessageLookupByLibrary.simpleMessage("全部"), "quanbudingdan" : MessageLookupByLibrary.simpleMessage("全部訂單"), @@ -534,10 +540,12 @@ class MessageLookup extends MessageLookupByLibrary { "shangjiayifahuo" : MessageLookupByLibrary.simpleMessage("商家已發貨"), "shangjiazhengzaipeican" : MessageLookupByLibrary.simpleMessage("商家正在配餐"), "shanglajiazai" : MessageLookupByLibrary.simpleMessage("上拉加載"), + "shangpincaigou" : MessageLookupByLibrary.simpleMessage("商品採購"), "shangpinjifen" : m29, "shangpinxiangqing" : MessageLookupByLibrary.simpleMessage("商品詳情"), "shangyidengji" : MessageLookupByLibrary.simpleMessage("上一等級"), "shenghuoyule" : MessageLookupByLibrary.simpleMessage("生活娛樂"), + "shengxianzhaipei" : MessageLookupByLibrary.simpleMessage("生鮮宅配"), "shenmijifendali" : MessageLookupByLibrary.simpleMessage("神秘積分大禮"), "shenqingtuikuan" : MessageLookupByLibrary.simpleMessage("申請退款"), "shezhi" : MessageLookupByLibrary.simpleMessage("設置"), @@ -626,6 +634,7 @@ class MessageLookup extends MessageLookupByLibrary { "wodeqianbao" : MessageLookupByLibrary.simpleMessage("我的錢包"), "wodeshengri" : MessageLookupByLibrary.simpleMessage("我的生日"), "wodexiaoxi" : MessageLookupByLibrary.simpleMessage("我的消息"), + "wodeyaoqing" : MessageLookupByLibrary.simpleMessage("我的邀請"), "wodeyaoqingma" : MessageLookupByLibrary.simpleMessage("我的邀請碼"), "woyouyaoqingma" : MessageLookupByLibrary.simpleMessage("我有邀請碼"), "wuliudanhao" : MessageLookupByLibrary.simpleMessage("物流單號:"), @@ -675,6 +684,7 @@ class MessageLookup extends MessageLookupByLibrary { "yiduihuanjian" : m36, "yifahuo" : MessageLookupByLibrary.simpleMessage("已發貨"), "yiguanzhu" : MessageLookupByLibrary.simpleMessage("已關注"), + "yihouzaishuo" : MessageLookupByLibrary.simpleMessage("以後再說"), "yihuide" : MessageLookupByLibrary.simpleMessage("已獲得"), "yihujiaoqishou" : MessageLookupByLibrary.simpleMessage("已呼叫騎手"), "yikaitongzidongxufei" : MessageLookupByLibrary.simpleMessage("已開通自動續費"), @@ -763,6 +773,9 @@ class MessageLookup extends MessageLookupByLibrary { "zhongwenjianti" : MessageLookupByLibrary.simpleMessage("中文簡體"), "zhuanlan" : MessageLookupByLibrary.simpleMessage("專欄"), "zhuanxiangyouhuiquan" : MessageLookupByLibrary.simpleMessage("專享優惠券"), + "zhunong1" : MessageLookupByLibrary.simpleMessage("愛在回鄉,快樂助農"), + "zhunongjifen" : MessageLookupByLibrary.simpleMessage("助農積分"), + "zhunongzhuanqu" : MessageLookupByLibrary.simpleMessage("助農專區"), "zhuxiaotixing" : MessageLookupByLibrary.simpleMessage("再次提醒:註銷帳號後不可恢復,相關資料和資訊會永久删除。"), "ziqu" : MessageLookupByLibrary.simpleMessage("自取"), "ziti" : MessageLookupByLibrary.simpleMessage("自提"), diff --git a/lib/generated/intl/messages_zh_TW.dart b/lib/generated/intl/messages_zh_TW.dart index 2dc857a1..a011baca 100644 --- a/lib/generated/intl/messages_zh_TW.dart +++ b/lib/generated/intl/messages_zh_TW.dart @@ -130,6 +130,7 @@ class MessageLookup extends MessageLookupByLibrary { "bojin" : MessageLookupByLibrary.simpleMessage("铂金"), "brand_yixinhuixiang" : MessageLookupByLibrary.simpleMessage("一心回鄉"), "buzhichikaipiao" : MessageLookupByLibrary.simpleMessage("不支持開票"), + "canyingfuwu" : MessageLookupByLibrary.simpleMessage("餐飲服務"), "chakan" : MessageLookupByLibrary.simpleMessage("查看"), "chakangengduo" : MessageLookupByLibrary.simpleMessage("查看更多"), "chakanhexiaoma" : MessageLookupByLibrary.simpleMessage("查看核銷碼"), @@ -306,6 +307,7 @@ class MessageLookup extends MessageLookupByLibrary { "huode" : MessageLookupByLibrary.simpleMessage("獲得"), "huodequanyi" : MessageLookupByLibrary.simpleMessage("獲得權益"), "huodong" : MessageLookupByLibrary.simpleMessage("活動"), + "huodongguize" : MessageLookupByLibrary.simpleMessage("活動規則"), "huodongjianmianpeisongfei" : m10, "huodongjinxingzhong" : MessageLookupByLibrary.simpleMessage("活動進行中"), "huodongliebiao" : MessageLookupByLibrary.simpleMessage("活動列表"), @@ -344,6 +346,7 @@ class MessageLookup extends MessageLookupByLibrary { "jinkahuiyuan" : MessageLookupByLibrary.simpleMessage("金卡会员"), "jinrihuiyuanrenwu" : MessageLookupByLibrary.simpleMessage("今日會員任務"), "jinrushangdian" : MessageLookupByLibrary.simpleMessage("進入商店"), + "jinruzhuanqu" : MessageLookupByLibrary.simpleMessage("進入專區"), "jinxingbangdingfuka" : MessageLookupByLibrary.simpleMessage("進行綁定副卡"), "jinxingfukabangding" : MessageLookupByLibrary.simpleMessage("進行副卡綁定"), "jinxingzhanghaozhuxiao" : MessageLookupByLibrary.simpleMessage("進行賬號注銷"), @@ -372,6 +375,7 @@ class MessageLookup extends MessageLookupByLibrary { "kongtiao" : MessageLookupByLibrary.simpleMessage("空調"), "kuaidi" : MessageLookupByLibrary.simpleMessage("快遞"), "kuaidiwuliu" : MessageLookupByLibrary.simpleMessage("快遞物流"), + "kuailezhunong" : MessageLookupByLibrary.simpleMessage("快樂助農"), "lianxikefu" : MessageLookupByLibrary.simpleMessage("聯系客服"), "lianxishoujihao" : MessageLookupByLibrary.simpleMessage("聯繫手機號"), "lianxuqiandaolingqushuangbeijifen" : MessageLookupByLibrary.simpleMessage("連續簽到領取雙倍積分"), @@ -379,6 +383,7 @@ class MessageLookup extends MessageLookupByLibrary { "liaojiejiankang" : MessageLookupByLibrary.simpleMessage("瞭解健康"), "lijicanjia" : MessageLookupByLibrary.simpleMessage("立即參加"), "lijichongzhi" : MessageLookupByLibrary.simpleMessage("立即充值"), + "lijigengxin" : MessageLookupByLibrary.simpleMessage("立即更新"), "lijikaitong" : MessageLookupByLibrary.simpleMessage("立即開通"), "lijilingqu" : MessageLookupByLibrary.simpleMessage("立即領取"), "lijiqiandao" : MessageLookupByLibrary.simpleMessage("立即簽到"), @@ -477,6 +482,7 @@ class MessageLookup extends MessageLookupByLibrary { "qishoupeisongzhongyujisongdashijian" : MessageLookupByLibrary.simpleMessage("騎手配送中,預計送達時間"), "qishouyijiedanquhuozhong" : MessageLookupByLibrary.simpleMessage("騎手已接單、取貨中"), "qita" : MessageLookupByLibrary.simpleMessage("其他"), + "qiyetuanjian" : MessageLookupByLibrary.simpleMessage("企業團建"), "quanbao" : MessageLookupByLibrary.simpleMessage("券包"), "quanbu" : MessageLookupByLibrary.simpleMessage("全部"), "quanbudingdan" : MessageLookupByLibrary.simpleMessage("全部訂單"), @@ -536,10 +542,12 @@ class MessageLookup extends MessageLookupByLibrary { "shangjiayifahuo" : MessageLookupByLibrary.simpleMessage("商家已發貨"), "shangjiazhengzaipeican" : MessageLookupByLibrary.simpleMessage("商家正在配餐"), "shanglajiazai" : MessageLookupByLibrary.simpleMessage("上拉加載"), + "shangpincaigou" : MessageLookupByLibrary.simpleMessage("商品採購"), "shangpinjifen" : m29, "shangpinxiangqing" : MessageLookupByLibrary.simpleMessage("商品詳情"), "shangyidengji" : MessageLookupByLibrary.simpleMessage("上一等級"), "shenghuoyule" : MessageLookupByLibrary.simpleMessage("生活娛樂"), + "shengxianzhaipei" : MessageLookupByLibrary.simpleMessage("生鮮宅配"), "shenmijifendali" : MessageLookupByLibrary.simpleMessage("神秘積分大禮"), "shenqingtuikuan" : MessageLookupByLibrary.simpleMessage("申請退款"), "shezhi" : MessageLookupByLibrary.simpleMessage("設置"), @@ -629,6 +637,7 @@ class MessageLookup extends MessageLookupByLibrary { "wodeqianbao" : MessageLookupByLibrary.simpleMessage("我的錢包"), "wodeshengri" : MessageLookupByLibrary.simpleMessage("我的生日"), "wodexiaoxi" : MessageLookupByLibrary.simpleMessage("我的消息"), + "wodeyaoqing" : MessageLookupByLibrary.simpleMessage("我的邀請"), "wodeyaoqingma" : MessageLookupByLibrary.simpleMessage("我的邀請碼"), "woyouyaoqingma" : MessageLookupByLibrary.simpleMessage("我有邀請碼"), "wuliudanhao" : MessageLookupByLibrary.simpleMessage("物流單號:"), @@ -678,6 +687,7 @@ class MessageLookup extends MessageLookupByLibrary { "yiduihuanjian" : m36, "yifahuo" : MessageLookupByLibrary.simpleMessage("已發貨"), "yiguanzhu" : MessageLookupByLibrary.simpleMessage("已關注"), + "yihouzaishuo" : MessageLookupByLibrary.simpleMessage("以後再說"), "yihuide" : MessageLookupByLibrary.simpleMessage("已獲得"), "yihujiaoqishou" : MessageLookupByLibrary.simpleMessage("已呼叫騎手"), "yikaitongzidongxufei" : MessageLookupByLibrary.simpleMessage("已開通自動續費"), @@ -766,6 +776,9 @@ class MessageLookup extends MessageLookupByLibrary { "zhongwenjianti" : MessageLookupByLibrary.simpleMessage("中文簡體"), "zhuanlan" : MessageLookupByLibrary.simpleMessage("專欄"), "zhuanxiangyouhuiquan" : MessageLookupByLibrary.simpleMessage("專享優惠券"), + "zhunong1" : MessageLookupByLibrary.simpleMessage("愛在回鄉,快樂助農"), + "zhunongjifen" : MessageLookupByLibrary.simpleMessage("助農積分"), + "zhunongzhuanqu" : MessageLookupByLibrary.simpleMessage("助農專區"), "zhuxiaotixing" : MessageLookupByLibrary.simpleMessage("再次提醒:註銷帳號後不可恢復,相關資料和資訊會永久删除。"), "ziqu" : MessageLookupByLibrary.simpleMessage("自取"), "ziti" : MessageLookupByLibrary.simpleMessage("自提"), diff --git a/lib/generated/l10n.dart b/lib/generated/l10n.dart index dc9ce61b..de8d5e66 100644 --- a/lib/generated/l10n.dart +++ b/lib/generated/l10n.dart @@ -6745,6 +6745,136 @@ class S { ); } + /// `活动规则` + String get huodongguize { + return Intl.message( + '活动规则', + name: 'huodongguize', + desc: '', + args: [], + ); + } + + /// `我的邀请` + String get wodeyaoqing { + return Intl.message( + '我的邀请', + name: 'wodeyaoqing', + desc: '', + args: [], + ); + } + + /// `立即更新` + String get lijigengxin { + return Intl.message( + '立即更新', + name: 'lijigengxin', + desc: '', + args: [], + ); + } + + /// `以后再说` + String get yihouzaishuo { + return Intl.message( + '以后再说', + name: 'yihouzaishuo', + desc: '', + args: [], + ); + } + + /// `助农专区` + String get zhunongzhuanqu { + return Intl.message( + '助农专区', + name: 'zhunongzhuanqu', + desc: '', + args: [], + ); + } + + /// `快乐助农` + String get kuailezhunong { + return Intl.message( + '快乐助农', + name: 'kuailezhunong', + desc: '', + args: [], + ); + } + + /// `爱在回乡 快乐助农` + String get zhunong1 { + return Intl.message( + '爱在回乡 快乐助农', + name: 'zhunong1', + desc: '', + args: [], + ); + } + + /// `进入专区` + String get jinruzhuanqu { + return Intl.message( + '进入专区', + name: 'jinruzhuanqu', + desc: '', + args: [], + ); + } + + /// `生鲜宅配` + String get shengxianzhaipei { + return Intl.message( + '生鲜宅配', + name: 'shengxianzhaipei', + desc: '', + args: [], + ); + } + + /// `商品采购` + String get shangpincaigou { + return Intl.message( + '商品采购', + name: 'shangpincaigou', + desc: '', + args: [], + ); + } + + /// `餐饮服务` + String get canyingfuwu { + return Intl.message( + '餐饮服务', + name: 'canyingfuwu', + desc: '', + args: [], + ); + } + + /// `企业团建` + String get qiyetuanjian { + return Intl.message( + '企业团建', + name: 'qiyetuanjian', + desc: '', + args: [], + ); + } + + /// `助农积分` + String get zhunongjifen { + return Intl.message( + '助农积分', + name: 'zhunongjifen', + desc: '', + args: [], + ); + } + /// `并使用本机号码登录` String get privacy_policy4 { return Intl.message( diff --git a/lib/home/help_farmers/farmers_tab.dart b/lib/home/help_farmers/farmers_tab.dart new file mode 100644 index 00000000..727a5ba2 --- /dev/null +++ b/lib/home/help_farmers/farmers_tab.dart @@ -0,0 +1,26 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; + +class FarmersTab extends Decoration { + @override + BoxPainter createBoxPainter([VoidCallback onChanged]) { + return _CustomBoxPainter(); + } +} + +class _CustomBoxPainter extends BoxPainter { + @override + void paint(Canvas canvas, Offset offset, ImageConfiguration configuration) { + ///每个Tab的宽高 + Size tabSize = Size(32.w, 32.w); + final Offset tabOffset = Offset(offset.dx+((configuration.size.width-32.w)/2),offset.dy); + final Rect rect = tabOffset & tabSize; + final Paint paint = Paint(); + paint.color = Color(0xFFFFFFFF); + paint.style = PaintingStyle.stroke; + paint.strokeCap = StrokeCap.round; + paint.strokeWidth = 3; + ///画Tab矩形 + canvas.drawArc(rect, 1, 1.2, false, paint); + } +} \ No newline at end of file diff --git a/lib/home/help_farmers/help_farmers_page.dart b/lib/home/help_farmers/help_farmers_page.dart new file mode 100644 index 00000000..acafdd31 --- /dev/null +++ b/lib/home/help_farmers/help_farmers_page.dart @@ -0,0 +1,305 @@ +import 'package:dio/dio.dart'; +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_staggered_grid_view/flutter_staggered_grid_view.dart'; +import 'package:huixiang/home/help_farmers/farmers_tab.dart'; +import 'package:huixiang/retrofit/retrofit_api.dart'; +import 'package:huixiang/view_widget/classic_header.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:huixiang/view_widget/my_footer.dart'; +import 'package:pull_to_refresh/pull_to_refresh.dart'; +import 'package:shared_preferences/shared_preferences.dart'; + +import '../../generated/l10n.dart'; +import '../../retrofit/data/base_data.dart'; +import '../../retrofit/data/farmers_list.dart'; +import '../../utils/flutter_utils.dart'; +import '../../utils/font_weight.dart'; +import '../../view_widget/custom_image.dart'; +import '../../view_widget/my_tab.dart'; +import '../../view_widget/no_data_view.dart'; + +class HelpFarmersPage extends StatefulWidget { + @override + State createState() { + return _HelpFarmersPage(); + } +} + +class _HelpFarmersPage extends State { + ApiService apiService; + final RefreshController refreshController = RefreshController(); + List farmersList = []; + int tabIndex = 0; + + @override + void initState() { + super.initState(); + SharedPreferences.getInstance().then((value) => { + apiService = ApiService( + Dio(), + context: context, + token: value.getString('token'), + // showLoading: true + ), + queryConfig(), + }); + } + + ///助农列表 + queryConfig() async { + try{ + if (apiService == null) { + SharedPreferences value = await SharedPreferences.getInstance(); + apiService = ApiService( + Dio(), + context: context, + token: value.getString("token"), + ); + } + BaseData> baseData = + await apiService.getConfig().catchError((error) { + SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type), + alignment: Alignment.center); + refreshController.refreshFailed(); + }); + if (baseData != null && baseData.isSuccess) { + farmersList.clear(); + farmersList.addAll(baseData.data); + refreshController.refreshCompleted(); + } else { + refreshController.refreshFailed(); + } + }finally{ + setState(() {}); + EasyLoading.dismiss(); + } + + } + + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: Colors.transparent, + body: NestedScrollView( + headerSliverBuilder: (context, inner) { + return [ + SliverAppBar( + pinned: true, + backgroundColor: Colors.white, + elevation: 0, + leading: GestureDetector( + onTap: () { + Navigator.of(context).pop(); + }, + child: Container( + alignment: Alignment.centerRight, + margin: EdgeInsets.only(left: 10.w), + padding: EdgeInsets.all(6), + child: Icon( + Icons.arrow_back_ios, + color: Colors.white, + size: 24, + ), + ), + ), + ///去掉返回按钮 + // automaticallyImplyLeading: false, + centerTitle: true, + flexibleSpace: FlexibleSpaceBar( + background: MImage( + (farmersList.isNotEmpty)?farmersList[tabIndex]?.agriculturaListImg : "", + fit: BoxFit.fill, + width: double.infinity, + height: 354.h, + errorSrc: "assets/image/default_1.webp", + fadeSrc: "assets/image/default_1.webp", + )), + expandedHeight: 354.h, + bottom: PreferredSize( + preferredSize: Size(double.infinity, 0), + child: DefaultTabController( + length: farmersList.length, + child: Container( + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: BorderRadius.vertical( + top: Radius.circular(16), + ), + color: Color(0xFF32A060), + ), + padding: EdgeInsets.only(top:7.h,bottom: 7.h), + child: TabBar( + isScrollable: true, + //可滚动 + indicatorColor: Colors.white, + labelColor: Colors.white, + labelStyle: TextStyle( + fontSize: 16.sp, + fontWeight: FontWeight.bold, + ), + unselectedLabelStyle: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + ), + indicator: FarmersTab(), + // controller: tabController, + //未选中文字颜色 + unselectedLabelColor: Colors.white, + indicatorSize: TabBarIndicatorSize.label, + //指示器与文字等宽 + tabs: farmersList == null + ? [] + : farmersList + .map((e) => MyTab(text: e.typeName)) + .toList(), + onTap: (index) { + // queryConfig("AgriculturalList"); + tabIndex = index; + queryConfig(); + setState(() {}); + }, + ), + ), + ), + ), + ), + ]; + }, + body: recommend(), + ), + ); + } + + ///为你推荐 + Widget recommend() { + return Container( + color: Colors.white, + padding: EdgeInsets.symmetric(horizontal: 10.w), + child: (farmersList.isNotEmpty && farmersList[tabIndex].goodList.length == 0) + ? NoDataView( + src: "assets/image/xiao_fei.webp", + isShowBtn: false, + text: "当前分类暂无商品", + fontSize: 16.sp, + margin: EdgeInsets.only(top: 120.h, left: 60.w, right: 60.w), + ) + : StaggeredGridView.countBuilder( + crossAxisCount: 2, + shrinkWrap: true, + itemCount: (farmersList != null && farmersList.isNotEmpty) ? farmersList[tabIndex].goodList.length : 0, + mainAxisSpacing: 10, + crossAxisSpacing: 10, + physics: BouncingScrollPhysics(), + itemBuilder: (context, position) { + return GestureDetector( + onTap: () { + Navigator.of(context) + .pushNamed('/router/shop_details_page', arguments: { + "id": farmersList[tabIndex].goodList[position].id, + "storeId": farmersList[tabIndex].goodList[position].storeId, + }); + }, + child: recommendItem(farmersList[tabIndex].goodList[position]), + ); + }, + staggeredTileBuilder: (position) { + return StaggeredTile.fit(1); + }, + ), + ); + } + + Widget recommendItem(GoodList goodList) { + return Container( + width: 173, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(6), + boxShadow: [ + BoxShadow( + color: Color(0x1A213303), + offset: Offset(0, 2), + blurRadius: 4, + spreadRadius: 0, + ) + ], + color: Colors.white, + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + MImage( + goodList.productImg ?? "", + fit: BoxFit.fill, + width:double.infinity, + height: 174, + radius: BorderRadius.only( + topLeft: Radius.circular(6), + topRight: Radius.circular(6), + ), + errorSrc: "assets/image/default_1.webp", + fadeSrc: "assets/image/default_1.webp", + ), + Padding( + padding: EdgeInsets.only(top: 7.h, left: 10.w, bottom: 8.h), + child: Text( + goodList?.productName ?? "", + maxLines: 2, + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 14.sp, + height: 1.3.h, + fontWeight: MyFontWeight.medium, + color: Color(0xFF0D0D0D), + ), + ), + ), + Padding( + padding: EdgeInsets.only(left: 10.w, bottom: 12.h), + child:Row( + children: [ + Text( + AppUtils.calculateDouble(double.tryParse(goodList?.price) ?? 0), + style: TextStyle( + fontSize:24.sp, + fontFamily: 'APPHT', + fontWeight: MyFontWeight.medium, + color: Color(0xFF32A060), + ), + ), + Container( + margin: EdgeInsets.only(left: 8.w), + padding: EdgeInsets.symmetric(vertical:3.h,horizontal: 9.w), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(100), + boxShadow: [ + BoxShadow( + color: Color(0x1A213303), + offset: Offset(0, 2), + blurRadius: 4, + spreadRadius: 0, + ) + ], + color: Color(0xFF32A060), + ), + child: + Text( + S.of(context).zhunongjifen, + style: TextStyle( + fontSize:12.sp, + fontWeight: MyFontWeight.medium, + color: Colors.white, + ), + ), + ) + ], + ), + ), + ], + ), + ); + } +} diff --git a/lib/home/home_page.dart b/lib/home/home_page.dart index 60eb1e46..e418f8ad 100644 --- a/lib/home/home_page.dart +++ b/lib/home/home_page.dart @@ -42,7 +42,9 @@ 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 '../utils/flutter_utils.dart'; +import 'home_view/happy_help_farmers.dart'; import 'home_view/shortcut_operation.dart'; class HomePage extends StatefulWidget { @@ -149,6 +151,8 @@ class HomePageState extends State with AutomaticKeepAliveClientMixin { List coupons = []; int state = 1; HomeRank homeRank; + UserInfo userInfo; + dynamic mRaiseMoney = 0;//众筹金余额 queryHome() async { // EasyLoading.show(status: S.of(context).zhengzaijiazai); @@ -283,6 +287,16 @@ class HomePageState extends State with AutomaticKeepAliveClientMixin { } } + queryUserBalance() async { + BaseData baseData = + await apiService.queryInfo().catchError((onError) {}); + if (baseData != null && baseData.isSuccess) { + userInfo = baseData.data; + mRaiseMoney = double.tryParse(userInfo.raiseMoney); + if (mounted) setState(() {}); + } + } + ///消息数量 queryMsgStats() async { if (apiService == null) { @@ -382,6 +396,7 @@ class HomePageState extends State with AutomaticKeepAliveClientMixin { _onRefresh() async{ await queryHome(); + await queryUserBalance(); // queryMsgStats(); await queryCoupon(); } @@ -519,6 +534,10 @@ class HomePageState extends State with AutomaticKeepAliveClientMixin { ///特惠专区-推荐商品展示 HomeRecommendGoods(homeRank), + ///助农专区 + if(mRaiseMoney != 0) + HappyHelpFarmers(), + ///福利中心 WelfareCore(), diff --git a/lib/home/home_view/discount_zone.dart b/lib/home/home_view/discount_zone.dart index 1f5c7c66..e4977adf 100644 --- a/lib/home/home_view/discount_zone.dart +++ b/lib/home/home_view/discount_zone.dart @@ -30,7 +30,7 @@ class _DiscountZone extends State { Widget build(BuildContext context) { return Container( width: double.infinity, - margin: EdgeInsets.only(top:28.h,), + margin: EdgeInsets.only(top:24.h,bottom: 8.h), child: Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start, @@ -64,7 +64,7 @@ class _DiscountZone extends State { if(widget.coupon.length != 0) Container( height: 108.h, - margin: EdgeInsets.only(top: 10.h), + margin: EdgeInsets.only(top: 16.h), child: ListView.builder( scrollDirection: Axis.horizontal, physics: BouncingScrollPhysics(), diff --git a/lib/home/home_view/happy_help_farmers.dart b/lib/home/home_view/happy_help_farmers.dart new file mode 100644 index 00000000..aa669f0d --- /dev/null +++ b/lib/home/home_view/happy_help_farmers.dart @@ -0,0 +1,222 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:huixiang/retrofit/retrofit_api.dart'; +import 'package:huixiang/utils/font_weight.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; + +import '../../generated/l10n.dart'; + +class HappyHelpFarmers extends StatefulWidget { + @override + State createState() { + return _HappyHelpFarmers(); + } +} + +class _HappyHelpFarmers extends State { + ApiService apiService; + + @override + void initState() { + super.initState(); + } + + + @override + Widget build(BuildContext context) { + return Container( + margin: EdgeInsets.only(left:10.w,right: 10.w,bottom: 24.h), + child:Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Text( + S.of(context).zhunongzhuanqu, + style: TextStyle( + color: Color(0xFF0D0D0D), + fontSize: 15.sp, + fontWeight: FontWeight.bold, + ), + ), + SizedBox(height: 16.w,), + GestureDetector( + behavior: HitTestBehavior.translucent, + onTap: (){ + Navigator.of(context).pushNamed('/router/help_farmers_page'); + }, + child: Container( + padding: EdgeInsets.only(top: 12.h,left: 13.w,right: 7.w,bottom:20.h), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(6), + color: Colors.white, + boxShadow: [ + BoxShadow( + color: Color(0x08203303).withAlpha(3), + offset: Offset(0, 2), + blurRadius: 4, + spreadRadius: 0, + ) + ], + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Row( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Image.asset( + "assets/image/help_farmers_logo.webp", + fit: BoxFit.fill, + width: 109.w, + height: 62.h, + ), + SizedBox(width: 8.w,), + Expanded(child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + S.of(context).kuailezhunong, + style: TextStyle( + color: Color(0xFF0D0D0D), + fontSize: 14.sp, + fontWeight: FontWeight.bold, + ), + ), + SizedBox(height:5.h,), + Text( + S.of(context).zhunong1, + style: TextStyle( + color: Color(0xFF4D4D4D), + fontSize: 11.sp, + fontWeight: MyFontWeight.medium, + ), + ) + ], + )), + Text( + S.of(context).jinruzhuanqu, + style: TextStyle( + color: Color(0xFF4D4D4D), + fontSize: 12.sp, + fontWeight: MyFontWeight.medium, + ), + ), + Image.asset( + "assets/image/icon_right_z.webp", + fit: BoxFit.fill, + width: 13, + height: 13, + color: Color(0xFF353535), + ), + ], + ), + SizedBox(height:20.h,), + Row( + children: [ + SizedBox(width:7.w,), + Expanded(child: Column( + children: [ + Image.asset( + "assets/image/farmers_zp.webp", + fit: BoxFit.fill, + width: 40, + height: 40, + ), + SizedBox(height: 10.h,), + Text( + S.of(context).shengxianzhaipei, + style: TextStyle( + color: Color(0xFF4D4D4D), + fontSize: 12.sp, + fontWeight: MyFontWeight.medium, + ), + ), + ], + ),), + Container( + color: Color(0xFF32A060), + width: 0.5.w, + height: 66.h, + ), + Expanded(child:Column( + children: [ + Image.asset( + "assets/image/farmers_cg.webp", + fit: BoxFit.fill, + width: 40, + height: 40, + ), + SizedBox(height: 10.h,), + Text( + S.of(context).shangpincaigou, + style: TextStyle( + color: Color(0xFF4D4D4D), + fontSize: 12.sp, + fontWeight: MyFontWeight.medium, + ), + ), + ], + )), + Container( + color: Color(0xFF32A060), + width: 0.5.w, + height: 66.h, + ), + Expanded(child:Column( + children: [ + Image.asset( + "assets/image/farmers_cy.webp", + fit: BoxFit.fill, + width: 40, + height: 40, + ), + SizedBox(height: 10.h,), + Text( + S.of(context).canyingfuwu, + style: TextStyle( + color: Color(0xFF4D4D4D), + fontSize: 12.sp, + fontWeight: MyFontWeight.medium, + ), + ), + + ], + )), + Container( + color: Color(0xFF32A060), + width: 0.5.w, + height: 66.h, + ), + Expanded(child:Column( + children: [ + Image.asset( + "assets/image/farmers_tj.webp", + fit: BoxFit.fill, + width: 40, + height: 40, + ), + SizedBox(height:10.h,), + Text( + S.of(context).qiyetuanjian, + style: TextStyle( + color: Color(0xFF4D4D4D), + fontSize: 12.sp, + fontWeight: MyFontWeight.medium, + ), + ), + ], + )), + SizedBox(width:13.w,), + ], + ) + ], + ), + ), + ) + ], + ), + ); + } +} diff --git a/lib/home/home_view/home_recommend_goods.dart b/lib/home/home_view/home_recommend_goods.dart index b40825e2..e9aea46e 100644 --- a/lib/home/home_view/home_recommend_goods.dart +++ b/lib/home/home_view/home_recommend_goods.dart @@ -40,8 +40,7 @@ class _HomeRecommendGoods extends State { borderRadius: BorderRadius.circular(6), color: Colors.white, ), - margin: EdgeInsets.only( - left: 14.w, right: 14.w, top: 14.h, bottom: 14.h), + margin: EdgeInsets.only(left: 14.w, right: 14.w,bottom: 24.h), child: ListView.builder( scrollDirection: Axis.horizontal, physics: BouncingScrollPhysics(), diff --git a/lib/home/home_view/shortcut_operation.dart b/lib/home/home_view/shortcut_operation.dart index 53fe87a0..3299e3fa 100644 --- a/lib/home/home_view/shortcut_operation.dart +++ b/lib/home/home_view/shortcut_operation.dart @@ -30,7 +30,7 @@ class _ShortcutOperation extends State { return Container( // height: 70.h, width: double.infinity, - margin: EdgeInsets.only(bottom:28.h, left: 9.w, right: 9.w), + margin: EdgeInsets.only(bottom:16.h, left: 9.w, right: 9.w), child: Row( crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center, diff --git a/lib/home/home_view/union_entry.dart b/lib/home/home_view/union_entry.dart index 4bf4e7b2..c3f2e69d 100644 --- a/lib/home/home_view/union_entry.dart +++ b/lib/home/home_view/union_entry.dart @@ -30,21 +30,9 @@ class _UnionEntry extends State { @override Widget build(BuildContext context) { return Container( - height: 130.h, + height: 120.h, width: double.infinity, - margin: EdgeInsets.symmetric(horizontal:14.w,vertical: 15.h), - decoration: BoxDecoration( - color: Color(0xFFFFFFFF), - boxShadow: [ - BoxShadow( - color: Colors.black.withAlpha(12), - offset: Offset(0, 3), - blurRadius: 14, - spreadRadius: 0, - ) - ], - borderRadius: BorderRadius.circular(6.r), - ), + margin: EdgeInsets.only(top: 14.h,bottom: 10.h,right: 9.w,left: 9.w), child: Row( crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center, @@ -53,33 +41,62 @@ class _UnionEntry extends State { onTap: (){ widget.goToOrder(1); }, - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Image.asset( - "assets/image/home_chi.webp", - fit: BoxFit.fill, - width: 53.w, - height: 52.h, - ), - SizedBox(height:8.h), - Text( - S.of(context).chijiankang, - style: TextStyle( - fontWeight: MyFontWeight.semi_bold, - fontSize: 15.sp, - color: Color(0xFF0D0D0D), + child: Container( + margin: EdgeInsets.symmetric(horizontal: 5), + decoration: BoxDecoration( + color: Color(0xFFFFFFFF), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ) + ], + borderRadius: BorderRadius.circular(6.r), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Image.asset( + "assets/image/home_chi.webp", + fit: BoxFit.fill, + width: 53.w, + height: 52.h, ), - ), - ], + SizedBox(height:8.h), + Text( + S.of(context).chijiankang, + style: TextStyle( + fontWeight: MyFontWeight.semi_bold, + fontSize: 15.sp, + color: Color(0xFF0D0D0D), + ), + ), + ], + ), ), ) ), Expanded(child:GestureDetector( onTap: (){ widget.goToOrder(2); }, - child: Column( + child: Container( + margin: EdgeInsets.symmetric(horizontal: 5), + decoration: BoxDecoration( + color: Color(0xFFFFFFFF), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ) + ], + borderRadius: BorderRadius.circular(6.r), + ), + child: Column( crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center, children: [ @@ -99,13 +116,27 @@ class _UnionEntry extends State { ), ), ], - ), + )), ) ), Expanded(child: GestureDetector( onTap: (){ widget.goToOrder(3); }, - child:Column( + child:Container( + margin: EdgeInsets.symmetric(horizontal: 5), + decoration: BoxDecoration( + color: Color(0xFFFFFFFF), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ) + ], + borderRadius: BorderRadius.circular(6.r), + ), + child: Column( crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center, children: [ @@ -125,7 +156,7 @@ class _UnionEntry extends State { ), ), ], - ), + )), )), ], ), diff --git a/lib/home/home_view/welfare_core.dart b/lib/home/home_view/welfare_core.dart index 8952a5b3..b4d2077d 100644 --- a/lib/home/home_view/welfare_core.dart +++ b/lib/home/home_view/welfare_core.dart @@ -30,7 +30,7 @@ class _WelfareCore extends State { @override Widget build(BuildContext context) { return Container( - margin: EdgeInsets.only(left:10.w,right: 10.w,top: 14.h,bottom: 14.h), + margin: EdgeInsets.only(left:10.w,right: 10.w,bottom: 14.h), child:Column( children: [ Row( diff --git a/lib/l10n/intl_en.arb b/lib/l10n/intl_en.arb index 728c6dc4..cbd7d680 100644 --- a/lib/l10n/intl_en.arb +++ b/lib/l10n/intl_en.arb @@ -700,6 +700,23 @@ "he": "喝", "wan": "玩", "dianzan": "点赞", + "huodongguize": "活动规则", + "wodeyaoqing": "我的邀请", + "lijigengxin":"立即更新", + "yihouzaishuo": "以后再说", + "zhunongzhuanqu": "助农专区", + "kuailezhunong": "快乐助农", + "zhunong1": "爱在回乡 快乐助农", + "jinruzhuanqu":"进入专区", + "shengxianzhaipei":"生鲜宅配", + "shangpincaigou":"商品采购", + "canyingfuwu":"餐饮服务", + "qiyetuanjian":"企业团建", + "zhunongjifen":"助农积分", + + + + diff --git a/lib/l10n/intl_en_US.arb b/lib/l10n/intl_en_US.arb index 64584ce7..a5283cf8 100644 --- a/lib/l10n/intl_en_US.arb +++ b/lib/l10n/intl_en_US.arb @@ -701,6 +701,19 @@ "he": "Drink", "wan": "Play", "dianzan": "Like", + "huodongguize": "Activity Rules", + "wodeyaoqing": "My invitation", + "lijigengxin":"Update Now", + "yihouzaishuo":"Talk Later", + "zhunongzhuanqu": "Special Area for Agricultural Aid", + "kuailezhunong": "Helping farmers happily", + "zhunong1": "Love returns home and helps farmers happily", + "jinruzhuanqu":"Enter the zone", + "shengxianzhaipei":"Fresh House", + "shangpincaigou":"Commodity buy", + "canyingfuwu":"catering service", + "qiyetuanjian":"Enterprise League Building", + "zhunongjifen":"Farming aid points", diff --git a/lib/l10n/intl_zh_CN.arb b/lib/l10n/intl_zh_CN.arb index 740736ea..edb9f2a0 100644 --- a/lib/l10n/intl_zh_CN.arb +++ b/lib/l10n/intl_zh_CN.arb @@ -701,6 +701,19 @@ "he": "喝", "wan": "玩", "dianzan": "点赞", + "huodongguize": "活动规则", + "wodeyaoqing": "我的邀请", + "lijigengxin":"立即更新", + "yihouzaishuo":"以后再说", + "zhunongzhuanqu": "助农专区", + "kuailezhunong": "快乐助农", + "zhunong1": "爱在回乡 快乐助农", + "jinruzhuanqu":"进入专区", + "shengxianzhaipei":"生鲜宅配", + "shangpincaigou":"商品采购", + "canyingfuwu":"餐饮服务", + "qiyetuanjian":"企业团建", + "zhunongjifen":"助农积分", diff --git a/lib/l10n/intl_zh_Hans_CN.arb b/lib/l10n/intl_zh_Hans_CN.arb index 5ac17b35..5d24beec 100644 --- a/lib/l10n/intl_zh_Hans_CN.arb +++ b/lib/l10n/intl_zh_Hans_CN.arb @@ -701,6 +701,19 @@ "he": "喝", "wan": "玩", "dianzan": "点赞", + "huodongguize": "活动规则", + "wodeyaoqing": "我的邀请", + "lijigengxin":"立即更新", + "yihouzaishuo":"以后再说", + "zhunongzhuanqu": "助农专区", + "kuailezhunong": "快乐助农", + "zhunong1": "爱在回乡 快乐助农", + "jinruzhuanqu":"进入专区", + "shengxianzhaipei":"生鲜宅配", + "shangpincaigou":"商品采购", + "canyingfuwu":"餐饮服务", + "qiyetuanjian":"企业团建", + "zhunongjifen":"助农积分", diff --git a/lib/l10n/intl_zh_Hant_CN.arb b/lib/l10n/intl_zh_Hant_CN.arb index 1ea896ec..9c107d87 100644 --- a/lib/l10n/intl_zh_Hant_CN.arb +++ b/lib/l10n/intl_zh_Hant_CN.arb @@ -692,6 +692,19 @@ "he": "喝", "wan": "玩", "dianzan": "點贊", + "huodongguize": "活動規則", + "wodeyaoqing": "我的邀請", + "lijigengxin":"立即更新", + "yihouzaishuo":"以後再說", + "zhunongzhuanqu": "助農專區", + "kuailezhunong": "快樂助農", + "zhunong1": "愛在回鄉,快樂助農", + "jinruzhuanqu":"進入專區", + "shengxianzhaipei":"生鮮宅配", + "shangpincaigou":"商品採購", + "canyingfuwu":"餐飲服務", + "qiyetuanjian":"企業團建", + "zhunongjifen":"助農積分", diff --git a/lib/l10n/intl_zh_TW.arb b/lib/l10n/intl_zh_TW.arb index 97f321ff..467affc4 100644 --- a/lib/l10n/intl_zh_TW.arb +++ b/lib/l10n/intl_zh_TW.arb @@ -694,6 +694,19 @@ "he": "喝", "wan": "玩", "dianzan": "點贊", + "huodongguize": "活動規則", + "wodeyaoqing": "我的邀請", + "lijigengxin":"立即更新", + "yihouzaishuo":"以後再說", + "zhunongzhuanqu": "助農專區", + "kuailezhunong": "快樂助農", + "zhunong1": "愛在回鄉,快樂助農", + "jinruzhuanqu":"進入專區", + "shengxianzhaipei":"生鮮宅配", + "shangpincaigou":"商品採購", + "canyingfuwu":"餐飲服務", + "qiyetuanjian":"企業團建", + "zhunongjifen":"助農積分", diff --git a/lib/main.dart b/lib/main.dart index ec654dcb..41c34173 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -90,6 +90,7 @@ import 'community/report/report_notice.dart'; import 'community/report/report_page.dart'; import 'community/report/report_success.dart'; import 'home/guide_page.dart'; +import 'home/help_farmers/help_farmers_page.dart'; import 'home/home_view/activity_list.dart'; import 'home/welfare_exchange.dart'; import 'home/welfare_page.dart'; @@ -414,4 +415,6 @@ Map routers = { ProductMealsSku(arguments:arguments), '/router/user_vip_service_page': (context, {arguments}) => UserVipServicePage(), + '/router/help_farmers_page': (context, {arguments}) => + HelpFarmersPage(), }; diff --git a/lib/mine/mine_wallet_page.dart b/lib/mine/mine_wallet_page.dart index 821a3621..04b0b817 100644 --- a/lib/mine/mine_wallet_page.dart +++ b/lib/mine/mine_wallet_page.dart @@ -32,8 +32,10 @@ class MineWalletPage extends StatefulWidget { class _MineWalletPage extends State { dynamic pBalance = 0; //平台总余额 dynamic mBalance = 0; // 余额 - dynamic mgreenMoney = 0; - dynamic activityMoney = 0; + dynamic mgreenMoney = 0;//绿币余额 + dynamic activityMoney = 0;//活动余额 + dynamic mRaiseMoney = 0;//众筹金余额 + bool integralTips = false; @override void initState() { @@ -52,8 +54,9 @@ class _MineWalletPage extends State { userInfo = UserInfo.fromJson(jsonDecode(sharedPreferences.getString('user'))); mgreenMoney = double.tryParse(userInfo.greenMoney); + mRaiseMoney = double.tryParse(userInfo.raiseMoney); mBalance = double.tryParse(userInfo.money); - pBalance = mBalance+mgreenMoney; + pBalance = mBalance + mgreenMoney; activityMoney = double.tryParse(userInfo.activityMoney); if (mounted) setState(() {}); String token = sharedPreferences.getString("token"); @@ -72,9 +75,10 @@ class _MineWalletPage extends State { if (baseData != null && baseData.isSuccess) { userInfo = baseData.data; mgreenMoney = double.tryParse(userInfo.greenMoney); + mRaiseMoney = double.tryParse(userInfo.raiseMoney); activityMoney = double.tryParse(userInfo.activityMoney); mBalance = double.tryParse(userInfo.money); - pBalance = mBalance+mgreenMoney; + pBalance = mBalance + mgreenMoney; if (mounted) setState(() {}); } } @@ -150,6 +154,242 @@ class _MineWalletPage extends State { ); } + Widget balance() { + return Container( + width: double.infinity, + margin: EdgeInsets.fromLTRB(14.w, 16.h, 14.w, 8.h), + padding: EdgeInsets.only(bottom: 12.h), + decoration: BoxDecoration( + color: Color(0xFF32A060), + borderRadius: BorderRadius.circular(10), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(25), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ), + ], + ), + child: Stack( + children: [ + Container( + padding: EdgeInsets.symmetric(horizontal: 26.w), + width: double.infinity, + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10), + ), + child: IntrinsicHeight( + child: Column( + children: [ + Padding( + padding: EdgeInsets.only(top: 18.h, bottom: 6.h), + child: Text( + S.of(context).zongzichanyuan, + style: TextStyle( + color: Colors.white, + fontWeight: MyFontWeight.semi_bold, + fontSize: 16.sp, + ), + ), + ), + Padding( + padding: EdgeInsets.only(bottom: 14.h), + child: Text( + "${NP.plus(mBalance, mgreenMoney)}", + style: TextStyle( + fontWeight: MyFontWeight.medium, + fontSize: 24.sp, + fontFamily: 'JDZhengHT', + color: Colors.white, + ), + ), + ), + GestureDetector( + onTap: () { + toRecharge(); + }, + child: Container( + width: 106.w, + height: 32.h, + alignment: Alignment.center, + margin: EdgeInsets.only(bottom: 16.h), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(100), + ), + child: Text( + "去充值", + style: TextStyle( + fontWeight: MyFontWeight.semi_bold, + fontSize: 14.sp, + fontFamily: 'JDZhengHT', + color: Color(0xFF35BB6D), + ), + ), + ), + ), + + ///余额 + Row( + children: [ + Expanded( + child: Text( + "${S.of(context).yue}(含活动)", + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.semi_bold, + color: Colors.white, + ), + )), + Text( + "${NP.strip(mBalance)}", + style: TextStyle( + fontSize: 14.sp, + fontFamily: 'JDZhengHT', + fontWeight: MyFontWeight.medium, + color: Colors.white, + ), + ) + ], + ), + Container( + margin: EdgeInsets.symmetric(vertical: 8.h), + width: double.infinity, + height: 1.h, + color: Color(0x33FFFCFC), + ), + + ///活动余额 + Row( + children: [ + Expanded( + child: Text( + "活动余额", + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.semi_bold, + color: Colors.white, + ), + )), + Text( + "${NP.strip(activityMoney)}", + style: TextStyle( + fontSize: 14.sp, + fontFamily: 'JDZhengHT', + fontWeight: MyFontWeight.medium, + color: Colors.white, + ), + ), + ], + ), + Container( + margin: EdgeInsets.symmetric(vertical: 8.h), + width: double.infinity, + height: 1.h, + color: Color(0x33FFFCFC), + ), + + ///绿币余额 + if (mgreenMoney != 0) + Row( + children: [ + Expanded( + child: Text( + "绿币余额", + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.semi_bold, + color: Colors.white, + ), + ), + ), + Text( + "${NP.strip(mgreenMoney)}", + style: TextStyle( + fontSize: 14.sp, + fontFamily: 'JDZhengHT', + fontWeight: MyFontWeight.medium, + color: Colors.white, + ), + ) + ], + ), + if (mgreenMoney != 0) + Container( + margin: EdgeInsets.symmetric(vertical: 8.h), + width: double.infinity, + height: 1.h, + color: Color(0x33FFFCFC), + ), + ///助农积分 + if (mRaiseMoney != 0) + GestureDetector( + onTap: () { + setState(() { + integralTips = !integralTips; + }); + }, + child: Row( + children: [ + Text( + "助农积分", + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.semi_bold, + color: Colors.white, + ), + ), + SizedBox( + width: 4.w, + ), + Image.asset( + "assets/image/tips_white.webp", + fit: BoxFit.cover, + width: 16.w, + height: 16.h, + ), + Expanded( + child: Text( + integralTips ? " 有效期至${userInfo.raiseExpireTime.split(" ")[0]}" : "", + style: TextStyle( + fontSize: 10.sp, + fontFamily: 'JDZhengHT', + fontWeight: MyFontWeight.light, + color: Colors.white, + ), + )), + Text( + "${NP.strip(mRaiseMoney)}", + style: TextStyle( + fontSize: 14.sp, + fontFamily: 'JDZhengHT', + fontWeight: MyFontWeight.medium, + color: Colors.white, + ), + ) + ], + ), + ), + ], + ), + ), + ), + Align( + alignment: Alignment.topRight, + child: Image.asset( + "assets/image/wallet_logo.webp", + fit: BoxFit.fill, + width: 116.w, + height: 73.h, + ), + ), + ], + ), + ); + } + Widget balanceHistory() { return Container( margin: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 0), @@ -218,7 +458,7 @@ class _MineWalletPage extends State { Expanded( flex: 7, child: Text( - userBill.name, + userBill.title, style: TextStyle( color: Colors.black, fontSize: 12.sp, @@ -239,7 +479,7 @@ class _MineWalletPage extends State { child: Text( e, style: TextStyle( - color: Color(0xFF20662A), + color: Color(0xFF32A060), fontFamily: 'JDZhengHT', fontWeight: MyFontWeight.bold, fontSize: 12.sp, @@ -249,7 +489,7 @@ class _MineWalletPage extends State { : Text( e, style: TextStyle( - color: Color(0xFF20662A), + color: Color(0xFF32A060), fontWeight: MyFontWeight.bold, fontFamily: 'JDZhengHT', fontSize: 12.sp, @@ -431,209 +671,6 @@ class _MineWalletPage extends State { } //assets/image/recharge,Btn.png - Widget balance() { - return Container( - margin: EdgeInsets.fromLTRB(14.w, 16.h, 14.w, 8.h), - decoration: BoxDecoration( - color: Colors.green, - borderRadius: BorderRadius.circular(8), - boxShadow: [ - BoxShadow( - color: Colors.black.withAlpha(25), - offset: Offset(0, 3), - blurRadius: 14, - spreadRadius: 0, - ), - ], - ), - child: IntrinsicHeight( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - //24.w, 24.h, 24.w, 24.h - Padding( - padding: EdgeInsets.only( - left: 24.w, - top: 24.h, - ), - child: Text( - S.of(context).zongzichanyuan, - style: TextStyle( - color: Colors.white, - fontSize: 16.sp, - ), - ), - ), - Expanded( - child: Row( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox( - width: 24.w, - ), - Text( - "${NP.plus(mBalance,mgreenMoney)}", - style: TextStyle( - fontWeight: MyFontWeight.medium, - fontSize: 50.sp, - fontFamily: 'JDZhengHT', - color: Colors.white, - ), - ), - Spacer( - flex: 1, - ), - InkWell( - onTap: () { - toRecharge(); - }, - child: SizedBox( - width: 87.w, - height: 46.h, - child: Stack( - children: [ - Positioned.fill( - child: Image.asset( - "assets/image/rechargeBtn.png", - height: 46.h, - width: 87.w, - fit: BoxFit.fill, - ), - ), - Positioned( - left: 14.w, - top: 0, - bottom: 0, - child: Container( - alignment: Alignment.centerLeft, - child: Text( - S.of(context).chongzhi, - style: TextStyle( - fontSize: 18.sp, - fontWeight: MyFontWeight.semi_bold, - color: Color(0xFF32A060), - ), - ), - ), - ), - ], - ), - ), - ), - ], - ), - flex: 1, - ), - SizedBox( - height: 22.h, - ), - Padding( - padding: EdgeInsets.symmetric( - horizontal: 24.w, - ), - child: Row( - children: [ - Expanded( - flex: 1, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - "${S.of(context).yue}(含活动)", - style: TextStyle( - fontSize: 14.sp, - fontWeight: MyFontWeight.semi_bold, - color: Colors.white, - ), - ), - SizedBox( - height: 4.h, - ), - Text( - "${NP.strip(mBalance)}", - style: TextStyle( - fontSize: 18.sp, - fontFamily: 'JDZhengHT', - fontWeight: MyFontWeight.semi_bold, - color: Colors.white, - ), - ), - ], - ), - ), - SizedBox( - height: 8.h, - ), - Expanded( - flex: 1, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - "活动余额", - style: TextStyle( - fontSize: 14.sp, - fontWeight: MyFontWeight.semi_bold, - color: Colors.white, - ), - ), - SizedBox( - height: 4.h, - ), - Text( - "${NP.strip(activityMoney)}", - style: TextStyle( - fontSize: 18.sp, - fontFamily: 'JDZhengHT', - fontWeight: MyFontWeight.semi_bold, - color: Colors.white, - ), - ), - ], - ), - ), - SizedBox( - height: 8.h, - ), - Expanded( - flex: 1, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - "绿币余额", - style: TextStyle( - fontSize: 14.sp, - fontWeight: MyFontWeight.semi_bold, - color: Colors.white, - ), - ), - SizedBox( - height: 4.h, - ), - Text( - "${NP.strip(mgreenMoney)}", - style: TextStyle( - fontSize: 18.sp, - fontFamily: 'JDZhengHT', - fontWeight: MyFontWeight.semi_bold, - color: Colors.white, - ), - ), - ], - ), - ), - ], - ), - ), - SizedBox( - height: 24.h, - ), - ], - ), - ), - ); - } toRecharge() async { await Navigator.of(context).pushNamed('/router/recharge_page'); diff --git a/lib/order/logistics_information_page.dart b/lib/order/logistics_information_page.dart index 6708df0a..68f6233c 100644 --- a/lib/order/logistics_information_page.dart +++ b/lib/order/logistics_information_page.dart @@ -331,83 +331,85 @@ class _LogisticsInformationPage extends State { } Widget orderTrackItem(TracesBean logistics, var position, var size) { - return Row( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Column( - // mainAxisAlignment: MainAxisAlignment.start, - // crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - logistics.acceptTime.split(" ")[0], - style: TextStyle( - fontSize: 14.sp, - fontWeight: MyFontWeight.medium, - color: Color(0xff353535)), - ), - SizedBox( - height: 5.h, - ), - Text( - logistics.acceptTime.split(" ")[1], - style: TextStyle( - fontSize: 12.sp, - fontWeight: MyFontWeight.medium, - color: Color(0xff868686)), - ), - ], - ), - SizedBox( - width: 28.w, - ), - Column( - children: [ - Image.asset( - tripStatus(logistics.acceptStation), - width: 24.w, - height: 24.h, - ), - if (position != size - 1) - Container( - width: 1.w, - height: 75.h, - decoration: new BoxDecoration( - color: Color(0xffE1E1E1), - ), - ) - ], - ), - SizedBox( - width: 28.w, - ), - Expanded( - flex: 1, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + return IntrinsicHeight( + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Column( + // mainAxisAlignment: MainAxisAlignment.start, + // crossAxisAlignment: CrossAxisAlignment.start, children: [ - if (logisticsTripStatus(logistics.acceptStation) != "") - Text( - logisticsTripStatus(logistics.acceptStation), - style: TextStyle( - fontSize: 14.sp, - fontWeight: MyFontWeight.medium, - color: Colors.black), - ), + Text( + logistics.acceptTime.split(" ")[0], + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xff353535)), + ), SizedBox( - height: 10.h, + height: 5.h, ), Text( - logistics.acceptStation, + logistics.acceptTime.split(" ")[1], style: TextStyle( fontSize: 12.sp, - fontWeight: MyFontWeight.regular, - color: Color(0xff353535)), + fontWeight: MyFontWeight.medium, + color: Color(0xff868686)), ), ], ), - ), - ], + SizedBox( + width: 28.w, + ), + Column( + children: [ + Image.asset( + tripStatus(logistics.acceptStation), + width: 24.w, + height: 24.h, + ), + if (position != size - 1) + Container( + width: 1.w, + height: 75.h, + decoration: new BoxDecoration( + color: Color(0xffE1E1E1), + ), + ) + ], + ), + SizedBox( + width: 28.w, + ), + Expanded( + flex: 1, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + if (logisticsTripStatus(logistics.acceptStation) != "") + Text( + logisticsTripStatus(logistics.acceptStation), + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.medium, + color: Colors.black), + ), + SizedBox( + height: 10.h, + ), + Text( + logistics.acceptStation, + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xff353535)), + ), + ], + ), + ), + ], + ), ); } diff --git a/lib/order/order_view/order_info.dart b/lib/order/order_view/order_info.dart index f6d32caa..84d92782 100644 --- a/lib/order/order_view/order_info.dart +++ b/lib/order/order_view/order_info.dart @@ -77,6 +77,8 @@ class _OrderInfoView extends State { return "回乡绿币支付"; case 6: return "活动余额支付"; + case 7: + return "众筹金支付"; } return S.of(context).yue; } diff --git a/lib/order/order_view/order_pay_selected.dart b/lib/order/order_view/order_pay_selected.dart index 676da177..b265c09d 100644 --- a/lib/order/order_view/order_pay_selected.dart +++ b/lib/order/order_view/order_pay_selected.dart @@ -56,9 +56,40 @@ class _OrderPaySelected extends State { ), GestureDetector( onTap: () { - // Navigator.of(context).pop(4); + // Navigator.of(context).pop(3); setState(() { checkIndex = 1; + payIndex = 7; + }); + }, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Image.asset("assets/image/zhu_n.webp"), + Expanded(child: Padding( + padding: EdgeInsets.only(left: 8.w), + child:Text( + "助农积分", + style: TextStyle( + fontSize: 14.sp, + color: Color(0xff353535), + fontWeight: MyFontWeight.semi_bold, + ), + ), + ),), + checkView(1), + ], + ), + ), + SizedBox( + height: 10, + ), + GestureDetector( + onTap: () { + // Navigator.of(context).pop(4); + setState(() { + checkIndex = 2; payIndex = 4; }); }, @@ -77,7 +108,7 @@ class _OrderPaySelected extends State { fontWeight: MyFontWeight.semi_bold,), ), ),), - checkView(1), + checkView(2), ], ), ), @@ -88,7 +119,7 @@ class _OrderPaySelected extends State { onTap: () { // Navigator.of(context).pop(3); setState(() { - checkIndex = 2; + checkIndex = 3; payIndex = 3; }); @@ -109,7 +140,7 @@ class _OrderPaySelected extends State { ), ), ),), - checkView(2), + checkView(3), ], ), ), @@ -120,7 +151,7 @@ class _OrderPaySelected extends State { onTap: () { // Navigator.of(context).pop(3); setState(() { - checkIndex = 3; + checkIndex = 4; payIndex = 5; }); @@ -141,7 +172,7 @@ class _OrderPaySelected extends State { ), ), ),), - checkView(3), + checkView(4), ], ), ), @@ -152,7 +183,7 @@ class _OrderPaySelected extends State { onTap: () { // Navigator.of(context).pop(1); setState(() { - checkIndex = 4; + checkIndex = 5; payIndex = 1; }); }, @@ -172,7 +203,7 @@ class _OrderPaySelected extends State { ), ), ),), - checkView(4), + checkView(5), ], ), ), @@ -207,7 +238,7 @@ class _OrderPaySelected extends State { ); } - var checkIndex = 4; + var checkIndex = 5; int payIndex = 1; Widget checkView(var index) { diff --git a/lib/qr/invite_friends.dart b/lib/qr/invite_friends.dart index fd3a63f2..8a6ed6b7 100644 --- a/lib/qr/invite_friends.dart +++ b/lib/qr/invite_friends.dart @@ -135,7 +135,7 @@ class _InviteFriends extends State { Navigator.of(context).pop(); }), title: Text( - "邀请好友", + S.of(context).yaoqinghaoyou, style: TextStyle( fontWeight: MyFontWeight.semi_bold, fontSize: 17.sp, @@ -180,21 +180,16 @@ class _InviteFriends extends State { child: Container( child: SingleChildScrollView( physics: BouncingScrollPhysics(), - child: FutureBuilder( - // future: querySignInfo(), - builder: (context, snap) { - return Column( - children: [ - invite(), + child: Column( + children: [ + invite(), - activityRule(), + activityRule(), - achievement(), + achievement(), - mineInvite(), - ], - ); - }, + mineInvite(), + ], ), ), ), @@ -284,7 +279,7 @@ class _InviteFriends extends State { width:double.infinity, alignment: Alignment.center, child: Text( - "活动规则", + S.of(context).huodongguize, style: TextStyle( fontWeight: MyFontWeight.semi_bold, fontSize: 16.sp, @@ -653,7 +648,7 @@ class _InviteFriends extends State { width:double.infinity, alignment: Alignment.center, child: Text( - "我的成就", + S.of(context).wodechengjiu, style: TextStyle( fontWeight: MyFontWeight.semi_bold, fontSize: 16.sp, @@ -737,7 +732,7 @@ class _InviteFriends extends State { width:double.infinity, alignment: Alignment.center, child: Text( - "我的邀请", + S.of(context).wodeyaoqing, style: TextStyle( fontWeight: MyFontWeight.semi_bold, fontSize: 16.sp, @@ -843,7 +838,7 @@ class _InviteFriends extends State { [ "", ], - "https://pos.upload.gznl.top/0000/2022/06/0c4aa046-9da5-4053-84e6-a5c6ddb4387a.png", + "", "", buildShareUrl(), "", diff --git a/lib/retrofit/data/farmers_list.dart b/lib/retrofit/data/farmers_list.dart new file mode 100644 index 00000000..4bec5df6 --- /dev/null +++ b/lib/retrofit/data/farmers_list.dart @@ -0,0 +1,614 @@ +/// goodList : [{"productImg":"https://pos.upload.lotus-wallet.com/1178/2022/04/7dfa5c3e-b23e-4424-b886-f1dbb4f15ba1.jpg","productSkuVOList":[{"ticketStyle":"","productId":"1517366419690356736","isDelete":0,"ticketDays":"0","setMeal":"","updateUser":"1347839370706550784","skuPrice":"8.00","skuStock":1,"weight":0,"updateTime":"2022-04-22 12:55:20","ticketType":"","sort":50,"storeId":"1347853925696405504","version":0,"deliveries":0,"volume":0,"autoRenewSkuStock":0,"skuNameStr":"份","createTime":"2022-04-22 12:55:20","createUser":"1347839370706550784","id":"1517366419740688384","applyPrice":"8.00","skuAttrList":[{"attrValueId":"1517366419723911168","isDelete":0,"updateUser":"1347839370706550784","updateTime":"2022-04-22 12:55:20","attrId":"1517366419715522560","createTime":"2022-04-22 12:55:20","createUser":"1347839370706550784","id":"1517366419753271296","skuId":"1517366419740688384"}],"skuCode":"P202204221255202"}],"thumbnailImg":"https://pos.upload.lotus-wallet.com/1178/2022/06/9295bf3f-9d8b-4d5c-857e-4f80327ddc74.jpg","tenantCode":"1178","storeId":"1347853925696405504","productName":"苋菜","posShow":false,"price":"8.00","sellCount":27,"details":"","id":"1517366419690356736","applyPrice":"8.00","stock":1,"status":0,"info":""}] +/// typeName : "蔬菜宅配" + +class FarmersList { + FarmersList({ + List goodList, + String typeName, + String agriculturaListImg, + }) { + _goodList = goodList; + _typeName = typeName; + _agriculturaListImg = agriculturaListImg; + } + + FarmersList.fromJson(dynamic json) { + if (json['goodList'] != null) { + _goodList = []; + json['goodList'].forEach((v) { + _goodList.add(GoodList.fromJson(v)); + }); + } + _typeName = json['typeName']; + _agriculturaListImg = json['agriculturaListImg']; + } + + List _goodList; + String _typeName; + String _agriculturaListImg; + + FarmersList copyWith({ + List goodList, + String typeName, + String agriculturaListImg, + }) => + FarmersList( + goodList: goodList ?? _goodList, + typeName: typeName ?? _typeName, + agriculturaListImg: agriculturaListImg ?? _agriculturaListImg, + ); + + List get goodList => _goodList; + + String get typeName => _typeName; + + String get agriculturaListImg => _agriculturaListImg; + + Map toJson() { + final map = {}; + if (_goodList != null) { + map['goodList'] = _goodList.map((v) => v.toJson()).toList(); + } + map['typeName'] = _typeName; + map['agriculturaListImg'] = _agriculturaListImg; + return map; + } +} + +/// productImg : "https://pos.upload.lotus-wallet.com/1178/2022/04/7dfa5c3e-b23e-4424-b886-f1dbb4f15ba1.jpg" +/// productSkuVOList : [{"ticketStyle":"","productId":"1517366419690356736","isDelete":0,"ticketDays":"0","setMeal":"","updateUser":"1347839370706550784","skuPrice":"8.00","skuStock":1,"weight":0,"updateTime":"2022-04-22 12:55:20","ticketType":"","sort":50,"storeId":"1347853925696405504","version":0,"deliveries":0,"volume":0,"autoRenewSkuStock":0,"skuNameStr":"份","createTime":"2022-04-22 12:55:20","createUser":"1347839370706550784","id":"1517366419740688384","applyPrice":"8.00","skuAttrList":[{"attrValueId":"1517366419723911168","isDelete":0,"updateUser":"1347839370706550784","updateTime":"2022-04-22 12:55:20","attrId":"1517366419715522560","createTime":"2022-04-22 12:55:20","createUser":"1347839370706550784","id":"1517366419753271296","skuId":"1517366419740688384"}],"skuCode":"P202204221255202"}] +/// thumbnailImg : "https://pos.upload.lotus-wallet.com/1178/2022/06/9295bf3f-9d8b-4d5c-857e-4f80327ddc74.jpg" +/// tenantCode : "1178" +/// storeId : "1347853925696405504" +/// productName : "苋菜" +/// posShow : false +/// price : "8.00" +/// sellCount : 27 +/// details : "" +/// id : "1517366419690356736" +/// applyPrice : "8.00" +/// stock : 1 +/// status : 0 +/// info : "" + +class GoodList { + GoodList({ + String productImg, + List productSkuVOList, + String thumbnailImg, + String tenantCode, + String storeId, + String productName, + bool posShow, + String price, + num sellCount, + String details, + String id, + String applyPrice, + dynamic stock, + dynamic status, + String info, + }) { + _productImg = productImg; + _productSkuVOList = productSkuVOList; + _thumbnailImg = thumbnailImg; + _tenantCode = tenantCode; + _storeId = storeId; + _productName = productName; + _posShow = posShow; + _price = price; + _sellCount = sellCount; + _details = details; + _id = id; + _applyPrice = applyPrice; + _stock = stock; + _status = status; + _info = info; + } + + GoodList.fromJson(dynamic json) { + _productImg = json['productImg']; + if (json['productSkuVOList'] != null) { + _productSkuVOList = []; + json['productSkuVOList'].forEach((v) { + _productSkuVOList.add(ProductSkuVoList.fromJson(v)); + }); + } + _thumbnailImg = json['thumbnailImg']; + _tenantCode = json['tenantCode']; + _storeId = json['storeId']; + _productName = json['productName']; + _posShow = json['posShow']; + _price = json['price']; + _sellCount = json['sellCount']; + _details = json['details']; + _id = json['id']; + _applyPrice = json['applyPrice']; + _stock = json['stock']; + _status = json['status']; + _info = json['info']; + } + + String _productImg; + List _productSkuVOList; + String _thumbnailImg; + String _tenantCode; + String _storeId; + String _productName; + bool _posShow; + String _price; + num _sellCount; + String _details; + String _id; + String _applyPrice; + dynamic _stock; + dynamic _status; + String _info; + + GoodList copyWith({ + String productImg, + List productSkuVOList, + String thumbnailImg, + String tenantCode, + String storeId, + String productName, + bool posShow, + String price, + num sellCount, + String details, + String id, + String applyPrice, + dynamic stock, + dynamic status, + String info, + }) => + GoodList( + productImg: productImg ?? _productImg, + productSkuVOList: productSkuVOList ?? _productSkuVOList, + thumbnailImg: thumbnailImg ?? _thumbnailImg, + tenantCode: tenantCode ?? _tenantCode, + storeId: storeId ?? _storeId, + productName: productName ?? _productName, + posShow: posShow ?? _posShow, + price: price ?? _price, + sellCount: sellCount ?? _sellCount, + details: details ?? _details, + id: id ?? _id, + applyPrice: applyPrice ?? _applyPrice, + stock: stock ?? _stock, + status: status ?? _status, + info: info ?? _info, + ); + + String get productImg => _productImg; + + List get productSkuVOList => _productSkuVOList; + + String get thumbnailImg => _thumbnailImg; + + String get tenantCode => _tenantCode; + + String get storeId => _storeId; + + String get productName => _productName; + + bool get posShow => _posShow; + + String get price => _price; + + num get sellCount => _sellCount; + + String get details => _details; + + String get id => _id; + + String get applyPrice => _applyPrice; + + dynamic get stock => _stock; + + dynamic get status => _status; + + String get info => _info; + + Map toJson() { + final map = {}; + map['productImg'] = _productImg; + if (_productSkuVOList != null) { + map['productSkuVOList'] = + _productSkuVOList.map((v) => v.toJson()).toList(); + } + map['thumbnailImg'] = _thumbnailImg; + map['tenantCode'] = _tenantCode; + map['storeId'] = _storeId; + map['productName'] = _productName; + map['posShow'] = _posShow; + map['price'] = _price; + map['sellCount'] = _sellCount; + map['details'] = _details; + map['id'] = _id; + map['applyPrice'] = _applyPrice; + map['stock'] = _stock; + map['status'] = _status; + map['info'] = _info; + return map; + } +} + +/// ticketStyle : "" +/// productId : "1517366419690356736" +/// isDelete : 0 +/// ticketDays : "0" +/// setMeal : "" +/// updateUser : "1347839370706550784" +/// skuPrice : "8.00" +/// skuStock : 1 +/// weight : 0 +/// updateTime : "2022-04-22 12:55:20" +/// ticketType : "" +/// sort : 50 +/// storeId : "1347853925696405504" +/// version : 0 +/// deliveries : 0 +/// volume : 0 +/// autoRenewSkuStock : 0 +/// skuNameStr : "份" +/// createTime : "2022-04-22 12:55:20" +/// createUser : "1347839370706550784" +/// id : "1517366419740688384" +/// applyPrice : "8.00" +/// skuAttrList : [{"attrValueId":"1517366419723911168","isDelete":0,"updateUser":"1347839370706550784","updateTime":"2022-04-22 12:55:20","attrId":"1517366419715522560","createTime":"2022-04-22 12:55:20","createUser":"1347839370706550784","id":"1517366419753271296","skuId":"1517366419740688384"}] +/// skuCode : "P202204221255202" + +class ProductSkuVoList { + ProductSkuVoList({ + String ticketStyle, + String productId, + num isDelete, + String ticketDays, + String setMeal, + String updateUser, + String skuPrice, + num skuStock, + num weight, + String updateTime, + String ticketType, + num sort, + String storeId, + num version, + num deliveries, + num volume, + num autoRenewSkuStock, + String skuNameStr, + String createTime, + String createUser, + String id, + String applyPrice, + List skuAttrList, + String skuCode, + }) { + _ticketStyle = ticketStyle; + _productId = productId; + _isDelete = isDelete; + _ticketDays = ticketDays; + _setMeal = setMeal; + _updateUser = updateUser; + _skuPrice = skuPrice; + _skuStock = skuStock; + _weight = weight; + _updateTime = updateTime; + _ticketType = ticketType; + _sort = sort; + _storeId = storeId; + _version = version; + _deliveries = deliveries; + _volume = volume; + _autoRenewSkuStock = autoRenewSkuStock; + _skuNameStr = skuNameStr; + _createTime = createTime; + _createUser = createUser; + _id = id; + _applyPrice = applyPrice; + _skuAttrList = skuAttrList; + _skuCode = skuCode; + } + + ProductSkuVoList.fromJson(dynamic json) { + _ticketStyle = json['ticketStyle']; + _productId = json['productId']; + _isDelete = json['isDelete']; + _ticketDays = json['ticketDays']; + _setMeal = json['setMeal']; + _updateUser = json['updateUser']; + _skuPrice = json['skuPrice']; + _skuStock = json['skuStock']; + _weight = json['weight']; + _updateTime = json['updateTime']; + _ticketType = json['ticketType']; + _sort = json['sort']; + _storeId = json['storeId']; + _version = json['version']; + _deliveries = json['deliveries']; + _volume = json['volume']; + _autoRenewSkuStock = json['autoRenewSkuStock']; + _skuNameStr = json['skuNameStr']; + _createTime = json['createTime']; + _createUser = json['createUser']; + _id = json['id']; + _applyPrice = json['applyPrice']; + if (json['skuAttrList'] != null) { + _skuAttrList = []; + json['skuAttrList'].forEach((v) { + _skuAttrList.add(SkuAttrList.fromJson(v)); + }); + } + _skuCode = json['skuCode']; + } + + String _ticketStyle; + String _productId; + num _isDelete; + String _ticketDays; + String _setMeal; + String _updateUser; + String _skuPrice; + num _skuStock; + num _weight; + String _updateTime; + String _ticketType; + num _sort; + String _storeId; + num _version; + num _deliveries; + num _volume; + num _autoRenewSkuStock; + String _skuNameStr; + String _createTime; + String _createUser; + String _id; + String _applyPrice; + List _skuAttrList; + String _skuCode; + + ProductSkuVoList copyWith({ + String ticketStyle, + String productId, + num isDelete, + String ticketDays, + String setMeal, + String updateUser, + String skuPrice, + num skuStock, + num weight, + String updateTime, + String ticketType, + num sort, + String storeId, + num version, + num deliveries, + num volume, + num autoRenewSkuStock, + String skuNameStr, + String createTime, + String createUser, + String id, + String applyPrice, + List skuAttrList, + String skuCode, + }) => + ProductSkuVoList( + ticketStyle: ticketStyle ?? _ticketStyle, + productId: productId ?? _productId, + isDelete: isDelete ?? _isDelete, + ticketDays: ticketDays ?? _ticketDays, + setMeal: setMeal ?? _setMeal, + updateUser: updateUser ?? _updateUser, + skuPrice: skuPrice ?? _skuPrice, + skuStock: skuStock ?? _skuStock, + weight: weight ?? _weight, + updateTime: updateTime ?? _updateTime, + ticketType: ticketType ?? _ticketType, + sort: sort ?? _sort, + storeId: storeId ?? _storeId, + version: version ?? _version, + deliveries: deliveries ?? _deliveries, + volume: volume ?? _volume, + autoRenewSkuStock: autoRenewSkuStock ?? _autoRenewSkuStock, + skuNameStr: skuNameStr ?? _skuNameStr, + createTime: createTime ?? _createTime, + createUser: createUser ?? _createUser, + id: id ?? _id, + applyPrice: applyPrice ?? _applyPrice, + skuAttrList: skuAttrList ?? _skuAttrList, + skuCode: skuCode ?? _skuCode, + ); + + String get ticketStyle => _ticketStyle; + + String get productId => _productId; + + num get isDelete => _isDelete; + + String get ticketDays => _ticketDays; + + String get setMeal => _setMeal; + + String get updateUser => _updateUser; + + String get skuPrice => _skuPrice; + + num get skuStock => _skuStock; + + num get weight => _weight; + + String get updateTime => _updateTime; + + String get ticketType => _ticketType; + + num get sort => _sort; + + String get storeId => _storeId; + + num get version => _version; + + num get deliveries => _deliveries; + + num get volume => _volume; + + num get autoRenewSkuStock => _autoRenewSkuStock; + + String get skuNameStr => _skuNameStr; + + String get createTime => _createTime; + + String get createUser => _createUser; + + String get id => _id; + + String get applyPrice => _applyPrice; + + List get skuAttrList => _skuAttrList; + + String get skuCode => _skuCode; + + Map toJson() { + final map = {}; + map['ticketStyle'] = _ticketStyle; + map['productId'] = _productId; + map['isDelete'] = _isDelete; + map['ticketDays'] = _ticketDays; + map['setMeal'] = _setMeal; + map['updateUser'] = _updateUser; + map['skuPrice'] = _skuPrice; + map['skuStock'] = _skuStock; + map['weight'] = _weight; + map['updateTime'] = _updateTime; + map['ticketType'] = _ticketType; + map['sort'] = _sort; + map['storeId'] = _storeId; + map['version'] = _version; + map['deliveries'] = _deliveries; + map['volume'] = _volume; + map['autoRenewSkuStock'] = _autoRenewSkuStock; + map['skuNameStr'] = _skuNameStr; + map['createTime'] = _createTime; + map['createUser'] = _createUser; + map['id'] = _id; + map['applyPrice'] = _applyPrice; + if (_skuAttrList != null) { + map['skuAttrList'] = _skuAttrList.map((v) => v.toJson()).toList(); + } + map['skuCode'] = _skuCode; + return map; + } +} + +/// attrValueId : "1517366419723911168" +/// isDelete : 0 +/// updateUser : "1347839370706550784" +/// updateTime : "2022-04-22 12:55:20" +/// attrId : "1517366419715522560" +/// createTime : "2022-04-22 12:55:20" +/// createUser : "1347839370706550784" +/// id : "1517366419753271296" +/// skuId : "1517366419740688384" + +class SkuAttrList { + SkuAttrList({ + String attrValueId, + num isDelete, + String updateUser, + String updateTime, + String attrId, + String createTime, + String createUser, + String id, + String skuId, + }) { + _attrValueId = attrValueId; + _isDelete = isDelete; + _updateUser = updateUser; + _updateTime = updateTime; + _attrId = attrId; + _createTime = createTime; + _createUser = createUser; + _id = id; + _skuId = skuId; + } + + SkuAttrList.fromJson(dynamic json) { + _attrValueId = json['attrValueId']; + _isDelete = json['isDelete']; + _updateUser = json['updateUser']; + _updateTime = json['updateTime']; + _attrId = json['attrId']; + _createTime = json['createTime']; + _createUser = json['createUser']; + _id = json['id']; + _skuId = json['skuId']; + } + + String _attrValueId; + num _isDelete; + String _updateUser; + String _updateTime; + String _attrId; + String _createTime; + String _createUser; + String _id; + String _skuId; + + SkuAttrList copyWith({ + String attrValueId, + num isDelete, + String updateUser, + String updateTime, + String attrId, + String createTime, + String createUser, + String id, + String skuId, + }) => + SkuAttrList( + attrValueId: attrValueId ?? _attrValueId, + isDelete: isDelete ?? _isDelete, + updateUser: updateUser ?? _updateUser, + updateTime: updateTime ?? _updateTime, + attrId: attrId ?? _attrId, + createTime: createTime ?? _createTime, + createUser: createUser ?? _createUser, + id: id ?? _id, + skuId: skuId ?? _skuId, + ); + + String get attrValueId => _attrValueId; + + num get isDelete => _isDelete; + + String get updateUser => _updateUser; + + String get updateTime => _updateTime; + + String get attrId => _attrId; + + String get createTime => _createTime; + + String get createUser => _createUser; + + String get id => _id; + + String get skuId => _skuId; + + Map toJson() { + final map = {}; + map['attrValueId'] = _attrValueId; + map['isDelete'] = _isDelete; + map['updateUser'] = _updateUser; + map['updateTime'] = _updateTime; + map['attrId'] = _attrId; + map['createTime'] = _createTime; + map['createUser'] = _createUser; + map['id'] = _id; + map['skuId'] = _skuId; + return map; + } +} diff --git a/lib/retrofit/data/settleOrderInfo.dart b/lib/retrofit/data/settleOrderInfo.dart index ce04600a..24b7c920 100644 --- a/lib/retrofit/data/settleOrderInfo.dart +++ b/lib/retrofit/data/settleOrderInfo.dart @@ -19,6 +19,7 @@ class SettleOrderInfo { String promotionId; String memberCouponId; bool usePlateMoney; + bool isRaise; int selectDiscount; bool useVipPriceSelect = false; @@ -48,6 +49,7 @@ class SettleOrderInfo { settleOrderInfoBean.promotionId = map['promotionId']; settleOrderInfoBean.memberCouponId = map['memberCouponId']; settleOrderInfoBean.usePlateMoney = map['usePlateMoney']; + settleOrderInfoBean.isRaise = map['isRaise']; settleOrderInfoBean.selectDiscount = map['selectDiscount']; return settleOrderInfoBean; } @@ -70,6 +72,7 @@ class SettleOrderInfo { "promotionId": promotionId, "memberCouponId": memberCouponId, "usePlateMoney":usePlateMoney, + "isRaise":isRaise, "selectDiscount":selectDiscount }; diff --git a/lib/retrofit/data/user_info.dart b/lib/retrofit/data/user_info.dart index df218a1f..4b412eac 100644 --- a/lib/retrofit/data/user_info.dart +++ b/lib/retrofit/data/user_info.dart @@ -36,6 +36,8 @@ class UserInfo { String expendAmount; String points; String greenMoney; + String raiseMoney; + String raiseExpireTime; bool isBind; String masterId; int inviteNumber; @@ -68,6 +70,8 @@ class UserInfo { ..expendAmount = json['expendAmount'] as String ..points = json['points'] as String ..greenMoney = json['greenMoney'] as String + ..raiseMoney = json['raiseMoney'] as String + ..raiseExpireTime = json['raiseExpireTime'] as String ..isBind = json['isBind'] as bool ..masterId = json['masterId'] as String ..inviteNumber = json['inviteNumber'] as int @@ -99,6 +103,8 @@ class UserInfo { 'expendAmount': this.expendAmount, 'points': this.points, 'greenMoney': this.greenMoney, + 'raiseMoney': this.raiseMoney, + 'raiseExpireTime': this.raiseExpireTime, 'isBind': this.isBind, 'masterId': this.masterId, "inviteNumber": this.inviteNumber, diff --git a/lib/retrofit/min_api.dart b/lib/retrofit/min_api.dart index f7e60731..7e9d7012 100644 --- a/lib/retrofit/min_api.dart +++ b/lib/retrofit/min_api.dart @@ -26,7 +26,7 @@ import 'data/shopping_home_config.dart'; part 'min_api.g.dart'; -const localBaseUrl = "http://192.168.10.78:8765/app/";///本地 +const localBaseUrl = "http://192.168.10.129:8765/app/";///本地 // const localBaseUrl = "https://2946-27-19-77-115.jp.ngrok.io/app/";///本地 const serviceBaseUrl = "https://pos.api.lotus-wallet.com/app/";///线上 diff --git a/lib/retrofit/retrofit_api.dart b/lib/retrofit/retrofit_api.dart index db673ef1..e1507418 100644 --- a/lib/retrofit/retrofit_api.dart +++ b/lib/retrofit/retrofit_api.dart @@ -13,6 +13,7 @@ import 'package:huixiang/retrofit/data/article.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/comunity_comment.dart'; import 'package:huixiang/retrofit/data/coupon.dart'; +import 'package:huixiang/retrofit/data/farmers_list.dart'; import 'package:huixiang/retrofit/data/login_info.dart'; import 'package:huixiang/retrofit/data/order_info.dart'; import 'package:huixiang/view_widget/login_tips_dialog.dart'; @@ -63,7 +64,7 @@ import 'data/wx_pay.dart'; part 'retrofit_api.g.dart'; -const localBaseUrl = "http://192.168.10.78:8766/app/";///本地 +const localBaseUrl = "http://192.168.10.129:8766/app/";///本地 // const localBaseUrl = "https://2946-27-19-77-115.jp.ngrok.io/app/";///本地 const serviceBaseUrl = "https://pos.platform.lotus-wallet.com/app/";///线上 @@ -543,5 +544,7 @@ abstract class ApiService { @POST("/vipCard/orderVip") Future> orderVip(@Body() Map param); - + ///通过code获取设置/助农列表 + @GET("/raise/products") + Future>> getConfig(); } diff --git a/lib/retrofit/retrofit_api.g.dart b/lib/retrofit/retrofit_api.g.dart index 1c49aecd..40d5e1d9 100644 --- a/lib/retrofit/retrofit_api.g.dart +++ b/lib/retrofit/retrofit_api.g.dart @@ -2111,4 +2111,27 @@ class _ApiService implements ApiService { ); return value; } + + @override + Future>> getConfig() async { + const _extra = {}; + final queryParameters = {}; + final _data = {}; + final _result = await _dio.request>( + '/raise/products', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData>.fromJson( + _result.data, + (json) => (json as List) + .map( + (i) => FarmersList.fromJson(i as Map)) + .toList()); + return value; + } } diff --git a/lib/settlement/settlement.dart b/lib/settlement/settlement.dart index ad359578..7bd3cbf4 100644 --- a/lib/settlement/settlement.dart +++ b/lib/settlement/settlement.dart @@ -38,6 +38,8 @@ 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/settlement_tips_dialog.dart'; + class Settlement extends StatefulWidget { final arguments; @@ -495,6 +497,7 @@ class _Settlement extends State { this.downOrder = DownOrder.fromJson(baseData.data); querySettlement(); } else { + orderButton = false; SmartDialog.showToast(baseData?.msg, alignment: Alignment.center); } } else { @@ -529,6 +532,7 @@ class _Settlement extends State { queryOrderDetails(parentId); setState(() {}); } else { + orderButton = false; SmartDialog.showToast(baseData?.msg, alignment: Alignment.center); } } @@ -584,7 +588,7 @@ class _Settlement extends State { toOrderDetails(placeOrderFirst.id); } else { SmartDialog.show( - widget: Tips( + widget: SettlementTips( () { toOrderDetails(placeOrderFirst.id); }, @@ -642,7 +646,7 @@ class _Settlement extends State { bargainOrderId != null ? bargainOrderId : launchJoinAct.orderId); } else { SmartDialog.show( - widget: Tips( + widget: SettlementTips( () { toOrderDetails(bargainOrderId != null ? bargainOrderId @@ -788,7 +792,7 @@ class _Settlement extends State { if (placeOrder && joinA != JoinActivity.BargainBug) ///支付方式 - PayMethod(payChannelCheck,coupons,promotions,useVipPriceSelect), + PayMethod(payChannelCheck,coupons,promotions,useVipPriceSelect,settleOrderInfo), ], ), ), diff --git a/lib/settlement/settlement_view/activity_coupon_remarks.dart b/lib/settlement/settlement_view/activity_coupon_remarks.dart index 0357caf6..ebcc690a 100644 --- a/lib/settlement/settlement_view/activity_coupon_remarks.dart +++ b/lib/settlement/settlement_view/activity_coupon_remarks.dart @@ -249,8 +249,8 @@ class _ActivityCouponRemarks extends State { textAlign: TextAlign.end, style: TextStyle( fontSize: 14.sp, - color: Color(0xFFA29E9E), - fontWeight: MyFontWeight.semi_bold, + color: Color(0xFF858585), + fontWeight: MyFontWeight.medium, ), ), ), diff --git a/lib/settlement/settlement_view/pay_method.dart b/lib/settlement/settlement_view/pay_method.dart index 8877481a..692bae15 100644 --- a/lib/settlement/settlement_view/pay_method.dart +++ b/lib/settlement/settlement_view/pay_method.dart @@ -6,6 +6,8 @@ import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/utils/font_weight.dart'; import 'package:shared_preferences/shared_preferences.dart'; +import '../../retrofit/data/settleOrderInfo.dart'; +import '../../view_widget/settlement_tips_dialog.dart'; import '../../view_widget/tips_dialog.dart'; class PayMethod extends StatefulWidget { @@ -13,8 +15,9 @@ class PayMethod extends StatefulWidget { final String coupons; final String promotions; final bool useVipPriceSelect; + final SettleOrderInfo settleOrderInfo; - PayMethod(this.payChannelCheck,this.coupons,this.promotions,this.useVipPriceSelect); + PayMethod(this.payChannelCheck,this.coupons,this.promotions,this.useVipPriceSelect,this.settleOrderInfo); @override State createState() { @@ -26,17 +29,19 @@ class _PayMethod extends State { String money = "0"; String balance = "0"; String mGreenMoney = "0"; + String mRaiseMoney = "0"; @override void initState() { super.initState(); - SharedPreferences.getInstance().then((value) { Map memberInfo = jsonDecode(value.getString("minMember")); balance = memberInfo["balance"]; money = memberInfo["money"]; mGreenMoney = memberInfo["greenMoney"]; + mRaiseMoney = memberInfo["raiseMoney"]; + checkIndex = (widget?.settleOrderInfo?.isRaise ?? false) ? 5:4; setState(() {}); }); } @@ -83,6 +88,7 @@ class _PayMethod extends State { ), ), ), + if(!(widget.settleOrderInfo?.isRaise ?? false)) GestureDetector( onTap: () { setState(() { @@ -122,9 +128,11 @@ class _PayMethod extends State { ], ), ), + if(!(widget.settleOrderInfo?.isRaise ?? false)) SizedBox( height: 10, ), + if(!(widget.settleOrderInfo?.isRaise ?? false)) GestureDetector( onTap: () { setState(() { @@ -164,17 +172,18 @@ class _PayMethod extends State { ], ), ), + if(!(widget.settleOrderInfo?.isRaise ?? false)) SizedBox( height: 10, ), - if(mGreenMoney!="0.00") + if(mGreenMoney!="0.00" && !(widget.settleOrderInfo?.isRaise ?? false)) GestureDetector( onTap: () { setState(() { checkIndex = 3; if(widget.promotions != "" || widget.coupons != "" || widget.useVipPriceSelect){ SmartDialog.show( - widget: Tips( + widget: SettlementTips( () { }, text: "绿币支付不参与任何活动优惠,请重新选择支付方式", @@ -216,14 +225,68 @@ class _PayMethod extends State { ], ), ), - if(mGreenMoney!="0.00") + if(mGreenMoney!="0.00" && !(widget.settleOrderInfo?.isRaise ?? false)) SizedBox( height: 10, ), + if(mRaiseMoney!="0" && (widget.settleOrderInfo?.isRaise ?? false)) GestureDetector( onTap: () { setState(() { checkIndex = 4; + if(widget.promotions != "" || widget.coupons != "" || widget.useVipPriceSelect){ + SmartDialog.show( + widget: SettlementTips( + () { + }, + text: "助农积分不参与任何活动优惠,请重新选择支付方式", + )); + return; + } + }); + widget.payChannelCheck(7); + }, + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + checkView(4), + Expanded( + child: Container(), + flex: 1, + ), + Text( + "¥$mRaiseMoney", + style: TextStyle( + fontSize: 14.sp, + fontFamily: 'JDZhengHT', + color: Color(0xff353535), + fontWeight: MyFontWeight.medium, + ), + ), + SizedBox( + width: 10, + ), + Text( + "助农积分", + style: TextStyle( + fontSize: 14.sp, + color: Color(0xff353535), + fontWeight: MyFontWeight.semi_bold, + ), + ), + ], + ), + ), + if(mRaiseMoney!="0" && (widget.settleOrderInfo?.isRaise ?? false)) + SizedBox( + height: 10, + ), + if(!(widget.settleOrderInfo?.isRaise ?? false)) + GestureDetector( + onTap: () { + setState(() { + checkIndex = 5; widget.payChannelCheck(1); }); }, @@ -231,7 +294,7 @@ class _PayMethod extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.start, children: [ - checkView(4), + checkView(5), Spacer(), Image.asset("assets/image/icon_we_chat.webp"), Padding( @@ -253,7 +316,7 @@ class _PayMethod extends State { ); } - var checkIndex = 4; + var checkIndex = 5; Widget checkView(var index) { return Container( diff --git a/lib/store/shop_details_page.dart b/lib/store/shop_details_page.dart index 2584d5fd..d857f643 100644 --- a/lib/store/shop_details_page.dart +++ b/lib/store/shop_details_page.dart @@ -1,4 +1,5 @@ import 'package:dio/dio.dart'; +import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_html/flutter_html.dart'; @@ -19,10 +20,15 @@ import 'package:huixiang/view_widget/classic_header.dart'; import 'package:huixiang/view_widget/custom_image.dart'; import 'package:huixiang/view_widget/my_footer.dart'; import 'package:huixiang/view_widget/round_button.dart'; +import 'package:permission_handler/permission_handler.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:shared_preferences/shared_preferences.dart'; +import '../utils/flutter_utils.dart'; +import '../view_widget/border_text.dart'; +import '../view_widget/request_permission.dart'; + class ShopDetailsPage extends StatefulWidget { final Map arguments; @@ -46,6 +52,8 @@ class _ShopDetailsPage extends State { StoreInfo storeInfo; String parentCode = ""; int tableId = 0; + String tenant; + String minToken; String pName; String pid; String cName; @@ -63,26 +71,88 @@ class _ShopDetailsPage extends State { super.initState(); id = widget.arguments["id"]; storeId = widget.arguments["storeId"]; - SharedPreferences.getInstance().then((value) { - String minToken = value.getString("minToken"); - String tenant = value.getString("tenant"); - String storeId = value.getString("storeId"); - minService = MinApiService(Dio(), + // SharedPreferences.getInstance().then((value) { + // String minToken = value.getString("minToken"); + // String tenant = value.getString("tenant"); + // String storeId = value.getString("storeId"); + // minService = MinApiService(Dio(), + // context: context, + // token: minToken, + // tenant: tenant, + // storeId: storeId, + // showLoading: true); + // queryMiNiDetail(id); + // queryShopCar().then((value) { + // this.shopCarGoods = value; + // setState(() {}); + // }); + // }); + queryStoreInfo(); + buildCount(); + } + + + /// 查询店铺信息 + queryStoreInfo() async { + SharedPreferences value = await SharedPreferences.getInstance(); + if (apiService == null) + apiService = ApiService( + Dio(), + context: context, + token: value.getString("token"), + ); + BaseData baseData = + await apiService.queryStoreInfo(storeId).catchError((error) { + debugPrint(error); + }); + if (baseData != null && baseData.isSuccess) { + storeInfo = StoreInfo.fromJson(baseData.data); + activitys = storeInfo.informationVOPageVO.list + .map((e) => Activity.fromJson(e)) + .toList(); + if (mounted) { + setState(() {}); + } + minLogin(); + } + EasyLoading.dismiss(); + } + + /// 小程序登录 + minLogin() async { + apiService.minLogin(storeId).catchError((onError) { + debugPrint(onError); + }).then((baseData) { + if (baseData != null && baseData.isSuccess) { + Map minStoreInfo = baseData.data; + String minToken = minStoreInfo["token"]; + String tenant = storeInfo.tenantCode; + String storeId = storeInfo.id; + SharedPreferences.getInstance().then( + (value) => { + value.setString('minToken', minToken), + value.setString('tenant', tenant), + value.setString('storeId', storeId), + }, + ); + minService = MinApiService( + Dio(), context: context, token: minToken, tenant: tenant, storeId: storeId, - showLoading: true); - queryMiNiDetail(id); - queryShopCar().then((value) { - this.shopCarGoods = value; - setState(() {}); - }); + ); + queryMiNiDetail(id); + queryShopCar().then((value) { + this.shopCarGoods = value; + setState(() {}); + }); + EasyLoading.dismiss(); + } }); - queryStoreInfo(); - buildCount(); } + ///商品详情 queryMiNiDetail(id) async { BaseData baseData = @@ -106,34 +176,12 @@ class _ShopDetailsPage extends State { queryMiNiDetail(id); } - /// 查询店铺信息 - queryStoreInfo() async { - SharedPreferences value = await SharedPreferences.getInstance(); - if (apiService == null) - apiService = ApiService( - Dio(), - context: context, - token: value.getString("token"), - ); - BaseData baseData = await apiService.queryStoreInfo(storeId).catchError((error) { - debugPrint(error); - }); - if (baseData != null && baseData.isSuccess) { - storeInfo = StoreInfo.fromJson(baseData.data); - activitys = storeInfo.informationVOPageVO.list - .map((e) => Activity.fromJson(e)) - .toList(); - if (mounted) { - setState(() {}); - } - } - EasyLoading.dismiss(); - } - ///获取父订单(火锅订单加菜前调用) getParentInfo() async { - BaseData baseData = await minService.getParentInfo("$tableId") - .catchError((error) {debugPrint(error);}); + BaseData baseData = + await minService.getParentInfo("$tableId").catchError((error) { + debugPrint(error); + }); if (baseData != null && baseData.isSuccess) { if (baseData.data != null) { parentId = baseData.data["id"]; @@ -199,7 +247,7 @@ class _ShopDetailsPage extends State { if (parentId == null || parentId == "") { if (num == 0) { - SmartDialog.showToast("请先选择您要购买的商品!~"); + SmartDialog.showToast("请先选择您要购买的商品!~",alignment: Alignment.center); return; } } @@ -265,12 +313,11 @@ class _ShopDetailsPage extends State { ///选规格 _queryMiNiDetail(String id, int count) async { EasyLoading.show(status: S.current.zhengzaijiazai); - if(count < 0){ + if (count < 0) { shopCarGoods.shoppingCartSkuItemList.forEach((element) { - if(element.productId == id){ + if (element.productId == id) { shopCartReduce(element); - setState(() { - }); + setState(() {}); } }); return; @@ -279,6 +326,7 @@ class _ShopDetailsPage extends State { if (baseData != null && baseData.isSuccess) { showStoreSelector(baseData.data, id, count); } + EasyLoading.dismiss(); } ///选规格弹窗 @@ -288,7 +336,8 @@ class _ShopDetailsPage extends State { miNiDetail.attrList[0].attrValueList.length == 1) { _addShopCar(miNiDetail, [], counts); } else { - showSpanDialog(); + // showSpanDialog(); + selectSpecsShowBottomSheet(); } } @@ -345,8 +394,7 @@ class _ShopDetailsPage extends State { this.shopCarGoods = value; setState(() {}); }); - } - else { + } else { SmartDialog.showToast(baseDate?.msg, alignment: Alignment.center); } } @@ -359,7 +407,7 @@ class _ShopDetailsPage extends State { cName = ""; //优惠券 cid = ""; //优惠券 BaseData> baseDate = - await minService.getShoppingCart(tableId); + await minService.getShoppingCart(tableId); if (baseDate != null && baseDate.isSuccess && baseDate.data != null && @@ -392,7 +440,7 @@ class _ShopDetailsPage extends State { cartSkuItem.buyNum += 1; shopCarTemp["shoppingCartSkuItemList"] = [cartSkuItem.toJson()]; BaseData> baseDate = - await minService.shoppingCartSingle(shopCarTemp); + await minService.shoppingCartSingle(shopCarTemp); if (baseDate.isSuccess) { this.shopCarGoods = await queryShopCar(); if (shopCartKey != null) { @@ -410,15 +458,14 @@ class _ShopDetailsPage extends State { cartSkuItem.buyNum -= 1; shopCarTemp["shoppingCartSkuItemList"] = [cartSkuItem.toJson()]; BaseData> baseDate = - await minService.shoppingCartSingle(shopCarTemp); + await minService.shoppingCartSingle(shopCarTemp); if (baseDate.isSuccess) { EasyLoading.dismiss(); this.shopCarGoods = await queryShopCar(); if (shopCartKey?.currentState != null) { shopCartKey.currentState.setState(() {}); } - setState(() { - }); + setState(() {}); } return this.shopCarGoods; } @@ -426,7 +473,7 @@ class _ShopDetailsPage extends State { ///商品➕1 add(MiNiDetail miNiDetail, selectSkus) async { ProductSkuVOListBean productSku = - miNiDetail.productSkuVOList.firstWhere((element) { + miNiDetail.productSkuVOList.firstWhere((element) { return skuY(element, selectSkus); }); @@ -453,7 +500,7 @@ class _ShopDetailsPage extends State { } BaseData> baseDate = - await minService.shoppingCartSingle(shopCarTemp); + await minService.shoppingCartSingle(shopCarTemp); if (baseDate.isSuccess) { queryShopCar().then((value) { this.shopCarGoods = value; @@ -465,7 +512,7 @@ class _ShopDetailsPage extends State { ///商品➖1 reduce(MiNiDetail miNiDetail, selectSkus) async { ProductSkuVOListBean productSku = - miNiDetail.productSkuVOList.firstWhere((element) { + miNiDetail.productSkuVOList.firstWhere((element) { return skuY(element, selectSkus); }); @@ -498,7 +545,7 @@ class _ShopDetailsPage extends State { shopCarTemp["shoppingCartSkuItemList"] = [cartSkuItem.toJson()]; BaseData> baseDate = - await minService.shoppingCartSingle(shopCarTemp); + await minService.shoppingCartSingle(shopCarTemp); if (baseDate.isSuccess) { queryShopCar().then((value) { this.shopCarGoods = value; @@ -525,14 +572,16 @@ class _ShopDetailsPage extends State { productSku = miNiDetail.productSkuVOList.firstWhere((element) { return skuY(element, selectSkus); }); - }catch(ex){ + } catch (ex) { return; } if (productSku == null) return; selectedPrice = productSku.skuPrice; String skuId = productSku.id; - if (shopCarGoods == null || shopCarGoods.shoppingCartSkuItemList == null) return; - int shopSkuIndex = shopCarGoods.shoppingCartSkuItemList.indexWhere((element) => skuId == element.id); + if (shopCarGoods == null || shopCarGoods.shoppingCartSkuItemList == null) + return; + int shopSkuIndex = shopCarGoods.shoppingCartSkuItemList + .indexWhere((element) => skuId == element.id); if (shopSkuIndex >= 0) { counts = shopCarGoods.shoppingCartSkuItemList[shopSkuIndex].buyNum; } @@ -570,21 +619,26 @@ class _ShopDetailsPage extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ buildProduct(), - SizedBox(height: 16.h,), + SizedBox( + height: 16.h, + ), Container( width: double.infinity, - padding: EdgeInsets.symmetric(horizontal: 14.w,vertical: 16.h), + // padding: EdgeInsets.symmetric(horizontal: 14.w,vertical: 16.h), color: Colors.white, child: Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text( - "商品详情", - style: TextStyle( - fontSize: 15.sp, - fontWeight: MyFontWeight.semi_bold, - color: Color(0xFF000000), + Padding( + padding: EdgeInsets.only(left: 14.w,top: 16.h), + child: Text( + "商品详情", + style: TextStyle( + fontSize: 15.sp, + fontWeight: MyFontWeight.semi_bold, + color: Color(0xFF000000), + ), ), ), SizedBox( @@ -594,6 +648,16 @@ class _ShopDetailsPage extends State { color: Colors.white, child: Html( data: miNiDetail?.details ?? "", + style: { + 'body': Style( + backgroundColor: Colors.white, + padding: EdgeInsets.all(0), + margin: EdgeInsets.all(0)), + 'p': Style( + margin: EdgeInsets.all(0), + padding: EdgeInsets.all(0), + ), + }, customImageRenders: { networkSourceMatcher(): networkImageRender( loadingWidget: () { @@ -613,7 +677,7 @@ class _ShopDetailsPage extends State { ), flex: 1, ), - if(count() != 0) + if (count() != 0) Stack( alignment: Alignment.bottomLeft, children: [ @@ -629,7 +693,9 @@ class _ShopDetailsPage extends State { mainAxisAlignment: MainAxisAlignment.spaceAround, crossAxisAlignment: CrossAxisAlignment.center, children: [ - SizedBox(width:45.w,), + SizedBox( + width: 45.w, + ), Text.rich( TextSpan(children: [ TextSpan( @@ -640,8 +706,9 @@ class _ShopDetailsPage extends State { fontWeight: MyFontWeight.bold), ), TextSpan( - text: - shopCarGoods != null ? shopCarGoods.cartSum : "0.0", + text: shopCarGoods != null + ? shopCarGoods.cartSum + : "0.0", style: TextStyle( fontSize: 20.sp, color: Color(0xFFFFFFFF), @@ -674,8 +741,7 @@ class _ShopDetailsPage extends State { children: [ InkWell( onTap: () { - if(count() != 0) - showShoppingCart(); + if (count() != 0) showShoppingCart(); }, child: Image.asset( "assets/image/shopping_bag.webp", @@ -684,7 +750,7 @@ class _ShopDetailsPage extends State { fit: BoxFit.fitWidth, ), ), - if(count() != 0) + if (count() != 0) Positioned( right: 5, // top: 14, @@ -703,7 +769,9 @@ class _ShopDetailsPage extends State { ), ], ), - SizedBox(height: 30.h,) + SizedBox( + height: 30.h, + ) ], ), ), @@ -730,7 +798,7 @@ class _ShopDetailsPage extends State { swiper(), Container( padding: EdgeInsets.only( - top: 16.h, left: 14.w, right: 14.w,bottom: 16.h), + top: 16.h, left: 14.w, right: 14.w, bottom: 16.h), child: Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, @@ -764,7 +832,11 @@ class _ShopDetailsPage extends State { )), GestureDetector( onTap: () { - _queryMiNiDetail(id,counts); + if(storeInfo.posType.code == "NORMALSTORE" && tableId == 0){ + showDeleteDialog(); + }else{ + _queryMiNiDetail(id, counts); + } }, child: Container( width: 92.w, @@ -814,8 +886,6 @@ class _ShopDetailsPage extends State { ), Text( miNiDetail?.shortName ?? "", - maxLines: 3, - overflow: TextOverflow.ellipsis, style: TextStyle( fontSize: 12.sp, height: 1.5, @@ -834,7 +904,7 @@ class _ShopDetailsPage extends State { Widget swiper() { return Container( child: AspectRatio( - aspectRatio: 375/375, + aspectRatio: 375 / 375, child: Stack( children: [ Swiper( @@ -850,7 +920,7 @@ class _ShopDetailsPage extends State { ), itemBuilder: (context, position) { return MImage( - miNiDetail?.imgs != null ? miNiDetail.imgs[position]:"", + miNiDetail?.imgs != null ? miNiDetail.imgs[position] : "", fit: BoxFit.cover, radius: BorderRadius.zero, height: 375, @@ -882,224 +952,221 @@ class _ShopDetailsPage extends State { } ///选择規格弹窗 - showSpanDialog() { - showDialog( - context: context, - builder: (context) { - return StatefulBuilder(builder: ( - context, - state, - ) - { - return AlertDialog( - content: Container( - width: MediaQuery - .of(context) - .size - .width - 84, - height: 500.h, - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( + selectSpecsShowBottomSheet() { + showModalBottomSheet( + builder: (BuildContext context) { + return StatefulBuilder(builder: ( + context, + state, + ) { + return WillPopScope( + onWillPop: () async => false, + child:Container( + alignment: Alignment.topCenter, + padding: EdgeInsets.symmetric(horizontal: 14.w,vertical: 16), + height: MediaQuery.of(context).size.height / 3 * 2, + width: double.infinity, + decoration: BoxDecoration( + color: Color(0xFFFAFAFA), + borderRadius: BorderRadius.only( + topLeft: Radius.circular(8), + topRight: Radius.circular(8), + ), + ), + child: Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ - ClipRRect( - child: MImage( - miNiDetail.imgs[0], - fit: BoxFit.cover, - width: 70, - height: 70, - errorSrc: "assets/image/default_2_1.webp", - fadeSrc: "assets/image/default_2_1.webp", - ), - borderRadius: BorderRadius.circular(4), - ), - SizedBox( - width: 10.w, - ), - Expanded( - child: Container( - height: 70, - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment - .spaceBetween, - crossAxisAlignment: CrossAxisAlignment.center, + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + ClipRRect( + child: MImage( + miNiDetail.imgs[0], + fit: BoxFit.cover, + width: 70, + height: 70, + errorSrc: "assets/image/default_2_1.webp", + fadeSrc: "assets/image/default_2_1.webp", + ), + borderRadius: BorderRadius.circular(4), + ), + SizedBox( + width: 10.w, + ), + Expanded( + child: Container( + height: 70, + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + miNiDetail?.productName ?? "", + style: TextStyle( + fontSize: 13.sp, + fontWeight: FontWeight.bold, + color: Color(0xFF000000), + ), + ), + GestureDetector( + onTap: () { + Navigator.of(context).pop(); + }, + child: Image.asset( + "assets/image/cancel.webp", + fit: BoxFit.cover, + height: 24, + width: 24, + ), + ), + ], + ), Text( - miNiDetail?.productName ?? "", + "¥${miNiDetail?.price ?? ""}", style: TextStyle( - fontSize: 13.sp, + fontSize: 12.sp, fontWeight: FontWeight.bold, - color: Color(0xFF000000), - ), - ), - GestureDetector( - onTap: () { - Navigator.of(context).pop(); - }, - child: Image.asset( - "assets/image/cancel.webp", - fit: BoxFit.cover, - height: 24, - width: 24, + color: Color(0xFFF65720), ), ), ], ), - Text( - "¥${miNiDetail?.price ?? ""}", - style: TextStyle( - fontSize: 12.sp, - fontWeight: FontWeight.bold, - color: Color(0xFFF65720), - ), - ), - ], - ), - )), - ], - ), - if (miNiDetail.attrList != null && - miNiDetail.attrList.length > 0) - SizedBox( - height: 10, - ), - if (miNiDetail.attrList != null && - miNiDetail.attrList.length > 0) - Expanded( - child: ListView.builder( - itemCount: miNiDetail.attrList.length, - scrollDirection: Axis.vertical, - physics: BouncingScrollPhysics(), - padding: EdgeInsets.zero, - itemBuilder: (context, position) { - return attrItem( - (attrValue) { + )), + ], + ), + if (miNiDetail.attrList != null && + miNiDetail.attrList.length > 0) + SizedBox( + height: 10, + ), + if (miNiDetail.attrList != null && + miNiDetail.attrList.length > 0) + Expanded( + child: ListView.builder( + itemCount: miNiDetail.attrList.length, + scrollDirection: Axis.vertical, + physics: BouncingScrollPhysics(), + padding: EdgeInsets.zero, + itemBuilder: (context, position) { + return attrItem( + (attrValue) { state(() { - // if(selectSkus.length > position) - selectSkus[position] = attrValue; - buildCount(); - }); + // if(selectSkus.length > position) + selectSkus[position] = attrValue; + buildCount(); + }); + }, + miNiDetail.attrList[position], + position, + ); }, - miNiDetail.attrList[position], - position, - ); - }, - ), - ), - SizedBox( - height: 24, - ), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Text( - "数量", - style: TextStyle( - color: Color(0xFFB3B3B3), - fontSize: 12.sp, - fontWeight: MyFontWeight.regular, + ), ), + SizedBox( + height: 24, ), - SizedBox(height: 10,), - Row( + Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, children: [ - InkWell( - onTap: () { - state(() { - if (counts > 1) - setState(() { - counts -= 1; - }); - reduce(miNiDetail, selectSkus); - }); - }, - child: Icon( - Icons.remove, - color: Color(0xFF32A060), - size: 24, - ) - // Image.asset( - // "assets/image/reduce.webp", - // width: 22, - // height: 22, - // ), - ), - Padding( - padding: EdgeInsets.only(left: 8, right: 8), - child: Text( - "$counts", - style: TextStyle( - color: Colors.black, - fontSize: 14.sp, - fontWeight: MyFontWeight.medium, - ), + Text( + "数量", + style: TextStyle( + color: Color(0xFFB3B3B3), + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, ), ), - InkWell( - onTap: () { - state(() { - counts += 1; - add(miNiDetail, selectSkus); - }); - }, - child: Icon( - Icons.add, - color: Color(0xFF32A060), - size: 24, - ) + SizedBox( + height: 10, ), + Row( + children: [ + InkWell( + onTap: () { + state(() { + if (counts > 1) + setState(() { + counts -= 1; + }); + reduce(miNiDetail, selectSkus); + }); + }, + child: Icon( + Icons.remove, + color: Color(0xFF32A060), + size: 24, + ) + // Image.asset( + // "assets/image/reduce.webp", + // width: 22, + // height: 22, + // ), + ), + Padding( + padding: EdgeInsets.only(left: 8, right: 8), + child: Text( + "$counts", + style: TextStyle( + color: Colors.black, + fontSize: 14.sp, + fontWeight: MyFontWeight.medium, + ), + ), + ), + InkWell( + onTap: () { + state(() { + counts += 1; + add(miNiDetail, selectSkus); + }); + }, + child: Icon( + Icons.add, + color: Color(0xFF32A060), + size: 24, + )), + ], + ) ], - ) - ], - ), - SizedBox( - height: 24, - ), - GestureDetector( - onTap: () { - state(() { - _addShopCar(miNiDetail, selectSkus, counts); - Navigator.of(context).pop(); - }); - }, - child: Container( - width: double.infinity, - alignment: Alignment.center, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(20), - color: Color(0xFF32A060), ), - padding: EdgeInsets.symmetric(vertical: 6), - child: Text( - "加入购物车", - style: TextStyle( - fontSize: 15.sp, - fontWeight: MyFontWeight.bold, - color: Color(0xFFFFFFFF), - ), + SizedBox( + height: 24, ), - ), - ) - ], - ), - ), - ); - }); - }, - ); + RoundButton( + width: double.infinity, + height: 54.h, + text: "加入购物车", + textColor: Colors.white, + fontWeight: MyFontWeight.semi_bold, + radius: 27, + backgroup: Color(0xFF32A060), + fontSize: 16.sp, + callback: () { + state(() { + _addShopCar(miNiDetail, selectSkus, counts); + Navigator.of(context).pop(); + }); + }, + ), + ], + ), + )); + }); + }, + backgroundColor: Colors.transparent, + context: context); } Widget attrItem(Function fc, AttrListBean attrListBean, position) { - if (attrListBean.attrValueList != null && attrListBean.attrValueList.length > 0) + if (attrListBean.attrValueList != null && + attrListBean.attrValueList.length > 0) return Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -1114,7 +1181,7 @@ class _ShopDetailsPage extends State { ), ), ), - sweetnessStore(fc,attrListBean.attrValueList, position), + sweetnessStore(fc, attrListBean.attrValueList, position), // sweetnessStore(fc, attrListBean.attrValueList, position), ], ); @@ -1123,30 +1190,32 @@ class _ShopDetailsPage extends State { } } - Widget sweetnessStore(Function fc,List arrays, position){ + Widget sweetnessStore(Function fc, List arrays, position) { return Wrap( runSpacing: 10.0, spacing: 10.0, - children: arrays.take(arrays.length).map((AttrValueListBean tag) { + children: + arrays.take(arrays.length).map((AttrValueListBean tag) { return GestureDetector( onTap: () { fc(tag.attrValue); }, - child:sweetnessItem( + child: sweetnessItem( tag.attrValue, - (selectSkus.length > position && tag.attrValue == selectSkus[position]), + (selectSkus.length > position && + tag.attrValue == selectSkus[position]), )); }).toList()); } Widget sweetnessItem(String name, bool isCheck) { return Container( - padding: const EdgeInsets.symmetric(vertical:5.0,horizontal: 12.0), + padding: const EdgeInsets.symmetric(vertical: 5.0, horizontal: 12.0), decoration: BoxDecoration( color: !isCheck ? Color(0xFFF2F2F2) : Color(0xFFF0FAF4), border: Border.all( - width: !isCheck ? 0:1, - color: !isCheck ? Color(0xFFF2F2F2):Color(0xFF32A060), + width: !isCheck ? 0 : 1, + color: !isCheck ? Color(0xFFF2F2F2) : Color(0xFF32A060), style: BorderStyle.solid, ), borderRadius: const BorderRadius.all( @@ -1157,11 +1226,132 @@ class _ShopDetailsPage extends State { name, overflow: TextOverflow.ellipsis, style: TextStyle( - color:!isCheck ? Color(0xFF4D4D4D) : Color(0xFF32A060), + color: !isCheck ? Color(0xFF4D4D4D) : Color(0xFF32A060), fontSize: 14.sp, fontWeight: MyFontWeight.regular, ), )); } + ///扫码提示弹窗 + showDeleteDialog() { + showDialog( + context: context, + builder: (context) { + return AlertDialog( + content: Container( + width: MediaQuery.of(context).size.width - 84.w, + height: 130.h, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + "您即将进行扫码点餐", + style: TextStyle( + fontSize: 17.sp, + fontWeight: FontWeight.bold, + color: Colors.black, + ), + ), + SizedBox( + height: 30.h, + ), + Row( + children: [ + Expanded( + child: InkWell( + child: BorderText( + text: "取消", + textColor: Color(0xFF32A060), + fontSize: 16.sp, + fontWeight: FontWeight.bold, + borderColor: Color(0xFF32A060), + radius: 4, + padding: EdgeInsets.all(12), + borderWidth: 1, + ), + onTap: () { + Navigator.of(context).pop(); + }, + ), + flex: 1, + ), + SizedBox( + width: 16.w, + ), + Expanded( + child: InkWell( + child: RoundButton( + text: "确定", + textColor: Colors.white, + radius: 4, + padding: EdgeInsets.all(12), + backgroup: Color(0xFF32A060), + fontSize: 16.sp, + fontWeight: FontWeight.bold, + ), + onTap: () { + toScan(); + Navigator.of(context).pop(); + }, + ), + flex: 1, + ), + ], + ) + ], + ), + ), + ); + }, + ); + } + + ///扫码 + toScan() async { + if (await Permission.camera.isPermanentlyDenied) { + showCupertinoDialog( + context: context, + builder: (context) { + return RequestPermission( + "assets/image/icon_camera_permission_tips.webp", + S.of(context).ninxiangjiquanxianweikaiqi, + S.of(context).weilekaipaizhaoxuanzhetouxiang, + S.of(context).kaiqiquanxian, + (result) async { + if (result) { + await openAppSettings(); + } + }, + heightRatioWithWidth: 0.82, + ); + }); + } else if (await Permission.camera.isGranted) { + var result = await Navigator.of(context).pushNamed('/router/qr_scan'); + // String result = "http://pos.app.gznl.top/placeorder/?tableId=1315906639160672256&tenantCode=1166&shopId=1300372027722432512"; + Uri uri = Uri.parse(result); + String tableId = uri.queryParameters["tableId"]; + String tenantCode = uri.queryParameters["tenantCode"]; + String shopId = uri.queryParameters["shopId"]; + if (tableId != null && + tableId != "" && + tenantCode != null && + tenantCode != "" && + shopId != null && + shopId != "") { + Navigator.of(context).pushReplacementNamed( + '/router/store_order', + arguments: { + "id": shopId, + "tenant": tenantCode, + "storeName": "", + "tableId": int.tryParse(tableId), + }, + ); + } + } else { + await Permission.camera.request(); + } + } } diff --git a/lib/store/shopping/shopping_goods_details.dart b/lib/store/shopping/shopping_goods_details.dart index e5048f4b..970ef188 100644 --- a/lib/store/shopping/shopping_goods_details.dart +++ b/lib/store/shopping/shopping_goods_details.dart @@ -415,7 +415,7 @@ class _ShoppingGoodsDetails extends State { ///去下单结算页面 toDownOrder() async { if (count1 == 0) { - SmartDialog.showToast("请先选择您要购买的商品!~"); + SmartDialog.showToast("请先选择您要购买的商品!~",alignment: Alignment.center); return; } await Navigator.of(context).pushNamed( @@ -450,7 +450,7 @@ class _ShoppingGoodsDetails extends State { ///普通商品直接购买去下单结算页面 toGoods() async { if (count1 == 0) { - SmartDialog.showToast("请先选择您要购买的商品!~"); + SmartDialog.showToast("请先选择您要购买的商品!~",alignment: Alignment.center); return; } await Navigator.of(context).pushNamed( @@ -751,7 +751,7 @@ class _ShoppingGoodsDetails extends State { onTap: () { joinA = JoinActivity.MZBug; if (count1 == 0) { - SmartDialog.showToast("请先选择您要购买的商品!~"); + SmartDialog.showToast("请先选择您要购买的商品!~",alignment: Alignment.center); return; } toOrder(); @@ -812,7 +812,7 @@ class _ShoppingGoodsDetails extends State { onTap: () { joinA = JoinActivity.MBug; if (count1 == 0) { - SmartDialog.showToast("请先选择您要购买的商品!~"); + SmartDialog.showToast("请先选择您要购买的商品!~",alignment: Alignment.center); return; } toOrder(); @@ -885,7 +885,7 @@ class _ShoppingGoodsDetails extends State { bargainType = BargainType.BargainZBug; joinA = JoinActivity.BargainZBug; if (count1 == 0) { - SmartDialog.showToast("请先选择您要购买的商品!~"); + SmartDialog.showToast("请先选择您要购买的商品!~",alignment: Alignment.center); return; } toOrder(); @@ -947,7 +947,7 @@ class _ShoppingGoodsDetails extends State { bargainType = BargainType.BargainBug; joinA = JoinActivity.BargainBug; if (count1 == 0) { - SmartDialog.showToast("请先选择您要购买的商品!~"); + SmartDialog.showToast("请先选择您要购买的商品!~",alignment: Alignment.center); return; } toOrder(); @@ -1019,7 +1019,7 @@ class _ShoppingGoodsDetails extends State { onTap: () { joinA = JoinActivity.CollageZBug; if (count1 == 0) { - SmartDialog.showToast("请先选择您要购买的商品!~"); + SmartDialog.showToast("请先选择您要购买的商品!~",alignment: Alignment.center); return; } toOrder(); @@ -1081,7 +1081,7 @@ class _ShoppingGoodsDetails extends State { bargainType = BargainType.CollageBug; joinA = JoinActivity.CollageBug; if (count1 == 0) { - SmartDialog.showToast("请先选择您要购买的商品!~"); + SmartDialog.showToast("请先选择您要购买的商品!~",alignment: Alignment.center); return; } toOrder(); @@ -1924,7 +1924,7 @@ class _ShoppingGoodsDetails extends State { joinA = JoinActivity.GoJoin; indexP = actRecordAndJoinlDTOList.actRecord.id; if (count1 == 0) { - SmartDialog.showToast("请先选择您要购买的商品!~"); + SmartDialog.showToast("请先选择您要购买的商品!~",alignment: Alignment.center); return; } toOrder(); diff --git a/lib/store/store_order.dart b/lib/store/store_order.dart index 7e67ca65..eb9d9849 100644 --- a/lib/store/store_order.dart +++ b/lib/store/store_order.dart @@ -426,7 +426,6 @@ class _StoreOrderPage extends State ]; }, body: - ///点餐 TabBarView( physics: NeverScrollableScrollPhysics(), @@ -632,7 +631,7 @@ class _StoreOrderPage extends State if (parentId == null || parentId == "") { if (num == 0) { - SmartDialog.showToast("请先选择您要购买的商品!~"); + SmartDialog.showToast("请先选择您要购买的商品!~",alignment: Alignment.center); return; } } diff --git a/lib/store/store_view/product_sku.dart b/lib/store/store_view/product_sku.dart index ae6ce3d8..72d8ee88 100644 --- a/lib/store/store_view/product_sku.dart +++ b/lib/store/store_view/product_sku.dart @@ -179,9 +179,10 @@ class _ProductSku extends State { SmartDialog.dismiss(); }, child: Image.asset( - "assets/image/icon_order_cancel.webp", - width: 22, - height: 22, + "assets/image/cancel.webp", + fit: BoxFit.cover, + height: 24, + width: 24, ), ), ], diff --git a/lib/union/union_page.dart b/lib/union/union_page.dart index 22486e4b..37696e6e 100644 --- a/lib/union/union_page.dart +++ b/lib/union/union_page.dart @@ -172,7 +172,7 @@ class UnionPageState extends State }).then((value) { if (!value) { EasyLoading.dismiss(); - tabRefresh().refreshFailed(); + tabRefresh().refreshCompleted(); } }); } diff --git a/lib/view_widget/settlement_tips_dialog.dart b/lib/view_widget/settlement_tips_dialog.dart new file mode 100644 index 00000000..9ae173ba --- /dev/null +++ b/lib/view_widget/settlement_tips_dialog.dart @@ -0,0 +1,79 @@ +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; +import 'package:huixiang/generated/l10n.dart'; +import 'package:huixiang/utils/font_weight.dart'; + +class SettlementTips extends StatefulWidget { + final Function tips; + final String text; + SettlementTips(this.tips, {this.text}); + + @override + State createState() { + return _SettlementTips(); + } +} + +class _SettlementTips extends State { + @override + Widget build(BuildContext context) { + return Material( + type: MaterialType.transparency, + child: Center( + child: Container( + width: MediaQuery.of(context).size.width - 80.w, + height: 165.h, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8), + ), + child: Column( + children: [ + Container( + width: double.infinity, + height:109.h, + alignment: Alignment.center, + padding: EdgeInsets.all(10), + child: Text( + widget.text ?? S.of(context).querenyaoshanchudangqianpinglunma, + style: TextStyle( + fontSize: 15.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFF353535), + ), + ), + ), + Container( + color: Color(0x1A000000), + height: 1.h, + ), + Container( + height: 55.h, + child: InkWell( + onTap: () { + SmartDialog.dismiss(); + widget.tips(); + }, + child: Container( + width: double.infinity, + height: 90.h, + alignment: Alignment.center, + child: Text( + S.of(context).queren, + style: TextStyle( + fontSize: 16.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFF32A060), + ), + ), + ), + ), + ), + ], + ), + ), + ), + ); + } +} diff --git a/lib/view_widget/update_dialog.dart b/lib/view_widget/update_dialog.dart index f343d9ca..4fb563a7 100644 --- a/lib/view_widget/update_dialog.dart +++ b/lib/view_widget/update_dialog.dart @@ -10,6 +10,8 @@ import 'package:path_provider/path_provider.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:url_launcher/url_launcher.dart'; +import '../generated/l10n.dart'; + class UpdateDialog extends StatefulWidget { final String version; final AppUpdate appUpdate; @@ -105,7 +107,7 @@ class _UpdateDialog extends State { padding: EdgeInsets.symmetric(vertical: 11.h), alignment: Alignment.center, child: Text( - "立即更新", + S.of(context).lijigengxin, style: TextStyle( fontSize: 17.sp, fontWeight: MyFontWeight.semi_bold, @@ -124,7 +126,7 @@ class _UpdateDialog extends State { alignment: Alignment.center, padding: EdgeInsets.only(top: 8.h,bottom: 15.h), child: Text( - "以后再说", + S.of(context).yihouzaishuo, style: TextStyle( fontSize: 10.sp, fontWeight: MyFontWeight.regular, diff --git a/lib/vip/vip_page.dart b/lib/vip/vip_page.dart index d7b1cd7c..90a25727 100644 --- a/lib/vip/vip_page.dart +++ b/lib/vip/vip_page.dart @@ -102,6 +102,8 @@ class _VipPageState extends State with AutomaticKeepAliveClientMixin { VipGoodsDiscount(vipHome), ExclusiveCoupon(), + + SizedBox(height: 24.h,) ], ), ), diff --git a/lib/vip/vip_view/exclusive_coupon.dart b/lib/vip/vip_view/exclusive_coupon.dart index d7db39f4..0b7038c5 100644 --- a/lib/vip/vip_view/exclusive_coupon.dart +++ b/lib/vip/vip_view/exclusive_coupon.dart @@ -4,6 +4,7 @@ import 'package:huixiang/utils/font_weight.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import '../../generated/l10n.dart'; +import '../../view_widget/my_appbar.dart'; class ExclusiveCoupon extends StatefulWidget { @override @@ -301,60 +302,83 @@ class _ExclusiveCoupon extends State { Container( width: double.infinity, height:470.h, - padding: EdgeInsets.symmetric(horizontal:14.w,vertical: 16.h), + padding: EdgeInsets.only(left: 14.w,right: 14.w,bottom: 16.h), decoration: new BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(8), ), - child: SingleChildScrollView( - physics: BouncingScrollPhysics(), - child: Container( - child:Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( + child: Scaffold( + appBar: MyAppBar( + title:"", + titleColor: Colors.black, + titleSize: 10.sp, + background: Colors.white, + leadingColor: Colors.white, + actions: [ + GestureDetector( + onTap: () { + Navigator.of(context).pop(); + }, + child: Icon( + Icons.clear, + color: Colors.black, + ), + ) + ], + ), + body: Container( + color: Colors.white, + child: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Container( + child:Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Spacer(), - GestureDetector( - onTap: () { - Navigator.of(context).pop(); - }, - child: Icon( - Icons.clear, + // Row( + // children: [ + // Spacer(), + // GestureDetector( + // onTap: () { + // Navigator.of(context).pop(); + // }, + // child: Icon( + // Icons.clear, + // color: Colors.black, + // ), + // ) + // ], + // ), + SizedBox(height: 10.h,), + Text( + "VIP会员专享优惠券:" + "\n ①海峡姐妹饮品券" + "\n *用户开通回乡VIP卡,可享全单饮品6折优惠。" + "\n *适用饮品:门店现制奶茶类饮品及现制咖啡类饮品。" + "\n *适用门店:海峡姐妹茶汉街店、前进麦味*海峡姐妹茶哈乐城店" + "\n ②前进麦味烘焙券" + "\n *用户开通回乡VIP卡,可享全单面包7折优惠。" + "\n *适用产品:门店现制面包类产品及甜品类产品。" + "\n *适用门店:前进麦味凯德1818店、前进麦味*海峡姐妹茶哈乐城店" + "\n ③回乡农场火锅券" + "\n *用户开通回乡VIP卡,可享全单菜品(小料、酒水、饮品不参与)8折优惠。" + "\n *适用产品:门店现制菜品" + "\n *适用门店:回乡农场火锅汉街店" + "\n ④百年川椒火锅券" + "\n *用户开通回乡VIP卡,可享全单菜品(小料、酒水、饮品不参与)8折优惠。" + "\n *适用产品:门店现制菜品" + "\n *适用门店:百年川椒重庆老火锅光谷店", + style: TextStyle( + fontWeight: MyFontWeight.medium, + fontSize: 14.sp, + height: 1.7.h, color: Colors.black, ), - ) + ), + SizedBox(height: 15.h,) ], ), - SizedBox(height: 10.h,), - Text( - "VIP会员专享优惠券:" - "\n ①海峡姐妹饮品券" - "\n *用户开通回乡VIP卡,可享以面价6折优惠购买部分现制饮品的会员权益。" - "\n *适用饮品:门店现制奶茶类饮品及现制咖啡类饮品。" - "\n *适用门店:海峡姐妹茶汉街店" - "\n ②前进麦味烘焙券" - "\n *用户开通回乡VIP卡,可享以面价7折优惠购买部分现制面包的会员权益。" - "\n *适用产品:门店现制面包类产品及甜品类产品。" - "\n *适用门店:前进麦味凯德1818店、前进麦味哈乐城店" - "\n ③回乡农场火锅券" - "\n *用户开通回乡VIP卡,可享以面价8折优惠购买部分火锅菜品的会员权益。" - "\n *适用产品:门店现制菜品" - "\n *适用门店:回乡农场火锅汉街店" - "\n ④百年川椒火锅券" - "\n *用户开通回乡VIP卡,可享以面价8折优惠购买部分火锅菜品的会员权益。" - "\n *适用产品:门店现制菜品" - "\n *适用门店:百年川椒重庆老火锅光谷店", - style: TextStyle( - fontWeight: MyFontWeight.medium, - fontSize: 14.sp, - height: 1.7.h, - color: Colors.black, - ), - ), - SizedBox(height: 15.h,) - ], + ), ), ), ), diff --git a/lib/vip/vip_view/vip_goods_discount.dart b/lib/vip/vip_view/vip_goods_discount.dart index f775d5a1..9d7cf19e 100644 --- a/lib/vip/vip_view/vip_goods_discount.dart +++ b/lib/vip/vip_view/vip_goods_discount.dart @@ -193,8 +193,8 @@ class _VipGoodsDiscount extends State { Widget vipGoodsRecommendItem(ProductVips productVips) { return Container( - width: 130.w, - // margin: EdgeInsets.only(right:13.w,left:6.w), + width: 116.w, + margin: EdgeInsets.only(right:4.w,left:3.w), child: Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, diff --git a/pubspec.yaml b/pubspec.yaml index f099b387..386d551b 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.1.7+35 +version: 3.1.8+36 environment: sdk: ">=2.7.0 <3.0.0" @@ -126,6 +126,10 @@ flutter: - asset: assets/fonts/JDZhengHT-Light.ttf - asset: assets/fonts/JDZhengHT-Regular.ttf + - family: APPHT + fonts: + - asset: assets/fonts/APPHT.ttf + uses-material-design: true