Browse Source

Merge branch 'dev' into new_revision_app

# Conflicts:
#	lib/settlement/settlement_view/coupon.dart
new_revision_app
wurong 2 years ago
parent
commit
b7dafc3d6d
  1. 2
      lib/login/new_login_page.dart
  2. 2
      lib/order/order_view/order_commodity.dart
  3. 7
      lib/retrofit/data/placeOrderFirst.dart
  4. 79
      lib/settlement/settlement.dart
  5. 212
      lib/settlement/settlement_view/activity_coupon_remarks.dart
  6. 67
      lib/settlement/settlement_view/coupon.dart
  7. 7
      lib/settlement/settlement_view/pay_method.dart
  8. 12
      lib/settlement/settlement_view/settlement_order_commodity.dart

2
lib/login/new_login_page.dart

@ -416,7 +416,7 @@ class _NewLoginPage extends State<NewLoginPage> {
Container( Container(
height: 30.h, height: 30.h,
width: MediaQuery.of(context).size.width - 100.w, 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( child: TextField(
style: TextStyle( style: TextStyle(
height: 1.h, height: 1.h,

2
lib/order/order_view/order_commodity.dart

@ -93,7 +93,7 @@ class _OrderCommodity extends State<OrderCommodity> {
vipItem( vipItem(
Color(0xFFFF7A1A), Color(0xFFFF7A1A),
"会员优惠金额", "会员优惠金额",
widget?.orderInfo?.benefitDiscountAmount ?? "0.00", "- ${widget?.orderInfo?.benefitDiscountAmount ?? "0.00"}",
), ),
); );
} }

7
lib/retrofit/data/placeOrderFirst.dart

@ -119,8 +119,9 @@ class PromotionInfoDTOBean {
String couponId; String couponId;
String promotionId; String promotionId;
bool useVipPrice; bool useVipPrice;
bool useBenefit;
PromotionInfoDTOBean({this.couponId, this.promotionId,this.useVipPrice}); PromotionInfoDTOBean({this.couponId, this.promotionId,this.useVipPrice,this.useBenefit});
static PromotionInfoDTOBean fromJson(Map<String, dynamic> json) { static PromotionInfoDTOBean fromJson(Map<String, dynamic> json) {
if (json == null) return null; if (json == null) return null;
@ -128,12 +129,14 @@ class PromotionInfoDTOBean {
promotionInfoDTOBean.couponId = json['couponId']; promotionInfoDTOBean.couponId = json['couponId'];
promotionInfoDTOBean.promotionId = json['promotionId']; promotionInfoDTOBean.promotionId = json['promotionId'];
promotionInfoDTOBean.useVipPrice = json['useVipPrice']; promotionInfoDTOBean.useVipPrice = json['useVipPrice'];
promotionInfoDTOBean.useBenefit = json['useBenefit'];
return promotionInfoDTOBean; return promotionInfoDTOBean;
} }
Map<String, dynamic> toJson() => { Map<String, dynamic> toJson() => {
"couponId": couponId, "couponId": couponId,
"promotionId": promotionId, "promotionId": promotionId,
"useVipPrice":useVipPrice "useVipPrice":useVipPrice,
"useBenefit":useBenefit
}; };
} }

79
lib/settlement/settlement.dart

@ -83,8 +83,11 @@ class _Settlement extends State<Settlement> {
bool orderButton = false; bool orderButton = false;
bool useVipPriceSelect = true; bool useVipPriceSelect = true;
bool showVipTips = false; bool showVipTips = false;
bool useBenefitSelect = true;
bool isRaiseChannel = false; bool isRaiseChannel = false;
ShoppingCart shopCarGoods; ShoppingCart shopCarGoods;
String vipName;
@override @override
void initState() { void initState() {
@ -136,6 +139,7 @@ class _Settlement extends State<Settlement> {
actProductId ?? "", actProductId ?? "",
actProductSkuId ?? "", actProductSkuId ?? "",
useVipPriceSelect, useVipPriceSelect,
useBenefitSelect,
count1, count1,
payChannel, payChannel,
tableId); tableId);
@ -150,6 +154,7 @@ class _Settlement extends State<Settlement> {
actProductId ?? "", actProductId ?? "",
actProductSkuId ?? "", actProductSkuId ?? "",
useVipPriceSelect, useVipPriceSelect,
useBenefitSelect,
count1, count1,
payChannel, payChannel,
tableId); tableId);
@ -164,6 +169,7 @@ class _Settlement extends State<Settlement> {
actProductId ?? "", actProductId ?? "",
actProductSkuId ?? "", actProductSkuId ?? "",
useVipPriceSelect, useVipPriceSelect,
useBenefitSelect,
count1, count1,
payChannel, payChannel,
tableId); tableId);
@ -186,6 +192,7 @@ class _Settlement extends State<Settlement> {
actProductId, actProductId,
actProductSkuId, actProductSkuId,
useVipPriceSelect, useVipPriceSelect,
useBenefitSelect,
buyNum, buyNum,
payChannel, payChannel,
tableId) async { tableId) async {
@ -202,6 +209,7 @@ class _Settlement extends State<Settlement> {
"actProductId": actProductId, "actProductId": actProductId,
"actProductSkuId": actProductSkuId, "actProductSkuId": actProductSkuId,
"useVipPrice":useVipPriceSelect, "useVipPrice":useVipPriceSelect,
"useBenefit": useBenefitSelect,
"buyNum": buyNum, "buyNum": buyNum,
"payChannel":payChannel, "payChannel":payChannel,
"tableId": tableId "tableId": tableId
@ -246,6 +254,7 @@ class _Settlement extends State<Settlement> {
actProductId ?? "", actProductId ?? "",
actProductSkuId ?? "", actProductSkuId ?? "",
useVipPriceSelect, useVipPriceSelect,
useBenefitSelect,
count1, count1,
settleOrderInfo.isRaise ? 7 :payChannel, settleOrderInfo.isRaise ? 7 :payChannel,
tableId); tableId);
@ -270,6 +279,7 @@ class _Settlement extends State<Settlement> {
value.setString('minMember', jsonEncode(baseData.data)), value.setString('minMember', jsonEncode(baseData.data)),
}, },
); );
//json里面的某个字段赋值
} }
} }
@ -329,6 +339,7 @@ class _Settlement extends State<Settlement> {
actProductId ?? "", actProductId ?? "",
actProductSkuId ?? "", actProductSkuId ?? "",
useVipPriceSelect, useVipPriceSelect,
useBenefitSelect,
count1, count1,
payChannel, payChannel,
tableId); tableId);
@ -381,6 +392,7 @@ class _Settlement extends State<Settlement> {
actProductId ?? "", actProductId ?? "",
actProductSkuId ?? "", actProductSkuId ?? "",
useVipPriceSelect, useVipPriceSelect,
useBenefitSelect,
count1, count1,
payChannel, payChannel,
tableId); tableId);
@ -409,6 +421,7 @@ class _Settlement extends State<Settlement> {
actProductId ?? "", actProductId ?? "",
actProductSkuId ?? "", actProductSkuId ?? "",
useVipPriceSelect, useVipPriceSelect,
useBenefitSelect,
count1, count1,
payChannel, payChannel,
tableId); tableId);
@ -509,7 +522,8 @@ class _Settlement extends State<Settlement> {
placeOrderFirst.promotionInfoDTO.couponId = placeOrderFirst.promotionInfoDTO.couponId =
(couponListBean != null && tableId <= 0) ? couponListBean.id : ""; (couponListBean != null && tableId <= 0) ? couponListBean.id : "";
// : widget.arguments["cid"] ?? ""; // : widget.arguments["cid"] ?? "";
placeOrderFirst.promotionInfoDTO.useVipPrice = useVipPriceSelect; placeOrderFirst.promotionInfoDTO.useVipPrice = settleOrderInfo.isRaise ? false : useVipPriceSelect;
placeOrderFirst.promotionInfoDTO.useBenefit = (settleOrderInfo.benefitDiscountAmount == "0") ? false : useBenefitSelect;
placeOrderFirst.recMobile = placeOrderFirst.recMobile =
(mobile == null || mobile == "") ? mobile : storeInfo.headMobile; (mobile == null || mobile == "") ? mobile : storeInfo.headMobile;
placeOrderFirst.shoppingCartSkuItemList = settleOrderInfo.orderProductList; placeOrderFirst.shoppingCartSkuItemList = settleOrderInfo.orderProductList;
@ -774,6 +788,7 @@ class _Settlement extends State<Settlement> {
actProductId ?? "", actProductId ?? "",
actProductSkuId ?? "", actProductSkuId ?? "",
useVipPriceSelect, useVipPriceSelect,
useBenefitSelect,
count1, count1,
payChannel, payChannel,
tableId ?? 0); tableId ?? 0);
@ -798,8 +813,9 @@ class _Settlement extends State<Settlement> {
minOrderInfo, minOrderInfo,
tableId, tableId,
pageType, pageType,
(coupons != "" || promotions!="") ? false :useVipPriceSelect, (coupons != "" || promotions!="") ? false : useVipPriceSelect,
this.showVipTips this.showVipTips,
(coupons != "" || promotions!="") ? false : useBenefitSelect,
), ),
///// /////
@ -829,12 +845,14 @@ class _Settlement extends State<Settlement> {
setState(() { setState(() {
this.showVipTips = true; this.showVipTips = true;
}); });
} },
vipBenefitSelect,
payChannel,
), ),
if (settleOrderInfo != null && placeOrder && joinA != JoinActivity.BargainBug) 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<Settlement> {
// return; // return;
// } else // } else
// orderButton = true; // orderButton = true;
pageType != null
? bargainOrderId != null // if(payChannel == 7 || payChannel == 5 && (couponListBean?.id != null || promotion?.id != null || productId!=null || useVipPriceSelect == true ||useBenefitSelect == true)){
? activityPay() // SmartDialog.show(
: joinA == JoinActivity.GoJoin // widget: SettlementTips(
? queryJoinAct() // () {
: queryLaunchAct() // },
: queryPlaceOrderFirst(); // text:"该支付方式不参与任何活动优惠,请重新选择支付方式",
// ));
// }else{
pageType != null
? bargainOrderId != null
? activityPay()
: joinA == JoinActivity.GoJoin
? queryJoinAct()
: queryLaunchAct()
: queryPlaceOrderFirst();
// }
}, },
), ),
SizedBox( SizedBox(
@ -940,7 +968,8 @@ class _Settlement extends State<Settlement> {
productSkuId ?? "", productSkuId ?? "",
actProductId ?? "", actProductId ?? "",
actProductSkuId ?? "", actProductSkuId ?? "",
useVipPriceSelect, (payChannel == 5 || payChannel == 7) ? false : useVipPriceSelect,
(payChannel == 5 || payChannel == 7)? false : useBenefitSelect,
count1, count1,
payChannel, payChannel,
tableId);} tableId);}
@ -962,6 +991,28 @@ class _Settlement extends State<Settlement> {
actProductId ?? "", actProductId ?? "",
actProductSkuId ?? "", actProductSkuId ?? "",
useVipPriceSelect, 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, count1,
payChannel, payChannel,
tableId);} tableId);}
@ -1019,6 +1070,7 @@ class _Settlement extends State<Settlement> {
actProductId ?? "", actProductId ?? "",
actProductSkuId ?? "", actProductSkuId ?? "",
useVipPriceSelect, useVipPriceSelect,
useBenefitSelect,
count1, count1,
payChannel, payChannel,
tableId); tableId);
@ -1052,6 +1104,7 @@ class _Settlement extends State<Settlement> {
actProductId ?? "", actProductId ?? "",
actProductSkuId ?? "", actProductSkuId ?? "",
useVipPriceSelect, useVipPriceSelect,
useBenefitSelect,
count1, count1,
payChannel, payChannel,
tableId); tableId);

