Commit e5f96e25212dd2a6715411267fcf5c80fca68d4c

Authored by 王强
1 parent 45f42c5f

积分商品列表显示商品金额超过万的问题处理

src/components/goodsItem_7/goodsItem_7.vue
... ... @@ -35,13 +35,13 @@
35 35  
36 36 <!-- 积分加现金 -->
37 37 <div v-if="goodType == 1" class="price-title-box">
38   - {{parseInt(item.num) > 9999 ? this.formatDecimal((parseInt(item.num) / 10000), 0) + "万" : item.num}}<span>积分 <span v-show="item.price > 0">+ {{item.price}}元</span></span>
  38 + {{parseInt(item.num) > 9999 ? this.formatDecimal((parseInt(item.num) / 10000), 2) + "万" : item.num}}<span>积分 <span v-show="item.price > 0">+ {{item.price}}元</span></span>
39 39 </div>
40 40  
41 41 <!-- 积分 -->
42 42 <div v-else-if="company == 1 || company == 2" class="grade-box" >
43 43 <span class="num" :class="{'grey-box':company == 2}">
44   - {{parseInt(item.num)>9999 ? this.formatDecimal((parseInt(item.num) / 10000), 0) + "万" : item.num}}
  44 + {{parseInt(item.num)>9999 ? this.formatDecimal((parseInt(item.num) / 10000), 2) + "万" : item.num}}
45 45 </span>
46 46 <span v-if="company==1">积分</span>
47 47 <span v-else>健康值</span>
... ...
src/main.js
... ... @@ -670,7 +670,7 @@ Vue.filter(&quot;datetime&quot;, function(value, fmt) {
670 670 /* 过滤器 结束 */
671 671  
672 672 /*数据返回一斤万为单位处理
673   - * @param {int} num [数据]
  673 + * @param {int} num [数据]
674 674 * @returns {decimal} [保留小数点位数]
675 675 */
676 676 (Vue.prototype.formatDecimal = function(num, decimal) {
... ...