
AI
goCheckInfo: function (e) { var that = this var tmplIds = 'tmplId'//模板id wx.getSetting({ withSubscriptions: true, success: function (res) { if (res.subscriptionsSetting.mAInSwitch) { // 用户打开了订阅消息总开关 if (res.subscriptionsSetting.itemSettings != null) { // 用户同意总是保持是否推送消息的选择, 这里表示以后不会再拉起推送消息的授权 let moIdState = res.subscriptionsSetting.itemSettings[tmplIds]; // 用户同意的消息模板id wx.requestSubscribeMessage({ tmplIds: [tmplIds], success(res) { //成功之后处理业务 }, }) } else { wx.requestSubscribeMessage({ tmplIds: [tmplIds], success(res) { //成功之后处理业务 }, }) } } else { console.log('订阅消息未开启') } }, fAIl: function (error) { console.log(error); }, }) },
Copyright © 2025 IZhiDa.com All Rights Reserved.
知答 版权所有 粤ICP备2023042255号