|
|
|
@ -86,8 +86,8 @@ class _Settlement extends State<Settlement> {
|
|
|
|
|
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<Settlement> {
|
|
|
|
|
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<Settlement> {
|
|
|
|
|
productSkuId ?? "", |
|
|
|
|
actProductId ?? "", |
|
|
|
|
actProductSkuId ?? "", |
|
|
|
|
useVipPriceSelect, |
|
|
|
|
useBenefitSelect, |
|
|
|
|
useVipPriceSelect, |
|
|
|
|
(useVipPriceSelect == true && isVips) ? false:useBenefitSelect, |
|
|
|
|
count1, |
|
|
|
|
payChannel, |
|
|
|
|
tableId); |
|
|
|
@ -242,7 +244,7 @@ class _Settlement extends State<Settlement> {
|
|
|
|
|
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<Settlement> {
|
|
|
|
|
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<Settlement> {
|
|
|
|
|
value.setString('minMember', jsonEncode(baseData.data)), |
|
|
|
|
}, |
|
|
|
|
); |
|
|
|
|
//获取json里面的某个字段赋值 |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
///查看订单详情 |
|
|
|
|
queryOrderDetails(id) async { |
|
|
|
|
EasyLoading.show(status: S.current.zhengzaijiazai); |
|
|
|
|
BaseData<MinOrderInfo> baseData = await minService.getOrderDetails({ |
|
|
|
|
"id": pageType != null ? widget.arguments["orderId"] : id ?? parentId, |
|
|
|
|
}).catchError((error) {}); |
|
|
|
@ -293,8 +295,10 @@ class _Settlement extends State<Settlement> {
|
|
|
|
|
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<Settlement> {
|
|
|
|
|
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<Settlement> {
|
|
|
|
|
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<Settlement> {
|
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// 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<Settlement> {
|
|
|
|
|
queryOrderDetails(parentId); |
|
|
|
|
setState(() {}); |
|
|
|
|
} else { |
|
|
|
|
// orderButton = false; |
|
|
|
|
orderButton = false; |
|
|
|
|
SmartDialog.showToast(baseData?.msg, alignment: Alignment.center); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -592,10 +596,10 @@ class _Settlement extends State<Settlement> {
|
|
|
|
|
|
|
|
|
|
///结算 |
|
|
|
|
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<Settlement> {
|
|
|
|
|
(coupons != "" || promotions!="") ? false : useVipPriceSelect, |
|
|
|
|
this.showVipTips, |
|
|
|
|
(coupons != "" || promotions!="") ? false : useBenefitSelect, |
|
|
|
|
placeOrder |
|
|
|
|
), |
|
|
|
|
|
|
|
|
|
///优惠券/备注/会员优惠金额 |
|
|
|
@ -848,11 +853,12 @@ class _Settlement extends State<Settlement> {
|
|
|
|
|
}, |
|
|
|
|
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<Settlement> {
|
|
|
|
|
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<Settlement> {
|
|
|
|
|
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<Settlement> {
|
|
|
|
|
actProductId ?? "", |
|
|
|
|
actProductSkuId ?? "", |
|
|
|
|
useVipPriceSelect, |
|
|
|
|
useBenefitSelect, |
|
|
|
|
useVipPriceSelect == true ? false :useBenefitSelect, |
|
|
|
|
count1, |
|
|
|
|
payChannel, |
|
|
|
|
tableId);} |
|
|
|
|