feat:超市数据库

This commit is contained in:
dzc committed 2025-03-17 12:07:11 +08:00
1 parent 9a98ac8e1c
commit fa4bb78f8b
25 files changed
+307 -185

No files matched your search

+1 -1
View File
@@ -12,5 +12,5 @@ Widget appBack(
return FIcon(
FAssets.icons.chevronLeft,
size: theme.typography.xl4.fontSize,
).alignLeft().width(height).onTap(() => onTap());
).center().width(height).height(height).onTap(() => onTap());
}
-1
View File
@@ -1,4 +1,3 @@
import 'package:common_utils/common_utils.dart';
import 'package:ducafe_ui_core/ducafe_ui_core.dart';
import 'package:flutter/material.dart';
import 'package:forui/forui.dart';
@@ -28,10 +28,7 @@ mixin OrderMixin {
RxList<ClassifyEntity> classifyList = RxList([]);
// 商品
RxList<ProductEntity> productList = RxList([]);
// 商品分类ids
RxList<String> productClassifyList = RxList([]);
RxList<CanteenSpuEntity> productList = RxList([]);
// 总价
RxInt totalPrice = RxInt(0);
@@ -96,7 +93,6 @@ mixin OrderMixin {
_sysType.name,
hourType.value.code,
);
productClassifyList.value = list.map((v) => v.serviceUniqueCode).toList();
list.insert(
0,
ClassifyEntity(
@@ -123,7 +119,7 @@ mixin OrderMixin {
);
productList.value = list;
productList.refresh();
productClassifyList.refresh();
classifyList.refresh();
}
// 创建本地订单
+26 -13
View File
@@ -160,20 +160,33 @@ Widget orderRowClassify(
.map((v) {
final target = classifyList[currentTabIndex];
final active = target.id == v.id;
return FButton(
style: active ? FButtonStyle.primary : FButtonStyle.secondary,
label: Text(
v.name,
textAlign: TextAlign.center,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: theme.typography.xl.copyWith(
return Text(
v.name,
textAlign: TextAlign.center,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: theme.typography.xl2.copyWith(
height: 1,
color: active
? theme.colorScheme.background
: theme.colorScheme.primary,
),
)
.center()
.width(180.w)
.height(60.h)
.decorated(
color: active
? theme.colorScheme.secondary
: theme.colorScheme.primary,
),
).center().width(120.w),
onPress: () {
? theme.colorScheme.primary
: theme.colorScheme.background,
border: Border.all(
color: theme.colorScheme.primary,
width: 1,
),
borderRadius: theme.style.borderRadius / 2,
)
.onTap(
() {
final index = classifyList.indexWhere((i) => i.id == v.id);
onChange(index);
},
@@ -22,7 +22,7 @@ class SteelyardController extends GetxController {
final app = Get.find<AppControl>();
// 称重商品
Rxn<ProductEntity?> _widgetProduct = Rxn(null);
Rxn<CanteenSpuEntity?> _widgetProduct = Rxn(null);
// 重量
RxDouble widget = RxDouble(0);
@@ -65,7 +65,7 @@ class SteelyardController extends GetxController {
}
// 打开称重
bool open(ProductEntity current) {
bool open(CanteenSpuEntity current) {
final isOpen = _openSerial();
if (!isOpen) {
_closeStatus();