feat:超市商品管理

This commit is contained in:
dzc committed 2025-03-17 20:45:04 +08:00
1 parent d0ecbfbc53
commit e7c2fcd733
17 files changed
+297 -99

No files matched your search

+2 -2
View File
@@ -26,7 +26,7 @@ Widget appNetworkImg(
FAssets.icons.globeLock,
color: theme.colorScheme.error,
size: theme.typography.base.fontSize,
).width(imgWidth * 0.5).height(imgHeight * 0.5);
).center().width(imgWidth).height(imgWidth);
},
);
}
@@ -49,7 +49,7 @@ Widget appFileImg(
FAssets.icons.globeLock,
color: theme.colorScheme.error,
size: theme.typography.base.fontSize,
).width(imgWidth * 0.5).height(imgHeight * 0.5);
).center().width(imgWidth).height(imgHeight);
},
);
}
+3 -1
View File
@@ -20,7 +20,9 @@ export './card/card_common.dart';
export './order/mixin/order_mixin.dart';
export './order/select_pay_type_dialog.dart';
export './order/steelyard_container.dart';
export 'order/order_common.dart';
export './order/order_caneen_common.dart';
export './order/order_common.dart';
export './order/order_supermarket_common.dart';
export './setting/setting_password_dialog.dart';
@@ -0,0 +1,30 @@
import 'package:ducafe_ui_core/ducafe_ui_core.dart';
import 'package:flutter/material.dart';
import 'package:forui/forui.dart';
import 'package:pj_supermarket_cloud/common/index.dart';
/// 商品卡片
Widget orderCaneenSpuCard(
BuildContext context, {
String? image = "",
String name = "",
num price = 0.0,
}) {
final theme = FTheme.of(context);
return FCard(
style: theme.cardStyle.copyWith(
contentStyle: theme.cardStyle.contentStyle.copyWith(
padding: EdgeInsets.all(0),
),
),
image: appImg(image, width: double.infinity, height: 150.h),
subtitle: <Widget>[
Text(name, style: theme.typography.lg),
SizedBox(height: 5.h),
appPrice(context, price),
]
.toColumn(crossAxisAlignment: CrossAxisAlignment.center)
.width(double.infinity),
).width(double.infinity);
}
@@ -4,31 +4,6 @@ import 'package:forui/forui.dart';
import 'package:pj_supermarket_cloud/common/index.dart';
/// 商品卡片
Widget orderProductCard(
BuildContext context, {
String? image = "",
String name = "",
num price = 0.0,
}) {
final theme = FTheme.of(context);
return FCard(
style: theme.cardStyle.copyWith(
contentStyle: theme.cardStyle.contentStyle.copyWith(
padding: EdgeInsets.all(0),
),
),
image: appImg(image, width: double.infinity, height: 150.h),
subtitle: <Widget>[
Text(name, style: theme.typography.lg),
SizedBox(height: 5.h),
appPrice(context, price),
]
.toColumn(crossAxisAlignment: CrossAxisAlignment.center)
.width(double.infinity),
).width(double.infinity);
}
/// 菜品总价
/// 额外支付
/// 实际扣款
@@ -0,0 +1,61 @@
import 'package:ducafe_ui_core/ducafe_ui_core.dart';
import 'package:flutter/material.dart';
import 'package:forui/forui.dart';
import 'package:pj_supermarket_cloud/common/index.dart';
Widget orderSupermarketSpuCard(
BuildContext context, {
required SupermarketSpuEntity supermarketSpu,
}) {
final theme = FTheme.of(context);
final textStyle = theme.typography.sm.copyWith(
color: theme.colorScheme.primary,
);
return FCard(
style: theme.cardStyle.copyWith(
contentStyle: theme.cardStyle.contentStyle.copyWith(
padding: EdgeInsets.all(0),
),
),
image: appImg(supermarketSpu.picUrl, width: double.infinity, height: 100.h),
subtitle: <Widget>[
Text(supermarketSpu.productName, style: theme.typography.xl),
SizedBox(height: 5.h),
FBadge(
style: FBadgeStyle.secondary,
label: Text(
supermarketSpu.productNature.title,
style: textStyle,
),
),
<Widget>[
Text("零售价:", style: textStyle),
appPrice(context, supermarketSpu.retailPrice),
].toRow(mainAxisAlignment: MainAxisAlignment.center),
<Widget>[
Text("促销价:", style: textStyle),
appPrice(context, supermarketSpu.promotionPrice),
].toRow(mainAxisAlignment: MainAxisAlignment.center),
<Widget>[
Text("货号:", style: textStyle),
Text(supermarketSpu.productCode, style: textStyle),
].toRow(mainAxisAlignment: MainAxisAlignment.center),
<Widget>[
Text("辅助条码:", style: textStyle),
Text(supermarketSpu.barCode ?? "", style: textStyle),
].toRow(mainAxisAlignment: MainAxisAlignment.center),
<Widget>[
Text("包装单位:", style: textStyle),
Text("${supermarketSpu.packageNum}", style: textStyle),
Text("/"),
Text(supermarketSpu.unit, style: textStyle),
].toRow(mainAxisAlignment: MainAxisAlignment.center),
]
.toColumn(
crossAxisAlignment: CrossAxisAlignment.center,
)
.padding(horizontal: 10.w)
.width(double.infinity),
).width(double.infinity);
}