Commit 23cf0476d510a1179493ad94911aabc533fa49b7
1 parent
ab1086fc
评价有礼的bug修改
Showing
3 changed files
with
42 additions
and
22 deletions
pages/giftpack/evaluategift/evaluategift.js
... | ... | @@ -30,6 +30,7 @@ Page({ |
30 | 30 | is_sub: 0, //是否重复领取 |
31 | 31 | orderNumber: "", //订单号 |
32 | 32 | orderGoodsId: "", //商品id |
33 | + orderType:1, | |
33 | 34 | }, |
34 | 35 | GetList: function() { |
35 | 36 | var th = this; |
... | ... | @@ -41,7 +42,7 @@ Page({ |
41 | 42 | "storeId": a.stoid, //商家Id |
42 | 43 | "userId": d.user_id, //用户ID |
43 | 44 | "orderNumber": th.data.orderNumber, |
44 | - "orderType": 1, | |
45 | + "orderType": th.data.orderType, | |
45 | 46 | "orderGoodsId": th.data.orderGoodsId, |
46 | 47 | "gifbagid": th.data.giftBagId |
47 | 48 | } |
... | ... | @@ -122,6 +123,13 @@ Page({ |
122 | 123 | orderGoodsId: options.orderGoodsId, |
123 | 124 | giftBagId: options.giftBagId |
124 | 125 | }) |
126 | + | |
127 | + var orderType = options.orderType; | |
128 | + if (orderType) { | |
129 | + th.setData({ orderType: orderType}) | |
130 | + } | |
131 | + | |
132 | + | |
125 | 133 | th.GetList(); |
126 | 134 | }, |
127 | 135 | onShow: function() { |
... | ... | @@ -148,7 +156,7 @@ Page({ |
148 | 156 | "storeId": a.stoid, //商家Id |
149 | 157 | "userId": d.user_id, //用户ID |
150 | 158 | "orderNumber": th.data.orderNumber, |
151 | - "orderType": 1, | |
159 | + "orderType": th.data.orderType, | |
152 | 160 | "orderGoodsId": th.data.orderGoodsId, |
153 | 161 | "giftBagId": th.data.giftBagId |
154 | 162 | }; | ... | ... |
pages/user/my_service/tment_eval.js
... | ... | @@ -23,6 +23,10 @@ Page({ |
23 | 23 | arrangeTime: "", //服务日期 |
24 | 24 | is_evaluate: 0, //是否评价 |
25 | 25 | EvaluateDatetime: "", //评价时间 |
26 | + is_act:0, //是否能购获取图片 | |
27 | + actId:0, //活动ID | |
28 | + giftBagId:0, //礼包ID | |
29 | + | |
26 | 30 | }, |
27 | 31 | //点击星级 |
28 | 32 | check_stars: function(e) { |
... | ... | @@ -219,6 +223,7 @@ Page({ |
219 | 223 | is_evaluate: options.evaluate |
220 | 224 | }) |
221 | 225 | th.query_bea(); |
226 | + th.judge_act(); | |
222 | 227 | }, |
223 | 228 | |
224 | 229 | /** |
... | ... | @@ -240,29 +245,37 @@ Page({ |
240 | 245 | }, |
241 | 246 | //点击领取礼包 |
242 | 247 | clike_lb:function(){ |
243 | - | |
244 | - var dd=this.data.number; | |
248 | + | |
249 | + var id=this.data.actId; | |
250 | + var gifbagid = this.data.gifbagid; | |
251 | + wx.redirectTo({ | |
252 | + url: "/pages/giftpack/evaluategift/evaluategift?actId=" + id + "&gifbagid=&orderType=2&orderNumber="+this.data.number | |
253 | + }); | |
254 | + | |
255 | + }, | |
256 | + | |
257 | + //--评价有礼判断--- | |
258 | + judge_act: function () { | |
259 | + var th = this; | |
245 | 260 | var url = "/api/weshop/marketing/comment/act/judge"; |
246 | 261 | getApp().request.promiseGet(url, { |
247 | 262 | data: { |
248 | - userId: d.user_id, | |
263 | + orderNumber: th.data.number, | |
264 | + orderType: 2, | |
249 | 265 | storeId: a.stoid, |
250 | - orderType: 2,//评价类型 1=商城订单评价 2=美容师评价 | |
251 | - orderNumber: dd | |
266 | + userId: d.user_id | |
252 | 267 | } |
253 | 268 | }).then(res => { |
254 | - | |
255 | - if (res.data.code==0){ | |
256 | - var data=res.data.data; | |
257 | - var id=data.id; | |
258 | - var gifbagid = data.gifbagid; | |
259 | - var type= data.type | |
260 | - | |
261 | - wx.redirectTo({ | |
262 | - url: "/pages/giftpack/evaluategift/evaluategift?actId=" + id + "&gifbagid=" + gifbagid + "&orderType=" + type | |
263 | - }); | |
264 | - } | |
269 | + if (res.data.code == 0) { | |
270 | + var id = res.data.data.id; | |
271 | + var giftbagid = res.data.data.giftbagid; | |
272 | + th.setData({ | |
273 | + is_act: 1, | |
274 | + actId: id, | |
275 | + giftBagId: giftbagid | |
276 | + }) | |
277 | + } | |
265 | 278 | }) |
266 | - } | |
279 | + }, | |
267 | 280 | |
268 | 281 | }) |
269 | 282 | \ No newline at end of file | ... | ... |
pages/user/my_service/tment_eval.wxml
... | ... | @@ -97,9 +97,8 @@ |
97 | 97 | <view style="margin: auto;margin-bottom: 30rpx;" class="Submission flex-center" bindtap="evaluate_qt"> |
98 | 98 | <view>评价其他</view> |
99 | 99 | </view> |
100 | - | |
101 | - | |
102 | - <view style="margin: auto;margin-bottom: 30rpx;" class="Submission flex-center yellow-b" bindtap="clike_lb"> | |
100 | + | |
101 | + <view wx:if="{{is_act}}" style="margin: auto;margin-bottom: 30rpx;" class="Submission flex-center yellow-b" bindtap="clike_lb"> | |
103 | 102 | <view>点击领取礼品</view> |
104 | 103 | </view> |
105 | 104 | </view> | ... | ... |