diff --git a/lib/login/new_login_page.dart b/lib/login/new_login_page.dart index fe1e3957..163a8296 100644 --- a/lib/login/new_login_page.dart +++ b/lib/login/new_login_page.dart @@ -284,6 +284,7 @@ class _NewLoginPage extends State { @override Widget build(BuildContext context) { return Scaffold( + resizeToAvoidBottomInset:false, body: GestureDetector( behavior: HitTestBehavior.translucent, onTap: () { diff --git a/lib/retrofit/data/min_order_info.dart b/lib/retrofit/data/min_order_info.dart index 04bd3f90..384bc124 100644 --- a/lib/retrofit/data/min_order_info.dart +++ b/lib/retrofit/data/min_order_info.dart @@ -60,7 +60,8 @@ class MinOrderInfo { String finalPayPrice, String activityNoPrice, String activityDiscountPrice, - String totalDiscountPrice, + String totalDiscountPrice, + String benefitDiscountAmount, int orderSource, dynamic address, dynamic discountPercent, @@ -84,7 +85,8 @@ class MinOrderInfo { bool onCredit, OrderInfoVo orderInfoVo, String endPayTime, - String orderSumPrice,}){ + String orderSumPrice, + bool isRaise,}){ this.id = id; this.createTime = createTime; this.createUser = createUser; @@ -143,6 +145,7 @@ class MinOrderInfo { this.activityNoPrice = activityNoPrice; this.activityDiscountPrice = activityDiscountPrice; this.totalDiscountPrice = totalDiscountPrice; + this.benefitDiscountAmount = benefitDiscountAmount; this.orderSource = orderSource; this.address = address; this.discountPercent = discountPercent; @@ -167,6 +170,7 @@ class MinOrderInfo { this.orderInfoVo = orderInfoVo; this.endPayTime = endPayTime; this.orderSumPrice = orderSumPrice; + this.isRaise = isRaise; } MinOrderInfo.fromJson(dynamic json) { @@ -228,6 +232,7 @@ class MinOrderInfo { this.activityNoPrice = json['activityNoPrice']; this.activityDiscountPrice = json['activityDiscountPrice']; this.totalDiscountPrice = json['totalDiscountPrice']; + this.benefitDiscountAmount = json['benefitDiscountAmount']; this.orderSource = json['orderSource']; this.address = json['address']; this.discountPercent = json['discountPercent']; @@ -257,6 +262,7 @@ class MinOrderInfo { this.orderInfoVo = json['orderInfoVo'] != null ? OrderInfoVo.fromJson(json['orderInfoVo']) : null; this.endPayTime = json['endPayTime']; this.orderSumPrice = json['orderSumPrice']; + this.isRaise = json['isRaise']; } String id; String createTime; @@ -316,6 +322,7 @@ class MinOrderInfo { String activityNoPrice; String activityDiscountPrice; String totalDiscountPrice; + String benefitDiscountAmount; int orderSource; dynamic address; dynamic discountPercent; @@ -340,6 +347,7 @@ class MinOrderInfo { OrderInfoVo orderInfoVo; String endPayTime; String orderSumPrice; + bool isRaise; Map toJson() { final map = {}; @@ -401,6 +409,7 @@ class MinOrderInfo { map['activityNoPrice'] = this.activityNoPrice; map['activityDiscountPrice'] = this.activityDiscountPrice; map['totalDiscountPrice'] = this.totalDiscountPrice; + map['benefitDiscountAmount'] = this.benefitDiscountAmount; map['orderSource'] = this.orderSource; map['address'] = this.address; map['discountPercent'] = this.discountPercent; @@ -429,6 +438,7 @@ class MinOrderInfo { } map['endPayTime'] = this.endPayTime; map['orderSumPrice'] = this.orderSumPrice; + map['isRaise'] = this.isRaise; return map; } diff --git a/lib/settlement/settlement.dart b/lib/settlement/settlement.dart index f22fe24b..354d86a5 100644 --- a/lib/settlement/settlement.dart +++ b/lib/settlement/settlement.dart @@ -86,8 +86,8 @@ class _Settlement extends State { bool useBenefitSelect = true; bool isRaiseChannel = false; ShoppingCart shopCarGoods; - String vipName; - + String vipLevelName; + bool isVips = false; @override void initState() { @@ -111,6 +111,8 @@ class _Settlement extends State { count1 = widget.arguments["buyNum"]; productId = widget.arguments["productId"]; shopCarGoods = widget.arguments["shoppingCart"]; + vipLevelName = widget.arguments["vipLevelName"]; + isVips = widget.arguments["isVips"]; if (tableId == 0) { placeOrder = true; @@ -168,8 +170,8 @@ class _Settlement extends State { productSkuId ?? "", actProductId ?? "", actProductSkuId ?? "", - useVipPriceSelect, - useBenefitSelect, + useVipPriceSelect, + (useVipPriceSelect == true && isVips) ? false:useBenefitSelect, count1, payChannel, tableId); @@ -242,7 +244,7 @@ class _Settlement extends State { queryOrderDetails( pageType != null ? widget.arguments["orderId"] : parentId); } - if(!isRaiseChannel && settleOrderInfo.isRaise){ + if(!isRaiseChannel && ((tableId > 0 ? (minOrderInfo?.isRaise ??false): settleOrderInfo.isRaise))){ isRaiseChannel = true; queryOrderInfo( address?.id, @@ -256,7 +258,7 @@ class _Settlement extends State { useVipPriceSelect, useBenefitSelect, count1, - settleOrderInfo.isRaise ? 7 :payChannel, + (tableId > 0 ? minOrderInfo.isRaise : settleOrderInfo.isRaise) ? 7 :payChannel, tableId); } } else { @@ -279,12 +281,12 @@ class _Settlement extends State { value.setString('minMember', jsonEncode(baseData.data)), }, ); - //获取json里面的某个字段赋值 } } ///查看订单详情 queryOrderDetails(id) async { + EasyLoading.show(status: S.current.zhengzaijiazai); BaseData baseData = await minService.getOrderDetails({ "id": pageType != null ? widget.arguments["orderId"] : id ?? parentId, }).catchError((error) {}); @@ -293,8 +295,10 @@ class _Settlement extends State { minOrderInfo = baseData.data; coupons = minOrderInfo?.couponName ?? ""; }); + EasyLoading.dismiss(); } else { SmartDialog.showToast(baseData.msg ?? "", alignment: Alignment.center); + EasyLoading.dismiss(); } } @@ -514,7 +518,7 @@ class _Settlement extends State { placeOrderFirst.orderTypeId = 0; placeOrderFirst.parentCode = parentCode; // 火锅加菜 placeOrderFirst.parentId = parentId; // 火锅加菜 - placeOrderFirst.payChannel = ((placeOrderFirst.cartSum == "0.00") ? payChannel = 0 : (settleOrderInfo.isRaise ? 7:payChannel)); + placeOrderFirst.payChannel = ((placeOrderFirst.cartSum == "0.00") ? payChannel = 0 : (((tableId > 0 ? (minOrderInfo?.isRaise ?? false) : (settleOrderInfo?.isRaise ?? false))) ? 7:payChannel)); placeOrderFirst.promotionInfoDTO = PromotionInfoDTOBean(); placeOrderFirst.promotionInfoDTO.promotionId = (promotion != null && tableId <= 0) ? promotion.id : ""; @@ -522,8 +526,8 @@ class _Settlement extends State { placeOrderFirst.promotionInfoDTO.couponId = (couponListBean != null && tableId <= 0) ? couponListBean.id : ""; // : widget.arguments["cid"] ?? ""; - placeOrderFirst.promotionInfoDTO.useVipPrice = settleOrderInfo.isRaise ? false : useVipPriceSelect; - placeOrderFirst.promotionInfoDTO.useBenefit = (settleOrderInfo.benefitDiscountAmount == "0") ? false : useBenefitSelect; + placeOrderFirst.promotionInfoDTO.useVipPrice = (settleOrderInfo.isRaise || payChannel == 5 || ((payChannel == 4 && (settleOrderInfo.usePlateMoney == false))) ) ? false : useVipPriceSelect; + placeOrderFirst.promotionInfoDTO.useBenefit = (settleOrderInfo.isRaise || payChannel == 5 || ((payChannel == 4 && settleOrderInfo.usePlateMoney == false))) ? false : useBenefitSelect; placeOrderFirst.recMobile = (mobile == null || mobile == "") ? mobile : storeInfo.headMobile; placeOrderFirst.shoppingCartSkuItemList = settleOrderInfo.orderProductList; @@ -576,7 +580,7 @@ class _Settlement extends State { }); } } - // orderButton = false; + orderButton = false; if (baseData != null && baseData.isSuccess) { placeOrder = true; this.downOrder = DownOrder.fromJson(baseData.data); @@ -584,7 +588,7 @@ class _Settlement extends State { queryOrderDetails(parentId); setState(() {}); } else { - // orderButton = false; + orderButton = false; SmartDialog.showToast(baseData?.msg, alignment: Alignment.center); } } @@ -592,10 +596,10 @@ class _Settlement extends State { ///结算 querySettlement() async { - placeOrderFirst.id = parentId != "" ? parentId : downOrder.id; - placeOrderFirst.orderProductVOList = (downOrder == null) + placeOrderFirst.id = ((parentId != "") ? parentId : downOrder.id); + placeOrderFirst.orderProductVOList = ((downOrder == null) ? minOrderInfo.orderProductVOList - : downOrder.orderProductVOList; + : downOrder.orderProductVOList); if (placeOrderFirst.payChannel == 1) { if (Platform.isAndroid) { @@ -816,6 +820,7 @@ class _Settlement extends State { (coupons != "" || promotions!="") ? false : useVipPriceSelect, this.showVipTips, (coupons != "" || promotions!="") ? false : useBenefitSelect, + placeOrder ), ///优惠券/备注/会员优惠金额 @@ -848,11 +853,12 @@ class _Settlement extends State { }, vipBenefitSelect, payChannel, + vipLevelName, ), if (settleOrderInfo != null && placeOrder && joinA != JoinActivity.BargainBug) ///支付方式 - PayMethod(payChannelCheck,coupons,promotions,useVipPriceSelect,settleOrderInfo,useBenefitSelect), + PayMethod(payChannelCheck,coupons,promotions,useVipPriceSelect,settleOrderInfo,useBenefitSelect,tableId,minOrderInfo), ], ), ), @@ -914,21 +920,6 @@ class _Settlement extends State { vertical: 5.h, ), callback: () { - // if (orderButton) { - // SmartDialog.showToast("订单正在提交中...", - // alignment: Alignment.center); - // return; - // } else - // orderButton = true; - - // 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() @@ -962,14 +953,14 @@ class _Settlement extends State { queryOrderInfo( address?.id, selectedBtn, - couponListBean?.id, + (settleOrderInfo.isRaise || payChannel == 5 || ((payChannel == 4 && settleOrderInfo.usePlateMoney == false))) ? "" :couponListBean?.id, 0, - promotion?.id ?? productId, + (settleOrderInfo.isRaise || payChannel == 5 || ((payChannel == 4 && settleOrderInfo.usePlateMoney == false))) ? "" :promotion?.id ?? productId, productSkuId ?? "", actProductId ?? "", actProductSkuId ?? "", - (payChannel == 5 || payChannel == 7) ? false : useVipPriceSelect, - (payChannel == 5 || payChannel == 7)? false : useBenefitSelect, + (settleOrderInfo.isRaise || payChannel == 5 || ((payChannel == 4 && settleOrderInfo.usePlateMoney == false))) ? false :useVipPriceSelect, + (settleOrderInfo.isRaise || payChannel == 5 || ((payChannel == 4 && settleOrderInfo.usePlateMoney == false)) || useVipPriceSelect == true) ? false :useBenefitSelect, count1, payChannel, tableId);} @@ -991,7 +982,7 @@ class _Settlement extends State { actProductId ?? "", actProductSkuId ?? "", useVipPriceSelect, - useBenefitSelect, + useVipPriceSelect == true ? false :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 2522ec71..1a2c3922 100644 --- a/lib/settlement/settlement_view/activity_coupon_remarks.dart +++ b/lib/settlement/settlement_view/activity_coupon_remarks.dart @@ -9,6 +9,8 @@ import 'package:huixiang/retrofit/data/settleOrderInfo.dart'; import 'package:huixiang/utils/font_weight.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import '../../view_widget/settlement_tips_dialog.dart'; + class ActivityCouponRemarks extends StatefulWidget { final Function() couponCart; final Function() activityCart; @@ -26,6 +28,7 @@ class ActivityCouponRemarks extends StatefulWidget { final Function showVipTips; final Function(bool useBenefitSelect) vipBenefitSelect; final int payChannell; + final String vipLevelName; ActivityCouponRemarks( this.couponCart, @@ -42,7 +45,8 @@ class ActivityCouponRemarks extends StatefulWidget { this.vipPriceSelect, this.showVipTips, this.vipBenefitSelect, - this.payChannell); + this.payChannell, + this.vipLevelName); @override State createState() { @@ -105,14 +109,23 @@ class _ActivityCouponRemarks extends State { (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)) + widget.payChannell == 5 || widget.payChannell == 7|| + (widget.payChannell == 4 && widget.settleOrderInfo.usePlateMoney == false)) ? false : vipSelect, materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, activeColor: Color(0xff32A060), onChanged: (bool value) { setState(() { + if(widget.settleOrderInfo.usePlateMoney == false || widget.payChannell == 5){ + SmartDialog.show( + widget: SettlementTips( + () { + }, + text: widget.payChannell == 5 ? "该支付余额为特殊活动充值, 不可参与任何活动" :"该用户平台余额为特殊活动充值, 不可参与任何活动", + )); + return; + } if ((widget?.settleOrderInfo?.memberVO?.isVip ?? false)) { vipSelect = !vipSelect; @@ -157,89 +170,106 @@ class _ActivityCouponRemarks extends State { ) ], ), - if (widget.placeOrder && - widget.settleOrderInfo.memberVO.memberRankVo.rankName == "黄金会员") - Container( - margin: EdgeInsets.only( - bottom: 13, - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Expanded( - flex: 1, - child: Text( - "会员优惠金额", - style: TextStyle( - fontWeight: MyFontWeight.regular, - fontSize: 14.sp, - color: Color(0xFF353535), - ), - ), - ), - // 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?.settleOrderInfo?.isRaise ?? false)) + // Container( + // margin: EdgeInsets.only( + // bottom: 13, + // ), + // child: Row( + // mainAxisAlignment: MainAxisAlignment.center, + // crossAxisAlignment: CrossAxisAlignment.center, + // children: [ + // Expanded( + // flex: 1, + // child: Text( + // "会员优惠金额", + // style: TextStyle( + // fontWeight: MyFontWeight.regular, + // fontSize: 14.sp, + // color: Color(0xFF353535), + // ), + // ), + // ), + // // 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.usePlateMoney == false) ) + // ? false + // : vipBenefit, + // materialTapTargetSize: + // MaterialTapTargetSize.shrinkWrap, + // activeColor: Color(0xff32A060), + // onChanged: (bool value) { + // setState(() { + // if(widget.settleOrderInfo.usePlateMoney == false || widget.payChannell == 5){ + // SmartDialog.show( + // widget: SettlementTips( + // () { + // }, + // text: widget.payChannell == 5 ? "该支付余额为特殊活动充值, 不可参与任何活动" :"该用户平台余额为特殊活动充值, 不可参与任何活动", + // )); + // return; + // } + // 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)) InkWell( onTap: () { + if(widget.payChannell == 5){ + SmartDialog.show( + widget: SettlementTips( + () { + }, + text: "该支付余额为特殊活动充值, 不可参与任何活动", + )); + return; + } widget.activityCart(); }, child: Row( @@ -280,6 +310,15 @@ class _ActivityCouponRemarks extends State { if (widget.placeOrder && !(widget?.settleOrderInfo?.isRaise ?? false)) InkWell( onTap: () { + if(widget.payChannell == 5){ + SmartDialog.show( + widget: SettlementTips( + () { + }, + text: "该支付余额为特殊活动充值, 不可参与任何活动", + )); + return; + } widget.couponCart(); }, child: Row( diff --git a/lib/settlement/settlement_view/pay_method.dart b/lib/settlement/settlement_view/pay_method.dart index 6cc1b527..f30ceadd 100644 --- a/lib/settlement/settlement_view/pay_method.dart +++ b/lib/settlement/settlement_view/pay_method.dart @@ -6,6 +6,7 @@ import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/utils/font_weight.dart'; import 'package:shared_preferences/shared_preferences.dart'; +import '../../retrofit/data/min_order_info.dart'; import '../../retrofit/data/settleOrderInfo.dart'; import '../../view_widget/settlement_tips_dialog.dart'; import '../../view_widget/tips_dialog.dart'; @@ -17,8 +18,10 @@ class PayMethod extends StatefulWidget { final bool useVipPriceSelect; final SettleOrderInfo settleOrderInfo; final bool useBenefitSelect; + final int tableId; + final MinOrderInfo minOrderInfo; - PayMethod(this.payChannelCheck,this.coupons,this.promotions,this.useVipPriceSelect,this.settleOrderInfo,this.useBenefitSelect); + PayMethod(this.payChannelCheck,this.coupons,this.promotions,this.useVipPriceSelect,this.settleOrderInfo,this.useBenefitSelect,this.tableId,this.minOrderInfo); @override State createState() { @@ -35,7 +38,7 @@ class _PayMethod extends State { @override void initState() { super.initState(); - checkIndex = (widget?.settleOrderInfo?.isRaise ?? false) ? 4:5; + checkIndex = ((widget.minOrderInfo != null) ? (widget?.minOrderInfo?.isRaise??false) : (widget?.settleOrderInfo?.isRaise ?? false)) ? 4:5; SharedPreferences.getInstance().then((value) { Map memberInfo = jsonDecode(value.getString("minMember")); @@ -89,7 +92,7 @@ class _PayMethod extends State { ), ), ), - if(!(widget.settleOrderInfo?.isRaise ?? false)) + if(!((widget.minOrderInfo != null) ? (widget?.minOrderInfo?.isRaise??false) : (widget?.settleOrderInfo?.isRaise ?? false))) GestureDetector( behavior: HitTestBehavior.opaque, onTap: () { @@ -130,11 +133,11 @@ class _PayMethod extends State { ], ), ), - if(!(widget.settleOrderInfo?.isRaise ?? false)) + if(!((widget.minOrderInfo != null) ? (widget?.minOrderInfo?.isRaise??false) : (widget?.settleOrderInfo?.isRaise ?? false))) SizedBox( height: 10, ), - if(!(widget.settleOrderInfo?.isRaise ?? false)) + if(!((widget.minOrderInfo != null) ? (widget?.minOrderInfo?.isRaise??false) : (widget?.settleOrderInfo?.isRaise ?? false))) GestureDetector( behavior: HitTestBehavior.opaque, onTap: () { @@ -175,11 +178,11 @@ class _PayMethod extends State { ], ), ), - if(!(widget.settleOrderInfo?.isRaise ?? false)) + if(!((widget.minOrderInfo != null) ? (widget?.minOrderInfo?.isRaise??false) : (widget?.settleOrderInfo?.isRaise ?? false))) SizedBox( height: 10, ), - if(mGreenMoney!="0.00" && !(widget.settleOrderInfo?.isRaise ?? false)) + if(mGreenMoney!="0.00" && !((widget.minOrderInfo != null) ? (widget?.minOrderInfo?.isRaise??false) : (widget?.settleOrderInfo?.isRaise ?? false))) GestureDetector( behavior: HitTestBehavior.opaque, onTap: () { @@ -229,11 +232,11 @@ class _PayMethod extends State { ], ), ), - if(mGreenMoney!="0.00" && !(widget.settleOrderInfo?.isRaise ?? false)) + if(mGreenMoney!="0.00" && !((widget.minOrderInfo != null) ? (widget?.minOrderInfo?.isRaise??false) : (widget?.settleOrderInfo?.isRaise ?? false))) SizedBox( height: 10, ), - if(mRaiseMoney!="0" && (widget.settleOrderInfo?.isRaise ?? false)) + if(mRaiseMoney!="0" && ((widget.minOrderInfo != null) ? (widget?.minOrderInfo?.isRaise??false) : (widget?.settleOrderInfo?.isRaise ?? false))) GestureDetector( behavior: HitTestBehavior.opaque, onTap: () { @@ -283,11 +286,11 @@ class _PayMethod extends State { ], ), ), - if(mRaiseMoney!="0" && (widget.settleOrderInfo?.isRaise ?? false)) + if(mRaiseMoney!="0" && ((widget.minOrderInfo != null) ? (widget?.minOrderInfo?.isRaise??false) : (widget?.settleOrderInfo?.isRaise ?? false))) SizedBox( height: 10, ), - if(!(widget.settleOrderInfo?.isRaise ?? false)) + if(!((widget.minOrderInfo != null) ? (widget?.minOrderInfo?.isRaise??false) : (widget?.settleOrderInfo?.isRaise ?? false))) GestureDetector( behavior: HitTestBehavior.opaque, onTap: () { diff --git a/lib/settlement/settlement_view/settlement_order_commodity.dart b/lib/settlement/settlement_view/settlement_order_commodity.dart index 8bad59bd..473d30fb 100644 --- a/lib/settlement/settlement_view/settlement_order_commodity.dart +++ b/lib/settlement/settlement_view/settlement_order_commodity.dart @@ -20,6 +20,7 @@ class SettlementOrderCommodity extends StatefulWidget { final bool useVipPriceSelect; final bool showVipTips; final bool useBenefitSelect; + final bool placeOrder; SettlementOrderCommodity( this.isTakeOut, @@ -29,7 +30,8 @@ class SettlementOrderCommodity extends StatefulWidget { this.pageType, this.useVipPriceSelect, this.showVipTips, - this.useBenefitSelect,); + this.useBenefitSelect, + this.placeOrder); @override State createState() { @@ -114,16 +116,16 @@ class _SettlementOrderCommodity extends State { if (widget.useVipPriceSelect && widget.settleOrderInfo.memberVO.isVip && - (!widget.settleOrderInfo.isRaise) && + (widget.tableId > 0 ? !(widget?.minOrderInfo?.isRaise ?? false) : !(widget?.settleOrderInfo?.isRaise ?? false)) && (widget?.settleOrderInfo?.discountAmount != "0")) { widgets.add(vipItem(Color(0xFFFF7A1A), "VIP优惠", - widget?.settleOrderInfo?.discountAmount ?? "")); + (widget.minOrderInfo != null && widget.minOrderInfo.orderProductVOList != null) ? (widget.minOrderInfo?.discountAmount ?? ""):(widget?.settleOrderInfo?.discountAmount ?? ""))); } if (widget.useBenefitSelect && - (widget?.settleOrderInfo?.benefitDiscountAmount != "0")) { - widgets.add(vipItem(Color(0xFFFF7A1A), "VIP优惠金额", - widget?.settleOrderInfo?.benefitDiscountAmount ?? "")); + (widget?.settleOrderInfo?.benefitDiscountAmount != "0") && ((widget.tableId > 0 ? !(widget?.minOrderInfo?.isRaise ?? false) : !(widget?.settleOrderInfo?.isRaise ?? false)))) { + widgets.add(vipItem(Color(0xFFFF7A1A), "会员优惠金额", + (widget.minOrderInfo != null && widget.minOrderInfo.orderProductVOList != null) ? (widget.minOrderInfo?.benefitDiscountAmount ?? "") :(widget?.settleOrderInfo?.benefitDiscountAmount ?? ""))); } if (widget.showVipTips) { @@ -462,7 +464,7 @@ class _SettlementOrderCommodity extends State { ), Container( child: Text( - "已优惠:¥${discountPrice()}", + "已优惠:¥${(widget.tableId > 0 ? (widget?.minOrderInfo?.isRaise ?? false) : (widget?.settleOrderInfo?.isRaise ?? false)) ? "0": discountPrice()}", style: TextStyle( fontSize: 12.sp, fontFamily: 'JDZhengHT', @@ -504,10 +506,7 @@ class _SettlementOrderCommodity extends State { String discountPrice() { if (widget.minOrderInfo != null) { - return AppUtils.calculateDouble( - double.tryParse(widget.minOrderInfo?.couponSubPrice ?? "0") + - double.tryParse( - widget.settleOrderInfo?.benefitDiscountAmount ?? "0")); + return AppUtils.calculateDouble(double.tryParse(widget.minOrderInfo?.totalDiscountPrice ?? "0")); } else if (widget.tableId < 0) { return "0"; } else { diff --git a/lib/store/store_order.dart b/lib/store/store_order.dart index 11a20298..8e53c303 100644 --- a/lib/store/store_order.dart +++ b/lib/store/store_order.dart @@ -34,6 +34,7 @@ import 'package:permission_handler/permission_handler.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:shared_preferences/shared_preferences.dart'; +import '../retrofit/data/settleOrderInfo.dart'; import '../view_widget/border_text.dart'; import '../view_widget/request_permission.dart'; @@ -66,6 +67,8 @@ class _StoreOrderPage extends State String tenant = ""; String storeId = ""; int numberOfPeople = 0; + String vipLevelName; + MemberVo memberVo; ///小程序token String minToken; @@ -155,6 +158,7 @@ class _StoreOrderPage extends State value.setString('minMember', jsonEncode(baseData.data)), }, ); + memberVo = MemberVo.fromJson(baseData.data); } } @@ -650,6 +654,8 @@ class _StoreOrderPage extends State "shoppingCart": shopCarGoods, "numberOfPeople": numberOfPeople, "distance":widget.arguments["distance"], + "vipLevelName":memberVo.memberRankVo.rankName, + "isVips":memberVo.isVip, }, ); if (tableId > 0) { diff --git a/lib/union/union_list.dart b/lib/union/union_list.dart index a7d6c822..d10df8c5 100644 --- a/lib/union/union_list.dart +++ b/lib/union/union_list.dart @@ -229,7 +229,7 @@ class _UnionList extends State { height: 40.h, ), Text( - store.storeName, + store?.storeName ?? "", overflow: TextOverflow.ellipsis, style: TextStyle( color: Color(0xFF0D0D0D),