From 698bb28c8bfc46822f7df3bc9d2bfd63f097eb7e Mon Sep 17 00:00:00 2001 From: wurong <953969641@qq.com> Date: Wed, 11 Jan 2023 17:52:18 +0800 Subject: [PATCH] =?UTF-8?q?vip=E8=A7=84=E5=88=99=E5=BC=B9=E7=AA=97?= =?UTF-8?q?=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/vip/vip_view/exclusive_coupon.dart | 306 ++++++++++++----------- lib/vip/vip_view/vip_goods_discount.dart | 131 +++++----- 2 files changed, 223 insertions(+), 214 deletions(-) diff --git a/lib/vip/vip_view/exclusive_coupon.dart b/lib/vip/vip_view/exclusive_coupon.dart index 0b7038c5..a755ffaf 100644 --- a/lib/vip/vip_view/exclusive_coupon.dart +++ b/lib/vip/vip_view/exclusive_coupon.dart @@ -19,7 +19,8 @@ class _ExclusiveCoupon extends State { return Container( margin: EdgeInsets.only(left: 14.w, right: 14.w, bottom: 40.h), width: double.infinity, - padding: EdgeInsets.only(top: 20.h,left: 20.h,bottom: 10.h,right: 20.w), + 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, @@ -38,14 +39,18 @@ class _ExclusiveCoupon extends State { children: [ Row( children: [ - SizedBox(width: 7.w,), + SizedBox( + width: 7.w, + ), Image.asset( "assets/image/vip_title.webp", fit: BoxFit.fill, //填充剩余空间 - height:13.h, + height: 13.h, width: 27.w, ), - SizedBox(width: 4.w,), + SizedBox( + width: 4.w, + ), Text( S.of(context).zhuanxiangyouhuiquan, style: TextStyle( @@ -56,15 +61,16 @@ class _ExclusiveCoupon extends State { ), GestureDetector( behavior: HitTestBehavior.translucent, - onTap: (){ + onTap: () { showAlertDialog(); }, - child:Container( - padding: EdgeInsets.only(left: 8.w,right:30.w,top: 3.h,bottom: 3.h), + child: Container( + padding: EdgeInsets.only( + left: 8.w, right: 30.w, top: 3.h, bottom: 3.h), child: Image.asset( "assets/image/vip_tips.webp", fit: BoxFit.fill, //填充剩余空间 - height:14, + height: 14, width: 14, ), ), @@ -82,7 +88,7 @@ class _ExclusiveCoupon extends State { Image.asset( "assets/image/vip_shop_bj.webp", fit: BoxFit.fill, //填充剩余空间 - height:double.infinity, + height: double.infinity, width: double.infinity, ), Container( @@ -90,51 +96,55 @@ class _ExclusiveCoupon extends State { mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.center, children: [ - Expanded(child:Padding( - padding:EdgeInsets.only(top:25.h,left: 19.w), + 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, + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "海峡姐妹饮品券", + style: TextStyle( + color: Color(0xff32A060), + fontSize: 15.sp, + fontWeight: MyFontWeight.semi_bold, + ), ), - ), - SizedBox(height: 5.h,), - Text.rich( - TextSpan( - children: [ - TextSpan( - text: "6", - style: TextStyle( - fontWeight: MyFontWeight.extra_bold, - fontSize: 36.sp, - fontFamily: 'JDZhengHT', - color: Color(0xffFF7E12), + SizedBox( + height: 5.h, + ), + Text.rich( + TextSpan( + children: [ + TextSpan( + text: "6", + style: TextStyle( + fontWeight: MyFontWeight.extra_bold, + fontSize: 36.sp, + fontFamily: 'JDZhengHT', + color: Color(0xffFF7E12), + ), ), - ), - TextSpan( - text: " 折", - style: TextStyle( - fontSize: 24.sp, - color: Color(0xffFF7E12), - fontWeight: MyFontWeight.semi_bold, + TextSpan( + text: " 折", + style: TextStyle( + fontSize: 24.sp, + color: Color(0xffFF7E12), + fontWeight: MyFontWeight.semi_bold, + ), ), - ), - ], + ], + ), + textDirection: TextDirection.ltr, ), - textDirection: TextDirection.ltr, - ), - ], - ),)), + ], + ), + )), Image.asset( "assets/image/vip_shop_hx.webp", fit: BoxFit.fill, //填充剩余空间 - height:85, + height: 85, width: 85, ), ], @@ -151,7 +161,7 @@ class _ExclusiveCoupon extends State { Image.asset( "assets/image/vip_shop_bj.webp", fit: BoxFit.fill, //填充剩余空间 - height:double.infinity, + height: double.infinity, width: double.infinity, ), Container( @@ -159,8 +169,9 @@ class _ExclusiveCoupon extends State { mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.center, children: [ - Expanded(child:Padding( - padding:EdgeInsets.only(top:25.h,left: 19.w), + Expanded( + child: Padding( + padding: EdgeInsets.only(top: 25.h, left: 19.w), child: Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, @@ -173,7 +184,9 @@ class _ExclusiveCoupon extends State { fontWeight: MyFontWeight.semi_bold, ), ), - SizedBox(height: 5.h,), + SizedBox( + height: 5.h, + ), Text.rich( TextSpan( children: [ @@ -199,11 +212,12 @@ class _ExclusiveCoupon extends State { textDirection: TextDirection.ltr, ), ], - ),)), + ), + )), Image.asset( "assets/image/vip_shop_qj.webp", fit: BoxFit.fill, //填充剩余空间 - height:85, + height: 85, width: 85, ), ], @@ -220,7 +234,7 @@ class _ExclusiveCoupon extends State { Image.asset( "assets/image/vip_shop_bj.webp", fit: BoxFit.fill, //填充剩余空间 - height:double.infinity, + height: double.infinity, width: double.infinity, ), Container( @@ -228,8 +242,9 @@ class _ExclusiveCoupon extends State { mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.center, children: [ - Expanded(child:Padding( - padding:EdgeInsets.only(top:25.h,left: 19.w), + Expanded( + child: Padding( + padding: EdgeInsets.only(top: 25.h, left: 19.w), child: Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, @@ -242,7 +257,9 @@ class _ExclusiveCoupon extends State { fontWeight: MyFontWeight.semi_bold, ), ), - SizedBox(height: 5.h,), + SizedBox( + height: 5.h, + ), Text.rich( TextSpan( children: [ @@ -268,11 +285,12 @@ class _ExclusiveCoupon extends State { textDirection: TextDirection.ltr, ), ], - ),)), + ), + )), Image.asset( "assets/image/vip_shop_hg.webp", fit: BoxFit.fill, //填充剩余空间 - height:85, + height: 85, width: 85, ), ], @@ -288,104 +306,88 @@ class _ExclusiveCoupon extends State { ///会员优惠规则弹窗 showAlertDialog() { - //显示对话框 - showDialog( - context: context, - builder: (BuildContext context) { - return SimpleDialog( - backgroundColor: Colors.transparent, - elevation: 0, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(6), - ), - children: [ - Container( - width: double.infinity, - height:470.h, - padding: EdgeInsets.only(left: 14.w,right: 14.w,bottom: 16.h), - decoration: new BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(8), - ), - child: Scaffold( - appBar: MyAppBar( - title:"", - titleColor: Colors.black, - titleSize: 10.sp, - background: Colors.white, - leadingColor: Colors.white, - actions: [ + showModalBottomSheet( + builder: (BuildContext context) { + return StatefulBuilder(builder: ( + context, + state, + ) { + return WillPopScope( + ///点击背景不收起弹窗; + // onWillPop: () async => false, + child:Stack( + alignment: Alignment.topRight, + children: [ + Container( + width: double.infinity, + height: 370.h, + padding: EdgeInsets.symmetric(horizontal: 14.w, vertical: 16.h), + decoration: new BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(8), + topRight: Radius.circular(8), + ), + ), + child: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Container( + padding: EdgeInsets.only(right: 18.w), + child: + Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 10.h, + ), + Text( + "VIP会员专享优惠券:" + "\n ①海峡姐妹饮品券" + "\n *用户开通回乡VIP卡,可享全单饮品6折优惠。" + "\n *适用饮品:门店现制奶茶类饮品及现制咖啡类饮品。" + "\n *适用门店:海峡姐妹茶汉街店、前进麦味*海峡姐妹茶哈乐城店" + "\n ②前进麦味烘焙券" + "\n *用户开通回乡VIP卡,可享全单面包7折优惠。" + "\n *适用产品:门店现制面包类产品及甜品类产品。" + "\n *适用门店:前进麦味凯德1818店、前进麦味*海峡姐妹茶哈乐城店" + "\n ③回乡农场火锅券" + "\n *用户开通回乡VIP卡,可享全单菜品(小料、酒水、饮品不参与)8折优惠。" + "\n *适用产品:门店现制菜品" + "\n *适用门店:回乡农场火锅汉街店" + "\n ④百年川椒火锅券" + "\n *用户开通回乡VIP卡,可享全单菜品(小料、酒水、饮品不参与)8折优惠。" + "\n *适用产品:门店现制菜品" + "\n *适用门店:百年川椒重庆老火锅光谷店", + style: TextStyle( + fontWeight: MyFontWeight.medium, + fontSize: 14.sp, + height: 1.7.h, + color: Colors.black, + ), + ), + ], + ), + ), + ), + ), GestureDetector( onTap: () { Navigator.of(context).pop(); }, - child: Icon( - Icons.clear, - color: Colors.black, - ), - ) - ], - ), - body: Container( - color: Colors.white, - child: SingleChildScrollView( - physics: BouncingScrollPhysics(), - child: Container( - child:Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - // Row( - // children: [ - // Spacer(), - // GestureDetector( - // onTap: () { - // Navigator.of(context).pop(); - // }, - // child: Icon( - // Icons.clear, - // color: Colors.black, - // ), - // ) - // ], - // ), - SizedBox(height: 10.h,), - Text( - "VIP会员专享优惠券:" - "\n ①海峡姐妹饮品券" - "\n *用户开通回乡VIP卡,可享全单饮品6折优惠。" - "\n *适用饮品:门店现制奶茶类饮品及现制咖啡类饮品。" - "\n *适用门店:海峡姐妹茶汉街店、前进麦味*海峡姐妹茶哈乐城店" - "\n ②前进麦味烘焙券" - "\n *用户开通回乡VIP卡,可享全单面包7折优惠。" - "\n *适用产品:门店现制面包类产品及甜品类产品。" - "\n *适用门店:前进麦味凯德1818店、前进麦味*海峡姐妹茶哈乐城店" - "\n ③回乡农场火锅券" - "\n *用户开通回乡VIP卡,可享全单菜品(小料、酒水、饮品不参与)8折优惠。" - "\n *适用产品:门店现制菜品" - "\n *适用门店:回乡农场火锅汉街店" - "\n ④百年川椒火锅券" - "\n *用户开通回乡VIP卡,可享全单菜品(小料、酒水、饮品不参与)8折优惠。" - "\n *适用产品:门店现制菜品" - "\n *适用门店:百年川椒重庆老火锅光谷店", - style: TextStyle( - fontWeight: MyFontWeight.medium, - fontSize: 14.sp, - height: 1.7.h, - color: Colors.black, - ), - ), - SizedBox(height: 15.h,) - ], + child: Container( + margin: EdgeInsets.only(right: 14.w,top: 16.h), + child: Image.asset( + "assets/image/cancel.webp", + width: 24, + height: 24, + ), ), - ), - ), - ), - ), - ), - ], - ); - }, - ); + )], + )); + }); + }, + backgroundColor: Colors.transparent, + context: context); } } diff --git a/lib/vip/vip_view/vip_goods_discount.dart b/lib/vip/vip_view/vip_goods_discount.dart index 9d7cf19e..e945fa9e 100644 --- a/lib/vip/vip_view/vip_goods_discount.dart +++ b/lib/vip/vip_view/vip_goods_discount.dart @@ -8,7 +8,6 @@ import '../../retrofit/data/vip_card_home.dart'; import '../../utils/flutter_utils.dart'; import '../../view_widget/custom_image.dart'; - class VipGoodsDiscount extends StatefulWidget { final VipCardHome vipCardHome; @@ -194,7 +193,7 @@ class _VipGoodsDiscount extends State { Widget vipGoodsRecommendItem(ProductVips productVips) { return Container( width: 116.w, - margin: EdgeInsets.only(right:4.w,left:3.w), + margin: EdgeInsets.only(right: 4.w, left: 3.w), child: Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, @@ -215,8 +214,7 @@ class _VipGoodsDiscount extends State { Container( // width:53.w, // alignment: Alignment.center, - padding: - EdgeInsets.symmetric(vertical: 2.h, horizontal:8.w), + padding: EdgeInsets.symmetric(vertical: 2.h, horizontal: 8.w), margin: EdgeInsets.only(left: 5.w), decoration: BoxDecoration( color: Color(0xffF96519), @@ -264,7 +262,9 @@ class _VipGoodsDiscount extends State { fontWeight: MyFontWeight.medium, ), ), - SizedBox(width: 4.w,), + SizedBox( + width: 4.w, + ), Text( "¥${AppUtils.calculateDouble(double.tryParse(productVips.applyPrice ?? "0.00"))}", textAlign: TextAlign.end, @@ -285,69 +285,76 @@ class _VipGoodsDiscount extends State { ///会员专享价格规则弹窗 showAlertDialog() { - //显示对话框 - showDialog( - context: context, - builder: (BuildContext context) { - return SimpleDialog( - backgroundColor: Colors.transparent, - elevation: 0, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(6), - ), - children: [ - Container( - width: double.infinity, - height: 470.h, - padding: EdgeInsets.symmetric(horizontal: 14.w, vertical: 16.h), - decoration: new BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(8), - ), - child: SingleChildScrollView( - physics: BouncingScrollPhysics(), - child: Container( - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( + showModalBottomSheet( + builder: (BuildContext context) { + return StatefulBuilder(builder: ( + context, + state, + ) { + return WillPopScope( + ///点击背景不收起弹窗; + // onWillPop: () async => false, + child: Stack( + alignment: Alignment.topRight, + children: [ + Container( + width: double.infinity, + height: 370.h, + padding: + EdgeInsets.symmetric(horizontal: 14.w, vertical: 16.h), + decoration: new BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(8), + topRight: Radius.circular(8), + ), + ), + child: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Container( + padding: EdgeInsets.only(right: 18.w), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Spacer(), - GestureDetector( - onTap: () { - Navigator.of(context).pop(); - }, - child: Icon( - Icons.clear, + SizedBox( + height: 10.h, + ), + Text( + "VIP会员专享价格" + "\n*用户开通回乡VIP卡,可享以专享优惠价格购买一心回乡APP入驻商户部分门店商品的会员权益。" + "\n*权益适用产品及专享价格,以会员权益页面公示为准。" + "\n为满足不同用户的需求,一心回乡将可能适时调整权益适用产品及专享价格,具体权益内容以会员权益页面公示为准。", + style: TextStyle( + fontWeight: MyFontWeight.medium, + fontSize: 14.sp, + height: 1.7.h, color: Colors.black, ), - ) + ), ], ), - SizedBox( - height: 10.h, - ), - Text( - "VIP会员专享价格" - "\n*用户开通回乡VIP卡,可享以专享优惠价格购买一心回乡APP入驻商户部分门店商品的会员权益。" - "\n*权益适用产品及专享价格,以会员权益页面公示为准。" - "\n为满足不同用户的需求,一心回乡将可能适时调整权益适用产品及专享价格,具体权益内容以会员权益页面公示为准。", - style: TextStyle( - fontWeight: MyFontWeight.medium, - fontSize: 14.sp, - height: 1.7.h, - color: Colors.black, - ), - ), - ], + ), ), ), - ), - ), - ], - ); - }, - ); + GestureDetector( + onTap: () { + Navigator.of(context).pop(); + }, + child: Container( + margin: EdgeInsets.only(right: 14.w, top: 16.h), + child: Image.asset( + "assets/image/cancel.webp", + width: 24, + height: 24, + ), + ), + ) + ], + )); + }); + }, + backgroundColor: Colors.transparent, + context: context); } }