Commit 97e347c7 authored by gaodapeng's avatar gaodapeng

修改金额失真问题

parent 60adba16
......@@ -62,7 +62,7 @@ Page({
if (totalPrice != null) {
this.setData({
payPrice: totalPrice - totalDisc,
payPrice: payUtils.fen2Yuan(payUtils.yuan2Fen(totalPrice) - payUtils.yuan2Fen(totalDisc)),
totalPrice: totalPrice,
couponPrice: totalDisc,
})
......
......@@ -62,11 +62,11 @@ Page({
})
} else if (res.action == ACTION_MEMBER) {
let showPhone = res.data.substring(0,3)+"****"+res.data.substring(7,11)
let showPhone = res.data.substring(0, 3) + "****" + res.data.substring(7, 11)
context.setData({
memberPhone: res.data,
showMemberPhone:showPhone,
memberPoint:2130
showMemberPhone: showPhone,
memberPoint: 2130
})
}
else if (res.action == ACTION_GO_BALANCE) {
......@@ -80,11 +80,11 @@ Page({
my.reLaunch({
url: "/pages/home/home",
});
}else if (res.action == ACTION_USE_COUPON) {
} else if (res.action == ACTION_USE_COUPON) {
//优惠券
context.setData({
scanDialogDisplay: res.data.discCouponState,
totalDisc:res.data. discCouponPrice
totalDisc: res.data.discCouponPrice
});
if (res.data.discCouponState == 1) {
......@@ -125,7 +125,7 @@ Page({
let totalDiscTemp = this.data.totalDisc + Math.round(Math.random() * 4) + 1;
//超额
if(totalDiscTemp > this.data.totalPrice){
if (totalDiscTemp > this.data.totalPrice) {
let req = {}
req.discCouponMsg = "超额优惠券"
req.discCouponState = 4;
......@@ -136,7 +136,7 @@ Page({
let req = {}
req.discCouponPrice = totalDiscTemp;
req.discCouponState = 3;
this.useCouponCallback(ACTION_USE_COUPON,req)
this.useCouponCallback(ACTION_USE_COUPON, req)
}, 700);
},
......@@ -153,7 +153,7 @@ Page({
success: (res) => {
console.info(`sendBuddyMessage success: ${JSON.stringify(res)}`);
//用券成功
if(result.discCouponState == 3){
if (result.discCouponState == 3) {
//模拟数据 1 - 5 随机整数
context.setData({ scanDialogDisplay: 0, totalDisc: result.discCouponPrice })
my.showToast({
......@@ -165,13 +165,13 @@ Page({
},
});
//用券失败
}else if(result.discCouponState == 4){
} else if (result.discCouponState == 4) {
context.setData({ scanDialogDisplay: 4 })
}
},
fail: (res) => {
console.info(`sendBuddyMessage failed: ${JSON.stringify(res)}`);
context.useCouponCallback(action,result)
context.useCouponCallback(action, result)
}
});
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment