diff --git a/pages/user/my_service/appment_main.js b/pages/user/my_service/appment_main.js index 14dd47e..cb33019 100644 --- a/pages/user/my_service/appment_main.js +++ b/pages/user/my_service/appment_main.js @@ -47,23 +47,6 @@ Page({ }, //控制备注输入 check_text: function() { - wx.requestSubscribeMessage({ - tmplIds: ['Jg7Tj-wPlDfsairz_EHBQdoQnzLLF4nVhT1weCBEmTE'], - success(res) { - console.log("222222222222222222222222222222"); - }, - - fail(res) { - - console.log('fail 失败') - - console.log(res) - - logger.warn('订阅消息fail', res) - - } - }) - var th = this; var is_textea = th.data.is_textea; th.setData({ @@ -101,12 +84,9 @@ Page({ //提交成功及发送模版代码 success: function() { var th = this; - th.setData({ - is_textea: 0 - }) var store = th.data.store_name; //门店名称 var bea_name = th.data.beautician_name; //美容师名称 - var time = th.data.time; //预约时间 + var time = th.data.time+":00"; //预约时间 var is_sub = th.data.is_sub; //是否重复提交 //提交预约前的判断 if (store == "") { @@ -119,10 +99,6 @@ Page({ getApp().my_warnning("请选择预约时间", 0, th); return false; } else { - 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 @@ -160,6 +136,7 @@ Page({ th.setData({ is_sub: 0 }) + wx.hideLoading(); if (res.data.code == 0) { getApp().my_warnning("预约成功", 1, th); var store_name = th.data.store_name; //预约门店 @@ -212,13 +189,23 @@ Page({ } }) } - } + }, //提交预约 sub_success: function(e) { var th = this; - var temp_url = "/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; + } + th.setData({ + is_textea: 0, + is_sub: 1 + }) + wx.showLoading({ + title: '加载中', + }) //获取模版id getApp().request.promiseGet(temp_url, { data: { @@ -238,7 +225,7 @@ Page({ th.success(); } }) - }else{ + } else { th.success(); } }) @@ -522,6 +509,9 @@ Page({ if (seekTime != "") { th.query_more(); } + th.setData({ + time: th.data.time.substring(0, 16) + }) th.query_project(); }, //获取单个服务项目信息