diff --git a/pages/user/my_service/beauty_deta.js b/pages/user/my_service/beauty_deta.js index 00c9a10..472f206 100644 --- a/pages/user/my_service/beauty_deta.js +++ b/pages/user/my_service/beauty_deta.js @@ -19,7 +19,7 @@ Page({ comment: "", //美容师评价 aweeks: [], //七天的预约时间 head_img: "", //美容师头像 - 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'], + 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'], weeks: [], //星期几数组 time_index: -1, //选择预约时间下标 date_id: 0, //选择日期的id @@ -36,22 +36,22 @@ Page({ /** * 生命周期函数--监听页面加载 */ - onLoad: function(options) { + onLoad: function (options) { var th = this; var myDate = new Date(); var minutes = myDate.getMinutes(); //获取当前分钟数(0-59) var hours = myDate.getHours() + ":" + minutes; //获取当前小时数(0-23) var beautician_id = options.BeauticianID; var storageId = options.StorageId; - - + + th.setData({ beautician_id: beautician_id, itemId: options.itemId, modify: options.modify, hours: hours, projectId: options.projectId, - storageId:storageId + storageId: storageId }) if (options.url != undefined) { th.setData({ @@ -68,17 +68,17 @@ Page({ iscos: options.iscos }) } - if (options.StaffName!=undefined){ + if (options.StaffName != undefined) { th.setData({ StaffName: options.StaffName }) } - th.query_beatea(th.query_aweek); + th.query_beatea(th.query_aweek); }, /** * 生命周期函数--监听页面显示 */ - onShow: function() { + onShow: function () { var th = this; //获取当前时间 var myDate = new Date(); @@ -91,7 +91,7 @@ Page({ }, //图片失败,默认图片 - bind_bnerr1: function(e) { + bind_bnerr1: function (e) { var _errImg = e.target.dataset.errorimg; var _Img = e.target.dataset.img; if (_Img != undefined) { @@ -101,7 +101,7 @@ Page({ } }, //选择服务日期 - check_date: function(e) { + check_date: function (e) { var th = this; var id = e.currentTarget.dataset.dateid; var date_id = th.data.date_id; @@ -115,7 +115,7 @@ Page({ } }, //获取美容师信息 - query_beatea: function(func) { + query_beatea: function (func) { var th = this; var url = "/api/weshop/marketing/reservation/staff/get"; //接口路径 var beautician_id = th.data.beautician_id; @@ -127,23 +127,23 @@ Page({ }).then(res => { if (res.data.code == 0) { var data = res.data.data; - var ob={ + var ob = { name: data.StaffName, comment: data.Remark1, head_img: data.PhotoUrl - }; - if(!th.data.storageId){ - ob.storageId=data.StorageId; - } + }; + if (!th.data.storageId) { + ob.storageId = data.StorageId; + } th.setData(ob); - func(); + func(); } else { getApp().my_warnning(res.data.msg, 0, th); } }) }, //返回上个页面 - navigateBack: function() { + navigateBack: function () { var th = this; var modify = th.data.modify; //是否是更改时间 var seekTime = th.data.seekTime; //选择的日期 @@ -163,7 +163,6 @@ Page({ "remark": "更改时间", "states": 0, "storeId": a.stoid, - "VipId":getApp().globalData.userInfo.erpvipid, }; var data = JSON.stringify(json); var url = th.data.inurl + "/api/weshop/marketing/reservation/reservation/update"; //预约接口地址 @@ -174,10 +173,10 @@ Page({ header: { 'content-type': 'application/json' }, // 设置请求的 header - success: function(res) { + success: function (res) { if (res.data.code == 0) { getApp().my_warnning(res.data.data, 1, th); - setTimeout(function() { + setTimeout(function () { wx.navigateBack({ //返回 delta: 1 @@ -219,7 +218,7 @@ Page({ } }, //选择时间 - Selection_time: function(e) { + Selection_time: function (e) { var th = this; var index = e.currentTarget.dataset.index; var time_index = th.data.time_index; @@ -232,11 +231,11 @@ Page({ } }, //查询七天预约时间 - query_aweek: function() { + query_aweek: function () { var th = this; var beautician_id = th.data.beautician_id; //美容师id - var storageId=th.data.storageId; - + var storageId = th.data.storageId; + var itemId = th.data.itemId; //服务id var projectId = th.data.projectId; //项目id var number = th.data.number; //预约单号 @@ -247,8 +246,9 @@ Page({ beauticianId: beautician_id, serviceId: itemId, storeId: a.stoid, - storageId:storageId, - number: number + storageId: storageId, + number: number, + VipId: getApp().globalData.userInfo.erpvipid, } }).then(res => { if (res.data.code == 0) { @@ -288,7 +288,7 @@ Page({ }, - query_date: function() { + query_date: function () { var th = this; var projectId = th.data.projectId; var date_id = th.data.date_id; //日期下标 @@ -300,11 +300,12 @@ Page({ data: { projectId: projectId, staffId: th.data.beautician_id, - storageId:th.data.storageId, + storageId: th.data.storageId, serviceId: th.data.itemId, seekTime: SeekTime, storeId: a.stoid, - number:number, + number: number, + VipId: getApp().globalData.userInfo.erpvipid, } }).then(res => { if (res.data.code == 0) { @@ -313,11 +314,11 @@ Page({ var time = th.data.time; var date_id = th var new_time = []; - var date = th.data.hours.substring(0,2); + var date = th.data.hours.substring(0, 2); //不等于空就是有可以预约的时间 if (time_list != null) { - if (res.data.data && res.data.data[0]!= undefined) { + if (res.data.data && res.data.data[0] != undefined) { if (res.data.data[0].GroupHour && res.data.data[0].GroupHour.length > 11) { getApp().my_warnning(res.data.data[0].GroupHour, 0, th); } @@ -331,7 +332,7 @@ Page({ if (date > time_list[ii].begintime.substring(0, 2) && date_id == 0) { new_time[i] = ""; break; - }else{ + } else { new_time[i] = time_list[ii].begintime.substring(0, 5); break; } @@ -340,9 +341,9 @@ Page({ } } } - }else{ - for(var i = 0 ;i