Commit f836d06fc67ee8a6fc7255f9a371d6613ba9816d
1 parent
18170d47
单项预约 查询时间增加vipid字段
Showing
1 changed file
with
51 additions
and
50 deletions
pages/user/my_service/beauty_deta.js
| ... | ... | @@ -19,7 +19,7 @@ Page({ |
| 19 | 19 | comment: "", //美容师评价 |
| 20 | 20 | aweeks: [], //七天的预约时间 |
| 21 | 21 | head_img: "", //美容师头像 |
| 22 | - time:['08:00','08:30', '09:00', '09:30', '10:00', '10:30', '11:00', '11:30', '12:00', '12:30', '13:00', '13:30', '14:00','14:30', '15:00', '15:30', '16:00', '16:30', '17:00','17:30', '18:00','18:30', '19:00', '19:30', '20:00', '20:30', '21:00', '21:30', '22:00','22:30'], | |
| 22 | + time: ['08:00', '08:30', '09:00', '09:30', '10:00', '10:30', '11:00', '11:30', '12:00', '12:30', '13:00', '13:30', '14:00', '14:30', '15:00', '15:30', '16:00', '16:30', '17:00', '17:30', '18:00', '18:30', '19:00', '19:30', '20:00', '20:30', '21:00', '21:30', '22:00', '22:30'], | |
| 23 | 23 | weeks: [], //星期几数组 |
| 24 | 24 | time_index: -1, //选择预约时间下标 |
| 25 | 25 | date_id: 0, //选择日期的id |
| ... | ... | @@ -36,22 +36,22 @@ Page({ |
| 36 | 36 | /** |
| 37 | 37 | * 生命周期函数--监听页面加载 |
| 38 | 38 | */ |
| 39 | - onLoad: function(options) { | |
| 39 | + onLoad: function (options) { | |
| 40 | 40 | var th = this; |
| 41 | 41 | var myDate = new Date(); |
| 42 | 42 | var minutes = myDate.getMinutes(); //获取当前分钟数(0-59) |
| 43 | 43 | var hours = myDate.getHours() + ":" + minutes; //获取当前小时数(0-23) |
| 44 | 44 | var beautician_id = options.BeauticianID; |
| 45 | 45 | var storageId = options.StorageId; |
| 46 | - | |
| 47 | - | |
| 46 | + | |
| 47 | + | |
| 48 | 48 | th.setData({ |
| 49 | 49 | beautician_id: beautician_id, |
| 50 | 50 | itemId: options.itemId, |
| 51 | 51 | modify: options.modify, |
| 52 | 52 | hours: hours, |
| 53 | 53 | projectId: options.projectId, |
| 54 | - storageId:storageId | |
| 54 | + storageId: storageId | |
| 55 | 55 | }) |
| 56 | 56 | if (options.url != undefined) { |
| 57 | 57 | th.setData({ |
| ... | ... | @@ -68,17 +68,17 @@ Page({ |
| 68 | 68 | iscos: options.iscos |
| 69 | 69 | }) |
| 70 | 70 | } |
| 71 | - if (options.StaffName!=undefined){ | |
| 71 | + if (options.StaffName != undefined) { | |
| 72 | 72 | th.setData({ |
| 73 | 73 | StaffName: options.StaffName |
| 74 | 74 | }) |
| 75 | 75 | } |
| 76 | - th.query_beatea(th.query_aweek); | |
| 76 | + th.query_beatea(th.query_aweek); | |
| 77 | 77 | }, |
| 78 | 78 | /** |
| 79 | 79 | * 生命周期函数--监听页面显示 |
| 80 | 80 | */ |
| 81 | - onShow: function() { | |
| 81 | + onShow: function () { | |
| 82 | 82 | var th = this; |
| 83 | 83 | //获取当前时间 |
| 84 | 84 | var myDate = new Date(); |
| ... | ... | @@ -91,7 +91,7 @@ Page({ |
| 91 | 91 | }, |
| 92 | 92 | |
| 93 | 93 | //图片失败,默认图片 |
| 94 | - bind_bnerr1: function(e) { | |
| 94 | + bind_bnerr1: function (e) { | |
| 95 | 95 | var _errImg = e.target.dataset.errorimg; |
| 96 | 96 | var _Img = e.target.dataset.img; |
| 97 | 97 | if (_Img != undefined) { |
| ... | ... | @@ -101,7 +101,7 @@ Page({ |
| 101 | 101 | } |
| 102 | 102 | }, |
| 103 | 103 | //选择服务日期 |
| 104 | - check_date: function(e) { | |
| 104 | + check_date: function (e) { | |
| 105 | 105 | var th = this; |
| 106 | 106 | var id = e.currentTarget.dataset.dateid; |
| 107 | 107 | var date_id = th.data.date_id; |
| ... | ... | @@ -115,7 +115,7 @@ Page({ |
| 115 | 115 | } |
| 116 | 116 | }, |
| 117 | 117 | //获取美容师信息 |
| 118 | - query_beatea: function(func) { | |
| 118 | + query_beatea: function (func) { | |
| 119 | 119 | var th = this; |
| 120 | 120 | var url = "/api/weshop/marketing/reservation/staff/get"; //接口路径 |
| 121 | 121 | var beautician_id = th.data.beautician_id; |
| ... | ... | @@ -127,23 +127,23 @@ Page({ |
| 127 | 127 | }).then(res => { |
| 128 | 128 | if (res.data.code == 0) { |
| 129 | 129 | var data = res.data.data; |
| 130 | - var ob={ | |
| 130 | + var ob = { | |
| 131 | 131 | name: data.StaffName, |
| 132 | 132 | comment: data.Remark1, |
| 133 | 133 | head_img: data.PhotoUrl |
| 134 | - }; | |
| 135 | - if(!th.data.storageId){ | |
| 136 | - ob.storageId=data.StorageId; | |
| 137 | - } | |
| 134 | + }; | |
| 135 | + if (!th.data.storageId) { | |
| 136 | + ob.storageId = data.StorageId; | |
| 137 | + } | |
| 138 | 138 | th.setData(ob); |
| 139 | - func(); | |
| 139 | + func(); | |
| 140 | 140 | } else { |
| 141 | 141 | getApp().my_warnning(res.data.msg, 0, th); |
| 142 | 142 | } |
| 143 | 143 | }) |
| 144 | 144 | }, |
| 145 | 145 | //返回上个页面 |
| 146 | - navigateBack: function() { | |
| 146 | + navigateBack: function () { | |
| 147 | 147 | var th = this; |
| 148 | 148 | var modify = th.data.modify; //是否是更改时间 |
| 149 | 149 | var seekTime = th.data.seekTime; //选择的日期 |
| ... | ... | @@ -163,7 +163,6 @@ Page({ |
| 163 | 163 | "remark": "更改时间", |
| 164 | 164 | "states": 0, |
| 165 | 165 | "storeId": a.stoid, |
| 166 | - "VipId":getApp().globalData.userInfo.erpvipid, | |
| 167 | 166 | }; |
| 168 | 167 | var data = JSON.stringify(json); |
| 169 | 168 | var url = th.data.inurl + "/api/weshop/marketing/reservation/reservation/update"; //预约接口地址 |
| ... | ... | @@ -174,10 +173,10 @@ Page({ |
| 174 | 173 | header: { |
| 175 | 174 | 'content-type': 'application/json' |
| 176 | 175 | }, // 设置请求的 header |
| 177 | - success: function(res) { | |
| 176 | + success: function (res) { | |
| 178 | 177 | if (res.data.code == 0) { |
| 179 | 178 | getApp().my_warnning(res.data.data, 1, th); |
| 180 | - setTimeout(function() { | |
| 179 | + setTimeout(function () { | |
| 181 | 180 | wx.navigateBack({ |
| 182 | 181 | //返回 |
| 183 | 182 | delta: 1 |
| ... | ... | @@ -219,7 +218,7 @@ Page({ |
| 219 | 218 | } |
| 220 | 219 | }, |
| 221 | 220 | //选择时间 |
| 222 | - Selection_time: function(e) { | |
| 221 | + Selection_time: function (e) { | |
| 223 | 222 | var th = this; |
| 224 | 223 | var index = e.currentTarget.dataset.index; |
| 225 | 224 | var time_index = th.data.time_index; |
| ... | ... | @@ -232,11 +231,11 @@ Page({ |
| 232 | 231 | } |
| 233 | 232 | }, |
| 234 | 233 | //查询七天预约时间 |
| 235 | - query_aweek: function() { | |
| 234 | + query_aweek: function () { | |
| 236 | 235 | var th = this; |
| 237 | 236 | var beautician_id = th.data.beautician_id; //美容师id |
| 238 | - var storageId=th.data.storageId; | |
| 239 | - | |
| 237 | + var storageId = th.data.storageId; | |
| 238 | + | |
| 240 | 239 | var itemId = th.data.itemId; //服务id |
| 241 | 240 | var projectId = th.data.projectId; //项目id |
| 242 | 241 | var number = th.data.number; //预约单号 |
| ... | ... | @@ -247,8 +246,9 @@ Page({ |
| 247 | 246 | beauticianId: beautician_id, |
| 248 | 247 | serviceId: itemId, |
| 249 | 248 | storeId: a.stoid, |
| 250 | - storageId:storageId, | |
| 251 | - number: number | |
| 249 | + storageId: storageId, | |
| 250 | + number: number, | |
| 251 | + VipId: getApp().globalData.userInfo.erpvipid, | |
| 252 | 252 | } |
| 253 | 253 | }).then(res => { |
| 254 | 254 | if (res.data.code == 0) { |
| ... | ... | @@ -288,7 +288,7 @@ Page({ |
| 288 | 288 | |
| 289 | 289 | }, |
| 290 | 290 | |
| 291 | - query_date: function() { | |
| 291 | + query_date: function () { | |
| 292 | 292 | var th = this; |
| 293 | 293 | var projectId = th.data.projectId; |
| 294 | 294 | var date_id = th.data.date_id; //日期下标 |
| ... | ... | @@ -300,11 +300,12 @@ Page({ |
| 300 | 300 | data: { |
| 301 | 301 | projectId: projectId, |
| 302 | 302 | staffId: th.data.beautician_id, |
| 303 | - storageId:th.data.storageId, | |
| 303 | + storageId: th.data.storageId, | |
| 304 | 304 | serviceId: th.data.itemId, |
| 305 | 305 | seekTime: SeekTime, |
| 306 | 306 | storeId: a.stoid, |
| 307 | - number:number, | |
| 307 | + number: number, | |
| 308 | + VipId: getApp().globalData.userInfo.erpvipid, | |
| 308 | 309 | } |
| 309 | 310 | }).then(res => { |
| 310 | 311 | if (res.data.code == 0) { |
| ... | ... | @@ -313,11 +314,11 @@ Page({ |
| 313 | 314 | var time = th.data.time; |
| 314 | 315 | var date_id = th |
| 315 | 316 | var new_time = []; |
| 316 | - var date = th.data.hours.substring(0,2); | |
| 317 | + var date = th.data.hours.substring(0, 2); | |
| 317 | 318 | |
| 318 | 319 | //不等于空就是有可以预约的时间 |
| 319 | 320 | if (time_list != null) { |
| 320 | - if (res.data.data && res.data.data[0]!= undefined) { | |
| 321 | + if (res.data.data && res.data.data[0] != undefined) { | |
| 321 | 322 | if (res.data.data[0].GroupHour && res.data.data[0].GroupHour.length > 11) { |
| 322 | 323 | getApp().my_warnning(res.data.data[0].GroupHour, 0, th); |
| 323 | 324 | } |
| ... | ... | @@ -331,7 +332,7 @@ Page({ |
| 331 | 332 | if (date > time_list[ii].begintime.substring(0, 2) && date_id == 0) { |
| 332 | 333 | new_time[i] = ""; |
| 333 | 334 | break; |
| 334 | - }else{ | |
| 335 | + } else { | |
| 335 | 336 | new_time[i] = time_list[ii].begintime.substring(0, 5); |
| 336 | 337 | break; |
| 337 | 338 | } |
| ... | ... | @@ -340,9 +341,9 @@ Page({ |
| 340 | 341 | } |
| 341 | 342 | } |
| 342 | 343 | } |
| 343 | - }else{ | |
| 344 | - for(var i = 0 ;i<time.length;i++){ | |
| 345 | - new_time[i]=""; | |
| 344 | + } else { | |
| 345 | + for (var i = 0; i < time.length; i++) { | |
| 346 | + new_time[i] = ""; | |
| 346 | 347 | } |
| 347 | 348 | } |
| 348 | 349 | th.setData({ |
| ... | ... | @@ -355,7 +356,7 @@ Page({ |
| 355 | 356 | |
| 356 | 357 | }, |
| 357 | 358 | //更改预约时间 |
| 358 | - change_time: function() { | |
| 359 | + change_time: function () { | |
| 359 | 360 | var th = this; |
| 360 | 361 | var seekTime = th.data.seekTime; //选择的日期 |
| 361 | 362 | var time_list = th.data.time_list; |
| ... | ... | @@ -378,7 +379,7 @@ Page({ |
| 378 | 379 | header: { |
| 379 | 380 | 'content-type': 'application/json' |
| 380 | 381 | }, // 设置请求的 header |
| 381 | - success: function(res) { | |
| 382 | + success: function (res) { | |
| 382 | 383 | if (res.data.code == 0) { |
| 383 | 384 | getApp().my_warnning("更改成功", 0, th); |
| 384 | 385 | } else { |
| ... | ... | @@ -388,7 +389,7 @@ Page({ |
| 388 | 389 | }) |
| 389 | 390 | }, |
| 390 | 391 | //预览头像 |
| 391 | - previewImage: function(e) { | |
| 392 | + previewImage: function (e) { | |
| 392 | 393 | var th = this; |
| 393 | 394 | var current = e.currentTarget.dataset.src; |
| 394 | 395 | wx.previewImage({ |
| ... | ... | @@ -397,7 +398,7 @@ Page({ |
| 397 | 398 | }) |
| 398 | 399 | }, |
| 399 | 400 | |
| 400 | - sort_arr: function(a, b) { | |
| 401 | + sort_arr: function (a, b) { | |
| 401 | 402 | a = a['time']; |
| 402 | 403 | b = b['time']; |
| 403 | 404 | if (a < b) { |
| ... | ... | @@ -408,16 +409,16 @@ Page({ |
| 408 | 409 | } |
| 409 | 410 | return 0; |
| 410 | 411 | }, |
| 411 | - | |
| 412 | - check_is_in_arr:function(val,pdata) { | |
| 413 | - if(!val || !pdata) return false; | |
| 414 | - for(var i in pdata){ | |
| 415 | - if(pdata[i].begintime.indexOf(val)!=-1){ | |
| 416 | - return true; | |
| 417 | - } | |
| 418 | - } | |
| 419 | - return false; | |
| 420 | - } | |
| 412 | + | |
| 413 | + check_is_in_arr: function (val, pdata) { | |
| 414 | + if (!val || !pdata) return false; | |
| 415 | + for (var i in pdata) { | |
| 416 | + if (pdata[i].begintime.indexOf(val) != -1) { | |
| 417 | + return true; | |
| 418 | + } | |
| 419 | + } | |
| 420 | + return false; | |
| 421 | + } | |
| 421 | 422 | |
| 422 | 423 | |
| 423 | 424 | ... | ... |