We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8cf2b17 commit 75f69f7Copy full SHA for 75f69f7
miniprogram/pages/my/index.js
@@ -48,14 +48,15 @@ Page({
48
},
49
50
handleSubscribe() {
51
- const tmpId = 'vjEDlUYrVJ05CauSw_V9jIWF-okt3OMCBtlz9yvjrfg';
+ const tmplIds = ['vjEDlUYrVJ05CauSw_V9jIWF-okt3OMCBtlz9yvjrfg', 'Sbtj4X4gIKWRy0xDeWU8xCl8LejbTpIQ3gWiKh5JFp4'];
52
wx.requestSubscribeMessage({
53
- tmplIds: [tmpId],
54
- success: (res) => {
+ tmplIds,
+ success: async (res) => {
55
+ const accept = tmplIds.some(key => res[key] === 'accept')
56
Toast({
57
context: this,
58
selector: '#t-toast',
- message: res[tmpId] == 'accept' ? '订阅成功' : '你拒绝了订阅',
59
+ message: accept ? '订阅成功' : '你拒绝了订阅',
60
});
61
}
62
})
0 commit comments