Commit 60a64ba7574bf4b08d15842ec39981f8e8c3eb58

Authored by pengye
1 parent 3cbcaca2

意见建议反馈填写

@@ -57,7 +57,9 @@ @@ -57,7 +57,9 @@
57 "pages/pinglun/video", 57 "pages/pinglun/video",
58 "pages/customer/detail_owner_invitation_new", 58 "pages/customer/detail_owner_invitation_new",
59 "pages/me/coupon_news", 59 "pages/me/coupon_news",
60 - "pages/me/wananchi" 60 + "pages/me/wananchi",
  61 + "pages/pinglun/createOpinion",
  62 + "pages/pinglun/opinionSuccess"
61 ], 63 ],
62 "requiredPrivateInfos": [ 64 "requiredPrivateInfos": [
63 "getLocation", 65 "getLocation",
@@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
4 <view class="cu-avatar round lg" style="background-image: url('{{post.isnoshow==1 ? 'http://nosqn.colorcun.com/noshow.jpg' : post.author_image}}');width: 72rpx;height: 72rpx;border-radius: 50%;" ></view> 4 <view class="cu-avatar round lg" style="background-image: url('{{post.isnoshow==1 ? 'http://nosqn.colorcun.com/noshow.jpg' : post.author_image}}');width: 72rpx;height: 72rpx;border-radius: 50%;" ></view>
5 <view class="flex-treble flex flex-direction margin-left-sm"> 5 <view class="flex-treble flex flex-direction margin-left-sm">
6 <view class="txt-24-h text-bold margin-bottom-sm" style="margin-bottom: 10rpx;">{{post.isnoshow==1 ? '匿名用户' : post.author}}</view> 6 <view class="txt-24-h text-bold margin-bottom-sm" style="margin-bottom: 10rpx;">{{post.isnoshow==1 ? '匿名用户' : post.author}}</view>
7 - <stat value="{{post.grade}}" cla="card" disabled></stat> 7 + <stat wx:if="{{post.grade}}" value="{{post.grade}}" cla="card" disabled></stat>
8 </view> 8 </view>
9 <view class="text-gray txt-24-h {{hasStatus?'hasStatus status-'+post.status:''}}">{{util.unixtoTime(post.create_time,'YYYY-MM-DD')}}</view> 9 <view class="text-gray txt-24-h {{hasStatus?'hasStatus status-'+post.status:''}}">{{util.unixtoTime(post.create_time,'YYYY-MM-DD')}}</view>
10 </view> 10 </view>
@@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@
12 <view class="cu-avatar round lg" style="background-color: rgba(0,0,0,0);"></view> 12 <view class="cu-avatar round lg" style="background-color: rgba(0,0,0,0);"></view>
13 <view class="flex-treble flex flex-direction margin-left-sm"> 13 <view class="flex-treble flex flex-direction margin-left-sm">
14 <view class="text-df margin-bottom-xs" wx:if="{{post.text}}" style="word-break:break-all;">{{post.text}}</view> 14 <view class="text-df margin-bottom-xs" wx:if="{{post.text}}" style="word-break:break-all;">{{post.text}}</view>
15 - <view class="text-df margin-bottom-xs text-blue">#{{post.eval_label}}</view> 15 + <view wx:if="{{post.eval_label}}" class="text-df margin-bottom-xs text-blue">#{{post.eval_label}}</view>
16 <view class="grid col-3 grid-square" wx:if="{{enclosure.length>0}}"> 16 <view class="grid col-3 grid-square" wx:if="{{enclosure.length>0}}">
17 <block wx:for="{{enclosure}}" wx:key="enclosure"> 17 <block wx:for="{{enclosure}}" wx:key="enclosure">
18 <view wx:if="{{!item.avinfo}}" class="bg-image" style="background-image: url('{{item.url}}')" catchtap="displayImage" data-index="{{index}}"> 18 <view wx:if="{{!item.avinfo}}" class="bg-image" style="background-image: url('{{item.url}}')" catchtap="displayImage" data-index="{{index}}">
@@ -55,4 +55,5 @@ @@ -55,4 +55,5 @@
55 .texts { 55 .texts {
56 font-size: 24rpx; 56 font-size: 24rpx;
57 font-weight: 400; 57 font-weight: 400;
  58 + color: #999;
58 } 59 }
@@ -12,7 +12,7 @@ Page({ @@ -12,7 +12,7 @@ Page({
12 id:'', 12 id:'',
13 oid:'', 13 oid:'',
14 sid:'', 14 sid:'',
15 - types:'1',//1是邀请函过来的 15 + types:'1',//1是邀请函过来的(邀请函的券或者点击意见反馈买券) 2是商家APP分享的
16 rid:'', 16 rid:'',
17 }, 17 },
18 use:{}, 18 use:{},
@@ -18,10 +18,12 @@ @@ -18,10 +18,12 @@
18 18
19 .texts_right { 19 .texts_right {
20 font-weight: 500; 20 font-weight: 500;
21 - width: 76%; 21 + text-align: right;
  22 + width: 79%;
22 display: flex; 23 display: flex;
23 flex-wrap: wrap; 24 flex-wrap: wrap;
24 justify-content: flex-end; 25 justify-content: flex-end;
  26 + word-break: break-all;
25 } 27 }
26 28
27 .info input { 29 .info input {
@@ -9,7 +9,7 @@ @@ -9,7 +9,7 @@
9 </view> 9 </view>
10 <view class="info" style="color: rgba({{textColor}});"> 10 <view class="info" style="color: rgba({{textColor}});">
11 <view class="texts font28r">桌位台号:</view> 11 <view class="texts font28r">桌位台号:</view>
12 - <view class="texts_right textsTable font28r">{{seller.tablesText}}</view> 12 + <view class="texts_right font28r">{{seller.tablesText}}</view>
13 </view> 13 </view>
14 <view class="info" style="color: rgba({{textColor}});"> 14 <view class="info" style="color: rgba({{textColor}});">
15 <view class="texts font28r">就餐人数:</view> 15 <view class="texts font28r">就餐人数:</view>
@@ -19,7 +19,11 @@ @@ -19,7 +19,11 @@
19 .texts_right { 19 .texts_right {
20 font-weight: 500; 20 font-weight: 500;
21 text-align: right; 21 text-align: right;
22 - width: 57%; 22 + width: 79%;
  23 + display: flex;
  24 + flex-wrap: wrap;
  25 + justify-content: flex-end;
  26 + word-break: break-all;
23 } 27 }
24 28
25 .info input { 29 .info input {
@@ -334,11 +338,4 @@ @@ -334,11 +338,4 @@
334 } 338 }
335 .btns .onebtns{ 339 .btns .onebtns{
336 width: 100%; 340 width: 100%;
337 -}  
338 -.textsTable{  
339 - display: -webkit-box;  
340 - word-break: break-all;  
341 - word-wrap: break-word;  
342 - overflow: hidden;  
343 - text-align: right;  
344 } 341 }
@@ -42,6 +42,9 @@ Page({ @@ -42,6 +42,9 @@ Page({
42 certificate:'', 42 certificate:'',
43 dataStr:Date.now()*1/1000, 43 dataStr:Date.now()*1/1000,
44 swich_phone:'0', 44 swich_phone:'0',
  45 + is_comments:'0',
  46 + is_user_comments:false,
  47 + cusdem:'',//备注 传参给意见反馈
45 }, 48 },
46 /** 49 /**
47 * 生命周期函数--监听页面加载 50 * 生命周期函数--监听页面加载
@@ -64,7 +67,6 @@ Page({ @@ -64,7 +67,6 @@ Page({
64 "statReachBottom": true, 67 "statReachBottom": true,
65 "lauchOpts": options, //渠道分析 68 "lauchOpts": options, //渠道分析
66 }); 69 });
67 - this.getDetail();  
68 }, 70 },
69 // 点击了解更多会员优惠政策 71 // 点击了解更多会员优惠政策
70 gotoFavourableList(){ 72 gotoFavourableList(){
@@ -77,7 +79,40 @@ Page({ @@ -77,7 +79,40 @@ Page({
77 wx.navigateTo({ 79 wx.navigateTo({
78 url 80 url
79 }) 81 })
80 - }, 82 + },
  83 + // 去评价
  84 + evaluateFun(){
  85 + let coupon_data_comments=this.data.marketing.coupon_data_comments;//赠送优惠券的列表
  86 + let coupon=this.data.marketing.is_comments_coupon;//评价赠送优惠券
  87 + let couponId,price,use;
  88 + if(coupon && coupon_data_comments && coupon_data_comments.length>0){
  89 + let obj=coupon_data_comments[0];
  90 + console.log('填写意见获取的券的信息',obj);
  91 + couponId=obj.id;
  92 + price=obj.price;
  93 + use=JSON.stringify(obj.use)
  94 + }
  95 + let record={
  96 + date:this.data.seller.date,
  97 + tablesText:this.data.seller.tablesText,
  98 + tableNum:this.data.detail.actual_pum?this.data.detail.actual_pum:this.data.tableNum,
  99 + cusdem:this.data.cusdem,
  100 + }
  101 + let url=util.http_build_query({
  102 + sellerName:this.data.seller.name,
  103 + record:JSON.stringify(record),
  104 + sellerid:this.data.seller.sid,
  105 + oid:this.data.detail.id,
  106 + types:'1',
  107 + coupon:coupon || '',
  108 + couponId:couponId || '',
  109 + price:price || '',
  110 + use:use || '',
  111 + },'/pages/pinglun/createOpinion')
  112 + wx.navigateTo({
  113 + url
  114 + })
  115 + },
81 /** 116 /**
82 * 用户点击右上角分享 117 * 用户点击右上角分享
83 */ 118 */
@@ -91,6 +126,7 @@ Page({ @@ -91,6 +126,7 @@ Page({
91 * 生命周期函数--监听页面显示 126 * 生命周期函数--监听页面显示
92 */ 127 */
93 onShow: function () { 128 onShow: function () {
  129 + this.getDetail()
94 }, 130 },
95 cli() { 131 cli() {
96 if(this.data.staffinfo.wechat){ 132 if(this.data.staffinfo.wechat){
@@ -152,6 +188,8 @@ Page({ @@ -152,6 +188,8 @@ Page({
152 this.setData({ 188 this.setData({
153 detail: this.formatDatail(reserev, dateSmart), 189 detail: this.formatDatail(reserev, dateSmart),
154 tableNum, 190 tableNum,
  191 + is_user_comments:res.data.is_user_comments,
  192 + cusdem:res.data.cusdem,
155 seller: { 193 seller: {
156 name: reserev.seller.sellername, 194 name: reserev.seller.sellername,
157 sid:reserev.sid, 195 sid:reserev.sid,
@@ -274,15 +312,17 @@ Page({ @@ -274,15 +312,17 @@ Page({
274 let data=res.data 312 let data=res.data
275 console.log('data',data); 313 console.log('data',data);
276 let coupon_dataList=[] 314 let coupon_dataList=[]
277 - let home,chef,marketing,reserve,swich_phone,signboard,store,homeColor,priceInfo,certificate,scoreInfo,recharge_list,stringifyUse; 315 + let home,chef,marketing,reserve,swich_phone,is_comments,signboard,store,homeColor,priceInfo,certificate,scoreInfo,recharge_list,stringifyUse;
278 chef = util.determine(data.chef); 316 chef = util.determine(data.chef);
279 reserve = util.determine(data.reserve); 317 reserve = util.determine(data.reserve);
280 - swich_phone = reserve && reserve.swich_phone?reserve.swich_phone:'';  
281 marketing = util.determine(data.marketing); 318 marketing = util.determine(data.marketing);
282 signboard = util.determine(data.signboard); 319 signboard = util.determine(data.signboard);
283 store = util.determine(data.store); 320 store = util.determine(data.store);
284 home = util.determine(data.home); 321 home = util.determine(data.home);
285 - let coupon=marketing?util.determine(marketing.coupon_data):'' 322 + swich_phone = reserve && reserve.swich_phone?reserve.swich_phone:'';
  323 + is_comments = marketing && marketing.is_comments?marketing.is_comments:'';
  324 + let coupon=marketing?util.determine(marketing.coupon_data):'';
  325 + marketing.coupon_data_comments=(marketing && is_comments=='1' && marketing.is_comments_coupon=='1')?util.determine(marketing.coupon_data_comments):'';
286 // is_cash 代金券 is_discount折扣券 is_dish菜品券 只有代金券有几折显示 326 // is_cash 代金券 is_discount折扣券 is_dish菜品券 只有代金券有几折显示
287 if(coupon && util.getType(coupon)=='object'){ 327 if(coupon && util.getType(coupon)=='object'){
288 coupon.stringifyUse=JSON.stringify(coupon.use) 328 coupon.stringifyUse=JSON.stringify(coupon.use)
@@ -318,7 +358,8 @@ Page({ @@ -318,7 +358,8 @@ Page({
318 stringifyUse, 358 stringifyUse,
319 coupon, 359 coupon,
320 coupon_dataList, 360 coupon_dataList,
321 - swich_phone 361 + swich_phone,
  362 + is_comments,
322 } 363 }
323 console.log('获取数据', {...obj}); 364 console.log('获取数据', {...obj});
324 if(marketing && marketing.is_recharge=='1' && marketing.recharge_data){ 365 if(marketing && marketing.is_recharge=='1' && marketing.recharge_data){
@@ -363,6 +404,7 @@ Page({ @@ -363,6 +404,7 @@ Page({
363 priceInfo, 404 priceInfo,
364 scoreInfo, 405 scoreInfo,
365 swich_phone, 406 swich_phone,
  407 + is_comments,
366 }) 408 })
367 if (home && home.red == '1' && home.green == '67' && home.blue == '163') { 409 if (home && home.red == '1' && home.green == '67' && home.blue == '163') {
368 this.setData({ 410 this.setData({
@@ -29,7 +29,7 @@ @@ -29,7 +29,7 @@
29 </view> 29 </view>
30 <view class="flex-11" wx:if="{{seller.tablesText}}"> 30 <view class="flex-11" wx:if="{{seller.tablesText}}">
31 <view class="label">【包间】</view> 31 <view class="label">【包间】</view>
32 - <view class="contentData">{{seller.tablesText}}</view> 32 + <view class="contentData room">{{seller.tablesText}}</view>
33 </view> 33 </view>
34 <view class="flex-11" wx:if="{{detail.actual_pum || tableNum}}"> 34 <view class="flex-11" wx:if="{{detail.actual_pum || tableNum}}">
35 <view class="label">【人数】</view> 35 <view class="label">【人数】</view>
@@ -43,9 +43,6 @@ @@ -43,9 +43,6 @@
43 <view class="label">【联系】</view> 43 <view class="label">【联系】</view>
44 <view class="contentData">{{reserve.seller_phone?reserve.seller_phone:detail.seller.phone}}</view> 44 <view class="contentData">{{reserve.seller_phone?reserve.seller_phone:detail.seller.phone}}</view>
45 </view> 45 </view>
46 - <view class="welcome">  
47 - 欢迎垂询,恭候光临!  
48 - </view>  
49 <block wx:if="{{staffinfo && reserve.swich_manager=='1'}}"> 46 <block wx:if="{{staffinfo && reserve.swich_manager=='1'}}">
50 <view class="handleInfo"> 47 <view class="handleInfo">
51 <image wx:if="{{staffinfo && staffinfo.photo}}" src="{{staffinfo.photo}}" class="headerimg" mode="aspectFill"></image> 48 <image wx:if="{{staffinfo && staffinfo.photo}}" src="{{staffinfo.photo}}" class="headerimg" mode="aspectFill"></image>
@@ -59,12 +56,15 @@ @@ -59,12 +56,15 @@
59 </view> 56 </view>
60 </view> 57 </view>
61 </block> 58 </block>
  59 + <view class="welcome">
  60 + 欢迎垂询,恭候光临!
  61 + </view>
62 </view> 62 </view>
63 </view> 63 </view>
64 <view class="positioning" bindtap="looklocation"> 64 <view class="positioning" bindtap="looklocation">
65 - <image src="https://qn.colorcun.com/WechatIMG256.png" mode="" /> 65 + <image src="https://qn.colorcun.com/address.png" mode="" />
66 <view class="name"> 66 <view class="name">
67 - <text>{{seller.name?seller.name:reserve.seller_name}}</text> 67 + <text>【{{seller.name?seller.name:reserve.seller_name}}】</text>
68 <text>{{seller.addr?seller.addr:reserev.seller.map_address}}</text> 68 <text>{{seller.addr?seller.addr:reserev.seller.map_address}}</text>
69 </view> 69 </view>
70 </view> 70 </view>
@@ -96,6 +96,11 @@ @@ -96,6 +96,11 @@
96 </view> 96 </view>
97 </view> 97 </view>
98 </view> 98 </view>
  99 + <view wx:if="{{is_comments=='1' && !is_user_comments}}" class="evaluateBox" bindtap="evaluateFun">
  100 + <text wx:if="{{is_comments=='1' && marketing.is_comments_coupon!='1'}}">{{'想吐槽?戳这里填写意见!-->'}}</text>
  101 + <text wx:if="{{marketing.is_comments_coupon=='1'}}">想吐槽?戳这里填写意见反馈赢好礼!</text>
  102 + <image src="https://qn.colorcun.com/evaluate.png" mode=""/>
  103 + </view>
99 <!-- <view class="visitor"> 104 <!-- <view class="visitor">
100 确认赴约客人:{{keepAppointment.length}}位 105 确认赴约客人:{{keepAppointment.length}}位
101 </view> 106 </view>
@@ -107,14 +107,14 @@ @@ -107,14 +107,14 @@
107 line-height: 40rpx; 107 line-height: 40rpx;
108 color: #000000; 108 color: #000000;
109 font-family: PingFang SC; 109 font-family: PingFang SC;
110 - font-size: 28rpx; 110 + font-size: 32rpx;
111 } 111 }
112 112
113 .label { 113 .label {
114 flex-shrink: 0; 114 flex-shrink: 0;
115 color: #000000; 115 color: #000000;
116 font-family: PingFang SC; 116 font-family: PingFang SC;
117 - font-size: 28rpx; 117 + font-size: 32rpx;
118 } 118 }
119 119
120 .contentData { 120 .contentData {
@@ -122,7 +122,7 @@ @@ -122,7 +122,7 @@
122 line-height: 40rpx; 122 line-height: 40rpx;
123 color: #000000; 123 color: #000000;
124 font-family: PingFang SC; 124 font-family: PingFang SC;
125 - font-size: 28rpx; 125 + font-size: 32rpx;
126 } 126 }
127 127
128 .handleInfo { 128 .handleInfo {
@@ -187,19 +187,19 @@ @@ -187,19 +187,19 @@
187 } 187 }
188 188
189 .positioning { 189 .positioning {
190 - margin: 16rpx 26rpx; 190 + margin: 16rpx 40rpx;
191 display: flex; 191 display: flex;
192 box-sizing: border-box; 192 box-sizing: border-box;
193 justify-content: center; 193 justify-content: center;
194 - background: #D9D9D9; 194 + background: #F8F9FD;
195 padding: 16rpx 20rpx 16rpx 30rpx; 195 padding: 16rpx 20rpx 16rpx 30rpx;
196 border-radius: 10rpx; 196 border-radius: 10rpx;
197 align-items: center; 197 align-items: center;
198 } 198 }
199 199
200 .positioning image { 200 .positioning image {
201 - width: 72rpx;  
202 - height: 116rpx; 201 + width: 60rpx;
  202 + height: 71rpx;
203 margin-right: 38rpx; 203 margin-right: 38rpx;
204 } 204 }
205 205
@@ -463,7 +463,7 @@ @@ -463,7 +463,7 @@
463 } 463 }
464 464
465 .preferential { 465 .preferential {
466 - margin: 16rpx 26rpx; 466 + margin: 16rpx 40rpx;
467 } 467 }
468 468
469 .preferentialItems { 469 .preferentialItems {
@@ -529,7 +529,7 @@ @@ -529,7 +529,7 @@
529 529
530 .price{ 530 .price{
531 display: flex; 531 display: flex;
532 - align-items: flex-end; 532 + align-items: center;
533 justify-content: center; 533 justify-content: center;
534 } 534 }
535 535
@@ -646,4 +646,21 @@ @@ -646,4 +646,21 @@
646 color: #fff !important; 646 color: #fff !important;
647 font-weight: normal; 647 font-weight: normal;
648 width: 27% !important; 648 width: 27% !important;
  649 +}
  650 +.room{
  651 + font-weight: 600;
  652 +}
  653 +.evaluateBox{
  654 + margin: 16rpx 84rpx 16rpx 40rpx;
  655 + display: flex;
  656 + align-items: center;
  657 + justify-content: space-between;
  658 +}
  659 +.evaluateBox image{
  660 + width: 60rpx;
  661 + height: 70rpx;
  662 +}
  663 +.evaluateBox text{
  664 + color: #000;
  665 + font-size: 28rpx;
649 } 666 }
@@ -47,7 +47,6 @@ Page({ @@ -47,7 +47,6 @@ Page({
47 sizeType:['compressed'], //['original', 'compressed'] 所选的图片的尺寸,超大图片 compressed 会引起开卡顿 47 sizeType:['compressed'], //['original', 'compressed'] 所选的图片的尺寸,超大图片 compressed 会引起开卡顿
48 sourceType:['album', 'camera'], //['album', 'camera'] 选择图片的来源 48 sourceType:['album', 'camera'], //['album', 'camera'] 选择图片的来源
49 }, 49 },
50 - files:[], //组件数据放入这里展示到页面上  
51 hasAddFile:true,//出现上传加号 50 hasAddFile:true,//出现上传加号
52 isnoshow:1, //是否匿名 51 isnoshow:1, //是否匿名
53 filesHttps:[], 52 filesHttps:[],
@@ -128,7 +127,6 @@ Page({ @@ -128,7 +127,6 @@ Page({
128 tpupload(e){ 127 tpupload(e){
129 this.setData({ 128 this.setData({
130 filesHttps:e.detail.filesHttps, 129 filesHttps:e.detail.filesHttps,
131 - files:e.detail.files,  
132 }) 130 })
133 }, 131 },
134 displayImage(e){ 132 displayImage(e){
  1 +// pages/pinglun/createOpinion.js
  2 +import util from '../../utils/util';
  3 +import App from '../../utils/api'
  4 +Page({
  5 +
  6 + /**
  7 + * 页面的初始数据
  8 + */
  9 + data: {
  10 + options: {},
  11 + filesHttps: [],
  12 + },
  13 + text: '',
  14 + /**
  15 + * 生命周期函数--监听页面加载
  16 + */
  17 + onLoad(options) {
  18 + let data = options
  19 + data.record = util.determine(options.record)
  20 + this.setData({
  21 + options: data
  22 + })
  23 + console.log('options', {
  24 + ...data
  25 + });
  26 + },
  27 + // 获取上传的图片或者视频
  28 + tpupload(e) {
  29 + this.setData({
  30 + filesHttps: e.detail.filesHttps,
  31 + })
  32 + },
  33 + textareaInput(e) {
  34 + this.text = util.val(e).trim();
  35 + },
  36 + // 提交
  37 + submit() {
  38 + if (this.text == '') {
  39 + return wx.showToast({
  40 + icon: 'none',
  41 + title: '请填写意见反馈!',
  42 + })
  43 + }
  44 + wx.showLoading({
  45 + title: '提交中',
  46 + })
  47 + let params = {
  48 + sid: this.data.options.sellerid,
  49 + rid: this.data.options.oid,
  50 + author_openid: getApp().openid,
  51 + enclosure: JSON.stringify(this.data.filesHttps),
  52 + identity: 1,
  53 + text: this.text,
  54 + types: this.data.options.types, //types为1时 rid就是预订ID types为2时 rid就是套餐ID types为3时 rid就是卡券ID
  55 + isnoshow: '1', //匿名评价 1 开 0 关
  56 + }
  57 + console.log({
  58 + ...params
  59 + });
  60 + App.User.SetComment(params).then(res => {
  61 + if (res.ret != 200) {
  62 + wx.hideLoading()
  63 + return wx.showToast({
  64 + icon: 'none',
  65 + title: res.msg,
  66 + })
  67 + }
  68 + let url = ''
  69 + let options = this.data.options
  70 + // 有券
  71 + if (this.options.coupon == '1') {
  72 + url = util.http_build_query({
  73 + sellerName: options.sellerName,
  74 + coupon: options.coupon,
  75 + couponId: options.couponId || '',
  76 + coupon: options.coupon || '',
  77 + price: options.price || '',
  78 + use: options.use || '',
  79 + oid: options.oid,
  80 + sid: options.sellerid,
  81 + }, './opinionSuccess')
  82 + } else { //没券
  83 + url = util.http_build_query({
  84 + sellerName: options.sellerName,
  85 + coupon: options.coupon, //1有券 2没有券
  86 + couponId: options.couponId || '',
  87 + }, './opinionSuccess')
  88 + }
  89 + wx.redirectTo({
  90 + url
  91 + })
  92 + if (url) {
  93 + wx.hideLoading()
  94 + }
  95 + }).catch(e => {
  96 + wx.hideLoading()
  97 + console.log('catch', e);
  98 + wx.showToast({
  99 + icon: 'none',
  100 + title: e.msg,
  101 + })
  102 + })
  103 + },
  104 + /**
  105 + * 生命周期函数--监听页面初次渲染完成
  106 + */
  107 + onReady() {
  108 +
  109 + },
  110 +
  111 + /**
  112 + * 生命周期函数--监听页面显示
  113 + */
  114 + onShow() {
  115 +
  116 + },
  117 +
  118 + /**
  119 + * 生命周期函数--监听页面隐藏
  120 + */
  121 + onHide() {
  122 +
  123 + },
  124 +
  125 + /**
  126 + * 生命周期函数--监听页面卸载
  127 + */
  128 + onUnload() {
  129 +
  130 + },
  131 +
  132 + /**
  133 + * 页面相关事件处理函数--监听用户下拉动作
  134 + */
  135 + onPullDownRefresh() {
  136 +
  137 + },
  138 +
  139 + /**
  140 + * 页面上拉触底事件的处理函数
  141 + */
  142 + onReachBottom() {
  143 +
  144 + },
  145 +
  146 + /**
  147 + * 用户点击右上角分享
  148 + */
  149 + onShareAppMessage() {
  150 +
  151 + }
  152 +})
  1 +{
  2 + "backgroundTextStyle": "light",
  3 + "navigationBarBackgroundColor": "#4d4e50",
  4 + "navigationBarTextStyle": "white",
  5 + "usingComponents": {
  6 + "nav":"/components/nav/nav",
  7 + "tpupload": "/components/tpupload/tpupload"
  8 + }
  9 +}
  1 +<!--pages/pinglun/createOpinion.wxml 填写意见反馈页面-->
  2 +<nav color="#515151">{{options.sellerName}}</nav>
  3 +<view class="box">
  4 + <view class="info">
  5 + <view class="texts font28r">就餐时间:</view>
  6 + <view class="texts_right font28r">{{options.record.date}}</view>
  7 + </view>
  8 + <view class="info">
  9 + <view class="texts font28r">桌位台号:</view>
  10 + <view class="texts_right font28r">{{options.record.tablesText}}</view>
  11 + </view>
  12 + <view class="info">
  13 + <view class="texts font28r">就餐人数:</view>
  14 + <view class="texts_right font28r">{{options.record.tableNum}}</view>
  15 + </view>
  16 + <view class="info">
  17 + <view class="texts font28r">备注信息:</view>
  18 + <view wx:if="{{options.record.cusdem}}" class="texts_right font28r">{{options.record.cusdem}}</view>
  19 + </view>
  20 +</view>
  21 +<view class="main">
  22 + <textarea class="margin-top-lg text-df textarea" bindinput="textareaInput" cols="30" rows="10" placeholder="麻烦点这里输入您的意见反馈。\n\n\n可以帮助我们持续改进,给您带来更好的服务品质,谢谢啦!" placeholder-style="color:#999999;font-size:30rpx;"></textarea>
  23 + <tpupload bind:tpupload="tpupload" tpNum='6'></tpupload>
  24 +</view>
  25 +<button class="btn" bindtap="submit">提交</button>
  1 +/* pages/pinglun/createOpinion.wxss */
  2 +.box {
  3 + padding: 24rpx 0 30rpx 0;
  4 + margin: 0 40rpx;
  5 + border-bottom: 2rpx solid #515151;
  6 +}
  7 +
  8 +.info {
  9 + margin-bottom: 16rpx;
  10 + display: flex;
  11 + justify-content: space-between;
  12 +}
  13 +
  14 +.texts {
  15 + font-weight: 500;
  16 +}
  17 +
  18 +.texts_right {
  19 + font-weight: 500;
  20 + text-align: right;
  21 + width: 79%;
  22 + display: flex;
  23 + flex-wrap: wrap;
  24 + justify-content: flex-end;
  25 + word-break: break-all;
  26 +}
  27 +
  28 +.textarea {
  29 + width: 100%;
  30 + height: 370rpx;
  31 + font-size: 30rpx;
  32 + line-height: 42rpx;
  33 + margin-top: 36rpx 0 20rpx 0;
  34 + word-wrap: break-word;
  35 + white-space: pre-line
  36 +}
  37 +
  38 +.textarea-placeholder {
  39 + font-size: 30rpx;
  40 + font-family: PingFangSC-Regular, PingFang SC;
  41 + font-weight: 400;
  42 + color: #999999 !important;
  43 + line-height: 42rpx;
  44 +}
  45 +
  46 +.main {
  47 + padding: 0 40rpx;
  48 + margin: 36rpx 0 42rpx 0;
  49 +}
  50 +
  51 +.btn {
  52 + margin: 0 40rpx;
  53 + font-weight: 500;
  54 + font-size: 32rpx;
  55 + color: #f8f9fd;
  56 + border-radius: 42rpx;
  57 + background: linear-gradient(104.24deg, #4c8dad -57.47%, #0143a3 55.72%, #42a5ff 148.72%);
  58 +}
  1 +// pages/pinglun/opinionSuccess.js
  2 +import App from '../../utils/api'
  3 +import util from '../../utils/util';
  4 +Page({
  5 +
  6 + /**
  7 + * 页面的初始数据
  8 + */
  9 + data: {
  10 + options: {}
  11 + },
  12 +
  13 + /**
  14 + * 生命周期函数--监听页面加载
  15 + */
  16 + onLoad: function (options) {
  17 + console.log('options', options);
  18 + this.setData({
  19 + options,
  20 + })
  21 + },
  22 + seeCoupon() {
  23 + wx.showLoading({
  24 + title: '加载中',
  25 + })
  26 + let options = this.data.options
  27 + // 金额大于0 需要购买券
  28 + if (options.coupon == '1' && options.price * 1 > 0) {
  29 + let url = util.http_build_query({
  30 + id: options.couponId,
  31 + name: options.sellerName,
  32 + oid: options.oid,
  33 + sid: options.sid,
  34 + types: '1',
  35 + use: options.use ? JSON.stringify(options.use) : '',
  36 + }, '/pack-activity/pack/buyCoupon')
  37 + wx.hideLoading()
  38 + wx.redirectTo({
  39 + url
  40 + })
  41 + } else { //金额为0 直接领券后跳转到我的券页面
  42 + App.Activity.CreateNewRechargeOrder({
  43 + recharge_id: options.couponId,
  44 + sellerid: options.sid,
  45 + number: '1',
  46 + price: options.price,
  47 + type: '1',
  48 + }).then(res => {
  49 + if (res.ret == '200') {
  50 + wx.hideLoading()
  51 + let price = res.data.price;
  52 + if (price == 0) {
  53 + wx.showToast({
  54 + icon: 'none',
  55 + title: '购买成功',
  56 + })
  57 + wx.reLaunch({
  58 + url: '/pages/me/coupon_news'
  59 + })
  60 + return
  61 + }
  62 + } else {
  63 + wx.hideLoading()
  64 + wx.showToast({
  65 + title: res.msg,
  66 + duration: 2000,
  67 + mask: true
  68 + })
  69 + }
  70 + })
  71 + }
  72 + },
  73 + /**
  74 + * 生命周期函数--监听页面初次渲染完成
  75 + */
  76 + onReady: function () {
  77 +
  78 + },
  79 +
  80 + /**
  81 + * 生命周期函数--监听页面显示
  82 + */
  83 + onShow: function () {
  84 +
  85 + },
  86 +
  87 + /**
  88 + * 生命周期函数--监听页面隐藏
  89 + */
  90 + onHide: function () {
  91 +
  92 + },
  93 +
  94 + /**
  95 + * 生命周期函数--监听页面卸载
  96 + */
  97 + onUnload: function () {
  98 +
  99 + },
  100 +
  101 + /**
  102 + * 页面相关事件处理函数--监听用户下拉动作
  103 + */
  104 + onPullDownRefresh: function () {
  105 +
  106 + },
  107 +
  108 + /**
  109 + * 页面上拉触底事件的处理函数
  110 + */
  111 + onReachBottom: function () {
  112 +
  113 + },
  114 +
  115 + /**
  116 + * 用户点击右上角分享
  117 + */
  118 + onShareAppMessage: function () {
  119 +
  120 + }
  121 +})
  1 +{
  2 + "navigationBarBackgroundColor": "#ffffff",
  3 + "navigationBarTextStyle": "black",
  4 + "usingComponents": {
  5 + "nav":"/components/nav/nav"
  6 + }
  7 + }
  1 +<!--pages/pinglun/opinionSuccess.wxml-->
  2 +<nav>{{options.sellerName}}</nav>
  3 +<view class="flexView">
  4 + <view class="imgBox">
  5 + <image src="http://nosqn.colorcun.com/pinglun/p%20%288%29.png" style="width: 60rpx;height: 60rpx;"></image>
  6 + <view class="texts">感谢您的评价!</view>
  7 + </view>
  8 + <view wx:if="{{options.coupon=='0'}}" class="text font28r">我们会加倍用功,努力做到更好!期待您的再次光临!</view>
  9 + <view wx:if="{{options.coupon=='1'}}" class="text font28r">我们特地给您准备了小礼物一份,请笑纳!</view>
  10 +
  11 + <button wx:if="{{options.coupon=='1'}}" bindtap="seeCoupon" class="margin-top mylist">去查看</button>
  12 + <view wx:if="{{options.coupon=='1'}}" class="font28r info">我们会加倍用功,努力做到更好!期待您的再次光临!</view>
  13 +</view>
  1 +/* pages/pinglun/opinionSuccess.wxss */
  2 +.flexView {
  3 + display: flex;
  4 + flex-direction: column;
  5 + align-items: center;
  6 +}
  7 +
  8 +.imgBox {
  9 + margin-top: 80rpx;
  10 + display: flex;
  11 + align-items: center;
  12 +}
  13 +
  14 +.imgBox image {
  15 + width: 90rpx;
  16 + height: 90rpx;
  17 +}
  18 +
  19 +.texts {
  20 + font-weight: bold;
  21 + font-size: 38rpx;
  22 + margin-left: 20rpx;
  23 +}
  24 +
  25 +.mylist {
  26 + padding: 0 36rpx;
  27 + border-radius: 40rpx;
  28 + border: 2rpx solid #0143A3;
  29 + font-size: 24rpx;
  30 + font-family: PingFangSC-Semibold, PingFang SC;
  31 + font-weight: 600;
  32 + color: #0143A3;
  33 + text-align: center;
  34 + margin-bottom: 200rpx;
  35 +}
  36 +
  37 +.text {
  38 + color: #000;
  39 + margin: 50rpx 96rpx;
  40 +}
  41 +
  42 +.info {
  43 + color: #000;
  44 + margin: 0 96rpx;
  45 +}