-
Status changed to merged
-
mentioned in commit 50b3b08f0719cccd1e790d989df77369181225da
Showing
17 changed files
pages/cart/cart2/cart2.js
@@ -361,7 +361,7 @@ Page({ | @@ -361,7 +361,7 @@ Page({ | ||
361 | } | 361 | } |
362 | }) | 362 | }) |
363 | 363 | ||
364 | - if(frozenQuan){ | 364 | + if (frozenQuan && arr[ind].quan_list){ |
365 | arr[ind].quan_list=th.check_is_frozenQuan(arr[ind].quan_list,frozenQuan); | 365 | arr[ind].quan_list=th.check_is_frozenQuan(arr[ind].quan_list,frozenQuan); |
366 | } | 366 | } |
367 | 367 | ||
@@ -446,7 +446,7 @@ Page({ | @@ -446,7 +446,7 @@ Page({ | ||
446 | } | 446 | } |
447 | }) | 447 | }) |
448 | 448 | ||
449 | - if(frozenQuan){ | 449 | + if (frozenQuan && quanlist){ |
450 | quanlist=th.check_is_frozenQuan(quanlist,frozenQuan); | 450 | quanlist=th.check_is_frozenQuan(quanlist,frozenQuan); |
451 | } | 451 | } |
452 | 452 | ||
@@ -493,7 +493,7 @@ Page({ | @@ -493,7 +493,7 @@ Page({ | ||
493 | } | 493 | } |
494 | }) | 494 | }) |
495 | 495 | ||
496 | - if(frozenQuan){ | 496 | + if (frozenQuan && quanlist){ |
497 | quanlist=th.check_is_frozenQuan(quanlist,frozenQuan); | 497 | quanlist=th.check_is_frozenQuan(quanlist,frozenQuan); |
498 | } | 498 | } |
499 | } | 499 | } |
pages/goods/goodsInfo/goodsInfo.js
@@ -305,7 +305,6 @@ Page({ | @@ -305,7 +305,6 @@ Page({ | ||
305 | if (!user) return false; | 305 | if (!user) return false; |
306 | clearInterval(ti); | 306 | clearInterval(ti); |
307 | 307 | ||
308 | - | ||
309 | if(user.card_field ){ | 308 | if(user.card_field ){ |
310 | var str = user['card_expiredate'].replace(/-/g, '/'); | 309 | var str = user['card_expiredate'].replace(/-/g, '/'); |
311 | var end = new Date(str); | 310 | var end = new Date(str); |
@@ -1573,7 +1572,7 @@ Page({ | @@ -1573,7 +1572,7 @@ Page({ | ||
1573 | } | 1572 | } |
1574 | 1573 | ||
1575 | var goods_list = this.selectComponent("#goods_list"); //组件的id | 1574 | var goods_list = this.selectComponent("#goods_list"); //组件的id |
1576 | - goods_list.get_list(); | 1575 | + if (goods_list) goods_list.get_list(); |
1577 | }, | 1576 | }, |
1578 | 1577 | ||
1579 | //--------检查是否活动,活动是否开始,或者是否结束------- | 1578 | //--------检查是否活动,活动是否开始,或者是否结束------- |
pages/goods/goodsInfo/goodsInfo.wxml
@@ -566,25 +566,8 @@ | @@ -566,25 +566,8 @@ | ||
566 | <view class="xc-recommend-word">推荐</view> | 566 | <view class="xc-recommend-word">推荐</view> |
567 | </view> | 567 | </view> |
568 | </view> | 568 | </view> |
569 | - | ||
570 | - <!-- 显示商品 --> | ||
571 | - <view class="xc-goods "> | ||
572 | - <view> | ||
573 | - <view bindtap="go_goods" data-gid="{{item.goods_id}}" class="rel xc-goods-recommend {{index%2==0?'':'ml'}}" wx:for="{{recommend_list}}"> | ||
574 | - <image class="xc-goods-imgs" src="{{iurl+item.original_img}}"></image> | ||
575 | - <view class='xc-goods-bottom abs'> | ||
576 | - <view class="flex monry-frame"> | ||
577 | - <view class="flex"> | ||
578 | - <view class="three-level-word money-color-val rmb-symbol">¥</view> | ||
579 | - <view class="two-level-word money-color-val" style='margin-top:8rpx;'>{{item.shop_price}}</view> | ||
580 | - </view> | ||
581 | - <view class="word-lines xc-original-price"> 原价¥{{item.market_price}}</view> | ||
582 | - </view> | ||
583 | - <view class="xc-good-explain ellipsis-2">{{item.goods_name}}</view> | ||
584 | - </view> | ||
585 | - </view> | ||
586 | - </view> | ||
587 | - </view> | 569 | + |
570 | + <goods_recommend id="goods_list"></goods_recommend> | ||
588 | 571 | ||
589 | </view> | 572 | </view> |
590 | 573 |
pages/user/my_service/appment_main.js
@@ -47,23 +47,6 @@ Page({ | @@ -47,23 +47,6 @@ Page({ | ||
47 | }, | 47 | }, |
48 | //控制备注输入 | 48 | //控制备注输入 |
49 | check_text: function() { | 49 | check_text: function() { |
50 | - wx.requestSubscribeMessage({ | ||
51 | - tmplIds: ['Jg7Tj-wPlDfsairz_EHBQdoQnzLLF4nVhT1weCBEmTE'], | ||
52 | - success(res) { | ||
53 | - console.log("222222222222222222222222222222"); | ||
54 | - }, | ||
55 | - | ||
56 | - fail(res) { | ||
57 | - | ||
58 | - console.log('fail 失败') | ||
59 | - | ||
60 | - console.log(res) | ||
61 | - | ||
62 | - logger.warn('订阅消息fail', res) | ||
63 | - | ||
64 | - } | ||
65 | - }) | ||
66 | - | ||
67 | var th = this; | 50 | var th = this; |
68 | var is_textea = th.data.is_textea; | 51 | var is_textea = th.data.is_textea; |
69 | th.setData({ | 52 | th.setData({ |
@@ -77,11 +60,13 @@ Page({ | @@ -77,11 +60,13 @@ Page({ | ||
77 | if (store) { | 60 | if (store) { |
78 | th.setData({ | 61 | th.setData({ |
79 | store: 0, | 62 | store: 0, |
63 | + is_textea: 1 | ||
80 | }) | 64 | }) |
81 | } else { | 65 | } else { |
82 | th.setData({ | 66 | th.setData({ |
83 | beautician: 0, | 67 | beautician: 0, |
84 | store: 1, | 68 | store: 1, |
69 | + is_textea: 0 | ||
85 | }) | 70 | }) |
86 | if (th.data.store_list.length < 1) { | 71 | if (th.data.store_list.length < 1) { |
87 | wx.showLoading({ | 72 | wx.showLoading({ |
@@ -101,148 +86,220 @@ Page({ | @@ -101,148 +86,220 @@ Page({ | ||
101 | //提交成功及发送模版代码 | 86 | //提交成功及发送模版代码 |
102 | success: function() { | 87 | success: function() { |
103 | var th = this; | 88 | var th = this; |
104 | - th.setData({ | ||
105 | - is_textea: 0 | 89 | + var store = th.data.store_name; //门店名称 |
90 | + var bea_name = th.data.beautician_name; //美容师名称 | ||
91 | + var time = th.data.time; //预约时间 | ||
92 | + var is_sub = th.data.is_sub; //是否重复提交 | ||
93 | + var url = th.data.inurl + "/api/weshop/marketing/reservation/reservation/insert"; //接口路径 | ||
94 | + var serviceId = th.data.itemId; //服务id | ||
95 | + var beauticianID = th.data.beauticianID; //美容师id | ||
96 | + var buyType = th.data.buyType; //服务项目类型 | ||
97 | + var storeId = a.stoid; //商家id | ||
98 | + var storageId = th.data.storageId; //门店id | ||
99 | + var userId = d.user_id; //用户id | ||
100 | + var remarks = th.data.remarks; //用户备注 | ||
101 | + var project_id = th.data.project_id; //项目id | ||
102 | + var validay = th.data.validay; | ||
103 | + var json = { | ||
104 | + "arrangeTime": time + ":00", | ||
105 | + "beauticianId": beauticianID, | ||
106 | + "buyType": buyType, | ||
107 | + "effectiveDay": "", | ||
108 | + "number": "", | ||
109 | + "projectId": project_id, | ||
110 | + "remark": remarks, | ||
111 | + "serviceId": serviceId, | ||
112 | + "states": 0, | ||
113 | + "storageId": storageId, | ||
114 | + "storeId": storeId, | ||
115 | + "userId": userId, | ||
116 | + "validay": validay | ||
117 | + } | ||
118 | + var data = JSON.stringify(json); | ||
119 | + wx.request({ | ||
120 | + url: url, | ||
121 | + data: json, | ||
122 | + method: 'post', | ||
123 | + header: { | ||
124 | + 'content-type': 'application/json' | ||
125 | + }, // 设置请求的 header | ||
126 | + success: function(res) { | ||
127 | + th.setData({ | ||
128 | + is_sub: 0 | ||
129 | + }) | ||
130 | + wx.hideLoading(); | ||
131 | + if (res.data.code == 0) { | ||
132 | + getApp().my_warnning("预约成功", 1, th); | ||
133 | + var store_name = th.data.store_name; //预约门店 | ||
134 | + var number = res.data.data.Number; | ||
135 | + var temp_url = "/api/wx/open/app/user/sendSubscribeMsg"; //模版接口 | ||
136 | + var userinfo = getApp().globalData.userInfo; | ||
137 | + var name = d.userInfo.nickname; | ||
138 | + var json = { | ||
139 | + // "formId": formid, | ||
140 | + "keyWord": [{ | ||
141 | + "keyword": res.data.data.ServiceName | ||
142 | + }, | ||
143 | + { | ||
144 | + "keyword": time.substring(0, 16) | ||
145 | + }, { | ||
146 | + "keyword": res.data.data.BeauticianName | ||
147 | + }, { | ||
148 | + "keyword": res.data.data.StorageName | ||
149 | + }, { | ||
150 | + "keyword": res.data.data.Address | ||
151 | + } | ||
152 | + ], | ||
153 | + "page": "/pages/user/my_service/tment_details?number=" + number, | ||
154 | + "storeId": a.stoid, | ||
155 | + "typeId": "1011", | ||
156 | + "userId": d.user_id | ||
157 | + }; | ||
158 | + var data = JSON.stringify(json); | ||
159 | + //调用发送预约成功模版接口 | ||
160 | + wx.request({ | ||
161 | + url: th.data.inurl + temp_url, | ||
162 | + data: data, | ||
163 | + method: 'post', | ||
164 | + header: { | ||
165 | + 'content-type': 'application/json' | ||
166 | + }, // 设置请求的 header | ||
167 | + success: function(data) {} | ||
168 | + }) | ||
169 | + setTimeout(function() { | ||
170 | + wx.redirectTo({ | ||
171 | + url: "/pages/user/my_service/tment_details?number=" + number | ||
172 | + }); | ||
173 | + }, 1000); | ||
174 | + } else { | ||
175 | + getApp().my_warnning(res.data.msg, 0, th); | ||
176 | + th.settime(); | ||
177 | + } | ||
178 | + } | ||
106 | }) | 179 | }) |
180 | + | ||
181 | + }, | ||
182 | + //定时显示texteat | ||
183 | + settime: function() { | ||
184 | + var th = this; | ||
185 | + setTimeout(function() { | ||
186 | + th.setData({ | ||
187 | + is_textea: 1 | ||
188 | + }) | ||
189 | + }, 2000); | ||
190 | + }, | ||
191 | + //提交预约 | ||
192 | + sub_success: function(e) { | ||
193 | + var th = this; | ||
194 | + var temp_url = th.data.inurl + "/api/wx/weappSendlist/page"; | ||
195 | + var template_id = ""; | ||
196 | + if (th.data.is_sub == 1) { | ||
197 | + return false; | ||
198 | + } | ||
107 | var store = th.data.store_name; //门店名称 | 199 | var store = th.data.store_name; //门店名称 |
108 | var bea_name = th.data.beautician_name; //美容师名称 | 200 | var bea_name = th.data.beautician_name; //美容师名称 |
109 | var time = th.data.time; //预约时间 | 201 | var time = th.data.time; //预约时间 |
110 | var is_sub = th.data.is_sub; //是否重复提交 | 202 | var is_sub = th.data.is_sub; //是否重复提交 |
203 | + th.setData({ | ||
204 | + is_textea: 0, | ||
205 | + is_sub: 1 | ||
206 | + }) | ||
111 | //提交预约前的判断 | 207 | //提交预约前的判断 |
112 | if (store == "") { | 208 | if (store == "") { |
113 | getApp().my_warnning("请选择服务门店", 0, th); | 209 | getApp().my_warnning("请选择服务门店", 0, th); |
210 | + th.setData({ | ||
211 | + is_sub: 0 | ||
212 | + }) | ||
213 | + th.settime(); | ||
114 | return false; | 214 | return false; |
115 | } else if (bea_name == "") { | 215 | } else if (bea_name == "") { |
116 | getApp().my_warnning("请选择美容师", 0, th); | 216 | getApp().my_warnning("请选择美容师", 0, th); |
217 | + th.setData({ | ||
218 | + is_sub: 0 | ||
219 | + }) | ||
220 | + th.settime(); | ||
117 | return false; | 221 | return false; |
118 | - } else if (time == "") { | 222 | + } else if (time == undefined || time == '') { |
119 | getApp().my_warnning("请选择预约时间", 0, th); | 223 | getApp().my_warnning("请选择预约时间", 0, th); |
224 | + th.setData({ | ||
225 | + is_sub: 0 | ||
226 | + }) | ||
227 | + th.settime(); | ||
120 | return false; | 228 | return false; |
121 | } else { | 229 | } else { |
122 | - if (is_sub == 0) { | ||
123 | - th.setData({ | ||
124 | - is_sub: 1 | ||
125 | - }) | ||
126 | - var url = th.data.inurl + "/api/weshop/marketing/reservation/reservation/insert"; //接口路径 | ||
127 | - var serviceId = th.data.itemId; //服务id | ||
128 | - var beauticianID = th.data.beauticianID; //美容师id | ||
129 | - var buyType = th.data.buyType; //服务项目类型 | ||
130 | - var storeId = a.stoid; //商家id | ||
131 | - var storageId = th.data.storageId; //门店id | ||
132 | - var userId = d.user_id; //用户id | ||
133 | - var remarks = th.data.remarks; //用户备注 | ||
134 | - var project_id = th.data.project_id; //项目id | ||
135 | - var validay = th.data.validay; | ||
136 | - var json = { | ||
137 | - "arrangeTime": time, | ||
138 | - "beauticianId": beauticianID, | ||
139 | - "buyType": buyType, | ||
140 | - "effectiveDay": "", | ||
141 | - "number": "", | ||
142 | - "projectId": project_id, | ||
143 | - "remark": remarks, | ||
144 | - "serviceId": serviceId, | ||
145 | - "states": 0, | ||
146 | - "storageId": storageId, | ||
147 | - "storeId": storeId, | ||
148 | - "userId": userId, | ||
149 | - "validay": validay | 230 | + var version =""; |
231 | + //判断微信版本是否达到预约成功订阅的要求 | ||
232 | + wx.getSystemInfo({ | ||
233 | + success(res) { | ||
234 | + version = res.version; | ||
150 | } | 235 | } |
151 | - var data = JSON.stringify(json); | ||
152 | - wx.request({ | ||
153 | - url: url, | ||
154 | - data: json, | ||
155 | - method: 'post', | ||
156 | - header: { | ||
157 | - 'content-type': 'application/json' | ||
158 | - }, // 设置请求的 header | ||
159 | - success: function(res) { | ||
160 | - th.setData({ | ||
161 | - is_sub: 0 | 236 | + }) |
237 | + wx.showLoading({ | ||
238 | + title: '加载中', | ||
239 | + }) | ||
240 | + if (th.ver(version, '7.0.4') >= 0) { | ||
241 | + //获取模版id | ||
242 | + getApp().request.promiseGet(temp_url, { | ||
243 | + data: { | ||
244 | + store_id: a.stoid, | ||
245 | + typeid: "1011" | ||
246 | + } | ||
247 | + }).then(res => { | ||
248 | + if (res.data.code == 0 && res.data.data.pageData.length > 0) { | ||
249 | + template_id = res.data.data.pageData[0].template_id; | ||
250 | + // //授权订阅 | ||
251 | + wx.requestSubscribeMessage({ | ||
252 | + tmplIds: [template_id], | ||
253 | + success(res) { | ||
254 | + th.success(); | ||
255 | + }, | ||
256 | + fail(res) { | ||
257 | + th.success(); | ||
258 | + } | ||
162 | }) | 259 | }) |
163 | - if (res.data.code == 0) { | ||
164 | - getApp().my_warnning("预约成功", 1, th); | ||
165 | - var store_name = th.data.store_name; //预约门店 | ||
166 | - var number = res.data.data.Number; | ||
167 | - var temp_url = "/api/wx/open/app/user/sendSubscribeMsg"; //模版接口 | ||
168 | - var userinfo = getApp().globalData.userInfo; | ||
169 | - var name = d.userInfo.nickname; | ||
170 | - var json = { | ||
171 | - // "formId": formid, | ||
172 | - "keyWord": [{ | ||
173 | - "keyword": res.data.data.ServiceName | ||
174 | - }, | ||
175 | - { | ||
176 | - "keyword": time | ||
177 | - }, { | ||
178 | - "keyword": res.data.data.BeauticianName | ||
179 | - }, { | ||
180 | - "keyword": res.data.data.StorageName | ||
181 | - }, { | ||
182 | - "keyword": res.data.data.Address | ||
183 | - } | ||
184 | - ], | ||
185 | - "page": "/pages/user/my_service/tment_details?number=" + number, | ||
186 | - "storeId": a.stoid, | ||
187 | - "typeId": "1011", | ||
188 | - "userId": d.user_id | ||
189 | - }; | ||
190 | - var data = JSON.stringify(json); | ||
191 | - //调用发送预约成功模版接口 | ||
192 | - wx.request({ | ||
193 | - url: th.data.inurl + temp_url, | ||
194 | - data: data, | ||
195 | - method: 'post', | ||
196 | - header: { | ||
197 | - 'content-type': 'application/json' | ||
198 | - }, // 设置请求的 header | ||
199 | - success: function(data) {} | ||
200 | - }) | ||
201 | - setTimeout(function() { | ||
202 | - wx.redirectTo({ | ||
203 | - url: "/pages/user/my_service/tment_details?number=" + number | ||
204 | - }); | ||
205 | - }, 1000); | ||
206 | - } else { | ||
207 | - getApp().my_warnning(res.data.msg, 0, th); | ||
208 | - th.setData({ | ||
209 | - is_sub: 0 | ||
210 | - }) | ||
211 | - } | 260 | + } else { |
261 | + th.success(); | ||
212 | } | 262 | } |
213 | }) | 263 | }) |
264 | + } else { | ||
265 | + // 如果希望用户在最新版本的客户端上体验您的小程序,可以这样子提示 | ||
266 | + wx.showModal({ | ||
267 | + title: '提示', | ||
268 | + content: '当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。' | ||
269 | + }) | ||
270 | + th.setData({ | ||
271 | + is_sub: 0 | ||
272 | + }) | ||
214 | } | 273 | } |
274 | + | ||
215 | } | 275 | } |
216 | }, | 276 | }, |
217 | - //提交预约 | ||
218 | - sub_success: function(e) { | ||
219 | - var th = this; | ||
220 | - var temp_url = "/api/wx/weappSendlist/page"; | ||
221 | - var template_id = ""; | ||
222 | - //获取模版id | ||
223 | - getApp().request.promiseGet(temp_url, { | ||
224 | - data: { | ||
225 | - store_id: a.stoid, | ||
226 | - typeid: "1011" | 277 | + //版本判断 |
278 | + ver:function(v1,v2){ | ||
279 | + v1 = v1.split('.') | ||
280 | + v2 = v2.split('.') | ||
281 | + var num1 = "" ; | ||
282 | + var num2 = ""; | ||
283 | + var len = Math.max(v1.length, v2.length) | ||
284 | + | ||
285 | + while (v1.length < len) { | ||
286 | + v1.push('0') | ||
227 | } | 287 | } |
228 | - }).then(res => { | ||
229 | - if (res.data.code == 0) { | ||
230 | - template_id = res.data.data.pageData[0].template_id; | ||
231 | - // //授权订阅 | ||
232 | - wx.requestSubscribeMessage({ | ||
233 | - tmplIds: [template_id], | ||
234 | - success(res) { | ||
235 | - th.success(); | ||
236 | - }, | ||
237 | - fail(res) { | ||
238 | - th.success(); | ||
239 | - } | ||
240 | - }) | ||
241 | - }else{ | ||
242 | - th.success(); | 288 | + while (v2.length < len) { |
289 | + v2.push('0') | ||
243 | } | 290 | } |
244 | - }) | ||
245 | 291 | ||
292 | + for (let i = 0; i < len; i++) { | ||
293 | + num1 = parseInt(v1[i]) | ||
294 | + num2 = parseInt(v2[i]) | ||
295 | + | ||
296 | + if (num1 > num2) { | ||
297 | + return 1 | ||
298 | + } else if (num1 < num2) { | ||
299 | + return -1 | ||
300 | + } | ||
301 | + } | ||
302 | + return 0 | ||
246 | }, | 303 | }, |
247 | goto: function(e) { | 304 | goto: function(e) { |
248 | var th = this; | 305 | var th = this; |
@@ -252,9 +309,14 @@ Page({ | @@ -252,9 +309,14 @@ Page({ | ||
252 | }) | 309 | }) |
253 | if (th.data.store_name == "") { | 310 | if (th.data.store_name == "") { |
254 | getApp().my_warnning("请选择服务门店", 0, th); | 311 | getApp().my_warnning("请选择服务门店", 0, th); |
312 | + th.settime(); | ||
255 | } else if (th.data.beautician_name == "") { | 313 | } else if (th.data.beautician_name == "") { |
256 | getApp().my_warnning("请选择美容师", 0, th); | 314 | getApp().my_warnning("请选择美容师", 0, th); |
315 | + th.settime(); | ||
257 | } else { | 316 | } else { |
317 | + th.setData({ | ||
318 | + is_textea: 1 | ||
319 | + }) | ||
258 | var url = e.currentTarget.dataset.url; | 320 | var url = e.currentTarget.dataset.url; |
259 | getApp().goto(url); | 321 | getApp().goto(url); |
260 | } | 322 | } |
@@ -285,7 +347,8 @@ Page({ | @@ -285,7 +347,8 @@ Page({ | ||
285 | th.setData({ | 347 | th.setData({ |
286 | store: 0, | 348 | store: 0, |
287 | store_name: store_name, | 349 | store_name: store_name, |
288 | - storageId: Id | 350 | + storageId: Id, |
351 | + is_textea: 1 | ||
289 | }) | 352 | }) |
290 | }, | 353 | }, |
291 | onReachBottom: function() { | 354 | onReachBottom: function() { |
@@ -340,6 +403,7 @@ Page({ | @@ -340,6 +403,7 @@ Page({ | ||
340 | } | 403 | } |
341 | } else { | 404 | } else { |
342 | getApp().my_warnning(res.data.msg, 0, th); | 405 | getApp().my_warnning(res.data.msg, 0, th); |
406 | + th.settime(); | ||
343 | } | 407 | } |
344 | }) | 408 | }) |
345 | }, | 409 | }, |
@@ -351,6 +415,7 @@ Page({ | @@ -351,6 +415,7 @@ Page({ | ||
351 | }) | 415 | }) |
352 | if (th.data.store_name == "") { | 416 | if (th.data.store_name == "") { |
353 | getApp().my_warnning("请选择服务门店", 0, th); | 417 | getApp().my_warnning("请选择服务门店", 0, th); |
418 | + th.settime(); | ||
354 | } else { | 419 | } else { |
355 | wx.showLoading({ | 420 | wx.showLoading({ |
356 | title: '加载中', | 421 | title: '加载中', |
@@ -373,6 +438,7 @@ Page({ | @@ -373,6 +438,7 @@ Page({ | ||
373 | }) | 438 | }) |
374 | if (res.data.data.pageData.length < 1) { | 439 | if (res.data.data.pageData.length < 1) { |
375 | getApp().my_warnning("暂无美容师", 0, th); | 440 | getApp().my_warnning("暂无美容师", 0, th); |
441 | + th.settime(); | ||
376 | } else { | 442 | } else { |
377 | if (th.data.beautician == 0) { | 443 | if (th.data.beautician == 0) { |
378 | th.setData({ | 444 | th.setData({ |
@@ -385,7 +451,8 @@ Page({ | @@ -385,7 +451,8 @@ Page({ | ||
385 | } | 451 | } |
386 | } | 452 | } |
387 | } else { | 453 | } else { |
388 | - getApp().my_warnning("暂无美容师", 0, th); | 454 | + getApp().my_warnning(res.data.msg, 0, th); |
455 | + th.settime(); | ||
389 | } | 456 | } |
390 | }) | 457 | }) |
391 | } | 458 | } |
@@ -402,7 +469,7 @@ Page({ | @@ -402,7 +469,7 @@ Page({ | ||
402 | beauticianID: BeauticianID, | 469 | beauticianID: BeauticianID, |
403 | time: "", | 470 | time: "", |
404 | tment_count: "", | 471 | tment_count: "", |
405 | - is_textea: 0 | 472 | + is_textea: 1 |
406 | }) | 473 | }) |
407 | 474 | ||
408 | }, | 475 | }, |
@@ -431,7 +498,6 @@ Page({ | @@ -431,7 +498,6 @@ Page({ | ||
431 | nav_bea: function() { | 498 | nav_bea: function() { |
432 | var th = this; | 499 | var th = this; |
433 | th.setData({ | 500 | th.setData({ |
434 | - is_textea: 0, | ||
435 | beautician: 0 | 501 | beautician: 0 |
436 | }) | 502 | }) |
437 | var storageId = th.data.storageId; //线下门店id | 503 | var storageId = th.data.storageId; //线下门店id |
@@ -439,10 +505,15 @@ Page({ | @@ -439,10 +505,15 @@ Page({ | ||
439 | var project_id = th.data.project_id; | 505 | var project_id = th.data.project_id; |
440 | if (storageId == "") { | 506 | if (storageId == "") { |
441 | getApp().my_warnning("请选择服务门店", 0, th); | 507 | getApp().my_warnning("请选择服务门店", 0, th); |
508 | + th.settime(); | ||
442 | } else { | 509 | } else { |
510 | + th.setData({ | ||
511 | + is_textea: 1 | ||
512 | + }) | ||
443 | wx.navigateTo({ | 513 | wx.navigateTo({ |
444 | url: "/pages/user/my_service/cosmetology_list?" + 'storageId=' + storageId + '&' + 'itemId=' + itemId + '&' + "projectId=" + project_id | 514 | url: "/pages/user/my_service/cosmetology_list?" + 'storageId=' + storageId + '&' + 'itemId=' + itemId + '&' + "projectId=" + project_id |
445 | }); | 515 | }); |
516 | + | ||
446 | } | 517 | } |
447 | }, | 518 | }, |
448 | /** | 519 | /** |
@@ -473,6 +544,7 @@ Page({ | @@ -473,6 +544,7 @@ Page({ | ||
473 | }); | 544 | }); |
474 | if (th.data.is_gps == 0) { | 545 | if (th.data.is_gps == 0) { |
475 | getApp().confirmBox("请开启GPS定位", null, 25000, !1); | 546 | getApp().confirmBox("请开启GPS定位", null, 25000, !1); |
547 | + th.settime(); | ||
476 | } | 548 | } |
477 | } else { | 549 | } else { |
478 | th.setData({ | 550 | th.setData({ |
@@ -509,6 +581,7 @@ Page({ | @@ -509,6 +581,7 @@ Page({ | ||
509 | }) | 581 | }) |
510 | } else { | 582 | } else { |
511 | getApp().my_warnning(res.data.msg, 0, th); | 583 | getApp().my_warnning(res.data.msg, 0, th); |
584 | + th.settime(); | ||
512 | } | 585 | } |
513 | }) | 586 | }) |
514 | 587 | ||
@@ -522,6 +595,10 @@ Page({ | @@ -522,6 +595,10 @@ Page({ | ||
522 | if (seekTime != "") { | 595 | if (seekTime != "") { |
523 | th.query_more(); | 596 | th.query_more(); |
524 | } | 597 | } |
598 | + th.setData({ | ||
599 | + time: th.data.time.substring(0, 16), | ||
600 | + is_textea: 1 | ||
601 | + }) | ||
525 | th.query_project(); | 602 | th.query_project(); |
526 | }, | 603 | }, |
527 | //获取单个服务项目信息 | 604 | //获取单个服务项目信息 |
@@ -542,6 +619,7 @@ Page({ | @@ -542,6 +619,7 @@ Page({ | ||
542 | }) | 619 | }) |
543 | } else { | 620 | } else { |
544 | getApp().my_warnning(res.data.msg, 0, th); | 621 | getApp().my_warnning(res.data.msg, 0, th); |
622 | + th.settime(); | ||
545 | } | 623 | } |
546 | }) | 624 | }) |
547 | }, | 625 | }, |
pages/user/my_service/appment_main.wxml
@@ -36,7 +36,7 @@ | @@ -36,7 +36,7 @@ | ||
36 | <view class="beauticians abs" wx:if="{{beautician}}"> | 36 | <view class="beauticians abs" wx:if="{{beautician}}"> |
37 | <!-- 到时候要做判断如果是index==循环的最后一个则把下边线去掉:(beaclone去掉的css) --> | 37 | <!-- 到时候要做判断如果是index==循环的最后一个则把下边线去掉:(beaclone去掉的css) --> |
38 | <view class="beautician flex-vertical fs26" wx:for="{{beautician_list}}" bindtap="choice_beautician" data-baaindex="{{key}}" wx:for-index="key"> | 38 | <view class="beautician flex-vertical fs26" wx:for="{{beautician_list}}" bindtap="choice_beautician" data-baaindex="{{key}}" wx:for-index="key"> |
39 | - <view>{{item.StaffName}}</view> | 39 | + <view class="StaffName ellipsis-1">{{item.StaffName}}</view> |
40 | </view> | 40 | </view> |
41 | <view> | 41 | <view> |
42 | </view> | 42 | </view> |
@@ -69,12 +69,12 @@ | @@ -69,12 +69,12 @@ | ||
69 | <view>注</view> | 69 | <view>注</view> |
70 | </view> | 70 | </view> |
71 | <view class="flex fs26"> | 71 | <view class="flex fs26"> |
72 | - <block wx:if="{{is_textea==1 && store==0}}"> | 72 | + <block wx:if="{{is_textea==1}}"> |
73 | <textarea class="textarea" placeholder="{{remarks==''?'填写备注':remarks}}" placeholder-class="fs26 color" value="{{remarks}}" bindinput="input_remarks" maxlength="100"> | 73 | <textarea class="textarea" placeholder="{{remarks==''?'填写备注':remarks}}" placeholder-class="fs26 color" value="{{remarks}}" bindinput="input_remarks" maxlength="100"> |
74 | </textarea> | 74 | </textarea> |
75 | </block> | 75 | </block> |
76 | <block wx:else> | 76 | <block wx:else> |
77 | - <view class="textarea color" bindtap="check_text">{{remarks==''?'填写备注':remarks}} | 77 | + <view class="textarea {{remarks==''?'color':''}}" bindtap="check_text">{{remarks==''?'填写备注':remarks}} |
78 | </view> | 78 | </view> |
79 | </block> | 79 | </block> |
80 | </view> | 80 | </view> |
pages/user/my_service/appment_main.wxss
@@ -14,7 +14,9 @@ | @@ -14,7 +14,9 @@ | ||
14 | font-size: 26rpx; | 14 | font-size: 26rpx; |
15 | color: rgb(142, 142, 142); | 15 | color: rgb(142, 142, 142); |
16 | } | 16 | } |
17 | - | 17 | +.StaffName{ |
18 | + max-width: 350rpx; | ||
19 | +} | ||
18 | .angler { | 20 | .angler { |
19 | transform: rotate(227deg); | 21 | transform: rotate(227deg); |
20 | margin-bottom: 0rpx; | 22 | margin-bottom: 0rpx; |
pages/user/my_service/beauty_deta.js
@@ -47,8 +47,7 @@ Page({ | @@ -47,8 +47,7 @@ Page({ | ||
47 | itemId: options.itemId, | 47 | itemId: options.itemId, |
48 | modify: options.modify, | 48 | modify: options.modify, |
49 | hours: hours, | 49 | hours: hours, |
50 | - projectId: options.projectId, | ||
51 | - StaffName: options.StaffName | 50 | + projectId: options.projectId |
52 | }) | 51 | }) |
53 | if (options.url != undefined) { | 52 | if (options.url != undefined) { |
54 | th.setData({ | 53 | th.setData({ |
@@ -65,6 +64,11 @@ Page({ | @@ -65,6 +64,11 @@ Page({ | ||
65 | iscos: options.iscos | 64 | iscos: options.iscos |
66 | }) | 65 | }) |
67 | } | 66 | } |
67 | + if (options.StaffName!=undefined){ | ||
68 | + th.setData({ | ||
69 | + StaffName: options.StaffName | ||
70 | + }) | ||
71 | + } | ||
68 | th.query_beatea(); | 72 | th.query_beatea(); |
69 | th.query_aweek(); | 73 | th.query_aweek(); |
70 | }, | 74 | }, |
@@ -78,8 +82,6 @@ Page({ | @@ -78,8 +82,6 @@ Page({ | ||
78 | // var date = myDate.getHours(); //获取当前小时数(0-23); | 82 | // var date = myDate.getHours(); //获取当前小时数(0-23); |
79 | let str = myDate.toTimeString(); //"10:55:24 GMT+0800 (中国标准时间)" | 83 | let str = myDate.toTimeString(); //"10:55:24 GMT+0800 (中国标准时间)" |
80 | let date = str.substring(0, 8); // '10:55:24' | 84 | let date = str.substring(0, 8); // '10:55:24' |
81 | - | ||
82 | - // console.log("当前时间", date); | ||
83 | th.setData({ | 85 | th.setData({ |
84 | hours: date | 86 | hours: date |
85 | }); | 87 | }); |
pages/user/my_service/cosmetology_list.js
@@ -74,6 +74,7 @@ Page({ | @@ -74,6 +74,7 @@ Page({ | ||
74 | if (_Img != undefined) { | 74 | if (_Img != undefined) { |
75 | var _errObj = {}; | 75 | var _errObj = {}; |
76 | _errObj[_errImg] = "/miniapp/images/no-head.jpg"; | 76 | _errObj[_errImg] = "/miniapp/images/no-head.jpg"; |
77 | + console.log(_errObj,"zzzzzzz"); | ||
77 | this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; | 78 | this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; |
78 | } | 79 | } |
79 | }, | 80 | }, |
pages/user/my_service/cosmetology_list.wxml
@@ -2,33 +2,26 @@ | @@ -2,33 +2,26 @@ | ||
2 | <image class="appointment" src="{{iurl}}/miniapp/images/yyservice/Cosm_appo.png"></image> | 2 | <image class="appointment" src="{{iurl}}/miniapp/images/yyservice/Cosm_appo.png"></image> |
3 | 3 | ||
4 | <!-- 总预约 --> | 4 | <!-- 总预约 --> |
5 | - <view wx:if="{{true}}"> | 5 | + <view wx:if="{{cosmetology_list.length>0}}"> |
6 | <!-- 当个预约 --> | 6 | <!-- 当个预约 --> |
7 | - <view class="single" wx:for="{{cosmetology_list}}"> | 7 | + <view class="single" wx:for="{{cosmetology_list}}" wx:for-item="item"> |
8 | <!-- 个人属性 --> | 8 | <!-- 个人属性 --> |
9 | <view class="flex-vertical-between"> | 9 | <view class="flex-vertical-between"> |
10 | <view class="flex-vertical"> | 10 | <view class="flex-vertical"> |
11 | - <image class="portrait" src="{{item.PhotoUrl==''?iurl+defimgurl:item.PhotoUrl}}" lazy-load="true" data-errorimg="cosmetology_list[{{index}}].PhotoUrl" binderror="bind_bnerr1" data-img="{{item.PhotoUrl}}"></image> | 11 | + <image class="portrait" src="{{item.PhotoUrl==''?iurl+defimgurl:item.PhotoUrl}}" lazy-load="true" data-errorimg="cosmetology_list[{{index}}].PhotoUrl" binderror="bind_bnerr1" data-img="cosmetology_list[{{index}}].PhotoUrl"></image> |
12 | <view> | 12 | <view> |
13 | <!-- 用户名 --> | 13 | <!-- 用户名 --> |
14 | <view class="UserName ellipsis-1 fs32">{{item.StaffName}}</view> | 14 | <view class="UserName ellipsis-1 fs32">{{item.StaffName}}</view> |
15 | <!-- 评价星数 --> | 15 | <!-- 评价星数 --> |
16 | <view class="flex" style="margin-top:10rpx;"> | 16 | <view class="flex" style="margin-top:10rpx;"> |
17 | - <image class="Stars" src="{{iurl}}{{key<item.Star || item.Star==''?'/miniapp/images/StarsredCk.png':'/miniapp/images/StarswhiteUnCk.png'}}" wx:for="{{item.Star==''?5:it.Star}}" wx:for-index="key" wx:for-item="it"></image> | 17 | + <image class="Stars" src="{{iurl}}{{key<item.Star || item.Star==''?'/miniapp/images/StarsredCk.png':'/miniapp/images/StarswhiteUnCk.png'}}" wx:for="{{item.Star==''?5:5}}" wx:for-index="key" wx:for-item="it"></image> |
18 | <!-- images/StarswhiteUnCk.png//白色星星地址 --> | 18 | <!-- images/StarswhiteUnCk.png//白色星星地址 --> |
19 | </view> | 19 | </view> |
20 | <!-- 个人标签 --> | 20 | <!-- 个人标签 --> |
21 | - <view class="Label fs22 flex" wx:if="{{item.EvaluationLabel!=''?true:false}} " wx:for="{{item.EvaluationLabel.split('|')}}"> | ||
22 | - <view wx:if="{{index==0}}" class="flex-center Labelitem itone"> | ||
23 | - <view>{{item}}</view> | 21 | + <view class="Labels fs22 flex" wx:if="{{item.EvaluationLabel!=''?true:false}} "> |
22 | + <view wx:if="{{lab<3}}" class="flex-center Labelitem itone {{lab==1?'itwo':''}} {{lab==2?'ith':''}}" wx:for="{{item.EvaluationLabel}}" wx:for-item="it" wx:for-index="lab"> | ||
23 | + <view class="ellipsis-1">{{it.LabelName}}</view> | ||
24 | </view> | 24 | </view> |
25 | - <view wx:if="{{index==1}}" class="flex-center Labelitem itwo"> | ||
26 | - <view>{{item}}</view> | ||
27 | - </view> | ||
28 | - <view wx:if="{{index==2}}" class="flex-center Labelitem ith"> | ||
29 | - <view>{{item}}</view> | ||
30 | - </view> | ||
31 | - | ||
32 | </view> | 25 | </view> |
33 | </view> | 26 | </view> |
34 | </view> | 27 | </view> |
@@ -50,7 +43,7 @@ | @@ -50,7 +43,7 @@ | ||
50 | </view> | 43 | </view> |
51 | <!-- 没有数据 --> | 44 | <!-- 没有数据 --> |
52 | <!-- 加载完毕并且数据大于=页大小 --> | 45 | <!-- 加载完毕并且数据大于=页大小 --> |
53 | - <view class="After_all flex-center" wx:if="{{ismore && service_List.length>=4}}"> | 46 | + <view class="After_all flex-center" wx:if="{{ismore && cosmetology_list.length>=4}}"> |
54 | <view class="Line"></view> | 47 | <view class="Line"></view> |
55 | <view class="end fs26 xc-black">到底了</view> | 48 | <view class="end fs26 xc-black">到底了</view> |
56 | <view class="Line"></view> | 49 | <view class="Line"></view> |
pages/user/my_service/cosmetology_list.wxss
@@ -32,7 +32,10 @@ page{ | @@ -32,7 +32,10 @@ page{ | ||
32 | height: 25rpx; | 32 | height: 25rpx; |
33 | margin-right: 7rpx; | 33 | margin-right: 7rpx; |
34 | } | 34 | } |
35 | - | 35 | +.Labels{ |
36 | + width: 100%; | ||
37 | + margin-top: 15rpx; | ||
38 | +} | ||
36 | .Label { | 39 | .Label { |
37 | margin-top: 25rpx; | 40 | margin-top: 25rpx; |
38 | } | 41 | } |
@@ -42,7 +45,8 @@ page{ | @@ -42,7 +45,8 @@ page{ | ||
42 | height: 30rpx; | 45 | height: 30rpx; |
43 | border-radius: 20rpx; | 46 | border-radius: 20rpx; |
44 | line-height: 30rpx; | 47 | line-height: 30rpx; |
45 | - margin-right: 14rpx; | 48 | + margin-right: 10rpx; |
49 | + padding:0rpx 9rpx; | ||
46 | } | 50 | } |
47 | 51 | ||
48 | .itone { | 52 | .itone { |
pages/user/my_service/hist_service.wxml
@@ -39,6 +39,7 @@ | @@ -39,6 +39,7 @@ | ||
39 | </view> | 39 | </view> |
40 | <!-- right --> | 40 | <!-- right --> |
41 | <view class="serState fs32"> | 41 | <view class="serState fs32"> |
42 | + <view wx:if="{{item.State==0}}">未服务</view> | ||
42 | <view wx:if="{{item.State==1}}">已服务</view> | 43 | <view wx:if="{{item.State==1}}">已服务</view> |
43 | <view wx:if="{{item.State==2}}">已过期</view> | 44 | <view wx:if="{{item.State==2}}">已过期</view> |
44 | <view wx:if="{{item.State==3}}">已取消</view> | 45 | <view wx:if="{{item.State==3}}">已取消</view> |
pages/user/my_service/i_service.js
pages/user/my_service/tment_eval.js
1 | -var e = getApp(), | 1 | + var e = getApp(), |
2 | a = e.globalData.setting, | 2 | a = e.globalData.setting, |
3 | os = a, | 3 | os = a, |
4 | t = e.request, | 4 | t = e.request, |
@@ -21,37 +21,37 @@ Page({ | @@ -21,37 +21,37 @@ Page({ | ||
21 | beautician: "", //美容师信息 | 21 | beautician: "", //美容师信息 |
22 | fromType: "服务评价", //评价来源 | 22 | fromType: "服务评价", //评价来源 |
23 | arrangeTime: "", //服务日期 | 23 | arrangeTime: "", //服务日期 |
24 | - is_evaluate:0,//是否评价 | ||
25 | - EvaluateDatetime:"",//评价时间 | 24 | + is_evaluate: 0, //是否评价 |
25 | + EvaluateDatetime: "", //评价时间 | ||
26 | }, | 26 | }, |
27 | //点击星级 | 27 | //点击星级 |
28 | check_stars: function(e) { | 28 | check_stars: function(e) { |
29 | var th = this; | 29 | var th = this; |
30 | - var is_evaluate = th.data.is_evaluate;//0可点击 | ||
31 | - if (is_evaluate==0){ | ||
32 | - var index = e.currentTarget.dataset.index; | ||
33 | - var stars_index = th.data.stars_index; | ||
34 | - if (index != stars_index) { | ||
35 | - var url = "/api/weshop/marketing/reservation/star/label/list"; | ||
36 | - getApp().request.promiseGet(url, { | ||
37 | - data: { | ||
38 | - Star: index+1, | ||
39 | - storeId: a.stoid | ||
40 | - } | ||
41 | - }).then(res => { | ||
42 | - if (res.data.code == 0) { | ||
43 | - th.setData({ | ||
44 | - labels: res.data.data | ||
45 | - }) | ||
46 | - } else { | ||
47 | - getApp().my_warnning(res.data.msg, 0, th); | ||
48 | - return; | ||
49 | - } | ||
50 | - }) | ||
51 | - th.setData({ | ||
52 | - stars_index: index | ||
53 | - }) | ||
54 | - } | 30 | + var is_evaluate = th.data.is_evaluate; //0可点击 |
31 | + if (is_evaluate == 0) { | ||
32 | + var index = e.currentTarget.dataset.index; | ||
33 | + var stars_index = th.data.stars_index; | ||
34 | + if (index != stars_index) { | ||
35 | + var url = "/api/weshop/marketing/reservation/star/label/list"; | ||
36 | + getApp().request.promiseGet(url, { | ||
37 | + data: { | ||
38 | + Star: index + 1, | ||
39 | + storeId: a.stoid | ||
40 | + } | ||
41 | + }).then(res => { | ||
42 | + if (res.data.code == 0) { | ||
43 | + th.setData({ | ||
44 | + labels: res.data.data | ||
45 | + }) | ||
46 | + } else { | ||
47 | + getApp().my_warnning(res.data.msg, 0, th); | ||
48 | + return; | ||
49 | + } | ||
50 | + }) | ||
51 | + th.setData({ | ||
52 | + stars_index: index | ||
53 | + }) | ||
54 | + } | ||
55 | } | 55 | } |
56 | }, | 56 | }, |
57 | //输入评价意见和建议 | 57 | //输入评价意见和建议 |
@@ -63,31 +63,32 @@ Page({ | @@ -63,31 +63,32 @@ Page({ | ||
63 | }) | 63 | }) |
64 | }, | 64 | }, |
65 | //图片失败,默认图片 | 65 | //图片失败,默认图片 |
66 | - bind_bnerr1: function(e) { | 66 | + bind_bnerr1: function (e) { |
67 | + var th = this; | ||
67 | var _errImg = e.target.dataset.errorimg; | 68 | var _errImg = e.target.dataset.errorimg; |
68 | var _Img = e.target.dataset.img; | 69 | var _Img = e.target.dataset.img; |
69 | if (_Img != undefined) { | 70 | if (_Img != undefined) { |
70 | var _errObj = {}; | 71 | var _errObj = {}; |
71 | _errObj[_errImg] = "/miniapp/images/no-head.jpg"; | 72 | _errObj[_errImg] = "/miniapp/images/no-head.jpg"; |
72 | - this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; | 73 | + th.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; |
73 | } | 74 | } |
74 | }, | 75 | }, |
75 | //选择标签 | 76 | //选择标签 |
76 | check_label: function(e) { | 77 | check_label: function(e) { |
77 | var th = this; | 78 | var th = this; |
78 | - var evaluate = th.data.is_evaluate;//0为未评价,未评价才可点击标签 | ||
79 | - if (evaluate==0){ | ||
80 | - var index = e.currentTarget.dataset.index; | ||
81 | - var label_id = th.data.labels[index].check; | ||
82 | - var labels = 'labels[' + index + '].check'; | ||
83 | - if (label_id) { | ||
84 | - label_id = 0 | ||
85 | - } else { | ||
86 | - label_id = 1 | ||
87 | - } | ||
88 | - th.setData({ | ||
89 | - [labels]: label_id | ||
90 | - }) | 79 | + var evaluate = th.data.is_evaluate; //0为未评价,未评价才可点击标签 |
80 | + if (evaluate == 0) { | ||
81 | + var index = e.currentTarget.dataset.index; | ||
82 | + var label_id = th.data.labels[index].check; | ||
83 | + var labels = 'labels[' + index + '].check'; | ||
84 | + if (label_id) { | ||
85 | + label_id = 0 | ||
86 | + } else { | ||
87 | + label_id = 1 | ||
88 | + } | ||
89 | + th.setData({ | ||
90 | + [labels]: label_id | ||
91 | + }) | ||
91 | } | 92 | } |
92 | }, | 93 | }, |
93 | //查询美容师信息 | 94 | //查询美容师信息 |
@@ -106,7 +107,7 @@ Page({ | @@ -106,7 +107,7 @@ Page({ | ||
106 | var data = res.data.data.pageData; | 107 | var data = res.data.data.pageData; |
107 | var arrangeTime = data[0].ArrangeTime; | 108 | var arrangeTime = data[0].ArrangeTime; |
108 | th.setData({ | 109 | th.setData({ |
109 | - beautician: data[0], | 110 | + beautician: data, |
110 | arrangeTime: arrangeTime | 111 | arrangeTime: arrangeTime |
111 | }) | 112 | }) |
112 | } else { | 113 | } else { |
@@ -118,22 +119,22 @@ Page({ | @@ -118,22 +119,22 @@ Page({ | ||
118 | evaluate_get: function() { | 119 | evaluate_get: function() { |
119 | var th = this; | 120 | var th = this; |
120 | var url = "/api/weshop/evaluation/evaluate/get"; | 121 | var url = "/api/weshop/evaluation/evaluate/get"; |
121 | - getApp().request.promiseGet(url,{ | 122 | + getApp().request.promiseGet(url, { |
122 | data: { | 123 | data: { |
123 | number: th.data.number, | 124 | number: th.data.number, |
124 | storeId: a.stoid | 125 | storeId: a.stoid |
125 | } | 126 | } |
126 | }).then(res => { | 127 | }).then(res => { |
127 | - if(res.data.code == 0){ | ||
128 | - th.setData({ | ||
129 | - stars_index: res.data.data.Star, | ||
130 | - labels: res.data.data.EvaluationList, | ||
131 | - proposal: res.data.data.Remark, | ||
132 | - EvaluateDatetime: res.data.data.EvaluateDatetime.substring(0,19) | ||
133 | - }) | ||
134 | - }else{ | ||
135 | - getApp().my_warnning(res.data.msg,0,th); | ||
136 | - } | 128 | + if (res.data.code == 0) { |
129 | + th.setData({ | ||
130 | + stars_index: res.data.data.Star-1, | ||
131 | + labels: res.data.data.EvaluationList, | ||
132 | + proposal: res.data.data.Remark, | ||
133 | + EvaluateDatetime: res.data.data.EvaluateDatetime.substring(0, 19) | ||
134 | + }) | ||
135 | + } else { | ||
136 | + getApp().my_warnning(res.data.msg, 0, th); | ||
137 | + } | ||
137 | }) | 138 | }) |
138 | }, | 139 | }, |
139 | //提交评价 | 140 | //提交评价 |
@@ -145,10 +146,13 @@ Page({ | @@ -145,10 +146,13 @@ Page({ | ||
145 | if (stars < 0) { | 146 | if (stars < 0) { |
146 | getApp().my_warnning("请进行评分", 0, th); | 147 | getApp().my_warnning("请进行评分", 0, th); |
147 | return false; | 148 | return false; |
148 | - } else if (proposal==""){ | 149 | + } else if (proposal == "") { |
149 | getApp().my_warnning("给点建议呗", 0, th); | 150 | getApp().my_warnning("给点建议呗", 0, th); |
150 | return false; | 151 | return false; |
151 | } | 152 | } |
153 | + wx.showLoading({ | ||
154 | + title: '加载中', | ||
155 | + }) | ||
152 | var labels = th.data.labels; //星级标签数组 | 156 | var labels = th.data.labels; //星级标签数组 |
153 | var evaLabList = []; //用户选择的评价标签 | 157 | var evaLabList = []; //用户选择的评价标签 |
154 | // 查询评价标签 | 158 | // 查询评价标签 |
@@ -178,15 +182,14 @@ Page({ | @@ -178,15 +182,14 @@ Page({ | ||
178 | 'content-type': 'application/json' | 182 | 'content-type': 'application/json' |
179 | }, // 设置请求的 header | 183 | }, // 设置请求的 header |
180 | success: function(res) { | 184 | success: function(res) { |
185 | + wx.hideLoading(); | ||
181 | if (res.data.code == 0) { | 186 | if (res.data.code == 0) { |
182 | - th.setData({ | ||
183 | - sub_evaluate: 1 | ||
184 | - }) | 187 | + getApp().my_warnning("评价成功", 1, th); |
185 | setTimeout(function() { | 188 | setTimeout(function() { |
186 | wx.redirectTo({ | 189 | wx.redirectTo({ |
187 | url: "/pages/user/my_service/tment_order_list" | 190 | url: "/pages/user/my_service/tment_order_list" |
188 | }); | 191 | }); |
189 | - }, 1500); | 192 | + }, 2000); |
190 | } else { | 193 | } else { |
191 | getApp().my_warnning(res.data.msg, 0, th); | 194 | getApp().my_warnning(res.data.msg, 0, th); |
192 | } | 195 | } |
@@ -196,12 +199,14 @@ Page({ | @@ -196,12 +199,14 @@ Page({ | ||
196 | }, | 199 | }, |
197 | //图片失败,默认图片 | 200 | //图片失败,默认图片 |
198 | bind_bnerr1: function(e) { | 201 | bind_bnerr1: function(e) { |
202 | + var th = this; | ||
199 | var _errImg = e.target.dataset.errorimg; | 203 | var _errImg = e.target.dataset.errorimg; |
200 | var _Img = e.target.dataset.img; | 204 | var _Img = e.target.dataset.img; |
201 | if (_Img != undefined) { | 205 | if (_Img != undefined) { |
206 | + | ||
202 | var _errObj = {}; | 207 | var _errObj = {}; |
203 | - _errObj[_errImg] = "/miniapp/images/no-head.jpg"; | ||
204 | - this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; | 208 | + _errObj[_errImg] = th.data.iurl+"/miniapp/images/no-head.jpg"; |
209 | + th.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; | ||
205 | } | 210 | } |
206 | }, | 211 | }, |
207 | /** | 212 | /** |
@@ -222,8 +227,8 @@ Page({ | @@ -222,8 +227,8 @@ Page({ | ||
222 | onShow: function() { | 227 | onShow: function() { |
223 | var th = this; | 228 | var th = this; |
224 | var is_evaluate = th.data.is_evaluate; | 229 | var is_evaluate = th.data.is_evaluate; |
225 | - if (is_evaluate==1){ | 230 | + if (is_evaluate == 1) { |
226 | th.evaluate_get(); | 231 | th.evaluate_get(); |
227 | - } | 232 | + } |
228 | }, | 233 | }, |
229 | }) | 234 | }) |
230 | \ No newline at end of file | 235 | \ No newline at end of file |
pages/user/my_service/tment_eval.wxml
1 | -<view class="container"> | 1 | +<view class="container" wx:for="{{beautician}}" wx:if="{{index<1}}" wx:for-item="it"> |
2 | 2 | ||
3 | <!-- 头像 --> | 3 | <!-- 头像 --> |
4 | <view class="flex-center head"> | 4 | <view class="flex-center head"> |
5 | - <image class="headimg" src="{{beautician.PhotoUrl==''?iurl+defimgurl:beautician.PhotoUrl}}" lazy-load="true" data-errorimg="beautician.PhotoUrl" binderror="bind_bnerr1" data-img="{{beautician.PhotoUrl}}"></image> | 5 | + |
6 | + <image class="headimg" src="{{it.PhotoUrl==''?iurl+defimgurl:it.PhotoUrl}}" lazy-load="true" data-errorimg="beautician[{{index}}].PhotoUrl" binderror="bind_bnerr1" data-img="beautician[{{index}}].PhotoUrl"></image> | ||
6 | </view> | 7 | </view> |
7 | 8 | ||
8 | - <!-- 姓名 --> | 9 | + <!-- 姓名 --> |
9 | <view class="flex-level item"> | 10 | <view class="flex-level item"> |
10 | <view class="itemlf flex-level-right"> | 11 | <view class="itemlf flex-level-right"> |
11 | <view class="fs32">服务美容师:</view> | 12 | <view class="fs32">服务美容师:</view> |
12 | </view> | 13 | </view> |
13 | - <view class="itemlr fs30 ellipsis-1">{{beautician.BeauticianName}}</view> | 14 | + <view class="itemlr fs30 ellipsis-1">{{it.BeauticianName}}</view> |
14 | </view> | 15 | </view> |
15 | 16 | ||
16 | <!-- 项目 --> | 17 | <!-- 项目 --> |
17 | <view class="flex-center item"> | 18 | <view class="flex-center item"> |
18 | <view class="itemlf fs32 flex-level-right">服务项目:</view> | 19 | <view class="itemlf fs32 flex-level-right">服务项目:</view> |
19 | - <view class="itemlr fs30 ellipsis-1">{{beautician.StorageName}}</view> | 20 | + <view class="itemlr fs30 ellipsis-1">{{it.ServiceName}}</view> |
20 | </view> | 21 | </view> |
21 | 22 | ||
22 | <!-- 时间 --> | 23 | <!-- 时间 --> |
23 | <view class="flex-center item"> | 24 | <view class="flex-center item"> |
24 | <view class="itemlf fs32 flex-level-right">服务时间:</view> | 25 | <view class="itemlf fs32 flex-level-right">服务时间:</view> |
25 | - <view class="itemlr fs30">{{arrangeTime}}</view> | 26 | + <view class="itemlr fs30">{{it.WriteTime}}</view> |
26 | </view> | 27 | </view> |
27 | 28 | ||
28 | <!-- 评价时间 --> | 29 | <!-- 评价时间 --> |
@@ -35,7 +36,7 @@ | @@ -35,7 +36,7 @@ | ||
35 | 36 | ||
36 | <view class="flex-center"> | 37 | <view class="flex-center"> |
37 | <view class="starss"> | 38 | <view class="starss"> |
38 | - <image class="stars" src="{{iurl}}{{stars_index>=index?'/miniapp/images/StarsredCk.png':'/miniapp/images/StarswhiteUnCk.png'}}" wx:for="{{5}}" bindtap="check_stars" data-index="{{index}}"></image> | 39 | + <image class="stars" src="{{iurl}}{{key<=stars_index?'/miniapp/images/StarsredCk.png':'/miniapp/images/StarswhiteUnCk.png'}}" wx:for="{{5}}" bindtap="check_stars" data-index="{{key}}" wx:for-index="key"></image> |
39 | </view> | 40 | </view> |
40 | </view> | 41 | </view> |
41 | <view class="tea_labs"> | 42 | <view class="tea_labs"> |
@@ -61,7 +62,7 @@ | @@ -61,7 +62,7 @@ | ||
61 | </view> | 62 | </view> |
62 | <view wx:if="{{labels.length>0 && is_evaluate==1}}" class="{{labels.length==1 || labels.length==2?'flex-center':''}}" style="width:100%;"> | 63 | <view wx:if="{{labels.length>0 && is_evaluate==1}}" class="{{labels.length==1 || labels.length==2?'flex-center':''}}" style="width:100%;"> |
63 | <view class="labels flex fs24 ellipsis-3"> | 64 | <view class="labels flex fs24 ellipsis-3"> |
64 | - <view class="label {{item.check==1?'checklabel':''}} flex-center" wx:for="{{labels}}" bindtap="check_label" data-index="{{key}}" wx:for-index="key"> | 65 | + <view class="label checklabel flex-center" wx:for="{{labels}}" bindtap="check_label" data-index="{{key}}" wx:for-index="key"> |
65 | <view class="ellipsis-1">{{item.LabelName}}</view> | 66 | <view class="ellipsis-1">{{item.LabelName}}</view> |
66 | </view> | 67 | </view> |
67 | 68 | ||
@@ -85,8 +86,8 @@ | @@ -85,8 +86,8 @@ | ||
85 | </view> | 86 | </view> |
86 | </block> | 87 | </block> |
87 | </view> | 88 | </view> |
88 | -<navigator wx:if="{{is_evaluate==0}}" class="Subs fs32 flex-center" bindtap="evaluate_save"> | ||
89 | - <view class="Submission flex-center"> | 89 | +<navigator wx:if="{{is_evaluate==0}}" class="Subs fs32 flex-center"> |
90 | + <view class="Submission flex-center" bindtap="evaluate_save"> | ||
90 | <view>确认提交</view> | 91 | <view>确认提交</view> |
91 | </view> | 92 | </view> |
92 | </navigator> | 93 | </navigator> |
pages/user/my_service/tment_order_list.js
@@ -101,6 +101,9 @@ Page({ | @@ -101,6 +101,9 @@ Page({ | ||
101 | var arr1 = th.data.tm_order_list; | 101 | var arr1 = th.data.tm_order_list; |
102 | var arr2 = res.data.data.pageData; | 102 | var arr2 = res.data.data.pageData; |
103 | var arr3 = [...arr1, ...arr2]; | 103 | var arr3 = [...arr1, ...arr2]; |
104 | + for(var i = 0;i<arr3.length;i++){ | ||
105 | + arr3[i].ArrangeTime = arr3[i].ArrangeTime.substring(0, 16); | ||
106 | + } | ||
104 | var ismore = 0; | 107 | var ismore = 0; |
105 | if (arr3.length == res.data.data.total) ismore = 1 | 108 | if (arr3.length == res.data.data.total) ismore = 1 |
106 | th.setData({ | 109 | th.setData({ |
pages/user/my_service/tment_order_list.wxml
@@ -73,7 +73,7 @@ | @@ -73,7 +73,7 @@ | ||
73 | <navigator wx:if="{{item.State==0}}" class="important Unimportance flex-level" url="/pages/user/my_service/beauty_deta?BeauticianID={{item.BeauticianID}}&number={{item.Number}}&itemId={{item.ServiceID}}&modify=1&projectId={{item.ProjectID}}">更改时间</navigator> | 73 | <navigator wx:if="{{item.State==0}}" class="important Unimportance flex-level" url="/pages/user/my_service/beauty_deta?BeauticianID={{item.BeauticianID}}&number={{item.Number}}&itemId={{item.ServiceID}}&modify=1&projectId={{item.ProjectID}}">更改时间</navigator> |
74 | <navigator wx:if="{{item.State==1}}" url="/pages/user/my_service/tment_eval?Number={{item.Number}}&evaluate={{0}}" class="important Unimportance flex-level">发表评价</navigator> | 74 | <navigator wx:if="{{item.State==1}}" url="/pages/user/my_service/tment_eval?Number={{item.Number}}&evaluate={{0}}" class="important Unimportance flex-level">发表评价</navigator> |
75 | <navigator wx:if="{{item.State==2 || item.State==3}}" url="/pages/user/my_service/appment_main?ProjectID={{item.ProjectID}}&BuyType={{item.BuyType}}&service_id={{item.ServiceID}}" class="important Unimportance flex-level">重新预约</navigator> | 75 | <navigator wx:if="{{item.State==2 || item.State==3}}" url="/pages/user/my_service/appment_main?ProjectID={{item.ProjectID}}&BuyType={{item.BuyType}}&service_id={{item.ServiceID}}" class="important Unimportance flex-level">重新预约</navigator> |
76 | - <navigator wx:if="{{item.State==4}}" url="/pages/user/my_service/tment_eval?Number={{item.Number}}&evaluate={{1}}" class="important Unimportance flex-level">查看评价</navigator> | 76 | + <navigator wx:if="{{item.State==4}}" url="/pages/user/my_service/tment_eval?Number={{item.Number}}&evaluate={{1}}" class="important Unimportance flex-level">评价详情</navigator> |
77 | </view> | 77 | </view> |
78 | </view> | 78 | </view> |
79 | <view class="exactly flex-center fs26" wx:if="{{ismore && tm_order_list.length>=3}}"> | 79 | <view class="exactly flex-center fs26" wx:if="{{ismore && tm_order_list.length>=3}}"> |
pages/user/my_service/tment_order_list.wxss