diff --git a/pages/user/my_service/appment_main.js b/pages/user/my_service/appment_main.js index 80fd7bb..eeaa4f3 100644 --- a/pages/user/my_service/appment_main.js +++ b/pages/user/my_service/appment_main.js @@ -12,7 +12,7 @@ Page({ iurl: a.imghost, //服务器网址 store: 0, //是否显示服务门店列表 beautician: 0, //是否显示美容师列表 - beautician_name: null, //选中的美容师名称 + beautician_name: "", //选中的美容师名称 placeholder: "填写备注", //备注为空的placeholder store_list: [], //门店列表 beautician_list: [], //美容师列表 @@ -27,6 +27,9 @@ Page({ key_word: "", //是否按门店文字查询 is_service_read: 0, //是否调用过门店接口 is_search: 0, //是否通过key_word调用接口 + is_success: 0, //是否提交成功 + remarks: "", //备注 + storageId: "", //线下门店id }, onclickstore: function() { var th = this; @@ -36,20 +39,77 @@ Page({ store: 0, placeholder: "填写备注" }) + wx.hideLoading(); } else { th.setData({ store: 1, placeholder: "" }) + if (th.data.store_list.length < 1) { + th.query_store(); + } } }, + //输入的备注 + input_remarks: function(e) { + var remarks = e.detail.value; + this.setData({ + remarks: remarks + }) + }, + //提交预约 + sub_success: function() { + var th = this; + var store = th.data.store_name; //门店 + var bea_name = th.data.beautician_name; //选择的美容师 + // var time = th.data.time; //选择服务的时间 + // //提交预约前的判断 + // if (store == "") { + // getApp().my_warnning("请选择服务门店", 0, th); + // return false; + // } else if (bea_name == "") { + // getApp().my_warnning("请选择美容师", 0, th); + // return false; + // } else if (time == "") { + // getApp().my_warnning("请选择预约时间", 0, th); + // return false; + // } + + var url = "/api/weshop/marketing/reservation/reservation/insert"; + getApp().request.post(url, { + data: { + projectID: "", + beauticianID: "", + buyType: "", + storeId: a.stoid, + storageID: "", + arrangeTime: "", + userId: d.user_id, + remark: "", + states: "" + } + }).then(res => { + if (res.data.code == 0) { + th.setData({ + is_success: 1 + }) + wx.navigateTo({ + url: "/pages/user/my_service/tment_details" + }); + } else { + getApp().my_warnning(res.data.msg, 0, th); + } + }) + }, goto: function(e) { var th = this; - if (th.data.beautician_name != null) { + if (th.data.store_name == "") { + getApp().my_warnning("请选择服务门店", 0, th); + } else if (th.data.beautician_name == "") { + getApp().my_warnning("请选择美容师", 0, th); + } else { var url = e.currentTarget.dataset.url; getApp().goto(url); - } else { - getApp().my_warnning("请先选择美容师", 0, th); } }, //点击选择门店 @@ -70,10 +130,12 @@ Page({ choice_store: function() { var th = this; var index = th.data.fir_pick_index; - var pickup_name = th.data.store_list[index].StorageName; + var store_name = th.data.store_list[index].StorageName; + var Id = th.data.store_list[index].Id; th.setData({ store: 0, - store_name: pickup_name + store_name: store_name, + storageId: Id }) }, onReachBottom: function() { @@ -89,8 +151,8 @@ Page({ //分页查询门店信息 query_store: function() { var th = this; - // var itemId = th.data.itemId; - var itemId = "08AD49D5-BAFD-4B5E-ABBA-B180EB64EED6"; + // var itemId = th.data.itemId;//正式使用项目id + var itemId = "08AD49D5-BAFD-4B5E-ABBA-B180EB64EED6"; //测试的项目id var url = "/api/weshop/marketing/reservation/storage/page"; var key_word = th.data.key_word; getApp().request.promiseGet(url, { @@ -117,6 +179,8 @@ Page({ ismore: ismore, is_service_read: 1, }), wx.stopPullDownRefresh(); //停止下拉刷新 + } else { + getApp().my_warnning(res.data.msg, 0, th); } }) }, @@ -124,7 +188,7 @@ Page({ query_beautician: function() { var th = this; if (th.data.store_name == "") { - getApp().my_warnning("请先选择服务门店", 0, th); + getApp().my_warnning("请选择服务门店", 0, th); } else { if (th.data.beautician == 0) { th.setData({ @@ -135,8 +199,10 @@ Page({ beautician: 0 }) } - var itemid = "08AD49D5-BAFD-4B5E-ABBA-B180EB64EED6"; - var storageId = "FD8EC44A-6474-4BA1-A17C-A87306690E59"; + var itemid = "08AD49D5-BAFD-4B5E-ABBA-B180EB64EED6"; //测试的项目id + // var itemid = th.data.itemId;//正式使用的项目id + // var storageId = th.data.storageId;//正式使用的线下门店id + var storageId = "FD8EC44A-6474-4BA1-A17C-A87306690E59"; //测试的线下门店id var url = "/api/weshop/marketing/reservation/staff/page"; getApp().request.promiseGet(url, { data: { @@ -187,7 +253,19 @@ Page({ }) } } else { - getApp().my_warnning("请输入门店名称",0,th); + getApp().my_warnning("请输入门店名称", 0, th); + } + }, + //美容师预约跳转页面 + nav_bea: function() { + var th = this; + var storageId = th.data.storageId; //线下门店id + if (storageId == "") { + getApp().my_warnning("请选择服务门店", 0, th); + } else { + wx.navigateTo({ + url: "/pages/user/my_service/cosmetology_list" + }); } }, /** @@ -204,7 +282,6 @@ Page({ * 生命周期函数--监听页面显示 */ onShow: function() { - var th = this; - th.query_store(); + } }) \ No newline at end of file diff --git a/pages/user/my_service/appment_main.wxml b/pages/user/my_service/appment_main.wxml index ce0ffa2..67b7095 100644 --- a/pages/user/my_service/appment_main.wxml +++ b/pages/user/my_service/appment_main.wxml @@ -28,7 +28,7 @@ - {{beautician_name==null?'选择美容师':beautician_name}} + {{beautician_name==''?'选择美容师':beautician_name}} @@ -41,9 +41,9 @@ - + - + @@ -69,7 +69,7 @@ - @@ -86,12 +86,12 @@ 我的预约 - + 提交预约 - + 预约成功 @@ -138,7 +138,7 @@ - + 数据加载完毕 diff --git a/pages/user/my_service/appment_main.wxss b/pages/user/my_service/appment_main.wxss index 8f41a85..8b9ee6f 100644 --- a/pages/user/my_service/appment_main.wxss +++ b/pages/user/my_service/appment_main.wxss @@ -18,7 +18,9 @@ transform: rotate(227deg); margin-bottom: 0rpx; } - +.users{ + background-color: rgb(255,255,255); +} .user { width: 40rpx; height: 40rpx; diff --git a/pages/user/my_service/beauty_deta.js b/pages/user/my_service/beauty_deta.js index 7a12427..a05fad3 100644 --- a/pages/user/my_service/beauty_deta.js +++ b/pages/user/my_service/beauty_deta.js @@ -10,12 +10,13 @@ Page({ */ data: { iurl: a.imghost, + defimgurl: "/miniapp/images/yyservice/yyxmdefault.jpg", seekTime: "2019-11-18", //当前服务预约选择的时间 time_list: [], //可预约时间 name: "", //美容师姓名 comment: "", //美容师评价 head_img: "", //美容师头像 - 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: ["08:00:00", "09:00: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: 0, //选择预约时间下标 }, @@ -83,7 +84,7 @@ Page({ return; } else { th.setData({ - time_index: time_index + time_index: index }) } }, @@ -106,14 +107,15 @@ Page({ var time_list = []; for (var i = 0; i < time.length; i++) { for (var ii = ii; ii < data.length; ii++) { - if (time[i] == data[ii]) { - time_list[i] = data[ii]; + if (time[i] == data[ii].GroupHour) { + time_list[i] = data[ii].GroupHour; break; } else { time_list[i] = ""; } } } + console.log("1111111111"+time_list.length); th.setData({ time_list: time_list }) diff --git a/pages/user/my_service/beauty_deta.wxml b/pages/user/my_service/beauty_deta.wxml index 4079c23..e5c3465 100644 --- a/pages/user/my_service/beauty_deta.wxml +++ b/pages/user/my_service/beauty_deta.wxml @@ -1,12 +1,11 @@ - {{name}} - + @@ -37,7 +36,7 @@ - + diff --git a/pages/user/my_service/hist_service.js b/pages/user/my_service/hist_service.js index 19a0fb4..8a67100 100644 --- a/pages/user/my_service/hist_service.js +++ b/pages/user/my_service/hist_service.js @@ -12,8 +12,8 @@ Page({ iurl: a.imghost, isPickerShow: false, isPickerRender: false, - startTime: 0, - endTime: 0, + startTime: "", + endTime: "", pickerConfig: { endDate: true, column: "", @@ -26,9 +26,10 @@ Page({ hist_List: [], //服务项目列表 is_service_read: 0, curpage: 1, //当前分页数 - pageSize: 10, //页大小 + pageSize: 15, //页大小 total: 0, ismore: 0, //是否加载完毕 + is_screen: 0, //是否通过筛选来选择历史服务 }, pickerShow: function() { this.setData({ @@ -54,8 +55,11 @@ Page({ endTime: data.endTime, val: 0, distance: 0, + hist_List: [], + curpage: 1, + is_screen: 1 }); - console.log("开始" + data.startTime + "结束" + data.endTime, ); + th.query_hist(); }, /** * 生命周期函数--监听页面加载 @@ -93,46 +97,41 @@ Page({ th.query_service(); }, query_hist: function() { + var th = this; - var url = "http://localhost:8022/api/weshop/yy_fuwu_lishi"; - wx.request({ - url: url, - success: function(res) { - if (res.data.code == 0) { - th.setData({ - hist_List: res.data.data.pageData, - total: res.data.data.total - }) - } + var startTime = th.data.startTime.substring(0, 10); //开始 + var endTime = th.data.endTime.substring(0, 10); //结束 + var url = "/api/weshop/marketing/reservation/reservation/page"; + getApp().request.promiseGet(url, { + data: { + storeId: a.stoid, + userId: 5682130, //5682130 d.user_id + beginDate: startTime, + endDate: endTime, + page: th.data.curpage, + pageSize: th.data.pageSize + } + }).then(res => { + if (res.data.code == 0) { + wx.hideLoading(); + th.data.curpage++; + var arr1 = th.data.hist_List; + var arr2 = res.data.data.pageData; + var arr3 = [...arr1, ...arr2]; + var ismore = 0; + if (arr3.length == res.data.total) ismore = 1 + th.setData({ + hist_List: arr3, + total: res.data.data.total, + ismore: ismore, + is_service_read: 1, + }), wx.stopPullDownRefresh(); //停止下拉刷新 + } else { + th.setData({ + is_service_read: 1 + }) } }) - - // var th = this; - // var url = "/api/weshop/marketing/reservation/sm/page"; - // getApp().request.promiseGet(url, { - // data: { - // storeId: a.stoid, - // userId: d.user_id, - // page: th.data.curpage, - // pageSize: th.data.pageSize - // } - // }).then(res => { - // if (res.data.code == 0) { - // wx.hideLoading(); - // th.data.curpage++; - // var arr1 = th.data.service_List; - // var arr2 = res.data.data.pageData; - // var arr3 = [...arr1, ...arr2]; - // 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(); //停止下拉刷新 - // } - // }) }, /** * 用户点击右上角分享 diff --git a/pages/user/my_service/hist_service.wxml b/pages/user/my_service/hist_service.wxml index e16ff89..9d4fc7f 100644 --- a/pages/user/my_service/hist_service.wxml +++ b/pages/user/my_service/hist_service.wxml @@ -1,6 +1,6 @@ - + 共使用 {{total}} @@ -26,18 +26,19 @@ - {{item.xm}} + {{item.ProjectName==''?'匿名':item.ProjectName}} (美容师: - {{item.name}} + {{item.BeauticianName}} ) - {{item.type_a}} + {{item.BillDate!=''?item.BillDate:item.ArrangeTime}} - 未服务 - 已服务 - 已过期 + 未服务 + 已服务 + 已过期 + 已取消 @@ -50,7 +51,7 @@ - + diff --git a/pages/user/my_service/hist_service.wxss b/pages/user/my_service/hist_service.wxss index 6aad1e0..cbe87b8 100644 --- a/pages/user/my_service/hist_service.wxss +++ b/pages/user/my_service/hist_service.wxss @@ -43,7 +43,7 @@ page { .item { margin: 0rpx 25rpx; padding: 0rpx 20rpx; - height: 135rpx; + height: 100rpx; border-bottom: 1rpx solid rgb(242, 242, 242); } diff --git a/pages/user/my_service/i_service.js b/pages/user/my_service/i_service.js index 42d42a7..49cc587 100644 --- a/pages/user/my_service/i_service.js +++ b/pages/user/my_service/i_service.js @@ -94,7 +94,6 @@ Page({ ewm = ewm + tt; th.data.qr_code_object.val = ewm; th.data.qr_code_object.is_fw = 1; - console.log(ewm); var qc_com = th.selectComponent("#qc_com"); //组件的id qc_com.open(th.data.qr_code_object) }, diff --git a/pages/user/my_service/i_service.wxml b/pages/user/my_service/i_service.wxml index 7e83c4b..8dda735 100644 --- a/pages/user/my_service/i_service.wxml +++ b/pages/user/my_service/i_service.wxml @@ -1,7 +1,7 @@ - 历史服务 + 历史服务 @@ -49,7 +49,7 @@ 立即使用 - + 预约 diff --git a/pages/user/my_service/i_service.wxss b/pages/user/my_service/i_service.wxss index b9ac455..ad3dc27 100644 --- a/pages/user/my_service/i_service.wxss +++ b/pages/user/my_service/i_service.wxss @@ -31,7 +31,7 @@ page { display: inline-block; margin-right: 15rpx; margin-bottom: 20rpx; - box-shadow: 0rpx 2rpx 3rpx 3rpx rgb(233, 233, 233); + box-shadow: 0rpx 3rpx 3rpx 3rpx rgb(233, 233, 233); } .abs { @@ -45,11 +45,12 @@ page { } .Serviceitems { - position: relative; + position: absolute; top: 370rpx; left: 0rpx; z-index: 2; padding-left: 18rpx; + padding-bottom: 20rpx; } .itemimage { @@ -98,7 +99,6 @@ page { height: 40rpx; line-height: 40rpx; border-radius: 25rpx; - background-color: #ff9c00; margin-left: 20rpx; } diff --git a/pages/user/my_service/tment_details.wxml b/pages/user/my_service/tment_details.wxml index 5350629..acb5c75 100644 --- a/pages/user/my_service/tment_details.wxml +++ b/pages/user/my_service/tment_details.wxml @@ -82,17 +82,15 @@ - + 取消预约 - 删除订单 + 我的服务 - 更改时间 发表评价 重新预约 - \ 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 59f324b..3a65bae 100644 --- a/pages/user/my_service/tment_details.wxss +++ b/pages/user/my_service/tment_details.wxss @@ -87,10 +87,6 @@ page { color: rgb(255, 255, 255); } -.lb { - background-color: rgb(153, 153, 153); -} - .rb { background-color: rgb(214, 1, 33); } diff --git a/pages/user/my_service/tment_order_list.js b/pages/user/my_service/tment_order_list.js index 5ab56e2..14604bf 100644 --- a/pages/user/my_service/tment_order_list.js +++ b/pages/user/my_service/tment_order_list.js @@ -1,7 +1,8 @@ var e = getApp(), a = e.globalData.setting, os = a, - t = e.request; + t = e.request, + d = e.globalData; Page({ /** @@ -10,6 +11,7 @@ Page({ data: { iurl: a.imghost, activeCategoryId: 0, //类别选中下标 + defimgurl: "/miniapp/images/yyservice/yyxmdefault.jpg", categories: [{ name: "全部", id: 0 @@ -43,14 +45,18 @@ Page({ var activeCategoryId = th.data.activeCategoryId; if (id != activeCategoryId) { th.setData({ - activeCategoryId: id + activeCategoryId: id, + tm_order_list: [], + curpage: 1, + ismore: 0 }) + th.query_orderList(); } else { return false; } }, //显示核销码 - code_show: function (e) { + code_show: function(e) { var th = this; //--获取成功的时候-- var no = e.currentTarget.dataset.order_sn; @@ -63,27 +69,41 @@ Page({ }, query_orderList: function() { var th = this; - var url = "http://localhost:8022/api/weshop/yy_order_list"; - wx.request({ - url: url, - success: function(res) { - if (res.data.code == 0) { - th.setData({ - tm_order_list: res.data.data.pageData - }) - } + var url = "/api/weshop/marketing/reservation/reservation/page"; + + var state_index = th.data.activeCategoryId; + if (state_index == 0) { + state_index = ""; + } else { + --state_index; + } + getApp().request.promiseGet(url, { + data: { + storeId: a.stoid, + userId: 5682130, + state: state_index + } + }).then(res => { + if (res.data.code == 0) { + var data = res.data.data.pageData; + th.setData({ + tm_order_list: data + }) + } else { + getApp().my_warnning(res.data.msg, 0, this); //调用失败提示 } }) + }, - //删除预约记录 - deleteOrderData: function(e) { - var th = this; - var index = e.currentTarget.dataset.order_id; - var arr = th.data.tm_order_list; - arr.splice(index, 1); - th.setData({ - tm_order_list: arr - }) + //图片失败,默认图片 + bind_bnerr1: function(e) { + var _errImg = e.target.dataset.errorimg; + var _Img = e.target.dataset.img; + if (_Img != undefined) { + var _errObj = {}; + _errObj[_errImg] = "/miniapp/images/no_cate_def.png"; + this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; + } }, /** * 生命周期函数--监听页面显示 @@ -97,6 +117,14 @@ Page({ * 页面上拉触底事件的处理函数 */ onReachBottom: function() { + var th = this; + if (this.data.total <= th.data.pageSize) return; + if (this.data.ismore) return; + + wx.showLoading({ + title: '加载中...', + }) + th.query_orderList(); + }, - } }) \ No newline at end of file diff --git a/pages/user/my_service/tment_order_list.json b/pages/user/my_service/tment_order_list.json index 8a0db23..054a4f7 100644 --- a/pages/user/my_service/tment_order_list.json +++ b/pages/user/my_service/tment_order_list.json @@ -1,6 +1,7 @@ { "navigationBarTitleText": "我的预约", "usingComponents": { - "qr_code": "/components/qr_code/qr_code" + "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.wxml b/pages/user/my_service/tment_order_list.wxml index b6c1823..79671ea 100644 --- a/pages/user/my_service/tment_order_list.wxml +++ b/pages/user/my_service/tment_order_list.wxml @@ -1,8 +1,8 @@ - - {{item.name}} + + {{item.name}} @@ -11,13 +11,13 @@ - 订单编号:{{item.order_sn}} + 订单编号:{{item.Number}} - 未服务 - 已服务 - 已过期 - 已取消 + 未服务 + 已服务 + 已过期 + 已取消 @@ -26,45 +26,45 @@ - + 预约门店: - {{item.store}} + {{item.StorageName}} 预约项目: - {{item.goods_name}} + {{item.projectName}} 美容师: - {{item.meirongshi}} + {{item.BeauticianName}} 预约时间: - {{item.time}} + {{item.ArrangeTime}} - + 服务时间: - {{item.endtime}} + {{item.BillDate}} - - + + 取消预约 - 查看详情 + 查看详情 - 更改时间 - 发表评价 - 重新预约 + 更改时间 + 发表评价 + 重新预约 @@ -77,7 +77,7 @@ - + @@ -89,4 +89,5 @@ - \ No newline at end of file + + \ No newline at end of file diff --git a/pages/user/my_service/tment_order_list.wxss b/pages/user/my_service/tment_order_list.wxss index cc8d994..2098984 100644 --- a/pages/user/my_service/tment_order_list.wxss +++ b/pages/user/my_service/tment_order_list.wxss @@ -1,6 +1,5 @@ page { height: 100%; - background-color: rgb(238, 238, 238); } .container {