|
|
|
@ -274,23 +274,21 @@ class _Settlement extends State<Settlement> {
|
|
|
|
|
|
|
|
|
|
if (tableId == 0) { |
|
|
|
|
///正常的商店下单 |
|
|
|
|
BaseData<DownOrder> baseData = await minService |
|
|
|
|
BaseData<dynamic> baseData = await minService |
|
|
|
|
.placeOrderFirst(placeOrderFirst.toJson()) |
|
|
|
|
.catchError((error) { |
|
|
|
|
print("error: $error"); |
|
|
|
|
}); |
|
|
|
|
if (baseData != null && baseData.isSuccess) { |
|
|
|
|
placeOrder = true; |
|
|
|
|
this.downOrder = baseData.data; |
|
|
|
|
this.downOrder = DownOrder.fromJson(baseData.data); |
|
|
|
|
querySettlement(); |
|
|
|
|
} else { |
|
|
|
|
baseData?.isSuccess ?? false ? |
|
|
|
|
SmartDialog.showToast("下单失败:订单实付金额不能为0", alignment: Alignment.center) : |
|
|
|
|
SmartDialog.showToast(baseData.msg, alignment: Alignment.center); |
|
|
|
|
SmartDialog.showToast(baseData?.msg, alignment: Alignment.center); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
///火锅店下单, 等待结算 |
|
|
|
|
BaseData<DownOrder> baseData; |
|
|
|
|
BaseData<dynamic> baseData; |
|
|
|
|
if (parentId == "") { |
|
|
|
|
// 下单 |
|
|
|
|
if (placeOrder) { |
|
|
|
@ -319,11 +317,14 @@ class _Settlement extends State<Settlement> {
|
|
|
|
|
} |
|
|
|
|
if (baseData != null && baseData.isSuccess) { |
|
|
|
|
placeOrder = true; |
|
|
|
|
this.downOrder = baseData.data; |
|
|
|
|
this.downOrder = DownOrder.fromJson(baseData.data); |
|
|
|
|
queryOrderDetails( |
|
|
|
|
(parentId == null || parentId == "") ? baseData.data.id : parentId); |
|
|
|
|
setState(() {}); |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
SmartDialog.showToast(baseData?.msg, alignment: Alignment.center); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|