diff --git a/assets/image/2x/discount.webp b/assets/image/2x/discount.webp index 00aa8f7e..550ed87d 100644 Binary files a/assets/image/2x/discount.webp and b/assets/image/2x/discount.webp differ diff --git a/assets/image/2x/fa_bu.webp b/assets/image/2x/fa_bu.webp index b084a8a3..33cc54a3 100644 Binary files a/assets/image/2x/fa_bu.webp and b/assets/image/2x/fa_bu.webp differ diff --git a/assets/image/2x/hot_list.webp b/assets/image/2x/hot_list.webp new file mode 100644 index 00000000..33c828df Binary files /dev/null and b/assets/image/2x/hot_list.webp differ diff --git a/assets/image/2x/icon_mine_records_of_consumption.webp b/assets/image/2x/icon_mine_records_of_consumption.webp new file mode 100644 index 00000000..3715856b Binary files /dev/null and b/assets/image/2x/icon_mine_records_of_consumption.webp differ diff --git a/assets/image/2x/jifen.webp b/assets/image/2x/jifen.webp index 60aea05e..99c4d48c 100644 Binary files a/assets/image/2x/jifen.webp and b/assets/image/2x/jifen.webp differ diff --git a/assets/image/2x/ming_xi.webp b/assets/image/2x/ming_xi.webp new file mode 100644 index 00000000..ef280e4c Binary files /dev/null and b/assets/image/2x/ming_xi.webp differ diff --git a/assets/image/2x/welfare_zx.webp b/assets/image/2x/welfare_zx.webp index 41d6d4ce..17a7d239 100644 Binary files a/assets/image/2x/welfare_zx.webp and b/assets/image/2x/welfare_zx.webp differ diff --git a/assets/image/3x/discount.webp b/assets/image/3x/discount.webp index 16719e2d..8507bbf7 100644 Binary files a/assets/image/3x/discount.webp and b/assets/image/3x/discount.webp differ diff --git a/assets/image/3x/fa_bu.webp b/assets/image/3x/fa_bu.webp index 5bb2f9f6..b24c87ae 100644 Binary files a/assets/image/3x/fa_bu.webp and b/assets/image/3x/fa_bu.webp differ diff --git a/assets/image/3x/hot_list.webp b/assets/image/3x/hot_list.webp new file mode 100644 index 00000000..63a767ff Binary files /dev/null and b/assets/image/3x/hot_list.webp differ diff --git a/assets/image/3x/icon_mine_records_of_consumption.webp b/assets/image/3x/icon_mine_records_of_consumption.webp new file mode 100644 index 00000000..b695f95a Binary files /dev/null and b/assets/image/3x/icon_mine_records_of_consumption.webp differ diff --git a/assets/image/3x/jifen.webp b/assets/image/3x/jifen.webp index bab5f98e..19ec0b82 100644 Binary files a/assets/image/3x/jifen.webp and b/assets/image/3x/jifen.webp differ diff --git a/assets/image/3x/ming_xi.webp b/assets/image/3x/ming_xi.webp new file mode 100644 index 00000000..40b7d8f5 Binary files /dev/null and b/assets/image/3x/ming_xi.webp differ diff --git a/assets/image/3x/welfare_zx.webp b/assets/image/3x/welfare_zx.webp index 6ce35e18..a18b2fcd 100644 Binary files a/assets/image/3x/welfare_zx.webp and b/assets/image/3x/welfare_zx.webp differ diff --git a/assets/image/discount.webp b/assets/image/discount.webp index 333e19ed..60ea5563 100644 Binary files a/assets/image/discount.webp and b/assets/image/discount.webp differ diff --git a/assets/image/fa_bu.webp b/assets/image/fa_bu.webp index f1102978..0cb83711 100644 Binary files a/assets/image/fa_bu.webp and b/assets/image/fa_bu.webp differ diff --git a/assets/image/hot_list.webp b/assets/image/hot_list.webp new file mode 100644 index 00000000..7ed657e2 Binary files /dev/null and b/assets/image/hot_list.webp differ diff --git a/assets/image/icon_mine_records_of_consumption.webp b/assets/image/icon_mine_records_of_consumption.webp new file mode 100644 index 00000000..da294b25 Binary files /dev/null and b/assets/image/icon_mine_records_of_consumption.webp differ diff --git a/assets/image/jifen.webp b/assets/image/jifen.webp index a8bea80c..ae281b1f 100644 Binary files a/assets/image/jifen.webp and b/assets/image/jifen.webp differ diff --git a/assets/image/ming_xi.webp b/assets/image/ming_xi.webp new file mode 100644 index 00000000..1e7557ca Binary files /dev/null and b/assets/image/ming_xi.webp differ diff --git a/assets/image/welfare_zx.webp b/assets/image/welfare_zx.webp index 35d82651..c5131bbb 100644 Binary files a/assets/image/welfare_zx.webp and b/assets/image/welfare_zx.webp differ diff --git a/lib/generated/intl/messages_en.dart b/lib/generated/intl/messages_en.dart index 83a3d946..b4a94f76 100644 --- a/lib/generated/intl/messages_en.dart +++ b/lib/generated/intl/messages_en.dart @@ -218,8 +218,8 @@ class MessageLookup extends MessageLookupByLibrary { "fapiaozhushou" : MessageLookupByLibrary.simpleMessage("发票助手"), "fasong" : MessageLookupByLibrary.simpleMessage("发送"), "faxingshijian" : m4, - "feishiwuduihuanma" : MessageLookupByLibrary.simpleMessage("非实物兑换吗"), - "feishiwushangpin" : MessageLookupByLibrary.simpleMessage("非实物商品兑换后领取到卡包即可使用!"), + "feishiwuduihuanma" : MessageLookupByLibrary.simpleMessage("非实物兑换码"), + "feishiwushangpin" : MessageLookupByLibrary.simpleMessage("非实物商品兑换后领取到优惠券即可使用!"), "fensi" : MessageLookupByLibrary.simpleMessage("粉丝"), "fenxiang" : MessageLookupByLibrary.simpleMessage("分享"), "fenxiangdao" : MessageLookupByLibrary.simpleMessage("分享到"), diff --git a/lib/generated/intl/messages_zh_CN.dart b/lib/generated/intl/messages_zh_CN.dart index 8b7dad03..3eac4b60 100644 --- a/lib/generated/intl/messages_zh_CN.dart +++ b/lib/generated/intl/messages_zh_CN.dart @@ -218,8 +218,8 @@ class MessageLookup extends MessageLookupByLibrary { "fapiaozhushou" : MessageLookupByLibrary.simpleMessage("发票助手"), "fasong" : MessageLookupByLibrary.simpleMessage("发送"), "faxingshijian" : m4, - "feishiwuduihuanma" : MessageLookupByLibrary.simpleMessage("非实物兑换吗"), - "feishiwushangpin" : MessageLookupByLibrary.simpleMessage("非实物商品兑换后领取到卡包即可使用!"), + "feishiwuduihuanma" : MessageLookupByLibrary.simpleMessage("非实物兑换码"), + "feishiwushangpin" : MessageLookupByLibrary.simpleMessage("非实物商品兑换后领取到优惠券即可使用!"), "fensi" : MessageLookupByLibrary.simpleMessage("粉丝"), "fenxiang" : MessageLookupByLibrary.simpleMessage("分享"), "fenxiangdao" : MessageLookupByLibrary.simpleMessage("分享到"), diff --git a/lib/generated/intl/messages_zh_Hans_CN.dart b/lib/generated/intl/messages_zh_Hans_CN.dart index a4059ff4..d428be63 100644 --- a/lib/generated/intl/messages_zh_Hans_CN.dart +++ b/lib/generated/intl/messages_zh_Hans_CN.dart @@ -218,8 +218,8 @@ class MessageLookup extends MessageLookupByLibrary { "fapiaozhushou" : MessageLookupByLibrary.simpleMessage("发票助手"), "fasong" : MessageLookupByLibrary.simpleMessage("发送"), "faxingshijian" : m4, - "feishiwuduihuanma" : MessageLookupByLibrary.simpleMessage("非实物兑换吗"), - "feishiwushangpin" : MessageLookupByLibrary.simpleMessage("非实物商品兑换后领取到卡包即可使用!"), + "feishiwuduihuanma" : MessageLookupByLibrary.simpleMessage("非实物兑换码"), + "feishiwushangpin" : MessageLookupByLibrary.simpleMessage("非实物商品兑换后领取到优惠券即可使用!"), "fensi" : MessageLookupByLibrary.simpleMessage("粉丝"), "fenxiang" : MessageLookupByLibrary.simpleMessage("分享"), "fenxiangdao" : MessageLookupByLibrary.simpleMessage("分享到"), diff --git a/lib/generated/intl/messages_zh_Hant_CN.dart b/lib/generated/intl/messages_zh_Hant_CN.dart index 33977745..602bb2a4 100644 --- a/lib/generated/intl/messages_zh_Hant_CN.dart +++ b/lib/generated/intl/messages_zh_Hant_CN.dart @@ -217,7 +217,7 @@ class MessageLookup extends MessageLookupByLibrary { "fasong" : MessageLookupByLibrary.simpleMessage("發送"), "faxingshijian" : m4, "feishiwuduihuanma" : MessageLookupByLibrary.simpleMessage("非實物兌換碼"), - "feishiwushangpin" : MessageLookupByLibrary.simpleMessage("非實物商品!"), + "feishiwushangpin" : MessageLookupByLibrary.simpleMessage("非實物商品兌換後領取到優惠券即可使用!"), "fensi" : MessageLookupByLibrary.simpleMessage("粉絲"), "fenxiang" : MessageLookupByLibrary.simpleMessage("分享"), "fenxiangdao" : MessageLookupByLibrary.simpleMessage("分享到"), diff --git a/lib/generated/intl/messages_zh_TW.dart b/lib/generated/intl/messages_zh_TW.dart index 825c0ccc..786248a3 100644 --- a/lib/generated/intl/messages_zh_TW.dart +++ b/lib/generated/intl/messages_zh_TW.dart @@ -219,7 +219,7 @@ class MessageLookup extends MessageLookupByLibrary { "fasong" : MessageLookupByLibrary.simpleMessage("發送"), "faxingshijian" : m4, "feishiwuduihuanma" : MessageLookupByLibrary.simpleMessage("非實物兌換碼"), - "feishiwushangpin" : MessageLookupByLibrary.simpleMessage("非實物商品!"), + "feishiwushangpin" : MessageLookupByLibrary.simpleMessage("非實物商品兌換後領取到優惠券即可使用!"), "fensi" : MessageLookupByLibrary.simpleMessage("粉絲"), "fenxiang" : MessageLookupByLibrary.simpleMessage("分享"), "fenxiangdao" : MessageLookupByLibrary.simpleMessage("分享到"), diff --git a/lib/generated/l10n.dart b/lib/generated/l10n.dart index f646d904..9c9b0efd 100644 --- a/lib/generated/l10n.dart +++ b/lib/generated/l10n.dart @@ -1055,10 +1055,10 @@ class S { ); } - /// `非实物兑换吗` + /// `非实物兑换码` String get feishiwuduihuanma { return Intl.message( - '非实物兑换吗', + '非实物兑换码', name: 'feishiwuduihuanma', desc: '', args: [], @@ -2405,10 +2405,10 @@ class S { ); } - /// `非实物商品兑换后领取到卡包即可使用!` + /// `非实物商品兑换后领取到优惠券即可使用!` String get feishiwushangpin { return Intl.message( - '非实物商品兑换后领取到卡包即可使用!', + '非实物商品兑换后领取到优惠券即可使用!', name: 'feishiwushangpin', desc: '', args: [], diff --git a/lib/home/home_page.dart b/lib/home/home_page.dart index 69731b8d..13aae57c 100644 --- a/lib/home/home_page.dart +++ b/lib/home/home_page.dart @@ -70,9 +70,8 @@ class HomePageState extends State with AutomaticKeepAliveClientMixin { setState(() {}); } }); - queryMsgStats(); queryActivity(); - queryCoupon(); + _onRefresh(); if ((widget.invite ?? "") != "" || widget.interviewCouponList != null && @@ -126,6 +125,7 @@ class HomePageState extends State with AutomaticKeepAliveClientMixin { String categoryId; int pageNum = 1; + int couponPageNum = 1; bool showInvite = false; bool showNew = false; @@ -285,11 +285,11 @@ class HomePageState extends State with AutomaticKeepAliveClientMixin { } BaseData> baseData = await apiService.stats().catchError((onError) {}); if (baseData != null && baseData.isSuccess) { - setState(() { + // setState(() { totalMsg = 0; baseData.data.forEach((element) { totalMsg += element.number; - }); + // }); }); } EasyLoading.dismiss(); @@ -344,7 +344,7 @@ class HomePageState extends State with AutomaticKeepAliveClientMixin { } BaseData> baseData = await apiService.queryCoupon({ "centre": true, - "pageNum": pageNum, + "pageNum": couponPageNum, "pageSize": 10, "searchKey": "", "state": 0 @@ -352,7 +352,7 @@ class HomePageState extends State with AutomaticKeepAliveClientMixin { refreshController.refreshFailed(); refreshController.loadFailed(); }); - if (pageNum == 1) coupons.clear(); + if (couponPageNum == 1) coupons.clear(); if (baseData != null && baseData.isSuccess) { coupons.addAll(baseData.data.list); refreshController.refreshCompleted(); @@ -360,10 +360,11 @@ class HomePageState extends State with AutomaticKeepAliveClientMixin { if (baseData.data.pageNum == baseData.data.pages) { refreshController.loadNoData(); } else { - pageNum += 1; + couponPageNum += 1; } setState(() {}); - } else { + } + else { refreshController.refreshFailed(); refreshController.loadFailed(); } @@ -371,7 +372,7 @@ class HomePageState extends State with AutomaticKeepAliveClientMixin { _onRefresh(){ queryHome(); - queryMsgStats(); + // queryMsgStats(); queryCoupon(); } @@ -569,12 +570,12 @@ class HomePageState extends State with AutomaticKeepAliveClientMixin { Widget spread(){ return Container( width: double.infinity, - height: 100.h, + height: 80.h, margin: EdgeInsets.symmetric(horizontal: 14.w), child: GestureDetector( onTap: (){ - // Navigator.of(context).pushNamed('/router/invite_friends'); - Navigator.of(context).pushNamed('/router/mine_greenery'); + Navigator.of(context).pushNamed('/router/invite_friends'); + // Navigator.of(context).pushNamed('/router/mine_greenery'); }, child: ClipRRect( child:Image.asset( diff --git a/lib/home/home_view/discount_zone.dart b/lib/home/home_view/discount_zone.dart index 9e3c5995..0778d1b2 100644 --- a/lib/home/home_view/discount_zone.dart +++ b/lib/home/home_view/discount_zone.dart @@ -50,7 +50,7 @@ class _DiscountZone extends State { )), if(widget.coupon.length != 0) Container( - height: 91, + height: 100, margin: EdgeInsets.only(top: 10), child: ListView.builder( scrollDirection: Axis.horizontal, @@ -74,55 +74,39 @@ class _DiscountZone extends State { Widget discountItem(Coupon coupon) { return Container( - width: 300.w, - height: 91.h, + width: 270.w, + height: 100.h, decoration: BoxDecoration( image: DecorationImage( - fit: BoxFit.cover, + fit: BoxFit.fill, image: AssetImage("assets/image/discount.webp"), ), ), margin: EdgeInsets.only(right: 6.w), child: Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, children: [ - Expanded( - flex: 1, - child:Container( - margin: EdgeInsets.only(top: 12,bottom: 12), - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Expanded(child: Container( - child:discountWidget(coupon), - )), - ], - ), - )), Expanded( flex: 2, child: Container( - margin: EdgeInsets.only(top: 12,left:35,bottom: 12), + margin: EdgeInsets.only(top: 12,bottom: 12,left: 20,right: 27), child: Column( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.start, children: [ - Expanded(child: Text( - coupon != null ? coupon.couponName ?? "" : "", - maxLines: 1, + (coupon != null ? coupon.couponName ?? "" : ""), + maxLines: 2, overflow: TextOverflow.ellipsis, style: TextStyle( fontSize: 14.sp, + height: 1.5, fontWeight: MyFontWeight.semi_bold, - color: Color(0xFF0D0D0D), + color: Color(0xFFFFA607), ), - ),), - Spacer(), + ), SizedBox(height:5), - Expanded(child: (coupon.useStartTime == null && coupon.useEndTime == null)? Text( @@ -132,7 +116,7 @@ class _DiscountZone extends State { style: TextStyle( fontSize: 12.sp, fontWeight: MyFontWeight.regular, - color: Color(0xFF4D4D4D), + color: Color(0xFFFFA607), ), ):Text( "有效期至 ${coupon.useEndTime.substring(0, coupon.useEndTime.indexOf(" "))}", @@ -141,12 +125,26 @@ class _DiscountZone extends State { style: TextStyle( fontSize: 12.sp, fontWeight: MyFontWeight.regular, - color: Color(0xFF4D4D4D), + color: Color(0xFFFFA607), ), - )), + ), ], ), )), + Expanded( + flex: 1, + child:Container( + margin: EdgeInsets.only(top: 12,bottom: 12), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Expanded(child: Container( + child:discountWidget(coupon), + )), + ], + ), + )), ], ) ); @@ -168,7 +166,7 @@ class _DiscountZone extends State { style: TextStyle( fontSize: 12.sp, fontWeight: MyFontWeight.medium, - color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xff32A060), + color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xFFFFFFFF), ), ), SizedBox( @@ -182,8 +180,8 @@ class _DiscountZone extends State { : "", style: TextStyle( fontSize: 30.sp, - fontWeight: MyFontWeight.semi_bold, - color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xff32A060), + fontWeight: FontWeight.w900, + color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xFFFFFFFF), ), ), ], @@ -196,7 +194,7 @@ class _DiscountZone extends State { style: TextStyle( fontSize: 12.sp, fontWeight: MyFontWeight.semi_bold, - color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xff32A060), + color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xFFFFFFFF), ), ), ], @@ -213,7 +211,7 @@ class _DiscountZone extends State { style: TextStyle( fontSize: 26.sp, fontWeight: MyFontWeight.semi_bold, - color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xff32A060), + color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xFFFFFFFF), ), ), ), @@ -222,7 +220,7 @@ class _DiscountZone extends State { style: TextStyle( fontSize: 12.sp, fontWeight: MyFontWeight.semi_bold, - color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xff32A060), + color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xFFFFFFFF), ), ), ], @@ -239,7 +237,7 @@ class _DiscountZone extends State { style: TextStyle( fontSize: 26.sp, fontWeight: MyFontWeight.semi_bold, - color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xff32A060), + color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xFFFFFFFF), ), ), ), @@ -248,12 +246,47 @@ class _DiscountZone extends State { style: TextStyle( fontSize: 12.sp, fontWeight: MyFontWeight.semi_bold, - color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xff32A060), + color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xFFFFFFFF), ), ), ], ); - } else { + } else if (coupon.bizType == 6) { + return Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.baseline, + textBaseline: TextBaseline.alphabetic, + children: [ + Text( + "¥", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.medium, + color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xFFFFFFFF), + ), + ), + SizedBox( + height: 4.h, + ), + Text( + coupon != null + ? double.tryParse("${coupon.limitAmount}" ?? "0").toStringAsFixed(2) + : "", + style: TextStyle( + fontSize: 28.sp, + fontWeight: FontWeight.w900, + color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xFFFFFFFF), + ), + ), + ], + ), + ], + ); + }else{ return Column( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, @@ -271,7 +304,7 @@ class _DiscountZone extends State { style: TextStyle( fontSize: 30.sp, fontWeight: MyFontWeight.semi_bold, - color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xff32A060), + color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xFFFFFFFF), ), ), SizedBox( @@ -282,7 +315,7 @@ class _DiscountZone extends State { style: TextStyle( fontSize: 14.sp, fontWeight: MyFontWeight.semi_bold, - color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xff32A060), + color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xFFFFFFFF), ), ), ], diff --git a/lib/home/home_view/home_banner.dart b/lib/home/home_view/home_banner.dart index edae5219..d3270268 100644 --- a/lib/home/home_view/home_banner.dart +++ b/lib/home/home_view/home_banner.dart @@ -23,7 +23,7 @@ class _HomeBanner extends State { Widget build(BuildContext context) { return Container( child: AspectRatio( - aspectRatio: 1.4, + aspectRatio: 375/230, child: Swiper( pagination: SwiperPagination( margin: EdgeInsets.only(bottom: 12.h), diff --git a/lib/home/home_view/shortcut_operation.dart b/lib/home/home_view/shortcut_operation.dart index 7030beb5..0b802f2d 100644 --- a/lib/home/home_view/shortcut_operation.dart +++ b/lib/home/home_view/shortcut_operation.dart @@ -151,8 +151,8 @@ class _ShortcutOperation extends State { ), ), Expanded(child: GestureDetector( onTap: (){ - Navigator.of(context).pushNamed('/router/roll_center_page'); - // Navigator.of(context).pushNamed('/router/welfare_page'); + // Navigator.of(context).pushNamed('/router/roll_center_page'); + Navigator.of(context).pushNamed('/router/welfare_page'); }, child:Container( width: double.infinity, diff --git a/lib/home/home_view/top_selling_list.dart b/lib/home/home_view/top_selling_list.dart index 48901b1c..5790ccc9 100644 --- a/lib/home/home_view/top_selling_list.dart +++ b/lib/home/home_view/top_selling_list.dart @@ -33,7 +33,10 @@ class _TopSellingList extends State { width: double.infinity, decoration: BoxDecoration( borderRadius: BorderRadius.circular(6), - color: Colors.blueGrey, + image: DecorationImage( + fit: BoxFit.fill, + image: AssetImage("assets/image/hot_list.webp"), + ), ), margin: EdgeInsets.only(left: 14.w,right: 14.w,top: 12.h,bottom: 23.h), padding: EdgeInsets.only(left: 12.w,top: 16.h), diff --git a/lib/home/home_view/welfare_core.dart b/lib/home/home_view/welfare_core.dart index a62b3b6c..35a937ad 100644 --- a/lib/home/home_view/welfare_core.dart +++ b/lib/home/home_view/welfare_core.dart @@ -65,106 +65,121 @@ class _WelfareCore extends State { mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ - Expanded(child: Container( - width: double.infinity, - height:60.h, - padding: EdgeInsets.only(left: 12.w), - decoration: BoxDecoration( - image: DecorationImage( - fit: BoxFit.fill, - image: AssetImage("assets/image/welfare1.webp"), + Expanded(child: GestureDetector( + onTap: (){ + Navigator.of(context).pushNamed('/router/welfare_page'); + }, + child:Container( + width: double.infinity, + height:60.h, + padding: EdgeInsets.only(left: 12.w), + decoration: BoxDecoration( + image: DecorationImage( + fit: BoxFit.fill, + image: AssetImage("assets/image/welfare1.webp"), + ), ), - ), - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - "本周劵包", - style: TextStyle( - fontSize: 14.sp, - fontWeight: MyFontWeight.regular, - color: Color(0xFFFFFFFF), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "本周劵包", + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFFFFFFFF), + ), ), - ), - SizedBox(height: 2.h), - Text( - "每周三更新劵包", - style: TextStyle( - fontSize: 10.sp, - fontWeight: MyFontWeight.regular, - color: Color(0xFFFFFFFF), + SizedBox(height: 2.h), + Text( + "每周三更新劵包", + style: TextStyle( + fontSize: 10.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFFFFFFFF), + ), ), - ), - ], + ], + ), ), )), - Expanded(child: Container( - width: double.infinity, - height:60.h, - padding: EdgeInsets.only(left: 12.w), - decoration: BoxDecoration( - image: DecorationImage( - fit: BoxFit.fill, - image: AssetImage("assets/image/welfare2.webp"), + Expanded(child: GestureDetector( + onTap: (){ + Navigator.of(context).pushNamed('/router/welfare_page'); + }, + child:Container( + width: double.infinity, + height:60.h, + padding: EdgeInsets.only(left: 12.w), + decoration: BoxDecoration( + image: DecorationImage( + fit: BoxFit.fill, + image: AssetImage("assets/image/welfare2.webp"), + ), ), - ), - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - "邀请好友", - style: TextStyle( - fontSize: 14.sp, - fontWeight: MyFontWeight.regular, - color: Color(0xFFFFFFFF), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "邀请好友", + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFFFFFFFF), + ), ), - ), - SizedBox(height: 2.h), - Text( - "邀请好友得分", - style: TextStyle( - fontSize: 10.sp, - fontWeight: MyFontWeight.regular, - color: Color(0xFFFFFFFF), + SizedBox(height: 2.h), + Text( + "邀请好友得分", + style: TextStyle( + fontSize: 10.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFFFFFFFF), + ), ), - ), - ], - ), - )), - Expanded(child: Container( - width: double.infinity, - height:60.h, - padding: EdgeInsets.only(left: 12.w), - decoration: BoxDecoration( - image: DecorationImage( - fit: BoxFit.fill, - image: AssetImage("assets/image/welfare3.webp"), + ], ), ), - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - "做任务得券", - style: TextStyle( - fontSize: 14.sp, - fontWeight: MyFontWeight.regular, - color: Color(0xFFFFFFFF), - ), + ),), + Expanded(child: GestureDetector( + onTap: (){ + Navigator.of(context).pushNamed('/router/welfare_page'); + }, + child:Container( + width: double.infinity, + height:60.h, + padding: EdgeInsets.only(left: 12.w), + decoration: BoxDecoration( + image: DecorationImage( + fit: BoxFit.fill, + image: AssetImage("assets/image/welfare3.webp"), ), - SizedBox(height: 2.h), - Text( - "多种优惠券等你拿", - style: TextStyle( - fontSize: 10.sp, - fontWeight: MyFontWeight.regular, - color: Color(0xFFFFFFFF), + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "积分换券", + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFFFFFFFF), + ), ), - ), - ], + SizedBox(height: 2.h), + Text( + "多种优惠券等你拿", + style: TextStyle( + fontSize: 10.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFFFFFFFF), + ), + ), + ], + ), ), )), ], diff --git a/lib/home/points_mall_view/points_goods_title.dart b/lib/home/points_mall_view/points_goods_title.dart index 67afb668..22009eba 100644 --- a/lib/home/points_mall_view/points_goods_title.dart +++ b/lib/home/points_mall_view/points_goods_title.dart @@ -42,32 +42,32 @@ class _PointsGoodsTitle extends State { mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ - // ItemTitle( - // text: S.of(context).jifenshangcheng, - // imgPath: "assets/image/icon_points_mall.webp", - // ), // ItemTitle( // text: S.of(context).jifenshangcheng, // imgPath: "assets/image/icon_points_mall.webp", - // moreText: _itemText, - // moreType: 1, - // items: sortString - // .map( - // (e) => DropdownMenuItem( - // value: e, - // child: Text( - // e, - // style: TextStyle( - // fontSize: 12.sp, - // fontWeight: MyFontWeight.medium, - // color: Color(0xff353535), - // ), - // ), - // ), - // ) - // .toList(), - // onChanged: _sortChange, // ), + ItemTitle( + text: S.of(context).jifenshangcheng, + imgPath: "assets/image/icon_points_mall.webp", + moreText: _itemText, + moreType: 1, + items: sortString + .map( + (e) => DropdownMenuItem( + value: e, + child: Text( + e, + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xff353535), + ), + ), + ), + ) + .toList(), + onChanged: _sortChange, + ), Container( alignment: Alignment.centerLeft, child: DefaultTabController( diff --git a/lib/home/points_mall_view/points_goods_view.dart b/lib/home/points_mall_view/points_goods_view.dart index f9f6fc4d..2095b564 100644 --- a/lib/home/points_mall_view/points_goods_view.dart +++ b/lib/home/points_mall_view/points_goods_view.dart @@ -19,6 +19,18 @@ class PointGoods extends StatefulWidget { } class _PointGoods extends State { + String pointPrice(Goods goods){ + if(goods == null) + return ""; + if(goods?.onePrice!=null && goods?.onePrice!="0"){ + return S.of(context).jifen_(goods?.onePrice); + }else if((goods?.onePrice == null || goods?.onePrice == "0") && ((goods?.price != null && goods?.price != "0") || (goods?.money != null && goods?.money != "0.00"))){ + return (goods?.price== "0"|| goods?.price == null ? "" : S.of(context).jifen_(goods?.price)) + (goods?.money== "0"|| goods?.money == null ? "" : " + ${goods?.money}元"); + }else if(goods.oneMoney != null && goods.oneMoney != "0.00"){ + return "${goods.oneMoney}元"; + } + } + @override Widget build(BuildContext context) { return GridView.builder( @@ -40,7 +52,7 @@ class _PointGoods extends State { mainAxisSpacing: 16.w, //子Widget宽高比例 0.59 childAspectRatio: - 200 / (281 / 2 + (281 / 2) * AppUtils.textScale(context)), + 200 / (295 / 2 + (295 / 2) * AppUtils.textScale(context)), ), itemBuilder: (context, index) { return GestureDetector( @@ -79,7 +91,7 @@ class _PointGoods extends State { children: [ MImage( goods.mainImgPath, - aspectRatio: 1.1, + aspectRatio: 158/158, radius: BorderRadius.only( topLeft: Radius.circular(6), topRight: Radius.circular(6), @@ -109,34 +121,37 @@ class _PointGoods extends State { fontSize: 15.sp, ), ), - - Row( + Column( mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - (goods?.price == null || goods.price == "0"?"":S.of(context).jifen_(goods.price)) + (goods?.money == null|| goods.money == "0.00" ?"":" + ${goods.money}元"), + pointPrice(goods), style: TextStyle( color: Color(0xFFE5600D), - fontSize: 16.sp, + fontSize: 15.sp, fontWeight: MyFontWeight.semi_bold, ), ), - Image.asset( - "assets/image/green_leaf.webp", - fit: BoxFit.cover, - width: 12, - height: 12, - ), - Text( - "x100", - overflow: TextOverflow.ellipsis, - maxLines: 2, - style: TextStyle( - color: Color(0xFF32A060), - fontWeight: MyFontWeight.semi_bold, - fontSize: 16.sp, - ), + Row( + children: [ + Image.asset( + "assets/image/green_leaf.webp", + fit: BoxFit.cover, + width: 12, + height: 12, + ), + Text( + "x100", + overflow: TextOverflow.ellipsis, + maxLines: 2, + style: TextStyle( + color: Color(0xFF32A060), + fontWeight: MyFontWeight.semi_bold, + fontSize: 15.sp, + ), + ), + ], ), ], ), diff --git a/lib/home/welfare_exchange.dart b/lib/home/welfare_exchange.dart index 4099c7f8..00329630 100644 --- a/lib/home/welfare_exchange.dart +++ b/lib/home/welfare_exchange.dart @@ -339,25 +339,58 @@ class _WelfareExchange extends State { mainAxisAlignment: MainAxisAlignment.spaceEvenly, crossAxisAlignment: CrossAxisAlignment.end, children: [ - Text( - S.of(context).yiyoujifen, - style: TextStyle( - fontSize: 12.sp, - fontWeight: MyFontWeight.medium, - color: Color(0xFF4C4C4C), + GestureDetector( + onTap: (){ + Navigator.of(context).pushNamed('/router/integral_detailed_page'); + }, + child: Row( + children: [ + Text( + "积分明细", + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFF4C4C4C), + ), + ), + Container( + width: 20, + height: 20, + margin: EdgeInsets.only(left: 4), + decoration: BoxDecoration( + color: Color(0xFF32A060), + borderRadius: BorderRadius.circular(10), + ), + child:Icon( + Icons.keyboard_arrow_right, + size: 20, + color: Colors.white, + ), + ), + ], ), ), SizedBox( height: 4.h, ), - Text( - (userInfo != null) ? "${userInfo.points}" : "", - style: TextStyle( - fontSize: 16.sp, - color: Color(0xFF32A060), - fontWeight: FontWeight.bold, - ), - ), + Row( + children: [ + Text( + (userInfo != null) ? "${userInfo.points}" : "", + style: TextStyle( + fontSize: 16.sp, + color: Color(0xFF32A060), + fontWeight: MyFontWeight.medium, + ), + ), + SizedBox(width: 6,), + Image.asset( + "assets/image/icon_gold_coin.webp", + width: 18, + height: 18, + ) + ], + ) ], ), ) @@ -471,7 +504,7 @@ class _WelfareExchange extends State { ), Spacer(), Text( - (goods?.price == null || goods.price == "0"?"":S.of(context).jifen_(goods.price)) + (goods?.money == null|| goods.money == "0.00" ?"":" + ${goods.money}元"), + pointPrice(goods), style: TextStyle( color: Color(0xFFE5600D), fontSize: 16.sp, @@ -490,4 +523,16 @@ class _WelfareExchange extends State { ); } + String pointPrice(Goods goods){ + if(goods == null) + return ""; + if(goods?.onePrice!=null && goods?.onePrice!="0"){ + return S.of(context).jifen_(goods?.onePrice); + }else if((goods?.onePrice == null || goods?.onePrice == "0") && ((goods?.price != null && goods?.price != "0") || (goods?.money != null && goods?.money != "0.00"))){ + return (goods?.price== "0"|| goods?.price == null ? "" : S.of(context).jifen_(goods?.price)) + (goods?.money== "0"|| goods?.money == null ? "" : " + ${goods?.money}元"); + }else if(goods.oneMoney != null && goods.oneMoney != "0.00"){ + return "${goods.oneMoney}元"; + } + } + } diff --git a/lib/home/welfare_page.dart b/lib/home/welfare_page.dart index 8b3254a6..436462de 100644 --- a/lib/home/welfare_page.dart +++ b/lib/home/welfare_page.dart @@ -34,6 +34,7 @@ class _WelfarePage extends State { ApiService apiService; final RefreshController refreshController = RefreshController(); List goods = []; + Goods goodsPrice; List coupons = []; List> coupon=[]; String categoryId; @@ -116,6 +117,8 @@ class _WelfarePage extends State { con = coupons.skip(i*3).take((i*3 0 && coupon[coupon.length - 1].isEmpty) + coupon.removeAt(coupon.length-1); refreshController.refreshCompleted(); refreshController.loadComplete(); setState(() {}); @@ -144,7 +147,7 @@ class _WelfarePage extends State { ), ), width: double.infinity, - height: 385.h, + height: 236.h, ), Scaffold( backgroundColor: Colors.transparent, @@ -174,20 +177,27 @@ class _WelfarePage extends State { physics: BouncingScrollPhysics(), scrollController: ScrollController(), child: Container( - margin: EdgeInsets.only(top: 45.h,left: 14,right: 14), + // margin: EdgeInsets.only(top:30.h,left: 14,right: 14), child: SingleChildScrollView( physics: BouncingScrollPhysics(), child: Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ - - weekCoupons(), - inviteFriends(), + Container( + color: Colors.white, + padding: EdgeInsets.only(left: 14,right: 14), + child:Column( + children: [ + + inviteFriends(), - benefitExchange(), + benefitExchange(), + ], + ), + ) // activityTask(), ], @@ -202,26 +212,23 @@ class _WelfarePage extends State { /// 周券包推荐 Widget weekCoupons() { - return Stack( - alignment: Alignment.topRight, - children: [ - Container( - width: double.infinity, - margin: EdgeInsets.only(top: 95), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(6), - color: Colors.white, - boxShadow: [ - BoxShadow( - color: Color(0x08213303).withAlpha(12), - offset: Offset(0, 2), - blurRadius: 3, - spreadRadius: 0, - ), - ], - ), - // margin: EdgeInsets.only(top: 139.h), - child: Column( + return Container( + width: double.infinity, + margin: EdgeInsets.only(top: 95), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(6), + color: Colors.white, + boxShadow: [ + BoxShadow( + color: Color(0x08213303).withAlpha(12), + offset: Offset(0, 2), + blurRadius: 3, + spreadRadius: 0, + ), + ], + ), + // margin: EdgeInsets.only(top: 139.h), + child: Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -241,7 +248,7 @@ class _WelfarePage extends State { ), ), Text( - "每周上新 ", + "每周三上新 ", style: TextStyle( color: Color(0xFF4D4D4D), fontSize: 12.sp, @@ -282,44 +289,6 @@ class _WelfarePage extends State { ) ], ) - ), - Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded(child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding(padding:EdgeInsets.only(top: 12), - child: Text( - "福利周周有,优惠享不停", - style: TextStyle( - fontSize: 20.sp, - fontWeight: MyFontWeight.bold, - color: Color(0xFFFFFFFF), - ), - )), - SizedBox(height: 8,), - Text( - "各种优惠全都有", - style: TextStyle( - fontSize: 14.sp, - fontWeight: MyFontWeight.regular, - color: Color(0xFFFFFFFF), - ), - ), - ], - )), - Image.asset( - "assets/image/welfare_zx_tu.webp", - width:120.w, - height:105.h, - fit: BoxFit.cover, - ) - ], - ), - ], ); } @@ -364,10 +333,9 @@ class _WelfarePage extends State { Expanded(child: Container( margin: EdgeInsets.only(top: 12,bottom: 12), child: Column( - mainAxisAlignment: MainAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.start, children: [ - Expanded(child: Text( cop != null ? cop.couponName ?? "" : "", maxLines: 1, @@ -375,10 +343,10 @@ class _WelfarePage extends State { style: TextStyle( fontSize: 14.sp, fontWeight: MyFontWeight.semi_bold, - color: Color(0xFF353535), + color: Color(0xFF0D0D0D), ), - )), - Expanded(child: + ), + SizedBox(height: 12,), (cop.useStartTime == null && cop.useEndTime == null)? Text( @@ -399,29 +367,6 @@ class _WelfarePage extends State { fontWeight: MyFontWeight.regular, color: cop.status == 3 ? Color(0xFFB3B3B3) :Color(0xFF4D4D4D), ), - )), - GestureDetector( - onTap: (){ - // showDeleteDialog(); - - }, - child: Row( - children: [ - Text( - "使用详情", - style: TextStyle( - fontSize: 12.sp, - fontWeight: MyFontWeight.regular, - color: cop.status == 3 ? Color(0xFFB3B3B3):Color(0xFF4D4D4D), - ), - ), - Icon( - Icons.keyboard_arrow_right, - color: cop.status == 3 ? Color(0xFFB3B3B3) :Color(0xFF4D4D4D), - size: 20, - ) - ], - ), ) ], ), @@ -555,7 +500,42 @@ class _WelfarePage extends State { ), ], ); - } else { + } else if (cop.bizType == 6) { + return Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.baseline, + textBaseline: TextBaseline.alphabetic, + children: [ + Text( + "¥", + style: TextStyle( + fontSize: 16.sp, + fontWeight: MyFontWeight.medium, + color: cop.status == 3 ? Color(0xFFB3B3B3):Color(0xff32A060), + ), + ), + SizedBox( + height: 4.h, + ), + Text( + coupon != null + ? double.tryParse("${cop.limitAmount}" ?? "0").toStringAsFixed(2) + : "", + style: TextStyle( + fontSize: 24.sp, + fontWeight: FontWeight.bold, + color: cop.status == 3 ? Color(0xFFB3B3B3):Color(0xff32A060), + ), + ), + ], + ), + ], + ); + }else{ return Column( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, @@ -741,7 +721,7 @@ class _WelfarePage extends State { }, child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, children: [ Expanded(child: Text( @@ -868,8 +848,8 @@ class _WelfarePage extends State { ), Spacer(), Text( - (goods?.price == null || goods.price == "0"?"":S.of(context).jifen_(goods.price)) + (goods?.money == null|| goods.money == "0.00" ?"":" + ${goods.money}元"), - style: TextStyle( + pointPrice(goods), + style: TextStyle( color: Color(0xFFE5600D), fontSize: 16.sp, fontWeight: MyFontWeight.semi_bold, @@ -887,6 +867,19 @@ class _WelfarePage extends State { ); } + + String pointPrice(Goods goodsPrice){ + if(goodsPrice == null) + return ""; + if(goodsPrice?.onePrice!=null && goodsPrice?.onePrice!="0"){ + return S.of(context).jifen_(goodsPrice?.onePrice); + }else if((goodsPrice?.onePrice == null || goodsPrice?.onePrice == "0") && ((goodsPrice?.price != null && goodsPrice?.price != "0") || (goodsPrice?.money != null && goodsPrice?.money != "0.00"))){ + return (goodsPrice?.price== "0"|| goodsPrice?.price == null ? "" : S.of(context).jifen_(goodsPrice?.price)) + (goodsPrice?.money== "0"|| goodsPrice?.money == null ? "" : " + ${goodsPrice?.money}元"); + }else if(goodsPrice.oneMoney != null && goodsPrice.oneMoney != "0.00"){ + return "${goodsPrice.oneMoney}元"; + } + } + ///活动任务 Widget activityTask() { return Container( diff --git a/lib/integral/integral_page.dart b/lib/integral/integral_page.dart index 8157afae..e327e46d 100644 --- a/lib/integral/integral_page.dart +++ b/lib/integral/integral_page.dart @@ -105,7 +105,7 @@ class _IntegralPage extends State { ), ), width: double.infinity, - height: 409.h, + height: 215.h, ), Scaffold( backgroundColor: Colors.transparent, diff --git a/lib/integral/intergra_view/in_for_points.dart b/lib/integral/intergra_view/in_for_points.dart index 9917ae97..9ca9d8d9 100644 --- a/lib/integral/intergra_view/in_for_points.dart +++ b/lib/integral/intergra_view/in_for_points.dart @@ -104,7 +104,7 @@ class _InForPoints extends State { : Colors.white, backgroup: (widget.signInfo != null && widget.signInfo.todayHasSignin) ? Color(0xFFF5F6FA) - : Color(0xFF00BF00), + : Color(0xFF32A060), fontSize: 16.sp, fontWeight: MyFontWeight.bold, padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 6.h), @@ -185,7 +185,7 @@ class _InForPoints extends State { color: (widget.signInfo != null && widget.signInfo.signInList != null && widget.signInfo.signInList.length > position) - ? Color(0xFF00BF00) + ? Color(0xFF32A060) : Color(0xFFF5F6FA), borderRadius: BorderRadius.circular(4), ), diff --git a/lib/integral_store/integral_store_details_page.dart b/lib/integral_store/integral_store_details_page.dart index 835fc442..18f2d6dc 100644 --- a/lib/integral_store/integral_store_details_page.dart +++ b/lib/integral_store/integral_store_details_page.dart @@ -64,11 +64,11 @@ class _IntegralStoreDetailsPage extends State { if(goods != null && points != null && double.tryParse(goods.onePrice) != 0 && double.tryParse(goods.onePrice) <= double.tryParse(points)){ payType = 1; - } else if (goods != null && points != null && double.tryParse(goods.price) - <= double.tryParse(points)){ + } else if (goods != null && points != null && double.tryParse(goods.price) != 0 && double.tryParse(goods.price) + <= double.tryParse(points) && double.tryParse(goods.money) != 0.00){ payType = 2; } else if (goods != null && points != null - && double.tryParse(goods.oneMoney) != 0){ + && double.tryParse(goods.oneMoney) != 0.00){ payType = 3; } refreshController.refreshCompleted(); @@ -78,6 +78,18 @@ class _IntegralStoreDetailsPage extends State { } } + String pointPrice(){ + if(goods == null) + return ""; + if(goods?.onePrice!=null && goods?.onePrice!="0"){ + return S.of(context).jifen_(goods?.onePrice); + }else if((goods?.onePrice == null || goods?.onePrice == "0") && ((goods?.price != null && goods?.price != "0") || (goods?.money != null && goods?.money != "0.00"))){ + return (goods?.price== "0"|| goods?.price == null ? "" : S.of(context).jifen_(goods?.price)) + (goods?.money== "0"|| goods?.money == null ? "" : " + ${goods?.money}元"); + }else if(goods.oneMoney != null && goods.oneMoney != "0.00"){ + return "${goods.oneMoney}元"; + } + } + @override Widget build(BuildContext context) { return Scaffold( @@ -145,30 +157,29 @@ class _IntegralStoreDetailsPage extends State { ), GestureDetector( onTap: () { - // if(payType > 0){ - // toExchangeOrder(); - // }else{ - // SmartDialog.showToast("您的积分不足!", alignment: Alignment.center); - // return; - // } + if(payType > 0){ + toExchangeOrder(); + }else{ + SmartDialog.showToast("您的积分不足!", alignment: Alignment.center); + return; + } }, child: Container( padding: EdgeInsets.only(top: 16.h, bottom: 16.h), decoration: BoxDecoration( - color: Color(0xFFD8D8D8), - // (payType > 0) - // ? Color(0xFF32A060) - // : Color(0xFFD8D8D8), + color: (payType > 0) + ? Color(0xFF32A060) + : Color(0xFFD8D8D8), borderRadius: BorderRadius.vertical( top: Radius.circular(4), ), ), alignment: Alignment.center, child: Text( - // (payType > 0) - // ? S.of(context).duihuan - // : S.of(context).jifenbuzu, - "兑换功能暂未开放", + (payType > 0) + ? S.of(context).duihuan + : S.of(context).jifenbuzu, + // "兑换功能暂未开放", style: TextStyle( fontSize: 16.sp, color: Color(0xFFFFFFFF), @@ -235,12 +246,12 @@ class _IntegralStoreDetailsPage extends State { crossAxisAlignment: CrossAxisAlignment.center, children: [ Text( - (goods?.price == null || goods.price == "0" - ? "" - : S.of(context).jifen_(goods.price)) + - (goods?.money == null || goods.money == "0.00" - ? "" - : " + ${goods.money}元"), + // goods?.onePrice == null || goods?.onePrice == "0"? + // ((goods?.price == null || goods?.price == "0"?"":S.of(context).jifen_(goods?.price)) + + // (goods?.money == null|| goods?.money == "0.00" ?"":" + ${goods.money}元"))==""? + // (goods?.oneMoney == null || goods?.oneMoney == "0.00"?"":"${goods?.oneMoney}元"):"" + // :S.of(context).jifen_(goods?.onePrice), + pointPrice(), style: TextStyle( fontWeight: MyFontWeight.semi_bold, fontSize: 18.sp, @@ -307,7 +318,7 @@ class _IntegralStoreDetailsPage extends State { Widget swiper() { return Container( child: AspectRatio( - aspectRatio: 1.3698, + aspectRatio:375/375, child: Stack( children: [ Swiper( diff --git a/lib/l10n/intl_en.arb b/lib/l10n/intl_en.arb index 016dd729..2fd00698 100644 --- a/lib/l10n/intl_en.arb +++ b/lib/l10n/intl_en.arb @@ -101,7 +101,7 @@ "yiduihuan": "已兑换", "zitidizhi": "自提地址", "zitishijian": "自提时间", - "feishiwuduihuanma": "非实物兑换吗", + "feishiwuduihuanma": "非实物兑换码", "shangpinjifen": "商品积分 {jifen}积分", "shifujifen": "实付积分 {jifen}积分", "shanchudingdan": "删除订单", @@ -236,7 +236,7 @@ "keyongquan": "可用券", "xuni": "虚拟", "qingxuanzeshouhuodizhi": "请选择收货地址", - "feishiwushangpin": "非实物商品兑换后领取到卡包即可使用!", + "feishiwushangpin": "非实物商品兑换后领取到优惠券即可使用!", "duihuanhoufahuo": "兑换后五个工作日内发货", "xianshangfafang": "线上发放", "lingqushijian": "领取时间 {shijian}", diff --git a/lib/l10n/intl_zh_CN.arb b/lib/l10n/intl_zh_CN.arb index 7134079b..dd62bda0 100644 --- a/lib/l10n/intl_zh_CN.arb +++ b/lib/l10n/intl_zh_CN.arb @@ -101,7 +101,7 @@ "yiduihuan": "已兑换", "zitidizhi": "自提地址", "zitishijian": "自提时间", - "feishiwuduihuanma": "非实物兑换吗", + "feishiwuduihuanma": "非实物兑换码", "shangpinjifen": "商品积分 {jifen}积分", "shifujifen": "实付积分 {jifen}积分", "shanchudingdan": "删除订单", @@ -236,7 +236,7 @@ "keyongquan": "可用券", "xuni": "虚拟", "qingxuanzeshouhuodizhi": "请选择收货地址", - "feishiwushangpin": "非实物商品兑换后领取到卡包即可使用!", + "feishiwushangpin": "非实物商品兑换后领取到优惠券即可使用!", "duihuanhoufahuo": "兑换后五个工作日内发货", "xianshangfafang": "线上发放", "lingqushijian": "领取时间 {shijian}", diff --git a/lib/l10n/intl_zh_Hans_CN.arb b/lib/l10n/intl_zh_Hans_CN.arb index e80618c5..3a39d221 100644 --- a/lib/l10n/intl_zh_Hans_CN.arb +++ b/lib/l10n/intl_zh_Hans_CN.arb @@ -101,7 +101,7 @@ "yiduihuan": "已兑换", "zitidizhi": "自提地址", "zitishijian": "自提时间", - "feishiwuduihuanma": "非实物兑换吗", + "feishiwuduihuanma": "非实物兑换码", "shangpinjifen": "商品积分 {jifen}积分", "shifujifen": "实付积分 {jifen}积分", "shanchudingdan": "删除订单", @@ -236,7 +236,7 @@ "keyongquan": "可用券", "xuni": "虚拟", "qingxuanzeshouhuodizhi": "请选择收货地址", - "feishiwushangpin": "非实物商品兑换后领取到卡包即可使用!", + "feishiwushangpin": "非实物商品兑换后领取到优惠券即可使用!", "duihuanhoufahuo": "兑换后五个工作日内发货", "xianshangfafang": "线上发放", "lingqushijian": "领取时间 {shijian}", diff --git a/lib/l10n/intl_zh_Hant_CN.arb b/lib/l10n/intl_zh_Hant_CN.arb index 562f4aa6..ed417912 100644 --- a/lib/l10n/intl_zh_Hant_CN.arb +++ b/lib/l10n/intl_zh_Hant_CN.arb @@ -237,7 +237,7 @@ "qingxuanzeshouhuodizhi": "請選擇收貨地址", "shouhuodizhi1": "收貨地址", "wenzhangxiangqing": "文章詳情", - "feishiwushangpin": "非實物商品!", + "feishiwushangpin": "非實物商品兌換後領取到優惠券即可使用!", "duihuanhoufahuo": "兌換物商品", "xianshangfafang": "綫上發放", "lingqushijian": "領取時間 {shijian}", diff --git a/lib/l10n/intl_zh_TW.arb b/lib/l10n/intl_zh_TW.arb index 706386e2..6c370a5e 100644 --- a/lib/l10n/intl_zh_TW.arb +++ b/lib/l10n/intl_zh_TW.arb @@ -237,7 +237,7 @@ "qingxuanzeshouhuodizhi": "請選擇收貨地址", "shouhuodizhi1": "收貨地址", "wenzhangxiangqing": "文章詳情", - "feishiwushangpin": "非實物商品!", + "feishiwushangpin": "非實物商品兌換後領取到優惠券即可使用!", "duihuanhoufahuo": "兌換物商品", "xianshangfafang": "綫上發放", "lingqushijian": "領取時間 {shijian}", diff --git a/lib/main_page.dart b/lib/main_page.dart index 12b0a20e..605abdce 100644 --- a/lib/main_page.dart +++ b/lib/main_page.dart @@ -204,7 +204,7 @@ class _MainPage extends State with WidgetsBindingObserver { ); } - /// @typed: 1文章 2活动 3店铺 4积分商品 5订单 6动态 + /// @typed: 1文章 2活动 3店铺 4积分商品 5订单 6动态 7用户 8平台余额/钱包 xgFlutterPlugin.addEventHandler(xgPushClickAction: (event) async { print("xgPushClickAction1: $event"); if (event["actionType"] == 2) return event; @@ -293,6 +293,11 @@ class _MainPage extends State with WidgetsBindingObserver { routeName = "/router/community_details"; params["businessId"] = pushMap["info"]; break; + case 8: + routeName = "/router/mine_wallet"; + params["id"] = pushMap["info"]; + break; + } sharedPreferences.setString("pushData", ""); print("xgPushClickAction: routeName: $routeName"); diff --git a/lib/mine/coupon_page.dart b/lib/mine/coupon_page.dart index fd05f4a3..933bc3d3 100644 --- a/lib/mine/coupon_page.dart +++ b/lib/mine/coupon_page.dart @@ -3,7 +3,6 @@ import 'dart:convert'; import 'package:dio/dio.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_html/flutter_html.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/coupon.dart'; @@ -11,6 +10,7 @@ import 'package:huixiang/retrofit/data/page.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/view_widget/classic_header.dart'; +import 'package:huixiang/view_widget/coupon_details_dialog.dart'; import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:huixiang/view_widget/my_footer.dart'; import 'package:huixiang/view_widget/new_coupon_widget.dart'; @@ -94,7 +94,9 @@ class _CouponPage extends State { Widget build(BuildContext context) { return Scaffold( appBar: MyAppBar( - title: S.of(context).youhuiquan, + title: S + .of(context) + .youhuiquan, titleColor: Colors.black, background: Color(0xFFFFFFFF), leadingColor: Colors.black, @@ -110,68 +112,76 @@ class _CouponPage extends State { children: [ Expanded( child: GestureDetector( - onTap: () { - setState(() { - state = 1; - _onRefresh(); - }); - }, - child: Container( - width: double.infinity, - alignment: Alignment.center, - decoration: BoxDecoration( - borderRadius: new BorderRadius.only( - topLeft: Radius.circular(6), - bottomLeft: Radius.circular(6), - ), - border: Border.all( - color: Color(0xFF32A060), - width: 1, - ), - color: state == 1 ? Color(0xFF32A060) : Color(0xFFFFFFFF), - ), - child: Text( - S.of(context).keyongquan, - style: TextStyle( - fontWeight: MyFontWeight.medium, - fontSize: 15.sp, - color: state == 1 ? Color(0xFFFFFFFF) : Color(0xFF32A060), + onTap: () { + setState(() { + state = 1; + _onRefresh(); + }); + }, + child: Container( + width: double.infinity, + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: new BorderRadius.only( + topLeft: Radius.circular(6), + bottomLeft: Radius.circular(6), + ), + border: Border.all( + color: Color(0xFF32A060), + width: 1, + ), + color: state == 1 ? Color(0xFF32A060) : Color( + 0xFFFFFFFF), + ), + child: Text( + S + .of(context) + .keyongquan, + style: TextStyle( + fontWeight: MyFontWeight.medium, + fontSize: 15.sp, + color: state == 1 ? Color(0xFFFFFFFF) : Color( + 0xFF32A060), + ), + ), ), - ), - ), - )), + )), Expanded( child: GestureDetector( - onTap: () { - setState(() { - state = 3; - _onRefresh(); - }); - }, - child: Container( - width: double.infinity, - alignment: Alignment.center, - decoration: BoxDecoration( - borderRadius: new BorderRadius.only( - topRight: Radius.circular(6), - bottomRight: Radius.circular(6), - ), - border: Border.all( - color: Color(0xFF32A060), - width: 1, - ), - color: state == 3 ? Color(0xFF32A060) : Color(0xFFFFFFFF), - ), - child: Text( - S.of(context).shixiaoquan, - style: TextStyle( - fontWeight: MyFontWeight.medium, - fontSize: 15.sp, - color: state == 3 ? Color(0xFFFFFFFF) : Color(0xFF32A060), + onTap: () { + setState(() { + state = 3; + _onRefresh(); + }); + }, + child: Container( + width: double.infinity, + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: new BorderRadius.only( + topRight: Radius.circular(6), + bottomRight: Radius.circular(6), + ), + border: Border.all( + color: Color(0xFF32A060), + width: 1, + ), + color: state == 3 ? Color(0xFF32A060) : Color( + 0xFFFFFFFF), + ), + child: Text( + S + .of(context) + .shixiaoquan, + style: TextStyle( + fontWeight: MyFontWeight.medium, + fontSize: 15.sp, + color: state == 3 ? Color(0xFFFFFFFF) : Color( + 0xFF32A060), + ), + ), ), - ), - ), - )) + )) ], ), ), @@ -191,54 +201,55 @@ class _CouponPage extends State { onLoading: queryCard, child: (coupons != null && coupons.length > 0) ? ListView.builder( - itemBuilder: (context, position) { - return GestureDetector( - child: NewCouponWidget( - coupons[position], - (type) { - if (type == 1) { - receiveCoupon(coupons[position].id); - } else { - if (coupons[position].bizType == 5 || - coupons[position].bizType == 3) { - Navigator.of(context).pushNamed( - '/router/write_off_page', - arguments: { - "couponId": coupons[position].id, - "coupon": jsonEncode(coupons[position]), - }).then((value) { - _onRefresh(); - }); - } else { - showStoreSelector( - coupons[position].storeList); - } - } - }, - // (){ - // setState(() { - // couponDialog(); - // }); - // }, - () { - setState(() { - coupons[position].isEx = - !coupons[position].isEx; - }); - }, - type: 0, - ), - ); + itemBuilder: (context, position) { + return GestureDetector( + child: NewCouponWidget( + coupons[position], + (type) { + if (type == 1) { + receiveCoupon(coupons[position].id); + } else { + if (coupons[position].bizType == 5 || + coupons[position].bizType == 3) { + Navigator.of(context).pushNamed( + '/router/write_off_page', + arguments: { + "couponId": coupons[position].id, + "coupon": jsonEncode(coupons[position]), + }).then((value) { + _onRefresh(); + }); + } else { + showStoreSelector( + coupons[position].storeList); + + } + } }, - itemCount: coupons != null ? coupons.length : 0, - ) - : NoDataView( - src: "assets/image/ka.webp", - isShowBtn: false, - text: "目前暂无优惠券,请到领劵中心领取哦~", - fontSize: 16.sp, - margin: EdgeInsets.only(top: 120.h, left: 60, right: 60), + () { + setState(() { + coupons[position].isEx = + !coupons[position].isEx; + }); + }, + (){ + setState(() { + showCouponDetails(position); + }); + }, + type: 0, ), + ); + }, + itemCount: coupons != null ? coupons.length : 0, + ) + : NoDataView( + src: "assets/image/ka.webp", + isShowBtn: false, + text: "目前暂无优惠券,请到领劵中心领取哦~", + fontSize: 16.sp, + margin: EdgeInsets.only(top: 120.h, left: 60, right: 60), + ), ), ), ], @@ -248,7 +259,7 @@ class _CouponPage extends State { receiveCoupon(couponId) async { BaseData baseData = - await apiService.receiveCoupon(couponId).catchError((onError) {}); + await apiService.receiveCoupon(couponId).catchError((onError) {}); if (baseData != null && baseData.isSuccess) { _onRefresh(); showAlertDialog(); @@ -265,10 +276,6 @@ class _CouponPage extends State { }); } - couponDialog(){ - showCouponDialog(); - } - showAlertDialog() { //显示对话框 showDialog( @@ -279,75 +286,14 @@ class _CouponPage extends State { ); } - ///优惠券详情弹窗 - showCouponDialog() { - showDialog( - context: context, - builder: (context) { - return AlertDialog( - content: Container( - width: MediaQuery.of(context).size.width - 14, - height: 330.h, - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Expanded(child: - Container( - alignment: Alignment.center, - child: Text( - "使用详情", - style: TextStyle( - fontWeight: MyFontWeight.bold, - fontSize: 15.sp, - color: Color(0xFF353535), - ), - ), - )), - GestureDetector( - onTap: (){ - setState(() { - Navigator.of(context).pop(); - }); - }, - child: Icon( - Icons.clear, - color: Colors.black, - size: 18, - ), - ), - SizedBox(width: 14), - ], - ), - SizedBox(height: 12.h,), - Container( - width: double.infinity, - height: 1.h, - color: Color(0xFFF2F2F2), - margin: EdgeInsets.only(bottom:11.h), - ), - Container( - color: Colors.white, - child: Html( - data: "注意", - customImageRenders: { - networkSourceMatcher(): networkImageRender( - loadingWidget: () { - return Container(); - }, - ), - }, - ), - ), - ], - ), - ), - ); - }, - ); + ///使用详情 + showCouponDetails(index) { + showModalBottomSheet( + context: context, + backgroundColor: Colors.transparent, + builder: (context) { + return CouponDetailsWidget(coupons[index]); + }); } + } diff --git a/lib/mine/coupons_page.dart b/lib/mine/coupons_page.dart index 0b434514..a632b486 100644 --- a/lib/mine/coupons_page.dart +++ b/lib/mine/coupons_page.dart @@ -9,6 +9,7 @@ import 'package:huixiang/retrofit/data/coupon.dart'; import 'package:huixiang/retrofit/data/page.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/view_widget/classic_header.dart'; +import 'package:huixiang/view_widget/coupon_details_dialog.dart'; import 'package:huixiang/view_widget/my_footer.dart'; import 'package:huixiang/view_widget/new_coupon_widget.dart'; import 'package:huixiang/view_widget/no_data_view.dart'; @@ -193,6 +194,11 @@ class _CouponsPage extends State { coupons[position].isEx = !coupons[position].isEx; }); }, + (){ + setState(() { + showCouponDetails(position); + }); + }, type: 0, ), ); @@ -240,4 +246,15 @@ class _CouponsPage extends State { }, ); } + + + ///使用详情 + showCouponDetails(index) { + showModalBottomSheet( + context: context, + backgroundColor: Colors.transparent, + builder: (context) { + return CouponDetailsWidget(coupons[index]); + }); + } } diff --git a/lib/mine/mine_shop_details.dart b/lib/mine/mine_shop_details.dart index 71ed591b..c686ce79 100644 --- a/lib/mine/mine_shop_details.dart +++ b/lib/mine/mine_shop_details.dart @@ -13,6 +13,7 @@ import 'package:huixiang/store/scan.dart'; import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/utils/location.dart'; import 'package:huixiang/utils/painter_bg.dart'; +import 'package:huixiang/view_widget/classic_header.dart'; import 'package:huixiang/view_widget/custom_image.dart'; import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:huixiang/view_widget/my_footer.dart'; @@ -47,15 +48,14 @@ class _MineShopDetails extends State { @override void initState() { super.initState(); - - vipDetail("", ""); - - // startLocation(); - queryDetail("bill_cate_point_sub"); + SharedPreferences.getInstance().then((value) { + apiService = + ApiService(Dio(), token: value.getString("token"), context: context); + vipDetail("", ""); + }); + startLocation(); } - - VipCard vipCard; final RefreshController refreshController = RefreshController(); final RefreshController consumeRefreshController = RefreshController(); @@ -63,8 +63,9 @@ class _MineShopDetails extends State { vipDetail(latitude, longitude) async { SharedPreferences value = await SharedPreferences.getInstance(); - if(apiService == null) - apiService = ApiService(Dio(), context: context, token: value.getString("token")); + if (apiService == null) + apiService = + ApiService(Dio(), context: context, token: value.getString("token")); BaseData baseData = await apiService.vipDetail({ "id": widget.arguments["id"], "latitude": "$latitude", @@ -80,42 +81,76 @@ class _MineShopDetails extends State { setState(() {}); } - queryDetail(category) async { - SharedPreferences value = await SharedPreferences.getInstance(); - if(apiService == null) - apiService = ApiService(Dio(), context: context, token: value.getString("token")); + startLocation() async { + // EasyLoading.show(status: S.current.zhengzaijiazai); + Location.getInstance() + .aMapFlutterLocation + .onResultCallback() + .listen((event) { + if (event != null && + event["latitude"] != null && + event["longitude"] != null) { + vipDetail(event["latitude"], event["longitude"]); + } else { + EasyLoading.dismiss(); + } + }); + Location.getInstance().prepareLoc(); + Location.getInstance().startLocation(context).then((value) { + if (!value) { + EasyLoading.dismiss(); + refreshController.refreshFailed(); + } + }); + } + + billInfo() async { + if (apiService == null) { + SharedPreferences value = await SharedPreferences.getInstance(); + apiService = ApiService(Dio(), + context: context, token: value.getString("token"), showLoading: true); + } BaseData> baseData = await apiService.queryBillInfo({ "current": current, - "model": {"category": category, "title": "bill_title_point", "type": ""}, + "model": {"category": "", "title": "bill_title_balance", "type": ""}, "order": "descending", "size": 10, "sort": "id" }).catchError((onError) { - consumeRefreshController.loadFailed(); + refreshController.refreshFailed(); + refreshController.loadFailed(); consumeRefreshController.refreshFailed(); + consumeRefreshController.loadFailed(); }); - if (current == 1) userBill.clear(); if (baseData != null && baseData.isSuccess) { + if (current == 1) { + userBill.clear(); + } userBill.addAll(baseData.data.records); - consumeRefreshController.loadComplete(); + refreshController.refreshCompleted(); + refreshController.loadComplete(); consumeRefreshController.refreshCompleted(); + consumeRefreshController.loadComplete(); if (current * 10 > int.tryParse(baseData.data.total)) { + refreshController.loadNoData(); consumeRefreshController.loadNoData(); } else { current += 1; } - setState(() {}); } else { - consumeRefreshController.loadFailed(); + refreshController.refreshFailed(); + refreshController.loadFailed(); consumeRefreshController.refreshFailed(); + consumeRefreshController.loadFailed(); } + if (mounted) setState(() {}); } @override Widget build(BuildContext context) { return Scaffold( appBar: MyAppBar( - title: "余额详情", + title: "会员卡详情", titleColor: Colors.black, background: Colors.white, brightness: Brightness.dark, @@ -126,13 +161,12 @@ class _MineShopDetails extends State { buildVipCard(), Container( margin: EdgeInsets.only(left: 14.w), - child: - Row( + child: Row( children: [ GestureDetector( - onTap: (){ + onTap: () { setState(() { - selectType =0; + selectType = 0; }); }, child: Column( @@ -140,40 +174,16 @@ class _MineShopDetails extends State { Text( "适用门店", style: TextStyle( - color: Color(selectType == 0 ? 0xFF000000 : 0xFF868686), + color: + Color(selectType == 0 ? 0xFF000000 : 0xFF868686), fontSize: 15.sp, fontWeight: MyFontWeight.medium, ), ), - SizedBox(height:8.h,), - if(selectType == 0) - Container( - width: 52.w, - height: 2.h, - color: Color(0xFF32A060), - ) - ], - ), - ), - SizedBox(width: 20.w,), - GestureDetector( - onTap: (){ - setState(() { - selectType = 1; - }); - }, - child: Column( - children: [ - Text( - "余额明细", - style: TextStyle( - color:Color(selectType == 1 ? 0xFF000000 : 0xFF868686), - fontSize: 15.sp, - fontWeight: MyFontWeight.medium, - ), + SizedBox( + height: 8.h, ), - SizedBox(height:8.h,), - if(selectType == 1) + if (selectType == 0) Container( width: 52.w, height: 2.h, @@ -182,64 +192,99 @@ class _MineShopDetails extends State { ], ), ), + SizedBox( + width: 20.w, + ), + // GestureDetector( + // onTap: () { + // setState(() { + // selectType = 1; + // billInfo(); + // }); + // }, + // child: Column( + // children: [ + // Text( + // "余额明细", + // style: TextStyle( + // color: + // Color(selectType == 1 ? 0xFF000000 : 0xFF868686), + // fontSize: 15.sp, + // fontWeight: MyFontWeight.medium, + // ), + // ), + // SizedBox( + // height: 8.h, + // ), + // if (selectType == 1) + // Container( + // width: 52.w, + // height: 2.h, + // color: Color(0xFF32A060), + // ) + // ], + // ), + // ), ], ), ), - selectType == 0 ? - Expanded( - child: SmartRefresher( - controller: refreshController, - enablePullDown: false, - enablePullUp: false, - footer: CustomFooter( - builder: (context, mode) { - return MyFooter(mode); - }, - ), - physics: BouncingScrollPhysics(), - child: ListView.builder( - itemBuilder: (context, position) { - return GestureDetector( - onTap: () {}, - child: shopItem(vipCard.storeList[position]), - ); - }, - padding: EdgeInsets.symmetric(vertical: 1), - itemCount: (vipCard != null && vipCard.storeList != null) - ? vipCard.storeList.length - : 0, - ), - ), - ): - Expanded( - child: SmartRefresher( - controller: consumeRefreshController, - enablePullDown: false, - enablePullUp: false, - footer: CustomFooter( - builder: (context, mode) { - return MyFooter(mode); - }, - ), - physics: BouncingScrollPhysics(), - child: Column( - children: [ - Expanded(child: ListView.builder( - itemBuilder: (context, position) { - return GestureDetector( - onTap: () { - + selectType == 0 + ? Expanded( + child: SmartRefresher( + controller: refreshController, + enablePullDown: false, + enablePullUp: false, + footer: CustomFooter( + builder: (context, mode) { + return MyFooter(mode); + }, + ), + physics: BouncingScrollPhysics(), + child: ListView.builder( + itemBuilder: (context, position) { + return GestureDetector( + onTap: () {}, + child: shopItem(vipCard.storeList[position]), + ); + }, + padding: EdgeInsets.symmetric(vertical: 1), + itemCount: (vipCard != null && vipCard.storeList != null) + ? vipCard.storeList.length + : 0, + ), + ), + ) + : Expanded( + child: SmartRefresher( + controller: consumeRefreshController, + enablePullDown: true, + enablePullUp: true, + physics: BouncingScrollPhysics(), + header: MyHeader(), + footer: CustomFooter( + builder: (context, mode) { + return MyFooter(mode); }, - child: consumeItem(userBill[position]), - ); - }, - padding: EdgeInsets.symmetric(vertical: 1), - itemCount: userBill != null ? userBill.length : 0, - ),), - ], - ) - ), - ), + ), + onRefresh: (){ + current = 1; + billInfo(); + }, + onLoading: () { + billInfo(); + }, + child: ListView.builder( + itemBuilder: (context, position) { + return GestureDetector( + onTap: () {}, + child: consumeItem(userBill[position]), + ); + }, + shrinkWrap: true, + padding: EdgeInsets.symmetric(vertical: 1), + itemCount: userBill != null ? userBill.length : 0, + )), + ), ], ), ); @@ -259,9 +304,9 @@ class _MineShopDetails extends State { Widget buildVipCard() { return Container( - width:double.infinity, + width: double.infinity, // height:140.h, - margin: EdgeInsets.only(bottom:24.h,top: 14.h,left: 14.w,right: 14.w), + margin: EdgeInsets.only(bottom: 24.h, top: 14.h, left: 14.w, right: 14.w), child: Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, @@ -272,7 +317,7 @@ class _MineShopDetails extends State { topLeft: Radius.circular(6), topRight: Radius.circular(6), ), - color: Color(colorByName(vipCard?.tenantName ?? "")), + color: Color(colorByName(vipCard?.tenantName ?? "")), ), padding: EdgeInsets.only(left: 12.w), height: 62.h, @@ -289,7 +334,9 @@ class _MineShopDetails extends State { errorSrc: "assets/image/default_1.webp", fadeSrc: "assets/image/default_1.webp", ), - SizedBox(width: 6,), + SizedBox( + width: 6, + ), Text( vipCard != null ? vipCard.tenantName : "", style: TextStyle( @@ -336,12 +383,14 @@ class _MineShopDetails extends State { ), ], ), - SizedBox(height:4.h,), + SizedBox( + height: 4.h, + ), Text( "¥${vipCard != null ? vipCard.balance : ""}", style: TextStyle( color: Color(0xFF262626), - fontSize:24.sp, + fontSize: 24.sp, fontWeight: MyFontWeight.bold, ), ), @@ -383,7 +432,7 @@ class _MineShopDetails extends State { onTap: () { // Navigator.of(context).pushNamed('/router/union_detail_page', // arguments: {"id": store.id}); - if(store.posType.code == "NORMALSTORE") { + if (store.posType.code == "NORMALSTORE") { Scan.toScan( context, store.id, @@ -455,7 +504,7 @@ class _MineShopDetails extends State { flex: 1, child: Text( S.of(context).yingyeshijian((store.openStartTime == null && - store.openEndTime == null) + store.openEndTime == null) ? S.of(context).quantian : "${store.openStartTime.substring(0, store.openStartTime.lastIndexOf(":"))} - ${store.openEndTime.substring(0, store.openEndTime.lastIndexOf(":"))}"), style: TextStyle( @@ -468,10 +517,10 @@ class _MineShopDetails extends State { Text( (store.distance ?? 0) > 1000 ? S.of(context).gongli( - ((store.distance ?? 0) / 1000 * 100).toInt() / 100.0) + ((store.distance ?? 0) / 1000 * 100).toInt() / 100.0) : S - .of(context) - .mi(((store.distance ?? 0) * 100).toInt() / 100.0), + .of(context) + .mi(((store.distance ?? 0) * 100).toInt() / 100.0), style: TextStyle( fontSize: 12.sp, fontWeight: MyFontWeight.regular, @@ -485,43 +534,45 @@ class _MineShopDetails extends State { ); } - Widget consumeItem(UserBill userBill){ + Widget consumeItem(UserBill userBill) { return Container( decoration: BoxDecoration( - borderRadius: new BorderRadius.circular(6), - color: Colors.white, - ), + borderRadius: new BorderRadius.circular(6), + color: Colors.white, + ), padding: EdgeInsets.all(12), margin: EdgeInsets.symmetric(horizontal: 16.w, vertical: 8.h), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.center, children: [ - Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - userBill.name ?? "", - style: TextStyle( - fontSize: 14.sp, - fontWeight: MyFontWeight.semi_bold, - color: Colors.black, + Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + userBill.name ?? "", + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.semi_bold, + color: Colors.black, + ), ), - ), - SizedBox(height: 4,), - Text( - userBill.updateTime ?? "", - style: TextStyle( - fontSize: 12.sp, - fontWeight: MyFontWeight.regular, - color: Color(0xFF4D4D4D), + SizedBox( + height: 4, ), - ), - ], - ), + Text( + userBill.updateTime ?? "", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF4D4D4D), + ), + ), + ], + ), Text( - "-${double.tryParse(userBill.number ?? "0").toInt().toString()}", + "-${double.tryParse(userBill.number ?? "0").toInt().toString()}元", style: TextStyle( fontSize: 18.sp, fontWeight: MyFontWeight.regular, @@ -554,41 +605,41 @@ class _MineShopDetails extends State { return products .map( (e) => Container( - margin: EdgeInsets.symmetric(horizontal: 2.w), - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceAround, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - MImage( - e.skuImg, - width: 75.w, - height: 75.h, - fit: BoxFit.contain, - errorSrc: "assets/image/default_1.webp", - fadeSrc: "assets/image/default_1.webp", - ), - SizedBox( - height: 4.h, - ), - if (isRemake) - Container( - width: 75.w, - child: Text( - e.productName, - maxLines: 1, - textAlign: TextAlign.center, - overflow: TextOverflow.ellipsis, - style: TextStyle( - fontSize: 10.sp, - fontWeight: MyFontWeight.regular, - color: Color(0xFF353535), - ), + margin: EdgeInsets.symmetric(horizontal: 2.w), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + MImage( + e.skuImg, + width: 75.w, + height: 75.h, + fit: BoxFit.contain, + errorSrc: "assets/image/default_1.webp", + fadeSrc: "assets/image/default_1.webp", ), - ), - ], - ), - ), - ) + SizedBox( + height: 4.h, + ), + if (isRemake) + Container( + width: 75.w, + child: Text( + e.productName, + maxLines: 1, + textAlign: TextAlign.center, + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 10.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF353535), + ), + ), + ), + ], + ), + ), + ) .toList(); } } diff --git a/lib/mine/mine_view/calendar_page.dart b/lib/mine/mine_view/calendar_page.dart index 37ffc7f2..ca76ba09 100644 --- a/lib/mine/mine_view/calendar_page.dart +++ b/lib/mine/mine_view/calendar_page.dart @@ -84,5 +84,4 @@ class _CalendarPage extends State with TickerProviderStateMixin { ); } - } diff --git a/lib/mine/mine_view/mine_item.dart b/lib/mine/mine_view/mine_item.dart index 176936fd..f82b75de 100644 --- a/lib/mine/mine_view/mine_item.dart +++ b/lib/mine/mine_view/mine_item.dart @@ -15,6 +15,7 @@ class MineItem extends StatefulWidget { } class _MineItem extends State { + var isShowMore = false; @override Widget build(BuildContext context) { return Container( @@ -36,8 +37,8 @@ class _MineItem extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - padding: EdgeInsets.only(left: 16,top:16,bottom:4), - child: Text( + padding: EdgeInsets.only(left: 16,top:16,bottom:4,right: 16), + child:Text( "其他", style: TextStyle( color: Color(0xFF353535), @@ -204,8 +205,27 @@ class _MineItem extends State { ], ), SizedBox(height: 10.h,), + if(isShowMore) Row( children: [ + ///兑换历史 + Expanded(child: InkWell( + onTap: () { + SharedPreferences.getInstance().then((value) { + if (value.getString("token") == null || + value.getString("token") == "") { + LoginTipsDialog().show(context); + return; + } + Navigator.of(context) + .pushNamed('/router/exchange_history_page'); + }); + }, + child: mineItem( + S.of(context).duihuanlishi, + "assets/image/icon_mine_records_of_consumption.webp", + ), + ),), ///我的砍价 Expanded(child: InkWell( @@ -240,26 +260,15 @@ class _MineItem extends State { "assets/image/settled.webp", ), ),), - ///发票管理 - Expanded(child: InkWell( - onTap: () { - Navigator.of(context).pushNamed('/router/bargain_group_order', - arguments: {"type":1}); - }, - child: mineItem( - "发票管理", - "assets/image/bill_gl.webp", - ), - ),), - // Expanded(child: InkWell( - // onTap: () { - // Navigator.of(context).pushNamed('/router/qr_share', arguments: {}); - // }, - // child: mineItem( - // S.of(context).tuiguangma, - // "assets/image/pin_tuan.webp", - // ), - // ),), + // Expanded(child: InkWell( + // onTap: () { + // Navigator.of(context).pushNamed('/router/qr_share', arguments: {}); + // }, + // child: mineItem( + // S.of(context).tuiguangma, + // "assets/image/pin_tuan.webp", + // ), + // ),), // Expanded(child:InkWell( // onTap: () { // Navigator.of(context).pushNamed('/router/invitation_record', arguments: {}); @@ -271,9 +280,22 @@ class _MineItem extends State { // ),), ], ), + if(isShowMore) SizedBox(height: 10.h,), + if(isShowMore) Row( children: [ + ///发票管理 + Expanded(child: InkWell( + onTap: () { + Navigator.of(context).pushNamed('/router/bargain_group_order', + arguments: {"type":1}); + }, + child: mineItem( + "发票管理", + "assets/image/bill_gl.webp", + ), + ),), ///帮助反馈 Expanded(child: InkWell( onTap: () { @@ -295,9 +317,40 @@ class _MineItem extends State { ), ),), Expanded(child:Container(),), - Expanded(child:Container(),), ], ), + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + setState(() { + isShowMore = !isShowMore; + }); + }, + child: Container( + margin: EdgeInsets.symmetric(vertical: 10), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisSize: MainAxisSize.max, + children: [ + Text( + (isShowMore != null && !isShowMore)?"展开": "收起", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF32A060), + ), + ), + Icon( + (isShowMore != null && !isShowMore) + ? Icons.keyboard_arrow_down + : Icons.keyboard_arrow_up, + color: Color(0xFF32A060), + size: 18, + ), + ], + ),), + ) ], ), ); diff --git a/lib/mine/mine_view/mine_view.dart b/lib/mine/mine_view/mine_view.dart index 380366ec..ea9811dd 100644 --- a/lib/mine/mine_view/mine_view.dart +++ b/lib/mine/mine_view/mine_view.dart @@ -374,16 +374,10 @@ class _MineView extends State { }, child: Container( padding: EdgeInsets.only(top: 4, bottom: 4, right: 16,left: 7), + margin: EdgeInsets.only(right: 14.w), decoration: BoxDecoration( - borderRadius: BorderRadius.only(topLeft: Radius.circular(100),bottomLeft:Radius.circular(100)), - gradient: LinearGradient( - begin: Alignment.topLeft, - end: Alignment.bottomRight, - colors: [ - Color(0xFFACDD60), - Color(0xFF32A060), - ], - ), + borderRadius: BorderRadius.circular(12), + color: Colors.white ), child: Row( mainAxisAlignment: MainAxisAlignment.end, @@ -396,7 +390,7 @@ class _MineView extends State { Text( "天天领积分", style: TextStyle( - color: Colors.white, + color: Color(0xFF32A060), fontSize: 12.sp, fontWeight: MyFontWeight.regular, ), diff --git a/lib/mine/recharge_page.dart b/lib/mine/recharge_page.dart index bfd050f0..002f04b7 100644 --- a/lib/mine/recharge_page.dart +++ b/lib/mine/recharge_page.dart @@ -21,6 +21,7 @@ import 'package:huixiang/utils/min.dart'; import 'package:huixiang/view_widget/item_input_widget.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:huixiang/view_widget/my_appbar.dart'; +import 'package:huixiang/view_widget/recharge_details_dialog.dart'; import 'package:huixiang/view_widget/round_button.dart'; import 'package:shared_preferences/shared_preferences.dart'; @@ -552,7 +553,7 @@ class _RechargePage extends State { onTap: (){ setState(() { if(selectIndex == index) - rechargeShowBottomSheet(); + showRecharge(index); }); }, child: Row( @@ -596,96 +597,14 @@ class _RechargePage extends State { } ///充值说明底部弹窗 - rechargeShowBottomSheet() { - showModalBottomSheet( - builder: (BuildContext context) { - return buildBottomSheetWidget(context); - }, - backgroundColor: Colors.transparent, - context: context); - } - - Widget buildBottomSheetWidget(BuildContext context) { - return Container( - padding: EdgeInsets.only(top: 12), - decoration: new BoxDecoration( - color: Colors.white, - borderRadius: new BorderRadius.only( - topLeft: const Radius.circular(25.0), - topRight: const Radius.circular(25.0))), - child: Container( - width: 299, - height:299, - child: Column( - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Expanded(child: - Container( - margin: EdgeInsets.symmetric(vertical: 12.h), - alignment: Alignment.center, - child: Text( - "充值说明", - style: TextStyle( - fontWeight: MyFontWeight.bold, - fontSize: 15.sp, - color: Color(0xFF353535), - ), - ), - )), - GestureDetector( - onTap: (){ - setState(() { - Navigator.of(context).pop(); - }); - }, - child: Icon( - Icons.clear, - color: Colors.black, - size: 18, - ), - ), - SizedBox(width: 14), - ], - ), - SizedBox(height: 12.h,), - Container( - width: double.infinity, - height: 1.h, - color: Color(0xFFF2F2F2), - margin: EdgeInsets.only(bottom:13.h), - ), - Padding(padding:EdgeInsets.only(left: 14), - child: - Row( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - if (vipRuleDetails?.recharge != null && - vipRuleDetails.recharge != "") - Expanded( - child: Container( - color: Colors.white, - child: Html( - data: "注意:${vipRuleDetails?.recharge ?? ""}", - customImageRenders: { - networkSourceMatcher(): networkImageRender( - loadingWidget: () { - return Container(); - }, - ), - }, - ), - ), - ) - ], - ),) - ], - ), - )); - } + showRecharge(index) { + showModalBottomSheet( + context: context, + backgroundColor: Colors.transparent, + builder: (context) { + return RechargeWidget(rechargeA[index]); + }); + } recharge() async { // String money = controller.text; diff --git a/lib/mine/roll_center_page.dart b/lib/mine/roll_center_page.dart index c5567f85..d3ca703a 100644 --- a/lib/mine/roll_center_page.dart +++ b/lib/mine/roll_center_page.dart @@ -7,6 +7,7 @@ import 'package:huixiang/retrofit/data/coupon.dart'; import 'package:huixiang/retrofit/data/page.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/view_widget/classic_header.dart'; +import 'package:huixiang/view_widget/coupon_details_dialog.dart'; import 'package:huixiang/view_widget/item_title.dart'; import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:huixiang/view_widget/my_footer.dart'; @@ -145,6 +146,9 @@ class _RollCenterPage extends State { coupons[position].isEx = !coupons[position].isEx; }); }, + (){ + showCouponDetails(position); + }, type: 1, ), ); @@ -192,4 +196,14 @@ class _RollCenterPage extends State { }, ); } + + ///使用详情 + showCouponDetails(index) { + showModalBottomSheet( + context: context, + backgroundColor: Colors.transparent, + builder: (context) { + return CouponDetailsWidget(coupons[index]); + }); + } } diff --git a/lib/mine/vip_balance_page.dart b/lib/mine/vip_balance_page.dart index 6fd28c3a..da15a98a 100644 --- a/lib/mine/vip_balance_page.dart +++ b/lib/mine/vip_balance_page.dart @@ -84,7 +84,7 @@ class _VipBalancePage extends State { Widget build(BuildContext context) { return Scaffold( appBar: MyAppBar( - title: S.of(context).yuemingxi, + title: S.of(context).yue, titleColor: Colors.black, background: Color(0xFFF7F7F7), leadingColor: Colors.black, diff --git a/lib/order/exchange_history_page.dart b/lib/order/exchange_history_page.dart index 3b00cb07..c75e29c5 100644 --- a/lib/order/exchange_history_page.dart +++ b/lib/order/exchange_history_page.dart @@ -331,6 +331,7 @@ class _ExchangeHistoryList extends State { mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ + if(exchangeOrder.useTyped != 3) Text( S.of(context).shouhuodi + " :", style: TextStyle( diff --git a/lib/order/exchange_order_page.dart b/lib/order/exchange_order_page.dart index a469f64b..7c3421d8 100644 --- a/lib/order/exchange_order_page.dart +++ b/lib/order/exchange_order_page.dart @@ -77,8 +77,8 @@ class _ExchangeOrderPage extends State { physics: BouncingScrollPhysics(), child: Column( children: [ - widget.arguments["useTyped"] == 1 - ? Container( + // widget.arguments["useTyped"] == 1 ? + Container( margin: EdgeInsets.only( left: 16, right: 16, top: 26, bottom: 8), padding: EdgeInsets.all(20), @@ -147,11 +147,11 @@ class _ExchangeOrderPage extends State { color: Color(0xFF353535), ), )), - Icon( - Icons.keyboard_arrow_right, - size: 16, - color: Color(0xFF32A060), - ), + // Icon( + // Icons.keyboard_arrow_right, + // size: 16, + // color: Color(0xFF32A060), + // ), ], ), ), @@ -270,244 +270,244 @@ class _ExchangeOrderPage extends State { ), ], ), - ) - : + ), + // : + // // Container( + // // margin: + // // EdgeInsets.only(left: 16, right: 16, top: 26, bottom: 8), + // // padding: EdgeInsets.all(20), + // // decoration: BoxDecoration( + // // color: Colors.white, + // // boxShadow: [ + // // BoxShadow( + // // color: Colors.black.withAlpha(12), + // // offset: Offset(0, 3), + // // blurRadius: 14, + // // spreadRadius: 0, + // // ) + // // ], + // // borderRadius: BorderRadius.all(Radius.circular(8)), + // // ), + // // child: Column( + // // mainAxisAlignment: MainAxisAlignment.spaceAround, + // // crossAxisAlignment: CrossAxisAlignment.start, + // // children: [ + // // Row( + // // children: [ + // // Image.asset( + // // "assets/image/icon_order_exchange_info.webp", + // // width: 24, + // // height: 24, + // // ), + // // SizedBox(width: 4), + // // Text( + // // S.of(context).duihuanxinxi, + // // style: TextStyle( + // // fontWeight: FontWeight.bold, + // // fontSize: 16, + // // color: Color(0xFF353535)), + // // ), + // // ], + // // ), + // // SizedBox( + // // height: 18.h, + // // ), + // // Row( + // // children: [ + // // Text( + // // S.of(context).lingqufangshi, + // // style: TextStyle( + // // fontSize: 14.sp, + // // color: Color(0xFF353535), + // // ), + // // ), + // // SizedBox( + // // width: 12.w, + // // ), + // // Text( + // // widget.arguments["useTyped"] == 1 + // // ? S.of(context).ziti + // // : widget.arguments["useTyped"] == 2 + // // ? S.of(context).peisong + // // : S.of(context).xianshangfafang, + // // style: TextStyle( + // // fontSize: 14.sp, + // // color: Color(0xFF353535), + // // ), + // // ), + // // ], + // // ), + // // SizedBox( + // // height: 12.h, + // // ), + // // Text( + // // "非实物商品兑换后领取到卡包即可使用!", + // // style: TextStyle( + // // fontSize: 14.sp, + // // color: Color(0xFF32A060), + // // fontWeight: MyFontWeight.medium + // // ), + // // ), + // // ], + // // ), + // // ), // Container( - // margin: - // EdgeInsets.only(left: 16, right: 16, top: 26, bottom: 8), - // padding: EdgeInsets.all(20), - // decoration: BoxDecoration( - // color: Colors.white, - // boxShadow: [ - // BoxShadow( - // color: Colors.black.withAlpha(12), - // offset: Offset(0, 3), - // blurRadius: 14, - // spreadRadius: 0, - // ) - // ], - // borderRadius: BorderRadius.all(Radius.circular(8)), - // ), - // child: Column( - // mainAxisAlignment: MainAxisAlignment.spaceAround, - // crossAxisAlignment: CrossAxisAlignment.start, - // children: [ - // Row( - // children: [ - // Image.asset( - // "assets/image/icon_order_exchange_info.webp", - // width: 24, - // height: 24, - // ), - // SizedBox(width: 4), - // Text( - // S.of(context).duihuanxinxi, - // style: TextStyle( - // fontWeight: FontWeight.bold, - // fontSize: 16, - // color: Color(0xFF353535)), - // ), - // ], - // ), - // SizedBox( - // height: 18.h, - // ), - // Row( - // children: [ - // Text( - // S.of(context).lingqufangshi, - // style: TextStyle( - // fontSize: 14.sp, - // color: Color(0xFF353535), + // margin: EdgeInsets.only( + // left: 16, right: 16, top: 26, bottom: 8), + // padding: EdgeInsets.all(20), + // decoration: BoxDecoration( + // color: Colors.white, + // boxShadow: [ + // BoxShadow( + // color: Colors.black.withAlpha(12), + // offset: Offset(0, 3), + // blurRadius: 14, + // spreadRadius: 0, + // ) + // ], + // borderRadius: + // BorderRadius.all(Radius.circular(8)), + // ), + // child: Column( + // children: [ + // Row( + // children: [ + // Image.asset( + // "assets/image/icon_order_exchange_info.webp", + // width: 24, + // height: 24, + // ), + // SizedBox(width: 4), + // Text( + // S.of(context).duihuanxinxi, + // style: TextStyle( + // fontWeight: FontWeight.bold, + // fontSize: 16, + // color: Color(0xFF353535)), // ), + // ], + // ), + // SizedBox( + // height: 18.h, + // ), + // GestureDetector( + // onTap: () { + // setState(() { + // showAlertDialog(); + // }); + // }, + // child: Row( + // children: [ + // Text( + // S.of(context).lingqufangshi, + // style: TextStyle( + // fontSize: 14.sp, + // color: Color(0xFF353535), + // ), + // ), + // SizedBox( + // width: 12.w, + // ), + // Expanded( + // child: Text( + // widget.arguments["useTyped"] == 1 + // ? S.of(context).ziti + // : widget.arguments["useTyped"] == 2 + // ? S.of(context).peisong + // : S.of(context).xianshangfafang, + // style: TextStyle( + // fontSize: 14.sp, + // color: Color(0xFF353535), + // ), + // )), + // Icon( + // Icons.keyboard_arrow_right, + // size: 16, + // color: Color(0xFF32A060), + // ), + // ], // ), - // SizedBox( - // width: 12.w, + // ), + // Visibility( + // child: SizedBox( + // height: 13.h, // ), - // Text( - // widget.arguments["useTyped"] == 1 - // ? S.of(context).ziti - // : widget.arguments["useTyped"] == 2 - // ? S.of(context).peisong - // : S.of(context).xianshangfafang, - // style: TextStyle( - // fontSize: 14.sp, - // color: Color(0xFF353535), - // ), + // visible: widget.arguments["useTyped"] != 3, + // ), + // Visibility( + // child: Row( + // children: [ + // Text( + // "收货地址", + // style: TextStyle( + // fontSize: 14.sp, + // color: Color(0xFF353535), + // ), + // ), + // SizedBox( + // width: 12.w, + // ), + // Expanded( + // child: GestureDetector( + // onTap: () { + // toAddressPicker(); + // }, + // child: Row( + // mainAxisAlignment: + // MainAxisAlignment.end, + // crossAxisAlignment: + // CrossAxisAlignment.end, + // mainAxisSize: MainAxisSize.min, + // children: [ + // Expanded( + // child: Text( + // (address != null && + // address != "") + // ? address + // : widget.arguments[ + // "useTyped"] == + // 1 + // ? S + // .of(context) + // .qingxuanzhemendian + // : widget.arguments[ + // "useTyped"] == + // 2 + // ? S + // .of(context) + // .qingxuanzeshouhuodizhi + // : S + // .of(context) + // .xuni, + // overflow: + // TextOverflow.ellipsis, + // style: TextStyle( + // fontSize: 14.sp, + // color: Color(0xFF32A060), + // ), + // ), + // flex: 1, + // ), + // Icon( + // Icons.keyboard_arrow_right, + // size: 16, + // color: Color(0xFF32A060), + // ), + // ], + // ), + // ), + // flex: 1, + // ), + // ], // ), - // ], - // ), - // SizedBox( - // height: 12.h, - // ), - // Text( - // "非实物商品兑换后领取到卡包即可使用!", - // style: TextStyle( - // fontSize: 14.sp, - // color: Color(0xFF32A060), - // fontWeight: MyFontWeight.medium + // visible: widget.arguments["useTyped"] != 3, // ), - // ), - // ], + // SizedBox( + // height: 12.h, + // ), + // ], + // ), // ), - // ), - Container( - margin: EdgeInsets.only( - left: 16, right: 16, top: 26, bottom: 8), - padding: EdgeInsets.all(20), - decoration: BoxDecoration( - color: Colors.white, - boxShadow: [ - BoxShadow( - color: Colors.black.withAlpha(12), - offset: Offset(0, 3), - blurRadius: 14, - spreadRadius: 0, - ) - ], - borderRadius: - BorderRadius.all(Radius.circular(8)), - ), - child: Column( - children: [ - Row( - children: [ - Image.asset( - "assets/image/icon_order_exchange_info.webp", - width: 24, - height: 24, - ), - SizedBox(width: 4), - Text( - S.of(context).duihuanxinxi, - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 16, - color: Color(0xFF353535)), - ), - ], - ), - SizedBox( - height: 18.h, - ), - GestureDetector( - onTap: () { - setState(() { - showAlertDialog(); - }); - }, - child: Row( - children: [ - Text( - S.of(context).lingqufangshi, - style: TextStyle( - fontSize: 14.sp, - color: Color(0xFF353535), - ), - ), - SizedBox( - width: 12.w, - ), - Expanded( - child: Text( - widget.arguments["useTyped"] == 1 - ? S.of(context).ziti - : widget.arguments["useTyped"] == 2 - ? S.of(context).peisong - : S.of(context).xianshangfafang, - style: TextStyle( - fontSize: 14.sp, - color: Color(0xFF353535), - ), - )), - Icon( - Icons.keyboard_arrow_right, - size: 16, - color: Color(0xFF32A060), - ), - ], - ), - ), - Visibility( - child: SizedBox( - height: 13.h, - ), - visible: widget.arguments["useTyped"] != 3, - ), - Visibility( - child: Row( - children: [ - Text( - "收货地址", - style: TextStyle( - fontSize: 14.sp, - color: Color(0xFF353535), - ), - ), - SizedBox( - width: 12.w, - ), - Expanded( - child: GestureDetector( - onTap: () { - toAddressPicker(); - }, - child: Row( - mainAxisAlignment: - MainAxisAlignment.end, - crossAxisAlignment: - CrossAxisAlignment.end, - mainAxisSize: MainAxisSize.min, - children: [ - Expanded( - child: Text( - (address != null && - address != "") - ? address - : widget.arguments[ - "useTyped"] == - 1 - ? S - .of(context) - .qingxuanzhemendian - : widget.arguments[ - "useTyped"] == - 2 - ? S - .of(context) - .qingxuanzeshouhuodizhi - : S - .of(context) - .xuni, - overflow: - TextOverflow.ellipsis, - style: TextStyle( - fontSize: 14.sp, - color: Color(0xFF32A060), - ), - ), - flex: 1, - ), - Icon( - Icons.keyboard_arrow_right, - size: 16, - color: Color(0xFF32A060), - ), - ], - ), - ), - flex: 1, - ), - ], - ), - visible: widget.arguments["useTyped"] != 3, - ), - SizedBox( - height: 12.h, - ), - ], - ), - ), Container( margin: EdgeInsets.only( left: 16, right: 16, top: 8, bottom: 16), @@ -1003,18 +1003,22 @@ class _ExchangeOrderPage extends State { } String handleNeedPay() { - return widget.arguments["payType"] == 1 - ? "${double.parse(widget.arguments["onePrice"]) * buyNum}积分".toString() - : (widget.arguments["payType"] == 2 - ? ((widget.arguments["price"] == null || - widget.arguments["price"] == "0" - ? "" - : "${double.parse(widget.arguments["price"]) * buyNum}积分") + - (widget.arguments["money"] == null || - widget.arguments["money"] == "0.00" - ? "" - : " + ${double.parse(widget.arguments["money"]) * buyNum}元")) - : "${double.parse(widget.arguments["oneMoney"]) * buyNum}元"); + if(widget.arguments["payType"] == 0) + return ""; + if(widget.arguments["payType"] == 1){ + return S.of(context).jifen_(double.parse(widget.arguments["onePrice"]) * buyNum); + }else if(widget.arguments["payType"] ==2){ + return (widget.arguments["price"] == null || + widget.arguments["price"] == "0" + ? "" + : "${double.parse(widget.arguments["price"]) * buyNum}积分") + + (widget.arguments["money"] == null || + widget.arguments["money"] == "0.00" + ? "" + : " + ${double.parse(widget.arguments["money"]) * buyNum}元"); + }else if(widget.arguments["payType"] == 3){ + return "${double.parse(widget.arguments["oneMoney"]) * buyNum}元"; + } } Widget checkPayView(var index) { diff --git a/lib/order/order_view/order_commodity.dart b/lib/order/order_view/order_commodity.dart index 6c800981..d04de318 100644 --- a/lib/order/order_view/order_commodity.dart +++ b/lib/order/order_view/order_commodity.dart @@ -178,14 +178,16 @@ class _OrderCommodity extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.center, children: [ - Text( + Expanded(child:Text( productList.productName, + maxLines: 1, + overflow: TextOverflow.ellipsis, style: TextStyle( fontWeight: FontWeight.bold, fontSize: 14.sp, color: Color(0xFF353535), ), - ), + )), Text( "x${productList.buyNum}", style: TextStyle( diff --git a/lib/order/order_view/order_status.dart b/lib/order/order_view/order_status.dart index 71046fdb..c1f09bb6 100644 --- a/lib/order/order_view/order_status.dart +++ b/lib/order/order_view/order_status.dart @@ -69,12 +69,12 @@ class _OrderStatus extends State { : widget.isTakeOut == 1 ? S.of(context).waimai : "物流", - width: 42.w * AppUtils.textScale(context), + width: 46.w * AppUtils.textScale(context), height: 20.h * AppUtils.textScale(context), textColor: Color(0xFF32A060), fontSize: 14.sp, padding: - EdgeInsets.fromLTRB(8.w, 1.h, 8.w, 1.h), + EdgeInsets.symmetric(horizontal:8), backgroup: Color(0xFFFFFFFF), radius: 15.w, ), diff --git a/lib/order/store_selector_page.dart b/lib/order/store_selector_page.dart index e5492a01..971d4f74 100644 --- a/lib/order/store_selector_page.dart +++ b/lib/order/store_selector_page.dart @@ -45,7 +45,9 @@ class _StoreSelectorPage extends State { SharedPreferences.getInstance().then((value) { apiService = - ApiService(Dio(), context: context, token: value.getString('token')); + ApiService(Dio(), + showLoading: true, + context: context, token: value.getString('token')); }); if (aMapFlutterLocation == null) { diff --git a/lib/qr/invite_friends.dart b/lib/qr/invite_friends.dart index 627e42de..5310f7bc 100644 --- a/lib/qr/invite_friends.dart +++ b/lib/qr/invite_friends.dart @@ -3,9 +3,9 @@ import 'dart:convert'; import 'package:dio/dio.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:flutter/rendering.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:huixiang/generated/l10n.dart'; -import 'package:huixiang/retrofit/data/article.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/invitation_list.dart'; import 'package:huixiang/retrofit/data/page.dart'; @@ -19,6 +19,9 @@ import 'package:huixiang/view_widget/my_footer.dart'; import 'package:huixiang/view_widget/no_data_view.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:shared_preferences/shared_preferences.dart'; +import 'package:sharesdk_plugin/sharesdk_defines.dart'; +import 'package:sharesdk_plugin/sharesdk_interface.dart'; +import 'package:sharesdk_plugin/sharesdk_map.dart'; class InviteFriends extends StatefulWidget { @override @@ -34,12 +37,19 @@ class _InviteFriends extends State { List invitationList = []; UserInfo userInfo; int pageNum = 1; + String phone = ""; @override void initState() { super.initState(); - queryInviteMember(); - queryInviteMember(); + SharedPreferences.getInstance().then((value) { + if (value.getString('user') != null && value.getString('user') != "") { + phone = UserInfo.fromJson(jsonDecode(value.getString('user'))).inviteCode; + setState(() {}); + } + queryInviteMember(); + queryInviteMember(); + }); } ///邀请记录 @@ -134,21 +144,21 @@ class _InviteFriends extends State { ), centerTitle: true, elevation: 0.0, - actions: [ - GestureDetector( - child: Container( - margin: EdgeInsets.only(right: 14), - padding:EdgeInsets.only(left:70,right: 20), - child: Icon( - Icons.more_horiz, - color: Colors.black, - ), - ), - onTap: () { - // Navigator.of(context).pop(); - // share(); - }) - ], + // actions: [ + // GestureDetector( + // child: Container( + // margin: EdgeInsets.only(right: 14), + // padding:EdgeInsets.only(left:70,right: 20), + // child: Icon( + // Icons.more_horiz, + // color: Colors.black, + // ), + // ), + // onTap: () { + // // Navigator.of(context).pop(); + // // share(); + // }) + // ], ), body: SmartRefresher( controller: refreshController, @@ -209,34 +219,39 @@ class _InviteFriends extends State { fit: BoxFit.fill, ), SizedBox(height: 12.h,), - Container( - width: double.infinity, - height: 52.h, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(26), - color: Color(0xFF00E16F), - ), - margin: EdgeInsets.symmetric(horizontal:14.w), - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Image.asset( - "assets/image/wx.webp", - height: 20, - width:20, - fit: BoxFit.fill, + GestureDetector( + onTap: (){ + widgetToUrl(); + }, + child: Container( + width: double.infinity, + height: 52.h, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(26), + color: Color(0xFF00E16F), ), - SizedBox(width:4.w,), - Text( - "邀请微信好友", - style: TextStyle( - fontWeight: MyFontWeight.semi_bold, - fontSize: 16.sp, - color: Color(0xFFFFFFFF), + margin: EdgeInsets.symmetric(horizontal:14.w), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Image.asset( + "assets/image/wx.webp", + height: 20, + width:20, + fit: BoxFit.fill, ), - ) - ], + SizedBox(width:4.w,), + Text( + "邀请微信好友", + style: TextStyle( + fontWeight: MyFontWeight.semi_bold, + fontSize: 16.sp, + color: Color(0xFFFFFFFF), + ), + ) + ], + ), ), ) ], @@ -736,4 +751,33 @@ class _InviteFriends extends State { ); } + GlobalKey globalKey = GlobalKey(); + + widgetToUrl() async { + SSDKMap params = SSDKMap() + ..setGeneral( + "邀请好友", + "", + [ + "", + ], + "https://pos.upload.gznl.top/0000/2022/06/0c4aa046-9da5-4053-84e6-a5c6ddb4387a.png", + "", + buildShareUrl(), + "", + "", + "", + "", + SSDKContentTypes.webpage, + ); + SharesdkPlugin.share(ShareSDKPlatforms.wechatSession, params, + (state, userData, contentEntity, error) { + print("share!$state"); + }); + } + + String buildShareUrl() { + return "http://192.168.10.134:5500/invite.html?invite=${phone}"; + } + } diff --git a/lib/qr/qr_share_image.dart b/lib/qr/qr_share_image.dart index 28c0feab..861a56ac 100644 --- a/lib/qr/qr_share_image.dart +++ b/lib/qr/qr_share_image.dart @@ -8,7 +8,6 @@ import 'package:huixiang/utils/font_weight.dart'; import 'dart:ui' as ui; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:path_provider/path_provider.dart'; -import 'package:qr_flutter/qr_flutter.dart'; import 'package:sharesdk_plugin/sharesdk_plugin.dart'; class QrShareImagePage extends StatefulWidget { diff --git a/lib/retrofit/data/coupon.dart b/lib/retrofit/data/coupon.dart index 8da93e46..b1009616 100644 --- a/lib/retrofit/data/coupon.dart +++ b/lib/retrofit/data/coupon.dart @@ -23,9 +23,11 @@ class Coupon { bool centreDisplay; bool allProduct; String tenantCode; + String remark; String tenantName; int isDelete; String couponName; + String limitAmount; String couponImg; String couponDescription; String memberCouponId; @@ -55,9 +57,11 @@ class Coupon { ..centreDisplay = json['centreDisplay'] as bool ..allProduct = json['allProduct'] as bool ..tenantCode = json['tenantCode'] as String + ..remark = json['remark'] as String ..tenantName = json['tenantName'] as String ..isDelete = json['isDelete'] as int ..couponName = json['couponName'] as String + ..limitAmount = json['limitAmount'] as String ..couponImg = json['couponImg'] as String ..couponDescription = json['couponDescription'] as String ..memberCouponId = json['memberCouponId'] as String @@ -88,9 +92,11 @@ class Coupon { 'centreDisplay': this.centreDisplay, 'allProduct' : this.allProduct, 'tenantCode': this.tenantCode, + 'remark':this.remark, 'tenantName': this.tenantName, 'isDelete': this.isDelete, 'couponName': this.couponName, + 'limitAmount': this.limitAmount, 'couponImg': this.couponImg, 'couponDescription': this.couponDescription, 'memberCouponId': this.memberCouponId, diff --git a/lib/retrofit/data/settleOrderInfo.dart b/lib/retrofit/data/settleOrderInfo.dart index d045b833..fc5e566a 100644 --- a/lib/retrofit/data/settleOrderInfo.dart +++ b/lib/retrofit/data/settleOrderInfo.dart @@ -223,6 +223,7 @@ class CouponListBean { int fullNumber; int discountPercent; String bizId; + String limitAmount; String publishStartTime; String publishEndTime; String useStartTime; @@ -254,6 +255,7 @@ class CouponListBean { couponListBean.fullNumber = map['fullNumber']; couponListBean.discountPercent = map['discountPercent']; couponListBean.bizId = map['bizId']; + couponListBean.limitAmount = map['limitAmount']; couponListBean.publishStartTime = map['publishStartTime']; couponListBean.publishEndTime = map['publishEndTime']; couponListBean.useStartTime = map['useStartTime']; @@ -283,6 +285,7 @@ class CouponListBean { "fullNumber": fullNumber, "discountPercent": discountPercent, "bizId": bizId, + "limitAmount":limitAmount, "publishStartTime": publishStartTime, "publishEndTime": publishEndTime, "useStartTime": useStartTime, diff --git a/lib/retrofit/retrofit_api.dart b/lib/retrofit/retrofit_api.dart index ebd2d0da..d05b7563 100644 --- a/lib/retrofit/retrofit_api.dart +++ b/lib/retrofit/retrofit_api.dart @@ -81,7 +81,7 @@ abstract class ApiService { BuildContext context, String token, bool showLoading = false, - bool pay = false, + bool pay = true, }) { Map headers = (token == null || token == "") ? {} : {'token': "Bearer $token"}; diff --git a/lib/setting/logout_page.dart b/lib/setting/logout_page.dart index 1c4e0c32..00eafdec 100644 --- a/lib/setting/logout_page.dart +++ b/lib/setting/logout_page.dart @@ -118,7 +118,7 @@ class _LogoutPage extends State { ), _textRich("1.首先,保在您开始注销操作前,请先进行以下确认,保证帐号、财产完全:" "\n   •帐号处于安全状态;" - "\n   •请确认平台余额以及店铺余额清零,否则将不予注销;" + "\n   •请确认平台余额以及清零,否则将不予注销;" "\n   •请确认当下无正在进行中的交易,否则无法进行注销操作;。"), _textRich( "2.勾选《一心回乡账号注销协议》,点击注销后,系统将判定帐号是否符合注销条件,符合后进行手机号验证,输入正确验证码后既注销完成。"), diff --git a/lib/setting/treaty_page.dart b/lib/setting/treaty_page.dart index c434a42e..20ccf1c2 100644 --- a/lib/setting/treaty_page.dart +++ b/lib/setting/treaty_page.dart @@ -45,147 +45,6 @@ class _TreatyPage extends State { initialUrl: "http://huixiang.lotus-wallet.com/Privacy.html", javascriptMode: JavascriptMode.unrestricted, )), - // Container( - // width: MediaQuery.of(context).size.width, - // height: MediaQuery.of(context).size.height, - // margin: EdgeInsets.only(left: 20, right: 20, top: 10), - // child: SingleChildScrollView( - // physics: BouncingScrollPhysics(), - // child: Column( - // mainAxisAlignment: MainAxisAlignment.spaceEvenly, - // crossAxisAlignment: CrossAxisAlignment.start, - // children: [ - // Padding( - // padding: EdgeInsets.only(top: 5), - // child: Align( - // alignment: Alignment.center, - // child: Text( - // "用户注册及使用App隐私协议", - // style: TextStyle( - // fontSize: 18.sp, - // fontWeight: MyFontWeight.semi_bold, - // color: Color(0xff00A359), - // ), - // ), - // ), - // ), - // SizedBox( - // height: 32.h, - // ), - // _textRich("    在此特别提醒您(用户)在注册成为用户之前,请认真阅读本《用户注册及使用App隐私协议》" - // "(以下简称「协议」),确保您充分理解本协议中各条款。请您审慎阅读并选择接受或不接受本协议。除非您接受本协议所有条款," - // "否则您无权注册、登录或使用本协议所涉服务。您的注册、登录、使用等行为将视为对本协议的接受,并同意接受本协议各项条款" - // "的约束。本协议约定知理知己(武汉)文化科技有限公司(以下简称「一心回乡」)与用户之间关于一心回乡软件服务(以下简称" - // "「服务」)的权利义务。用户,是指注册、登录、使用本服务的个人或组织。本协议可由一心回乡随时更新,更新后的协议条款一旦" - // "公布即代替原来的协议条款,恕不再另行通知,用户可在本App中查阅最新版协议条款。在修改协议条款后,如果用户不接受修改后" - // "的条款,请立即停止使用一心回乡提供的服务,用户继续使用一心回乡提供的服务将被视为接受修改后的协议。"), - // Padding( - // padding: EdgeInsets.only(bottom: 25), - // child: Text( - // "一、账号注册", - // style: TextStyle( - // fontSize: 18.sp, - // fontWeight: MyFontWeight.semi_bold, - // height: 1.2, - // color: Color(0xff32A060)), - // ), - // ), - // _textRich("    1、用户在使用本服务前需要注册一个一心回乡App账号。一心回乡App账号应当使用手机号码绑定注册," - // "请用户使用尚未与一心回乡App账号绑定的手机号码,以及未被一心回乡根据本协议封禁的手机号码注册一心回乡App账号。" - // "一心回乡可以根据用户需求或产品需要对账号注册和绑定的方式进行变更,而无须事先通知用户。" - // "\n    2、鉴于一心回乡App账号的绑定注册方式,您同意一心回乡在注册时将允许您的手机号码及手机设备识别码等信息用于注册。" - // "\n    3、在用户注册及使用本服务时,一心回乡需要搜集能识别用户身份的个人信息以便一心回乡可以在必要时联系用户," - // "或为用户提供更好的使用体验。一心回乡搜集的信息包括但不限于用户的姓名、地址;一心回乡同意对这些信息的使用将受限于第三条用户个人隐私信息保护的约束。"), - // Padding( - // padding: EdgeInsets.only(bottom: 25), - // child: Text( - // "二、用户个人隐私信息保护", - // style: TextStyle( - // fontSize: 18.sp, - // fontWeight: MyFontWeight.semi_bold, - // height: 1.2, - // color: Color(0xff32A060)), - // ), - // ), - // _textRich("    1、如果一心回乡发现或收到他人举报或投诉用户违反本协议约定的,一心回乡" - // "有权不经通知随时对相关内容,包括但不限于用户资料、发布记录进行审查、删除,并视情节轻重对违" - // "规账号处以包括但不限于警告、账号封禁、设备封禁、功能封禁的处罚,且通知用户处理结果。" - // "\n    2、因违反用户协议被封禁的用户,可以自行与一心回乡联系。其中,被实施功能封禁的用户会在" - // "封禁期届满后自动恢复被封禁功能。被封禁用户可提交申诉,一心回乡将对申诉进行审查,并自行合理判断决定是否变更处罚措施。" - // "\n    3、用户理解并同意,一心回乡有权依合理判断对违反有关法律法规或本协议规定的行为进行处罚," - // "对违法违规的任何用户采取适当的法律行动,并依据法律法规保存有关信息向有关部门报告等,用户应承担由此而产生的一切法律责任。" - // "\n    4、用户理解并同意,因用户违反本协议约定,导致或产生的任何第三方主张的任何索赔、要求或损失," - // "包括合理的律师费,用户应当赔偿一心回乡与合作公司、关联公司,并使之免受损害。"), - // Padding( - // padding: EdgeInsets.only(bottom: 25), - // child: Text( - // "三、用户发布内容规范", - // style: TextStyle( - // fontSize: 18.sp, - // fontWeight: MyFontWeight.semi_bold, - // height: 1.2, - // color: Color(0xff32A060)), - // ), - // ), - // _textRich("   1、本条所述内容是指用户使用一心回乡App的过程中所制作、上传、复制、发布、传播的任何内容,包括但不限" - // "于账号头像、名称、用户说明等注册信息及认证资料,或文字、语音、图片、视频、图文等发送、回复或自动回复消息和" - // "相关链接页面,以及其他使用账号或本服务所产生的内容。" - // "\n    2、用户不得利用一心回乡App账号或本服务制作、上传、复制、发布、传播如下法律、法规和政策禁止的内容:" - // "\n    (1) 反对宪法所确定的基本原则的\n    (2) 危害国家安全,泄露国家秘密,颠覆国家政权,破坏国家统一的;" - // "\n    (3)损害国家荣誉和利益的;\n    (4) 煽动民族仇恨、民族歧视,破坏民族团结的;" - // "\n    (5) 破坏国家宗教政策,宣扬邪教和封建迷信的;\n    (6) 散布谣言,扰乱社会秩序,破坏社会稳定的;" - // "\n    (7) 散布淫秽、色情、赌博、暴力、凶杀、恐怖或者教唆犯罪的;\n    (8) 侮辱或者诽谤他人,侵害他人合法权益的;" - // "\n    (9) 含有法律、行政法规禁止的其他内容的信息。" - // "\n    3、用户不得利用一心回乡App账号或本服务制作、上传、复制、发布、传播如下干扰一心回乡App正常运营,以及侵犯其他用户或第三方合法权益的内容:" - // "\n    (1) 含有任何性或性暗示的;" - // "\n    (2) 含有辱骂、恐吓、威胁内容的;\n    (3) 含有骚扰、垃圾广告、恶意信息、诱骗信息的;" - // "\n    (4) 涉及他人隐私、个人信息或数据的;\n    (5) 侵害他人名誉权、肖像权、知识产权、商业秘密等合法权利的;" - // "\n    (6) 含有其他干扰本服务正常运营和侵犯其他用户或第三方合法权益内容的信息。"), - // Padding( - // padding: EdgeInsets.only(bottom: 25), - // child: Text( - // "四、使用规则", - // style: TextStyle( - // fontSize: 18.sp, - // fontWeight: MyFontWeight.semi_bold, - // height: 1.2, - // color: Color(0xff32A060)), - // ), - // ), - // _textRich( - // "   1、用户在本服务中或通过本服务所传送、发布的任何内容并不反映或代表,也不得被视为反映或代表一心回乡的观点、立场或政策,一心回乡对此不承担任何责任。" - // "\n    2、用户不得利用一心回乡App账号或本服务进行如下行为:\n    (1) 提交、发布虚假信息,或盗用他人头像或数据,冒充、利用他人名义的;" - // "\n    (2) 强制、诱导其他用户关注、点击连接页面或分享信息的;\n    (3) 虚构事实、隐瞒真相以误导、欺骗他人的;" - // "\n    (4) 利用技术手段批量建立虚假账号的;\n    (5)利用一心回乡App账号或本服务从事任何违法犯罪活动的;" - // "\n    (6) 制作、发布与以上行为相关的方法、工具,或对此类方法、工具进行运营或传播,无论这些行为是否为商业目的;" - // "\n    (7) 其他违反法律法规规定、侵犯其他用户合法权益、干扰一心回乡App正常运营或脚印未明示授权的行为。" - // "\n    3、用户须对利用一心回乡App账号或本服务传送信息的真实性、合法性、无害性、准确性、有效性等全权负责," - // "与用户所传播的信息相关的任何法律责任由用户自行承担,与一心回乡无关。如因此给一心回乡或第三方造成损害的,用户应当依法予以赔偿。" - // "\n    4、一心回乡提供的服务中可能包括广告,用户同意在使用过程中显示一心回乡和第三方供应商、合作伙伴提供的广告。" - // "除法律法规明确规定外,用户应自行对依该广告信息进行的交易负责,对用户因依该广告信息进行的交易或前述广告商提供的内容而遭受的损失或损害,一心回乡不承担任何责任。"), - // Padding( - // padding: EdgeInsets.only(bottom: 25), - // child: Text( - // "五、其他", - // style: TextStyle( - // fontSize: 18.sp, - // fontWeight: MyFontWeight.semi_bold, - // height: 1.2, - // color: Color(0xff32A060)), - // ), - // ), - // _textRich("   1、一心回乡郑重提醒用户注意本协议中免除脚印责任和限制用户权利的条款,请用户仔细阅读,自主考虑风险。" - // "未成年人应在法定监护人的陪同下阅读本协议。\n    2、本协议的效力、解释及纠纷的解决,适用于中华人民共和国法律。" - // "若用户和脚印之间发生任何纠纷或争议,首先应友好协商解决,协商不成的,用户同意将纠纷或争议提交脚印住所地有管辖权的人民法院管辖。" - // "\n    3、本协议的任何条款无论因何种原因无效或不具可执行性,其余条款仍有效,对双方具有约束力。\n    4、本协议最终解释" - // "权归脚印所有,据知理知己(武汉)有限责任公司免责条款特此声明:该应用注册及隐私协议与知理知己(武汉)有限责任公司无关。政策认为合适的披露。"), - // SizedBox( - // height: 50.h, - // ), - // ], - // ), - // ), - // ), ); } diff --git a/lib/settlement/settlement_view/coupon.dart b/lib/settlement/settlement_view/coupon.dart index f8998f46..a3b725b7 100644 --- a/lib/settlement/settlement_view/coupon.dart +++ b/lib/settlement/settlement_view/coupon.dart @@ -23,6 +23,8 @@ class CouponWidget extends StatefulWidget { } } + + class _CouponWidget extends State { @override Widget build(BuildContext context) { @@ -52,53 +54,55 @@ class _CouponWidget extends State { mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, children: [ - Expanded( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Expanded( - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.baseline, - textBaseline: TextBaseline.alphabetic, - children: [ - Text( - "¥", - style: TextStyle( - fontSize: 22.sp, - fontWeight: MyFontWeight.medium, - color: Color(0xff32A060), - ), - ), - SizedBox( - height: 4.h, - ), - Text( - "${double.tryParse(widget.couponList.discountAmount).toInt()}", - style: TextStyle( - fontSize: 40.sp, - fontWeight: MyFontWeight.semi_bold, - color: Color(0xff32A060), - ), - ), - ], - ), - ), - Text( - S - .of(context) - .manyuankeyong(widget.couponList.fullAmount), - style: TextStyle( - fontSize: 12.sp, - fontWeight: MyFontWeight.semi_bold, - color: Color(0xff32A060), - ), - ), - ], - ), - flex: 1, - ), + // Expanded( + // child: Column( + // mainAxisAlignment: MainAxisAlignment.center, + // crossAxisAlignment: CrossAxisAlignment.center, + // children: [ + // Expanded( + // child: Row( + // mainAxisAlignment: MainAxisAlignment.center, + // crossAxisAlignment: CrossAxisAlignment.baseline, + // textBaseline: TextBaseline.alphabetic, + // children: [ + // Text( + // "¥", + // style: TextStyle( + // fontSize: 22.sp, + // fontWeight: MyFontWeight.medium, + // color: Color(0xff32A060), + // ), + // ), + // SizedBox( + // height: 4.h, + // ), + // Text( + // "${double.tryParse(widget.couponList.discountAmount).toInt()}", + // style: TextStyle( + // fontSize: 40.sp, + // fontWeight: MyFontWeight.semi_bold, + // color: Color(0xff32A060), + // ), + // ), + // ], + // ), + // ), + // Text( + // S.of(context) + // .manyuankeyong(widget.couponList.fullAmount), + // style: TextStyle( + // fontSize: 12.sp, + // fontWeight: MyFontWeight.semi_bold, + // color: Color(0xff32A060), + // ), + // ), + // ], + // ), + // flex: 1, + // ), + SizedBox(width:8,), + couponListWidget(context), + SizedBox(width:5,), Expanded( flex: 2, child: Column( @@ -265,4 +269,179 @@ class _CouponWidget extends State { ), ); } + + Widget couponListWidget(BuildContext context) { + if (widget.couponList.bizType == 1) { + return Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.baseline, + textBaseline: TextBaseline.alphabetic, + children: [ + Text( + "¥", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xff32A060), + ), + ), + SizedBox( + height: 4.h, + ), + Text( + widget.couponList != null + ? double.tryParse("${widget.couponList.discountAmount}" ?? "0") + .toInt() + .toString() + : "", + style: TextStyle( + fontSize: 30.sp, + fontWeight: MyFontWeight.semi_bold, + color: Color(0xff32A060), + ), + ), + ], + ), + Text( + S.of(context).manyuankeyong(widget.couponList != null + ? ("${widget.couponList.fullAmount}" ?? "0") + .toString() + : ""), + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.semi_bold, + color: Color(0xff32A060), + ), + ), + ], + ); + } else if (widget.couponList.bizType == 3) { + return Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Container( + padding: EdgeInsets.only(bottom:10,top: 7,left: 12), + child: Text( + S.of(context).duihuanquan, + style: TextStyle( + fontSize: 26.sp, + fontWeight: MyFontWeight.semi_bold, + color: Color(0xff32A060), + ), + ), + ), + Text( + S.of(context).xianshangshiyong, + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.semi_bold, + color: Color(0xff32A060), + ), + ), + ], + ); + } else if (widget.couponList.bizType == 5) { + return Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Container( + padding: EdgeInsets.only(bottom:10,top: 7,left: 12), + child: Text( + S.of(context).duihuanquan, + style: TextStyle( + fontSize: 26.sp, + fontWeight: MyFontWeight.semi_bold, + color: Color(0xff32A060), + ), + ), + ), + Text( + S.of(context).xianxiashiyong, + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.semi_bold, + color: Color(0xff32A060), + ), + ), + ], + ); + } else if (widget.couponList.bizType == 6) { + return Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.baseline, + textBaseline: TextBaseline.alphabetic, + children: [ + Text( + "¥", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.medium, + color: widget.couponList.status == 3 ? Color(0xFFB3B3B3):Color(0xff32A060), + ), + ), + SizedBox( + height: 4.h, + ), + Text( + widget.couponList != null + ? double.tryParse("${widget.couponList.limitAmount}" ?? "0").toStringAsFixed(2) + : "", + style: TextStyle( + fontSize: 28.sp, + fontWeight: MyFontWeight.semi_bold, + color: Color(0xff32A060), + ), + ), + ], + ), + ], + ); + }else{ + return Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.baseline, + textBaseline: TextBaseline.alphabetic, + children: [ + Text( + widget.couponList != null + ? "${(widget.couponList.discountPercent / 10.0 >= 10) ? 10 : widget.couponList.discountPercent / 10.0}" ?? + "0" + : "", + style: TextStyle( + fontSize: 30.sp, + fontWeight: MyFontWeight.semi_bold, + color: Color(0xff32A060), + ), + ), + SizedBox( + height: 4.h, + ), + Text( + "折", + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.semi_bold, + color: Color(0xff32A060), + ), + ), + ], + ), + ], + ); + } + } } diff --git a/lib/settlement/settlement_view/settlement_order_commodity.dart b/lib/settlement/settlement_view/settlement_order_commodity.dart index 5d98c2d8..54c707b8 100644 --- a/lib/settlement/settlement_view/settlement_order_commodity.dart +++ b/lib/settlement/settlement_view/settlement_order_commodity.dart @@ -146,14 +146,17 @@ class _SettlementOrderCommodity extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.center, children: [ - Text( + Expanded(child: Text( productList.productName, + maxLines: 1, + overflow: TextOverflow.ellipsis, style: TextStyle( fontWeight: FontWeight.bold, fontSize: 14.sp, color: Color(0xFF353535), ), - ), + ),), + Text( "x${productList.buyNum}", style: TextStyle( diff --git a/lib/store/store_order.dart b/lib/store/store_order.dart index 1ae3aa53..11112dfc 100644 --- a/lib/store/store_order.dart +++ b/lib/store/store_order.dart @@ -436,7 +436,7 @@ class _StoreOrderPage extends State child: ),*/ ), - if(count() != 0) + // if(count() != 0) Positioned( bottom: 0, left: 0, @@ -645,6 +645,8 @@ class _StoreOrderPage extends State position < storeInfo.bannerList.length) ? storeInfo.bannerList[position].imgUrl : "", + height: 230.h, + width:double.infinity, fit: BoxFit.cover, radius: BorderRadius.zero, errorSrc: "assets/image/default_2_1.webp", diff --git a/lib/store/store_view/product_sku.dart b/lib/store/store_view/product_sku.dart index 584f0708..e57a5f7e 100644 --- a/lib/store/store_view/product_sku.dart +++ b/lib/store/store_view/product_sku.dart @@ -114,8 +114,8 @@ class _ProductSku extends State { children: [ MImage( widget.miNiDetail.imgs[0], - width: 75, - height: 75, + width: 76, + height: 76, fit: BoxFit.cover, radius: BorderRadius.circular(4), errorSrc: "assets/image/default_1.webp", diff --git a/lib/store/store_view/shop_goods.dart b/lib/store/store_view/shop_goods.dart index 7c029067..2b2fa373 100644 --- a/lib/store/store_view/shop_goods.dart +++ b/lib/store/store_view/shop_goods.dart @@ -83,20 +83,20 @@ class _ShopGoods extends State { ), ), ), - Image.asset( - "assets/image/green_leaf.webp", - fit: BoxFit.cover, - width: 12, - height: 12, - ), - Text( - "X300", - style: TextStyle( - color: Color(0xFF55BC51), - fontSize: 10.sp, - fontWeight: MyFontWeight.semi_bold, - ), - ), + // Image.asset( + // "assets/image/green_leaf.webp", + // fit: BoxFit.cover, + // width: 12, + // height: 12, + // ), + // Text( + // "X300", + // style: TextStyle( + // color: Color(0xFF55BC51), + // fontSize: 10.sp, + // fontWeight: MyFontWeight.semi_bold, + // ), + // ), ], ), SizedBox( @@ -141,23 +141,23 @@ class _ShopGoods extends State { SizedBox( width: 2.w, ), - Container( - width: 44.w, - height: 18.h, - decoration: BoxDecoration( - color: Color(0xFFFF4500), - borderRadius: BorderRadius.circular(2), - ), - alignment: Alignment.center, - child: Text( - "APP专享", - style: TextStyle( - color: Color(0xFFFFFFFF), - fontSize: 10.sp, - fontWeight: MyFontWeight.medium, - ), - ), - ), + // Container( + // width: 44.w, + // height: 18.h, + // decoration: BoxDecoration( + // color: Color(0xFFFF4500), + // borderRadius: BorderRadius.circular(2), + // ), + // alignment: Alignment.center, + // child: Text( + // "APP专享", + // style: TextStyle( + // color: Color(0xFFFFFFFF), + // fontSize: 10.sp, + // fontWeight: MyFontWeight.medium, + // ), + // ), + // ), ], ), Spacer(), diff --git a/lib/union/un_page.dart b/lib/union/un_page.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/union/union_page.dart b/lib/union/union_page.dart index 0b3eda52..4ae8195e 100644 --- a/lib/union/union_page.dart +++ b/lib/union/union_page.dart @@ -37,7 +37,7 @@ class UnionPage extends StatefulWidget { } class _UnionPage extends State - with AutomaticKeepAliveClientMixin, WidgetsBindingObserver { + with AutomaticKeepAliveClientMixin, WidgetsBindingObserver,SingleTickerProviderStateMixin { final RefreshController refreshController = RefreshController(initialRefresh: false); final RefreshController refreshController1 = @@ -50,6 +50,8 @@ class _UnionPage extends State bool isKeyBoardShow = false; BMFCoordinate latLng; + + @override void dispose() { super.dispose(); @@ -83,6 +85,11 @@ class _UnionPage extends State @override void initState() { super.initState(); + if (tabController == null) + tabController = TabController(length: 4, vsync: this); + tabController?.addListener(() { + startLocation(); + }); WidgetsBinding.instance.addObserver(this); eventBus.on().listen((event) { @@ -179,7 +186,7 @@ class _UnionPage extends State value.getString("province"), value.getString("city"), value.getString("district"), - editingController.text, + editingController.text ), setState(() { if (_mapController != null) { @@ -202,12 +209,13 @@ class _UnionPage extends State queryStore(latitude, longitude, province, city, district, searchKey) async { BaseData> baseData = await apiService.queryStore({ - // "city": city, - // "district": district, - // "province": province, + "city": city, + "district": district, + "province": province, "latitude": latitude, "longitude": longitude, - "searchKey": searchKey + "searchKey": searchKey, + "serviceType":tabController.index == 0 ?"":(tabController.index==1?"EATSTORE":(tabController.index == 2?"DRINKSTORE":"HAPPYSTORE")), }).catchError((error) { refreshController.refreshFailed(); }); @@ -220,13 +228,12 @@ class _UnionPage extends State EasyLoading.dismiss(); setState(() {}); } + TabController tabController; @override Widget build(BuildContext context) { super.build(context); - return DefaultTabController( - length: 4, - child: Scaffold( + return Scaffold( appBar: MyAppBar( title: "", leading: false, @@ -234,6 +241,7 @@ class _UnionPage extends State titleChild: PreferredSize( preferredSize: Size(double.infinity, 38.h), child: TabBar( + controller: tabController, isScrollable: true, //可滚动 indicatorColor: Color(0xff39B54A), @@ -260,6 +268,7 @@ class _UnionPage extends State ), )), body: TabBarView( + controller: tabController, children: [ buildItem(refreshController), buildItem(refreshController1), @@ -267,7 +276,6 @@ class _UnionPage extends State buildItem(refreshController3), ], ), - ), ); // GestureDetector( // onTap: () { @@ -351,7 +359,7 @@ class _UnionPage extends State // ); } - Widget buildItem(RefreshController refreshController) { + Widget buildItem(RefreshController refreshController,) { return Column( children: [ buildSearchItem(), @@ -411,6 +419,8 @@ class _UnionPage extends State ); } + + BMFMapController _mapController; final TextEditingController editingController = TextEditingController(); diff --git a/lib/view_widget/coupon_details_dialog.dart b/lib/view_widget/coupon_details_dialog.dart new file mode 100644 index 00000000..e9e55f38 --- /dev/null +++ b/lib/view_widget/coupon_details_dialog.dart @@ -0,0 +1,94 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_html/flutter_html.dart'; +import 'package:huixiang/generated/l10n.dart'; +import 'package:huixiang/retrofit/data/coupon.dart'; +import 'package:huixiang/retrofit/data/store.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:huixiang/store/scan.dart'; +import 'package:huixiang/utils/font_weight.dart'; +import 'package:huixiang/view_widget/border_text.dart'; +import 'package:huixiang/view_widget/custom_image.dart'; +import 'package:huixiang/view_widget/round_button.dart'; + +class CouponDetailsWidget extends StatefulWidget { + final Coupon coupon; + CouponDetailsWidget(this.coupon); + @override + State createState() { + return _CouponDetailsWidget(); + } +} + +class _CouponDetailsWidget extends State { + int selectIndex = 0; + + @override + Widget build(BuildContext context) { + return Container( + width: double.infinity, + height:291.h, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(8), + topRight: Radius.circular(8), + ), + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Expanded( + child: Container( + alignment: Alignment.center, + margin: EdgeInsets.symmetric(vertical: 12), + child: Text( + "使用详情", + style: TextStyle( + fontWeight: MyFontWeight.bold, + fontSize: 15.sp, + color: Color(0xFF353535), + ), + ), + )), + GestureDetector( + onTap: () { + setState(() { + Navigator.of(context).pop(); + }); + }, + child: Icon( + Icons.clear, + color: Colors.black, + size: 18, + ), + ), + SizedBox(width: 14), + ], + ), + Container( + width: double.infinity, + height: 1.h, + color: Color(0xFFF2F2F2), + margin: EdgeInsets.only(bottom: 11.h), + ), + Container( + color: Colors.white, + child: Html( + data: widget.coupon.remark ?? "", + customImageRenders: { + networkSourceMatcher(): networkImageRender( + loadingWidget: () { + return Container(); + }, + ), + }, + ), + ), + ])); + } +} diff --git a/lib/view_widget/mine_vip_entry.dart b/lib/view_widget/mine_vip_entry.dart index bebbb23d..e5d33c45 100644 --- a/lib/view_widget/mine_vip_entry.dart +++ b/lib/view_widget/mine_vip_entry.dart @@ -131,7 +131,7 @@ class MineVipEntry extends StatelessWidget { height: 14, ), Container( - height: 8.h, + height: 4.h, child: ClipRRect( borderRadius: BorderRadius.circular(6.5), child: LinearProgressIndicator( diff --git a/lib/view_widget/my_appbar.dart b/lib/view_widget/my_appbar.dart index b03257d4..a464ca01 100644 --- a/lib/view_widget/my_appbar.dart +++ b/lib/view_widget/my_appbar.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:huixiang/utils/font_weight.dart'; class MyAppBar extends StatelessWidget implements PreferredSizeWidget { final Function onTap; @@ -59,6 +60,7 @@ class MyAppBar extends StatelessWidget implements PreferredSizeWidget { brightness: brightness, leading: leading ? GestureDetector( + behavior: HitTestBehavior.opaque, onTap: () { if(exit == null) Navigator.of(context).pop(); @@ -66,7 +68,7 @@ class MyAppBar extends StatelessWidget implements PreferredSizeWidget { }, child: Container( alignment: Alignment.centerRight, - margin: EdgeInsets.only(left: 12), + margin: EdgeInsets.only(left: 12,), padding: EdgeInsets.all(6), child: Icon( Icons.arrow_back_ios, @@ -81,16 +83,24 @@ class MyAppBar extends StatelessWidget implements PreferredSizeWidget { leadingWidth: leading ? 56 : 10.w, title: ((title == null || title == "") && titleChild != null) ? titleChild - : Container( - width: double.infinity, - margin: EdgeInsets.only(right:34.w), - alignment: Alignment.center, - child: Text( - title, - style: TextStyle( - color: titleColor, - fontWeight: FontWeight.bold, - fontSize: titleSize, + : GestureDetector( + onTap: () { + if(exit == null) + Navigator.of(context).pop(); + else exit(); + }, + child: Container( + width: double.infinity, + margin: EdgeInsets.only(right:34.w), + padding: EdgeInsets.all(10), + alignment: Alignment.center, + child: Text( + title, + style: TextStyle( + color: titleColor, + fontWeight: MyFontWeight.medium, + fontSize: titleSize, + ), ), ), ), diff --git a/lib/view_widget/new_coupon_widget.dart b/lib/view_widget/new_coupon_widget.dart index 94c64733..96785008 100644 --- a/lib/view_widget/new_coupon_widget.dart +++ b/lib/view_widget/new_coupon_widget.dart @@ -10,16 +10,16 @@ class NewCouponWidget extends StatelessWidget { // final Function couponDialog; final GestureTapCallback callbackEx; final Coupon coupon; + final Function showCouponDetails; final int type; - NewCouponWidget(this.coupon, this.callback,this.callbackEx, {this.type = 1}); + NewCouponWidget(this.coupon, this.callback,this.callbackEx,this.showCouponDetails, {this.type = 1}); @override Widget build(BuildContext context) { return buildCoupon(context); } - String getCouponStoreName(){ String couponStoreName = coupon.tenantName; if(coupon?.storeList != null && coupon.storeId != "0"){ @@ -30,6 +30,7 @@ class NewCouponWidget extends StatelessWidget { } return couponStoreName; } + ///优惠券ui Widget buildCoupon(BuildContext context) { // if(coupon != null) { @@ -41,7 +42,7 @@ class NewCouponWidget extends StatelessWidget { // } return Container( - height: (coupon != null && coupon.isEx) ? 168.h : 151.h, + height: (coupon != null && coupon.isEx) ? 155.h : 135.h, width: double.infinity, margin: EdgeInsets.fromLTRB(14.w, 6.h, 14.w, 6.h), decoration: BoxDecoration( @@ -74,7 +75,7 @@ class NewCouponWidget extends StatelessWidget { Expanded( flex: 2, child:Container( - margin: EdgeInsets.only(top: 12,left: 12,bottom: 12), + margin: EdgeInsets.only(top: 14,left: 14,bottom: 14), child: Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, @@ -89,7 +90,7 @@ class NewCouponWidget extends StatelessWidget { color: Color(0xFF0D0D0D), ), ), - SizedBox(height: 6,), + SizedBox(height:10,), Expanded(child: (coupon.useStartTime == null && coupon.useEndTime == null)? @@ -130,6 +131,7 @@ class NewCouponWidget extends StatelessWidget { color: coupon.status == 3 ? Color(0xFFB3B3B3) :Color(0xFF4D4D4D), ), ), + SizedBox(height: 5,), Text( "${coupon?.useEndTime ?? ""}", maxLines:1, @@ -147,8 +149,7 @@ class NewCouponWidget extends StatelessWidget { ),), GestureDetector( onTap: (){ - // showDeleteDialog(); - + showCouponDetails(); }, child: Row( children: [ @@ -174,7 +175,7 @@ class NewCouponWidget extends StatelessWidget { Expanded( flex: 1, child:Container( - margin: EdgeInsets.only(top: 12,left: 12,bottom: 12), + margin: EdgeInsets.only(top: 14,left: 12,bottom: 14,), child: Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, @@ -489,7 +490,42 @@ class NewCouponWidget extends StatelessWidget { ), ], ); - } else { + } else if (coupon.bizType == 6) { + return Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.baseline, + textBaseline: TextBaseline.alphabetic, + children: [ + Text( + "¥", + style: TextStyle( + fontSize: 22.sp, + fontWeight: MyFontWeight.medium, + color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xff32A060), + ), + ), + SizedBox( + height: 4.h, + ), + Text( + coupon != null + ? double.tryParse("${coupon.limitAmount}" ?? "0").toStringAsFixed(2) + : "", + style: TextStyle( + fontSize: 35.sp, + fontWeight: MyFontWeight.semi_bold, + color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xff32A060), + ), + ), + ], + ), + ], + ); + }else { return Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.center, @@ -673,4 +709,5 @@ class NewCouponWidget extends StatelessWidget { } } } + } diff --git a/lib/view_widget/recharge_details_dialog.dart b/lib/view_widget/recharge_details_dialog.dart new file mode 100644 index 00000000..13512eb7 --- /dev/null +++ b/lib/view_widget/recharge_details_dialog.dart @@ -0,0 +1,106 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_html/flutter_html.dart'; +import 'package:huixiang/generated/l10n.dart'; +import 'package:huixiang/retrofit/data/coupon.dart'; +import 'package:huixiang/retrofit/data/recharge_list.dart'; +import 'package:huixiang/retrofit/data/store.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:huixiang/store/scan.dart'; +import 'package:huixiang/utils/font_weight.dart'; +import 'package:huixiang/view_widget/border_text.dart'; +import 'package:huixiang/view_widget/custom_image.dart'; +import 'package:huixiang/view_widget/round_button.dart'; + +class RechargeWidget extends StatefulWidget { + final RechargeList rechargeA; + RechargeWidget(this.rechargeA); + @override + State createState() { + return _RechargeWidget(); + } +} + +class _RechargeWidget extends State { + int selectIndex = 0; + + @override + Widget build(BuildContext context) { + return Container( + padding: EdgeInsets.only(top: 12), + decoration: new BoxDecoration( + color: Colors.white, + borderRadius: new BorderRadius.only( + topLeft: const Radius.circular(25.0), + topRight: const Radius.circular(25.0))), + child: Container( + width: 299, + height:299, + child: Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Expanded(child: + Container( + margin: EdgeInsets.symmetric(vertical: 12.h), + alignment: Alignment.center, + child: Text( + "充值说明", + style: TextStyle( + fontWeight: MyFontWeight.bold, + fontSize: 15.sp, + color: Color(0xFF353535), + ), + ), + )), + GestureDetector( + onTap: (){ + setState(() { + Navigator.of(context).pop(); + }); + }, + child: Icon( + Icons.clear, + color: Colors.black, + size: 18, + ), + ), + SizedBox(width: 14), + ], + ), + SizedBox(height: 12.h,), + Container( + width: double.infinity, + height: 1.h, + color: Color(0xFFF2F2F2), + margin: EdgeInsets.only(bottom:13.h), + ), + Padding(padding:EdgeInsets.only(left: 14), + child: + Row( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Expanded( + child: Container( + color: Colors.white, + child: Html( + data: widget.rechargeA.remark ?? "", + customImageRenders: { + networkSourceMatcher(): networkImageRender( + loadingWidget: () { + return Container(); + }, + ), + }, + ), + ), + ) + ], + ),) + ], + ), + )); + } +} diff --git a/lib/view_widget/selector_store_dialog.dart b/lib/view_widget/selector_store_dialog.dart index 9c1214ba..dbd2b159 100644 --- a/lib/view_widget/selector_store_dialog.dart +++ b/lib/view_widget/selector_store_dialog.dart @@ -32,10 +32,10 @@ class _SelectorStoreWidget extends State { 52.0.h) + 54.0.h + 158.0.h, - padding: EdgeInsets.only( - top: 16.h, - bottom: 16.h, - ), + // padding: EdgeInsets.only( + // top: 16.h, + // bottom: 16.h, + // ), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.only( @@ -54,6 +54,7 @@ class _SelectorStoreWidget extends State { Expanded( child: Container( alignment: Alignment.center, + margin: EdgeInsets.symmetric(vertical: 12), child: Text( S.of(context).qingxuanzeshiyongmendian, style: TextStyle( @@ -78,9 +79,6 @@ class _SelectorStoreWidget extends State { SizedBox(width: 14), ], ), - SizedBox( - height: 12.h, - ), Container( width: double.infinity, height: 1.h, @@ -233,7 +231,7 @@ class _SelectorStoreWidget extends State { color: position == selectIndex ? Color(0xFFF0FAF4) :Color(0xFFF7F7F7), ), alignment: Alignment.centerLeft, - padding: EdgeInsets.only(left: 12, bottom: 16, top: 16), + padding: EdgeInsets.only(left: 12,), child: Text( store.storeName, style: TextStyle(