wx.requestSubscribeMessage方法多个模板,只勾选其中一个允许,下次还会弹吗?
const tmplIds = ['OK2V3j2Wk2VHiotWvkEGfxVWeZa8HEOPRVgiqdXu9Wk', 'OLpL93nmrpG6j81FsLg91j6gMH-UT_MhjQirbVmdFh8']
wx.requestSubscribeMessage({
tmplIds: tmplIds, // 替换为你的模板ID
success(res) {
console.log(77777, res)
tmplIds.forEach(tmplId => {
if (res[tmplId] === 'accept') {
wx.showToast({
title: '订阅消息,请留意微信通知',
icon: 'none',
duration: 2500
})
console.log();
} else if (res[tmplId] === 'reject') {
// 记录用户拒绝订阅的时间
wx.setStorageSync('lastRejectTime', now);
}
});
},
fail(err) {
console.error('订阅失败', err);
}
});