From da7741ce9f72de623cadfe7502ec3db72360b3d4 Mon Sep 17 00:00:00 2001 From: DESKTOP-QHAFKU5\iceling Date: Fri, 6 Dec 2019 17:34:25 +0800 Subject: [PATCH] texteat层次过高问题,历史服务添加未服务状态 --- pages/user/my_service/appment_main.js | 231 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------------------------------------------------------------------------------- pages/user/my_service/appment_main.wxml | 4 ++-- pages/user/my_service/hist_service.wxml | 1 + 3 files changed, 130 insertions(+), 106 deletions(-) diff --git a/pages/user/my_service/appment_main.js b/pages/user/my_service/appment_main.js index 13dbcc6..824f31c 100644 --- a/pages/user/my_service/appment_main.js +++ b/pages/user/my_service/appment_main.js @@ -60,11 +60,13 @@ Page({ if (store) { th.setData({ store: 0, + is_textea: 1 }) } else { th.setData({ beautician: 0, store: 1, + is_textea: 0 }) if (th.data.store_list.length < 1) { wx.showLoading({ @@ -86,116 +88,131 @@ Page({ var th = this; var store = th.data.store_name; //门店名称 var bea_name = th.data.beautician_name; //美容师名称 - var time = th.data.time+":00"; //预约时间 + var time = th.data.time + ":00"; //预约时间 var is_sub = th.data.is_sub; //是否重复提交 //提交预约前的判断 if (store == "") { getApp().my_warnning("请选择服务门店", 0, th); + th.settime(); return false; } else if (bea_name == "") { getApp().my_warnning("请选择美容师", 0, th); + th.settime(); return false; } else if (time == "") { getApp().my_warnning("请选择预约时间", 0, th); + th.settime(); 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 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) { + wx.showLoading({ + title: '加载中', + }) + 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) { + th.setData({ + is_sub: 0 + }) + wx.hideLoading(); + if (res.data.code == 0) { + getApp().my_warnning("预约成功", 1, th); + var store_name = th.data.store_name; //预约门店 + var number = res.data.data.Number; + var temp_url = "/api/wx/open/app/user/sendSubscribeMsg"; //模版接口 + var userinfo = getApp().globalData.userInfo; + var name = d.userInfo.nickname; + var json = { + // "formId": formid, + "keyWord": [{ + "keyword": res.data.data.ServiceName + }, + { + "keyword": time.substring(0, 16) + }, { + "keyword": res.data.data.BeauticianName + }, { + "keyword": res.data.data.StorageName + }, { + "keyword": res.data.data.Address + } + ], + "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.settime(); th.setData({ is_sub: 0 }) - wx.hideLoading(); - if (res.data.code == 0) { - getApp().my_warnning("预约成功", 1, th); - var store_name = th.data.store_name; //预约门店 - var number = res.data.data.Number; - var temp_url = "/api/wx/open/app/user/sendSubscribeMsg"; //模版接口 - var userinfo = getApp().globalData.userInfo; - var name = d.userInfo.nickname; - var json = { - // "formId": formid, - "keyWord": [{ - "keyword": res.data.data.ServiceName - }, - { - "keyword": time.substring(0,16) - }, { - "keyword": res.data.data.BeauticianName - }, { - "keyword": res.data.data.StorageName - }, { - "keyword": res.data.data.Address - } - ], - "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 - }) - } } - }) - } - + } + }) + } + + }, + //定时显示texteat + settime:function(){ + var th = this; + setTimeout(function () { + th.setData({ + is_textea: 1 + }) + }, 2000); }, //提交预约 sub_success: function(e) { var th = this; - var temp_url = th.data.inurl+"/api/wx/weappSendlist/page"; + var temp_url = th.data.inurl + "/api/wx/weappSendlist/page"; var template_id = ""; if (th.data.is_sub == 1) { return false; @@ -204,9 +221,6 @@ Page({ is_textea: 0, is_sub: 1 }) - wx.showLoading({ - title: '加载中', - }) //获取模版id getApp().request.promiseGet(temp_url, { data: { @@ -219,13 +233,10 @@ Page({ // //授权订阅 wx.requestSubscribeMessage({ tmplIds: [template_id], - success(res) { - }, - fail(res) { - } + success(res) {}, + fail(res) {} }) - } else { - } + } else {} }) th.success(); }, @@ -237,8 +248,10 @@ Page({ }) if (th.data.store_name == "") { getApp().my_warnning("请选择服务门店", 0, th); + th.settime(); } else if (th.data.beautician_name == "") { getApp().my_warnning("请选择美容师", 0, th); + th.settime(); } else { var url = e.currentTarget.dataset.url; getApp().goto(url); @@ -257,7 +270,8 @@ Page({ fir_pick_index: index_c, beautician_name: "", time: "", - tment_count: "" + tment_count: "", + is_textea: 1 }) } }, @@ -270,7 +284,8 @@ Page({ th.setData({ store: 0, store_name: store_name, - storageId: Id + storageId: Id, + is_textea:1 }) }, onReachBottom: function() { @@ -325,6 +340,7 @@ Page({ } } else { getApp().my_warnning(res.data.msg, 0, th); + th.settime(); } }) }, @@ -336,6 +352,7 @@ Page({ }) if (th.data.store_name == "") { getApp().my_warnning("请选择服务门店", 0, th); + th.settime(); } else { wx.showLoading({ title: '加载中', @@ -358,6 +375,7 @@ Page({ }) if (res.data.data.pageData.length < 1) { getApp().my_warnning("暂无美容师", 0, th); + th.settime(); } else { if (th.data.beautician == 0) { th.setData({ @@ -370,7 +388,8 @@ Page({ } } } else { - getApp().my_warnning("暂无美容师", 0, th); + getApp().my_warnning(res.data.msg, 0, th); + th.settime(); } }) } @@ -387,7 +406,7 @@ Page({ beauticianID: BeauticianID, time: "", tment_count: "", - is_textea: 0 + is_textea: 1 }) }, @@ -424,6 +443,7 @@ Page({ var project_id = th.data.project_id; if (storageId == "") { getApp().my_warnning("请选择服务门店", 0, th); + th.settime(); } else { wx.navigateTo({ url: "/pages/user/my_service/cosmetology_list?" + 'storageId=' + storageId + '&' + 'itemId=' + itemId + '&' + "projectId=" + project_id @@ -458,6 +478,7 @@ Page({ }); if (th.data.is_gps == 0) { getApp().confirmBox("请开启GPS定位", null, 25000, !1); + th.settime(); } } else { th.setData({ @@ -494,6 +515,7 @@ Page({ }) } else { getApp().my_warnning(res.data.msg, 0, th); + th.settime(); } }) @@ -529,7 +551,8 @@ Page({ validay: res.data.data.pageData[0].Validay }) } else { - getApp().my_warnning(res.data.msg, 0, th); + getApp().my_warnning(res.data.msg, 0, th); + th.settime(); } }) }, diff --git a/pages/user/my_service/appment_main.wxml b/pages/user/my_service/appment_main.wxml index 9621fce..e405f80 100644 --- a/pages/user/my_service/appment_main.wxml +++ b/pages/user/my_service/appment_main.wxml @@ -69,12 +69,12 @@ - + - {{remarks==''?'填写备注':remarks}} + {{remarks==''?'填写备注':remarks}} diff --git a/pages/user/my_service/hist_service.wxml b/pages/user/my_service/hist_service.wxml index 5d290d0..2e8cb8e 100644 --- a/pages/user/my_service/hist_service.wxml +++ b/pages/user/my_service/hist_service.wxml @@ -39,6 +39,7 @@ + 未服务 已服务 已过期 已取消 -- libgit2 0.21.4