diff --git a/lib/common/widgets/app/app_price.dart b/lib/common/widgets/app/app_price.dart index 49a1c60..079947c 100644 --- a/lib/common/widgets/app/app_price.dart +++ b/lib/common/widgets/app/app_price.dart @@ -2,8 +2,13 @@ import 'package:ducafe_ui_core/ducafe_ui_core.dart'; import 'package:flutter/material.dart'; import 'package:forui/forui.dart'; -Widget appPrice(BuildContext context, dynamic price) { +Widget appPrice( + BuildContext context, + dynamic price, { + TextStyle? textStyle, +}) { final theme = FTheme.of(context); + textStyle ??= theme.typography.xl; double? priceNum = price is double ? price : double.tryParse( @@ -21,7 +26,7 @@ Widget appPrice(BuildContext context, dynamic price) { ), Text( priceNum.toStringAsFixed(2), - style: theme.typography.xl.copyWith( + style: textStyle.copyWith( color: theme.colorScheme.error, height: 1, ), diff --git a/lib/common/widgets/order/order_common.dart b/lib/common/widgets/order/order_common.dart index 3c0f333..36f262d 100644 --- a/lib/common/widgets/order/order_common.dart +++ b/lib/common/widgets/order/order_common.dart @@ -68,6 +68,7 @@ Widget orderSelectPanel( int total = 1, double widget = 0, num price = 0, + num totalPrice = 0, int index = 0, double height = 50, showPlus = false, @@ -153,11 +154,21 @@ Widget orderSelectPanel( } }, ), - Text( - "${widget.toString()}/kg", - style: theme.typography.base.copyWith(height: 1), - textAlign: TextAlign.center, - ).center().width(textWidth.w).height(double.infinity).decorated( + [ + Text( + "${widget.toString()}/kg", + style: theme.typography.sm.copyWith(height: 1), + textAlign: TextAlign.center, + ), + appPrice(context, totalPrice, textStyle: theme.typography.sm), + ] + .toColumn( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + ) + .width(textWidth.w) + .height(double.infinity) + .decorated( color: theme.colorScheme.secondary, borderRadius: theme.style.borderRadius / 2, ), diff --git a/lib/pages/setting/widgets/setting_face.dart b/lib/pages/setting/widgets/setting_face.dart index 9aed654..b6d0549 100644 --- a/lib/pages/setting/widgets/setting_face.dart +++ b/lib/pages/setting/widgets/setting_face.dart @@ -150,6 +150,7 @@ class FaceManageController extends GetxController { }); } + /// 搜索 Future doPage({int? page}) async { if (page != null) currentPage.value = page; // 收起键盘 @@ -157,6 +158,15 @@ class FaceManageController extends GetxController { await getFaceList(isLoading: true); } + /// 重置 + Future doReset() async { + currentPage.value = 1; + usernameC.clear(); + // 收起键盘 + FocusManager.instance.primaryFocus?.unfocus(); + await getFaceList(isLoading: true); + } + // 删除人脸 Future deleteFace(FaceEntity v) async { final isSure = await appMessageDialog(Get.context!, "是否删除人脸"); @@ -199,9 +209,27 @@ Widget buildFaceSearch(BuildContext context) { controller: faceC.usernameC, hint: '请输入姓名', maxLines: 1, + onSubmit: (_) => faceC.doPage(), ), ).width(300.w), FButton( + prefix: FIcon( + FAssets.icons.ban, + size: theme.typography.base.fontSize, + ), + label: Text( + '重置', + style: theme.typography.base.copyWith( + color: theme.colorScheme.secondary, + ), + ), + onPress: () => faceC.doReset(), + ), + FButton( + prefix: FIcon( + FAssets.icons.search, + size: theme.typography.base.fontSize, + ), label: Text( '搜索', style: theme.typography.base.copyWith( diff --git a/lib/pages/setting/widgets/setting_product.dart b/lib/pages/setting/widgets/setting_product.dart index ba6c834..0b7a171 100644 --- a/lib/pages/setting/widgets/setting_product.dart +++ b/lib/pages/setting/widgets/setting_product.dart @@ -103,7 +103,7 @@ class ProductManageController extends GetxController { final findCount = await supermarketSpuDao.getCount("-1", "-1"); totalPage.value = findCount ?? 0; final list = await supermarketSpuDao.getAllPage( - "-1", + selfCodeC.text, "-1", pageSize.value, (currentPage.value - 1) * pageSize.value, @@ -199,6 +199,7 @@ Widget _buildSearch(BuildContext context) { controller: productC.selfCodeC, hint: '请输入自编码/商品名', maxLines: 1, + onSubmit: (_) => productC.doPage(), ).offstage( offstage: productC.sysType.value != SysType.SUPERMARKET, ), diff --git a/lib/pages/supermarket_order/view.dart b/lib/pages/supermarket_order/view.dart index a1b89f7..d780645 100644 --- a/lib/pages/supermarket_order/view.dart +++ b/lib/pages/supermarket_order/view.dart @@ -42,6 +42,7 @@ class SupermarketOrderPage extends GetView { focusNode: controller.focusNode, hint: '请输入自编码/商品名', maxLines: 1, + onSubmit: (_) => controller.doPage(), ).width(300.w), FButton( prefix: FIcon( @@ -242,6 +243,7 @@ class SupermarketOrderPage extends GetView { Get.context!, label: current.productName, price: current.productPrice, + totalPrice: current.totalPrice, widget: current.productWidget, total: current.productNumber, index: index,