212
lib/settlement/settlement_view/activity_coupon_remarks.dart

@ -24,6 +24,8 @@ class ActivityCouponRemarks extends StatefulWidget {
final int tableId; final int tableId;
final Function(bool useVipPriceSelect) vipPriceSelect; final Function(bool useVipPriceSelect) vipPriceSelect;
final Function showVipTips; final Function showVipTips;
final Function(bool useBenefitSelect) vipBenefitSelect;
final int payChannell;
ActivityCouponRemarks( ActivityCouponRemarks(
this.couponCart, this.couponCart,
@ -38,7 +40,9 @@ class ActivityCouponRemarks extends StatefulWidget {
this.editRemark, this.editRemark,
this.tableId, this.tableId,
this.vipPriceSelect, this.vipPriceSelect,
this.showVipTips); this.showVipTips,
this.vipBenefitSelect,
this.payChannell);
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
@ -48,6 +52,7 @@ class ActivityCouponRemarks extends StatefulWidget {
class _ActivityCouponRemarks extends State<ActivityCouponRemarks> { class _ActivityCouponRemarks extends State<ActivityCouponRemarks> {
bool vipSelect = true; bool vipSelect = true;
bool vipBenefit = true;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -76,70 +81,88 @@ class _ActivityCouponRemarks extends State<ActivityCouponRemarks> {
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
if( !(widget?.settleOrderInfo?.isRaise ?? false) && (widget?.settleOrderInfo?.memberVO?.isVip ?? false) && widget.placeOrder) if (!(widget?.settleOrderInfo?.isRaise ?? false) &&
Row( (widget?.settleOrderInfo?.memberVO?.isVip ?? false) &&
mainAxisAlignment: MainAxisAlignment.center, widget.placeOrder)
crossAxisAlignment: CrossAxisAlignment.center, Row(
children: [ mainAxisAlignment: MainAxisAlignment.center,
Expanded( crossAxisAlignment: CrossAxisAlignment.center,
flex: 1, children: [
child: Text( Expanded(
"VIP权益", flex: 1,
style: TextStyle( child: Text(
fontWeight: MyFontWeight.regular, "VIP权益",
fontSize: 14.sp, style: TextStyle(
color: Color(0xFF353535), 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,
), ),
), ),
) 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 && if (widget.placeOrder &&
widget?.settleOrderInfo?.benefitDiscountAmount != null && widget.settleOrderInfo.memberVO.memberRankVo.rankName == "黄金会员")
widget?.settleOrderInfo?.benefitDiscountAmount != "0")
Container( Container(
margin: EdgeInsets.only(bottom: 13), margin: EdgeInsets.only(
bottom: 13,
),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
@ -155,19 +178,66 @@ class _ActivityCouponRemarks extends State<ActivityCouponRemarks> {
), ),
), ),
), ),
Text( // Text(
widget.settleOrderInfo.benefitDiscountAmount, // "${widget.settleOrderInfo.benefitDiscountAmount}",
textAlign: TextAlign.end, // textAlign: TextAlign.end,
style: TextStyle( // style: TextStyle(
fontSize: 14.sp, // fontSize: 14.sp,
color: Color(0xFF32A060), // color: Color(0xFF32A060),
fontWeight: MyFontWeight.semi_bold, // 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( InkWell(
onTap: () { onTap: () {
widget.activityCart(); widget.activityCart();

67
lib/settlement/settlement_view/coupon.dart

@ -24,9 +24,9 @@ class CouponWidget extends StatefulWidget {
} }
} }
class _CouponWidget extends State<CouponWidget> { class _CouponWidget extends State<CouponWidget> {
bool selectIndex = false;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
@ -101,9 +101,13 @@ class _CouponWidget extends State<CouponWidget> {
// ), // ),
// flex: 1, // flex: 1,
// ), // ),
SizedBox(width:8,), SizedBox(
width: 8,
),
couponListWidget(context), couponListWidget(context),
SizedBox(width:5,), SizedBox(
width: 5,
),
Expanded( Expanded(
flex: 2, flex: 2,
child: Column( child: Column(
@ -172,7 +176,13 @@ class _CouponWidget extends State<CouponWidget> {
margin: EdgeInsets.only(right: 23.w), margin: EdgeInsets.only(right: 23.w),
child: GestureDetector( child: GestureDetector(
onTap: () { 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( child: Image.asset(
widget.selected widget.selected
@ -233,7 +243,7 @@ class _CouponWidget extends State<CouponWidget> {
onTap: () { onTap: () {
setState(() { setState(() {
widget.couponList.isEx = widget.couponList.isEx =
!(widget.couponList.isEx ?? false); !(widget.couponList.isEx ?? false);
}); });
}, },
), ),
@ -262,18 +272,21 @@ class _CouponWidget extends State<CouponWidget> {
), ),
], ],
), ),
if ((widget.couponList?.isEx ?? false) && (widget.couponList?.usableReason != null)) if ((widget.couponList?.isEx ?? false) &&
(widget.couponList.usableReason != null))
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Expanded(child: Text( Expanded(
child: Text(
"不可用原因:", "不可用原因:",
style: TextStyle( style: TextStyle(
color: Color(0xFF353535), color: Color(0xFF353535),
fontSize: 10.sp, fontSize: 10.sp,
), ),
)), )),
Expanded(child: Align( Expanded(
child: Align(
alignment: Alignment.centerRight, alignment: Alignment.centerRight,
child: Text( child: Text(
widget.couponList.usableReason ?? "", widget.couponList.usableReason ?? "",
@ -283,8 +296,7 @@ class _CouponWidget extends State<CouponWidget> {
fontSize: 10.sp, fontSize: 10.sp,
), ),
), ),
)) )),
,
], ],
), ),
], ],
@ -312,7 +324,7 @@ class _CouponWidget extends State<CouponWidget> {
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,
color: Color(0xff32A060), color: Color(0xff32A060),
), ),
), ),
SizedBox( SizedBox(
@ -325,20 +337,19 @@ class _CouponWidget extends State<CouponWidget> {
style: TextStyle( style: TextStyle(
fontSize: 30.sp, fontSize: 30.sp,
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
color: Color(0xff32A060), color: Color(0xff32A060),
), ),
), ),
], ],
), ),
Text( Text(
S.of(context).manyuankeyong(widget.couponList != null S.of(context).manyuankeyong(widget.couponList != null
? ("${widget.couponList.fullAmount}" ?? "0") ? ("${widget.couponList.fullAmount}" ?? "0").toString()
.toString()
: ""), : ""),
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
color: Color(0xff32A060), color: Color(0xff32A060),
), ),
), ),
], ],
@ -349,13 +360,13 @@ class _CouponWidget extends State<CouponWidget> {
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Container( Container(
padding: EdgeInsets.only(bottom:10,top: 7,left: 12), padding: EdgeInsets.only(bottom: 10, top: 7, left: 12),
child: Text( child: Text(
S.of(context).duihuanquan, S.of(context).duihuanquan,
style: TextStyle( style: TextStyle(
fontSize: 26.sp, fontSize: 26.sp,
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
color: Color(0xff32A060), color: Color(0xff32A060),
), ),
), ),
), ),
@ -364,7 +375,7 @@ class _CouponWidget extends State<CouponWidget> {
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
color: Color(0xff32A060), color: Color(0xff32A060),
), ),
), ),
], ],
@ -375,7 +386,7 @@ class _CouponWidget extends State<CouponWidget> {
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Container( Container(
padding: EdgeInsets.only(bottom:10,top: 7,left: 12), padding: EdgeInsets.only(bottom: 10, top: 7, left: 12),
child: Text( child: Text(
S.of(context).duihuanquan, S.of(context).duihuanquan,
style: TextStyle( style: TextStyle(
@ -410,27 +421,29 @@ class _CouponWidget extends State<CouponWidget> {
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,
color: widget.couponList.status == 3 ? Color(0xFFB3B3B3):Color(0xff32A060), color: widget.couponList.status == 3
? Color(0xFFB3B3B3)
: Color(0xff32A060),
), ),
), ),
SizedBox( SizedBox(
height: 4.h, height: 4.h,
), ),
Text( Text(
widget.couponList != null widget.couponList != null
? "${AppUtils.calculateDouble(double.tryParse(widget.couponList.limitAmount) ?? 0)}" ? "${AppUtils.calculateDouble(double.tryParse(widget.couponList.limitAmount) ?? 0)}"
: "", : "",
style: TextStyle( style: TextStyle(
fontSize: 28.sp, fontSize: 28.sp,
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
color: Color(0xff32A060), color: Color(0xff32A060),
), ),
), ),
], ],
), ),
], ],
); );
}else{ } else {
return Column( return Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
@ -441,14 +454,14 @@ class _CouponWidget extends State<CouponWidget> {
textBaseline: TextBaseline.alphabetic, textBaseline: TextBaseline.alphabetic,
children: [ children: [
Text( Text(
widget.couponList != null widget.couponList != null
? "${(widget.couponList.discountPercent / 10.0 >= 10) ? 10 : widget.couponList.discountPercent / 10.0}" ?? ? "${(widget.couponList.discountPercent / 10.0 >= 10) ? 10 : widget.couponList.discountPercent / 10.0}" ??
"0" "0"
: "", : "",
style: TextStyle( style: TextStyle(
fontSize: 30.sp, fontSize: 30.sp,
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
color: Color(0xff32A060), color: Color(0xff32A060),
), ),
), ),
SizedBox( SizedBox(

7
lib/settlement/settlement_view/pay_method.dart

@ -16,8 +16,9 @@ class PayMethod extends StatefulWidget {
final String promotions; final String promotions;
final bool useVipPriceSelect; final bool useVipPriceSelect;
final SettleOrderInfo settleOrderInfo; 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 @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
@ -184,7 +185,7 @@ class _PayMethod extends State<PayMethod> {
onTap: () { onTap: () {
setState(() { setState(() {
checkIndex = 3; checkIndex = 3;
if(widget.promotions != "" || widget.coupons != "" || widget.useVipPriceSelect){ if(widget.promotions != "" || widget.coupons != "" || widget.useVipPriceSelect || widget.useBenefitSelect){
SmartDialog.show( SmartDialog.show(
widget: SettlementTips( widget: SettlementTips(
() { () {
@ -238,7 +239,7 @@ class _PayMethod extends State<PayMethod> {
onTap: () { onTap: () {
setState(() { setState(() {
checkIndex = 4; checkIndex = 4;
if(widget.promotions != "" || widget.coupons != "" || widget.useVipPriceSelect){ if(widget.promotions != "" || widget.coupons != "" || widget.useVipPriceSelect || widget.useBenefitSelect){
SmartDialog.show( SmartDialog.show(
widget: SettlementTips( widget: SettlementTips(
() { () {

12
lib/settlement/settlement_view/settlement_order_commodity.dart

@ -19,6 +19,7 @@ class SettlementOrderCommodity extends StatefulWidget {
final String pageType; final String pageType;
final bool useVipPriceSelect; final bool useVipPriceSelect;
final bool showVipTips; final bool showVipTips;
final bool useBenefitSelect;
SettlementOrderCommodity( SettlementOrderCommodity(
this.isTakeOut, this.isTakeOut,
@ -27,7 +28,8 @@ class SettlementOrderCommodity extends StatefulWidget {
this.tableId, this.tableId,
this.pageType, this.pageType,
this.useVipPriceSelect, this.useVipPriceSelect,
this.showVipTips); this.showVipTips,
this.useBenefitSelect,);
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
@ -118,6 +120,12 @@ class _SettlementOrderCommodity extends State<SettlementOrderCommodity> {
widget?.settleOrderInfo?.discountAmount ?? "")); widget?.settleOrderInfo?.discountAmount ?? ""));
} }
if (widget.useBenefitSelect &&
(widget?.settleOrderInfo?.benefitDiscountAmount != "0")) {
widgets.add(vipItem(Color(0xFFFF7A1A), "VIP优惠金额",
widget?.settleOrderInfo?.benefitDiscountAmount ?? ""));
}
if (widget.showVipTips) { if (widget.showVipTips) {
widgets.add(GestureDetector( widgets.add(GestureDetector(
child: Container( child: Container(
@ -503,7 +511,7 @@ class _SettlementOrderCommodity extends State<SettlementOrderCommodity> {
} else if (widget.tableId < 0) { } else if (widget.tableId < 0) {
return "0"; return "0";
} else { } else {
return widget?.settleOrderInfo?.discountAmount ?? "0"; return AppUtils.calculateDouble(double.tryParse(widget?.settleOrderInfo?.discountAmount ?? "0") + double.tryParse(widget?.settleOrderInfo?.benefitDiscountAmount ?? "0"));
} }
} }

Loading…
Cancel
Save