diff --git a/lib/login/new_login_page.dart b/lib/login/new_login_page.dart index ff90b763..fe1e3957 100644 --- a/lib/login/new_login_page.dart +++ b/lib/login/new_login_page.dart @@ -416,7 +416,7 @@ class _NewLoginPage extends State { Container( height: 30.h, width: MediaQuery.of(context).size.width - 100.w, - margin: EdgeInsets.only(bottom:10.h), + margin: EdgeInsets.only(bottom: Platform.isIOS ? 10.h : 5.h), child: TextField( style: TextStyle( height: 1.h, diff --git a/lib/order/order_view/order_commodity.dart b/lib/order/order_view/order_commodity.dart index 3177360b..5c079ddb 100644 --- a/lib/order/order_view/order_commodity.dart +++ b/lib/order/order_view/order_commodity.dart @@ -93,7 +93,7 @@ class _OrderCommodity extends State { vipItem( Color(0xFFFF7A1A), "会员优惠金额", - widget?.orderInfo?.benefitDiscountAmount ?? "0.00", + "- ${widget?.orderInfo?.benefitDiscountAmount ?? "0.00"}", ), ); } diff --git a/lib/retrofit/data/placeOrderFirst.dart b/lib/retrofit/data/placeOrderFirst.dart index d7cc0276..e8b83162 100644 --- a/lib/retrofit/data/placeOrderFirst.dart +++ b/lib/retrofit/data/placeOrderFirst.dart @@ -119,8 +119,9 @@ class PromotionInfoDTOBean { String couponId; String promotionId; bool useVipPrice; + bool useBenefit; - PromotionInfoDTOBean({this.couponId, this.promotionId,this.useVipPrice}); + PromotionInfoDTOBean({this.couponId, this.promotionId,this.useVipPrice,this.useBenefit}); static PromotionInfoDTOBean fromJson(Map json) { if (json == null) return null; @@ -128,12 +129,14 @@ class PromotionInfoDTOBean { promotionInfoDTOBean.couponId = json['couponId']; promotionInfoDTOBean.promotionId = json['promotionId']; promotionInfoDTOBean.useVipPrice = json['useVipPrice']; + promotionInfoDTOBean.useBenefit = json['useBenefit']; return promotionInfoDTOBean; } Map toJson() => { "couponId": couponId, "promotionId": promotionId, - "useVipPrice":useVipPrice + "useVipPrice":useVipPrice, + "useBenefit":useBenefit }; } diff --git a/lib/settlement/settlement.dart b/lib/settlement/settlement.dart index 023e78aa..f22fe24b 100644 --- a/lib/settlement/settlement.dart +++ b/lib/settlement/settlement.dart @@ -83,8 +83,11 @@ class _Settlement extends State { bool orderButton = false; bool useVipPriceSelect = true; bool showVipTips = false; + bool useBenefitSelect = true; bool isRaiseChannel = false; ShoppingCart shopCarGoods; + String vipName; + @override void initState() { @@ -136,6 +139,7 @@ class _Settlement extends State { actProductId ?? "", actProductSkuId ?? "", useVipPriceSelect, + useBenefitSelect, count1, payChannel, tableId); @@ -150,6 +154,7 @@ class _Settlement extends State { actProductId ?? "", actProductSkuId ?? "", useVipPriceSelect, + useBenefitSelect, count1, payChannel, tableId); @@ -164,6 +169,7 @@ class _Settlement extends State { actProductId ?? "", actProductSkuId ?? "", useVipPriceSelect, + useBenefitSelect, count1, payChannel, tableId); @@ -186,6 +192,7 @@ class _Settlement extends State { actProductId, actProductSkuId, useVipPriceSelect, + useBenefitSelect, buyNum, payChannel, tableId) async { @@ -202,6 +209,7 @@ class _Settlement extends State { "actProductId": actProductId, "actProductSkuId": actProductSkuId, "useVipPrice":useVipPriceSelect, + "useBenefit": useBenefitSelect, "buyNum": buyNum, "payChannel":payChannel, "tableId": tableId @@ -246,6 +254,7 @@ class _Settlement extends State { actProductId ?? "", actProductSkuId ?? "", useVipPriceSelect, + useBenefitSelect, count1, settleOrderInfo.isRaise ? 7 :payChannel, tableId); @@ -270,6 +279,7 @@ class _Settlement extends State { value.setString('minMember', jsonEncode(baseData.data)), }, ); + //获取json里面的某个字段赋值 } } @@ -329,6 +339,7 @@ class _Settlement extends State { actProductId ?? "", actProductSkuId ?? "", useVipPriceSelect, + useBenefitSelect, count1, payChannel, tableId); @@ -381,6 +392,7 @@ class _Settlement extends State { actProductId ?? "", actProductSkuId ?? "", useVipPriceSelect, + useBenefitSelect, count1, payChannel, tableId); @@ -409,6 +421,7 @@ class _Settlement extends State { actProductId ?? "", actProductSkuId ?? "", useVipPriceSelect, + useBenefitSelect, count1, payChannel, tableId); @@ -509,7 +522,8 @@ class _Settlement extends State { placeOrderFirst.promotionInfoDTO.couponId = (couponListBean != null && tableId <= 0) ? couponListBean.id : ""; // : widget.arguments["cid"] ?? ""; - placeOrderFirst.promotionInfoDTO.useVipPrice = useVipPriceSelect; + placeOrderFirst.promotionInfoDTO.useVipPrice = settleOrderInfo.isRaise ? false : useVipPriceSelect; + placeOrderFirst.promotionInfoDTO.useBenefit = (settleOrderInfo.benefitDiscountAmount == "0") ? false : useBenefitSelect; placeOrderFirst.recMobile = (mobile == null || mobile == "") ? mobile : storeInfo.headMobile; placeOrderFirst.shoppingCartSkuItemList = settleOrderInfo.orderProductList; @@ -774,6 +788,7 @@ class _Settlement extends State { actProductId ?? "", actProductSkuId ?? "", useVipPriceSelect, + useBenefitSelect, count1, payChannel, tableId ?? 0); @@ -798,8 +813,9 @@ class _Settlement extends State { minOrderInfo, tableId, pageType, - (coupons != "" || promotions!="") ? false :useVipPriceSelect, - this.showVipTips + (coupons != "" || promotions!="") ? false : useVipPriceSelect, + this.showVipTips, + (coupons != "" || promotions!="") ? false : useBenefitSelect, ), ///优惠券/备注/会员优惠金额 @@ -829,12 +845,14 @@ class _Settlement extends State { setState(() { this.showVipTips = true; }); - } + }, + vipBenefitSelect, + payChannel, ), if (settleOrderInfo != null && placeOrder && joinA != JoinActivity.BargainBug) ///支付方式 - PayMethod(payChannelCheck,coupons,promotions,useVipPriceSelect,settleOrderInfo), + PayMethod(payChannelCheck,coupons,promotions,useVipPriceSelect,settleOrderInfo,useBenefitSelect), ], ), ), @@ -902,13 +920,23 @@ class _Settlement extends State { // return; // } else // orderButton = true; - pageType != null - ? bargainOrderId != null - ? activityPay() - : joinA == JoinActivity.GoJoin - ? queryJoinAct() - : queryLaunchAct() - : queryPlaceOrderFirst(); + + // if(payChannel == 7 || payChannel == 5 && (couponListBean?.id != null || promotion?.id != null || productId!=null || useVipPriceSelect == true ||useBenefitSelect == true)){ + // SmartDialog.show( + // widget: SettlementTips( + // () { + // }, + // text:"该支付方式不参与任何活动优惠,请重新选择支付方式", + // )); + // }else{ + pageType != null + ? bargainOrderId != null + ? activityPay() + : joinA == JoinActivity.GoJoin + ? queryJoinAct() + : queryLaunchAct() + : queryPlaceOrderFirst(); + // } }, ), SizedBox( @@ -940,7 +968,8 @@ class _Settlement extends State { productSkuId ?? "", actProductId ?? "", actProductSkuId ?? "", - useVipPriceSelect, + (payChannel == 5 || payChannel == 7) ? false : useVipPriceSelect, + (payChannel == 5 || payChannel == 7)? false : useBenefitSelect, count1, payChannel, tableId);} @@ -962,6 +991,28 @@ class _Settlement extends State { actProductId ?? "", actProductSkuId ?? "", useVipPriceSelect, + useBenefitSelect, + count1, + payChannel, + tableId);} + } + + vipBenefitSelect(bool useBenefitSelect) { + this.useBenefitSelect = useBenefitSelect; + if (tableId > 0) { + queryOrderDetails(parentId); + } else { + queryOrderInfo( + address?.id, + selectedBtn, + null, + 0, + productId ?? null, + productSkuId ?? "", + actProductId ?? "", + actProductSkuId ?? "", + useVipPriceSelect, + useBenefitSelect, count1, payChannel, tableId);} @@ -1019,6 +1070,7 @@ class _Settlement extends State { actProductId ?? "", actProductSkuId ?? "", useVipPriceSelect, + useBenefitSelect, count1, payChannel, tableId); @@ -1052,6 +1104,7 @@ class _Settlement extends State { actProductId ?? "", actProductSkuId ?? "", useVipPriceSelect, + useBenefitSelect, count1, payChannel, tableId); diff --git a/lib/settlement/settlement_view/activity_coupon_remarks.dart b/lib/settlement/settlement_view/activity_coupon_remarks.dart index 4335d428..2522ec71 100644 --- a/lib/settlement/settlement_view/activity_coupon_remarks.dart +++ b/lib/settlement/settlement_view/activity_coupon_remarks.dart @@ -24,6 +24,8 @@ class ActivityCouponRemarks extends StatefulWidget { final int tableId; final Function(bool useVipPriceSelect) vipPriceSelect; final Function showVipTips; + final Function(bool useBenefitSelect) vipBenefitSelect; + final int payChannell; ActivityCouponRemarks( this.couponCart, @@ -38,7 +40,9 @@ class ActivityCouponRemarks extends StatefulWidget { this.editRemark, this.tableId, this.vipPriceSelect, - this.showVipTips); + this.showVipTips, + this.vipBenefitSelect, + this.payChannell); @override State createState() { @@ -48,6 +52,7 @@ class ActivityCouponRemarks extends StatefulWidget { class _ActivityCouponRemarks extends State { bool vipSelect = true; + bool vipBenefit = true; @override Widget build(BuildContext context) { @@ -76,70 +81,88 @@ class _ActivityCouponRemarks extends State { mainAxisAlignment: MainAxisAlignment.spaceEvenly, crossAxisAlignment: CrossAxisAlignment.center, children: [ - if( !(widget?.settleOrderInfo?.isRaise ?? false) && (widget?.settleOrderInfo?.memberVO?.isVip ?? false) && widget.placeOrder) - Row( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Expanded( - flex: 1, - child: Text( - "VIP权益", - style: TextStyle( - fontWeight: MyFontWeight.regular, - fontSize: 14.sp, - color: Color(0xFF353535), - ), - ), - ), - Platform.isAndroid ? - Switch.adaptive( - value: (widget.coupons != null && widget.coupons != ""||widget.promotions != null && widget.promotions != "") ? false:vipSelect, - materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, - activeColor: Color(0xff32A060), - onChanged: (bool value) { - setState(() { - if((widget?.settleOrderInfo?.memberVO?.isVip ?? false)){ - vipSelect = !vipSelect; - widget.vipPriceSelect(vipSelect); - }else{ - widget.showVipTips(); - return; - } - }); - }, - ): - GestureDetector( - onTap: () { - setState(() { - if ((widget?.settleOrderInfo?.memberVO?.isVip ?? false)) { - vipSelect = !vipSelect; - widget.vipPriceSelect(vipSelect); - } else { - widget.showVipTips(); - return; - } - }); - }, - child: Container( - padding: EdgeInsets.only(bottom: 18.w), - alignment: Alignment.center, - child: Image.asset( - ((widget.coupons != null && widget.coupons != ""||widget.promotions != null && widget.promotions != "") ? false:vipSelect) - ? "assets/image/vip_price.webp" - : "assets/image/vip_unprice.webp", - width: 38.w, - height: 20.h, + if (!(widget?.settleOrderInfo?.isRaise ?? false) && + (widget?.settleOrderInfo?.memberVO?.isVip ?? false) && + widget.placeOrder) + Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Expanded( + flex: 1, + child: Text( + "VIP权益", + style: TextStyle( + fontWeight: MyFontWeight.regular, + fontSize: 14.sp, + color: Color(0xFF353535), + ), ), ), - ) - ], - ), + Platform.isAndroid + ? Switch.adaptive( + value: + (widget.coupons != null && widget.coupons != "" || + widget.promotions != null && + widget.promotions != "" || + widget.payChannell == 5 || + widget.payChannell == 7 ||(widget.payChannell == 4 && widget.settleOrderInfo.promotionInfoList.length <=0 && widget.settleOrderInfo.couponList.length <= 0)) + ? false + : vipSelect, + materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, + activeColor: Color(0xff32A060), + onChanged: (bool value) { + setState(() { + if ((widget?.settleOrderInfo?.memberVO?.isVip ?? + false)) { + vipSelect = !vipSelect; + widget.vipPriceSelect(vipSelect); + } else { + widget.showVipTips(); + return; + } + }); + }, + ) + : GestureDetector( + onTap: () { + setState(() { + if ((widget?.settleOrderInfo?.memberVO?.isVip ?? + false)) { + vipSelect = !vipSelect; + widget.vipPriceSelect(vipSelect); + } else { + widget.showVipTips(); + return; + } + }); + }, + child: Container( + padding: EdgeInsets.only(bottom: 18.w), + alignment: Alignment.center, + child: Image.asset( + ((widget.coupons != null && widget.coupons != "" || + widget.promotions != null && + widget.promotions != "" || + widget.payChannell == 5 || + widget.payChannell == 7 || (widget.payChannell == 4 && widget.settleOrderInfo.promotionInfoList.length <=0 && widget.settleOrderInfo.couponList.length <= 0)) + ? false + : vipSelect) + ? "assets/image/vip_price.webp" + : "assets/image/vip_unprice.webp", + width: 38.w, + height: 20.h, + ), + ), + ) + ], + ), if (widget.placeOrder && - widget?.settleOrderInfo?.benefitDiscountAmount != null && - widget?.settleOrderInfo?.benefitDiscountAmount != "0") + widget.settleOrderInfo.memberVO.memberRankVo.rankName == "黄金会员") Container( - margin: EdgeInsets.only(bottom: 13), + margin: EdgeInsets.only( + bottom: 13, + ), child: Row( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, @@ -155,19 +178,66 @@ class _ActivityCouponRemarks extends State { ), ), ), - Text( - widget.settleOrderInfo.benefitDiscountAmount, - textAlign: TextAlign.end, - style: TextStyle( - fontSize: 14.sp, - color: Color(0xFF32A060), - fontWeight: MyFontWeight.semi_bold, - ), - ), + // Text( + // "¥${widget.settleOrderInfo.benefitDiscountAmount}", + // textAlign: TextAlign.end, + // style: TextStyle( + // fontSize: 14.sp, + // color: Color(0xFF32A060), + // fontFamily: 'JDZhengHT', + // fontWeight: MyFontWeight.regular, + // ), + // ), + Platform.isAndroid + ? Switch.adaptive( + value: + (widget.coupons != null && widget.coupons != "" || + widget.promotions != null && + widget.promotions != "" || + widget.payChannell == 5 || + widget.payChannell == 7 || (widget.payChannell == 4 && widget.settleOrderInfo.promotionInfoList.length <=0 && widget.settleOrderInfo.couponList.length <= 0)) + ? false + : vipBenefit, + materialTapTargetSize: + MaterialTapTargetSize.shrinkWrap, + activeColor: Color(0xff32A060), + onChanged: (bool value) { + setState(() { + vipBenefit = !vipBenefit; + widget.vipBenefitSelect(vipBenefit); + }); + }, + ) + : GestureDetector( + onTap: () { + setState(() { + vipBenefit = !vipBenefit; + widget.vipBenefitSelect(vipBenefit); + }); + }, + child: Container( + padding: EdgeInsets.only(bottom: 18.w), + alignment: Alignment.center, + child: Image.asset( + (((widget.coupons != null && widget.coupons != "") || + (widget.promotions != null && widget.promotions != "" )|| + widget.payChannell == 5 || widget.payChannell == 7|| + (widget.payChannell == 4 && widget.settleOrderInfo.promotionInfoList.length <=0 && widget.settleOrderInfo.couponList.length <= 0)) + ? false + : vipSelect) + ? "assets/image/vip_price.webp" + : "assets/image/vip_unprice.webp", + width: 38.w, + height: 20.h, + ), + ), + ) ], ), ), - if (widget.placeOrder && widget.tableId <= 0 && !(widget?.settleOrderInfo?.isRaise ?? false)) + if (widget.placeOrder && + widget.tableId <= 0 && + !(widget?.settleOrderInfo?.isRaise ?? false)) InkWell( onTap: () { widget.activityCart(); diff --git a/lib/settlement/settlement_view/coupon.dart b/lib/settlement/settlement_view/coupon.dart index ddbdba9c..100b72ec 100644 --- a/lib/settlement/settlement_view/coupon.dart +++ b/lib/settlement/settlement_view/coupon.dart @@ -24,9 +24,9 @@ class CouponWidget extends StatefulWidget { } } - - class _CouponWidget extends State { + bool selectIndex = false; + @override Widget build(BuildContext context) { return Container( @@ -101,9 +101,13 @@ class _CouponWidget extends State { // ), // flex: 1, // ), - SizedBox(width:8,), + SizedBox( + width: 8, + ), couponListWidget(context), - SizedBox(width:5,), + SizedBox( + width: 5, + ), Expanded( flex: 2, child: Column( @@ -172,7 +176,13 @@ class _CouponWidget extends State { margin: EdgeInsets.only(right: 23.w), child: GestureDetector( onTap: () { - Navigator.of(context).pop(widget.couponList); + if(widget.selected == true){ + Navigator.of(context) + .pop(); + }else{ + Navigator.of(context) + .pop(widget.couponList); + } }, child: Image.asset( widget.selected @@ -233,7 +243,7 @@ class _CouponWidget extends State { onTap: () { setState(() { widget.couponList.isEx = - !(widget.couponList.isEx ?? false); + !(widget.couponList.isEx ?? false); }); }, ), @@ -262,18 +272,21 @@ class _CouponWidget extends State { ), ], ), - if ((widget.couponList?.isEx ?? false) && (widget.couponList.usableReason != null)) + if ((widget.couponList?.isEx ?? false) && + (widget.couponList.usableReason != null)) Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Expanded(child: Text( + Expanded( + child: Text( "不可用原因:", style: TextStyle( color: Color(0xFF353535), fontSize: 10.sp, ), )), - Expanded(child: Align( + Expanded( + child: Align( alignment: Alignment.centerRight, child: Text( widget.couponList.usableReason ?? "", @@ -283,8 +296,7 @@ class _CouponWidget extends State { fontSize: 10.sp, ), ), - )) - , + )), ], ), ], @@ -312,7 +324,7 @@ class _CouponWidget extends State { style: TextStyle( fontSize: 12.sp, fontWeight: MyFontWeight.medium, - color: Color(0xff32A060), + color: Color(0xff32A060), ), ), SizedBox( @@ -325,20 +337,19 @@ class _CouponWidget extends State { style: TextStyle( fontSize: 30.sp, fontWeight: MyFontWeight.semi_bold, - color: Color(0xff32A060), + color: Color(0xff32A060), ), ), ], ), Text( S.of(context).manyuankeyong(widget.couponList != null - ? ("${widget.couponList.fullAmount}" ?? "0") - .toString() + ? ("${widget.couponList.fullAmount}" ?? "0").toString() : ""), style: TextStyle( fontSize: 12.sp, fontWeight: MyFontWeight.semi_bold, - color: Color(0xff32A060), + color: Color(0xff32A060), ), ), ], @@ -349,13 +360,13 @@ class _CouponWidget extends State { crossAxisAlignment: CrossAxisAlignment.center, children: [ Container( - padding: EdgeInsets.only(bottom:10,top: 7,left: 12), + padding: EdgeInsets.only(bottom: 10, top: 7, left: 12), child: Text( S.of(context).duihuanquan, style: TextStyle( fontSize: 26.sp, fontWeight: MyFontWeight.semi_bold, - color: Color(0xff32A060), + color: Color(0xff32A060), ), ), ), @@ -364,7 +375,7 @@ class _CouponWidget extends State { style: TextStyle( fontSize: 12.sp, fontWeight: MyFontWeight.semi_bold, - color: Color(0xff32A060), + color: Color(0xff32A060), ), ), ], @@ -375,7 +386,7 @@ class _CouponWidget extends State { crossAxisAlignment: CrossAxisAlignment.center, children: [ Container( - padding: EdgeInsets.only(bottom:10,top: 7,left: 12), + padding: EdgeInsets.only(bottom: 10, top: 7, left: 12), child: Text( S.of(context).duihuanquan, style: TextStyle( @@ -410,27 +421,29 @@ class _CouponWidget extends State { style: TextStyle( fontSize: 12.sp, fontWeight: MyFontWeight.medium, - color: widget.couponList.status == 3 ? Color(0xFFB3B3B3):Color(0xff32A060), + color: widget.couponList.status == 3 + ? Color(0xFFB3B3B3) + : Color(0xff32A060), ), ), SizedBox( height: 4.h, ), Text( - widget.couponList != null + widget.couponList != null ? "${AppUtils.calculateDouble(double.tryParse(widget.couponList.limitAmount) ?? 0)}" : "", style: TextStyle( fontSize: 28.sp, fontWeight: MyFontWeight.semi_bold, - color: Color(0xff32A060), + color: Color(0xff32A060), ), ), ], ), ], ); - }else{ + } else { return Column( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, @@ -441,14 +454,14 @@ class _CouponWidget extends State { textBaseline: TextBaseline.alphabetic, children: [ Text( - widget.couponList != null + widget.couponList != null ? "${(widget.couponList.discountPercent / 10.0 >= 10) ? 10 : widget.couponList.discountPercent / 10.0}" ?? - "0" + "0" : "", style: TextStyle( fontSize: 30.sp, fontWeight: MyFontWeight.semi_bold, - color: Color(0xff32A060), + color: Color(0xff32A060), ), ), SizedBox( diff --git a/lib/settlement/settlement_view/pay_method.dart b/lib/settlement/settlement_view/pay_method.dart index d947eef9..6cc1b527 100644 --- a/lib/settlement/settlement_view/pay_method.dart +++ b/lib/settlement/settlement_view/pay_method.dart @@ -16,8 +16,9 @@ class PayMethod extends StatefulWidget { final String promotions; final bool useVipPriceSelect; final SettleOrderInfo settleOrderInfo; + final bool useBenefitSelect; - PayMethod(this.payChannelCheck,this.coupons,this.promotions,this.useVipPriceSelect,this.settleOrderInfo); + PayMethod(this.payChannelCheck,this.coupons,this.promotions,this.useVipPriceSelect,this.settleOrderInfo,this.useBenefitSelect); @override State createState() { @@ -184,7 +185,7 @@ class _PayMethod extends State { onTap: () { setState(() { checkIndex = 3; - if(widget.promotions != "" || widget.coupons != "" || widget.useVipPriceSelect){ + if(widget.promotions != "" || widget.coupons != "" || widget.useVipPriceSelect || widget.useBenefitSelect){ SmartDialog.show( widget: SettlementTips( () { @@ -238,7 +239,7 @@ class _PayMethod extends State { onTap: () { setState(() { checkIndex = 4; - if(widget.promotions != "" || widget.coupons != "" || widget.useVipPriceSelect){ + if(widget.promotions != "" || widget.coupons != "" || widget.useVipPriceSelect || widget.useBenefitSelect){ SmartDialog.show( widget: SettlementTips( () { diff --git a/lib/settlement/settlement_view/settlement_order_commodity.dart b/lib/settlement/settlement_view/settlement_order_commodity.dart index bd554982..8bad59bd 100644 --- a/lib/settlement/settlement_view/settlement_order_commodity.dart +++ b/lib/settlement/settlement_view/settlement_order_commodity.dart @@ -19,6 +19,7 @@ class SettlementOrderCommodity extends StatefulWidget { final String pageType; final bool useVipPriceSelect; final bool showVipTips; + final bool useBenefitSelect; SettlementOrderCommodity( this.isTakeOut, @@ -27,7 +28,8 @@ class SettlementOrderCommodity extends StatefulWidget { this.tableId, this.pageType, this.useVipPriceSelect, - this.showVipTips); + this.showVipTips, + this.useBenefitSelect,); @override State createState() { @@ -118,6 +120,12 @@ class _SettlementOrderCommodity extends State { widget?.settleOrderInfo?.discountAmount ?? "")); } + if (widget.useBenefitSelect && + (widget?.settleOrderInfo?.benefitDiscountAmount != "0")) { + widgets.add(vipItem(Color(0xFFFF7A1A), "VIP优惠金额", + widget?.settleOrderInfo?.benefitDiscountAmount ?? "")); + } + if (widget.showVipTips) { widgets.add(GestureDetector( child: Container( @@ -503,7 +511,7 @@ class _SettlementOrderCommodity extends State { } else if (widget.tableId < 0) { return "0"; } else { - return widget?.settleOrderInfo?.discountAmount ?? "0"; + return AppUtils.calculateDouble(double.tryParse(widget?.settleOrderInfo?.discountAmount ?? "0") + double.tryParse(widget?.settleOrderInfo?.benefitDiscountAmount ?? "0")); } } diff --git a/lib/store/store_order.dart b/lib/store/store_order.dart index 9ff7adf3..11a20298 100644 --- a/lib/store/store_order.dart +++ b/lib/store/store_order.dart @@ -677,8 +677,8 @@ class _StoreOrderPage extends State ), ), autoplay: true, - duration: 1500, - autoplayDelay: 2500, + duration: 1000, + autoplayDelay: 2000, itemBuilder: (context, position) { return Container( child: MImage(