Commit 6a841b53dc85e7c23c6000b67c1dcadb7e9540dd

Authored by pengye
1 parent 44cec529

提交意见反馈问题处理

... ... @@ -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);
... ...
... ... @@ -7,7 +7,14 @@ Page({
* 页面的初始数据
*/
data: {
options: {}
options: {
coupon:'',
couponId:'',
price:'',
use:'',
sid:'',
StyleType:'',
}
},
/**
... ... @@ -18,25 +25,64 @@ 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
})
}
})
}
this.getSellerTemplateConfFun(options.sellid)
},
getSellerTemplateConfFun(sid) {
console.log('sellid',sid);
App.Seller.GetSellerTemplateConf({
sid
}).then(res => {
if(res.ret==200){
let data=res.data
let marketing,is_comments;
marketing = util.determine(data.marketing);
if(marketing){
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):'';
}
console.log('marketingmarketing',{...marketing});
let coupon_data_comments=marketing && marketing.coupon_data_comments?marketing.coupon_data_comments:[];//赠送优惠券的列表
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];
console.log('填写意见获取的券的信息',obj);
couponId=obj.id;
price=obj.price;
use=JSON.stringify(obj.use)
}
this.setData({
'options.price':price || '',
'options.use':use || '',
'options.coupon':coupon || '',
'options.couponId':couponId || '',
StyleType:data.type
})
setTimeout(() => {
// 金额为0 直接领券后
if (this.data.options.coupon == '1' && this.data.options.price * 1 == 0) {
App.Activity.CreateNewRechargeOrder({
recharge_id: this.data.options.couponId,
sellerid: sid,
number: '1',
price: this.data.options.price,
type: '1',
}).then(res => {
if (res.ret != '200') {
wx.showToast({
title: '领券失败!',
duration: 2000,
mask: true
})
}
})
}
}, 100);
}else{
console.log('GetSellerTemplateConf请求失败');
}
})
},
seeCoupon() {
wx.showLoading({
title: '加载中',
... ... @@ -48,8 +94,9 @@ Page({
id: options.couponId,
name: options.sellerName,
oid: options.oid,
sid: options.sid,
sid: options.sellid,
types: '1',
StyleType:this.data.StyleType,
use: options.use ? JSON.stringify(options.use) : '',
}, '/pack-activity/pack/buyCoupon')
wx.hideLoading()
... ...