|
@@ -227,6 +227,7 @@ Page({
|
|
|
|
|
|
async handleSubscribeMessage(e) {
|
|
async handleSubscribeMessage(e) {
|
|
const { page } = e.currentTarget.dataset
|
|
const { page } = e.currentTarget.dataset
|
|
|
|
+ const that = this
|
|
|
|
|
|
try {
|
|
try {
|
|
const { errMsg, subscriptionsSetting } = await wx.getSetting({ withSubscriptions: true })
|
|
const { errMsg, subscriptionsSetting } = await wx.getSetting({ withSubscriptions: true })
|
|
@@ -238,44 +239,55 @@ Page({
|
|
const moIdState = subscriptionsSetting.itemSettings[tmplIds]
|
|
const moIdState = subscriptionsSetting.itemSettings[tmplIds]
|
|
if (moIdState === 'accept') {
|
|
if (moIdState === 'accept') {
|
|
|
|
|
|
|
|
+ wx.navigateTo({
|
|
|
|
+ url: `/pages/${page}/${page}`
|
|
|
|
+ })
|
|
} else if (moIdState === 'reject') {
|
|
} else if (moIdState === 'reject') {
|
|
|
|
|
|
|
|
+ wx.navigateTo({
|
|
|
|
+ url: `/pages/${page}/${page}`
|
|
|
|
+ })
|
|
} else if (moIdState === 'ban') {
|
|
} else if (moIdState === 'ban') {
|
|
|
|
|
|
|
|
+ wx.navigateTo({
|
|
|
|
+ url: `/pages/${page}/${page}`
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ that.handleSubscribeMessageBridge(tmplIds, page)
|
|
}
|
|
}
|
|
-
|
|
|
|
- wx.navigateTo({
|
|
|
|
- url: `/pages/${page}/${page}`
|
|
|
|
- })
|
|
|
|
} else {
|
|
} else {
|
|
-
|
|
+ that.handleSubscribeMessageBridge(tmplIds, page)
|
|
- wx.showModal({
|
|
|
|
- title: '提示',
|
|
|
|
- content: '请授权开通服务通知',
|
|
|
|
- showCancel: true,
|
|
|
|
- success: function (res) {
|
|
|
|
- if (res.confirm) {
|
|
|
|
- wx.requestSubscribeMessage({
|
|
|
|
- tmplIds: [tmplIds],
|
|
|
|
- success(res) {
|
|
|
|
- wx.navigateTo({
|
|
|
|
- url: `/pages/${page}/${page}`
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- fail(err) {
|
|
|
|
- wx.navigateTo({
|
|
|
|
- url: `/pages/${page}/${page}`
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
|
|
|
|
|
|
+ that.handleSubscribeMessageBridge(tmplIds, page)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} catch (err) {}
|
|
} catch (err) {}
|
|
|
|
+ },
|
|
|
|
+ handleSubscribeMessageBridge(tmplIds, page) {
|
|
|
|
+
|
|
|
|
+ wx.showModal({
|
|
|
|
+ title: '提示',
|
|
|
|
+ content: '请授权开通服务通知',
|
|
|
|
+ showCancel: true,
|
|
|
|
+ success: function (res) {
|
|
|
|
+ if (res.confirm) {
|
|
|
|
+ wx.requestSubscribeMessage({
|
|
|
|
+ tmplIds: [tmplIds],
|
|
|
|
+ success(res) {
|
|
|
|
+ wx.navigateTo({
|
|
|
|
+ url: `/pages/${page}/${page}`
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ fail(err) {
|
|
|
|
+ wx.navigateTo({
|
|
|
|
+ url: `/pages/${page}/${page}`
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
}
|
|
}
|
|
})
|
|
})
|