|
|
|
@ -140,9 +140,7 @@ class _Settlement extends State<Settlement> {
|
|
|
|
|
storeId: storeId, |
|
|
|
|
showLoading: false); |
|
|
|
|
queryMemberInfo(); |
|
|
|
|
if (widget.arguments["pid"] != null && |
|
|
|
|
widget.arguments["pid"] != "" && |
|
|
|
|
tableId <= 0) { |
|
|
|
|
if (widget.arguments["pid"] != null && widget.arguments["pid"] != "" && tableId <= 0) { |
|
|
|
|
queryOrderInfo( |
|
|
|
|
address != null ? address.id : null, |
|
|
|
|
((storeInfo?.pickupType?.dineInTakeStatus ?? false) == true && |
|
|
|
@ -163,9 +161,7 @@ class _Settlement extends State<Settlement> {
|
|
|
|
|
count1, |
|
|
|
|
payChannel, |
|
|
|
|
tableId); |
|
|
|
|
} else if (widget.arguments["cid"] != null && |
|
|
|
|
widget.arguments["cid"] != "" && |
|
|
|
|
tableId <= 0) { |
|
|
|
|
} else if ( widget.arguments["cid"] != null && widget.arguments["cid"] != "" && tableId <= 0) { |
|
|
|
|
queryOrderInfo( |
|
|
|
|
address != null ? address.id : null, |
|
|
|
|
((storeInfo?.pickupType?.dineInTakeStatus ?? false) == true && |
|
|
|
@ -174,7 +170,7 @@ class _Settlement extends State<Settlement> {
|
|
|
|
|
selectedBtn != 2) |
|
|
|
|
? diningStatus |
|
|
|
|
: selectedBtn, |
|
|
|
|
widget.arguments["cid"] ?? 0, |
|
|
|
|
widget.arguments["cid"]??0, |
|
|
|
|
0, |
|
|
|
|
productId ?? 0, |
|
|
|
|
productSkuId ?? "", |
|
|
|
@ -232,9 +228,7 @@ class _Settlement extends State<Settlement> {
|
|
|
|
|
payChannel, |
|
|
|
|
tableId) async { |
|
|
|
|
try { |
|
|
|
|
EasyLoading.show( |
|
|
|
|
status: S.current.zhengzaijiazai, |
|
|
|
|
maskType: EasyLoadingMaskType.black); |
|
|
|
|
EasyLoading.show(status: S.current.zhengzaijiazai,maskType: EasyLoadingMaskType.black); |
|
|
|
|
|
|
|
|
|
BaseData<SettleOrderInfo> baseData = await minService.getOrderInfo({ |
|
|
|
|
"addressId": addressId, |
|
|
|
@ -335,8 +329,7 @@ class _Settlement extends State<Settlement> {
|
|
|
|
|
|
|
|
|
|
///查看订单详情 |
|
|
|
|
queryOrderDetails(id) async { |
|
|
|
|
EasyLoading.show( |
|
|
|
|
status: S.current.zhengzaijiazai, maskType: EasyLoadingMaskType.black); |
|
|
|
|
EasyLoading.show(status: S.current.zhengzaijiazai,maskType: EasyLoadingMaskType.black); |
|
|
|
|
BaseData<MinOrderInfo> baseData = await minService.getOrderDetails({ |
|
|
|
|
"id": pageType != null ? widget.arguments["orderId"] : id ?? parentId, |
|
|
|
|
}).catchError((error) {}); |
|
|
|
@ -565,8 +558,7 @@ class _Settlement extends State<Settlement> {
|
|
|
|
|
///小程序下单 |
|
|
|
|
queryPlaceOrderFirst() async { |
|
|
|
|
try { |
|
|
|
|
EasyLoading.show( |
|
|
|
|
status: S.current.zhengzaijiazai, |
|
|
|
|
EasyLoading.show(status: S.current.zhengzaijiazai, |
|
|
|
|
maskType: EasyLoadingMaskType.black); |
|
|
|
|
// for (int i = 0; i < settleOrderInfo.orderProductList.length; i++) { |
|
|
|
|
// settleOrderInfo.orderProductList.forEach((element1) { |
|
|
|
@ -595,7 +587,9 @@ class _Settlement extends State<Settlement> {
|
|
|
|
|
placeOrderFirst.notes = remakers + |
|
|
|
|
(reservationTime ?? "") + |
|
|
|
|
((subscribeParam?.isEnableSubscribe ?? false) == true |
|
|
|
|
? "预约门店:${((subscribeParam?.stores?.length ?? 0) == 1 ? (subscribeParam.stores[0]) : (subscribeStoresName ?? ""))}" |
|
|
|
|
? "预约门店:${((subscribeParam?.stores?.length ?? 0) == 1 |
|
|
|
|
? (subscribeParam.stores[0]) |
|
|
|
|
: (subscribeStoresName ?? ""))}" |
|
|
|
|
: ""); |
|
|
|
|
placeOrderFirst.numberOfPeople = "$numberOfPeople"; |
|
|
|
|
placeOrderFirst.orderSource = 2; |
|
|
|
@ -645,8 +639,7 @@ class _Settlement extends State<Settlement> {
|
|
|
|
|
print("error: $error"); |
|
|
|
|
}); |
|
|
|
|
if (baseData != null && baseData.isSuccess) { |
|
|
|
|
// EasyLoading.show( |
|
|
|
|
// status: S.current.zhengzaijiazai, |
|
|
|
|
// EasyLoading.show(status: S.current.zhengzaijiazai, |
|
|
|
|
// maskType: EasyLoadingMaskType.black); |
|
|
|
|
placeOrder = true; |
|
|
|
|
this.downOrder = DownOrder.fromJson(baseData.data); |
|
|
|
@ -691,14 +684,13 @@ class _Settlement extends State<Settlement> {
|
|
|
|
|
SmartDialog.showToast(baseData?.msg, alignment: Alignment.center); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} finally { |
|
|
|
|
// EasyLoading.dismiss(); |
|
|
|
|
}finally{ |
|
|
|
|
EasyLoading.dismiss(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
///结算 |
|
|
|
|
querySettlement() async { |
|
|
|
|
try{ |
|
|
|
|
placeOrderFirst.id = ((parentId != "") ? parentId : downOrder.id); |
|
|
|
|
placeOrderFirst.orderProductVOList = ((downOrder == null) |
|
|
|
|
? minOrderInfo.orderProductVOList |
|
|
|
@ -735,10 +727,10 @@ class _Settlement extends State<Settlement> {
|
|
|
|
|
timeStamp: int.tryParse(wxPay.timeStamp), |
|
|
|
|
sign: wxPay.sign, |
|
|
|
|
); |
|
|
|
|
} else { |
|
|
|
|
}else{ |
|
|
|
|
EasyLoading.dismiss(); |
|
|
|
|
SmartDialog.showToast(baseData.msg, alignment: Alignment.center); |
|
|
|
|
Future.delayed(Duration(seconds: 2), () { |
|
|
|
|
Future.delayed(Duration(seconds:2), () { |
|
|
|
|
toOrderDetails(placeOrderFirst.id); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
@ -762,8 +754,6 @@ class _Settlement extends State<Settlement> {
|
|
|
|
|
text: "${baseData?.msg}", |
|
|
|
|
)); |
|
|
|
|
} |
|
|
|
|
}}finally{ |
|
|
|
|
EasyLoading.dismiss(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -971,9 +961,7 @@ class _Settlement extends State<Settlement> {
|
|
|
|
|
|
|
|
|
|
///会员优惠选择 |
|
|
|
|
if ((settleOrderInfo != null || |
|
|
|
|
minOrderInfo != null) && |
|
|
|
|
(placeOrder && |
|
|
|
|
tableId <= 0 && |
|
|
|
|
minOrderInfo != null) && (placeOrder && tableId <= 0 && |
|
|
|
|
!(settleOrderInfo?.isRaise ?? false))) |
|
|
|
|
VipDiscountsSelect( |
|
|
|
|
vipSelectCheck, |
|
|
|
@ -1557,19 +1545,13 @@ class _Settlement extends State<Settlement> {
|
|
|
|
|
selectedBtn != 2) |
|
|
|
|
? diningStatus |
|
|
|
|
: selectedBtn, |
|
|
|
|
((couponBean?.id ?? 0) == 0 && (promotion?.id ?? productId ?? 0) != 0) |
|
|
|
|
? 0 |
|
|
|
|
: couponBean?.id, |
|
|
|
|
((couponBean?.id??0) == 0 && (promotion?.id ?? productId ?? 0) !=0) ? 0: couponBean?.id, |
|
|
|
|
0, |
|
|
|
|
((couponBean?.id ?? 0) == 0 && (promotion?.id ?? productId ?? 0) != 0) |
|
|
|
|
? promotion?.id ?? productId |
|
|
|
|
: 0, |
|
|
|
|
((couponBean?.id??0) == 0 && (promotion?.id ?? productId ?? 0) !=0) ? promotion?.id ?? productId :0, |
|
|
|
|
productSkuId ?? "", |
|
|
|
|
actProductId ?? "", |
|
|
|
|
actProductSkuId ?? "", |
|
|
|
|
(couponBean?.id ?? 0) == 0 |
|
|
|
|
? ((promotion?.id ?? productId ?? 0) != 0 ? "ACTIVITY" : "AUTO") |
|
|
|
|
: "COUPON", |
|
|
|
|
(couponBean?.id ?? 0) == 0 ? ((promotion?.id ?? productId ?? 0) !=0 ? "ACTIVITY":"AUTO") : "COUPON", |
|
|
|
|
// useVipPriceSelect, |
|
|
|
|
// useBenefitSelect, |
|
|
|
|
count1, |
|
|
|
@ -1603,21 +1585,13 @@ class _Settlement extends State<Settlement> {
|
|
|
|
|
selectedBtn != 2) |
|
|
|
|
? diningStatus |
|
|
|
|
: selectedBtn, |
|
|
|
|
(((pro?.id ?? 0) ?? (productId ?? 0)) == 0 && |
|
|
|
|
(couponListBean?.id ?? 0) != 0) |
|
|
|
|
? couponListBean?.id |
|
|
|
|
: 0, |
|
|
|
|
(((pro?.id ?? 0) ?? (productId ?? 0)) == 0 && (couponListBean?.id ??0) != 0)?couponListBean?.id:0, |
|
|
|
|
0, |
|
|
|
|
(((pro?.id ?? 0) ?? (productId ?? 0)) == 0 && |
|
|
|
|
(couponListBean?.id ?? 0) != 0) |
|
|
|
|
? 0 |
|
|
|
|
: ((pro?.id ?? 0) ?? productId), |
|
|
|
|
(((pro?.id ?? 0) ?? (productId ?? 0)) == 0 && (couponListBean?.id ??0) != 0) ? 0 :((pro?.id ?? 0) ?? productId), |
|
|
|
|
productSkuId ?? "", |
|
|
|
|
actProductId ?? "", |
|
|
|
|
actProductSkuId ?? "", |
|
|
|
|
(((pro?.id ?? 0) ?? (productId ?? 0)) == 0 |
|
|
|
|
? ((couponListBean?.id ?? 0) != 0 ? "COUPON" : "AUTO") |
|
|
|
|
: "ACTIVITY"), |
|
|
|
|
(((pro?.id ?? 0) ?? (productId ?? 0)) == 0 ? ((couponListBean?.id ??0) != 0 ? "COUPON":"AUTO") : "ACTIVITY"), |
|
|
|
|
// useVipPriceSelect, |
|
|
|
|
// useBenefitSelect, |
|
|
|
|
count1, |
|
|
|
|