zxy 1 vuosi sitten
vanhempi
commit
7618971a16
1 muutettua tiedostoa jossa 12 lisäystä ja 10 poistoa
  1. 12 10
      nnzwminiapp/pages/nnzzd/nnzzd.js

+ 12 - 10
nnzwminiapp/pages/nnzzd/nnzzd.js

@@ -21,6 +21,18 @@ Page({
    * 生命周期函数--监听页面加载
    */
   onLoad(options) {
+    let that = this
+    wx.getSetting({
+        withSubscriptions: true,
+        success (res) {
+          console.log(res.subscriptionsSetting)
+          if(res.subscriptionsSetting.itemSettings['aGohosyMWmBOdzkjlD34qMRIsAPb2cVY6juinVIevgg'] == 'accept'){
+            that.setData({
+                dySign: false
+            })
+          }
+        }
+      })
     request({
         url: '/event/page?page=1&limit=9999',
         method: 'GET'
@@ -59,16 +71,6 @@ Page({
 
   },
   dy(){
-      let that = this
-    // wx.getSetting({
-    //     withSubscriptions: true,
-    //     success (res) {
-    //       console.log(res.subscriptionsSetting)
-    //       if(res.subscriptionsSetting.itemSettings['aGohosyMWmBOdzkjlD34qMRIsAPb2cVY6juinVIevgg'] == 'accept'){
-    //           console.log('用户已经订阅');
-    //       }
-    //     }
-    //   })
     wx.requestSubscribeMessage({
         tmplIds: ['aGohosyMWmBOdzkjlD34qMRIsAPb2cVY6juinVIevgg'],
         success (res) {