Commit ad422e9466a8bfba6e03643fdff5e1e3419c25b5
1 parent
e8a6cbaa
首页,评价有礼
Showing
3 changed files
with
43 additions
and
14 deletions
packageB/pages/evaluate/evaluate.js
@@ -26,6 +26,7 @@ Page({ | @@ -26,6 +26,7 @@ Page({ | ||
26 | is_act:0, //是否能购获取图片 | 26 | is_act:0, //是否能购获取图片 |
27 | actId:0, //活动ID | 27 | actId:0, //活动ID |
28 | giftBagId:0, //礼包ID | 28 | giftBagId:0, //礼包ID |
29 | + ftype:0 | ||
29 | 30 | ||
30 | }, | 31 | }, |
31 | //点击星级 | 32 | //点击星级 |
@@ -98,8 +99,19 @@ Page({ | @@ -98,8 +99,19 @@ Page({ | ||
98 | 99 | ||
99 | //查询美导信息 | 100 | //查询美导信息 |
100 | query_bea: function() { | 101 | query_bea: function() { |
101 | - var th = this; | ||
102 | - var url = "/api/weshop/order/pagePosOrder"; | 102 | + var th = this; |
103 | + var url = "/api/weshop/order/pagePosOrder"; | ||
104 | + | ||
105 | + switch (this.data.ftype){ | ||
106 | + case 3: | ||
107 | + break; | ||
108 | + case 4: | ||
109 | + url = "/api/weshop/serviceCard/pagePos"; | ||
110 | + break; | ||
111 | + default: | ||
112 | + break | ||
113 | + } | ||
114 | + | ||
103 | var number = th.data.number; //订单编号 | 115 | var number = th.data.number; //订单编号 |
104 | getApp().request.promiseGet(url, { | 116 | getApp().request.promiseGet(url, { |
105 | data: { | 117 | data: { |
@@ -175,10 +187,10 @@ Page({ | @@ -175,10 +187,10 @@ Page({ | ||
175 | var url = th.data.url + "/api/weshop/evaluation/evaluate/insert"; | 187 | var url = th.data.url + "/api/weshop/evaluation/evaluate/insert"; |
176 | var posNo = th.data.number; //收银单号 | 188 | var posNo = th.data.number; //收银单号 |
177 | var proposal = th.data.proposal; //用户建议内容 | 189 | var proposal = th.data.proposal; //用户建议内容 |
178 | - var fromType = th.data.fromType; //评价来源 | 190 | + var fromType = th.data.ftype?th.data.ftype:1; //评价来源 |
179 | var json = { | 191 | var json = { |
180 | "evaLabList": evaLabList, | 192 | "evaLabList": evaLabList, |
181 | - "fromType": 1, | 193 | + "fromType": fromType, |
182 | "number": posNo, | 194 | "number": posNo, |
183 | "remark": proposal, | 195 | "remark": proposal, |
184 | "star": stars + 1, | 196 | "star": stars + 1, |
@@ -197,9 +209,15 @@ Page({ | @@ -197,9 +209,15 @@ Page({ | ||
197 | if (res.data.code == 0) { | 209 | if (res.data.code == 0) { |
198 | getApp().my_warnning("评价成功", 1, th); | 210 | getApp().my_warnning("评价成功", 1, th); |
199 | var namber=th.data.number; | 211 | var namber=th.data.number; |
212 | + | ||
213 | + var url="/packageB/pages/evaluate_list/evaluate_list?IsEvaluate=1"; | ||
214 | + if(this.data.ftype==4){ | ||
215 | + url="/pages/user/index/index"; | ||
216 | + } | ||
217 | + | ||
200 | setTimeout(function() { | 218 | setTimeout(function() { |
201 | wx.redirectTo({ | 219 | wx.redirectTo({ |
202 | - url: "/packageB/pages/evaluate_list/evaluate_list?IsEvaluate=1" | 220 | + url: url |
203 | }); | 221 | }); |
204 | }, 2000); | 222 | }, 2000); |
205 | } else { | 223 | } else { |
@@ -218,11 +236,17 @@ Page({ | @@ -218,11 +236,17 @@ Page({ | ||
218 | number: options.number, | 236 | number: options.number, |
219 | //is_evaluate: options.evaluate | 237 | //is_evaluate: options.evaluate |
220 | }) | 238 | }) |
239 | + | ||
240 | + if(options.fromtype){ | ||
241 | + this.setData({ftype:parseInt(options.fromtype)}) ; | ||
242 | + if(options.fromtype==4) th.judge_act(); | ||
243 | + } | ||
221 | //th.query_bea(); | 244 | //th.query_bea(); |
222 | - //th.judge_act(); | 245 | + |
223 | var userinfo=getApp().globalData.userInfo; | 246 | var userinfo=getApp().globalData.userInfo; |
224 | console.log("userinfo",userinfo) | 247 | console.log("userinfo",userinfo) |
225 | - | 248 | + |
249 | + | ||
226 | if(!userinfo){ | 250 | if(!userinfo){ |
227 | getApp().goto("/pages/togoin/togoin"); | 251 | getApp().goto("/pages/togoin/togoin"); |
228 | } | 252 | } |
@@ -260,9 +284,11 @@ Page({ | @@ -260,9 +284,11 @@ Page({ | ||
260 | 284 | ||
261 | var id=this.data.actId; | 285 | var id=this.data.actId; |
262 | var gifbagid = this.data.gifbagid; | 286 | var gifbagid = this.data.gifbagid; |
263 | - console.log(id,"订单", this.data.number), | 287 | + console.log(id,"订单", this.data.number); |
288 | + | ||
289 | + var ty=this.data.ftype?this.data.ftype:2; | ||
264 | wx.redirectTo({ | 290 | wx.redirectTo({ |
265 | - url: "/pages/giftpack/evaluategift/evaluategift?actId="+id+ "&orderType=2&orderNumber="+this.data.number | 291 | + url: "/pages/giftpack/evaluategift/evaluategift?actId="+id+ "&orderType="+ty+"&orderNumber="+this.data.number |
266 | }); | 292 | }); |
267 | 293 | ||
268 | }, | 294 | }, |
@@ -271,10 +297,13 @@ Page({ | @@ -271,10 +297,13 @@ Page({ | ||
271 | judge_act: function () { | 297 | judge_act: function () { |
272 | var th = this; | 298 | var th = this; |
273 | var url = "/api/weshop/marketing/comment/act/judge"; | 299 | var url = "/api/weshop/marketing/comment/act/judge"; |
300 | + | ||
301 | + var ty=this.data.ftype?this.data.ftype:2; | ||
302 | + | ||
274 | getApp().request.promiseGet(url, { | 303 | getApp().request.promiseGet(url, { |
275 | data: { | 304 | data: { |
276 | orderNumber: th.data.number, | 305 | orderNumber: th.data.number, |
277 | - orderType: 2, | 306 | + orderType: ty, |
278 | storeId: a.stoid, | 307 | storeId: a.stoid, |
279 | userId: d.user_id | 308 | userId: d.user_id |
280 | } | 309 | } |
packageB/pages/evaluate/evaluate.wxml
@@ -94,13 +94,14 @@ | @@ -94,13 +94,14 @@ | ||
94 | </navigator> | 94 | </navigator> |
95 | <view wx:else> | 95 | <view wx:else> |
96 | 96 | ||
97 | - | 97 | +<block wx:if="{{ftype!=4}}"> |
98 | <view style="margin: auto;margin-bottom: 30rpx;" class="Submission flex-center" bindtap="evaluate_qt"> | 98 | <view style="margin: auto;margin-bottom: 30rpx;" class="Submission flex-center" bindtap="evaluate_qt"> |
99 | <view>评价其他</view> | 99 | <view>评价其他</view> |
100 | </view> | 100 | </view> |
101 | <view style="margin: auto;margin-bottom: 30rpx;" class="Submission flex-center" bindtap="evaluate_qt" data-status="1"> | 101 | <view style="margin: auto;margin-bottom: 30rpx;" class="Submission flex-center" bindtap="evaluate_qt" data-status="1"> |
102 | <view>查看已评价的订单</view> | 102 | <view>查看已评价的订单</view> |
103 | </view> | 103 | </view> |
104 | +</block> | ||
104 | 105 | ||
105 | <!-- 显示来个图标 --> | 106 | <!-- 显示来个图标 --> |
106 | <view class="show_icon" style="margin-top: 60rpx;"> | 107 | <view class="show_icon" style="margin-top: 60rpx;"> |
@@ -133,7 +134,7 @@ | @@ -133,7 +134,7 @@ | ||
133 | <view class="title">商品详情</view> | 134 | <view class="title">商品详情</view> |
134 | <view style="padding: 0 20rpx;"> | 135 | <view style="padding: 0 20rpx;"> |
135 | <view class="flex jc_sb fs30" style="margin-top: 20rpx;" wx:for="{{show_goods_list}}"> | 136 | <view class="flex jc_sb fs30" style="margin-top: 20rpx;" wx:for="{{show_goods_list}}"> |
136 | - <view>{{item.WareName}}</view> | 137 | + <view>{{item.WareName?item.WareName:item.ItemName}}</view> |
137 | <view>{{item.Qty}}</view> | 138 | <view>{{item.Qty}}</view> |
138 | </view> | 139 | </view> |
139 | </view> | 140 | </view> |
pages/index/index/index.js
@@ -97,7 +97,7 @@ Page({ | @@ -97,7 +97,7 @@ Page({ | ||
97 | }else{ | 97 | }else{ |
98 | var cache_scene= wx.setStorageSync('launch'); | 98 | var cache_scene= wx.setStorageSync('launch'); |
99 | //看一下有没有缓存,没有缓存,或者缓存的值不一样,就开始判断公众号关注组件 | 99 | //看一下有没有缓存,没有缓存,或者缓存的值不一样,就开始判断公众号关注组件 |
100 | - if(!cache_scene || cache_scene!=obj.scene){ | 100 | + if(!cache_scene){ |
101 | if (obj.scene === 1011 || obj.scene === 1012 || obj.scene === 1013 || obj.scene === 1017 || | 101 | if (obj.scene === 1011 || obj.scene === 1012 || obj.scene === 1013 || obj.scene === 1017 || |
102 | obj.scene === 1047 ||obj.scene === 1089 || obj.scene === 1038 || tt.scancode_time) { | 102 | obj.scene === 1047 ||obj.scene === 1089 || obj.scene === 1038 || tt.scancode_time) { |
103 | this.setData({is_ok_h5:1}) | 103 | this.setData({is_ok_h5:1}) |
@@ -108,7 +108,6 @@ Page({ | @@ -108,7 +108,6 @@ Page({ | ||
108 | } | 108 | } |
109 | }else{ | 109 | }else{ |
110 | this.setData({is_ok_h5:0}) | 110 | this.setData({is_ok_h5:0}) |
111 | - wx.setStorageSync('launch',0); | ||
112 | } | 111 | } |
113 | 112 | ||
114 | } | 113 | } |