|
|
@ -115,43 +115,40 @@ class _Settlement extends State<Settlement> { |
|
|
|
showLoading: true); |
|
|
|
showLoading: true); |
|
|
|
if (promotions != null && promotions != "" || tableId <= 0) { |
|
|
|
if (promotions != null && promotions != "" || tableId <= 0) { |
|
|
|
queryOrderInfo( |
|
|
|
queryOrderInfo( |
|
|
|
address != null ? address.id : null, |
|
|
|
address != null ? address.id : null, |
|
|
|
selectedBtn, |
|
|
|
selectedBtn, |
|
|
|
null, |
|
|
|
null, |
|
|
|
0, |
|
|
|
0, |
|
|
|
widget.arguments["pid"] ?? (productId?? ""), |
|
|
|
widget.arguments["pid"] ?? (productId ?? ""), |
|
|
|
productSkuId ?? "", |
|
|
|
productSkuId ?? "", |
|
|
|
actProductId ?? "", |
|
|
|
actProductId ?? "", |
|
|
|
actProductSkuId ?? "", |
|
|
|
actProductSkuId ?? "", |
|
|
|
count1, |
|
|
|
count1, |
|
|
|
payChannel |
|
|
|
payChannel); |
|
|
|
); |
|
|
|
|
|
|
|
} else if (coupons != null && coupons != "" || tableId <= 0) { |
|
|
|
} else if (coupons != null && coupons != "" || tableId <= 0) { |
|
|
|
queryOrderInfo( |
|
|
|
queryOrderInfo( |
|
|
|
address != null ? address.id : null, |
|
|
|
address != null ? address.id : null, |
|
|
|
selectedBtn, |
|
|
|
selectedBtn, |
|
|
|
widget.arguments["cid"], |
|
|
|
widget.arguments["cid"], |
|
|
|
0, |
|
|
|
0, |
|
|
|
productId?? null, |
|
|
|
productId ?? null, |
|
|
|
productSkuId ?? "", |
|
|
|
productSkuId ?? "", |
|
|
|
actProductId ?? "", |
|
|
|
actProductId ?? "", |
|
|
|
actProductSkuId ?? "", |
|
|
|
actProductSkuId ?? "", |
|
|
|
count1, |
|
|
|
count1, |
|
|
|
payChannel |
|
|
|
payChannel); |
|
|
|
); |
|
|
|
|
|
|
|
} else |
|
|
|
} else |
|
|
|
queryOrderInfo( |
|
|
|
queryOrderInfo( |
|
|
|
null, |
|
|
|
null, |
|
|
|
selectedBtn, |
|
|
|
selectedBtn, |
|
|
|
null, |
|
|
|
null, |
|
|
|
0, |
|
|
|
0, |
|
|
|
productId ?? null, |
|
|
|
productId ?? null, |
|
|
|
productSkuId ?? "", |
|
|
|
productSkuId ?? "", |
|
|
|
actProductId ?? "", |
|
|
|
actProductId ?? "", |
|
|
|
actProductSkuId ?? "", |
|
|
|
actProductSkuId ?? "", |
|
|
|
count1, |
|
|
|
count1, |
|
|
|
payChannel |
|
|
|
payChannel); |
|
|
|
); |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
weChatResponseEventHandler.listen((event) async { |
|
|
|
weChatResponseEventHandler.listen((event) async { |
|
|
@ -161,28 +158,18 @@ class _Settlement extends State<Settlement> { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
///订单结算信息 |
|
|
|
///订单结算信息 |
|
|
|
queryOrderInfo( |
|
|
|
queryOrderInfo(addressId, isTake, memberCouponId, orderId, promotionId, |
|
|
|
addressId, |
|
|
|
productSkuId, actProductId, actProductSkuId, buyNum, payChannel) async { |
|
|
|
isTake, |
|
|
|
|
|
|
|
memberCouponId, |
|
|
|
|
|
|
|
orderId, |
|
|
|
|
|
|
|
promotionId, |
|
|
|
|
|
|
|
productSkuId, |
|
|
|
|
|
|
|
actProductId, |
|
|
|
|
|
|
|
actProductSkuId, |
|
|
|
|
|
|
|
buyNum, |
|
|
|
|
|
|
|
payChannel |
|
|
|
|
|
|
|
) async { |
|
|
|
|
|
|
|
BaseData<SettleOrderInfo> baseData = await minService.getOrderInfo({ |
|
|
|
BaseData<SettleOrderInfo> baseData = await minService.getOrderInfo({ |
|
|
|
"addressId": addressId, |
|
|
|
"addressId": addressId, |
|
|
|
"isTake": isTake, |
|
|
|
"isTake": isTake, |
|
|
|
"memberCouponId": memberCouponId, |
|
|
|
"memberCouponId": memberCouponId, |
|
|
|
"orderId": orderId, |
|
|
|
"orderId": orderId, |
|
|
|
"promotionId": promotionId, |
|
|
|
"promotionId": promotionId, |
|
|
|
"productSkuId":productSkuId, |
|
|
|
"productSkuId": productSkuId, |
|
|
|
"actProductId": actProductId, |
|
|
|
"actProductId": actProductId, |
|
|
|
"actProductSkuId": actProductSkuId, |
|
|
|
"actProductSkuId": actProductSkuId, |
|
|
|
"buyNum":buyNum, |
|
|
|
"buyNum": buyNum, |
|
|
|
"payChannel": payChannel |
|
|
|
"payChannel": payChannel |
|
|
|
}).catchError((error) {}); |
|
|
|
}).catchError((error) {}); |
|
|
|
if (baseData != null && baseData.isSuccess) { |
|
|
|
if (baseData != null && baseData.isSuccess) { |
|
|
@ -219,17 +206,16 @@ class _Settlement extends State<Settlement> { |
|
|
|
}); |
|
|
|
}); |
|
|
|
if (address != null) { |
|
|
|
if (address != null) { |
|
|
|
queryOrderInfo( |
|
|
|
queryOrderInfo( |
|
|
|
address.id, |
|
|
|
address.id, |
|
|
|
selectedBtn, |
|
|
|
selectedBtn, |
|
|
|
null, |
|
|
|
null, |
|
|
|
0, |
|
|
|
0, |
|
|
|
productId?? null, |
|
|
|
productId ?? null, |
|
|
|
productSkuId ?? "", |
|
|
|
productSkuId ?? "", |
|
|
|
actProductId ?? "", |
|
|
|
actProductId ?? "", |
|
|
|
actProductSkuId ?? "", |
|
|
|
actProductSkuId ?? "", |
|
|
|
count1, |
|
|
|
count1, |
|
|
|
payChannel |
|
|
|
payChannel); |
|
|
|
); |
|
|
|
|
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
BaseData<List<Address>> baseDate = |
|
|
|
BaseData<List<Address>> baseDate = |
|
|
@ -274,17 +260,16 @@ class _Settlement extends State<Settlement> { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
queryOrderInfo( |
|
|
|
queryOrderInfo( |
|
|
|
address.id, |
|
|
|
address.id, |
|
|
|
selectedBtn, |
|
|
|
selectedBtn, |
|
|
|
null, |
|
|
|
null, |
|
|
|
0, |
|
|
|
0, |
|
|
|
productId?? null, |
|
|
|
productId ?? null, |
|
|
|
productSkuId ?? "", |
|
|
|
productSkuId ?? "", |
|
|
|
actProductId ?? "", |
|
|
|
actProductId ?? "", |
|
|
|
actProductSkuId ?? "", |
|
|
|
actProductSkuId ?? "", |
|
|
|
count1, |
|
|
|
count1, |
|
|
|
payChannel |
|
|
|
payChannel); |
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -301,17 +286,16 @@ class _Settlement extends State<Settlement> { |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
queryOrderInfo( |
|
|
|
queryOrderInfo( |
|
|
|
address.id, |
|
|
|
address.id, |
|
|
|
selectedBtn, |
|
|
|
selectedBtn, |
|
|
|
null, |
|
|
|
null, |
|
|
|
0, |
|
|
|
0, |
|
|
|
productId?? null, |
|
|
|
productId ?? null, |
|
|
|
productSkuId ?? "", |
|
|
|
productSkuId ?? "", |
|
|
|
actProductId ?? "", |
|
|
|
actProductId ?? "", |
|
|
|
actProductSkuId ?? "", |
|
|
|
actProductSkuId ?? "", |
|
|
|
count1, |
|
|
|
count1, |
|
|
|
payChannel |
|
|
|
payChannel); |
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -404,14 +388,10 @@ class _Settlement extends State<Settlement> { |
|
|
|
placeOrderFirst.payChannel = payChannel; |
|
|
|
placeOrderFirst.payChannel = payChannel; |
|
|
|
placeOrderFirst.promotionInfoDTO = PromotionInfoDTOBean(); |
|
|
|
placeOrderFirst.promotionInfoDTO = PromotionInfoDTOBean(); |
|
|
|
placeOrderFirst.promotionInfoDTO.promotionId = |
|
|
|
placeOrderFirst.promotionInfoDTO.promotionId = |
|
|
|
(promotion != null && tableId <= 0) |
|
|
|
(promotion != null && tableId <= 0) ? promotion.id : ""; |
|
|
|
? promotion.id |
|
|
|
|
|
|
|
: ""; |
|
|
|
|
|
|
|
// : widget.arguments["pid"] ?? ""; |
|
|
|
// : widget.arguments["pid"] ?? ""; |
|
|
|
placeOrderFirst.promotionInfoDTO.couponId = |
|
|
|
placeOrderFirst.promotionInfoDTO.couponId = |
|
|
|
(couponListBean != null && tableId <= 0) |
|
|
|
(couponListBean != null && tableId <= 0) ? couponListBean.id : ""; |
|
|
|
? couponListBean.id |
|
|
|
|
|
|
|
: ""; |
|
|
|
|
|
|
|
// : widget.arguments["cid"] ?? ""; |
|
|
|
// : widget.arguments["cid"] ?? ""; |
|
|
|
placeOrderFirst.recMobile = |
|
|
|
placeOrderFirst.recMobile = |
|
|
|
(mobile == null || mobile == "") ? mobile : storeInfo.headMobile; |
|
|
|
(mobile == null || mobile == "") ? mobile : storeInfo.headMobile; |
|
|
@ -442,8 +422,7 @@ class _Settlement extends State<Settlement> { |
|
|
|
if (placeOrder) { |
|
|
|
if (placeOrder) { |
|
|
|
// 结算 |
|
|
|
// 结算 |
|
|
|
querySettlement(); |
|
|
|
querySettlement(); |
|
|
|
} |
|
|
|
} else { |
|
|
|
else{ |
|
|
|
|
|
|
|
if (parentId == "") { |
|
|
|
if (parentId == "") { |
|
|
|
// 下单 |
|
|
|
// 下单 |
|
|
|
baseData = await minService |
|
|
|
baseData = await minService |
|
|
@ -462,12 +441,11 @@ class _Settlement extends State<Settlement> { |
|
|
|
} |
|
|
|
} |
|
|
|
if (baseData != null && baseData.isSuccess) { |
|
|
|
if (baseData != null && baseData.isSuccess) { |
|
|
|
placeOrder = true; |
|
|
|
placeOrder = true; |
|
|
|
this.downOrder = DownOrder.fromJson(baseData.data); |
|
|
|
this.downOrder = DownOrder.fromJson(baseData.data); |
|
|
|
queryOrderDetails( |
|
|
|
queryOrderDetails( |
|
|
|
(parentId == null || parentId == "") ? baseData.data.id : parentId); |
|
|
|
(parentId == null || parentId == "") ? baseData.data.id : parentId); |
|
|
|
setState(() {}); |
|
|
|
setState(() {}); |
|
|
|
} |
|
|
|
} else { |
|
|
|
else { |
|
|
|
|
|
|
|
SmartDialog.showToast(baseData?.msg, alignment: Alignment.center); |
|
|
|
SmartDialog.showToast(baseData?.msg, alignment: Alignment.center); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -480,7 +458,7 @@ class _Settlement extends State<Settlement> { |
|
|
|
? minOrderInfo.orderProductVOList |
|
|
|
? minOrderInfo.orderProductVOList |
|
|
|
: downOrder.orderProductVOList; |
|
|
|
: downOrder.orderProductVOList; |
|
|
|
if (placeOrderFirst.payChannel == 1) { |
|
|
|
if (placeOrderFirst.payChannel == 1) { |
|
|
|
if(Platform.isAndroid){ |
|
|
|
if (Platform.isAndroid) { |
|
|
|
if (!(await Min.isInitialize())) { |
|
|
|
if (!(await Min.isInitialize())) { |
|
|
|
// 小程序的微信支付和app的充值支付使用同一个WXPayEntryActivity回调, |
|
|
|
// 小程序的微信支付和app的充值支付使用同一个WXPayEntryActivity回调, |
|
|
|
// 然而充值时小程序未初始化会导致回调内部代码调用getPackage空指针, |
|
|
|
// 然而充值时小程序未初始化会导致回调内部代码调用getPackage空指针, |
|
|
@ -647,8 +625,8 @@ class _Settlement extends State<Settlement> { |
|
|
|
child: Container( |
|
|
|
child: Container( |
|
|
|
child: Column( |
|
|
|
child: Column( |
|
|
|
children: [ |
|
|
|
children: [ |
|
|
|
DistributionMode((addressId, isTake, |
|
|
|
DistributionMode((addressId, isTake, memberCouponId, |
|
|
|
memberCouponId, orderId, promotionId) { |
|
|
|
orderId, promotionId) { |
|
|
|
setState(() { |
|
|
|
setState(() { |
|
|
|
this.selectedBtn = 0; |
|
|
|
this.selectedBtn = 0; |
|
|
|
}); |
|
|
|
}); |
|
|
@ -657,13 +635,12 @@ class _Settlement extends State<Settlement> { |
|
|
|
isTake, |
|
|
|
isTake, |
|
|
|
memberCouponId, |
|
|
|
memberCouponId, |
|
|
|
orderId, |
|
|
|
orderId, |
|
|
|
promotionId ?? (productId?? ""), |
|
|
|
promotionId ?? (productId ?? ""), |
|
|
|
productSkuId ?? "", |
|
|
|
productSkuId ?? "", |
|
|
|
actProductId ?? "", |
|
|
|
actProductId ?? "", |
|
|
|
actProductSkuId ?? "", |
|
|
|
actProductSkuId ?? "", |
|
|
|
count1, |
|
|
|
count1, |
|
|
|
payChannel |
|
|
|
payChannel); |
|
|
|
); |
|
|
|
|
|
|
|
}, queryAddress, storeInfo, address, |
|
|
|
}, queryAddress, storeInfo, address, |
|
|
|
selectedAddress, pageType), |
|
|
|
selectedAddress, pageType), |
|
|
|
|
|
|
|
|
|
|
@ -691,28 +668,27 @@ class _Settlement extends State<Settlement> { |
|
|
|
couponCart, |
|
|
|
couponCart, |
|
|
|
activityCart, |
|
|
|
activityCart, |
|
|
|
settleOrderInfo, |
|
|
|
settleOrderInfo, |
|
|
|
payChannel == 4 ? null : coupons, |
|
|
|
payChannel == 4 ? null : coupons, |
|
|
|
payChannel == 4 ? null : promotions, |
|
|
|
payChannel == 4 ? null : promotions, |
|
|
|
couponCount(), |
|
|
|
couponCount(), |
|
|
|
placeOrder, |
|
|
|
placeOrder, |
|
|
|
remakers, |
|
|
|
remakers, |
|
|
|
() { |
|
|
|
() { |
|
|
|
Navigator.of(context).pushNamed( |
|
|
|
Navigator.of(context).pushNamed( |
|
|
|
'/router/edit_remarks_page', |
|
|
|
'/router/edit_remarks_page', |
|
|
|
arguments: {}, |
|
|
|
arguments: {}, |
|
|
|
).then((value) => { |
|
|
|
).then((value) => { |
|
|
|
setState(() { |
|
|
|
setState(() { |
|
|
|
if (value != null) remakers = value; |
|
|
|
if (value != null) remakers = value; |
|
|
|
}) |
|
|
|
}) |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
tableId, |
|
|
|
tableId, |
|
|
|
), |
|
|
|
), |
|
|
|
|
|
|
|
|
|
|
|
if (placeOrder && |
|
|
|
if (placeOrder && joinA != JoinActivity.BargainBug) |
|
|
|
joinA != JoinActivity.BargainBug) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
///支付方式 |
|
|
|
///支付方式 |
|
|
|
PayMethod(payChannelCheck), |
|
|
|
PayMethod(payChannelCheck), |
|
|
|
], |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
@ -776,14 +752,16 @@ class _Settlement extends State<Settlement> { |
|
|
|
callback: () { |
|
|
|
callback: () { |
|
|
|
pageType != null |
|
|
|
pageType != null |
|
|
|
? bargainOrderId != null |
|
|
|
? bargainOrderId != null |
|
|
|
? activityPay() |
|
|
|
? activityPay() |
|
|
|
: joinA == JoinActivity.GoJoin |
|
|
|
: joinA == JoinActivity.GoJoin |
|
|
|
? queryJoinAct() |
|
|
|
? queryJoinAct() |
|
|
|
: queryLaunchAct() |
|
|
|
: queryLaunchAct() |
|
|
|
: queryPlaceOrderFirst(); |
|
|
|
: queryPlaceOrderFirst(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
), |
|
|
|
), |
|
|
|
SizedBox(width: 17,) |
|
|
|
SizedBox( |
|
|
|
|
|
|
|
width: 17, |
|
|
|
|
|
|
|
) |
|
|
|
], |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
@ -800,15 +778,14 @@ class _Settlement extends State<Settlement> { |
|
|
|
queryOrderInfo( |
|
|
|
queryOrderInfo( |
|
|
|
address?.id, |
|
|
|
address?.id, |
|
|
|
selectedBtn, |
|
|
|
selectedBtn, |
|
|
|
payChannel == 4 ? null : couponListBean?.id, |
|
|
|
payChannel == 4 ? null : couponListBean?.id, |
|
|
|
0, |
|
|
|
0, |
|
|
|
payChannel == 4 ? null : promotion?.id, |
|
|
|
payChannel == 4 ? null : promotion?.id, |
|
|
|
productSkuId ?? "", |
|
|
|
productSkuId ?? "", |
|
|
|
actProductId ?? "", |
|
|
|
actProductId ?? "", |
|
|
|
actProductSkuId ?? "", |
|
|
|
actProductSkuId ?? "", |
|
|
|
count1, |
|
|
|
count1, |
|
|
|
payChannel |
|
|
|
payChannel); |
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
mobileChange(String mobile) { |
|
|
|
mobileChange(String mobile) { |
|
|
@ -843,21 +820,20 @@ class _Settlement extends State<Settlement> { |
|
|
|
); |
|
|
|
); |
|
|
|
if (couponBean != null) { |
|
|
|
if (couponBean != null) { |
|
|
|
this.couponListBean = couponBean; |
|
|
|
this.couponListBean = couponBean; |
|
|
|
coupons = couponListBean?.promotionName??""; |
|
|
|
coupons = couponListBean?.promotionName ?? ""; |
|
|
|
promotions = ""; |
|
|
|
promotions = ""; |
|
|
|
this.promotion = null; |
|
|
|
this.promotion = null; |
|
|
|
queryOrderInfo( |
|
|
|
queryOrderInfo( |
|
|
|
address?.id, |
|
|
|
address?.id, |
|
|
|
selectedBtn, |
|
|
|
selectedBtn, |
|
|
|
couponListBean?.id, |
|
|
|
couponListBean?.id, |
|
|
|
0, |
|
|
|
0, |
|
|
|
productId?? null, |
|
|
|
productId ?? null, |
|
|
|
productSkuId ?? "", |
|
|
|
productSkuId ?? "", |
|
|
|
actProductId ?? "", |
|
|
|
actProductId ?? "", |
|
|
|
actProductSkuId ?? "", |
|
|
|
actProductSkuId ?? "", |
|
|
|
count1, |
|
|
|
count1, |
|
|
|
payChannel |
|
|
|
payChannel); |
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -877,17 +853,16 @@ class _Settlement extends State<Settlement> { |
|
|
|
coupons = ""; |
|
|
|
coupons = ""; |
|
|
|
this.couponListBean = null; |
|
|
|
this.couponListBean = null; |
|
|
|
queryOrderInfo( |
|
|
|
queryOrderInfo( |
|
|
|
address?.id, |
|
|
|
address?.id, |
|
|
|
selectedBtn, |
|
|
|
selectedBtn, |
|
|
|
null, |
|
|
|
null, |
|
|
|
0, |
|
|
|
0, |
|
|
|
promotion != null ? promotion.id : (productId?? null), |
|
|
|
promotion != null ? promotion.id : (productId ?? null), |
|
|
|
productSkuId ?? "", |
|
|
|
productSkuId ?? "", |
|
|
|
actProductId ?? "", |
|
|
|
actProductId ?? "", |
|
|
|
actProductSkuId ?? "", |
|
|
|
actProductSkuId ?? "", |
|
|
|
count1, |
|
|
|
count1, |
|
|
|
payChannel |
|
|
|
payChannel); |
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|