Compare commits

...

2 Commits

  1. 3
      app.json
  2. 5
      pages/compare_price/index.js
  3. 6
      pages/compare_price/index.wxml

3
app.json

@ -24,7 +24,8 @@
"pages/company/company", "pages/company/company",
"pages/qrcode/index", "pages/qrcode/index",
"pages/collection/index", "pages/collection/index",
"pages/freight-calculator/index" "pages/freight-calculator/index",
"pages/compare_price/index"
], ],
"subpackages": [ "subpackages": [
{ {

5
pages/compare_price/index.js

@ -365,6 +365,11 @@ Page({
item.totalStock = displayStock; item.totalStock = displayStock;
item.originalTotalStock = totalStock; item.originalTotalStock = totalStock;
// 添加当前对比的规格信息
if (specWeight) {
item.currentSpec = specWeight;
}
// 处理地区信息,只显示省份 // 处理地区信息,只显示省份
if (item.region) { if (item.region) {
// 提取省份信息 // 提取省份信息

6
pages/compare_price/index.wxml

@ -8,7 +8,7 @@
<view class="tips-icon"> <view class="tips-icon">
<text class="check-icon">✓</text> <text class="check-icon">✓</text>
</view> </view>
<text class="tips-text">您已完成选择,以下是{{currentGoods ? currentGoods.productName : '商品'}}({{selectedSpec || '43-44g'}})的价格对比结果</text> <text class="tips-text">您已完成选择,以下是{{currentGoods ? (currentGoods.productName || currentGoods.name) : '商品'}}({{selectedSpec || '43-44g'}})的价格对比结果</text>
</view> </view>
</view> </view>
@ -28,7 +28,7 @@
<view class="current-goods-card"> <view class="current-goods-card">
<view class="goods-header"> <view class="goods-header">
<view class="brand-tag">品牌</view> <view class="brand-tag">品牌</view>
<text class="goods-name">{{currentGoods.productName}}</text> <text class="goods-name">{{currentGoods.productName || currentGoods.name || '商品'}}</text>
<view class="price-container"> <view class="price-container">
<text class="currency-symbol" style="color: {{currentGoods.priceDiff > 0 ? '#FF4D4F' : currentGoods.priceDiff < 0 ? '#10B981' : '#666666'}}">¥</text> <text class="currency-symbol" style="color: {{currentGoods.priceDiff > 0 ? '#FF4D4F' : currentGoods.priceDiff < 0 ? '#10B981' : '#666666'}}">¥</text>
<text class="price-amount" style="color: {{currentGoods.priceDiff > 0 ? '#FF4D4F' : currentGoods.priceDiff < 0 ? '#10B981' : '#666666'}}">{{currentGoods.price}}</text> <text class="price-amount" style="color: {{currentGoods.priceDiff > 0 ? '#FF4D4F' : currentGoods.priceDiff < 0 ? '#10B981' : '#666666'}}">{{currentGoods.price}}</text>
@ -73,7 +73,7 @@
<text class="compare-price-amount" style="color: {{item.priceDiff > 0 ? '#FF4D4F' : item.priceDiff < 0 ? '#10B981' : '#666666'}}">{{item.price}}</text> <text class="compare-price-amount" style="color: {{item.priceDiff > 0 ? '#FF4D4F' : item.priceDiff < 0 ? '#10B981' : '#666666'}}">{{item.price}}</text>
</view> </view>
</view> </view>
<text class="compare-item-spec">{{item.specification || (item.processedSpecs && item.processedSpecs.length > 0 ? item.processedSpecs.join(' | ') : '净重:45-50g')}} | 蛋壳:{{item.category || '绿壳'}} | 蛋黄:{{item.yolk || '无'}}</text> <text class="compare-item-spec">{{item.currentSpec || item.specification || (item.processedSpecs && item.processedSpecs.length > 0 ? item.processedSpecs.join(' | ') : '净重:45-50g')}} | {{item.category || '绿壳'}} | {{item.yolk || '无'}} | 库存:{{item.totalStock || '450'}}</text>
<view class="compare-item-footer"> <view class="compare-item-footer">
<view class="merchant-region"> <view class="merchant-region">
<text class="compare-item-merchant">🏪 {{item.sourceType || '生态农场'}}</text> <text class="compare-item-merchant">🏪 {{item.sourceType || '生态农场'}}</text>

Loading…
Cancel
Save