diff --git a/美国版/Food Labeling Management App UniApp/src/components/AppIcon.vue b/美国版/Food Labeling Management App UniApp/src/components/AppIcon.vue index 4ed8f61..b544b6c 100644 --- a/美国版/Food Labeling Management App UniApp/src/components/AppIcon.vue +++ b/美国版/Food Labeling Management App UniApp/src/components/AppIcon.vue @@ -53,6 +53,8 @@ const icons: Record = { lock: '', chevronDown: '', chevronUp: '', + squares: '', + list: '', } const svgContent = computed(() => icons[props.name] || icons.food) diff --git a/美国版/Food Labeling Management App UniApp/src/locales/en.ts b/美国版/Food Labeling Management App UniApp/src/locales/en.ts index 3b44c80..1e5d3e0 100644 --- a/美国版/Food Labeling Management App UniApp/src/locales/en.ts +++ b/美国版/Food Labeling Management App UniApp/src/locales/en.ts @@ -4,7 +4,7 @@ export default { appName: 'Food Label System', employeePortal: 'Employee Portal', email: 'Email', - emailPlaceholder: 'your.email@company.com', + emailPlaceholder: "your.email{'@'}company.com", password: 'Password', passwordPlaceholder: 'Enter your password', rememberMe: 'Remember me', diff --git a/美国版/Food Labeling Management App UniApp/src/locales/zh.ts b/美国版/Food Labeling Management App UniApp/src/locales/zh.ts index 208150d..dcb06e6 100644 --- a/美国版/Food Labeling Management App UniApp/src/locales/zh.ts +++ b/美国版/Food Labeling Management App UniApp/src/locales/zh.ts @@ -4,7 +4,7 @@ export default { appName: '食品标签系统', employeePortal: '员工门户', email: '电子邮件', - emailPlaceholder: 'your.email@company.com', + emailPlaceholder: "your.email{'@'}company.com", password: '密码', passwordPlaceholder: '输入您的密码', rememberMe: '记住我', diff --git a/美国版/Food Labeling Management App UniApp/src/pages/labels/labels.vue b/美国版/Food Labeling Management App UniApp/src/pages/labels/labels.vue index eb97d31..01906fc 100644 --- a/美国版/Food Labeling Management App UniApp/src/pages/labels/labels.vue +++ b/美国版/Food Labeling Management App UniApp/src/pages/labels/labels.vue @@ -103,7 +103,7 @@ {{ product.labelTypes.length }} Types - {{ product.name }} + {{ getDisplayName(product) }} {{ product.templateName }} @@ -117,7 +117,7 @@ Select Label Type - {{ selectedProduct ? selectedProduct.name : '' }} + {{ selectedProduct ? getDisplayName(selectedProduct) : '' }} = { ], } +// 按详情页规则:chicken→Chicken,2"x6"/2"x4"→Cheese Burger Deluxe,其余→Syrup(图片仍用产品图) +function getDisplayName(product: Product): string { + if (product.id === 'chicken') return 'Chicken' + const size = product.templateSize || '' + if (size.indexOf('2"x6"') >= 0 || size.indexOf('2"x4"') >= 0) return 'Cheese Burger Deluxe' + return 'Syrup' +} + const filteredProductCategories = computed(() => { const cats = productCategoriesByLabel[selectedCategory.value] || [] const s = searchTerm.value.toLowerCase() @@ -405,7 +413,8 @@ const filteredProductCategories = computed(() => { return { ...cat, products: cat.products.filter(function (p) { - return p.name.toLowerCase().indexOf(s) >= 0 + const displayName = getDisplayName(p) + return p.name.toLowerCase().indexOf(s) >= 0 || displayName.toLowerCase().indexOf(s) >= 0 }), } }) diff --git a/美国版/Food Labeling Management App UniApp/src/pages/labels/preview.vue b/美国版/Food Labeling Management App UniApp/src/pages/labels/preview.vue index 157bfd5..59b57df 100644 --- a/美国版/Food Labeling Management App UniApp/src/pages/labels/preview.vue +++ b/美国版/Food Labeling Management App UniApp/src/pages/labels/preview.vue @@ -54,6 +54,10 @@ + Label ID + {{ labelId }} + + Last Edited {{ lastEdited }} @@ -94,6 +98,10 @@ + + Label ID + {{ labelId }} + @@ -109,6 +117,8 @@ import AppIcon from '../../components/AppIcon.vue' import SideMenu from '../../components/SideMenu.vue' import LocationPicker from '../../components/LocationPicker.vue' import { getStatusBarHeight } from '../../utils/statusBar' +import { generateNextLabelId } from '../../utils/printLog' +import chickenLabelImg from '../../static/chicken-lable.png' const statusBarHeight = getStatusBarHeight() const isPrinting = ref(false) @@ -119,6 +129,7 @@ const showPreviewModal = ref(false) const btConnected = ref(false) const btDeviceName = ref('') +const productId = ref('chicken') const productName = ref('Chicken') const productCategory = ref('Meat') const labelTypeName = ref('') @@ -126,8 +137,12 @@ const templateSize = ref('2"x2"') const templateName = ref('Basic') const lastEdited = ref('2025.12.03 11:45') const locationName = ref('Location A') +const labelId = ref('') const labelImage = computed(() => { + if (productId.value === 'chicken') { + return chickenLabelImg + } const size = templateSize.value if (size.indexOf('2"x6"') >= 0 || size.indexOf('2"x4"') >= 0) { return '/static/lable2.png' @@ -135,10 +150,13 @@ const labelImage = computed(() => { return '/static/lable1.png' }) -// 产品名称按标签模板固定:lable1 → Syrup,lable2 → Cheese Burger Deluxe -const displayProductName = computed(() => - labelImage.value.includes('lable1') ? 'Syrup' : 'Cheese Burger Deluxe' -) +// 按详情规则与产品列表一致:chicken→Chicken,lable2→Cheese Burger Deluxe,lable1→Syrup +const displayProductName = computed(() => { + if (productId.value === 'chicken') return 'Chicken' + const size = templateSize.value + if (size.indexOf('2"x6"') >= 0 || size.indexOf('2"x4"') >= 0) return 'Cheese Burger Deluxe' + return 'Syrup' +}) onShow(() => { const name = uni.getStorageSync('btDeviceName') @@ -178,6 +196,7 @@ onLoad((opts: any) => { const product = productMap[pid] if (product) { + productId.value = pid productName.value = product.name productCategory.value = product.category templateSize.value = product.templateSize @@ -194,6 +213,7 @@ onLoad((opts: any) => { const storeId = uni.getStorageSync('storeId') || '001' locationName.value = 'Location A' + labelId.value = generateNextLabelId() }) const increment = () => { if (printQty.value < 99) printQty.value++ } @@ -442,18 +462,22 @@ const handlePrint = () => { .info-row { display: flex; - gap: 16rpx; margin-bottom: 24rpx; } .info-item { flex: 1; + min-width: 0; background: #fff; padding: 20rpx 24rpx; border-radius: 16rpx; box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.04); } +.info-item + .info-item { + margin-left: 10rpx; +} + .info-label { font-size: 22rpx; color: #9ca3af; @@ -614,6 +638,28 @@ const handlePrint = () => { padding: 24rpx; } +.modal-label-id { + margin-top: 20rpx; + padding-top: 20rpx; + border-top: 1rpx solid #e5e7eb; + display: flex; + align-items: center; + justify-content: space-between; + gap: 16rpx; +} + +.modal-label-id-label { + font-size: 26rpx; + color: #6b7280; + font-weight: 500; +} + +.modal-label-id-value { + font-size: 28rpx; + color: #111827; + font-weight: 600; +} + .modal-top { display: flex; justify-content: space-between; diff --git a/美国版/Food Labeling Management App UniApp/src/pages/login/login.vue b/美国版/Food Labeling Management App UniApp/src/pages/login/login.vue index 6b3459c..350a3fc 100644 --- a/美国版/Food Labeling Management App UniApp/src/pages/login/login.vue +++ b/美国版/Food Labeling Management App UniApp/src/pages/login/login.vue @@ -1,6 +1,6 @@