Przeglądaj źródła

岗位列表重复加载问题解决

ZhangWenQiang 6 lat temu
rodzic
commit
afc435ddd1
2 zmienionych plików z 25 dodań i 25 usunięć
  1. 12 12
      pages/index/index.js
  2. 13 13
      pages/pt/index.js

+ 12 - 12
pages/index/index.js

@@ -48,18 +48,6 @@ Page({
     showNoMore: "没有更多信息...", //显示已无更多
   },
   onLoad: function(options) {
-
-  },
-  start() {
-    let cityName = wx.getStorageSync('city') || app.globalData.userInfo.city || '无锡'
-    console.log(cityName)
-    this.setData({
-      cityName: cityName
-    })
-    this.fetchBanner();
-    this.workType(this.data.filter);
-  },
-  onShow: function() {
     if (app.globalData.userInfo) {
       console.log('有info===', app.globalData)
       this.start();
@@ -83,6 +71,18 @@ Page({
     }
 
   },
+  start() {
+    let cityName = wx.getStorageSync('city') || app.globalData.userInfo.city || '无锡'
+    console.log(cityName)
+    this.setData({
+      cityName: cityName
+    })
+    this.fetchBanner();
+    this.workType(this.data.filter);
+  },
+  onShow: function() {
+
+  },
   //下拉刷新
   onPullDownRefresh: function() {
     this.setData({

+ 13 - 13
pages/pt/index.js

@@ -29,19 +29,6 @@ Page({
     showNoMore: "没有更多信息...", //显示已无更多
   },
   onLoad: function(options) {
-
-  },
-  onReady: function() {
-
-  },
-  onReachBottom: function() {
-    var pageNo = this.data.pageNo + 1;
-    this.setData({
-      pageNo
-    })
-    this.fetchList()
-  },
-  onShow: function() {
     if (app.globalData.userInfo) {
       console.log('有info===', app.globalData)
       this.start()
@@ -63,6 +50,19 @@ Page({
       })
     }
   },
+  onReady: function() {
+
+  },
+  onReachBottom: function() {
+    var pageNo = this.data.pageNo + 1;
+    this.setData({
+      pageNo
+    })
+    this.fetchList()
+  },
+  onShow: function() {
+
+  },
   start() {
     this.setData({
       cityName: updataStorageData('city') || app.globalData.userInfo.city || '无锡'