|
|
|
@ -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<StatefulWidget> createState() { |
|
|
|
@ -48,6 +52,7 @@ class ActivityCouponRemarks extends StatefulWidget {
|
|
|
|
|
|
|
|
|
|
class _ActivityCouponRemarks extends State<ActivityCouponRemarks> { |
|
|
|
|
bool vipSelect = true; |
|
|
|
|
bool vipBenefit = true; |
|
|
|
|
|
|
|
|
|
@override |
|
|
|
|
Widget build(BuildContext context) { |
|
|
|
@ -76,7 +81,9 @@ class _ActivityCouponRemarks extends State<ActivityCouponRemarks> {
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly, |
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center, |
|
|
|
|
children: [ |
|
|
|
|
if( !(widget?.settleOrderInfo?.isRaise ?? false) && (widget?.settleOrderInfo?.memberVO?.isVip ?? false) && widget.placeOrder) |
|
|
|
|
if (!(widget?.settleOrderInfo?.isRaise ?? false) && |
|
|
|
|
(widget?.settleOrderInfo?.memberVO?.isVip ?? false) && |
|
|
|
|
widget.placeOrder) |
|
|
|
|
Row( |
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center, |
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center, |
|
|
|
@ -92,27 +99,36 @@ class _ActivityCouponRemarks extends State<ActivityCouponRemarks> {
|
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
Platform.isAndroid ? |
|
|
|
|
Switch.adaptive( |
|
|
|
|
value: (widget.coupons != null && widget.coupons != ""||widget.promotions != null && widget.promotions != "") ? false:vipSelect, |
|
|
|
|
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)){ |
|
|
|
|
if ((widget?.settleOrderInfo?.memberVO?.isVip ?? |
|
|
|
|
false)) { |
|
|
|
|
vipSelect = !vipSelect; |
|
|
|
|
widget.vipPriceSelect(vipSelect); |
|
|
|
|
}else{ |
|
|
|
|
} else { |
|
|
|
|
widget.showVipTips(); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
): |
|
|
|
|
GestureDetector( |
|
|
|
|
) |
|
|
|
|
: GestureDetector( |
|
|
|
|
onTap: () { |
|
|
|
|
setState(() { |
|
|
|
|
if ((widget?.settleOrderInfo?.memberVO?.isVip ?? false)) { |
|
|
|
|
if ((widget?.settleOrderInfo?.memberVO?.isVip ?? |
|
|
|
|
false)) { |
|
|
|
|
vipSelect = !vipSelect; |
|
|
|
|
widget.vipPriceSelect(vipSelect); |
|
|
|
|
} else { |
|
|
|
@ -125,7 +141,13 @@ class _ActivityCouponRemarks extends State<ActivityCouponRemarks> {
|
|
|
|
|
padding: EdgeInsets.only(bottom: 18.w), |
|
|
|
|
alignment: Alignment.center, |
|
|
|
|
child: Image.asset( |
|
|
|
|
((widget.coupons != null && widget.coupons != ""||widget.promotions != null && widget.promotions != "") ? false:vipSelect) |
|
|
|
|
((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, |
|
|
|
@ -136,10 +158,11 @@ class _ActivityCouponRemarks extends State<ActivityCouponRemarks> {
|
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
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<ActivityCouponRemarks> {
|
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
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(); |
|
|
|
|