Commit fcb0c6180e5ceb2c61e447af7b95c95b14a9bca3
1 parent
14a8d5f6
提交预约bug修复
Showing
5 changed files
with
93 additions
and
25 deletions
pages/user/my_service/appment_main.js
@@ -91,17 +91,20 @@ Page({ | @@ -91,17 +91,20 @@ Page({ | ||
91 | var userId = d.user_id; //用户id | 91 | var userId = d.user_id; //用户id |
92 | var remarks = th.data.remarks; //用户备注 | 92 | var remarks = th.data.remarks; //用户备注 |
93 | var project_id = th.data.project_id; //项目id | 93 | var project_id = th.data.project_id; //项目id |
94 | + | ||
94 | var json = { | 95 | var json = { |
95 | - "serviceId": serviceId, | ||
96 | - "projectId": project_id, | 96 | + "arrangeTime": time, |
97 | "beauticianId": beauticianID, | 97 | "beauticianId": beauticianID, |
98 | "buyType": buyType, | 98 | "buyType": buyType, |
99 | - "storeId": storeId, | ||
100 | - "storageId": storageId, | ||
101 | - "arrangeTime": time, | ||
102 | - "userId": userId, | 99 | + "effectiveDay": "", |
100 | + "number": "", | ||
101 | + "projectId": project_id, | ||
103 | "remark": remarks, | 102 | "remark": remarks, |
104 | - "states": 0 | 103 | + "serviceId": serviceId, |
104 | + "states": 0, | ||
105 | + "storageId": storageId, | ||
106 | + "storeId": storeId, | ||
107 | + "userId": userId | ||
105 | } | 108 | } |
106 | var data = JSON.stringify(json); | 109 | var data = JSON.stringify(json); |
107 | wx.request({ | 110 | wx.request({ |
@@ -149,7 +152,7 @@ Page({ | @@ -149,7 +152,7 @@ Page({ | ||
149 | th.setData({ | 152 | th.setData({ |
150 | fir_pick_index: index_c, | 153 | fir_pick_index: index_c, |
151 | beautician_name: "", | 154 | beautician_name: "", |
152 | - time: "2019-12-10 12:00:00", | 155 | + time: "", |
153 | tment_count: "" | 156 | tment_count: "" |
154 | }) | 157 | }) |
155 | } | 158 | } |
@@ -243,6 +246,8 @@ Page({ | @@ -243,6 +246,8 @@ Page({ | ||
243 | th.setData({ | 246 | th.setData({ |
244 | beautician_list: res.data.data.pageData | 247 | beautician_list: res.data.data.pageData |
245 | }) //停止下拉刷新 | 248 | }) //停止下拉刷新 |
249 | + } else { | ||
250 | + getApp().my_warnning(res.data.msg, 0, th); | ||
246 | } | 251 | } |
247 | }) | 252 | }) |
248 | } | 253 | } |
@@ -257,7 +262,7 @@ Page({ | @@ -257,7 +262,7 @@ Page({ | ||
257 | beautician: 0, | 262 | beautician: 0, |
258 | bea_index: bea_index, | 263 | bea_index: bea_index, |
259 | beauticianID: BeauticianID, | 264 | beauticianID: BeauticianID, |
260 | - time: "2019-12-10 13:00:00", | 265 | + time: "", |
261 | tment_count: "" | 266 | tment_count: "" |
262 | }) | 267 | }) |
263 | 268 | ||
@@ -316,17 +321,17 @@ Page({ | @@ -316,17 +321,17 @@ Page({ | ||
316 | //查询剩下可预约人数 | 321 | //查询剩下可预约人数 |
317 | query_more: function() { | 322 | query_more: function() { |
318 | var th = this; | 323 | var th = this; |
319 | - var url = "/api/weshop/marketing/reservation/marketing/can/reservation/count"; | 324 | + var url = "/api/weshop/marketing/reservation/can/reservation/count"; |
320 | var beauticianID = th.data.beauticianID; //美容师id | 325 | var beauticianID = th.data.beauticianID; //美容师id |
321 | - var projectID = th.data.itemId; //项目id | ||
322 | - var seekTime = th.data.time.substring(0, 11); //预约日期 | 326 | + var projectID = th.data.itemId; //服务id |
327 | + var seekTime = th.data.time.substring(0, 10); //预约日期 | ||
323 | var storageId = th.data.storageId; //门店id | 328 | var storageId = th.data.storageId; //门店id |
324 | var storeId = a.stoid; //商家id | 329 | var storeId = a.stoid; //商家id |
325 | getApp().request.promiseGet(url, { | 330 | getApp().request.promiseGet(url, { |
326 | data: { | 331 | data: { |
327 | - beauticianID: beauticianID, | ||
328 | - serviceId: projectID, | 332 | + beauticianId: beauticianID, |
329 | seekTime: seekTime, | 333 | seekTime: seekTime, |
334 | + serviceId: projectID, | ||
330 | storageId: storageId, | 335 | storageId: storageId, |
331 | storeId: storeId | 336 | storeId: storeId |
332 | } | 337 | } |
@@ -336,6 +341,8 @@ Page({ | @@ -336,6 +341,8 @@ Page({ | ||
336 | th.setData({ | 341 | th.setData({ |
337 | tment_count: tment_count | 342 | tment_count: tment_count |
338 | }) | 343 | }) |
344 | + } else { | ||
345 | + getApp().my_warnning(res.data.msg, 0, th); | ||
339 | } | 346 | } |
340 | }) | 347 | }) |
341 | 348 | ||
@@ -345,6 +352,9 @@ Page({ | @@ -345,6 +352,9 @@ Page({ | ||
345 | */ | 352 | */ |
346 | onShow: function() { | 353 | onShow: function() { |
347 | var th = this; | 354 | var th = this; |
348 | - th.query_more(); | 355 | + var seekTime = th.data.time; //预约日期 |
356 | + if (seekTime != "") { | ||
357 | + th.query_more(); | ||
358 | + } | ||
349 | } | 359 | } |
350 | }) | 360 | }) |
351 | \ No newline at end of file | 361 | \ No newline at end of file |
pages/user/my_service/appment_main.wxml
@@ -90,7 +90,6 @@ | @@ -90,7 +90,6 @@ | ||
90 | <view>提交预约</view> | 90 | <view>提交预约</view> |
91 | </view> | 91 | </view> |
92 | </view> | 92 | </view> |
93 | - | ||
94 | <block wx:if="{{is_success}}"> | 93 | <block wx:if="{{is_success}}"> |
95 | <view class="subSuccess fs36"> | 94 | <view class="subSuccess fs36"> |
96 | <image class="Success" src="{{iurl}}/miniapp/images/yyservice/Success.png"></image> | 95 | <image class="Success" src="{{iurl}}/miniapp/images/yyservice/Success.png"></image> |
pages/user/my_service/beauty_deta.js
@@ -9,6 +9,7 @@ Page({ | @@ -9,6 +9,7 @@ Page({ | ||
9 | * 页面的初始数据 | 9 | * 页面的初始数据 |
10 | */ | 10 | */ |
11 | data: { | 11 | data: { |
12 | + inurl: a.url, //接口网址 | ||
12 | iurl: a.imghost, | 13 | iurl: a.imghost, |
13 | url: "", //选择选择时间后返回的页面 | 14 | url: "", //选择选择时间后返回的页面 |
14 | defimgurl: "/miniapp/images/yyservice/yyxmdefault.jpg", | 15 | defimgurl: "/miniapp/images/yyservice/yyxmdefault.jpg", |
@@ -18,11 +19,12 @@ Page({ | @@ -18,11 +19,12 @@ Page({ | ||
18 | comment: "", //美容师评价 | 19 | comment: "", //美容师评价 |
19 | aweeks: [], //七天的预约时间 | 20 | aweeks: [], //七天的预约时间 |
20 | head_img: "", //美容师头像 | 21 | head_img: "", //美容师头像 |
21 | - time: ["08:00", "09:00", "10:00", "11:00", "12:00", "13:00", "14:00", "15:00", "16:00", "17:00", "18:00", "19:00","20:00", "21:00", "22:00"], | 22 | + time: ["08:00", "09:00", "10:00", "11:00", "12:00", "13:00", "14:00", "15:00", "16:00", "17:00", "18:00", "19:00", "20:00", "21:00", "22:00"], |
22 | time_index: "", //选择预约时间下标 | 23 | time_index: "", //选择预约时间下标 |
23 | date_id: 0, //选择日期的id | 24 | date_id: 0, //选择日期的id |
24 | beautician_id: "337C11B8-034B-495D-B360-FC2F6CB29394", //美容师id | 25 | beautician_id: "337C11B8-034B-495D-B360-FC2F6CB29394", //美容师id |
25 | itemId: "", //服务id | 26 | itemId: "", //服务id |
27 | + number: "", //预约单号 | ||
26 | }, | 28 | }, |
27 | 29 | ||
28 | /** | 30 | /** |
@@ -36,6 +38,11 @@ Page({ | @@ -36,6 +38,11 @@ Page({ | ||
36 | beautician_id: beautician_id, | 38 | beautician_id: beautician_id, |
37 | itemId: options.itemId | 39 | itemId: options.itemId |
38 | }) | 40 | }) |
41 | + if (options.number != "") { | ||
42 | + th.setData({ | ||
43 | + number: options.number | ||
44 | + }) | ||
45 | + } | ||
39 | th.query_beatea(); | 46 | th.query_beatea(); |
40 | th.query_aweek(); | 47 | th.query_aweek(); |
41 | }, | 48 | }, |
@@ -95,13 +102,32 @@ Page({ | @@ -95,13 +102,32 @@ Page({ | ||
95 | //返回上个页面 | 102 | //返回上个页面 |
96 | navigateBack: function() { | 103 | navigateBack: function() { |
97 | var th = this; | 104 | var th = this; |
98 | - var seekTime = th.data.seekTime;//选择的日期 | 105 | + var seekTime = th.data.seekTime; //选择的日期 |
99 | var time_list = th.data.time_list; | 106 | var time_list = th.data.time_list; |
100 | var time_index = th.data.time_index; | 107 | var time_index = th.data.time_index; |
101 | - var time = time_list[time_index]; | 108 | + var date_id = th.data.date_id; |
109 | + var date = th.data.aweeks[date_id].time; | ||
110 | + var time = date+" "+time_list[time_index]+":00"; | ||
111 | + // wx.navigateBack({ | ||
112 | + // url: th.data.url + '?' + 'seekTime=' + seekTime + '&' + "time=" + time | ||
113 | + // }); | ||
114 | + var pages = getCurrentPages(); //当前页面 | ||
115 | + | ||
116 | + var prevPage = pages[pages.length - 2]; //上一页面 | ||
117 | + | ||
118 | + prevPage.setData({ | ||
119 | + | ||
120 | + //直接给上一个页面赋值 | ||
121 | + time: time, | ||
122 | + | ||
123 | + }); | ||
124 | + | ||
102 | wx.navigateBack({ | 125 | wx.navigateBack({ |
103 | - url: th.data.url + '?' + 'seekTime=' + seekTime+'&'+"time="+time | ||
104 | - }); | 126 | + |
127 | + //返回 | ||
128 | + delta: 1 | ||
129 | + | ||
130 | + }) | ||
105 | }, | 131 | }, |
106 | //选择时间 | 132 | //选择时间 |
107 | Selection_time: function(e) { | 133 | Selection_time: function(e) { |
@@ -171,7 +197,7 @@ Page({ | @@ -171,7 +197,7 @@ Page({ | ||
171 | for (var ii = 0; ii < time_list.length; ii++) { | 197 | for (var ii = 0; ii < time_list.length; ii++) { |
172 | if (time[i] == time_list[ii].GroupHour.substring(0, 5)) { | 198 | if (time[i] == time_list[ii].GroupHour.substring(0, 5)) { |
173 | new_time[i] = time_list[ii].GroupHour.substring(0, 5); | 199 | new_time[i] = time_list[ii].GroupHour.substring(0, 5); |
174 | - break; | 200 | + break; |
175 | } else { | 201 | } else { |
176 | new_time[i] = ""; | 202 | new_time[i] = ""; |
177 | } | 203 | } |
@@ -185,8 +211,41 @@ Page({ | @@ -185,8 +211,41 @@ Page({ | ||
185 | } | 211 | } |
186 | }) | 212 | }) |
187 | }, | 213 | }, |
214 | + //更改预约时间 | ||
215 | + change_time: function() { | ||
216 | + var th = this; | ||
217 | + var seekTime = th.data.seekTime; //选择的日期 | ||
218 | + var time_list = th.data.time_list; | ||
219 | + var time_index = th.data.time_index; | ||
220 | + var time = time_list[time_index]; | ||
221 | + var number = th.data.number; //预约单号 | ||
222 | + var json = { | ||
223 | + "arrangeTime": seekTime + " " + time, | ||
224 | + "number": number, | ||
225 | + "remark": "更改预约时间", | ||
226 | + "states": 0, | ||
227 | + "storeId": a.stoid | ||
228 | + }; | ||
229 | + var data = JSON.stringify(json); | ||
230 | + var url = th.data.inurl + "/api/weshop/marketing/reservation/reservation/update"; //预约接口地址 | ||
231 | + wx.request({ | ||
232 | + url: url, | ||
233 | + data: data, | ||
234 | + method: 'put', | ||
235 | + header: { | ||
236 | + 'content-type': 'application/json' | ||
237 | + }, // 设置请求的 header | ||
238 | + success: function(res) { | ||
239 | + if (res.data.code == 0) { | ||
240 | + getApp().my_warnning("更改成功", 0, th); | ||
241 | + } else { | ||
242 | + getApp().my_warnning(res.data.msg, 0, th); | ||
243 | + } | ||
244 | + } | ||
245 | + }) | ||
246 | + }, | ||
188 | //预览头像 | 247 | //预览头像 |
189 | - previewImage: function (e) { | 248 | + previewImage: function(e) { |
190 | var th = this; | 249 | var th = this; |
191 | var current = e.currentTarget.dataset.src; | 250 | var current = e.currentTarget.dataset.src; |
192 | wx.previewImage({ | 251 | wx.previewImage({ |
pages/user/my_service/i_service.wxml
@@ -29,7 +29,7 @@ | @@ -29,7 +29,7 @@ | ||
29 | </view> | 29 | </view> |
30 | 30 | ||
31 | <view class="flex-center itemName"> | 31 | <view class="flex-center itemName"> |
32 | - <view class="fs32 Name ellipsis-1">{{item.ProjectName}}</view> | 32 | + <view class="fs32 Name ellipsis-1">{{item.ServiceName}}</view> |
33 | </view> | 33 | </view> |
34 | 34 | ||
35 | <view class="flex-center fs24 itemCount"> | 35 | <view class="flex-center fs24 itemCount"> |
pages/user/my_service/tment_order_list.wxml
@@ -63,7 +63,7 @@ | @@ -63,7 +63,7 @@ | ||
63 | <block wx:else> | 63 | <block wx:else> |
64 | <navigator url="/pages/user/my_service/tment_details?number={{item.Number}}" class="Unimportance flex-level">查看详情</navigator> | 64 | <navigator url="/pages/user/my_service/tment_details?number={{item.Number}}" class="Unimportance flex-level">查看详情</navigator> |
65 | </block> | 65 | </block> |
66 | - <navigator wx:if="{{item.State==0}}" class="important Unimportance flex-level" url="/pages/user/my_service/beauty_deta?BeauticianID={{item.BeauticianID}}&service_id={{item.ServiceID}}">更改时间</navigator> | 66 | + <navigator wx:if="{{item.State==0}}" class="important Unimportance flex-level" url="/pages/user/my_service/beauty_deta?BeauticianID={{item.BeauticianID}}&service_id={{item.ServiceID}}&number={{item.Number}}">更改时间</navigator> |
67 | <navigator wx:if="{{item.State==1}}" url="/pages/user/my_service/tment_eval?Number={{item.Number}}" class="important Unimportance flex-level">发表评价</navigator> | 67 | <navigator wx:if="{{item.State==1}}" url="/pages/user/my_service/tment_eval?Number={{item.Number}}" class="important Unimportance flex-level">发表评价</navigator> |
68 | <navigator wx:if="{{item.State==2 || item.State==3 || item.State==4}}" url="/pages/user/my_service/appment_main?ProjectID={{item.ProjectID}}&BuyType={{item.BuyType}}&service_id={{item.ServiceID}}" class="important Unimportance flex-level">重新预约</navigator> | 68 | <navigator wx:if="{{item.State==2 || item.State==3 || item.State==4}}" url="/pages/user/my_service/appment_main?ProjectID={{item.ProjectID}}&BuyType={{item.BuyType}}&service_id={{item.ServiceID}}" class="important Unimportance flex-level">重新预约</navigator> |
69 | </view> | 69 | </view> |