Commit cc3c445a authored by pengguangpu's avatar pengguangpu

Merge branch 'dev-1.0' of…

Merge branch 'dev-1.0' of https://gitlab.infra.miyatech.com/pengguangpu/doublescreen-front into dev-1.0
parents f5071335 97e347c7
......@@ -64,7 +64,7 @@ Page({
if (totalPrice != null) {
this.setData({
payPrice: totalPrice - totalDisc,
payPrice: payUtils.fen2Yuan(payUtils.yuan2Fen(totalPrice) - payUtils.yuan2Fen(totalDisc)),
totalPrice: totalPrice,
couponPrice: totalDisc,
})
......
......@@ -31,7 +31,7 @@ Page({
dialogResultFailureText: "录入失败,请稍后重试!",
},
onReady() {
onReady() {
if (my.canIUse('hideBackHome')) {
my.hideBackHome();
}
......@@ -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
memberPhone: res.data,
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) {
......@@ -96,7 +96,7 @@ Page({
}
});
}
}
}
......@@ -112,7 +112,7 @@ Page({
onKeyPress(r) {
if (this.data.scanDialogDisplay != 0) {
this.useCoupon(r);
return
return
}
console.log("scan onKeyPress==>" + r);
this.getGoodInfoByBarcode(r);
......@@ -122,28 +122,28 @@ Page({
useCoupon(code) {
this.setData({ scanDialogDisplay: 2 })
setTimeout(() => {
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;
this.useCouponCallback(ACTION_USE_COUPON, req)
return
}
let req = {}
req.discCouponPrice = totalDiscTemp;
req.discCouponPrice = totalDiscTemp;
req.discCouponState = 3;
this.useCouponCallback(ACTION_USE_COUPON,req)
this.useCouponCallback(ACTION_USE_COUPON, req)
}, 700);
},
//用券回调
useCouponCallback(action, result) {
let context = this;
//用券回调
useCouponCallback(action, result) {
let context = this;
my.ix.sendBuddyMessage({
target: getApp().globalData.backScreenAppId,
data: {
......@@ -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)
}
});
},
......@@ -232,9 +232,9 @@ Page({
//价格 分转元
goodinfo.quantity = 1;
goodinfo.price = goodinfo.price
goodinfo.salePrice = goodinfo.salePrice
goodinfo.discnt = goodinfo.discnt
goodinfo.price = goodinfo.price
goodinfo.salePrice = goodinfo.salePrice
goodinfo.discnt = goodinfo.discnt
//总数量
let totalQuantityTemp = 0
......
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