requestSubscribeMessage: function (finish) {
wx.getSetting({
withSubscriptions: true,
success(res) {
console.log(res.subscriptionsSetting)
if (!res.subscriptionsSetting.mainSwitch) {
wx.showModal({
title: '提示',
content: '请在设置->消息订阅中打开接收订阅消息,并勾选“名片交换通知”',
confirmText: '去设置',
showCancel: false,
success(res) {
if (res.confirm) {
wx.openSetting({
complete: (res) => {},
})
}
},
fail(errMsg) {
console.log(errMsg)
}
})
} else {
if (res.subscriptionsSetting.itemSettings && res.subscriptionsSetting.itemSettings.kKwJfuu9ndnJmQILftGx5GDWNOn_0M5twq_O6c0AmGk === 'reject') {
wx.showModal({
title: '提示',
content: '请在设置->消息订阅中勾选“名片交换通知”',
showCancel: false,
confirmText: '去设置',
success(res) {
if (res.confirm) {
wx.openSetting({
complete: (res) => {},
})
}
}
})
} else {
mta.Event.stat("10007", {})
wx.showLoading({
title: '加载中',
mask: true
})
wx.requestSubscribeMessage({
tmplIds: ['xxxxxxxx'],
success(res) {
if (res.xxxxxxxx === 'accept' &&
res.errMsg === 'requestSubscribeMessage:ok') {
mta.Event.stat("10008", {})
console.log("微信订阅成功")
} else {
console.log("用户取消订阅")
}
},
fail(error) {
mta.Event.stat("10010", {})
console.log("微信订阅失败:" + error.errMsg)
},
complete() {
if (typeof finish === 'function') {
finish()
console.log(typeof finish)
}
wx.hideLoading()
}
})
}
}
},
fail(error){
console.log(error)
},
complete: (res) => {
},
})
},
麻烦在手机微信那里上传下日志: 我->设置->帮助与反馈右上角有个上报日志的入口,麻烦提供一下微信号,时间点
微信号:Braving_z
时间点:04-27 (正午) 12:20 至 12:25
删除小程序从新打开也不行
苹果 8plus
微信版本:7.0.12
小程序基础库版本:2.10.4
小程序appId:wx9d49b279a71b6681
出现时间:2020-04-27 12:20左右
复现步骤:连续执行上述方法30-50次左右