Selaa lähdekoodia

Merge branch 'master' of http://git.cc-lotus.info/ball-court/ball-applet

zs 2 vuotta sitten
vanhempi
commit
de6ddf9179
2 muutettua tiedostoa jossa 30 lisäystä ja 0 poistoa
  1. 15 0
      pages/soneopen/list.js
  2. 15 0
      pages/soneprivate/list.js

+ 15 - 0
pages/soneopen/list.js

@@ -77,6 +77,21 @@ Page({
             }
         })
     },
+    // 分页
+    toPage: function () {
+        const that = this;
+        let list = that.data.list;
+        let limit = that.data.limit;
+        if (that.data.total > list.length) {
+            wx.showLoading({ title: '加载中', mask: true })
+            let page = that.data.page + 1;
+            that.setData({ page: page })
+            let skip = page * limit;
+            that.setData({ skip: skip })
+            that.watchLogin();
+            wx.hideLoading()
+        } else { wx.showToast({ title: '没有更多数据了', icon: 'none', duration: 2000 }) }
+    },
     /**
      * 生命周期函数--监听页面初次渲染完成
      */

+ 15 - 0
pages/soneprivate/list.js

@@ -47,6 +47,21 @@ Page({
             }
         })
     },
+    // 分页
+    toPage: function () {
+        const that = this;
+        let list = that.data.list;
+        let limit = that.data.limit;
+        if (that.data.total > list.length) {
+            wx.showLoading({ title: '加载中', mask: true })
+            let page = that.data.page + 1;
+            that.setData({ page: page })
+            let skip = page * limit;
+            that.setData({ skip: skip })
+            that.watchLogin();
+            wx.hideLoading()
+        } else { wx.showToast({ title: '没有更多数据了', icon: 'none', duration: 2000 }) }
+    },
     /**
      * 生命周期函数--监听页面加载
      */