fix(orderDetail): 修复订单详情页面的价格计算问题

- 使用 Math.round() 函数对订单价格进行四舍五入,确保价格计算准确
- 移除了多余的空行和空格,优化代码格式
main
Tuzki 7 months ago
parent 9d2844292a
commit 75b9186dfb
  1. 15
      pages/orderDetail/orderDetail.vue

@ -106,7 +106,8 @@
this.orderDetail = null; this.orderDetail = null;
this.orderDetail = JSON.parse(params.order); this.orderDetail = JSON.parse(params.order);
console.log('this.orderDetail', this.orderDetail); console.log('this.orderDetail', this.orderDetail);
this.orderPrice = this.orderDetail.orderInfo.settlementAmount*100; this.orderPrice = Math.round(this.orderDetail.orderInfo.settlementAmount * 100)
} }
}, },
onUnload() { onUnload() {
@ -183,7 +184,7 @@
}; };
printTicket(ob) printTicket(ob)
.then((ress) => { .then((ress) => {
const datas = JSON.stringify(that.orderDetail.orderInfo const datas = JSON.stringify(that.orderDetail.orderInfo
.ticketList); .ticketList);
// console.log(data) // console.log(data)
@ -243,7 +244,7 @@
console.log('支付结果', res) console.log('支付结果', res)
const data = res.data; const data = res.data;
// //
if (data.status === 0) { if (data.status === 0) {
that.createQueryInterval(); that.createQueryInterval();
return; return;
@ -263,7 +264,7 @@
setTimeout(()=>{ setTimeout(()=>{
printTicket(ob) printTicket(ob)
.then((ress) => { .then((ress) => {
const datas = JSON.stringify(that.orderDetail.orderInfo const datas = JSON.stringify(that.orderDetail.orderInfo
.ticketList); .ticketList);
console.log('ress',ress) console.log('ress',ress)
@ -278,7 +279,7 @@
},1000) },1000)
return return
} }
}).catch(err => { }).catch(err => {
// uni.showLoading({ // uni.showLoading({
// title: '...' // title: '...'
@ -392,7 +393,7 @@
flex-wrap: wrap; flex-wrap: wrap;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
.m-way-item { .m-way-item {
width: 49%; width: 49%;
height: 102upx; height: 102upx;
@ -505,4 +506,4 @@
} }
} }
} }
</style> </style>

Loading…
Cancel
Save