|
|
|
@ -140,7 +140,9 @@ 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 && |
|
|
|
@ -161,7 +163,9 @@ 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 && |
|
|
|
@ -228,7 +232,9 @@ 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, |
|
|
|
@ -329,7 +335,8 @@ 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) {}); |
|
|
|
@ -557,6 +564,10 @@ class _Settlement extends State<Settlement> {
|
|
|
|
|
|
|
|
|
|
///小程序下单 |
|
|
|
|
queryPlaceOrderFirst() async { |
|
|
|
|
try { |
|
|
|
|
EasyLoading.show( |
|
|
|
|
status: S.current.zhengzaijiazai, |
|
|
|
|
maskType: EasyLoadingMaskType.black); |
|
|
|
|
// for (int i = 0; i < settleOrderInfo.orderProductList.length; i++) { |
|
|
|
|
// settleOrderInfo.orderProductList.forEach((element1) { |
|
|
|
|
// if (settleOrderInfo.orderProductList[i].productId == |
|
|
|
@ -608,10 +619,12 @@ class _Settlement extends State<Settlement> {
|
|
|
|
|
// : widget.arguments["cid"] ?? ""; |
|
|
|
|
// 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.promotionInfoDTO.discountType = (!placeOrder) ? "AUTO" :settleOrderInfo?.discountType ?? ""; |
|
|
|
|
placeOrderFirst.promotionInfoDTO.discountType = |
|
|
|
|
(!placeOrder) ? "AUTO" : settleOrderInfo?.discountType ?? ""; |
|
|
|
|
placeOrderFirst.recMobile = |
|
|
|
|
(mobile == null || mobile == "") ? mobile : storeInfo.headMobile; |
|
|
|
|
placeOrderFirst.shoppingCartSkuItemList = settleOrderInfo.orderProductList; |
|
|
|
|
placeOrderFirst.shoppingCartSkuItemList = |
|
|
|
|
settleOrderInfo.orderProductList; |
|
|
|
|
placeOrderFirst.skuItemDTOList = []; |
|
|
|
|
placeOrderFirst.source = 1; |
|
|
|
|
placeOrderFirst.storeId = storeInfo.id; |
|
|
|
@ -632,10 +645,12 @@ class _Settlement extends State<Settlement> {
|
|
|
|
|
print("error: $error"); |
|
|
|
|
}); |
|
|
|
|
if (baseData != null && baseData.isSuccess) { |
|
|
|
|
EasyLoading.show(status: S.current.zhengzaijiazai,maskType: EasyLoadingMaskType.black); |
|
|
|
|
// EasyLoading.show( |
|
|
|
|
// status: S.current.zhengzaijiazai, |
|
|
|
|
// maskType: EasyLoadingMaskType.black); |
|
|
|
|
placeOrder = true; |
|
|
|
|
this.downOrder = DownOrder.fromJson(baseData.data); |
|
|
|
|
querySettlement(); |
|
|
|
|
await querySettlement(); |
|
|
|
|
} else { |
|
|
|
|
// orderButton = false; |
|
|
|
|
SmartDialog.showToast(baseData?.msg, alignment: Alignment.center); |
|
|
|
@ -676,10 +691,14 @@ class _Settlement extends State<Settlement> {
|
|
|
|
|
SmartDialog.showToast(baseData?.msg, alignment: Alignment.center); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} finally { |
|
|
|
|
// EasyLoading.dismiss(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
///结算 |
|
|
|
|
querySettlement() async { |
|
|
|
|
try{ |
|
|
|
|
placeOrderFirst.id = ((parentId != "") ? parentId : downOrder.id); |
|
|
|
|
placeOrderFirst.orderProductVOList = ((downOrder == null) |
|
|
|
|
? minOrderInfo.orderProductVOList |
|
|
|
@ -743,6 +762,8 @@ class _Settlement extends State<Settlement> {
|
|
|
|
|
text: "${baseData?.msg}", |
|
|
|
|
)); |
|
|
|
|
} |
|
|
|
|
}}finally{ |
|
|
|
|
EasyLoading.dismiss(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -950,7 +971,9 @@ class _Settlement extends State<Settlement> {
|
|
|
|
|
|
|
|
|
|
///会员优惠选择 |
|
|
|
|
if ((settleOrderInfo != null || |
|
|
|
|
minOrderInfo != null) && (placeOrder && tableId <= 0 && |
|
|
|
|
minOrderInfo != null) && |
|
|
|
|
(placeOrder && |
|
|
|
|
tableId <= 0 && |
|
|
|
|
!(settleOrderInfo?.isRaise ?? false))) |
|
|
|
|
VipDiscountsSelect( |
|
|
|
|
vipSelectCheck, |
|
|
|
@ -1534,13 +1557,19 @@ 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, |
|
|
|
@ -1574,13 +1603,21 @@ 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, |
|
|
|
|