Browse Source

FIX

修复入驻后用户组织不更新的问题
RegMs If 4 năm trước cách đây
mục cha
commit
7e541c8bfe

+ 18 - 0
miniprogram/pages/publisherLogin/publisherLogin.js

@@ -1,3 +1,4 @@
+const app = getApp()
 const util = require('../../utils/util.js')
 
 Page({
@@ -88,6 +89,23 @@ Page({
       this.setData({
         currentTab: 5
       })
+      return wx.cloud.callFunction({
+        name: 'listPublishers',
+        data: {
+          manager: true,
+          page_token: 0,
+          page_size: 20
+        }
+      })
+    }).then(res => {
+      if (res.result.status !== 'OK') {
+        wx.showToast({
+          title: res.result.errMsg,
+          icon: 'none'
+        })
+        return
+      }
+      app.globalData.pubInfo = res.result.list
     })
   },
 

+ 1 - 49
miniprogram/pages/publisherPage/publisherPage.js

@@ -61,10 +61,7 @@ Page({
     })
   },
 
-  /**
-   * 生命周期函数--监听页面加载
-   */
-  onLoad: function (options) {
+  onShow: function () {
     if (app.globalData.hasUserInfo) {
       const pubName = []
       for (let i = 0; i < app.globalData.pubInfo.length; i++) {
@@ -84,52 +81,7 @@ Page({
     }
   },
 
-  /**
-   * 生命周期函数--监听页面初次渲染完成
-   */
-  onReady: function () {
-
-  },
-
-  /**
-   * 生命周期函数--监听页面显示
-   */
-  onShow: function () {
-
-  },
-
-  /**
-   * 生命周期函数--监听页面隐藏
-   */
   onHide: function () {
-
-  },
-
-  /**
-   * 生命周期函数--监听页面卸载
-   */
-  onUnload: function () {
     app.globalData.pubIndex = this.data.pubIndex
-  },
-
-  /**
-   * 页面相关事件处理函数--监听用户下拉动作
-   */
-  onPullDownRefresh: function () {
-
-  },
-
-  /**
-   * 页面上拉触底事件的处理函数
-   */
-  onReachBottom: function () {
-
-  },
-
-  /**
-   * 用户点击右上角分享
-   */
-  onShareAppMessage: function () {
-
   }
 })