diff --git a/pages/user/my_service/appment_main.js b/pages/user/my_service/appment_main.js
index 6916ba4..14dd47e 100644
--- a/pages/user/my_service/appment_main.js
+++ b/pages/user/my_service/appment_main.js
@@ -47,13 +47,29 @@ 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({
is_textea: 1,
beautician: 0
})
-
},
onclickstore: function() {
var th = this;
@@ -82,13 +98,12 @@ Page({
remarks: remarks
})
},
- //提交预约
- sub_success: function(e) {
+ //提交成功及发送模版代码
+ success: function() {
var th = this;
th.setData({
is_textea: 0
})
- var formid = e.detail.formId; //发送预约成功模版信息
var store = th.data.store_name; //门店名称
var bea_name = th.data.beautician_name; //美容师名称
var time = th.data.time; //预约时间
@@ -149,11 +164,11 @@ Page({
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/templatMessageSend"; //模版接口
+ var temp_url = "/api/wx/open/app/user/sendSubscribeMsg"; //模版接口
var userinfo = getApp().globalData.userInfo;
var name = d.userInfo.nickname;
var json = {
- "formId": formid,
+ // "formId": formid,
"keyWord": [{
"keyword": res.data.data.ServiceName
},
@@ -199,10 +214,41 @@ Page({
}
}
},
+ //提交预约
+ sub_success: function(e) {
+ var th = this;
+ var temp_url = "/api/wx/weappSendlist/page";
+ var template_id = "";
+ //获取模版id
+ getApp().request.promiseGet(temp_url, {
+ data: {
+ store_id: a.stoid,
+ typeid: "1011"
+ }
+ }).then(res => {
+ if (res.data.code == 0) {
+ template_id = res.data.data.pageData[0].template_id;
+ // //授权订阅
+ wx.requestSubscribeMessage({
+ tmplIds: [template_id],
+ success(res) {
+ th.success();
+ },
+ fail(res) {
+ th.success();
+ }
+ })
+ }else{
+ th.success();
+ }
+ })
+
+ },
goto: function(e) {
var th = this;
th.setData({
- beautician: 0
+ beautician: 0,
+ is_textea: 0
})
if (th.data.store_name == "") {
getApp().my_warnning("请选择服务门店", 0, th);
diff --git a/pages/user/my_service/appment_main.wxml b/pages/user/my_service/appment_main.wxml
index 7013609..9621fce 100644
--- a/pages/user/my_service/appment_main.wxml
+++ b/pages/user/my_service/appment_main.wxml
@@ -68,7 +68,7 @@
备
注
-
+
@@ -87,7 +87,7 @@
我的预约
-