Commit 607a6a3b authored by jiangjiantao's avatar jiangjiantao

bugfix

parent 297f4bf5
......@@ -108,17 +108,40 @@ Page({
useCoupon(code) {
this.setData({ scanDialogDisplay: 2 })
setTimeout(() => {
//模拟数据 1 - 5 随机整数
let totalDiscTemp = this.data.totalDisc + Math.round(Math.random() * 4) + 1;
this.setData({ scanDialogDisplay: 0,totalDisc:totalDiscTemp})
my.showToast({
type: 'success',
content: '优惠已录入',
duration: 3000,
success: () => {
let context = this;
let req = {}
req.discCouponPrice = totalDiscTemp;
req.discCouponState = 3;
var commonRequest = {
action: ACTION_USE_COUPON,
data: req
};
my.ix.sendBuddyMessage({
target: getApp().globalData.backScreenAppId,
data: commonRequest,
success: (res) => {
//模拟数据 1 - 5 随机整数
context.setData({ scanDialogDisplay: 0, totalDisc: totalDiscTemp })
my.showToast({
type: 'success',
content: '优惠已录入',
duration: 3000,
success: () => {
},
});
console.log("用券成功到后屏小程序成功 ===》" + JSON.stringify(res));
},
});
fail: (res) => {
console.log("用券成功后屏小程序 失败 ===》 " + JSON.stringify(res));
//发送失败重试
context.sendGoodInfoToBack();
}
})
}, 700);
},
......
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