Commit 25ebef2d4b608e0b75c0463aed6bb5f91c843272

Authored by pengye
1 parent 60a64ba7

金额为0,在进入意见反馈完成页面直接领取

... ... @@ -158,6 +158,10 @@ Page({
}
})
if(eval_label.length<1) return util.toast('请选择标签','none')
wx.showToast({
icon: 'none',
title: '提交中,请稍后!',
})
let params={
sid:this.options.sid,
rid:this.options.oid,
... ...
... ... @@ -41,8 +41,9 @@ Page({
title: '请填写意见反馈!',
})
}
wx.showLoading({
title: '提交中',
wx.showToast({
icon: 'none',
title: '提交中,请稍后!',
})
let params = {
sid: this.data.options.sellerid,
... ... @@ -59,7 +60,6 @@ Page({
});
App.User.SetComment(params).then(res => {
if (res.ret != 200) {
wx.hideLoading()
return wx.showToast({
icon: 'none',
title: res.msg,
... ... @@ -72,10 +72,10 @@ Page({
url = util.http_build_query({
sellerName: options.sellerName,
coupon: options.coupon,
couponId: options.couponId || '',
coupon: options.coupon || '',
price: options.price || '',
use: options.use || '',
couponId: options.couponId,
coupon: options.coupon,
price: options.price,
use: options.use,
oid: options.oid,
sid: options.sellerid,
}, './opinionSuccess')
... ... @@ -89,11 +89,7 @@ Page({
wx.redirectTo({
url
})
if (url) {
wx.hideLoading()
}
}).catch(e => {
wx.hideLoading()
console.log('catch', e);
wx.showToast({
icon: 'none',
... ...
... ... @@ -18,6 +18,24 @@ Page({
this.setData({
options,
})
// 金额为0 直接领券后
if (options.coupon == '1' && options.price * 1 == 0) {
App.Activity.CreateNewRechargeOrder({
recharge_id: options.couponId,
sellerid: options.sid,
number: '1',
price: options.price,
type: '1',
}).then(res => {
if (res.ret != '200') {
wx.showToast({
title: '领券失败!',
duration: 2000,
mask: true
})
}
})
}
},
seeCoupon() {
wx.showLoading({
... ... @@ -38,35 +56,10 @@ Page({
wx.redirectTo({
url
})
} else { //金额为0 直接领券后跳转到我的券页面
App.Activity.CreateNewRechargeOrder({
recharge_id: options.couponId,
sellerid: options.sid,
number: '1',
price: options.price,
type: '1',
}).then(res => {
if (res.ret == '200') {
wx.hideLoading()
let price = res.data.price;
if (price == 0) {
wx.showToast({
icon: 'none',
title: '购买成功',
})
wx.reLaunch({
url: '/pages/me/coupon_news'
})
return
}
} else {
wx.hideLoading()
wx.showToast({
title: res.msg,
duration: 2000,
mask: true
})
}
} else { //金额为0 跳转到我的券页面
wx.hideLoading()
wx.reLaunch({
url: '/pages/me/coupon_news'
})
}
},
... ...