Browse Source

调整对比商品卡片展示数据

main
Trae AI 3 days ago
parent
commit
339c155ce6
  1. 2
      pages/compare_price/index.js
  2. 5
      pages/compare_price/index.wxml
  3. 5
      pages/compare_price/index.wxss
  4. 2
      pages/profile/index.wxml

2
pages/compare_price/index.js

@ -692,7 +692,7 @@ Page({
if (!isNaN(currentPrice) && !isNaN(itemPrice)) {
const priceDiff = itemPrice - currentPrice;
const pricePercent = ((priceDiff / currentPrice) * 100).toFixed(1);
item.priceDiff = priceDiff;
item.priceDiff = parseFloat(priceDiff.toFixed(1));
item.pricePercent = pricePercent;
}
}

5
pages/compare_price/index.wxml

@ -75,10 +75,6 @@
<view class="section-title">
<text class="title-icon">⚖</text>
<text class="title-text">同类商品价格对比</text>
<view class="filter-btn">
<text class="filter-text">筛选</text>
<text class="filter-icon">☰</text>
</view>
</view>
<view class="compare-list">
<view
@ -108,6 +104,7 @@
<view class="price-comparison" wx:if="{{item.pricePercent}}">
<text class="price-trend-icon" style="color: {{item.priceDiff > 0 ? '#EF4444' : item.priceDiff < 0 ? '#10B981' : '#666666'}}">{{item.priceDiff > 0 ? '↑' : item.priceDiff < 0 ? '↓' : '→'}}</text>
<text class="price-trend-text" style="color: {{item.priceDiff > 0 ? '#FF4D4F' : item.priceDiff < 0 ? '#10B981' : '#666666'}}">{{item.priceDiff > 0 ? '+' : ''}}{{item.pricePercent}}%</text>
<text wx:if="{{item.priceDiff < 0}}" class="price-save" style="color: #10B981; margin-left: 8px;">省¥{{-item.priceDiff}}</text>
</view>
</view>
</view>

5
pages/compare_price/index.wxss

@ -533,6 +533,11 @@
color: #FF4D4F;
}
.price-save {
font-size: 12px;
font-weight: 500;
}
/* 价格趋势图 */
.trend-section {
margin-bottom: 20px;

2
pages/profile/index.wxml

@ -106,7 +106,7 @@
<view class="title">系统信息</view>
<view style="padding: 20rpx 0;">
<view style="font-size: 26rpx; color: #333; margin-bottom: 16rpx;">
当前版本:{{versionInfo.version || '2.6.231'}}
当前版本:{{versionInfo.version || '2.6.232'}}
</view>
<view style="font-size: 26rpx; color: #333; margin-bottom: 16rpx;">
上次更新:{{versionInfo.lastUpdate || '2026-03-03'}}

Loading…
Cancel
Save