Bladeren bron

我的申请返回刷新问题

ZhangWenQiang 6 jaren geleden
bovenliggende
commit
ec841e72f2
2 gewijzigde bestanden met toevoegingen van 23 en 4 verwijderingen
  1. 21 3
      pages/apply-list/index.js
  2. 2 1
      pages/apply-list/index.json

+ 21 - 3
pages/apply-list/index.js

@@ -14,10 +14,18 @@ Page({
     list: [],
     showNoMore: "没有更多信息...", //显示已无更多
   },
-  onLoad: function(options) {
-    console.log(options)
+
+  //下拉刷新
+  onPullDownRefresh: function() {
+    this.setData({
+      pageNo: 1, //当前分页
+      isScroll: true, //是否可以滚动
+      list: [],
+    })
     this.fetchData()
+    wx.stopPullDownRefresh();
   },
+
   onReachBottom: function() {
     var pageNo = this.data.pageNo + 1;
     this.setData({
@@ -25,6 +33,16 @@ Page({
     })
     this.fetchData()
   },
+
+  onShow: function() {
+    this.setData({
+      pageNo: 1, //当前分页
+      isScroll: true, //是否可以滚动
+      list: [],
+    })
+    this.fetchData()
+  },
+
   onShareAppMessage: function() {
 
   },
@@ -62,7 +80,7 @@ Page({
       id,
       cate
     } = e.currentTarget.dataset
-    if(cate == 4){
+    if (cate == 4) {
       showToast("该岗位为拼工岗位,请到app上查看");
       return;
     }

+ 2 - 1
pages/apply-list/index.json

@@ -4,5 +4,6 @@
     "i-divider": "../../ui/divider/index",
     "i-tag": "../../ui/tag/index"
   },
-  "navigationBarTitleText": "我的申请"
+  "navigationBarTitleText": "我的申请",
+  "enablePullDownRefresh": true
 }