|
|
@ -1,3 +1,5 @@ |
|
|
|
|
|
|
|
import 'dart:io'; |
|
|
|
|
|
|
|
|
|
|
|
import 'package:flutter/cupertino.dart'; |
|
|
|
import 'package:flutter/cupertino.dart'; |
|
|
|
import 'package:flutter/material.dart'; |
|
|
|
import 'package:flutter/material.dart'; |
|
|
|
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; |
|
|
|
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; |
|
|
@ -36,8 +38,7 @@ class ActivityCouponRemarks extends StatefulWidget { |
|
|
|
this.editRemark, |
|
|
|
this.editRemark, |
|
|
|
this.tableId, |
|
|
|
this.tableId, |
|
|
|
this.vipPriceSelect, |
|
|
|
this.vipPriceSelect, |
|
|
|
this.showVipTips |
|
|
|
this.showVipTips); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@override |
|
|
|
@override |
|
|
|
State<StatefulWidget> createState() { |
|
|
|
State<StatefulWidget> createState() { |
|
|
@ -64,12 +65,7 @@ class _ActivityCouponRemarks extends State<ActivityCouponRemarks> { |
|
|
|
borderRadius: BorderRadius.circular(8), |
|
|
|
borderRadius: BorderRadius.circular(8), |
|
|
|
), |
|
|
|
), |
|
|
|
// height: 122.h / (!widget.placeOrder ? 2 : 1), |
|
|
|
// height: 122.h / (!widget.placeOrder ? 2 : 1), |
|
|
|
margin: EdgeInsets.only( |
|
|
|
margin: EdgeInsets.only(left: 16, right: 16, top: 15, bottom: 14), |
|
|
|
left: 16, |
|
|
|
|
|
|
|
right: 16, |
|
|
|
|
|
|
|
top: 15, |
|
|
|
|
|
|
|
bottom: 14 |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
padding: EdgeInsets.only( |
|
|
|
padding: EdgeInsets.only( |
|
|
|
left: 16, |
|
|
|
left: 16, |
|
|
|
right: 16, |
|
|
|
right: 16, |
|
|
@ -96,6 +92,7 @@ class _ActivityCouponRemarks extends State<ActivityCouponRemarks> { |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
|
|
|
|
Platform.isAndroid ? |
|
|
|
Switch.adaptive( |
|
|
|
Switch.adaptive( |
|
|
|
value: (widget.coupons != null && widget.coupons != ""||widget.promotions != null && widget.promotions != "") ? false:vipSelect, |
|
|
|
value: (widget.coupons != null && widget.coupons != ""||widget.promotions != null && widget.promotions != "") ? false:vipSelect, |
|
|
|
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, |
|
|
|
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, |
|
|
@ -111,13 +108,40 @@ class _ActivityCouponRemarks extends State<ActivityCouponRemarks> { |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
), |
|
|
|
): |
|
|
|
|
|
|
|
GestureDetector( |
|
|
|
|
|
|
|
onTap: () { |
|
|
|
|
|
|
|
setState(() { |
|
|
|
|
|
|
|
// (widget.coupons != null && widget.coupons != ""||widget.promotions != null && widget.promotions != "") ? false:vipSelect, |
|
|
|
|
|
|
|
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( |
|
|
|
|
|
|
|
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") |
|
|
|
if (widget.placeOrder && |
|
|
|
|
|
|
|
widget?.settleOrderInfo?.benefitDiscountAmount != null && |
|
|
|
|
|
|
|
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, |
|
|
|
children: [ |
|
|
|
children: [ |
|
|
@ -144,7 +168,7 @@ class _ActivityCouponRemarks extends State<ActivityCouponRemarks> { |
|
|
|
], |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
if (widget.placeOrder && widget.tableId <=0) |
|
|
|
if (widget.placeOrder && widget.tableId <= 0) |
|
|
|
InkWell( |
|
|
|
InkWell( |
|
|
|
onTap: () { |
|
|
|
onTap: () { |
|
|
|
widget.activityCart(); |
|
|
|
widget.activityCart(); |
|
|
@ -245,7 +269,7 @@ class _ActivityCouponRemarks extends State<ActivityCouponRemarks> { |
|
|
|
), |
|
|
|
), |
|
|
|
Expanded( |
|
|
|
Expanded( |
|
|
|
child: Text( |
|
|
|
child: Text( |
|
|
|
widget.remark != "" ? widget.remark:"点击添加备注", |
|
|
|
widget.remark != "" ? widget.remark : "点击添加备注", |
|
|
|
textAlign: TextAlign.end, |
|
|
|
textAlign: TextAlign.end, |
|
|
|
style: TextStyle( |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 14.sp, |
|
|
|
fontSize: 14.sp, |
|
|
@ -286,11 +310,10 @@ class _ActivityCouponRemarks extends State<ActivityCouponRemarks> { |
|
|
|
String coupon = ""; |
|
|
|
String coupon = ""; |
|
|
|
if (widget.coupons == null || widget.coupons == "") { |
|
|
|
if (widget.coupons == null || widget.coupons == "") { |
|
|
|
coupon = "未选择任何优惠券"; |
|
|
|
coupon = "未选择任何优惠券"; |
|
|
|
if(widget.placeOrder) |
|
|
|
if (widget.placeOrder) if (widget.minOrderInfo == null || |
|
|
|
if(widget.minOrderInfo == null || |
|
|
|
widget.minOrderInfo.orderInfoVo.couponList == null) { |
|
|
|
widget.minOrderInfo.orderInfoVo.couponList == null) |
|
|
|
coupon = "未选择任何优惠券"; |
|
|
|
{coupon = "未选择任何优惠券";} |
|
|
|
} else if (widget.promotions != null && widget.promotions != "") { |
|
|
|
else if(widget.promotions != null && widget.promotions != ""){ |
|
|
|
|
|
|
|
coupon = "优惠券与活动不可同享"; |
|
|
|
coupon = "优惠券与活动不可同享"; |
|
|
|
} |
|
|
|
} |
|
|
|
if (widget.settleOrderInfo == null || |
|
|
|
if (widget.settleOrderInfo == null || |
|
|
|