From 75b9186dfb8f972bc5037c91ae26fc15287347b6 Mon Sep 17 00:00:00 2001 From: Tuzki <1720599558@qq.com> Date: Thu, 20 Mar 2025 09:16:48 +0800 Subject: [PATCH] =?UTF-8?q?fix(orderDetail):=20=E4=BF=AE=E5=A4=8D=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E8=AF=A6=E6=83=85=E9=A1=B5=E9=9D=A2=E7=9A=84=E4=BB=B7?= =?UTF-8?q?=E6=A0=BC=E8=AE=A1=E7=AE=97=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 使用 Math.round() 函数对订单价格进行四舍五入,确保价格计算准确 - 移除了多余的空行和空格,优化代码格式 --- pages/orderDetail/orderDetail.vue | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/pages/orderDetail/orderDetail.vue b/pages/orderDetail/orderDetail.vue index 30469d6..a239b63 100644 --- a/pages/orderDetail/orderDetail.vue +++ b/pages/orderDetail/orderDetail.vue @@ -106,7 +106,8 @@ this.orderDetail = null; this.orderDetail = JSON.parse(params.order); console.log('this.orderDetail', this.orderDetail); - this.orderPrice = this.orderDetail.orderInfo.settlementAmount*100; + this.orderPrice = Math.round(this.orderDetail.orderInfo.settlementAmount * 100) + } }, onUnload() { @@ -183,7 +184,7 @@ }; printTicket(ob) .then((ress) => { - + const datas = JSON.stringify(that.orderDetail.orderInfo .ticketList); // console.log(data) @@ -243,7 +244,7 @@ console.log('支付结果', res) const data = res.data; // 打开轮询任务 - + if (data.status === 0) { that.createQueryInterval(); return; @@ -263,7 +264,7 @@ setTimeout(()=>{ printTicket(ob) .then((ress) => { - + const datas = JSON.stringify(that.orderDetail.orderInfo .ticketList); console.log('ress',ress) @@ -278,7 +279,7 @@ },1000) return } - + }).catch(err => { // uni.showLoading({ // title: '支付中...' @@ -392,7 +393,7 @@ flex-wrap: wrap; align-items: center; justify-content: space-between; - + .m-way-item { width: 49%; height: 102upx; @@ -505,4 +506,4 @@ } } } - \ No newline at end of file +