Sfoglia il codice sorgente

判断老价格是否大于新价格

xiaohaizhao 3 mesi fa
parent
commit
2d134eae52

+ 1 - 0
packageA/orderForm/modules/product/index.js

@@ -61,6 +61,7 @@ Component({
                     } catch (error) {
 
                     }
+                    v.isShowOldPrice = v.marketprice > v.defaultprice
                     v.defaultprice = CNY(v.defaultprice)
                     v.marketprice = CNY(v.marketprice)
                     v.defaultamount = CNY(v.defaultamount)

+ 1 - 1
packageA/orderForm/modules/product/list/index.wxml

@@ -29,7 +29,7 @@
                 </view>
                 <view style="margin-top: 8rpx;">
                     <text class="price">{{item.defaultprice}}{{language['元']||'元'}}</text>
-                    <text class="old-price">{{item.marketprice}}{{language['元']||'元'}}</text>
+                    <text class="old-price" wx:if="{{item.isShowOldPrice}}">{{item.marketprice}}{{language['元']||'元'}}</text>
                 </view>
             </view>
             <view wx:if="{{!disabled}}" class="delete" data-item="{{item}}" catchtap="deleteProduct">