diff --git a/pages/user/my_service/appment_main.js b/pages/user/my_service/appment_main.js index 9740689..7976d7f 100644 --- a/pages/user/my_service/appment_main.js +++ b/pages/user/my_service/appment_main.js @@ -41,6 +41,20 @@ Page({ lat: "", //纬度坐标 lon: "", //经度坐标 is_gps: 1, //是否开启gps + validay: "", //服务项目有效期 + is_sub: 0, //判断是否重复提交 + is_textea: 1, //备注是否是可输入 + }, + //控制备注输入 + check_text: function() { + var th = this; + var is_textea = th.data.is_textea; + if (is_textea == 0) { + th.setData({ + is_textea: 1, + beautician: 0 + }) + } }, onclickstore: function() { var th = this; @@ -48,14 +62,11 @@ Page({ if (store) { th.setData({ store: 0, - placeholder: "填写备注" }) - wx.hideLoading(); } else { th.setData({ beautician: 0, store: 1, - placeholder: "" }) if (th.data.store_list.length < 1) { wx.showLoading({ @@ -73,11 +84,13 @@ Page({ }) }, //提交预约 - sub_success: function() { + sub_success: function(e) { var th = this; + var formid = e.detail.formId; //发送预约成功模版信息 var store = th.data.store_name; //门店名称 var bea_name = th.data.beautician_name; //美容师名称 var time = th.data.time; //预约时间 + var is_sub = th.data.is_sub; //是否重复提交 //提交预约前的判断 if (store == "") { getApp().my_warnning("请选择服务门店", 0, th); @@ -89,53 +102,101 @@ Page({ getApp().my_warnning("请选择预约时间", 0, th); return false; } else { - var url = th.data.inurl + "/api/weshop/marketing/reservation/reservation/insert"; //接口路径 - var serviceId = th.data.itemId; //服务id - var beauticianID = th.data.beauticianID; //美容师id - var buyType = th.data.buyType; //服务项目类型 - var storeId = a.stoid; //商家id - var storageId = th.data.storageId; //门店id - var userId = d.user_id; //用户id - var remarks = th.data.remarks; //用户备注 - var project_id = th.data.project_id; //项目id - - var json = { - "arrangeTime": time, - "beauticianId": beauticianID, - "buyType": buyType, - "effectiveDay": "", - "number": "", - "projectId": project_id, - "remark": remarks, - "serviceId": serviceId, - "states": 0, - "storageId": storageId, - "storeId": storeId, - "userId": userId - } - var data = JSON.stringify(json); - wx.request({ - url: url, - data: json, - method: 'post', - header: { - 'content-type': 'application/json' - }, // 设置请求的 header - success: function(res) { - if (res.data.code == 0) { - th.setData({ - is_success: 1 - }) - setTimeout(function() { - wx.redirectTo({ - url: "/pages/user/my_service/tment_order_list" - }); - }, 800); - } else { - getApp().my_warnning(res.data.msg, 0, th); - } + if (is_sub == 0) { + th.setData({ + is_sub: 1 + }) + var url = th.data.inurl + "/api/weshop/marketing/reservation/reservation/insert"; //接口路径 + var serviceId = th.data.itemId; //服务id + var beauticianID = th.data.beauticianID; //美容师id + var buyType = th.data.buyType; //服务项目类型 + var storeId = a.stoid; //商家id + var storageId = th.data.storageId; //门店id + var userId = d.user_id; //用户id + var remarks = th.data.remarks; //用户备注 + var project_id = th.data.project_id; //项目id + var validay = th.data.validay; + var json = { + "arrangeTime": time, + "beauticianId": beauticianID, + "buyType": buyType, + "effectiveDay": "", + "number": "", + "projectId": project_id, + "remark": remarks, + "serviceId": serviceId, + "states": 0, + "storageId": storageId, + "storeId": storeId, + "userId": userId, + "validay": validay } - }) + var data = JSON.stringify(json); + wx.request({ + url: url, + data: json, + method: 'post', + header: { + 'content-type': 'application/json' + }, // 设置请求的 header + success: function(res) { + if (res.data.code == 0) { + th.setData({ + is_success: 1, + is_sub: 0 + }) + var store_name = th.data.store_name; //预约门店 + var number = res.data.data.Number; + var temp_url = "/api/wx/open/app/user/templatMessageSend"; //模版接口 + var userinfo = getApp().globalData.userInfo; + var name = d.userInfo.nickname; + var json = { + "formId": formid, + "keyWord": [{ + "keyword": res.data.data.StorageName + }, { + "keyword": name + }, { + "keyword": number + }, { + "keyword": res.data.data.Address + }, { + "keyword": time + }, { + "keyword": res.data.data.BeauticianName + }, { + "keyword": res.data.data.ServiceName + }], + "page": "/pages/user/my_service/tment_details?number=" + number, + "storeId": a.stoid, + "typeId": "1011", + "userId": d.user_id + }; + var data = JSON.stringify(json); + //调用发送预约成功模版接口 + wx.request({ + url: th.data.inurl + temp_url, + data: data, + method: 'post', + header: { + 'content-type': 'application/json' + }, // 设置请求的 header + success: function(data) {} + }) + setTimeout(function() { + wx.redirectTo({ + url: "/pages/user/my_service/tment_details?number=" + number + }); + }, 1000); + } else { + getApp().my_warnning(res.data.msg, 0, th); + th.setData({ + is_sub: 0 + }) + } + } + }) + } } }, goto: function(e) { @@ -191,6 +252,9 @@ Page({ //分页查询门店信息 query_store: function() { var th = this; + th.setData({ + is_textea: 0 + }) var itemId = th.data.itemId; //服务id var url = "/api/weshop/marketing/reservation/storage/page"; var key_word = th.data.key_word; @@ -227,18 +291,12 @@ Page({ //查询 query_beautician: function() { var th = this; + th.setData({ + is_textea: 0 + }) if (th.data.store_name == "") { getApp().my_warnning("请选择服务门店", 0, th); } else { - if (th.data.beautician == 0) { - th.setData({ - beautician: 1 - }) - } else { - th.setData({ - beautician: 0 - }) - } wx.showLoading({ title: '加载中', }) @@ -260,9 +318,21 @@ Page({ }) if (res.data.data.pageData.length < 1) { getApp().my_warnning("暂无美容师", 0, th); + } else { + if (th.data.beautician == 0) { + th.setData({ + beautician: 1, + }) + } else { + th.setData({ + beautician: 0, + }) + } } } else { - getApp().my_warnning("暂无美容师", 0, th); + th.setData({ + }) + getApp().my_warnning(res.data.msg, 0, th); } }) } @@ -278,7 +348,8 @@ Page({ bea_index: bea_index, beauticianID: BeauticianID, time: "", - tment_count: "" + tment_count: "", + is_textea: 0 }) }, @@ -317,7 +388,7 @@ Page({ getApp().my_warnning("请选择服务门店", 0, th); } else { wx.navigateTo({ - url: "/pages/user/my_service/cosmetology_list?" + 'storageId=' + storageId + '&' + 'itemId=' + itemId + url: "/pages/user/my_service/cosmetology_list?" + 'storageId=' + storageId + '&' + 'itemId=' + itemId + '&' + "projectId=" + project_id }); } }, @@ -330,6 +401,7 @@ Page({ itemId: options.service_id, buyType: options.BuyType, project_id: options.ProjectID, + validay: options.Validay }) wx.getLocation({ type: 'wgs84', diff --git a/pages/user/my_service/appment_main.wxml b/pages/user/my_service/appment_main.wxml index b0fc8ee..383c472 100644 --- a/pages/user/my_service/appment_main.wxml +++ b/pages/user/my_service/appment_main.wxml @@ -6,7 +6,7 @@ - + @@ -20,7 +20,7 @@ - + @@ -50,12 +50,12 @@ - + 预约时间 - - + + {{time==""?'选择时间':time}} @@ -64,17 +64,17 @@ - + - - - - 填写备注 + {{remarks==''?'填写备注':remarks}} @@ -83,13 +83,15 @@ 注:剩余可预约人数{{tment_count}}人 - + 我的预约 - - 提交预约 - +
+ +
@@ -108,7 +110,7 @@ - + 搜索 diff --git a/pages/user/my_service/appment_main.wxss b/pages/user/my_service/appment_main.wxss index e6ecb2d..5fe4d52 100644 --- a/pages/user/my_service/appment_main.wxss +++ b/pages/user/my_service/appment_main.wxss @@ -43,7 +43,7 @@ left: 110rpx; width: 540rpx; height: 315rpx; - background-color: rgb(155,155,155); + background-color: rgb(155, 155, 155); text-align: center; border-radius: 20rpx; color: rgb(255, 255, 255); @@ -59,10 +59,16 @@ .appment, .sub_appment { width: 270rpx; - height: 55rpx; + height: 60rpx; + line-height: 55rpx; border-radius: 40rpx; } +button { + height: 100%; + background-color: rgb(214, 1, 33); +} + .appment { background-color: rgb(238, 238, 238); } @@ -73,7 +79,7 @@ } .head { - width: 112rpx; + width: 122rpx; margin-right: 40rpx; height: 50rpx; line-height: 50rpx; @@ -88,6 +94,7 @@ padding-right: 15rpx; padding-top: 15rpx; padding-bottom: 15rpx; + color: rgb(172, 172, 172); } .mabot { @@ -96,8 +103,8 @@ .select { width: 420rpx; - height: 50rpx; - line-height: 50rpx; + height: 55rpx; + line-height: 55rpx; background-color: rgb(238, 238, 238); border-radius: 10rpx; padding-left: 40rpx; diff --git a/pages/user/my_service/beauty_deta.js b/pages/user/my_service/beauty_deta.js index b03c05d..2b11172 100644 --- a/pages/user/my_service/beauty_deta.js +++ b/pages/user/my_service/beauty_deta.js @@ -29,6 +29,7 @@ Page({ modify: 0, //是否是修改时间 iscos: 0, //是否是从美容师列表过来的 hours: "", //获取当前时分秒 + projectId: "", //项目id }, /** @@ -38,13 +39,13 @@ Page({ var th = this; var myDate = new Date(); var date = myDate.getHours() + ":00"; //获取当前小时数(0-23) - console.log(date > "09:00" + "和哦哦哦哦的"); var beautician_id = options.BeauticianID; th.setData({ beautician_id: beautician_id, itemId: options.itemId, modify: options.modify, - hours: date + hours: date, + projectId: options.projectId }) if (options.url != undefined) { th.setData({ @@ -208,10 +209,12 @@ Page({ query_aweek: function() { var th = this; var beautician_id = th.data.beautician_id; //美容师id - var itemId = th.data.itemId; //项目id + var itemId = th.data.itemId; //服务id + var projectId = th.data.projectId; //项目id var url = "/api/weshop/marketing/reservation/staff/seven/time/list"; //接口地址 getApp().request.promiseGet(url, { data: { + projectId: projectId, beauticianId: beautician_id, serviceId: itemId, storeId: a.stoid, @@ -227,12 +230,7 @@ Page({ }; arr.push(em); } - arr.sort(th.sort_arr); - - - - var weeks = ["今天", "明天", "后天"]; var week = ""; for (var i = 3; i < arr.length; i++) { @@ -262,11 +260,15 @@ Page({ query_date: function() { var th = this; + var projectId = th.data.projectId; var date_id = th.data.date_id; //日期下标 var SeekTime = th.data.aweeks[date_id].time; + var val = th.data.aweeks[date_id].val; + if(val!=""){ var url = "/api/weshop/marketing/reservation/staff/time/list"; getApp().request.promiseGet(url, { data: { + projectId: projectId, beauticianId: th.data.beautician_id, serviceId: th.data.itemId, seekTime: SeekTime, @@ -296,6 +298,7 @@ Page({ getApp().my_warnning(res.data.msg, 0, th); } }) + } }, //更改预约时间 change_time: function() { diff --git a/pages/user/my_service/beauty_deta.wxml b/pages/user/my_service/beauty_deta.wxml index d158394..3f87332 100644 --- a/pages/user/my_service/beauty_deta.wxml +++ b/pages/user/my_service/beauty_deta.wxml @@ -28,7 +28,7 @@ - + {{weeks[index]}}(约满) {{item.time}} diff --git a/pages/user/my_service/cosmetology_list.js b/pages/user/my_service/cosmetology_list.js index 325b405..521ba61 100644 --- a/pages/user/my_service/cosmetology_list.js +++ b/pages/user/my_service/cosmetology_list.js @@ -19,6 +19,7 @@ Page({ ismore: 0, //是否加载完毕 itemId: 0, //服务id, storageId: 0, //线下门店id + projectId:"",//项目id }, onReachBottom: function() { var th = this; @@ -57,6 +58,7 @@ Page({ total: res.data.data.total, ismore: ismore, is_service_read: 1, + is_cosmetology_read:1 }), wx.stopPullDownRefresh(); //停止下拉刷新 } else { getApp().my_warnning(res.data.msg, 0, th); @@ -82,6 +84,7 @@ Page({ onLoad: function(options) { var th = this; th.setData({ + projectId: options.projectId, itemId: options.itemId, storageId: options.storageId }) diff --git a/pages/user/my_service/i_service.wxml b/pages/user/my_service/i_service.wxml index 67ac67a..7b7b799 100644 --- a/pages/user/my_service/i_service.wxml +++ b/pages/user/my_service/i_service.wxml @@ -49,7 +49,7 @@ 立即使用 - + 预约
diff --git a/pages/user/my_service/tment_details.wxml b/pages/user/my_service/tment_details.wxml index 6d7939e..0374bd3 100644 --- a/pages/user/my_service/tment_details.wxml +++ b/pages/user/my_service/tment_details.wxml @@ -99,7 +99,7 @@ 我的服务 - + 更改时间 diff --git a/pages/user/my_service/tment_details.wxss b/pages/user/my_service/tment_details.wxss index 00ca817..66f292e 100644 --- a/pages/user/my_service/tment_details.wxss +++ b/pages/user/my_service/tment_details.wxss @@ -78,6 +78,7 @@ page { .subs { padding: 0rpx 5rpx; + margin-bottom: 20rpx; } .sub { diff --git a/pages/user/my_service/tment_eval.js b/pages/user/my_service/tment_eval.js index 44f9fd6..bf8927e 100644 --- a/pages/user/my_service/tment_eval.js +++ b/pages/user/my_service/tment_eval.js @@ -147,9 +147,11 @@ Page({ th.setData({ sub_evaluate: 1 }) - wx.navigateTo({ - url: "/pages/user/my_service/tment_order_list" - }); + setTimeout(function () { + wx.redirectTo({ + url: "/pages/user/my_service/tment_order_list" + }); + }, 800); } else { getApp().my_warnning(res.data.msg, 0, th); } diff --git a/pages/user/my_service/tment_eval.wxml b/pages/user/my_service/tment_eval.wxml index 205d07f..fcc1d86 100644 --- a/pages/user/my_service/tment_eval.wxml +++ b/pages/user/my_service/tment_eval.wxml @@ -61,7 +61,7 @@
- 评论成功 + 评价成功
diff --git a/pages/user/my_service/tment_order_list.js b/pages/user/my_service/tment_order_list.js index 1978c6a..beae8e4 100644 --- a/pages/user/my_service/tment_order_list.js +++ b/pages/user/my_service/tment_order_list.js @@ -84,6 +84,9 @@ Page({ wx.showLoading({ title: '加载中', }) + th.setData({ + is_read:0 + }) getApp().request.promiseGet(url, { data: { storeId: a.stoid, @@ -177,7 +180,7 @@ Page({ onShow: function() { var th = this; th.setData({ - is_read: 0 + is_read:0 }) th.query_orderList(); }, diff --git a/pages/user/my_service/tment_order_list.wxml b/pages/user/my_service/tment_order_list.wxml index 601d799..1980245 100644 --- a/pages/user/my_service/tment_order_list.wxml +++ b/pages/user/my_service/tment_order_list.wxml @@ -63,7 +63,7 @@ 查看详情 - 更改时间 + 更改时间 发表评价 重新预约