Commit f836d06fc67ee8a6fc7255f9a371d6613ba9816d

Authored by abson
1 parent 18170d47

单项预约 查询时间增加vipid字段

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