|
...
|
...
|
@@ -68,7 +68,7 @@ Page({ |
|
|
|
})
|
|
|
|
},
|
|
|
|
// 赠送券
|
|
|
|
giftCouponsFun(priceSum) {
|
|
|
|
giftCouponsFun(priceSum,orderid) {
|
|
|
|
App.Activity.GetActivityConfig({
|
|
|
|
sellerid: this.data.seller.sid,
|
|
|
|
}).then(res => {
|
|
...
|
...
|
@@ -87,9 +87,9 @@ Page({ |
|
|
|
if (fullData.rule == '1') {
|
|
|
|
const price = parseFloat(fullData.price)
|
|
|
|
const amount = parseInt(priceSum / price)
|
|
|
|
if (coupons.length > 0) this.getCouponFun(coupons, '1', amount)
|
|
|
|
if (coupons.length > 0) this.getCouponFun(coupons, '1', amount,orderid)
|
|
|
|
} else {
|
|
|
|
if (coupons.length > 0) this.getCouponFun(coupons, '1', 1)
|
|
|
|
if (coupons.length > 0) this.getCouponFun(coupons, '1', 1,orderid)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
...
|
...
|
@@ -103,7 +103,7 @@ Page({ |
|
|
|
let obj = this.findObjectByNum(ladder_data, priceSum)
|
|
|
|
if (obj && obj.coupons) {
|
|
|
|
let coupons = obj.coupons ? util.determine(obj.coupons) : '';
|
|
|
|
this.getCouponFun(coupons, '2', '1')
|
|
|
|
this.getCouponFun(coupons, '2', '1',orderid)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
...
|
...
|
@@ -111,8 +111,8 @@ Page({ |
|
|
|
}
|
|
|
|
})
|
|
|
|
},
|
|
|
|
getCouponFun(coupons, type, amount) {
|
|
|
|
console.log('送的券coupons---', coupons, type, amount);
|
|
|
|
getCouponFun(coupons, type, amount,orderid) {
|
|
|
|
console.log('送的券coupons---', coupons, type, amount,orderid);
|
|
|
|
let str = coupons.map(item => item.id).join(',');
|
|
|
|
App.Activity.GetActivityById({
|
|
|
|
id: str,
|
|
...
|
...
|
@@ -156,15 +156,16 @@ Page({ |
|
|
|
totalPrice,
|
|
|
|
})
|
|
|
|
this.showgiveCouponModal()
|
|
|
|
this.setcouponFun(ids)
|
|
|
|
this.setcouponFun(ids,orderid)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
},
|
|
|
|
setcouponFun(str) {
|
|
|
|
console.log('领取券方法ids---', str);
|
|
|
|
setcouponFun(str,orderid) {
|
|
|
|
console.log('领取券方法ids---', str,orderid);
|
|
|
|
App.Activity.SetActivityAsReserve({
|
|
|
|
aid: str,
|
|
|
|
orderid,
|
|
|
|
}).then((json) => {
|
|
|
|
if (json.ret != 200) {
|
|
|
|
wx.showToast({
|
|
...
|
...
|
@@ -396,7 +397,7 @@ Page({ |
|
|
|
paySign: res.data.paySign,
|
|
|
|
success(ress) {
|
|
|
|
if (ress.errMsg == 'requestPayment:ok') {
|
|
|
|
that.giftCouponsFun(actualPrice) //送券
|
|
|
|
that.giftCouponsFun(actualPrice,res.data.orderid) //送券
|
|
|
|
that.setData({
|
|
|
|
inputValue: '',
|
|
|
|
finalList: [],
|
...
|
...
|
|