|
|
@ -133,7 +133,6 @@ class _Settlement extends State<Settlement> { |
|
|
|
"orderId": orderId, |
|
|
|
"orderId": orderId, |
|
|
|
"promotionId": promotionId, |
|
|
|
"promotionId": promotionId, |
|
|
|
"payChannel": payChannel |
|
|
|
"payChannel": payChannel |
|
|
|
|
|
|
|
|
|
|
|
}).catchError((error) {}); |
|
|
|
}).catchError((error) {}); |
|
|
|
if (baseData != null && baseData.isSuccess) { |
|
|
|
if (baseData != null && baseData.isSuccess) { |
|
|
|
setState(() { |
|
|
|
setState(() { |
|
|
@ -152,7 +151,9 @@ class _Settlement extends State<Settlement> { |
|
|
|
print("ididididididid: $id"); |
|
|
|
print("ididididididid: $id"); |
|
|
|
BaseData<MinOrderInfo> baseData = await minService.getOrderDetails({ |
|
|
|
BaseData<MinOrderInfo> baseData = await minService.getOrderDetails({ |
|
|
|
"id": id, |
|
|
|
"id": id, |
|
|
|
}).catchError((error) {}); |
|
|
|
}).catchError((error) { |
|
|
|
|
|
|
|
print(error); |
|
|
|
|
|
|
|
}); |
|
|
|
if (baseData != null && baseData.isSuccess) { |
|
|
|
if (baseData != null && baseData.isSuccess) { |
|
|
|
setState(() { |
|
|
|
setState(() { |
|
|
|
minOrderInfo = baseData.data; |
|
|
|
minOrderInfo = baseData.data; |
|
|
@ -263,11 +264,13 @@ class _Settlement extends State<Settlement> { |
|
|
|
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; |
|
|
|
placeOrderFirst.shoppingCartSkuItemList = settleOrderInfo.orderProductList; |
|
|
|
placeOrderFirst.shoppingCartSkuItemList = settleOrderInfo.orderProductList; |
|
|
@ -294,23 +297,18 @@ class _Settlement extends State<Settlement> { |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
///火锅店下单, 等待结算 |
|
|
|
///火锅店下单, 等待结算 |
|
|
|
BaseData<dynamic> baseData; |
|
|
|
BaseData<dynamic> baseData; |
|
|
|
if (parentId == "") { |
|
|
|
|
|
|
|
// 下单 |
|
|
|
|
|
|
|
if (placeOrder) { |
|
|
|
if (placeOrder) { |
|
|
|
// 结算 |
|
|
|
// 结算 |
|
|
|
querySettlement(); |
|
|
|
querySettlement(); |
|
|
|
} else { |
|
|
|
} |
|
|
|
|
|
|
|
else{ |
|
|
|
|
|
|
|
if (parentId == "") { |
|
|
|
// 下单 |
|
|
|
// 下单 |
|
|
|
baseData = await minService |
|
|
|
baseData = await minService |
|
|
|
.placeOrderFirst(placeOrderFirst.toJson()) |
|
|
|
.placeOrderFirst(placeOrderFirst.toJson()) |
|
|
|
.catchError((error) { |
|
|
|
.catchError((error) { |
|
|
|
print("error: $error"); |
|
|
|
print("error: $error"); |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
if (placeOrder) { |
|
|
|
|
|
|
|
// 结算 |
|
|
|
|
|
|
|
querySettlement(); |
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
//加菜 |
|
|
|
//加菜 |
|
|
|
baseData = await minService |
|
|
|
baseData = await minService |
|
|
@ -470,8 +468,8 @@ class _Settlement extends State<Settlement> { |
|
|
|
couponCart, |
|
|
|
couponCart, |
|
|
|
activityCart, |
|
|
|
activityCart, |
|
|
|
settleOrderInfo, |
|
|
|
settleOrderInfo, |
|
|
|
coupons, |
|
|
|
payChannel == 4 ? null : coupons, |
|
|
|
promotions, |
|
|
|
payChannel == 4 ? null : promotions, |
|
|
|
couponCount(), |
|
|
|
couponCount(), |
|
|
|
placeOrder, |
|
|
|
placeOrder, |
|
|
|
remakers, |
|
|
|
remakers, |
|
|
@ -564,9 +562,9 @@ class _Settlement extends State<Settlement> { |
|
|
|
queryOrderInfo( |
|
|
|
queryOrderInfo( |
|
|
|
address?.id, |
|
|
|
address?.id, |
|
|
|
selectedBtn, |
|
|
|
selectedBtn, |
|
|
|
couponListBean?.id, |
|
|
|
payChannel == 4 ? null : couponListBean?.id, |
|
|
|
0, |
|
|
|
0, |
|
|
|
promotion?.id, |
|
|
|
payChannel == 4 ? null : promotion?.id, |
|
|
|
payChannel |
|
|
|
payChannel |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
@ -601,10 +599,11 @@ class _Settlement extends State<Settlement> { |
|
|
|
couponBean: couponListBean); |
|
|
|
couponBean: couponListBean); |
|
|
|
}, |
|
|
|
}, |
|
|
|
); |
|
|
|
); |
|
|
|
// if (couponBean != null) { |
|
|
|
if (couponBean != null) { |
|
|
|
this.couponListBean = couponBean; |
|
|
|
this.couponListBean = couponBean; |
|
|
|
coupons = couponListBean?.promotionName ?? ""; |
|
|
|
coupons = couponListBean?.promotionName ?? ""; |
|
|
|
promotions = ""; |
|
|
|
promotions = ""; |
|
|
|
|
|
|
|
this.promotion = null; |
|
|
|
queryOrderInfo( |
|
|
|
queryOrderInfo( |
|
|
|
address?.id, |
|
|
|
address?.id, |
|
|
|
selectedBtn, |
|
|
|
selectedBtn, |
|
|
@ -613,7 +612,7 @@ class _Settlement extends State<Settlement> { |
|
|
|
null, |
|
|
|
null, |
|
|
|
payChannel |
|
|
|
payChannel |
|
|
|
); |
|
|
|
); |
|
|
|
// } |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
///活动弹窗 |
|
|
|
///活动弹窗 |
|
|
@ -626,10 +625,11 @@ class _Settlement extends State<Settlement> { |
|
|
|
return SettlementActivity(settleOrderInfo, storeInfo); |
|
|
|
return SettlementActivity(settleOrderInfo, storeInfo); |
|
|
|
}, |
|
|
|
}, |
|
|
|
); |
|
|
|
); |
|
|
|
// if (pro != null) { |
|
|
|
if (pro != null) { |
|
|
|
this.promotion = pro; |
|
|
|
this.promotion = pro; |
|
|
|
promotions = promotion?.name ?? ""; |
|
|
|
promotions = promotion?.name ?? ""; |
|
|
|
coupons = ""; |
|
|
|
coupons = ""; |
|
|
|
|
|
|
|
this.couponListBean = null; |
|
|
|
queryOrderInfo( |
|
|
|
queryOrderInfo( |
|
|
|
address?.id, |
|
|
|
address?.id, |
|
|
|
selectedBtn, |
|
|
|
selectedBtn, |
|
|
@ -638,6 +638,6 @@ class _Settlement extends State<Settlement> { |
|
|
|
promotion?.id, |
|
|
|
promotion?.id, |
|
|
|
payChannel |
|
|
|
payChannel |
|
|
|
); |
|
|
|
); |
|
|
|
// } |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|