feat:交易记录、日期组建
This commit is contained in:
1 parent
08ad1c2d81
commit
88e73ad950
32 files changed
+672
-279
No files matched your search
@@ -13,6 +13,7 @@ Widget settingBackup(BuildContext context) {
|
||||
final sys = controller.sysSetting.value;
|
||||
if (sys == null) return const SizedBox.shrink();
|
||||
return <Widget>[
|
||||
appDividerTitle(context, "备份"),
|
||||
FTile(
|
||||
prefixIcon: appPrefixIcon(context, FAssets.icons.user),
|
||||
suffixIcon: appSuffixIcon(context, FAssets.icons.files),
|
||||
@@ -32,6 +33,13 @@ Widget settingBackup(BuildContext context) {
|
||||
title: appPrefixTitle(context, "log备份"),
|
||||
onPress: () => controller.backupsLog(),
|
||||
),
|
||||
appDividerTitle(context, "恢复"),
|
||||
FTile(
|
||||
prefixIcon: appPrefixIcon(context, FAssets.icons.user),
|
||||
suffixIcon: appSuffixIcon(context, FAssets.icons.folderSync),
|
||||
title: appPrefixTitle(context, "sql恢复"),
|
||||
onPress: () => controller.recoverSql(),
|
||||
),
|
||||
].toColumnSpace(space: 20.h);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -14,26 +14,21 @@ Widget settingPay(BuildContext context) {
|
||||
final sys = controller.sysSetting.value;
|
||||
if (sys == null) return const SizedBox.shrink();
|
||||
return <Widget>[
|
||||
FSelectMenuTile.builder(
|
||||
FSelectMenuTile(
|
||||
groupController: controller.globalPayTableC,
|
||||
validator: (value) => value == null ? '请选择' : null,
|
||||
autoHide: true,
|
||||
prefixIcon: appPrefixIcon(context, FAssets.icons.settings),
|
||||
suffixIcon: appSuffixIcon(context, FAssets.icons.audioLines),
|
||||
title: appPrefixTitle(context, "使用支付方式"),
|
||||
menuTileBuilder: (context, index) {
|
||||
if (index >= OrderPayDisplayType.values.length) {
|
||||
return null;
|
||||
}
|
||||
final type = OrderPayDisplayType.values[index];
|
||||
menu: OrderPayDisplayType.values.map((v) {
|
||||
return FSelectTile(
|
||||
title: Text(
|
||||
type.title,
|
||||
v.title,
|
||||
style: theme.typography.xl,
|
||||
),
|
||||
value: type.code,
|
||||
value: v.code,
|
||||
);
|
||||
},
|
||||
}).toList(),
|
||||
details: ListenableBuilder(
|
||||
listenable: controller.globalPayTableC,
|
||||
builder: (context, _) {
|
||||
|
||||
@@ -70,10 +70,8 @@ class ProductManageController extends GetxController {
|
||||
sysType,
|
||||
currnetHourType,
|
||||
);
|
||||
if (findCount != null) {
|
||||
totalPage.value = (findCount / pageSize.value).ceil();
|
||||
}
|
||||
final list = await productDao.getCurrentDayAllPage(
|
||||
if (findCount != null) totalPage.value = findCount;
|
||||
final list = await productDao.getAllPage(
|
||||
"-1",
|
||||
currnetHourType,
|
||||
sysType,
|
||||
@@ -101,7 +99,7 @@ class ProductManageController extends GetxController {
|
||||
try {
|
||||
final isSure = await appMessageDialog(
|
||||
Get.context!,
|
||||
"是否${v.isDefault ? '设置为' : '取消'}默认菜品",
|
||||
"是否${v.isDefault ? '取消' : '设置为'}默认菜品",
|
||||
);
|
||||
if (!isSure) return;
|
||||
EasyLoading.show(
|
||||
@@ -151,58 +149,57 @@ Widget buildSearch(BuildContext context) {
|
||||
Widget buildList(BuildContext context) {
|
||||
final theme = FTheme.of(context);
|
||||
final productC = Get.find<ProductManageController>();
|
||||
return GridView.builder(
|
||||
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 8,
|
||||
mainAxisSpacing: 10.w,
|
||||
crossAxisSpacing: 10.w,
|
||||
childAspectRatio: 0.7,
|
||||
),
|
||||
itemCount: productC.productList.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
final v = productC.productList[index];
|
||||
return FCard(
|
||||
style: theme.cardStyle.copyWith(
|
||||
contentStyle: theme.cardStyle.contentStyle.copyWith(
|
||||
padding: EdgeInsets.all(0),
|
||||
return Obx(
|
||||
() => GridView.builder(
|
||||
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 8,
|
||||
mainAxisSpacing: 10.w,
|
||||
crossAxisSpacing: 10.w,
|
||||
childAspectRatio: 0.7,
|
||||
),
|
||||
itemCount: productC.productList.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
final v = productC.productList[index];
|
||||
return FCard(
|
||||
style: theme.cardStyle.copyWith(
|
||||
contentStyle: theme.cardStyle.contentStyle.copyWith(
|
||||
padding: EdgeInsets.all(0),
|
||||
),
|
||||
),
|
||||
),
|
||||
image: appImg(v.image, width: double.infinity, height: 120.h),
|
||||
title: Text(v.name, maxLines: 2, style: theme.typography.base).center(),
|
||||
subtitle: appPrice(context, v.price.toString())
|
||||
.center()
|
||||
.paddingOnly(top: 10.h),
|
||||
child: <Widget>[
|
||||
Text("是否默认", style: theme.typography.sm),
|
||||
FSwitch(
|
||||
value: v.isDefault,
|
||||
onChange: (value) => productC.trigger(v),
|
||||
)
|
||||
].toRow(mainAxisAlignment: MainAxisAlignment.center),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/// 分页
|
||||
Widget buildPage(BuildContext context) {
|
||||
final productC = Get.find<ProductManageController>();
|
||||
return appPage(
|
||||
context,
|
||||
pageNo: productC.currentPage.value,
|
||||
pageSize: productC.pageSize.value,
|
||||
total: productC.totalPage.value * productC.pageSize.value,
|
||||
onPageChanged: (pageNo) => productC.doPage(page: pageNo),
|
||||
image: appImg(v.image, width: double.infinity, height: 120.h),
|
||||
title:
|
||||
Text(v.name, maxLines: 2, style: theme.typography.base).center(),
|
||||
subtitle: appPrice(context, v.price.toString())
|
||||
.center()
|
||||
.paddingOnly(top: 10.h),
|
||||
child: <Widget>[
|
||||
Text("是否默认", style: theme.typography.sm),
|
||||
FSwitch(
|
||||
value: v.isDefault,
|
||||
onChange: (value) => productC.trigger(v),
|
||||
)
|
||||
].toRow(mainAxisAlignment: MainAxisAlignment.center),
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget settingProduct(BuildContext context) {
|
||||
Get.put<ProductManageController>(
|
||||
final productC = Get.put<ProductManageController>(
|
||||
ProductManageController(),
|
||||
);
|
||||
return <Widget>[
|
||||
buildSearch(context),
|
||||
buildList(context).expanded(),
|
||||
buildPage(context),
|
||||
Obx(
|
||||
() => appPage(
|
||||
context,
|
||||
pageNo: productC.currentPage.value,
|
||||
pageSize: productC.pageSize.value,
|
||||
total: productC.totalPage.value,
|
||||
onPageChanged: (pageNo) => productC.doPage(page: pageNo),
|
||||
),
|
||||
),
|
||||
].toColumnSpace(space: 10.h);
|
||||
}
|
||||
Reference in new issue
Block a user