diff --git a/app.json b/app.json
index aede080..05550ab 100644
--- a/app.json
+++ b/app.json
@@ -24,7 +24,8 @@
"pages/company/company",
"pages/qrcode/index",
"pages/collection/index",
- "pages/freight-calculator/index"
+ "pages/freight-calculator/index",
+ "pages/compare_price/index"
],
"subpackages": [
{
diff --git a/pages/compare_price/index.js b/pages/compare_price/index.js
index 87fdd97..060abbe 100644
--- a/pages/compare_price/index.js
+++ b/pages/compare_price/index.js
@@ -365,6 +365,11 @@ Page({
item.totalStock = displayStock;
item.originalTotalStock = totalStock;
+ // 添加当前对比的规格信息
+ if (specWeight) {
+ item.currentSpec = specWeight;
+ }
+
// 处理地区信息,只显示省份
if (item.region) {
// 提取省份信息
diff --git a/pages/compare_price/index.wxml b/pages/compare_price/index.wxml
index 63529e9..ed9e77d 100644
--- a/pages/compare_price/index.wxml
+++ b/pages/compare_price/index.wxml
@@ -8,7 +8,7 @@
✓
- 您已完成选择,以下是{{currentGoods ? currentGoods.productName : '商品'}}({{selectedSpec || '43-44g'}})的价格对比结果
+ 您已完成选择,以下是{{currentGoods ? (currentGoods.productName || currentGoods.name) : '商品'}}({{selectedSpec || '43-44g'}})的价格对比结果
@@ -28,7 +28,7 @@
- {{item.specification || (item.processedSpecs && item.processedSpecs.length > 0 ? item.processedSpecs.join(' | ') : '净重:45-50g')}} | 蛋壳:{{item.category || '绿壳'}} | 蛋黄:{{item.yolk || '无'}}
+ {{item.currentSpec || item.specification || (item.processedSpecs && item.processedSpecs.length > 0 ? item.processedSpecs.join(' | ') : '净重:45-50g')}} | {{item.category || '绿壳'}} | {{item.yolk || '无'}} | 库存:{{item.totalStock || '450'}}