feat:挂单弹框
This commit is contained in:
1 parent
e8553a39c0
commit
815cb2ac8b
6 files changed
+128
-1
No files matched your search
@@ -52,3 +52,16 @@ enum OrderPayDisplayType implements BaseEnum {
|
||||
this.order,
|
||||
);
|
||||
}
|
||||
|
||||
enum OrderMoreTypeEnum implements BaseEnum {
|
||||
addHoldBill("10", "加入挂单"),
|
||||
holdBillList("20", "挂单列表"),
|
||||
;
|
||||
|
||||
@override
|
||||
final String code;
|
||||
@override
|
||||
final String title;
|
||||
|
||||
const OrderMoreTypeEnum(this.code, this.title);
|
||||
}
|
||||
@@ -9,3 +9,14 @@ class OrderHistoryTableItem {
|
||||
this.total = 0,
|
||||
});
|
||||
}
|
||||
|
||||
class OrderMoreItem {
|
||||
String title;
|
||||
bool visible;
|
||||
OrderMoreTypeEnum type;
|
||||
OrderMoreItem({
|
||||
required this.title,
|
||||
required this.visible,
|
||||
required this.type,
|
||||
});
|
||||
}
|
||||
@@ -27,6 +27,7 @@ export './order/steelyard_container.dart';
|
||||
export './order/order_caneen_common.dart';
|
||||
export './order/order_common.dart';
|
||||
export './order/order_supermarket_common.dart';
|
||||
export 'order/order_more_dialog.dart';
|
||||
|
||||
export './setting/setting_password_dialog.dart';
|
||||
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
import 'package:ducafe_ui_core/ducafe_ui_core.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:forui/forui.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:pj_supermarket_cloud/common/index.dart';
|
||||
|
||||
List<OrderMoreItem> panelBtnList = <OrderMoreItem>[
|
||||
OrderMoreItem(
|
||||
title: "加入挂单",
|
||||
visible: true,
|
||||
type: OrderMoreTypeEnum.addHoldBill,
|
||||
),
|
||||
OrderMoreItem(
|
||||
title: "挂单列表",
|
||||
visible: true,
|
||||
type: OrderMoreTypeEnum.holdBillList,
|
||||
),
|
||||
].obs;
|
||||
|
||||
Future<OrderMoreTypeEnum?> selectOrderMoreDialog() async {
|
||||
final context = Get.context!;
|
||||
final theme = FTheme.of(context);
|
||||
|
||||
final width = Get.context!.width;
|
||||
final height = Get.context!.height;
|
||||
final dialogWidth = width * 0.3;
|
||||
final dialogHeight = height * 0.5;
|
||||
return showDialog<OrderMoreTypeEnum?>(
|
||||
context: context,
|
||||
barrierDismissible: true,
|
||||
builder: (BuildContext _) {
|
||||
return FDialog(
|
||||
title: Text("选择更多操作", style: theme.typography.lg)
|
||||
.marginOnly(bottom: 20.h),
|
||||
style: theme.dialogStyle.copyWith(
|
||||
insetPadding: EdgeInsets.zero,
|
||||
maxWidth: dialogWidth,
|
||||
minWidth: dialogWidth,
|
||||
horizontalStyle: theme.dialogStyle.horizontalStyle.copyWith(
|
||||
padding: EdgeInsets.all(20.w),
|
||||
),
|
||||
),
|
||||
body: <Widget>[
|
||||
...panelBtnList
|
||||
.where((v) => v.visible)
|
||||
.map(
|
||||
(v) => FButton(
|
||||
label: Text(
|
||||
v.title,
|
||||
style: theme.typography.lg.copyWith(
|
||||
color: theme.colorScheme.secondary,
|
||||
),
|
||||
),
|
||||
onPress: () => Get.back(result: v.type),
|
||||
).marginOnly(bottom: 20.h),
|
||||
)
|
||||
.toList(),
|
||||
].toColumn().width(double.infinity).height(dialogHeight),
|
||||
actions: [],
|
||||
);
|
||||
});
|
||||
}
|
||||
@@ -98,6 +98,37 @@ class SupermarketOrderController extends GetxController with OrderMixin {
|
||||
sendSubScreen();
|
||||
}
|
||||
|
||||
// |下单|点击更多
|
||||
Future<void> doMore() async {
|
||||
final selectType = await selectOrderMoreDialog();
|
||||
// 未选择
|
||||
if (ObjectUtil.isEmpty(selectType)) return;
|
||||
switch (selectType) {
|
||||
case OrderMoreTypeEnum.addHoldBill:
|
||||
// 加入挂单
|
||||
await addHoldBill();
|
||||
break;
|
||||
case OrderMoreTypeEnum.holdBillList:
|
||||
// 挂单列表
|
||||
await holdBillList();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// 更多 start
|
||||
// **************************************************************************
|
||||
// 加入挂单
|
||||
Future<void> addHoldBill() async {}
|
||||
|
||||
// 挂单列表
|
||||
Future<void> holdBillList() async {}
|
||||
// **************************************************************************
|
||||
// 更多 end
|
||||
// **************************************************************************
|
||||
|
||||
// 分页
|
||||
Future<void> doPage({int? page}) async {
|
||||
EasyLoading.show(
|
||||
|
||||
@@ -283,7 +283,7 @@ class SupermarketOrderPage extends GetView<SupermarketOrderController> {
|
||||
),
|
||||
onPress: () => controller.doPay(),
|
||||
).flexible(flex: 1),
|
||||
SizedBox(width: 20.w),
|
||||
SizedBox(width: 10.w),
|
||||
FButton(
|
||||
style: FButtonStyle.destructive,
|
||||
label: Text(
|
||||
@@ -294,6 +294,15 @@ class SupermarketOrderPage extends GetView<SupermarketOrderController> {
|
||||
),
|
||||
onPress: () => controller.doCancelPay(),
|
||||
).flexible(flex: 1),
|
||||
SizedBox(width: 10.w),
|
||||
FButton(
|
||||
style: FButtonStyle.outline,
|
||||
label: FIcon(
|
||||
FAssets.icons.circleEllipsis,
|
||||
size: theme.typography.xl4.fontSize,
|
||||
),
|
||||
onPress: () => controller.doMore(),
|
||||
),
|
||||
].toRow(mainAxisAlignment: MainAxisAlignment.spaceBetween),
|
||||
].toColumn(),
|
||||
].toColumn().padding(vertical: 10.h, horizontal: 10.w);
|
||||
|
||||
Reference in new issue
Block a user