Commit c604c33ceee4ebcc9a05eddaa2736e3acf6ca82b

Authored by pengye
1 parent b8de42ab

商家端APP分享到意见建议页面

... ... @@ -44,7 +44,6 @@ Page({
swich_phone:'0',
is_comments:'0',
is_user_comments:false,
cusdem:'',//备注 传参给意见反馈
},
/**
* 生命周期函数--监听页面加载
... ... @@ -82,32 +81,11 @@ Page({
},
// 去评价
evaluateFun(){
let coupon_data_comments=this.data.marketing.coupon_data_comments;//赠送优惠券的列表
let coupon=this.data.marketing.is_comments_coupon;//评价赠送优惠券
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)
}
let record={
date:this.data.seller.date,
tablesText:this.data.seller.tablesText,
tableNum:this.data.detail.actual_pum?this.data.detail.actual_pum:this.data.tableNum,
cusdem:this.data.cusdem,
}
let url=util.http_build_query({
sellerName:this.data.seller.name,
record:JSON.stringify(record),
sellerid:this.data.seller.sid,
oid:this.data.detail.id,
types:'1',
coupon:coupon || '',
couponId:couponId || '',
price:price || '',
use:use || '',
},'/pages/pinglun/createOpinion')
wx.navigateTo({
url
... ... @@ -189,7 +167,6 @@ Page({
detail: this.formatDatail(reserev, dateSmart),
tableNum,
is_user_comments:res.data.is_user_comments,
cusdem:res.data.cusdem,
seller: {
name: reserev.seller.sellername,
sid:reserev.sid,
... ... @@ -323,7 +300,6 @@ Page({
if(marketing){
is_comments = marketing.is_comments?marketing.is_comments:'';
coupon=marketing.coupon_data?util.determine(marketing.coupon_data):'';
marketing.coupon_data_comments=(is_comments=='1' && marketing.is_comments_coupon=='1')?util.determine(marketing.coupon_data_comments):'';
}
// is_cash 代金券 is_discount折扣券 is_dish菜品券 只有代金券有几折显示
if(coupon && util.getType(coupon)=='object'){
... ...
... ... @@ -97,7 +97,7 @@
</block>
</view>
<view wx:if="{{is_comments=='1' && !is_user_comments}}" class="evaluateBox" bindtap="evaluateFun">
<text wx:if="{{is_comments=='1' && marketing.is_comments_coupon!='1'}}">{{'想吐槽?戳这里填写意见!-->'}}</text>
<text wx:if="{{is_comments=='1' && marketing.is_comments_coupon!='1'}}">想吐槽?戳这里填写意见!--></text>
<text wx:if="{{marketing.is_comments_coupon=='1'}}">想吐槽?戳这里填写意见反馈赢好礼!</text>
<image src="https://qn.colorcun.com/evaluate.png" mode=""/>
</view>
... ...
// pages/pinglun/createOpinion.js
import util from '../../utils/util';
import App from '../../utils/api'
import RS from '../../utils/reserveStatus'
Page({
/**
... ... @@ -9,21 +10,104 @@ Page({
data: {
options: {},
filesHttps: [],
dateSmart:'',
tablesText:'',
detail:{},
tableNum:'',
cusdem:'',
coupon:'',
couponId:'',
price:'',
coupon:'',
},
text: '',
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
let data = options
data.record = util.determine(options.record)
this.setData({
options: data
})
console.log('options', {
...data
});
if(options){
this.setData({
options
})
console.log('options', {
...options
});
this.getDetail()
}
},
getDetail() {
App.Reserve.Detail({
openid: getApp().openid,
rid: this.data.options.oid
}).then(res => {
let tablesText = '', //桌子信息
tableNum =0;
res.data.tables.forEach((t,i) => {
tableNum+=t.table_pnum*1
tablesText+=t.rname+t.name+(i==(res.data.tables.length-1)?'':'、');
})
let reserev = RS.reserve(res.data)
let dateSmart
if (res.data.type == 1) {
dateSmart = util.unixtoTime(reserev.ddate, 'YYYY/MM/DD 星期WW')
if (res.data.is_set_ddate == 1) {
dateSmart += ' ' + util.unixtoTime(reserev.ddate, 'YYYY/MM/DD 星期WW')
} else {
dateSmart += ' ' + reserev.soltName
}
} else {
dateSmart = util.unixtoTime(reserev.ddate, 'YYYY/MM/DD 星期WW HH:II')
}
this.setData({
dateSmart,
tablesText,
tableNum:res.data.actual_pum?res.data.actual_pum:tableNum,
cusdem:res.data.cusdem,
})
setTimeout(() => {
this.getSellerTemplateConfFun(reserev.sid);
}, 0);
}).catch(res=>{
console.log(res,'详情请求失败');
})
},
getSellerTemplateConfFun(sid) {
console.log('sidsidsidsid',sid);
App.Seller.GetSellerTemplateConf({
sid
}).then(res => {
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):'';
}
let coupon_data_comments=marketing.coupon_data_comments;//赠送优惠券的列表
let coupon=marketing.is_comments_coupon;//评价赠送优惠券
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({
coupon:coupon || '',
couponId:couponId || '',
price:price || '',
use:use || '',
})
this.setData({
marketing,
})
}).catch(res=>{
console.log('GetSellerTemplateConf请求失败');
})
},
// 获取上传的图片或者视频
tpupload(e) {
this.setData({
... ... @@ -68,22 +152,21 @@ Page({
let url = ''
let options = this.data.options
// 有券
if (this.options.coupon == '1') {
if (this.data.coupon == '1') {
url = util.http_build_query({
sellerName: options.sellerName,
coupon: options.coupon,
couponId: options.couponId,
coupon: options.coupon,
price: options.price,
use: options.use,
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: options.coupon, //1有券 2没有券
couponId: options.couponId || '',
coupon: this.data.coupon, //1有券 2没有券
couponId: this.data.couponId || '',
}, './opinionSuccess')
}
wx.redirectTo({
... ...
... ... @@ -3,19 +3,19 @@
<view class="box">
<view class="info">
<view class="texts font28r">就餐时间:</view>
<view class="texts_right font28r">{{options.record.date}}</view>
<view class="texts_right font28r">{{dateSmart}}</view>
</view>
<view class="info">
<view class="texts font28r">桌位台号:</view>
<view class="texts_right font28r">{{options.record.tablesText}}</view>
<view class="texts_right font28r">{{tablesText}}</view>
</view>
<view class="info">
<view class="texts font28r">就餐人数:</view>
<view class="texts_right font28r">{{options.record.tableNum}}</view>
<view class="texts_right font28r">{{tableNum}}</view>
</view>
<view class="info">
<view class="texts font28r">备注信息:</view>
<view wx:if="{{options.record.cusdem}}" class="texts_right font28r">{{options.record.cusdem}}</view>
<view wx:if="{{cusdem}}" class="texts_right font28r">{{cusdem}}</view>
</view>
</view>
<view class="main">
... ...