fix: 🐛 修改格式化金额可能会出现的问题

This commit is contained in:
学习很差啦
2022-09-30 18:36:21 +08:00
parent d101cd1b6a
commit 1225a41de4
10 changed files with 11 additions and 10 deletions

View File

@@ -43,7 +43,8 @@
if (typeof val == "undefined") { if (typeof val == "undefined") {
return val; return val;
} }
return val.toFixed(2).split(".");
return parseInt(val).toFixed(2).split(".");
}, },
// 数据去重一下 只显示一次 减免 劵 什么的 // 数据去重一下 只显示一次 减免 劵 什么的

View File

@@ -184,7 +184,7 @@
if (typeof val == "undefined") { if (typeof val == "undefined") {
return val; return val;
} }
return val.toFixed(2).split("."); return parseInt(val).toFixed(2).split(".");
}, },
// 数据去重一下 只显示一次 减免 劵 什么的 // 数据去重一下 只显示一次 减免 劵 什么的

View File

@@ -376,7 +376,7 @@ export default {
if (typeof val == "undefined") { if (typeof val == "undefined") {
return val; return val;
} }
return val.toFixed(2).split("."); return parseInt(val).toFixed(2).split(".");
}, },
// 展示更多数据 // 展示更多数据

View File

@@ -460,7 +460,7 @@ export default {
if (typeof val == "undefined") { if (typeof val == "undefined") {
return val; return val;
} }
return val.toFixed(2).split("."); return parseInt(val).toFixed(2).split(".");
}, },
//发票回调 选择发票之后刷新购物车 //发票回调 选择发票之后刷新购物车
async callbackInvoice(val) { async callbackInvoice(val) {

View File

@@ -757,7 +757,7 @@ export default {
if (typeof val == "undefined") { if (typeof val == "undefined") {
return val; return val;
} }
return val.toFixed(2).split("."); return parseInt(val).toFixed(2).split(".");
}, },
/**选择商品 */ /**选择商品 */

View File

@@ -146,7 +146,7 @@ export default {
if (typeof val == "undefined") { if (typeof val == "undefined") {
return val; return val;
} }
return val.toFixed(2).split("."); return parseInt(val).toFixed(2).split(".");
}, },
getCountDownTime(val) { getCountDownTime(val) {
let date = new Date(val); let date = new Date(val);

View File

@@ -53,7 +53,7 @@ export default {
if (typeof val == "undefined") { if (typeof val == "undefined") {
return val; return val;
} }
return val.toFixed(2).split("."); return parseInt(val).toFixed(2).split(".");
}, },
// 点击商品 // 点击商品
clickGoods(val) { clickGoods(val) {

View File

@@ -87,7 +87,7 @@ export default {
if (typeof val == "undefined") { if (typeof val == "undefined") {
return val; return val;
} }
return val.toFixed(2).split("."); return parseInt(val).toFixed(2).split(".");
}, },
async init() { async init() {
let res = await getStoreList(this.params); let res = await getStoreList(this.params);

View File

@@ -264,7 +264,7 @@ export default {
if (typeof val == "undefined") { if (typeof val == "undefined") {
return val; return val;
} }
return val.toFixed(2).split("."); return parseInt(val).toFixed(2).split(".");
}, },
/** /**

View File

@@ -63,7 +63,7 @@ export default {
if (typeof val == "undefined") { if (typeof val == "undefined") {
return val; return val;
} }
return val.toFixed(2).split("."); return parseInt(val).toFixed(2).split(".");
}, },
handleClick(item) { handleClick(item) {
uni.navigateTo({ uni.navigateTo({