Browse Source

【修复】 使用bigcjs计算的地方数字位数过长的BUG

master
邓平艺 4 years ago
parent
commit
de1def1a86
  1. 7
      pages/order/confirm/confirm.vue
  2. 2
      pages/order/pointconfirm/confirm.vue
  3. 2
      pages/shop/goodsdetail.vue
  4. 2
      pages/store/cart/cart.vue

7
pages/order/confirm/confirm.vue

@ -191,6 +191,7 @@
if(this.$isRight(arr)){
let price = arr[0].adjustmentTotal;
let adjustmentTotal = new Bigc(price).div(100);
adjustmentTotal = adjustmentTotal.round(2, 0);
return Math.abs(adjustmentTotal);
}else{
return 0
@ -251,7 +252,7 @@
},
//
unitConversion(price){
let newPrice = new Bigc(price).div(100);
let newPrice = new Bigc(price).div(100).round(2, 0);
return Math.abs(newPrice);
},
//
@ -265,7 +266,7 @@
let itemP = price.times(item.quantity);
itemsPrice = itemsPrice.plus(itemP);
})
this.itemsPrice = itemsPrice;
this.itemsPrice = itemsPrice.round(2, 0);
//
if(this.coupon_index != null){
let coupon = detail.coupons[this.coupon_index];
@ -283,7 +284,7 @@
let payable_freight = new Bigc(detail.order.payable_freight).div(100);
itemsPrice = itemsPrice.plus(payable_freight);
}
this.totalPrice = itemsPrice; //
this.totalPrice = itemsPrice.round(2, 0); //
},
//
switchMode(mode){

2
pages/order/pointconfirm/confirm.vue

@ -184,7 +184,7 @@
if(this.mode){
return order.total_yuan;
}else{
return new Bigc(order.total_yuan).plus(order.payable_freight_yuan);
return new Bigc(order.total_yuan).plus(order.payable_freight_yuan).round(2, 0);
}
}
},

2
pages/shop/goodsdetail.vue

@ -539,7 +539,7 @@
par.seckill_goods_id = this.seckill.item_id;
par.seckill_item_id = this.seckill.id;
par.price = this.seckill.seckill_price;
par.total = new Bigc(this.goods_num).times(this.seckill.seckill_price);
par.total = new Bigc(this.goods_num).times(this.seckill.seckill_price).round(2, 0);
}

2
pages/store/cart/cart.vue

@ -123,7 +123,7 @@
})
})
this.total_count = total_count;
this.total_price = total_price;
this.total_price = total_price.round(2, 0);
}
}
},

Loading…
Cancel
Save