|
@@ -131,20 +131,12 @@ Page({
|
|
|
},
|
|
|
async getSubscribe() {
|
|
|
let tmplIds = await setSubscribe()
|
|
|
- console.log(tmplIds, tmplIds ? true : false);
|
|
|
this.setData({
|
|
|
tmplIds: tmplIds ? tmplIds : [],
|
|
|
subscribeShow: tmplIds ? true : false,
|
|
|
})
|
|
|
},
|
|
|
requestMessage() {
|
|
|
- this.setData({
|
|
|
- tmplIds: [
|
|
|
- "oBzj9gVeL_6wI__PB5QdJuIG52KN__gyCAP3cQJ1Nqw",
|
|
|
- "8miPEckOl2q7AKaHLBygFpDDFASnQf_NPSP34Qb0QcI",
|
|
|
- "mGdQ9rUjqhC-D3HeFaZMaMkqw_Onfo1_PQbbHzWaXzI",
|
|
|
- ]
|
|
|
- })
|
|
|
wx.requestSubscribeMessage({
|
|
|
tmplIds: this.data.tmplIds,
|
|
|
success: async (res) => {
|
|
@@ -154,28 +146,29 @@ Page({
|
|
|
accept.push(item)
|
|
|
}
|
|
|
})
|
|
|
- console.log(accept, 'accept');
|
|
|
await setSubscribe({
|
|
|
ids: accept
|
|
|
}, 'post')
|
|
|
this.getSubscribe()
|
|
|
},
|
|
|
- /* fail: (err) => {
|
|
|
- console.log(err);
|
|
|
- if (err.errCode == '20004') {
|
|
|
- // 20004
|
|
|
- wx.showModal({
|
|
|
- title: '温馨提示',
|
|
|
- content: '请同意允许我们向您发送订阅信息,请打开设置勾选订阅消息,这样能随时接到关于您作品的最新消息',
|
|
|
- complete: (res) => {
|
|
|
- if (res.cancel) {
|
|
|
- }
|
|
|
- if (res.confirm) {
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- } */
|
|
|
+ fail: async (err) => {
|
|
|
+ await setSubscribe({
|
|
|
+ ids: []
|
|
|
+ }, 'post')
|
|
|
+ this.getSubscribe()
|
|
|
+ /* console.log(err);
|
|
|
+ if (err.errCode == '20004') {
|
|
|
+ // 20004
|
|
|
+ wx.showModal({
|
|
|
+ title: '温馨提示',
|
|
|
+ content: '请同意允许我们向您发送订阅信息,请打开设置勾选订阅消息,这样能随时接到关于您作品的最新消息',
|
|
|
+ complete: (res) => {
|
|
|
+ if (res.cancel) {}
|
|
|
+ if (res.confirm) {}
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } */
|
|
|
+ }
|
|
|
})
|
|
|
},
|
|
|
onUnload() {
|