Authored by 沈志敏

tofixed

... ... @@ -104,6 +104,13 @@ Vue.filter('convertOrderState', (value) => {
return stateTxt;
});
Vue.filter('toFixed', (value, num) => {
if (typeof value === 'undefined') {
return;
}
return Number(value).toFixed(num || 2);
});
/**
* 转换时间
* yyyy-MM-dd hh:mm:ss
... ...
... ... @@ -11,8 +11,8 @@
<h2 class="card-label">
<a href="{{item.productId | goodsUrl}}" class="line-clamp-2">{{item.productName}}</a>
</h2>
<span class="good-price" :class="{'old-price': item.marketPrice}" v-if="item.marketPrice">¥ {{item.marketPrice}}</span>
<span class="good-price" :class="{'sale-price': item.marketPrice}">¥ {{item.salesPrice}}</span>
<span class="good-price" :class="{'old-price': item.marketPrice}" v-if="item.marketPrice">¥ {{item.marketPrice | toFixed}}</span>
<span class="good-price" :class="{'sale-price': item.marketPrice}">¥ {{item.salesPrice | toFixed}}</span>
</div>
</li>
</ul>
... ...