商品选购及下单页面的金额出现超长小数位的问题修复

This commit is contained in:
donqi 2022-10-23 00:38:15 +08:00
parent f4197ec3b0
commit 4787c3e75e
3 changed files with 4 additions and 5 deletions

View File

@ -11,9 +11,9 @@ export default {
title: '加载中' title: '加载中'
}) })
// request 触发前拼接 url // request 触发前拼接 url
// args.url = 'https://www.opsoul.com' + args.url; args.url = 'https://www.opsoul.com' + args.url;
// args.url = 'http://192.168.2.42:80' + args.url; // args.url = 'http://192.168.2.42:80' + args.url;
args.url = 'http://127.0.0.1:80' + args.url; // args.url = 'http://127.0.0.1:80' + args.url;
if (args.data && Object.prototype && Object.prototype.toString.call(args.data) === '[object Object]') { if (args.data && Object.prototype && Object.prototype.toString.call(args.data) === '[object Object]') {
args.data.deptId = globalData.deptId; args.data.deptId = globalData.deptId;
args.data.from = globalData.from; args.data.from = globalData.from;
@ -88,7 +88,6 @@ export default {
async getCurArea() { async getCurArea() {
try{ try{
let curLocation = uni.getStorageSync('curLocation'); let curLocation = uni.getStorageSync('curLocation');
console.log(curLocation)
if (curLocation && curLocation.updateTimes) { if (curLocation && curLocation.updateTimes) {
let curTimes = new Date().getTime(); let curTimes = new Date().getTime();
let deltaSeconds = curTimes - Number(curLocation.updateTimes); let deltaSeconds = curTimes - Number(curLocation.updateTimes);

View File

@ -196,7 +196,7 @@
loadTotalPrice() { loadTotalPrice() {
// totalprice // totalprice
this.pickedProductList.forEach((obj) => { this.pickedProductList.forEach((obj) => {
this.totalPrice += Number(obj.totalMoney) this.totalPrice = Math.round((this.totalPrice + Number(obj.totalMoney)) * 100) / 100;
}) })
}, },
bindEvent() { bindEvent() {

View File

@ -94,7 +94,7 @@
changePiecesNum(piecesNum, index) { changePiecesNum(piecesNum, index) {
let spec = this.pickList[index]; let spec = this.pickList[index];
let price = spec.salePrice ? spec.salePrice : spec.price; let price = spec.salePrice ? spec.salePrice : spec.price;
this.totalPrice -= price * (spec.pickCount - piecesNum); this.totalPrice = Math.round((this.totalPrice - price * (spec.pickCount - piecesNum)) * 100)/100;
this.totalPickCount -= spec.pickCount - piecesNum this.totalPickCount -= spec.pickCount - piecesNum
this.pickList[index].pickCount = piecesNum; this.pickList[index].pickCount = piecesNum;
}, },