From 60844c080f9cddb37ac5ee8649de2f34ab0e100d Mon Sep 17 00:00:00 2001 From: wurong <953969641@qq.com> Date: Fri, 19 May 2023 16:34:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E6=83=A0=E9=80=89=E6=8B=A9=E4=BC=98?= =?UTF-8?q?=E5=8C=96=EF=BC=9B=20=E5=90=8E=E5=8F=B0=E5=81=9C=E7=95=997?= =?UTF-8?q?=E5=88=86=E9=92=9F=E5=90=8E=E9=87=8D=E5=90=AF=E5=BA=94=E7=94=A8?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=9B=B4=E6=94=B9=EF=BC=9B=20=E5=95=86?= =?UTF-8?q?=E5=93=81=E8=AF=A6=E6=83=85=E4=BC=98=E5=8C=96=EF=BC=8C=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E6=AD=A3=E5=9C=A8=E5=8A=A0=E8=BD=BD=EF=BC=9B=20?= =?UTF-8?q?=E9=83=A8=E5=88=86=E4=BC=98=E5=8C=96=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/home/start_page.dart | 17 +- lib/main.dart | 2 + lib/main_page.dart | 2 +- lib/settlement/settlement.dart | 2 +- .../activity_coupon_remarks.dart | 4 +- lib/store/shop_details_page.dart | 339 +++++++++--------- 6 files changed, 182 insertions(+), 184 deletions(-) diff --git a/lib/home/start_page.dart b/lib/home/start_page.dart index c9e41f84..c01cd66c 100644 --- a/lib/home/start_page.dart +++ b/lib/home/start_page.dart @@ -1,15 +1,10 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:huixiang/generated/l10n.dart'; -import 'package:huixiang/utils/font_weight.dart'; -import 'package:huixiang/view_widget/border_text.dart'; -import 'package:shared_preferences/shared_preferences.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; class StartPage extends StatefulWidget { - final bool isFirst; - - StartPage(this.isFirst); + // final bool isFirst; + // + // StartPage(this.isFirst); @override State createState() { return _StartPage(); @@ -36,8 +31,10 @@ class _StartPage extends State { @override void initState() { super.initState(); - Future.delayed(Duration(seconds:3), () { - Navigator.of(context).popAndPushNamed((widget.isFirst ?? true) ? '/router/guide_Page' : '/router/new_login_page'); + Future.delayed(Duration(seconds:2), () { + // Navigator.of(context).popAndPushNamed((widget.isFirst ?? true) ? + // '/router/guide_Page' : '/router/new_login_page'); + Navigator.of(context).popAndPushNamed('/router/main_page'); }); } } diff --git a/lib/main.dart b/lib/main.dart index 26e5d430..4c4993b4 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -93,6 +93,7 @@ import 'community/report/report_success.dart'; import 'home/guide_page.dart'; import 'home/help_farmers/help_farmers_page.dart'; import 'home/home_view/activity_list.dart'; +import 'home/start_page.dart'; import 'home/welfare_exchange.dart'; import 'home/welfare_page.dart'; import 'login/login_store_select.dart'; @@ -352,6 +353,7 @@ Map routers = { '/router/about_page': (context, {arguments}) => AboutPage(), '/router/qr_share': (context, {arguments}) => QrSharePage(), '/router/main_page': (context, {arguments}) => MainPage(arguments: arguments), + '/router/start_page': (context, {arguments}) => StartPage(), '/router/test_page': (context, {arguments}) => TestPage(), '/router/communityFollow': (context, {arguments}) => CommunityFollow(arguments:arguments), '/router/releasePage': (context, {arguments}) => ReleasePage(), diff --git a/lib/main_page.dart b/lib/main_page.dart index 4b9178ee..bfcbc3ea 100644 --- a/lib/main_page.dart +++ b/lib/main_page.dart @@ -74,7 +74,7 @@ class _MainPage extends State with WidgetsBindingObserver { case AppLifecycleState.resumed: //从后台切换前台,界面可见 pushRoute(); if(DateTime.now().millisecondsSinceEpoch - lastTime > 420000) - Navigator.of(context).popAndPushNamed('/router/main_page'); + Navigator.of(context).popAndPushNamed('/router/start_page'); break; case AppLifecycleState.paused: // 界面不可见,后台 lastTime = DateTime.now().millisecondsSinceEpoch; diff --git a/lib/settlement/settlement.dart b/lib/settlement/settlement.dart index 4a42c472..397d44a9 100644 --- a/lib/settlement/settlement.dart +++ b/lib/settlement/settlement.dart @@ -184,7 +184,7 @@ class _Settlement extends State { ? ((vipLevelName == "黄金会员" && placeOrder) ? "MEMBER_RANK" : "NONE") - : "VIP", + : "AUTO", // useVipPriceSelect, // (useVipPriceSelect == true && isVips) ? false:useBenefitSelect, count1, diff --git a/lib/settlement/settlement_view/activity_coupon_remarks.dart b/lib/settlement/settlement_view/activity_coupon_remarks.dart index 8e3fb641..a8630df5 100644 --- a/lib/settlement/settlement_view/activity_coupon_remarks.dart +++ b/lib/settlement/settlement_view/activity_coupon_remarks.dart @@ -122,7 +122,7 @@ class _ActivityCouponRemarks extends State { (widget.coupons != null && widget.coupons != "" || widget.promotions != null && widget.promotions != "" || - widget.payChannell == 5 || widget.payChannell == 7) + widget.payChannell == 5 || widget.payChannell == 7 ||(widget?.settleOrderInfo?.discountType ?? "") == "MEMBER_RANK" ||(widget.payChannell == 4 && widget.settleOrderInfo.promotionInfoList.length <=0 && widget.settleOrderInfo.couponList.length <= 0)) ? false : vipSelect, materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, @@ -179,7 +179,7 @@ class _ActivityCouponRemarks extends State { widget.promotions != null && widget.promotions != "" || widget.payChannell == 5 || - widget.payChannell == 7 || (widget.payChannell == 4 && widget.settleOrderInfo.promotionInfoList.length <=0 && widget.settleOrderInfo.couponList.length <= 0)) + widget.payChannell == 7 ||(widget?.settleOrderInfo?.discountType ?? "") == "MEMBER_RANK"|| (widget.payChannell == 4 && widget.settleOrderInfo.promotionInfoList.length <=0 && widget.settleOrderInfo.couponList.length <= 0)) ? false : vipSelect) ? "assets/image/vip_price.webp" diff --git a/lib/store/shop_details_page.dart b/lib/store/shop_details_page.dart index 76997a33..c27d2d8b 100644 --- a/lib/store/shop_details_page.dart +++ b/lib/store/shop_details_page.dart @@ -92,6 +92,7 @@ class _ShopDetailsPage extends State { /// 查询店铺信息 queryStoreInfo() async { + EasyLoading.show(status: S.current.zhengzaijiazai); SharedPreferences value = await SharedPreferences.getInstance(); if (apiService == null) apiService = ApiService( @@ -113,7 +114,7 @@ class _ShopDetailsPage extends State { } minLogin(); } - EasyLoading.dismiss(); + // EasyLoading.dismiss(); } /// 小程序登录 @@ -145,7 +146,7 @@ class _ShopDetailsPage extends State { this.shopCarGoods = value; setState(() {}); }); - EasyLoading.dismiss(); + // EasyLoading.dismiss(); } }); } @@ -163,6 +164,7 @@ class _ShopDetailsPage extends State { selectSkus.add(element.attrValueList[0].attrValue); }); }); + EasyLoading.dismiss(); refreshController.refreshCompleted(); } else { refreshController.refreshFailed(); @@ -601,190 +603,187 @@ class _ShopDetailsPage extends State { @override Widget build(BuildContext context) { return Scaffold( - body: Container( - child: Column( - children: [ - Expanded( - child: SmartRefresher( - controller: refreshController, - enablePullDown: true, - enablePullUp: false, - header: MyHeader(), - footer: CustomFooter( - builder: (context, mode) { - return MyFooter(mode); - }, - ), - onRefresh: () { - setState(() { - _onRefresh(); - }); + body: Column( + children: [ + Expanded( + child: SmartRefresher( + controller: refreshController, + enablePullDown: true, + enablePullUp: false, + header: MyHeader(), + footer: CustomFooter( + builder: (context, mode) { + return MyFooter(mode); }, - physics: BouncingScrollPhysics(), - scrollController: scrollController, - child: Container( - child: SingleChildScrollView( - physics: BouncingScrollPhysics(), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - buildProduct(), - SizedBox( - height: 16.h, - ), - Container( - width: double.infinity, - // padding: EdgeInsets.symmetric(horizontal: 14.w,vertical: 16.h), - color: Colors.white, - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.only(left: 14.w, top: 16.h), - child: Text( - "商品详情", - style: TextStyle( - fontSize: 15.sp, - fontWeight: MyFontWeight.semi_bold, - color: Color(0xFF000000), - ), + ), + onRefresh: () { + setState(() { + _onRefresh(); + }); + }, + physics: BouncingScrollPhysics(), + scrollController: scrollController, + child: Container( + child: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + buildProduct(), + SizedBox( + height: 16.h, + ), + Container( + width: double.infinity, + color: Colors.white, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.only(left: 14.w, top: 16.h), + child: Text( + "商品详情", + style: TextStyle( + fontSize: 15.sp, + fontWeight: MyFontWeight.semi_bold, + color: Color(0xFF000000), ), ), - SizedBox( - height: 14.h, - ), - Container( - color: Colors.white, - child: Html( - data: miNiDetail?.details ?? "", - style: { - 'body': Style( - backgroundColor: Colors.white, - padding: EdgeInsets.all(0), - margin: EdgeInsets.all(0)), - 'p': Style( - margin: EdgeInsets.all(0), + ), + SizedBox( + height: 14.h, + ), + Container( + color: Colors.white, + child: Html( + data: miNiDetail?.details ?? "", + style: { + 'body': Style( + backgroundColor: Colors.white, padding: EdgeInsets.all(0), - ), - }, - customImageRenders: { - networkSourceMatcher(): networkImageRender( - loadingWidget: () { - return Container(); - }, - ), - }, - ), + margin: EdgeInsets.all(0)), + 'p': Style( + margin: EdgeInsets.all(0), + padding: EdgeInsets.all(0), + ), + }, + customImageRenders: { + networkSourceMatcher(): networkImageRender( + loadingWidget: () { + return Container(); + }, + ), + }, ), - ], - ), - ) - ], - ), + ), + ], + ), + ) + ], ), ), ), - flex: 1, ), - if (count() != 0) - Stack( - alignment: Alignment.bottomLeft, - children: [ - Container( - margin: EdgeInsets.symmetric(horizontal: 14), - height: 45.h, - // color: Color(0xFFFAFAFA), - decoration: BoxDecoration( - color: Color(0xFF383A38), - borderRadius: BorderRadius.circular(100), - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox( - width: 45.w, - ), - Text.rich( - TextSpan(children: [ - TextSpan( - text: "¥ ", - style: TextStyle( - fontSize: 12.sp, - color: Color(0xFFFFFFFF), - fontWeight: MyFontWeight.bold), - ), - TextSpan( - text: shopCarGoods != null - ? shopCarGoods.cartSum - : "0.0", - style: TextStyle( - fontSize: 20.sp, - color: Color(0xFFFFFFFF), - fontFamily: 'JDZhengHT', - fontWeight: MyFontWeight.medium), - ), - ]), - ), - Spacer(), - GestureDetector( - onTap: () { - toDownOrder(); - }, - child: RoundButton( - width: 103.w, - height: 54.h, - text: S.current.jiesuan, - textColor: Colors.white, - fontWeight: MyFontWeight.bold, - backgroup: Color(0xFF32A060), - radius: 100, - fontSize: 16.sp, - padding: EdgeInsets.symmetric(vertical: 5.h), - ), - ), - ], - ), + flex: 1, + ), + if (count() != 0) + Stack( + alignment: Alignment.bottomLeft, + children: [ + Container( + margin: EdgeInsets.symmetric(horizontal: 14), + height: 45.h, + // color: Color(0xFFFAFAFA), + decoration: BoxDecoration( + color: Color(0xFF383A38), + borderRadius: BorderRadius.circular(100), ), - Stack( + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.center, children: [ - InkWell( + SizedBox( + width: 45.w, + ), + Text.rich( + TextSpan(children: [ + TextSpan( + text: "¥ ", + style: TextStyle( + fontSize: 12.sp, + color: Color(0xFFFFFFFF), + fontWeight: MyFontWeight.bold), + ), + TextSpan( + text: shopCarGoods != null + ? shopCarGoods.cartSum + : "0.0", + style: TextStyle( + fontSize: 20.sp, + color: Color(0xFFFFFFFF), + fontFamily: 'JDZhengHT', + fontWeight: MyFontWeight.medium), + ), + ]), + ), + Spacer(), + GestureDetector( onTap: () { - if (count() != 0) showShoppingCart(); + toDownOrder(); }, - child: Image.asset( - "assets/image/shopping_bag.webp", - width: 66, - height: 66, - fit: BoxFit.fitWidth, + child: RoundButton( + width: 103.w, + height: 54.h, + text: S.current.jiesuan, + textColor: Colors.white, + fontWeight: MyFontWeight.bold, + backgroup: Color(0xFF32A060), + radius: 100, + fontSize: 16.sp, + padding: EdgeInsets.symmetric(vertical: 5.h), ), ), - if (count() != 0) - Positioned( - right: 5, - // top: 14, - child: RoundButton( - width: 17.w, - height: 17.h, - text: "${count()}", - textColor: Colors.white, - fontWeight: MyFontWeight.regular, - backgroup: Color(0xFFF65720), - fontSize: 12.sp, - radius: 100, - ), - ), ], ), - ], - ), - SizedBox( - height: 30.h, - ) - ], - ), + ), + Stack( + children: [ + InkWell( + onTap: () { + if (count() != 0) showShoppingCart(); + }, + child: Image.asset( + "assets/image/shopping_bag.webp", + width: 66, + height: 66, + fit: BoxFit.fitWidth, + ), + ), + if (count() != 0) + Positioned( + right: 5, + // top: 14, + child: RoundButton( + width: 17.w, + height: 17.h, + text: "${count()}", + textColor: Colors.white, + fontWeight: MyFontWeight.regular, + backgroup: Color(0xFFF65720), + fontSize: 12.sp, + radius: 100, + ), + ), + ], + ), + ], + ), + SizedBox( + height: 30.h, + ) + ], ), ); } @@ -828,7 +827,7 @@ class _ShopDetailsPage extends State { ), ), SizedBox( - width: 2, + width: 2.w, ), Expanded( child: Text(