Commit da7741ce9f72de623cadfe7502ec3db72360b3d4
1 parent
e631a2a1
texteat层次过高问题,历史服务添加未服务状态
Showing
3 changed files
with
130 additions
and
106 deletions
pages/user/my_service/appment_main.js
... | ... | @@ -60,11 +60,13 @@ Page({ |
60 | 60 | if (store) { |
61 | 61 | th.setData({ |
62 | 62 | store: 0, |
63 | + is_textea: 1 | |
63 | 64 | }) |
64 | 65 | } else { |
65 | 66 | th.setData({ |
66 | 67 | beautician: 0, |
67 | 68 | store: 1, |
69 | + is_textea: 0 | |
68 | 70 | }) |
69 | 71 | if (th.data.store_list.length < 1) { |
70 | 72 | wx.showLoading({ |
... | ... | @@ -86,116 +88,131 @@ Page({ |
86 | 88 | var th = this; |
87 | 89 | var store = th.data.store_name; //门店名称 |
88 | 90 | var bea_name = th.data.beautician_name; //美容师名称 |
89 | - var time = th.data.time+":00"; //预约时间 | |
91 | + var time = th.data.time + ":00"; //预约时间 | |
90 | 92 | var is_sub = th.data.is_sub; //是否重复提交 |
91 | 93 | //提交预约前的判断 |
92 | 94 | if (store == "") { |
93 | 95 | getApp().my_warnning("请选择服务门店", 0, th); |
96 | + th.settime(); | |
94 | 97 | return false; |
95 | 98 | } else if (bea_name == "") { |
96 | 99 | getApp().my_warnning("请选择美容师", 0, th); |
100 | + th.settime(); | |
97 | 101 | return false; |
98 | 102 | } else if (time == "") { |
99 | 103 | getApp().my_warnning("请选择预约时间", 0, th); |
104 | + th.settime(); | |
100 | 105 | return false; |
101 | 106 | } else { |
102 | - | |
103 | - var url = th.data.inurl + "/api/weshop/marketing/reservation/reservation/insert"; //接口路径 | |
104 | - var serviceId = th.data.itemId; //服务id | |
105 | - var beauticianID = th.data.beauticianID; //美容师id | |
106 | - var buyType = th.data.buyType; //服务项目类型 | |
107 | - var storeId = a.stoid; //商家id | |
108 | - var storageId = th.data.storageId; //门店id | |
109 | - var userId = d.user_id; //用户id | |
110 | - var remarks = th.data.remarks; //用户备注 | |
111 | - var project_id = th.data.project_id; //项目id | |
112 | - var validay = th.data.validay; | |
113 | - var json = { | |
114 | - "arrangeTime": time, | |
115 | - "beauticianId": beauticianID, | |
116 | - "buyType": buyType, | |
117 | - "effectiveDay": "", | |
118 | - "number": "", | |
119 | - "projectId": project_id, | |
120 | - "remark": remarks, | |
121 | - "serviceId": serviceId, | |
122 | - "states": 0, | |
123 | - "storageId": storageId, | |
124 | - "storeId": storeId, | |
125 | - "userId": userId, | |
126 | - "validay": validay | |
127 | - } | |
128 | - var data = JSON.stringify(json); | |
129 | - wx.request({ | |
130 | - url: url, | |
131 | - data: json, | |
132 | - method: 'post', | |
133 | - header: { | |
134 | - 'content-type': 'application/json' | |
135 | - }, // 设置请求的 header | |
136 | - success: function(res) { | |
107 | + wx.showLoading({ | |
108 | + title: '加载中', | |
109 | + }) | |
110 | + var url = th.data.inurl + "/api/weshop/marketing/reservation/reservation/insert"; //接口路径 | |
111 | + var serviceId = th.data.itemId; //服务id | |
112 | + var beauticianID = th.data.beauticianID; //美容师id | |
113 | + var buyType = th.data.buyType; //服务项目类型 | |
114 | + var storeId = a.stoid; //商家id | |
115 | + var storageId = th.data.storageId; //门店id | |
116 | + var userId = d.user_id; //用户id | |
117 | + var remarks = th.data.remarks; //用户备注 | |
118 | + var project_id = th.data.project_id; //项目id | |
119 | + var validay = th.data.validay; | |
120 | + var json = { | |
121 | + "arrangeTime": time, | |
122 | + "beauticianId": beauticianID, | |
123 | + "buyType": buyType, | |
124 | + "effectiveDay": "", | |
125 | + "number": "", | |
126 | + "projectId": project_id, | |
127 | + "remark": remarks, | |
128 | + "serviceId": serviceId, | |
129 | + "states": 0, | |
130 | + "storageId": storageId, | |
131 | + "storeId": storeId, | |
132 | + "userId": userId, | |
133 | + "validay": validay | |
134 | + } | |
135 | + var data = JSON.stringify(json); | |
136 | + wx.request({ | |
137 | + url: url, | |
138 | + data: json, | |
139 | + method: 'post', | |
140 | + header: { | |
141 | + 'content-type': 'application/json' | |
142 | + }, // 设置请求的 header | |
143 | + success: function(res) { | |
144 | + th.setData({ | |
145 | + is_sub: 0 | |
146 | + }) | |
147 | + wx.hideLoading(); | |
148 | + if (res.data.code == 0) { | |
149 | + getApp().my_warnning("预约成功", 1, th); | |
150 | + var store_name = th.data.store_name; //预约门店 | |
151 | + var number = res.data.data.Number; | |
152 | + var temp_url = "/api/wx/open/app/user/sendSubscribeMsg"; //模版接口 | |
153 | + var userinfo = getApp().globalData.userInfo; | |
154 | + var name = d.userInfo.nickname; | |
155 | + var json = { | |
156 | + // "formId": formid, | |
157 | + "keyWord": [{ | |
158 | + "keyword": res.data.data.ServiceName | |
159 | + }, | |
160 | + { | |
161 | + "keyword": time.substring(0, 16) | |
162 | + }, { | |
163 | + "keyword": res.data.data.BeauticianName | |
164 | + }, { | |
165 | + "keyword": res.data.data.StorageName | |
166 | + }, { | |
167 | + "keyword": res.data.data.Address | |
168 | + } | |
169 | + ], | |
170 | + "page": "/pages/user/my_service/tment_details?number=" + number, | |
171 | + "storeId": a.stoid, | |
172 | + "typeId": "1011", | |
173 | + "userId": d.user_id | |
174 | + }; | |
175 | + var data = JSON.stringify(json); | |
176 | + //调用发送预约成功模版接口 | |
177 | + wx.request({ | |
178 | + url: th.data.inurl + temp_url, | |
179 | + data: data, | |
180 | + method: 'post', | |
181 | + header: { | |
182 | + 'content-type': 'application/json' | |
183 | + }, // 设置请求的 header | |
184 | + success: function(data) {} | |
185 | + }) | |
186 | + setTimeout(function() { | |
187 | + wx.redirectTo({ | |
188 | + url: "/pages/user/my_service/tment_details?number=" + number | |
189 | + }); | |
190 | + }, 1000); | |
191 | + } else { | |
192 | + getApp().my_warnning(res.data.msg, 0, th); | |
193 | + th.settime(); | |
137 | 194 | th.setData({ |
138 | 195 | is_sub: 0 |
139 | 196 | }) |
140 | - wx.hideLoading(); | |
141 | - if (res.data.code == 0) { | |
142 | - getApp().my_warnning("预约成功", 1, th); | |
143 | - var store_name = th.data.store_name; //预约门店 | |
144 | - var number = res.data.data.Number; | |
145 | - var temp_url = "/api/wx/open/app/user/sendSubscribeMsg"; //模版接口 | |
146 | - var userinfo = getApp().globalData.userInfo; | |
147 | - var name = d.userInfo.nickname; | |
148 | - var json = { | |
149 | - // "formId": formid, | |
150 | - "keyWord": [{ | |
151 | - "keyword": res.data.data.ServiceName | |
152 | - }, | |
153 | - { | |
154 | - "keyword": time.substring(0,16) | |
155 | - }, { | |
156 | - "keyword": res.data.data.BeauticianName | |
157 | - }, { | |
158 | - "keyword": res.data.data.StorageName | |
159 | - }, { | |
160 | - "keyword": res.data.data.Address | |
161 | - } | |
162 | - ], | |
163 | - "page": "/pages/user/my_service/tment_details?number=" + number, | |
164 | - "storeId": a.stoid, | |
165 | - "typeId": "1011", | |
166 | - "userId": d.user_id | |
167 | - }; | |
168 | - var data = JSON.stringify(json); | |
169 | - //调用发送预约成功模版接口 | |
170 | - wx.request({ | |
171 | - url: th.data.inurl + temp_url, | |
172 | - data: data, | |
173 | - method: 'post', | |
174 | - header: { | |
175 | - 'content-type': 'application/json' | |
176 | - }, // 设置请求的 header | |
177 | - success: function(data) {} | |
178 | - }) | |
179 | - setTimeout(function() { | |
180 | - wx.redirectTo({ | |
181 | - url: "/pages/user/my_service/tment_details?number=" + number | |
182 | - }); | |
183 | - }, 1000); | |
184 | - } else { | |
185 | - getApp().my_warnning(res.data.msg, 0, th); | |
186 | - th.setData({ | |
187 | - is_sub: 0 | |
188 | - }) | |
189 | - } | |
190 | 197 | } |
191 | - }) | |
192 | - } | |
193 | - | |
198 | + } | |
199 | + }) | |
200 | + } | |
201 | + | |
202 | + }, | |
203 | + //定时显示texteat | |
204 | + settime:function(){ | |
205 | + var th = this; | |
206 | + setTimeout(function () { | |
207 | + th.setData({ | |
208 | + is_textea: 1 | |
209 | + }) | |
210 | + }, 2000); | |
194 | 211 | }, |
195 | 212 | //提交预约 |
196 | 213 | sub_success: function(e) { |
197 | 214 | var th = this; |
198 | - var temp_url = th.data.inurl+"/api/wx/weappSendlist/page"; | |
215 | + var temp_url = th.data.inurl + "/api/wx/weappSendlist/page"; | |
199 | 216 | var template_id = ""; |
200 | 217 | if (th.data.is_sub == 1) { |
201 | 218 | return false; |
... | ... | @@ -204,9 +221,6 @@ Page({ |
204 | 221 | is_textea: 0, |
205 | 222 | is_sub: 1 |
206 | 223 | }) |
207 | - wx.showLoading({ | |
208 | - title: '加载中', | |
209 | - }) | |
210 | 224 | //获取模版id |
211 | 225 | getApp().request.promiseGet(temp_url, { |
212 | 226 | data: { |
... | ... | @@ -219,13 +233,10 @@ Page({ |
219 | 233 | // //授权订阅 |
220 | 234 | wx.requestSubscribeMessage({ |
221 | 235 | tmplIds: [template_id], |
222 | - success(res) { | |
223 | - }, | |
224 | - fail(res) { | |
225 | - } | |
236 | + success(res) {}, | |
237 | + fail(res) {} | |
226 | 238 | }) |
227 | - } else { | |
228 | - } | |
239 | + } else {} | |
229 | 240 | }) |
230 | 241 | th.success(); |
231 | 242 | }, |
... | ... | @@ -237,8 +248,10 @@ Page({ |
237 | 248 | }) |
238 | 249 | if (th.data.store_name == "") { |
239 | 250 | getApp().my_warnning("请选择服务门店", 0, th); |
251 | + th.settime(); | |
240 | 252 | } else if (th.data.beautician_name == "") { |
241 | 253 | getApp().my_warnning("请选择美容师", 0, th); |
254 | + th.settime(); | |
242 | 255 | } else { |
243 | 256 | var url = e.currentTarget.dataset.url; |
244 | 257 | getApp().goto(url); |
... | ... | @@ -257,7 +270,8 @@ Page({ |
257 | 270 | fir_pick_index: index_c, |
258 | 271 | beautician_name: "", |
259 | 272 | time: "", |
260 | - tment_count: "" | |
273 | + tment_count: "", | |
274 | + is_textea: 1 | |
261 | 275 | }) |
262 | 276 | } |
263 | 277 | }, |
... | ... | @@ -270,7 +284,8 @@ Page({ |
270 | 284 | th.setData({ |
271 | 285 | store: 0, |
272 | 286 | store_name: store_name, |
273 | - storageId: Id | |
287 | + storageId: Id, | |
288 | + is_textea:1 | |
274 | 289 | }) |
275 | 290 | }, |
276 | 291 | onReachBottom: function() { |
... | ... | @@ -325,6 +340,7 @@ Page({ |
325 | 340 | } |
326 | 341 | } else { |
327 | 342 | getApp().my_warnning(res.data.msg, 0, th); |
343 | + th.settime(); | |
328 | 344 | } |
329 | 345 | }) |
330 | 346 | }, |
... | ... | @@ -336,6 +352,7 @@ Page({ |
336 | 352 | }) |
337 | 353 | if (th.data.store_name == "") { |
338 | 354 | getApp().my_warnning("请选择服务门店", 0, th); |
355 | + th.settime(); | |
339 | 356 | } else { |
340 | 357 | wx.showLoading({ |
341 | 358 | title: '加载中', |
... | ... | @@ -358,6 +375,7 @@ Page({ |
358 | 375 | }) |
359 | 376 | if (res.data.data.pageData.length < 1) { |
360 | 377 | getApp().my_warnning("暂无美容师", 0, th); |
378 | + th.settime(); | |
361 | 379 | } else { |
362 | 380 | if (th.data.beautician == 0) { |
363 | 381 | th.setData({ |
... | ... | @@ -370,7 +388,8 @@ Page({ |
370 | 388 | } |
371 | 389 | } |
372 | 390 | } else { |
373 | - getApp().my_warnning("暂无美容师", 0, th); | |
391 | + getApp().my_warnning(res.data.msg, 0, th); | |
392 | + th.settime(); | |
374 | 393 | } |
375 | 394 | }) |
376 | 395 | } |
... | ... | @@ -387,7 +406,7 @@ Page({ |
387 | 406 | beauticianID: BeauticianID, |
388 | 407 | time: "", |
389 | 408 | tment_count: "", |
390 | - is_textea: 0 | |
409 | + is_textea: 1 | |
391 | 410 | }) |
392 | 411 | |
393 | 412 | }, |
... | ... | @@ -424,6 +443,7 @@ Page({ |
424 | 443 | var project_id = th.data.project_id; |
425 | 444 | if (storageId == "") { |
426 | 445 | getApp().my_warnning("请选择服务门店", 0, th); |
446 | + th.settime(); | |
427 | 447 | } else { |
428 | 448 | wx.navigateTo({ |
429 | 449 | url: "/pages/user/my_service/cosmetology_list?" + 'storageId=' + storageId + '&' + 'itemId=' + itemId + '&' + "projectId=" + project_id |
... | ... | @@ -458,6 +478,7 @@ Page({ |
458 | 478 | }); |
459 | 479 | if (th.data.is_gps == 0) { |
460 | 480 | getApp().confirmBox("请开启GPS定位", null, 25000, !1); |
481 | + th.settime(); | |
461 | 482 | } |
462 | 483 | } else { |
463 | 484 | th.setData({ |
... | ... | @@ -494,6 +515,7 @@ Page({ |
494 | 515 | }) |
495 | 516 | } else { |
496 | 517 | getApp().my_warnning(res.data.msg, 0, th); |
518 | + th.settime(); | |
497 | 519 | } |
498 | 520 | }) |
499 | 521 | |
... | ... | @@ -529,7 +551,8 @@ Page({ |
529 | 551 | validay: res.data.data.pageData[0].Validay |
530 | 552 | }) |
531 | 553 | } else { |
532 | - getApp().my_warnning(res.data.msg, 0, th); | |
554 | + getApp().my_warnning(res.data.msg, 0, th); | |
555 | + th.settime(); | |
533 | 556 | } |
534 | 557 | }) |
535 | 558 | }, | ... | ... |
pages/user/my_service/appment_main.wxml
... | ... | @@ -69,12 +69,12 @@ |
69 | 69 | <view>注</view> |
70 | 70 | </view> |
71 | 71 | <view class="flex fs26"> |
72 | - <block wx:if="{{is_textea==1 && store==0}}"> | |
72 | + <block wx:if="{{is_textea==1}}"> | |
73 | 73 | <textarea class="textarea" placeholder="{{remarks==''?'填写备注':remarks}}" placeholder-class="fs26 color" value="{{remarks}}" bindinput="input_remarks" maxlength="100"> |
74 | 74 | </textarea> |
75 | 75 | </block> |
76 | 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 | 78 | </view> |
79 | 79 | </block> |
80 | 80 | </view> | ... | ... |
pages/user/my_service/hist_service.wxml