bayi hace 1 año
padre
commit
c0d6e8e1bc
Se han modificado 3 ficheros con 19 adiciones y 26 borrados
  1. 18 25
      pages/index/index.js
  2. 1 0
      pages/my/index.js
  3. 0 1
      utils/request.js

+ 18 - 25
pages/index/index.js

@@ -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() {

+ 1 - 0
pages/my/index.js

@@ -1,6 +1,7 @@
 import {
     getMyInfo,
     androidbuyVip,
+    buyVip,
     getVipInfo,
     getWxQrcode,
     getLearnCard

+ 0 - 1
utils/request.js

@@ -15,7 +15,6 @@ if (envVersion == 'develop') {
 }
 
 function request(url, method, data, oldBaseUrl = false, intercept = true) {
-
     let header = {
         'uid': wx.getStorageSync('uid') || '',
         'channelCode': wx.getStorageSync('user').channel == '4001' ? '4001' : '3006'