From ac940c55619008e85bfae61f4cfc3b48be76cf8a Mon Sep 17 00:00:00 2001 From: yangjie <812952667@qq.com> Date: Tue, 7 Sep 2021 10:32:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AE=A2=E9=98=85=E6=B6=88?= =?UTF-8?q?=E6=81=AF=E9=80=9A=E7=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/tabBar/home/home.vue | 55 +++++++++++++++++++------------------- 1 file changed, 28 insertions(+), 27 deletions(-) diff --git a/pages/tabBar/home/home.vue b/pages/tabBar/home/home.vue index a5c2e1c..b41ced2 100644 --- a/pages/tabBar/home/home.vue +++ b/pages/tabBar/home/home.vue @@ -364,33 +364,34 @@ // 开启订阅消息 openMsg() { - var that = this - // 获取用户的当前设置,判断是否点击了“总是保持以上,不在询问” - wx.getSetting({ - withSubscriptions:true, //是否获取用户订阅消息的订阅状态,默认false不返回 - success(res) { - if(res.authSetting['scope.subscribeMessage'] || res.authSetting['scope.subscribeMessage'] == undefined) { //用户点击了“总是保持以上,不再询问” - uni.openSetting({ // 打开设置页 - success(res) { - console.log(res.authSetting) - }, - fail(err) { - console.log(err) - } - }); - }else { // 用户没有点击“总是保持以上,不再询问”则每次都会调起订阅消息 - uni.requestSubscribeMessage({ - tmplIds: 1, - success (res) { - console.log(res) - }, - fail:(res) => { - console.log(res) - } - }) - } - } - }) + uni.requestSubscribeMessage({ + tmplIds: ['oUvaCPeeOg4wH6HTvCcSabU6FnzXUXOBXsqBYAPOV-U'], + success (res) { + console.log(res) + }, + fail:(res) => { + console.log(res) + } + }) + // var that = this + // // 获取用户的当前设置,判断是否点击了“总是保持以上,不在询问” + // wx.getSetting({ + // withSubscriptions:true, //是否获取用户订阅消息的订阅状态,默认false不返回 + // success(res) { + // if(res.authSetting['scope.subscribeMessage'] || res.authSetting['scope.subscribeMessage'] == undefined) { //用户点击了“总是保持以上,不再询问” + // uni.openSetting({ // 打开设置页 + // success(res) { + // console.log(res.authSetting) + // }, + // fail(err) { + // console.log(err) + // } + // }); + // }else { // 用户没有点击“总是保持以上,不再询问”则每次都会调起订阅消息 + + // } + // } + // }) }, //获取弹出或者弹窗 getCmsContent() {