diff --git a/assets/image/2x/discount.webp b/assets/image/2x/discount.webp index 550ed87d..27ed950c 100644 Binary files a/assets/image/2x/discount.webp and b/assets/image/2x/discount.webp differ diff --git a/assets/image/2x/home_chi.webp b/assets/image/2x/home_chi.webp index fb6e1f98..8e43721a 100644 Binary files a/assets/image/2x/home_chi.webp and b/assets/image/2x/home_chi.webp differ diff --git a/assets/image/2x/home_he.webp b/assets/image/2x/home_he.webp index 12222bfd..5bd295f6 100644 Binary files a/assets/image/2x/home_he.webp and b/assets/image/2x/home_he.webp differ diff --git a/assets/image/2x/home_lm.webp b/assets/image/2x/home_lm.webp index 501dcebd..2c732315 100644 Binary files a/assets/image/2x/home_lm.webp and b/assets/image/2x/home_lm.webp differ diff --git a/assets/image/2x/home_recharge.webp b/assets/image/2x/home_recharge.webp index eba2ce11..6cb2563c 100644 Binary files a/assets/image/2x/home_recharge.webp and b/assets/image/2x/home_recharge.webp differ diff --git a/assets/image/2x/home_wan.webp b/assets/image/2x/home_wan.webp index c6389231..4065570c 100644 Binary files a/assets/image/2x/home_wan.webp and b/assets/image/2x/home_wan.webp differ diff --git a/assets/image/2x/home_welfare.webp b/assets/image/2x/home_welfare.webp index 0eeab06a..c36d2386 100644 Binary files a/assets/image/2x/home_welfare.webp and b/assets/image/2x/home_welfare.webp differ diff --git a/assets/image/2x/vip_card.webp b/assets/image/2x/vip_card.webp index 26396eb4..34f406eb 100644 Binary files a/assets/image/2x/vip_card.webp and b/assets/image/2x/vip_card.webp differ diff --git a/assets/image/2x/vip_shop_bj.webp b/assets/image/2x/vip_shop_bj.webp new file mode 100644 index 00000000..ea61a714 Binary files /dev/null and b/assets/image/2x/vip_shop_bj.webp differ diff --git a/assets/image/2x/vip_shop_hg.webp b/assets/image/2x/vip_shop_hg.webp index 9424d0a6..4bd62fe0 100644 Binary files a/assets/image/2x/vip_shop_hg.webp and b/assets/image/2x/vip_shop_hg.webp differ diff --git a/assets/image/2x/vip_shop_hx.webp b/assets/image/2x/vip_shop_hx.webp index 29f2e83e..e822b50f 100644 Binary files a/assets/image/2x/vip_shop_hx.webp and b/assets/image/2x/vip_shop_hx.webp differ diff --git a/assets/image/2x/vip_shop_qj.webp b/assets/image/2x/vip_shop_qj.webp index daaf44b4..07b202d5 100644 Binary files a/assets/image/2x/vip_shop_qj.webp and b/assets/image/2x/vip_shop_qj.webp differ diff --git a/assets/image/2x/vip_title.webp b/assets/image/2x/vip_title.webp new file mode 100644 index 00000000..05d74bd4 Binary files /dev/null and b/assets/image/2x/vip_title.webp differ diff --git a/assets/image/2x/welfare1.webp b/assets/image/2x/welfare1.webp index 58d41dba..0e7a67ad 100644 Binary files a/assets/image/2x/welfare1.webp and b/assets/image/2x/welfare1.webp differ diff --git a/assets/image/2x/welfare2.webp b/assets/image/2x/welfare2.webp index 523dfa04..fb72b6f9 100644 Binary files a/assets/image/2x/welfare2.webp and b/assets/image/2x/welfare2.webp differ diff --git a/assets/image/2x/welfare3.webp b/assets/image/2x/welfare3.webp index 7efea2aa..3e80f98b 100644 Binary files a/assets/image/2x/welfare3.webp and b/assets/image/2x/welfare3.webp differ diff --git a/assets/image/2x/welfare_spread.webp b/assets/image/2x/welfare_spread.webp index 3ff0cfb6..1cfe08dc 100644 Binary files a/assets/image/2x/welfare_spread.webp and b/assets/image/2x/welfare_spread.webp differ diff --git a/assets/image/3x/discount.webp b/assets/image/3x/discount.webp index 8507bbf7..b4d96eb0 100644 Binary files a/assets/image/3x/discount.webp and b/assets/image/3x/discount.webp differ diff --git a/assets/image/3x/home_chi.webp b/assets/image/3x/home_chi.webp index f00ba8e4..4b1dee14 100644 Binary files a/assets/image/3x/home_chi.webp and b/assets/image/3x/home_chi.webp differ diff --git a/assets/image/3x/home_he.webp b/assets/image/3x/home_he.webp index 248f8de9..60195397 100644 Binary files a/assets/image/3x/home_he.webp and b/assets/image/3x/home_he.webp differ diff --git a/assets/image/3x/home_lm.webp b/assets/image/3x/home_lm.webp index fb796300..5164a688 100644 Binary files a/assets/image/3x/home_lm.webp and b/assets/image/3x/home_lm.webp differ diff --git a/assets/image/3x/home_recharge.webp b/assets/image/3x/home_recharge.webp index 27f39a25..33108f8f 100644 Binary files a/assets/image/3x/home_recharge.webp and b/assets/image/3x/home_recharge.webp differ diff --git a/assets/image/3x/home_wan.webp b/assets/image/3x/home_wan.webp index 17a39e22..bf636727 100644 Binary files a/assets/image/3x/home_wan.webp and b/assets/image/3x/home_wan.webp differ diff --git a/assets/image/3x/home_welfare.webp b/assets/image/3x/home_welfare.webp index 151efea7..cd2cebaf 100644 Binary files a/assets/image/3x/home_welfare.webp and b/assets/image/3x/home_welfare.webp differ diff --git a/assets/image/3x/vip_card.webp b/assets/image/3x/vip_card.webp index 85fff480..766883d9 100644 Binary files a/assets/image/3x/vip_card.webp and b/assets/image/3x/vip_card.webp differ diff --git a/assets/image/3x/vip_shop_bj.webp b/assets/image/3x/vip_shop_bj.webp new file mode 100644 index 00000000..c77806d1 Binary files /dev/null and b/assets/image/3x/vip_shop_bj.webp differ diff --git a/assets/image/3x/vip_shop_hg.webp b/assets/image/3x/vip_shop_hg.webp index f8e06e5d..cce2e999 100644 Binary files a/assets/image/3x/vip_shop_hg.webp and b/assets/image/3x/vip_shop_hg.webp differ diff --git a/assets/image/3x/vip_shop_hx.webp b/assets/image/3x/vip_shop_hx.webp index 1404ca80..223fc4cd 100644 Binary files a/assets/image/3x/vip_shop_hx.webp and b/assets/image/3x/vip_shop_hx.webp differ diff --git a/assets/image/3x/vip_shop_qj.webp b/assets/image/3x/vip_shop_qj.webp index cf7f8077..c7958fe1 100644 Binary files a/assets/image/3x/vip_shop_qj.webp and b/assets/image/3x/vip_shop_qj.webp differ diff --git a/assets/image/3x/vip_title.webp b/assets/image/3x/vip_title.webp new file mode 100644 index 00000000..ce4590ae Binary files /dev/null and b/assets/image/3x/vip_title.webp differ diff --git a/assets/image/3x/welfare1.webp b/assets/image/3x/welfare1.webp index 1c700577..b6ca9377 100644 Binary files a/assets/image/3x/welfare1.webp and b/assets/image/3x/welfare1.webp differ diff --git a/assets/image/3x/welfare2.webp b/assets/image/3x/welfare2.webp index 2106d481..698fb9d1 100644 Binary files a/assets/image/3x/welfare2.webp and b/assets/image/3x/welfare2.webp differ diff --git a/assets/image/3x/welfare3.webp b/assets/image/3x/welfare3.webp index 8f0d0898..723ad716 100644 Binary files a/assets/image/3x/welfare3.webp and b/assets/image/3x/welfare3.webp differ diff --git a/assets/image/3x/welfare_spread.webp b/assets/image/3x/welfare_spread.webp index 197cd747..f37b9926 100644 Binary files a/assets/image/3x/welfare_spread.webp and b/assets/image/3x/welfare_spread.webp differ diff --git a/assets/image/discount.webp b/assets/image/discount.webp index 60ea5563..9ce06960 100644 Binary files a/assets/image/discount.webp and b/assets/image/discount.webp differ diff --git a/assets/image/home_chi.webp b/assets/image/home_chi.webp index 0b5c343f..000eceac 100644 Binary files a/assets/image/home_chi.webp and b/assets/image/home_chi.webp differ diff --git a/assets/image/home_he.webp b/assets/image/home_he.webp index 33c1dd44..9065a012 100644 Binary files a/assets/image/home_he.webp and b/assets/image/home_he.webp differ diff --git a/assets/image/home_lm.webp b/assets/image/home_lm.webp index 2421ec84..2bdb23cc 100644 Binary files a/assets/image/home_lm.webp and b/assets/image/home_lm.webp differ diff --git a/assets/image/home_recharge.webp b/assets/image/home_recharge.webp index ad7cc03c..87c811c5 100644 Binary files a/assets/image/home_recharge.webp and b/assets/image/home_recharge.webp differ diff --git a/assets/image/home_wan.webp b/assets/image/home_wan.webp index 00a4d9a8..62982118 100644 Binary files a/assets/image/home_wan.webp and b/assets/image/home_wan.webp differ diff --git a/assets/image/home_welfare.webp b/assets/image/home_welfare.webp index da506e31..6da77e74 100644 Binary files a/assets/image/home_welfare.webp and b/assets/image/home_welfare.webp differ diff --git a/assets/image/vip_card.webp b/assets/image/vip_card.webp index c1f899f5..79fb6f77 100644 Binary files a/assets/image/vip_card.webp and b/assets/image/vip_card.webp differ diff --git a/assets/image/vip_shop_bj.webp b/assets/image/vip_shop_bj.webp new file mode 100644 index 00000000..0df4ba06 Binary files /dev/null and b/assets/image/vip_shop_bj.webp differ diff --git a/assets/image/vip_shop_hg.webp b/assets/image/vip_shop_hg.webp index 29a4c2d1..4b41189c 100644 Binary files a/assets/image/vip_shop_hg.webp and b/assets/image/vip_shop_hg.webp differ diff --git a/assets/image/vip_shop_hx.webp b/assets/image/vip_shop_hx.webp index bbb27329..ce6cb272 100644 Binary files a/assets/image/vip_shop_hx.webp and b/assets/image/vip_shop_hx.webp differ diff --git a/assets/image/vip_shop_qj.webp b/assets/image/vip_shop_qj.webp index b320f51d..440909a6 100644 Binary files a/assets/image/vip_shop_qj.webp and b/assets/image/vip_shop_qj.webp differ diff --git a/assets/image/vip_title.webp b/assets/image/vip_title.webp new file mode 100644 index 00000000..12f3c83d Binary files /dev/null and b/assets/image/vip_title.webp differ diff --git a/assets/image/welfare1.webp b/assets/image/welfare1.webp index 7a680ab5..1b59eb51 100644 Binary files a/assets/image/welfare1.webp and b/assets/image/welfare1.webp differ diff --git a/assets/image/welfare2.webp b/assets/image/welfare2.webp index 03008186..88ef18e0 100644 Binary files a/assets/image/welfare2.webp and b/assets/image/welfare2.webp differ diff --git a/assets/image/welfare3.webp b/assets/image/welfare3.webp index 81cc0226..a6f27a7a 100644 Binary files a/assets/image/welfare3.webp and b/assets/image/welfare3.webp differ diff --git a/assets/image/welfare_spread.webp b/assets/image/welfare_spread.webp index db02b9b0..f33b9685 100644 Binary files a/assets/image/welfare_spread.webp and b/assets/image/welfare_spread.webp differ diff --git a/lib/home/home_page.dart b/lib/home/home_page.dart index c1c7533a..35baf6ed 100644 --- a/lib/home/home_page.dart +++ b/lib/home/home_page.dart @@ -42,6 +42,7 @@ import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import '../utils/flutter_utils.dart'; import 'home_view/shortcut_operation.dart'; class HomePage extends StatefulWidget { @@ -158,6 +159,8 @@ class HomePageState extends State with AutomaticKeepAliveClientMixin { final BaseData brand = await apiService.queryHomeBrand().catchError((onError) { + SmartDialog.showToast(AppUtils.dioErrorTypeToString(onError.type), + alignment: Alignment.center); refreshController.refreshFailed(); }); if (brand != null && brand.isSuccess) { @@ -377,10 +380,10 @@ class HomePageState extends State with AutomaticKeepAliveClientMixin { } } - _onRefresh(){ - queryHome(); + _onRefresh() async{ + await queryHome(); // queryMsgStats(); - queryCoupon(); + await queryCoupon(); } @override @@ -485,83 +488,78 @@ class HomePageState extends State with AutomaticKeepAliveClientMixin { }, child: SingleChildScrollView( physics: NeverScrollableScrollPhysics(), - child: FutureBuilder( - future:queryHome(), - builder: (context, snapshot) { - return Column( - children: [ - ///banner - HomeBanner(bannerData, controller), + child: Column( + children: [ + ///banner + HomeBanner(bannerData, controller), - ///吃喝玩 - UnionEntry((int jpIndex) { - widget.changeTab(1,jpIndex); - }), + ///吃喝玩 + UnionEntry((int jpIndex) { + widget.changeTab(1,jpIndex); + }), - ///快捷操作 - ShortcutOperation((int jpIndex) { - widget.changeTab(1,jpIndex); - }), + ///快捷操作 + ShortcutOperation((int jpIndex) { + widget.changeTab(1,jpIndex); + }), - ///推广图 - spread(), + ///推广图 + spread(), - // ///签到 - // SignView(isSigned, (value) { - // setState(() { - // isSigned = value; - // }); - // }), + // ///签到 + // SignView(isSigned, (value) { + // setState(() { + // isSigned = value; + // }); + // }), - ///特惠专区 - DiscountZone(coupons), + ///特惠专区 + DiscountZone(coupons), - ///特惠专区-推荐商品展示 - HomeRecommendGoods(homeRank), + ///特惠专区-推荐商品展示 + HomeRecommendGoods(homeRank), - ///福利中心 - WelfareCore(), + ///福利中心 + WelfareCore(), - ///吃喝玩商品热销榜 - TopSellingList(homeRank), + ///吃喝玩商品热销榜 + TopSellingList(homeRank), - // ///店铺推荐 - // QuickOrder(), + // ///店铺推荐 + // QuickOrder(), - // ///超级优惠券 - // CouponView(), + // ///超级优惠券 + // CouponView(), - // ///精选活动 - // FeaturedActivity(), + // ///精选活动 + // FeaturedActivity(), - // ///积分商城 - // HomeIntegralStore(gooods), + // ///积分商城 + // HomeIntegralStore(gooods), - ///积分商品头Tab - PointsGoodsTitle( - gooodsCategorys, + ///积分商品头Tab + PointsGoodsTitle( + gooodsCategorys, (orderType, orderDesc) { - this.orderType = orderType; - this.orderDesc = orderDesc; - setState(() {}); - }, + this.orderType = orderType; + this.orderDesc = orderDesc; + setState(() {}); + }, (index) { - categoryId = gooodsCategorys[index].id; - pageNum = 1; - setState(() {}); - }, - ), - - ///积分商品列表 - PointGoods( - goods, + categoryId = gooodsCategorys[index].id; + pageNum = 1; + setState(() {}); + }, + ), + + ///积分商品列表 + PointGoods( + goods, (index) { - _toDetails(index); - }, - ), - ], - ); - }, + _toDetails(index); + }, + ), + ], ), ), ), diff --git a/lib/home/home_view/discount_zone.dart b/lib/home/home_view/discount_zone.dart index bbbb2281..1998a9a3 100644 --- a/lib/home/home_view/discount_zone.dart +++ b/lib/home/home_view/discount_zone.dart @@ -30,20 +30,36 @@ class _DiscountZone extends State { Widget build(BuildContext context) { return Container( width: double.infinity, - margin: EdgeInsets.only(top: 14.h,), + margin: EdgeInsets.only(top:28.h,), child: Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start, children: [ - Padding(padding:EdgeInsets.symmetric(horizontal: 14.w), - child: Text( - S.of(context).tehuizhuanqu, - style: TextStyle( - color: Color(0xFF0D0D0D), - fontSize: 15.sp, - fontWeight: FontWeight.bold, + Padding(padding: EdgeInsets.symmetric(horizontal: 14.w),child: Row( + children: [ + Expanded(child: Text( + S.of(context).tehuizhuanqu, + style: TextStyle( + color: Color(0xFF0D0D0D), + fontSize: 15.sp, + fontWeight: FontWeight.bold, + ), + )), + GestureDetector( + onTap: (){ + Navigator.of(context).pushNamed('/router/welfare_page'); + }, + child: Text( + "更多好券", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF4D4D4D), + ), + ), ), - )), + ], + ),), if(widget.coupon.length != 0) Container( height: 120.h, @@ -99,29 +115,7 @@ class _DiscountZone extends State { fontSize: 14.sp, height: 1.5.h, fontWeight: MyFontWeight.semi_bold, - color: Color(0xFFFFA607), - ), - ), - SizedBox(height:5.w), - (coupon.useStartTime == null && - coupon.useEndTime == null)? - Text( - S.of(context).quantian, - maxLines: 1, - overflow: TextOverflow.ellipsis, - style: TextStyle( - fontSize: 12.sp, - fontWeight: MyFontWeight.regular, - color: Color(0xFFFFA607), - ), - ):Text( - "发放时间: ${coupon.useEndTime.substring(0, coupon.publishStartTime.indexOf(" "))}", - maxLines:1, - overflow: TextOverflow.ellipsis, - style: TextStyle( - fontSize: 12.sp, - fontWeight: MyFontWeight.regular, - color: Color(0xFFFFA607), + color: Color(0xFF32A060), ), ), ], @@ -163,7 +157,7 @@ class _DiscountZone extends State { style: TextStyle( fontSize: 12.sp, fontWeight: MyFontWeight.medium, - color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xFFFFFFFF), + color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xFF32A060), ), ), SizedBox( @@ -177,7 +171,7 @@ class _DiscountZone extends State { style: TextStyle( fontSize: 30.sp, fontWeight: FontWeight.w900, - color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xFFFFFFFF), + color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xFF32A060), ), ), ], @@ -190,7 +184,7 @@ class _DiscountZone extends State { style: TextStyle( fontSize: 12.sp, fontWeight: MyFontWeight.semi_bold, - color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xFFFFFFFF), + color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xFF32A060), ), ), ], @@ -207,7 +201,7 @@ class _DiscountZone extends State { style: TextStyle( fontSize: 26.sp, fontWeight: MyFontWeight.semi_bold, - color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xFFFFFFFF), + color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xFF32A060), ), ), ), @@ -216,7 +210,7 @@ class _DiscountZone extends State { style: TextStyle( fontSize: 12.sp, fontWeight: MyFontWeight.semi_bold, - color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xFFFFFFFF), + color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xFF32A060), ), ), ], @@ -233,7 +227,7 @@ class _DiscountZone extends State { style: TextStyle( fontSize: 26.sp, fontWeight: MyFontWeight.semi_bold, - color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xFFFFFFFF), + color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xFF32A060), ), ), ), @@ -242,7 +236,7 @@ class _DiscountZone extends State { style: TextStyle( fontSize: 12.sp, fontWeight: MyFontWeight.semi_bold, - color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xFFFFFFFF), + color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xFF32A060), ), ), ], @@ -262,7 +256,7 @@ class _DiscountZone extends State { style: TextStyle( fontSize: 12.sp, fontWeight: MyFontWeight.medium, - color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xFFFFFFFF), + color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xFF32A060), ), ), SizedBox( @@ -275,7 +269,7 @@ class _DiscountZone extends State { style: TextStyle( fontSize: 28.sp, fontWeight: FontWeight.w900, - color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xFFFFFFFF), + color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xFF32A060), ), ), ], @@ -300,7 +294,7 @@ class _DiscountZone extends State { style: TextStyle( fontSize: 30.sp, fontWeight: FontWeight.w900, - color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xFFFFFFFF), + color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xFF32A060), ), ), SizedBox( @@ -311,7 +305,7 @@ class _DiscountZone extends State { style: TextStyle( fontSize: 14.sp, fontWeight: MyFontWeight.semi_bold, - color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xFFFFFFFF), + color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xFF32A060), ), ), ], diff --git a/lib/home/home_view/shortcut_operation.dart b/lib/home/home_view/shortcut_operation.dart index 93e14784..4196945c 100644 --- a/lib/home/home_view/shortcut_operation.dart +++ b/lib/home/home_view/shortcut_operation.dart @@ -28,9 +28,9 @@ class _ShortcutOperation extends State { @override Widget build(BuildContext context) { return Container( - height: 75.h, + height: 70.h, width: double.infinity, - margin: EdgeInsets.only(bottom: 15.h, left: 9.w, right: 9.w), + margin: EdgeInsets.only(bottom:28.h, left: 9.w, right: 9.w), child: Row( crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center, @@ -45,13 +45,7 @@ class _ShortcutOperation extends State { margin: EdgeInsets.symmetric(horizontal: 5), padding: EdgeInsets.all(10.h), decoration: BoxDecoration( - gradient: new LinearGradient( - begin: Alignment.centerLeft, - end: Alignment.centerRight, - colors: [ - Color(0xFFD1E8D9), - Color(0xFFE4F7EA), - ]), + color: Colors.white, boxShadow: [ BoxShadow( color: Colors.black.withAlpha(12), @@ -75,7 +69,7 @@ class _ShortcutOperation extends State { style: TextStyle( fontWeight: MyFontWeight.semi_bold, fontSize: 14.sp, - color: Color(0xFF32A060), + color: Colors.black, ), ), SizedBox(height: 5.h), @@ -84,17 +78,18 @@ class _ShortcutOperation extends State { style: TextStyle( fontWeight: MyFontWeight.regular, fontSize: 12.sp, - color: Color(0xFF61836F), + color: Color(0xff4D4D4D), ), ), ], ), - SizedBox(width: 3.w), + SizedBox(width:16.w), Expanded( child: Image.asset( "assets/image/home_lm.webp", - width: 36.w, - height: 36.h, + width: 24.w, + height: 31.h, + fit: BoxFit.fill, ), ), ], @@ -111,13 +106,7 @@ class _ShortcutOperation extends State { margin: EdgeInsets.symmetric(horizontal: 5.w), padding: EdgeInsets.all(10.h), decoration: BoxDecoration( - gradient: new LinearGradient( - begin: Alignment.centerLeft, - end: Alignment.centerRight, - colors: [ - Color(0xFFFAEDCB), - Color(0xFFFAF4E2), - ]), + color: Colors.white, boxShadow: [ BoxShadow( color: Colors.black.withAlpha(12), @@ -141,7 +130,7 @@ class _ShortcutOperation extends State { style: TextStyle( fontWeight: MyFontWeight.semi_bold, fontSize: 14.sp, - color: Color(0xFFFFBA1B), + color: Colors.black, ), ), SizedBox(height: 5.h), @@ -150,17 +139,18 @@ class _ShortcutOperation extends State { style: TextStyle( fontWeight: MyFontWeight.regular, fontSize: 12.sp, - color: Color(0xFFA59162), + color: Color(0xff4D4D4D), ), ), ], ), - SizedBox(width: 3.w), + SizedBox(width:16.w), Expanded( child: Image.asset( "assets/image/home_recharge.webp", - width: 36.w, - height: 36.h, + width: 21.w, + height: 33.h, + fit: BoxFit.fill, ), ), ], @@ -179,13 +169,7 @@ class _ShortcutOperation extends State { margin: EdgeInsets.symmetric(horizontal: 5.w), padding: EdgeInsets.all(10.h), decoration: BoxDecoration( - gradient: new LinearGradient( - begin: Alignment.centerLeft, - end: Alignment.centerRight, - colors: [ - Color(0xFFFAE5CB), - Color(0xFFFAF1E4), - ]), + color: Colors.white, boxShadow: [ BoxShadow( color: Colors.black.withAlpha(12), @@ -209,7 +193,7 @@ class _ShortcutOperation extends State { style: TextStyle( fontWeight: MyFontWeight.semi_bold, fontSize: 14.sp, - color: Color(0xFFFF910F), + color: Colors.black, ), ), SizedBox(height: 5.h), @@ -218,17 +202,18 @@ class _ShortcutOperation extends State { style: TextStyle( fontWeight: MyFontWeight.regular, fontSize: 12.sp, - color: Color(0xFF89755D), + color: Color(0xff4D4D4D), ), ), ], ), - SizedBox(width: 3.w), + SizedBox(width: 16.w), Expanded( child: Image.asset( "assets/image/home_welfare.webp", - width: 36.w, - height: 36.h, + width: 22.w, + height: 35.h, + fit: BoxFit.fill, ), ), ], diff --git a/lib/home/home_view/top_selling_list.dart b/lib/home/home_view/top_selling_list.dart index 14d73261..3219cf2c 100644 --- a/lib/home/home_view/top_selling_list.dart +++ b/lib/home/home_view/top_selling_list.dart @@ -44,7 +44,7 @@ class _TopSellingList extends State { fit: BoxFit.cover, ), ), - margin: EdgeInsets.only(left: 14.w,right: 14.w,bottom: 14.h), + margin: EdgeInsets.only(left: 14.w,right: 14.w,bottom: 24.h), padding: EdgeInsets.only(left: 12.w,top: 16.h), child: Column( crossAxisAlignment: CrossAxisAlignment.start, diff --git a/lib/home/home_view/union_entry.dart b/lib/home/home_view/union_entry.dart index af7e10e0..4bf4e7b2 100644 --- a/lib/home/home_view/union_entry.dart +++ b/lib/home/home_view/union_entry.dart @@ -32,7 +32,7 @@ class _UnionEntry extends State { return Container( height: 130.h, width: double.infinity, - margin: EdgeInsets.all(14.h), + margin: EdgeInsets.symmetric(horizontal:14.w,vertical: 15.h), decoration: BoxDecoration( color: Color(0xFFFFFFFF), boxShadow: [ @@ -59,15 +59,15 @@ class _UnionEntry extends State { children: [ Image.asset( "assets/image/home_chi.webp", - fit: BoxFit.cover, - width: 60.w, - height: 60.h, + fit: BoxFit.fill, + width: 53.w, + height: 52.h, ), - SizedBox(height:4.h), + SizedBox(height:8.h), Text( S.of(context).chijiankang, style: TextStyle( - fontWeight: MyFontWeight.medium, + fontWeight: MyFontWeight.semi_bold, fontSize: 15.sp, color: Color(0xFF0D0D0D), ), @@ -85,15 +85,15 @@ class _UnionEntry extends State { children: [ Image.asset( "assets/image/home_he.webp", - fit: BoxFit.cover, - width: 60.w, - height: 60.h, + fit: BoxFit.fill, + width: 36.w, + height: 56.h, ), - SizedBox(height:4.h), + SizedBox(height:8.h), Text( S.of(context).hejiankang, style: TextStyle( - fontWeight: MyFontWeight.medium, + fontWeight: MyFontWeight.semi_bold, fontSize: 15.sp, color: Color(0xFF0D0D0D), ), @@ -111,15 +111,15 @@ class _UnionEntry extends State { children: [ Image.asset( "assets/image/home_wan.webp", - fit: BoxFit.cover, - width: 60.w, - height: 60.h, + fit: BoxFit.fill, + width: 58.w, + height: 52.h, ), - SizedBox(height:4.h), + SizedBox(height:8.h), Text( S.of(context).wanjiankang, style: TextStyle( - fontWeight: MyFontWeight.medium, + fontWeight: MyFontWeight.semi_bold, fontSize: 15.sp, color: Color(0xFF0D0D0D), ), diff --git a/lib/home/home_view/welfare_core.dart b/lib/home/home_view/welfare_core.dart index 0c3cb023..4059a318 100644 --- a/lib/home/home_view/welfare_core.dart +++ b/lib/home/home_view/welfare_core.dart @@ -29,163 +29,161 @@ class _WelfareCore extends State { @override Widget build(BuildContext context) { - return Column( - children: [ - Padding(padding:EdgeInsets.symmetric(horizontal: 14.w), - child: Row( - children: [ - Expanded(child: - Text( - S.of(context).fulizhongxin, - style: TextStyle( - color: Color(0xFF0D0D0D), - fontSize: 15.sp, - fontWeight: FontWeight.bold, - ), - )), - GestureDetector( - onTap: (){ - Navigator.of(context).pushNamed('/router/welfare_page'); - }, - child: Text( - S.of(context).chakangengduo, + return Container( + margin: EdgeInsets.only(left:10.w,right: 10.w,top: 14.h,bottom: 14.h), + child:Column( + children: [ + Row( + children: [ + Expanded(child: + Text( + S.of(context).fulizhongxin, style: TextStyle( - color: Color(0xFF4D4D4D), - fontSize: 12.sp, - fontWeight: MyFontWeight.regular, + color: Color(0xFF0D0D0D), + fontSize: 15.sp, + fontWeight: FontWeight.bold, ), - ), - ) - ], - ),), - Container( - width: double.infinity, - margin: EdgeInsets.only(left:10.w,right: 10.w,top: 14.h,bottom: 14.h), - child: Row( + )), + GestureDetector( + onTap: (){ + Navigator.of(context).pushNamed('/router/welfare_page'); + }, + child: Text( + S.of(context).chakangengduo, + style: TextStyle( + color: Color(0xFF4D4D4D), + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + ), + ), + ) + ], + ), + SizedBox(height: 16.w,), + Row( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, - children: [ - 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), - ), - ), - SizedBox(height: 2.h), - Text( - "每周三更新劵包", - style: TextStyle( - fontSize: 10.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/welfare2.webp"), - ), - ), - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - S.of(context).yaoqinghaoyou, - 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), - ), - ), - ], - ), - ), - ),), - 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"), - ), - ), - 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), - ), - ), - ], - ), - ), - )), - ], + children: [ + Expanded(child: GestureDetector( + onTap: (){ + Navigator.of(context).pushNamed('/router/welfare_page'); + }, + child:Container( + width: double.infinity, + height:75.h, + decoration: BoxDecoration( + image: DecorationImage( + fit: BoxFit.fill, + image: AssetImage("assets/image/welfare1.webp"), + ), + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + "本周劵包", + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFFFFFFFF), + ), + ), + SizedBox(height:5.h), + Text( + "每周三更新劵包", + style: TextStyle( + fontSize: 11.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFFFFFFFF), + ), + ), + ], + ), + ), + )), + SizedBox(width: 10.w,), + Expanded(child: GestureDetector( + onTap: (){ + Navigator.of(context).pushNamed('/router/welfare_page'); + }, + child:Container( + width: double.infinity, + height:75.h, + decoration: BoxDecoration( + image: DecorationImage( + fit: BoxFit.fill, + image: AssetImage("assets/image/welfare2.webp"), + ), + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + S.of(context).yaoqinghaoyou, + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFFFFFFFF), + ), + ), + SizedBox(height:5.h), + Text( + "邀请好友得分", + style: TextStyle( + fontSize: 11.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFFFFFFFF), + ), + ), + ], + ), + ), + ),), + SizedBox(width: 10.w,), + Expanded(child: GestureDetector( + onTap: (){ + Navigator.of(context).pushNamed('/router/welfare_page'); + }, + child:Container( + width: double.infinity, + height:75.h, + decoration: BoxDecoration( + image: DecorationImage( + fit: BoxFit.fill, + image: AssetImage("assets/image/welfare3.webp"), + ), + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + "积分换券", + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFFFFFFFF), + ), + ), + SizedBox(height:5.h), + Text( + "多种优惠券等你拿", + style: TextStyle( + fontSize: 11.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFFFFFFFF), + ), + ), + ], + ), + ), + )), + ], ), - ), - ], + ], + ), ); } } diff --git a/lib/home/points_mall_view/points_goods_view.dart b/lib/home/points_mall_view/points_goods_view.dart index 6b8ea86f..c7d83001 100644 --- a/lib/home/points_mall_view/points_goods_view.dart +++ b/lib/home/points_mall_view/points_goods_view.dart @@ -40,44 +40,51 @@ class _PointGoods extends State { @override Widget build(BuildContext context) { - return (widget.goods == null || widget.goods.length == 0) - ? NoDataView( - src: "assets/image/xiao_fei.webp", - isShowBtn: false, - text: "当前分类暂无商品", - fontSize: 16.sp, - margin: EdgeInsets.all(60.h), - ) - : GridView.builder( - itemCount: widget.goods == null ? 0 : widget.goods.length, - padding: EdgeInsets.only( - left: 16.w, - right: 16.w, - top: 18.h, - bottom: 16.h, - ), - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( - //一行的Widget数量 - crossAxisCount: 2, - //水平子Widget之间间距 - crossAxisSpacing: 11.w, - //垂直子Widget之间间距 - mainAxisSpacing: 16.w, - //子Widget宽高比例 0.59 - childAspectRatio: - 200 / (285 / 2 + (285 / 2) * AppUtils.textScale(context)), - ), - itemBuilder: (context, index) { - return GestureDetector( - onTap: () { - widget.onTap(index); - }, - child: buildItem(widget.goods[index]), - ); + return Container( + // decoration: BoxDecoration( + // borderRadius: BorderRadius.circular(4), + // color: Colors.white, + // ), + // margin: EdgeInsets.only(top: 16.h,right: 14.w,left: 14.w), + child:(widget.goods == null || widget.goods.length == 0) + ? NoDataView( + src: "assets/image/xiao_fei.webp", + isShowBtn: false, + text: "当前分类暂无商品", + fontSize: 16.sp, + margin: EdgeInsets.all(60.h), + ) + : GridView.builder( + itemCount: widget.goods == null ? 0 : widget.goods.length, + padding: EdgeInsets.only( + left: 16.w, + right: 16.w, + top: 18.h, + bottom: 16.h, + ), + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( + //一行的Widget数量 + crossAxisCount: 2, + //水平子Widget之间间距 + crossAxisSpacing: 11.w, + //垂直子Widget之间间距 + mainAxisSpacing: 16.w, + //子Widget宽高比例 0.59 + childAspectRatio: + 200 / (285 / 2 + (285 / 2) * AppUtils.textScale(context)), + ), + itemBuilder: (context, index) { + return GestureDetector( + onTap: () { + widget.onTap(index); }, + child: buildItem(widget.goods[index]), ); + }, + ), + ); } Widget buildItem(Goods goods) { diff --git a/lib/home/welfare_exchange.dart b/lib/home/welfare_exchange.dart index 08841bc6..5623627d 100644 --- a/lib/home/welfare_exchange.dart +++ b/lib/home/welfare_exchange.dart @@ -264,7 +264,7 @@ class _WelfareExchange extends State with SingleTickerProvider body: SmartRefresher( controller: refreshController, enablePullDown: true, - enablePullUp: true, + enablePullUp: false, physics: ClampingScrollPhysics(), header: MyHeader(), footer: CustomFooter( diff --git a/lib/login/new_login_page.dart b/lib/login/new_login_page.dart index 60b9c2f4..d5d043a7 100644 --- a/lib/login/new_login_page.dart +++ b/lib/login/new_login_page.dart @@ -137,7 +137,8 @@ class _NewLoginPage extends State { } }) .catchError((error) { - SmartDialog.showToast("$error", alignment: Alignment.center); + SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type), + alignment: Alignment.center); }); } } diff --git a/lib/main_page.dart b/lib/main_page.dart index a8088503..406aa7b8 100644 --- a/lib/main_page.dart +++ b/lib/main_page.dart @@ -84,6 +84,9 @@ class _MainPage extends State with WidgetsBindingObserver { @override void initState() { super.initState(); + pageController = PageController(initialPage: widget.arguments != null && widget.arguments["index"] != null ? widget.arguments["index"]:0); + if(widget.arguments != null && widget.arguments["index"] != null) + clickIndex = widget.arguments["index"]; WidgetsBinding.instance.addObserver(this); EasyLoading.instance ..indicatorType = EasyLoadingIndicatorType.circle @@ -390,7 +393,7 @@ class _MainPage extends State with WidgetsBindingObserver { } } - final PageController pageController = PageController(initialPage: 0); + PageController pageController; @override Widget build(BuildContext context) { diff --git a/lib/mine/mine_page.dart b/lib/mine/mine_page.dart index 6ba1ec69..153ad73e 100644 --- a/lib/mine/mine_page.dart +++ b/lib/mine/mine_page.dart @@ -4,6 +4,7 @@ import 'dart:io'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/main.dart'; import 'package:huixiang/mine/mine_view/mine_calendar.dart'; @@ -25,6 +26,7 @@ import 'package:shared_preferences/shared_preferences.dart'; import 'package:dio/dio.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import '../utils/flutter_utils.dart'; import 'mine_view/mine_item.dart'; import 'mine_view/mine_view.dart'; @@ -99,6 +101,8 @@ class MinePageState extends State with AutomaticKeepAliveClientMixin { BaseData> rankData = await apiService.rankList().catchError((onError) { + SmartDialog.showToast(AppUtils.dioErrorTypeToString(onError.type), + alignment: Alignment.center); _refreshController.refreshFailed(); }); if (rankData != null && rankData.isSuccess) { diff --git a/lib/order/order_detail_page.dart b/lib/order/order_detail_page.dart index 9429784d..e6f60e69 100644 --- a/lib/order/order_detail_page.dart +++ b/lib/order/order_detail_page.dart @@ -1,5 +1,6 @@ import 'package:dio/dio.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/order/order_view/order_address.dart'; @@ -43,6 +44,7 @@ class _OrderDetailPage extends State { Dio(), context: context, token: value.getString("token"), + showLoading: true ); queryDetails(); }); @@ -91,7 +93,7 @@ class _OrderDetailPage extends State { Dio(), context: context, token: value.getString("token"), - showLoading: true + showLoading: false ); } BaseData baseData = await apiService @@ -221,9 +223,12 @@ class _OrderDetailPage extends State { } } - payResult(BaseData baseData) { - queryDetails(); - SmartDialog.showToast(baseData?.msg == "ok" ?"订单支付成功" :baseData?.msg,alignment: Alignment.center); + payResult(BaseData baseData) async{ + await queryDetails(); + Future.delayed(Duration(milliseconds: 350), () { + EasyLoading.dismiss(); + SmartDialog.showToast(baseData?.msg == "ok" ?"订单支付成功" :baseData?.msg,alignment: Alignment.center); + }); } statusTitle() { diff --git a/lib/order/order_view/order_info.dart b/lib/order/order_view/order_info.dart index 5d10ad54..f6d32caa 100644 --- a/lib/order/order_view/order_info.dart +++ b/lib/order/order_view/order_info.dart @@ -53,8 +53,8 @@ class _OrderInfoView extends State { widget.orderInfo != null ? widget.orderInfo.notes ?? S.of(context).qingshurubeizhuyaoqiu : S.of(context).qingshurubeizhuyaoqiu), - orderInfoItem(S.of(context).zhifufangshi, - widget.orderInfo != null ? payChannel() : S.of(context).yue), + // orderInfoItem(S.of(context).zhifufangshi, + // widget.orderInfo != null ? payChannel() : S.of(context).yue), ], ), ); diff --git a/lib/retrofit/min_api.g.dart b/lib/retrofit/min_api.g.dart index 643b10a8..2e4cd7a2 100644 --- a/lib/retrofit/min_api.g.dart +++ b/lib/retrofit/min_api.g.dart @@ -123,7 +123,7 @@ class _MinApiService implements MinApiService { data: _data); final value = BaseData>.fromJson( _result.data, - (json) => (json as List) + (json) => ((json??"") == "")?null:(json as List) .map( (i) => ShoppingCart.fromJson(i as Map)) .toList()); diff --git a/lib/retrofit/retrofit_api.dart b/lib/retrofit/retrofit_api.dart index 728654be..db673ef1 100644 --- a/lib/retrofit/retrofit_api.dart +++ b/lib/retrofit/retrofit_api.dart @@ -18,6 +18,7 @@ import 'package:huixiang/retrofit/data/order_info.dart'; import 'package:huixiang/view_widget/login_tips_dialog.dart'; import 'package:retrofit/retrofit.dart'; +import '../utils/flutter_utils.dart'; import 'data/achievement_detail_list.dart'; import 'data/activity_pos.dart'; import 'data/address.dart'; @@ -131,6 +132,8 @@ abstract class ApiService { if (EasyLoading.isShow) { EasyLoading.dismiss(); } + // SmartDialog.showToast(AppUtils.dioErrorTypeToString(e.type), + // alignment: Alignment.center); debugPrint("\n======================= 错误响应数据 ======================="); debugPrint("type = ${e.type}"); debugPrint("message = ${e.message}"); diff --git a/lib/settlement/settlement.dart b/lib/settlement/settlement.dart index 5a9648a5..3530da62 100644 --- a/lib/settlement/settlement.dart +++ b/lib/settlement/settlement.dart @@ -80,7 +80,8 @@ class _Settlement extends State { int count1 = 0; String productId; bool orderButton = false; - bool useVipPriceSelect = true; + bool useVipPriceSelect = false; + bool showVipTips = false; @override void initState() { @@ -116,6 +117,7 @@ class _Settlement extends State { token: minToken, tenant: tenant, storeId: storeId, + showLoading: true ); if (promotions != null && promotions != "" && tableId <= 0) { queryOrderInfo( @@ -751,7 +753,8 @@ class _Settlement extends State { minOrderInfo, tableId, pageType, - (coupons != "" || promotions!="") ? false :useVipPriceSelect + (coupons != "" || promotions!="") ? false :useVipPriceSelect, + this.showVipTips ), ///优惠券/备注/会员优惠金额 @@ -776,11 +779,16 @@ class _Settlement extends State { });}, tableId, vipPriceSelect, + (){ + setState(() { + this.showVipTips = true; + }); + } ), if (placeOrder && joinA != JoinActivity.BargainBug) ///支付方式 - PayMethod(payChannelCheck), + PayMethod(payChannelCheck,coupons,promotions,useVipPriceSelect), ], ), ), @@ -873,22 +881,23 @@ class _Settlement extends State { payChannelCheck(int payChannel) { this.payChannel = payChannel; - if (tableId > 0) { - queryOrderDetails(parentId); - } else { - queryOrderInfo( - address?.id, - selectedBtn, - couponListBean?.id, - 0, - promotion?.id ?? productId, - productSkuId ?? "", - actProductId ?? "", - actProductSkuId ?? "", - useVipPriceSelect, - count1, - payChannel, - tableId);} + if (tableId > 0) { + queryOrderDetails(parentId); + } else { + queryOrderInfo( + address?.id, + selectedBtn, + couponListBean?.id, + 0, + promotion?.id ?? productId, + productSkuId ?? "", + actProductId ?? "", + actProductSkuId ?? "", + useVipPriceSelect, + count1, + payChannel, + tableId);} + } vipPriceSelect(bool useVipPriceSelect) { diff --git a/lib/settlement/settlement_view/activity_coupon_remarks.dart b/lib/settlement/settlement_view/activity_coupon_remarks.dart index 3e302526..0357caf6 100644 --- a/lib/settlement/settlement_view/activity_coupon_remarks.dart +++ b/lib/settlement/settlement_view/activity_coupon_remarks.dart @@ -1,5 +1,6 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/min_order_info.dart'; import 'package:huixiang/retrofit/data/settleOrderInfo.dart'; @@ -20,6 +21,7 @@ class ActivityCouponRemarks extends StatefulWidget { final String remark; final int tableId; final Function(bool useVipPriceSelect) vipPriceSelect; + final Function showVipTips; ActivityCouponRemarks( this.couponCart, @@ -34,6 +36,7 @@ class ActivityCouponRemarks extends StatefulWidget { this.editRemark, this.tableId, this.vipPriceSelect, + this.showVipTips ); @override @@ -43,7 +46,7 @@ class ActivityCouponRemarks extends StatefulWidget { } class _ActivityCouponRemarks extends State { - bool vipSelect = true; + bool vipSelect = false; @override Widget build(BuildContext context) { @@ -77,7 +80,7 @@ class _ActivityCouponRemarks extends State { mainAxisAlignment: MainAxisAlignment.spaceEvenly, crossAxisAlignment: CrossAxisAlignment.center, children: [ - if(widget?.settleOrderInfo?.memberVO?.isVip ?? false) + // if(widget?.settleOrderInfo?.memberVO?.isVip ?? false) Row( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, @@ -99,8 +102,13 @@ class _ActivityCouponRemarks extends State { activeColor: Color(0xff32A060), onChanged: (bool value) { setState(() { - vipSelect = !vipSelect; - widget.vipPriceSelect(vipSelect); + if((widget?.settleOrderInfo?.memberVO?.isVip ?? false)){ + vipSelect = !vipSelect; + widget.vipPriceSelect(vipSelect); + }else{ + widget.showVipTips(); + return; + } }); }, ), diff --git a/lib/settlement/settlement_view/pay_method.dart b/lib/settlement/settlement_view/pay_method.dart index 919fe110..08902664 100644 --- a/lib/settlement/settlement_view/pay_method.dart +++ b/lib/settlement/settlement_view/pay_method.dart @@ -1,14 +1,20 @@ import 'dart:convert'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/utils/font_weight.dart'; import 'package:shared_preferences/shared_preferences.dart'; +import '../../view_widget/tips_dialog.dart'; + class PayMethod extends StatefulWidget { final Function(int payChannel) payChannelCheck; + final String coupons; + final String promotions; + final bool useVipPriceSelect; - PayMethod(this.payChannelCheck); + PayMethod(this.payChannelCheck,this.coupons,this.promotions,this.useVipPriceSelect); @override State createState() { @@ -164,6 +170,15 @@ class _PayMethod extends State { onTap: () { setState(() { checkIndex = 3; + if(widget.promotions != "" || widget.coupons != "" || widget.useVipPriceSelect){ + SmartDialog.show( + widget: Tips( + () { + }, + text: "绿币支付不参与任何活动优惠,请重新选择支付方式", + )); + return; + } }); widget.payChannelCheck(5); }, diff --git a/lib/settlement/settlement_view/settlement_order_commodity.dart b/lib/settlement/settlement_view/settlement_order_commodity.dart index 69a961bf..f7ba8de5 100644 --- a/lib/settlement/settlement_view/settlement_order_commodity.dart +++ b/lib/settlement/settlement_view/settlement_order_commodity.dart @@ -18,9 +18,10 @@ class SettlementOrderCommodity extends StatefulWidget { final MinOrderInfo minOrderInfo; final String pageType; final bool useVipPriceSelect; + final bool showVipTips; SettlementOrderCommodity( - this.isTakeOut, this.settleOrderInfo, this.minOrderInfo,this.tableId,this.pageType,this.useVipPriceSelect); + this.isTakeOut, this.settleOrderInfo, this.minOrderInfo,this.tableId,this.pageType,this.useVipPriceSelect,this.showVipTips); @override State createState() { @@ -108,6 +109,36 @@ class _SettlementOrderCommodity extends State { widgets.add(vipItem(Color(0xFFFF7A1A), "VIP优惠", widget?.settleOrderInfo?.discountAmount ?? "")); } + if(widget.showVipTips){ + widgets.add(GestureDetector(child: Container( + alignment: Alignment.centerLeft, + child:Text.rich( + TextSpan( + children: [ + TextSpan( + text: "您未购买回乡VIP卡,无法享受优惠,", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Colors.black, + ), + ), + TextSpan( + text: "点击立即购买", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFFFF7A1A), + ), + ), + ], + ), + ),),onTap: (){ + Navigator.of(context) + .pushNamedAndRemoveUntil('/router/main_page', (route) => false,arguments: {"index":2}); + },)); + } + widgets.add(Container( margin: EdgeInsets.only( top: 24.h, @@ -123,6 +154,7 @@ class _SettlementOrderCommodity extends State { return widgets; } + Widget commodityItem(OrderProductVOList productList) { return Container( margin: EdgeInsets.only(top: 8.h, bottom: 8.h), diff --git a/lib/store/store_order.dart b/lib/store/store_order.dart index 2fcff32e..03790d89 100644 --- a/lib/store/store_order.dart +++ b/lib/store/store_order.dart @@ -52,6 +52,7 @@ class _StoreOrderPage extends State StoreInfo storeInfo; List activitys; StoreOrderListPage storeOrderListPage; + ScrollPhysics scrollPhysics = NeverScrollableScrollPhysics(); ScrollController controller = ScrollController(); ShoppingCart shopCarGoods; @@ -99,9 +100,11 @@ class _StoreOrderPage extends State Dio(), context: context, token: shared.getString('token'), - showLoading: false, + showLoading: true, ); apiService.minLogin(storeId).catchError((onError) { + SmartDialog.showToast(AppUtils.dioErrorTypeToString(onError.type), + alignment: Alignment.center); debugPrint(onError); }).then((baseData) { if (baseData != null && baseData.isSuccess) { @@ -121,7 +124,6 @@ class _StoreOrderPage extends State token: minToken, tenant: tenant, storeId: storeId, - showLoading: false, ); queryMemberInfo(); @@ -272,7 +274,13 @@ class _StoreOrderPage extends State controller, storeInfo != null ? storeInfo.storeName - : ''), + : '',(alpha){ + setState(() { + if(alpha == 1) + scrollPhysics = BouncingScrollPhysics(); + else scrollPhysics = NeverScrollableScrollPhysics(); + }); + }), collapseMode: CollapseMode.pin, stretchModes: [ StretchMode.zoomBackground, @@ -431,7 +439,7 @@ class _StoreOrderPage extends State this.shopCarGoods = value; setState(() {}); }); - }), + },scrollPhysics), ///星店活动, // StoreActivity( @@ -991,8 +999,9 @@ class _StoreOrderPage extends State class Title extends StatefulWidget { final ScrollController controller; final String title; + final Function scrollChange; - Title(this.controller, this.title); + Title(this.controller, this.title,this.scrollChange); @override State createState() { @@ -1023,6 +1032,7 @@ class _Title extends State { if (alpha != alphatemp && mounted) { alpha = alphatemp; print("object: $alpha"); + widget.scrollChange(alpha); setState(() {}); } }); diff --git a/lib/store/store_view/store_order_list.dart b/lib/store/store_view/store_order_list.dart index 6aa76117..39b341c4 100644 --- a/lib/store/store_view/store_order_list.dart +++ b/lib/store/store_view/store_order_list.dart @@ -24,6 +24,7 @@ class StoreOrderListPage extends StatefulWidget { final int tableId; final Function(String id, int count) queryMiNiDetail; final Function queryShoppingCart; + final ScrollPhysics scrollPhysics; ShoppingCart shopCarGoods; @@ -38,6 +39,7 @@ class StoreOrderListPage extends StatefulWidget { this.tableId, this.queryMiNiDetail, this.queryShoppingCart, + this.scrollPhysics ); @override @@ -86,7 +88,8 @@ class _StoreOrderListPage extends State<StoreOrderListPage> { token: widget.minToken, tenant: widget.tenant, storeId: widget.arguments["id"], - showLoading: true); + showLoading: true + ); BaseData<List<FindMiNiGroupList>> baseData = await minService.findMiNiGroupList({ @@ -147,8 +150,9 @@ class _StoreOrderListPage extends State<StoreOrderListPage> { width: MediaQuery.of(context).size.width - 100.w, child: ListView.builder( itemCount: appletProducts == null ? 0 : appletProducts.length, + padding: EdgeInsets.only(top: 0), controller: controller, - physics: BouncingScrollPhysics(), + physics: widget.scrollPhysics, shrinkWrap: true, itemBuilder: (context, position) { return rightOrderItem(position); @@ -211,7 +215,7 @@ class _StoreOrderListPage extends State<StoreOrderListPage> { color: currentIndex != index ? Color(0xFFFAFAFA) : Colors.white, alignment: Alignment.center, padding: EdgeInsets.all(15), - margin: EdgeInsets.only(bottom: (index==appletProducts.length - 1)?35.h:0), + // margin: EdgeInsets.only(bottom: (index==appletProducts.length - 1)?35.h:0), child: Row( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, diff --git a/lib/union/union_page.dart b/lib/union/union_page.dart index 3cf6eaa7..569977f2 100644 --- a/lib/union/union_page.dart +++ b/lib/union/union_page.dart @@ -8,6 +8,7 @@ import 'package:flutter_baidu_mapapi_map/flutter_baidu_mapapi_map.dart'; import 'package:flutter_baidu_mapapi_utils/flutter_baidu_mapapi_utils.dart'; import 'package:flutter_bmflocation/flutter_bmflocation.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/main.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; @@ -31,6 +32,8 @@ import 'package:flutter/rendering.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_baidu_mapapi_base/flutter_baidu_mapapi_base.dart'; +import '../utils/flutter_utils.dart'; + class UnionPage extends StatefulWidget { final int initialIndex; diff --git a/lib/vip/vip_page.dart b/lib/vip/vip_page.dart index 40fb1cef..d7b1cd7c 100644 --- a/lib/vip/vip_page.dart +++ b/lib/vip/vip_page.dart @@ -13,6 +13,7 @@ import 'package:shared_preferences/shared_preferences.dart'; import '../retrofit/data/base_data.dart'; import '../retrofit/retrofit_api.dart'; +import '../utils/flutter_utils.dart'; import '../view_widget/my_appbar.dart'; @@ -56,6 +57,8 @@ class _VipPageState extends State<VipPage> with AutomaticKeepAliveClientMixin { } BaseData<VipCardHome> baseData = await apiService.vipCardIndex().catchError((onError) { + SmartDialog.showToast(AppUtils.dioErrorTypeToString(onError.type), + alignment: Alignment.center); _refreshController.refreshFailed();}); if (baseData != null && baseData.isSuccess) { vipHome = baseData.data; diff --git a/lib/vip/vip_view/exclusive_coupon.dart b/lib/vip/vip_view/exclusive_coupon.dart index 7120074c..2515132d 100644 --- a/lib/vip/vip_view/exclusive_coupon.dart +++ b/lib/vip/vip_view/exclusive_coupon.dart @@ -18,7 +18,7 @@ class _ExclusiveCoupon extends State<ExclusiveCoupon> { return Container( margin: EdgeInsets.only(left: 14.w, right: 14.w, bottom: 40.h), width: double.infinity, - padding: EdgeInsets.only(top: 16.h,left: 8.h,bottom: 10.h), + padding: EdgeInsets.only(top: 20.h,left: 20.h,bottom: 10.h,right: 20.w), decoration: BoxDecoration( borderRadius: BorderRadius.circular(6.w), color: Colors.white, @@ -35,98 +35,232 @@ class _ExclusiveCoupon extends State<ExclusiveCoupon> { mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text( - S.of(context).zhuanxiangyouhuiquan, - style: TextStyle( - color: Colors.black, - fontSize: 15.sp, - fontWeight: MyFontWeight.semi_bold, - ), + Row( + children: [ + SizedBox(width: 7.w,), + Image.asset( + "assets/image/vip_title.webp", + fit: BoxFit.fill, //填充剩余空间 + height:13.h, + width: 27.w, + ), + SizedBox(width: 4.w,), + Text( + S.of(context).zhuanxiangyouhuiquan, + style: TextStyle( + color: Colors.black, + fontSize: 15.sp, + fontWeight: MyFontWeight.semi_bold, + ), + ), + ], ), SizedBox( height: 10.h, ), - Row( - children: [ - SizedBox(width: 2.w,), - Expanded( - child: Stack( - alignment: Alignment.bottomCenter, - children: [ - Image.asset( - "assets/image/vip_shop_hx.webp", - width: 100.w, - height: 120.h, - fit: BoxFit.fill, - ), - Padding( - padding: EdgeInsets.only(bottom: 4.h), - child: Text( - "6折饮品券", - style: TextStyle( - fontSize: 14.sp, - fontWeight: MyFontWeight.medium, - color: Colors.white, + Container( + height: 124.h, + margin: EdgeInsets.only(bottom: 16.h), + child: Stack( + children: [ + Image.asset( + "assets/image/vip_shop_bj.webp", + fit: BoxFit.fill, //填充剩余空间 + height:double.infinity, + width: double.infinity, + ), + Container( + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Expanded(child:Padding( + padding:EdgeInsets.only(top:25.h,left: 19.w), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "海峡姐妹饮品券", + style: TextStyle( + color: Color(0xff32A060), + fontSize: 15.sp, + fontWeight: MyFontWeight.semi_bold, + ), + ), + SizedBox(height: 5.h,), + Text.rich( + TextSpan( + children: [ + TextSpan( + text: "6", + style: TextStyle( + fontWeight: MyFontWeight.semi_bold, + fontSize: 36.sp, + color: Color(0xffFF7E12), + ), + ), + TextSpan( + text: " 折", + style: TextStyle( + fontSize: 24.sp, + color: Color(0xffFF7E12), + fontWeight: MyFontWeight.semi_bold, + ), + ), + ], + ), + textDirection: TextDirection.ltr, + ), + ], + ),)), + Image.asset( + "assets/image/vip_shop_hx.webp", + fit: BoxFit.fill, //填充剩余空间 + height:85, + width: 85, ), - ), + ], ), - ], - )), - SizedBox( - width: 14.w, - ), - Expanded( - child: Stack( - alignment: Alignment.bottomCenter, - children: [ - Image.asset( - "assets/image/vip_shop_qj.webp", - width: 100.w, - height: 120.h, - fit: BoxFit.fill, - ), - Padding( - padding: EdgeInsets.only(bottom: 4.h), - child: Text( - "7折烘焙券", - style: TextStyle( - fontSize: 14.sp, - fontWeight: MyFontWeight.medium, - color: Colors.white, - ), - ), - ), - ], + ) + ], + ), + ), + Container( + height: 124.h, + margin: EdgeInsets.only(bottom: 16.h), + child: Stack( + children: [ + Image.asset( + "assets/image/vip_shop_bj.webp", + fit: BoxFit.fill, //填充剩余空间 + height:double.infinity, + width: double.infinity, ), - ), - SizedBox( - width: 14.w, - ), - Expanded( - child: Stack( - alignment: Alignment.bottomCenter, - children: [ - Image.asset( - "assets/image/vip_shop_hg.webp", - width:100.w, - height: 120.h, - fit: BoxFit.fill, - ), - Padding( - padding: EdgeInsets.only(bottom: 4.h), - child: Text( - "8折火锅券", - style: TextStyle( - fontSize: 14.sp, - fontWeight: MyFontWeight.medium, - color: Colors.white, - ), + Container( + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Expanded(child:Padding( + padding:EdgeInsets.only(top:25.h,left: 19.w), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "前进麦味烘焙券", + style: TextStyle( + color: Color(0xff32A060), + fontSize: 15.sp, + fontWeight: MyFontWeight.semi_bold, + ), + ), + SizedBox(height: 5.h,), + Text.rich( + TextSpan( + children: [ + TextSpan( + text: "7", + style: TextStyle( + fontWeight: MyFontWeight.semi_bold, + fontSize: 36.sp, + color: Color(0xffFF7E12), + ), + ), + TextSpan( + text: " 折", + style: TextStyle( + fontSize: 24.sp, + color: Color(0xffFF7E12), + fontWeight: MyFontWeight.semi_bold, + ), + ), + ], + ), + textDirection: TextDirection.ltr, + ), + ], + ),)), + Image.asset( + "assets/image/vip_shop_qj.webp", + fit: BoxFit.fill, //填充剩余空间 + height:85, + width: 85, ), - ), - ], + ], + ), + ) + ], + ), + ), + Container( + height: 124.h, + margin: EdgeInsets.only(bottom: 22.h), + child: Stack( + children: [ + Image.asset( + "assets/image/vip_shop_bj.webp", + fit: BoxFit.fill, //填充剩余空间 + height:double.infinity, + width: double.infinity, ), - ), - ], + Container( + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Expanded(child:Padding( + padding:EdgeInsets.only(top:25.h,left: 19.w), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "门店火锅券", + style: TextStyle( + color: Color(0xff32A060), + fontSize: 15.sp, + fontWeight: MyFontWeight.semi_bold, + ), + ), + SizedBox(height: 5.h,), + Text.rich( + TextSpan( + children: [ + TextSpan( + text: "8", + style: TextStyle( + fontWeight: MyFontWeight.semi_bold, + fontSize: 36.sp, + color: Color(0xffFF7E12), + ), + ), + TextSpan( + text: " 折", + style: TextStyle( + fontSize: 24.sp, + color: Color(0xffFF7E12), + fontWeight: MyFontWeight.semi_bold, + ), + ), + ], + ), + textDirection: TextDirection.ltr, + ), + ], + ),)), + Image.asset( + "assets/image/vip_shop_hg.webp", + fit: BoxFit.fill, //填充剩余空间 + height:85, + width: 85, + ), + ], + ), + ) + ], + ), ), ], ), diff --git a/lib/vip/vip_view/vip_goods_discount.dart b/lib/vip/vip_view/vip_goods_discount.dart index 668e729d..167fe5cc 100644 --- a/lib/vip/vip_view/vip_goods_discount.dart +++ b/lib/vip/vip_view/vip_goods_discount.dart @@ -85,9 +85,9 @@ class _VipGoodsDiscount extends State<VipGoodsDiscount> { Widget vipGoodsRecommend(){ return Container( margin: EdgeInsets.only(top: 12.h), - height: 195.h, + height: 261.h, width: double.infinity, - padding: EdgeInsets.only(top: 16.h,left: 8.h), + padding: EdgeInsets.only(top: 16.h,left: 13.h), decoration: BoxDecoration( borderRadius: BorderRadius.circular(6.w), color: Colors.white, @@ -104,15 +104,27 @@ class _VipGoodsDiscount extends State<VipGoodsDiscount> { mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text( - S.of(context).huiyuanzhuanxiangjiage, - style: TextStyle( - color: Colors.black, - fontSize:15.sp, - fontWeight: MyFontWeight.semi_bold, - ), + Row( + children: [ + SizedBox(width: 7.w,), + Image.asset( + "assets/image/vip_title.webp", + fit: BoxFit.fill, //填充剩余空间 + height:13.h, + width: 27.w, + ), + SizedBox(width: 4.w,), + Text( + S.of(context).huiyuanzhuanxiangjiage, + style: TextStyle( + color: Colors.black, + fontSize:15.sp, + fontWeight: MyFontWeight.semi_bold, + ), + ), + ], ), - SizedBox(height:20.h,), + SizedBox(height:10.h,), vipGoodsRecommendList(), ], ), @@ -121,7 +133,7 @@ class _VipGoodsDiscount extends State<VipGoodsDiscount> { Widget vipGoodsRecommendList(){ return Container( - height: 126.h, + height: 200.h, child: ListView.builder( scrollDirection: Axis.horizontal, physics: BouncingScrollPhysics(), @@ -147,35 +159,53 @@ class _VipGoodsDiscount extends State<VipGoodsDiscount> { Widget vipGoodsRecommendItem(ProductVips productVips){ return Container( - width: 70.w, - margin: EdgeInsets.only(right:40.w,left:6.w), + width: 140.w, + margin: EdgeInsets.only(right:13.w,left:6.w), child: Column( mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Stack( - alignment: Alignment.bottomCenter, + MImage( + productVips.thumbnailImg ?? "", + width: 140.w, + height: 145.h, + fit: BoxFit.cover, + radius: BorderRadius.circular(6), + errorSrc: "assets/image/default_1.webp", + fadeSrc: "assets/image/default_1.webp", + ), + Expanded(child: Padding(padding:EdgeInsets.only(top:10.h,bottom:7.h), + child: Text( + productVips.productName ?? "", + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: TextStyle( + color: Color(0xff0D0D0D), + fontSize:14.sp, + fontWeight: MyFontWeight.regular, + ),), + )), + Row( children: [ - MImage( - productVips.thumbnailImg ?? "", - width: 70, - height: 70, - fit: BoxFit.cover, - radius: BorderRadius.circular(2), - errorSrc: "assets/image/default_1.webp", - fadeSrc: "assets/image/default_1.webp", - ), + Text( + "¥${productVips.vipPrice ?? "0.00"}", + style: TextStyle( + color: Color(0xff32A060), + fontSize:14.sp, + fontWeight: MyFontWeight.medium, + ),), if(productVips.vipDiscount != "0.00") Container( - width: 70, - padding: EdgeInsets.symmetric(vertical:2.h), - alignment: Alignment.center, + padding: EdgeInsets.symmetric(vertical: 2.h,horizontal:3.w), + margin: EdgeInsets.only(left: 5.w), decoration: BoxDecoration( + color: Color(0xffF96519), borderRadius: BorderRadius.only( - bottomRight: Radius.circular(2.r), - bottomLeft: Radius.circular(2.r), - ), - color: Color(0xff32A060), + topLeft: Radius.circular(10), + topRight: Radius.circular(10), + bottomLeft: Radius.circular(0), + bottomRight: Radius.circular(10), + ), ), child: Text( "省${productVips.vipDiscount ?? "0"}元", @@ -186,25 +216,7 @@ class _VipGoodsDiscount extends State<VipGoodsDiscount> { ),), ), ], - ), - Padding(padding:EdgeInsets.only(top:6.h,bottom: 4.h), - child: Text( - productVips.productName ?? "", - maxLines: 1, - overflow: TextOverflow.ellipsis, - style: TextStyle( - color: Color(0xff0D0D0D), - fontSize:14.sp, - fontWeight: MyFontWeight.regular, - ),), - ), - Text( - "¥${productVips.vipPrice ?? "0.00"}", - style: TextStyle( - color: Color(0xff0D0D0D), - fontSize:14.sp, - fontWeight: MyFontWeight.medium, - ),) + ) ], ), ); diff --git a/lib/vip/vip_view/vip_top.dart b/lib/vip/vip_view/vip_top.dart index 4c8f0f8a..eaf909c1 100644 --- a/lib/vip/vip_view/vip_top.dart +++ b/lib/vip/vip_view/vip_top.dart @@ -114,20 +114,91 @@ class _VipTop extends State<VipTop> { @override Widget build(BuildContext context) { - return Container( - child: Column( - children: [ - vipCard(), - SizedBox( - height: 15.h, + return Stack( + children: [ + Container( + height: 246.h, + decoration: BoxDecoration( + color: Color(0xff32A060), + borderRadius: BorderRadius.vertical( + bottom: Radius.circular(8.w), + ), ), - (!(widget?.vipCardHome?.member?.isVip ?? false)) - ? vipCardList() - : Padding( - padding: EdgeInsets.symmetric(horizontal: 16.w), - child: Row( - children: [ - Expanded( + ), + Container( + child: Column( + children: [ + vipCard(), + SizedBox( + height: 15.h, + ), + (!(widget?.vipCardHome?.member?.isVip ?? false)) + ? vipCardList() + : Padding( + padding: EdgeInsets.symmetric(horizontal: 16.w), + child: Row( + children: [ + Expanded( + child: Container( + alignment: Alignment.center, + padding: EdgeInsets.symmetric( + horizontal: 10.w, vertical: 15.h), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(4.w), + color: Color(0xffffffff), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ) + ], + ), + child: Text.rich( + TextSpan( + children: [ + TextSpan( + text: S.of(context).yixianghuiyuanquanyi, + style: TextStyle( + fontWeight: MyFontWeight.semi_bold, + fontSize: 15.sp, + color: Color(0xff32A060), + ), + ), + TextSpan( + text: widget + ?.vipCardHome?.member?.vipDuration + .toString() ?? + "0", + style: TextStyle( + fontWeight: MyFontWeight.semi_bold, + fontSize: 18.sp, + color: Color(0xffF96519), + ), + ), + TextSpan( + text: " 天", + style: TextStyle( + fontWeight: MyFontWeight.semi_bold, + fontSize: 15.sp, + color: Color(0xff32A060), + ), + ), + ], + ), + textDirection: TextDirection.ltr, + ))), + SizedBox( + width: 10.w, + ), + Expanded( + child: GestureDetector( + onTap: () { + setState(() { + vipRenewShowBottomSheet(); + }); + }, child: Container( alignment: Alignment.center, padding: EdgeInsets.symmetric( @@ -144,100 +215,42 @@ class _VipTop extends State<VipTop> { ) ], ), - child: Text.rich( - TextSpan( - children: [ - TextSpan( - text: S.of(context).yixianghuiyuanquanyi, - style: TextStyle( - fontWeight: MyFontWeight.semi_bold, - fontSize: 15.sp, - color: Color(0xff32A060), - ), - ), - TextSpan( - text: widget - ?.vipCardHome?.member?.vipDuration - .toString() ?? - "0", - style: TextStyle( - fontWeight: MyFontWeight.semi_bold, - fontSize: 18.sp, - color: Color(0xffF96519), - ), - ), - TextSpan( - text: " 天", - style: TextStyle( - fontWeight: MyFontWeight.semi_bold, - fontSize: 15.sp, - color: Color(0xff32A060), - ), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + "${(widget?.vipCardHome?.member?.isVipSubscribe ?? false) ? "已开通自动续费" : "续费回乡VIP"}", + style: TextStyle( + color: Color((widget?.vipCardHome + ?.member?.isVipSubscribe ?? + false) + ? 0xff3A3936 + : 0xff32A060), + fontSize: 15.sp, + fontWeight: MyFontWeight.semi_bold, ), - ], - ), - textDirection: TextDirection.ltr, + ), + SizedBox( + width: 6.w, + ), + Image.asset( + "${(widget?.vipCardHome?.member?.isVipSubscribe ?? false) ? "assets/image/vip_xf.webp" : "assets/image/icon_right.webp"}", + width: 16, + height: 16, + fit: BoxFit.fill, + color: Color(0xff32A060), + ), + ], ))), - SizedBox( - width: 10.w, - ), - Expanded( - child: GestureDetector( - onTap: () { - setState(() { - vipRenewShowBottomSheet(); - }); - }, - child: Container( - alignment: Alignment.center, - padding: EdgeInsets.symmetric( - horizontal: 10.w, vertical: 15.h), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(4.w), - color: Color(0xffffffff), - boxShadow: [ - BoxShadow( - color: Colors.black.withAlpha(12), - offset: Offset(0, 3), - blurRadius: 14, - spreadRadius: 0, - ) - ], - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Text( - "${(widget?.vipCardHome?.member?.isVipSubscribe ?? false) ? "已开通自动续费" : "续费回乡VIP"}", - style: TextStyle( - color: Color((widget?.vipCardHome - ?.member?.isVipSubscribe ?? - false) - ? 0xff3A3936 - : 0xff32A060), - fontSize: 15.sp, - fontWeight: MyFontWeight.semi_bold, - ), - ), - SizedBox( - width: 6.w, - ), - Image.asset( - "${(widget?.vipCardHome?.member?.isVipSubscribe ?? false) ? "assets/image/vip_xf.webp" : "assets/image/icon_right.webp"}", - width: 16, - height: 16, - fit: BoxFit.fill, - color: Color(0xff32A060), - ), - ], - ))), - ) - ], - ), + ) + ], ), - ], - ), + ), + ], + ), + ) + ], ); } @@ -245,8 +258,9 @@ class _VipTop extends State<VipTop> { Widget vipCard() { return Container( margin: EdgeInsets.fromLTRB( - 14.w, MediaQuery.of(context).padding.top + 25.h, 14.w, 8.h), - height: 167.h, + 14.w,( MediaQuery.of(context).padding.top + 50.h), 14.w, 8.h), + width: double.infinity, + height: 207.h, decoration: BoxDecoration( borderRadius: BorderRadius.circular(8.w), color: Colors.white, @@ -265,29 +279,22 @@ class _VipTop extends State<VipTop> { Image.asset( "assets/image/vip_card.webp", fit: BoxFit.fill, //填充剩余空间 - height: 167.h, + height:double.infinity, + width: double.infinity, ), Container( - padding: EdgeInsets.all(16.w), + padding: EdgeInsets.only(top: 24.h,right:16.w), + alignment: Alignment.topRight, child: Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ - Expanded( - child: Text( - S.of(context).huixiangVIPka, - style: TextStyle( - color: Color(0xff32A060), - fontSize: 24.sp, - fontWeight: MyFontWeight.semi_bold, - ), - )), Text( widget?.vipCardHome?.member?.nickname ?? "", style: TextStyle( - color: Colors.white, + color: Color(0xff32A060), fontSize: 15.sp, - fontWeight: MyFontWeight.regular, + fontWeight: MyFontWeight.medium, ), ), SizedBox( @@ -297,7 +304,7 @@ class _VipTop extends State<VipTop> { Text( "有效期至 ${(widget?.vipCardHome?.member?.vipExpire ?? "").substring(0, (widget?.vipCardHome?.member?.vipExpire ?? "").indexOf(" "))}", style: TextStyle( - color: Color(0xffFFFFFF), + color: Color(0xff32A060), fontSize: 13.sp, fontWeight: MyFontWeight.regular, ),