Authored by yyq

round

... ... @@ -4,8 +4,8 @@
<view class="item-detail">
<text class="item-title">{{item.productName}}</text>
<view class="item-price">
<text class="price1" style="color:{{item.showOriginPrice ? '#d0021b' : '#444444'}}">¥{{item.salePriceStr}}</text>
<text class="price2" wx:if="{{item.showOriginPrice}}">¥{{item.originPriceStr}}</text>
<text class="price1" style="color:{{item.showOriginPrice ? '#d0021b' : '#444444'}}">¥{{helper.round(item.salePriceStr)}}</text>
<text class="price2" wx:if="{{item.showOriginPrice}}">¥{{helper.round(item.originPriceStr)}}</text>
</view>
</view>
</view>
... ...
... ... @@ -63,7 +63,7 @@ function image(imgUrl, w, h, mode, q) {
function round(num, precision) {
num = +num;
if(!num || isNaN(num)){
if(num !== 0 && (!num || isNaN(num))){
return '';
}
... ...