diff --git a/src/pages.json b/src/pages.json
index 0b7d0b6..b245b37 100644
--- a/src/pages.json
+++ b/src/pages.json
@@ -30,6 +30,12 @@
"navigationBarTitleText": "选择商品"
}
},
+ {
+ "path": "pages/product/detail",
+ "style": {
+ "navigationBarTitleText": "商品详情"
+ }
+ },
{
"path": "pages/order/create",
"style": {
diff --git a/src/pages/product/detail.vue b/src/pages/product/detail.vue
new file mode 100644
index 0000000..92bd6ae
--- /dev/null
+++ b/src/pages/product/detail.vue
@@ -0,0 +1,250 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ ¥{{ product.price }}
+ /{{ product.unit }}
+
+ {{ product.name }}
+ 规格: {{ product.spec || '-' }}
+
+
+
+
+
+
+
+ 商品分类
+ {{ categoryName }}
+
+
+ 商品编码
+ {{ product.productId }}
+
+
+ 成本价
+ ¥{{ product.costPrice || '-' }}
+
+
+ 库存预警
+ {{ product.stockAlert || '-' }}
+
+
+ 当前库存
+ {{ stock }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/pages/product/list.vue b/src/pages/product/list.vue
index 71046a1..c21b19c 100644
--- a/src/pages/product/list.vue
+++ b/src/pages/product/list.vue
@@ -154,7 +154,9 @@ export default {
this.loadProducts()
},
viewDetail(item) {
- uni.showToast({ title: '商品详情开发中', icon: 'none' })
+ uni.navigateTo({
+ url: `/pages/product/detail?productId=${item.productId}`
+ })
},
getStock(productId) {
return this.stocks[productId] || 0