Ver Fonte

fix:挖矿页面认证有问题

yll há 4 anos atrás
pai
commit
e89d8a206c
2 ficheiros alterados com 10 adições e 9 exclusões
  1. 4 3
      view/xcx/components/mine/index.js
  2. 6 6
      view/xcx/pages/index/index.js

+ 4 - 3
view/xcx/components/mine/index.js

@@ -34,8 +34,8 @@ Component({
    */
   methods: {
     show: function() {
-      console.log('show:', app.globalData.token)
-      if (app.globalData.token) {
+      // console.log('show:', app.globalData.token)
+      if (app.globalData.isLog) {
         this.setData({ iShidden:true})
         this.getStatus()
         this.getHistory()
@@ -61,6 +61,7 @@ Component({
     },
 
     getStatus: function() {
+      // console.log('isLog:', app.globalData.isLog)
       if (app.globalData.isLog) {
         var that = this;
         getMineStatus().then(res=>{
@@ -104,7 +105,7 @@ Component({
 
     onLoadFun:function() {
       if (this.data.displaying && app.globalData.isLog){
-        console.log("onLoadFun")
+        // console.log("onLoadFun")
         this.getStatus()
         this.getHistory()
       }

+ 6 - 6
view/xcx/pages/index/index.js

@@ -139,9 +139,6 @@ Page({
    * 生命周期函数--监听页面初次渲染完成
    */
   onReady: function () {
-    this.setData({
-      cpnMine: this.selectComponent('#mine'),
-    })
   },
 
   /** 轮播监听 */
@@ -293,11 +290,14 @@ Page({
       activeTabIndex: activeTabIndex
     })
     // 黑洞
+    this.setData({
+      cpnMine: this.selectComponent('#mine'),
+    })
     if (this.data.categoryOne.children[activeTabIndex - 1].id === 199) {
-      this.data.cpnMine.show()
+      var _ = this.data.cpnMine && this.data.cpnMine.show()
       return
     } else {
-      this.data.cpnMine.hide()
+      var _ = this.data.cpnMine && this.data.cpnMine.hide()
     }
 
     that.setData({
@@ -479,7 +479,7 @@ Page({
       })
     }
 
-    this.data.cpnMine.hide()
+    var _ = this.data.cpnMine && this.data.cpnMine.hide()
   },
 
   /**