|
...
|
...
|
@@ -85,9 +85,8 @@ Page({ |
|
|
|
is_comments = marketing.is_comments?marketing.is_comments:'';
|
|
|
|
marketing.coupon_data_comments=(is_comments=='1' && marketing.is_comments_coupon=='1')?util.determine(marketing.coupon_data_comments):'';
|
|
|
|
}
|
|
|
|
|
|
|
|
let coupon_data_comments=marketing.coupon_data_comments;//赠送优惠券的列表
|
|
|
|
let coupon=marketing.is_comments_coupon;//评价赠送优惠券
|
|
|
|
let coupon=(marketing && marketing.is_comments=='1' && marketing.is_comments_coupon=='1')?'1':'0';//评价赠送优惠券
|
|
|
|
let couponId,price,use;
|
|
|
|
if(coupon && coupon_data_comments && coupon_data_comments.length>0){
|
|
|
|
let obj=coupon_data_comments[0];
|
|
...
|
...
|
@@ -134,6 +133,7 @@ Page({ |
|
|
|
}
|
|
|
|
wx.showLoading({
|
|
|
|
title: '提交中,请稍后!',
|
|
|
|
mask: true,
|
|
|
|
})
|
|
|
|
let params = {
|
|
|
|
sid: this.data.options.sellerid,
|
|
...
|
...
|
@@ -149,36 +149,38 @@ Page({ |
|
|
|
...params
|
|
|
|
});
|
|
|
|
App.User.SetComment(params).then(res => {
|
|
|
|
if (res.ret != 200) {
|
|
|
|
if (res.ret== 200 && res.data) {
|
|
|
|
let url = ''
|
|
|
|
let options = this.data.options
|
|
|
|
console.log('options',options);
|
|
|
|
// 有券
|
|
|
|
if (this.data.coupon == '1') {
|
|
|
|
url = util.http_build_query({
|
|
|
|
sellerName: options.sellerName,
|
|
|
|
coupon: this.data.coupon,
|
|
|
|
couponId: this.data.couponId,
|
|
|
|
price: this.data.price,
|
|
|
|
use: this.data.use,
|
|
|
|
oid: options.oid,
|
|
|
|
sellid: options.sellerid,
|
|
|
|
}, './opinionSuccess')
|
|
|
|
} else { //没券
|
|
|
|
url = util.http_build_query({
|
|
|
|
sellerName: options.sellerName,
|
|
|
|
coupon: this.data.coupon, //1有券 2没有券
|
|
|
|
couponId: this.data.couponId || '',
|
|
|
|
sellid: options.sellerid,
|
|
|
|
}, './opinionSuccess')
|
|
|
|
}
|
|
|
|
wx.redirectTo({
|
|
|
|
url
|
|
|
|
})
|
|
|
|
}else{
|
|
|
|
return wx.showToast({
|
|
|
|
icon: 'none',
|
|
|
|
title: res.msg,
|
|
|
|
})
|
|
|
|
}
|
|
|
|
let url = ''
|
|
|
|
let options = this.data.options
|
|
|
|
// 有券
|
|
|
|
if (this.data.coupon == '1') {
|
|
|
|
url = util.http_build_query({
|
|
|
|
sellerName: options.sellerName,
|
|
|
|
coupon: this.data.coupon,
|
|
|
|
couponId: this.data.couponId,
|
|
|
|
price: this.data.price,
|
|
|
|
use: this.data.use,
|
|
|
|
oid: options.oid,
|
|
|
|
sid: options.sellerid,
|
|
|
|
}, './opinionSuccess')
|
|
|
|
} else { //没券
|
|
|
|
url = util.http_build_query({
|
|
|
|
sellerName: options.sellerName,
|
|
|
|
coupon: this.data.coupon, //1有券 2没有券
|
|
|
|
couponId: this.data.couponId || '',
|
|
|
|
}, './opinionSuccess')
|
|
|
|
}
|
|
|
|
wx.hideLoading()
|
|
|
|
wx.redirectTo({
|
|
|
|
url
|
|
|
|
})
|
|
|
|
}).catch(e => {
|
|
|
|
wx.hideLoading()
|
|
|
|
console.log('catch', e);
|
...
|
...
|
|