diff --git a/pages/user/my_service/appment_main.js b/pages/user/my_service/appment_main.js index c4e4cd5..8faf54a 100644 --- a/pages/user/my_service/appment_main.js +++ b/pages/user/my_service/appment_main.js @@ -38,6 +38,9 @@ Page({ buyType: "", //项目类型 time: "", //选择预约时间 tment_count: "", //可预约人数 + lat: "", //纬度坐标 + lon: "", //经度坐标 + is_gps: 1,//是否开启gps }, onclickstore: function() { var th = this; @@ -54,6 +57,9 @@ Page({ placeholder: "" }) if (th.data.store_list.length < 1) { + wx.showLoading({ + title: '加载中', + }) th.query_store(); } } @@ -119,6 +125,7 @@ Page({ th.setData({ is_success: 1 }) + setTimeout(function() {}, 2000); wx.redirectTo({ url: "/pages/user/my_service/tment_order_list" }); @@ -190,11 +197,11 @@ Page({ storeId: a.stoid, userId: d.user_id, serviceId: itemId, - latitude: 1, - longitude: 1, + latitude: th.data.lat, + longitude: th.data.lon, page: th.data.curpage, pageSize: th.data.pageSize, - KeyWord: key_word + keyWord: key_word } }).then(res => { if (res.data.code == 0) { @@ -278,27 +285,23 @@ Page({ var th = this; var key_word = th.data.key_word; var store_list = th.data.store_list; - if (key_word != "") { + th.setData({ + curpage: 1, + is_search: 0, + store_list: [] + }) + th.query_store(); + if (store_list.length < 1) { th.setData({ - curpage: 1, - is_search: 0, - store_list: [] + is_search: 1 }) - th.query_store(); - if (store_list.length < 1) { - th.setData({ - is_search: 1 - }) - } - } else { - getApp().my_warnning("请输入门店名称", 0, th); } }, //美容师预约跳转页面 nav_bea: function() { var th = this; var storageId = th.data.storageId; //线下门店id - var itemId = th.data.itemId; + var itemId = th.data.itemId; //服务id if (storageId == "") { getApp().my_warnning("请选择服务门店", 0, th); } else { @@ -317,6 +320,33 @@ Page({ buyType: options.BuyType, project_id: options.ProjectID, }) + wx.getLocation({ + type: 'wgs84', + success: function(res) { + th.data.lat = res.latitude; + th.data.lon = res.longitude; + th.data.is_get_local_ok = 1; + th.setData({ + is_gps: 1 + }); + }, + fail: function(res) { + if (res.errCode == 2) { + th.setData({ + is_gps: 0 + }); + if (th.data.is_gps == 0) { + getApp().confirmBox("请开启GPS定位", null, 25000, !1); + } + } else { + th.setData({ + is_gps: "3" + }); + } + + th.data.is_get_local_ok = 1; + } + }) }, //查询剩下可预约人数 query_more: function() { diff --git a/pages/user/my_service/appment_main.wxml b/pages/user/my_service/appment_main.wxml index 5e5250d..4dcc63e 100644 --- a/pages/user/my_service/appment_main.wxml +++ b/pages/user/my_service/appment_main.wxml @@ -1,3 +1,4 @@ + @@ -25,7 +26,7 @@ - + {{beautician_name==''?'选择美容师':beautician_name}} @@ -54,7 +55,7 @@ - + {{time==""?'选择时间':time}} @@ -124,11 +125,11 @@ {{item.StorageName}} - - 距您: 728m + + 距您:{{item.Distance}}km - 地址:{{item.Address}} + {{item.Address}} diff --git a/pages/user/my_service/appment_main.wxss b/pages/user/my_service/appment_main.wxss index dc6c03b..be3de2e 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: #a6a6a6a4; + background-color: rgb(155,155,155); text-align: center; border-radius: 20rpx; color: rgb(255, 255, 255); @@ -249,7 +249,7 @@ border-radius: 25rpx; margin-right: 20rpx; color: rgb(159, 159, 159); - max-width: 150rpx; + max-width: 200rpx; } .store_address { diff --git a/pages/user/my_service/beauty_deta.js b/pages/user/my_service/beauty_deta.js index 589fe80..58bc5b5 100644 --- a/pages/user/my_service/beauty_deta.js +++ b/pages/user/my_service/beauty_deta.js @@ -13,7 +13,7 @@ Page({ iurl: a.imghost, url: "", //选择选择时间后返回的页面 defimgurl: "/miniapp/images/yyservice/yyxmdefault.jpg", - seekTime: "2019-11-24", //当前服务预约选择的时间 + seekTime: "", //当前服务预约选择的时间 time_list: [], //可预约时间 name: "", //美容师姓名 comment: "", //美容师评价 @@ -22,9 +22,11 @@ Page({ 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"], time_index: "", //选择预约时间下标 date_id: 0, //选择日期的id - beautician_id: "337C11B8-034B-495D-B360-FC2F6CB29394", //美容师id + beautician_id: "", //美容师id itemId: "", //服务id number: "", //预约单号 + modify: 0, //是否是修改时间 + iscos: 0, //是否是从美容师列表过来的 }, /** @@ -36,8 +38,11 @@ Page({ th.setData({ url: options.url, beautician_id: beautician_id, - itemId: options.itemId + itemId: options.itemId, + iscos: options.iscos, + modify: options.modify }) + if (options.number != "") { th.setData({ number: options.number @@ -102,32 +107,59 @@ Page({ //返回上个页面 navigateBack: function() { var th = this; + var modify = th.data.modify; //是否是更改时间 var seekTime = th.data.seekTime; //选择的日期 var time_list = th.data.time_list; var time_index = th.data.time_index; + if (time_index == "") { + getApp().my_warnning("请选择预约时间", 0, th); + return false; + } var date_id = th.data.date_id; var date = th.data.aweeks[date_id].time; - var time = date+" "+time_list[time_index]+":00"; - // wx.navigateBack({ - // url: th.data.url + '?' + 'seekTime=' + seekTime + '&' + "time=" + time - // }); - var pages = getCurrentPages(); //当前页面 - - var prevPage = pages[pages.length - 2]; //上一页面 - - prevPage.setData({ - - //直接给上一个页面赋值 - time: time, - - }); - - wx.navigateBack({ - - //返回 - delta: 1 - - }) + var time = date + " " + time_list[time_index] + ":00"; + if (modify == 1) { + var json = { + "arrangeTime": time, + "number": th.data.number, + "remark": "更改时间", + "states": 0, + "storeId": a.stoid + }; + var data = JSON.stringify(json); + var url = th.data.inurl + "/api/weshop/marketing/reservation/reservation/update"; //预约接口地址 + wx.request({ + url: url, + data: data, + method: 'put', + header: { + 'content-type': 'application/json' + }, // 设置请求的 header + success: function(res) { + if (res.data.code == 0) { + getApp().my_warnning(res.data.msg, 0, th); + wx.navigateBack({ + //返回 + delta: 1 + }) + } else { + getApp().my_warnning(res.data.msg, 0, th); + } + } + }) + } else { + var pages = getCurrentPages(); //当前页面 + var iscos = th.data.iscos; + var prevPage = pages[pages.length - 2 - iscos]; //上一页面 + prevPage.setData({ + //直接给上一个页面赋值 + time: time, + }); + wx.navigateBack({ + //返回 + delta: 2 + }) + } }, //选择时间 Selection_time: function(e) { diff --git a/pages/user/my_service/beauty_deta.wxml b/pages/user/my_service/beauty_deta.wxml index 9e4a60d..064cad6 100644 --- a/pages/user/my_service/beauty_deta.wxml +++ b/pages/user/my_service/beauty_deta.wxml @@ -24,6 +24,7 @@ {{item.time}} + 未排班 diff --git a/pages/user/my_service/cosmetology_list.wxml b/pages/user/my_service/cosmetology_list.wxml index 93d152d..47218fd 100644 --- a/pages/user/my_service/cosmetology_list.wxml +++ b/pages/user/my_service/cosmetology_list.wxml @@ -8,7 +8,7 @@ - + {{item.StaffName}} @@ -34,7 +34,7 @@ - + 预约 diff --git a/pages/user/my_service/hist_service.js b/pages/user/my_service/hist_service.js index 9172d9b..b25b111 100644 --- a/pages/user/my_service/hist_service.js +++ b/pages/user/my_service/hist_service.js @@ -108,7 +108,7 @@ Page({ var th = this; var startTime = th.data.startTime.substring(0, 10); //开始 var endTime = th.data.endTime.substring(0, 10); //结束 - var url = "/api/weshop/marketing/reservation/reservation/page"; + var url = "/api/weshop/marketing/reservation/history/reservation/page"; getApp().request.promiseGet(url, { data: { storeId: a.stoid, diff --git a/pages/user/my_service/hist_service.wxml b/pages/user/my_service/hist_service.wxml index 19e1ee1..915b053 100644 --- a/pages/user/my_service/hist_service.wxml +++ b/pages/user/my_service/hist_service.wxml @@ -14,7 +14,6 @@ 筛选 - @@ -26,7 +25,7 @@ - {{item.ProjectName==''?'匿名':item.ProjectName}} + {{item.ServiceName==''?'匿名':item.ServiceName}} (美容师: {{item.BeauticianName}} ) diff --git a/pages/user/my_service/i_service.js b/pages/user/my_service/i_service.js index 28f36f9..defe890 100644 --- a/pages/user/my_service/i_service.js +++ b/pages/user/my_service/i_service.js @@ -77,11 +77,14 @@ Page({ var ismore = 0; if (arr3.length == res.data.data.total) ismore = 1 th.setData({ - service_List: arr3, - total: res.data.data.total, - ismore: ismore, - is_service_read: 1, - }), wx.stopPullDownRefresh(); //停止下拉刷新 + service_List: arr3, + total: res.data.data.total, + ismore: ismore, + is_service_read: 1, + }), + console.log("顶顶顶顶顶" + res.data.data.pageData.length); + console.log("呃呃呃呃" + th.data.service_List.length); + wx.stopPullDownRefresh(); //停止下拉刷新 } else { getApp().my_warnning(res.data.msg, 0, th); } @@ -92,7 +95,7 @@ Page({ var th = this; var ind = e.currentTarget.dataset.ind; var item = this.data.service_List[ind]; - var ewm = "^" + th.data.userinfo.erpvipid + "|" + item.ID + "|" + item.BuyType + "|" + item.Validay + "|TY01|"; + var ewm = th.data.userinfo.erpvipid + "|" + item.ProjectID + "|" + item.BuyType + "|TY01|"; var tt = th.format_time(1); ewm = ewm + tt; th.data.qr_code_object.val = ewm; diff --git a/pages/user/my_service/i_service.wxml b/pages/user/my_service/i_service.wxml index 47de058..146c37b 100644 --- a/pages/user/my_service/i_service.wxml +++ b/pages/user/my_service/i_service.wxml @@ -8,7 +8,7 @@ - + @@ -49,7 +49,7 @@ 立即使用 - + 预约 diff --git a/pages/user/my_service/tment_details.js b/pages/user/my_service/tment_details.js index 4753754..a93fc19 100644 --- a/pages/user/my_service/tment_details.js +++ b/pages/user/my_service/tment_details.js @@ -9,11 +9,55 @@ Page({ * 页面的初始数据 */ data: { + url:a.url, iurl: a.imghost, tment_details: [], //预约详情 number:"",//订单号 arrangeTime:"",//预约年月日 day:"",//判断是上午还是下午 + states:3,//3为取消预约 + }, + //取消预约 + cancel_tment: function (e) { + var th = this; + var index = e.currentTarget.dataset.index; + var states = th.data.states; + var tment_details = th.data.tment_details; + var number = th.data.number; + var json = { + "number": number, + "storeId": a.stoid, + "states": states + }; + var data = JSON.stringify(json); + var url = th.data.url + "/api/weshop/marketing/reservation/reservation/update"; //预约接口地址 + wx.request({ + url: url, + data: data, + method: 'put', + header: { + 'content-type': 'application/json' + }, // 设置请求的 header + success: function (res) { + if (res.data.code == 0) { + getApp().my_warnning("取消成功", 0, th); + var id = th.data.activeCategoryId; + if (id == 1) { + tment_details.splice(index, 1); + th.setData({ + tment_details: tment_details + }) + } else { + var start = 'tment_details[' + index + '].State'; + th.setData({ + [start]: 3 + }) + } + } else { + getApp().my_warnning(res.data.msg, 0, th); + } + } + }) }, @@ -29,6 +73,9 @@ Page({ }, //查询美容师详情 query_bea: function() { + wx.showLoading({ + title: '加载中', + }) var th = this; var number = th.data.number; var url = "/api/weshop/marketing/reservation/reservation/page"; @@ -39,6 +86,7 @@ Page({ number: number } }).then(res => { + wx.hideLoading(); if (res.data.code == 0) { var data = res.data.data.pageData; var arrangeTime = data[0].ArrangeTime.substring(0,11); @@ -59,6 +107,18 @@ Page({ } }) }, + //显示核销码 + code_show: function (e) { + var th = this; + //--获取成功的时候-- + var no = e.currentTarget.dataset.order_sn; + var qc_com = th.selectComponent("#qc_com"); //组件的id + var obj = { + val: no, + content: "请将二维码展示给核销员,使用更快捷" + }; + qc_com.open(obj) + }, //跳到首页 goto: function (e) { wx.switchTab({ diff --git a/pages/user/my_service/tment_details.json b/pages/user/my_service/tment_details.json index 3132bf0..48013e7 100644 --- a/pages/user/my_service/tment_details.json +++ b/pages/user/my_service/tment_details.json @@ -1,6 +1,7 @@ { "navigationBarTitleText": "预约详情", - "usingComponents": { - "warn": "/components/long_warn/long_warn" - } + "usingComponents": { + "qr_code": "/components/qr_code/qr_code", + "warn": "/components/long_warn/long_warn" + } } \ No newline at end of file diff --git a/pages/user/my_service/tment_details.wxml b/pages/user/my_service/tment_details.wxml index 6beff18..6d7939e 100644 --- a/pages/user/my_service/tment_details.wxml +++ b/pages/user/my_service/tment_details.wxml @@ -8,9 +8,19 @@ 已服务 已过期 已取消 + 已评价 + + + + 预约订单: + {{number}} + + + + 预约门店: @@ -20,7 +30,7 @@ 预约项目: - {{item.StorageName}} + {{item.ServiceName}} @@ -82,26 +92,28 @@ - - 取消预约 + + 取消预约 - + 我的服务 - + 更改时间 - + 发表评价 - + 重新预约 - + 回到首页 + + \ No newline at end of file diff --git a/pages/user/my_service/tment_details.wxss b/pages/user/my_service/tment_details.wxss index 3a65bae..00ca817 100644 --- a/pages/user/my_service/tment_details.wxss +++ b/pages/user/my_service/tment_details.wxss @@ -28,7 +28,7 @@ page { } .value { - max-width: 450rpx; + max-width: 400rpx; } /* 公用 */ @@ -86,7 +86,11 @@ page { border-radius: 30rpx; color: rgb(255, 255, 255); } - +.code{ + margin-left: 10rpx; + width: 50rpx; + height: 50rpx; +} .rb { background-color: rgb(214, 1, 33); } diff --git a/pages/user/my_service/tment_eval.json b/pages/user/my_service/tment_eval.json index fdac9e4..8d44d3f 100644 --- a/pages/user/my_service/tment_eval.json +++ b/pages/user/my_service/tment_eval.json @@ -1,6 +1,7 @@ { "navigationBarTitleText": "预约评价", "usingComponents": { + "qr_code": "/components/qr_code/qr_code", "warn": "/components/long_warn/long_warn" } } \ No newline at end of file diff --git a/pages/user/my_service/tment_order_list.js b/pages/user/my_service/tment_order_list.js index 5fb16bc..8440905 100644 --- a/pages/user/my_service/tment_order_list.js +++ b/pages/user/my_service/tment_order_list.js @@ -81,6 +81,9 @@ Page({ } else { --state_index; } + wx.showLoading({ + title: '加载中', + }) getApp().request.promiseGet(url, { data: { storeId: a.stoid, @@ -103,7 +106,7 @@ Page({ tm_order_list: arr3, total: res.data.data.total, ismore: ismore, - is_read:1 + is_read: 1 }), wx.stopPullDownRefresh(); //停止下拉刷新 { } else { th.setData({ @@ -172,7 +175,11 @@ Page({ * 生命周期函数--监听页面显示 */ onShow: function() { - + var th = this; + th.setData({ + 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 21ceeda..601d799 100644 --- a/pages/user/my_service/tment_order_list.wxml +++ b/pages/user/my_service/tment_order_list.wxml @@ -23,7 +23,7 @@ - + @@ -33,11 +33,11 @@ 预约门店: - {{item.StorageName}} + {{item.ServiceName}} 预约项目: - {{item.ProjectName}} + {{item.StorageName}} 美容师: @@ -45,11 +45,11 @@ 预约时间: - {{item.BillDate}} + {{item.ArrangeTime}} - + 服务时间: - {{item.ArrangeTime}} + {{item.WriteTime}} @@ -63,7 +63,7 @@ 查看详情 - 更改时间 + 更改时间 发表评价 重新预约