Browse Source

添加专区

wangyong 5 years ago
parent
commit
303f028ba4
2 changed files with 19 additions and 3 deletions
  1. 2 2
      app.js
  2. 17 1
      pages/momo/momo.js

+ 2 - 2
app.js

@@ -137,8 +137,8 @@ App({
     fromUserId : '',//分享者的id
     fromUserRole : '',//分享者的role
     //servsers: "https://52yqf.cn/",
-    //servsers: "https://www.daliangzao.net/",//正式库
-    servsers: "https://dlz.info666.com/",//测试域名库
+    servsers: "https://www.daliangzao.net/",//正式库
+    // servsers: "https://dlz.info666.com/",//测试域名库
     //servsers: "https://tt.daliangzao.net/",//测试库
     appid: 'wxf9a0ddcb8c70b939',//appid
     secret: 'a009cb3e46c8ecef9c54a50522f11823',//secret

+ 17 - 1
pages/momo/momo.js

@@ -15,6 +15,7 @@ Page({
     limit: 20, //一页20条数据
     requestState: true, //默认是可以向下请求的
     loginStatic: false, //登陆状态,默认为false
+    reachBottomState:true,//判断是否有上拉加载状态
     tabBar: {
       "color": "#2d2d2d",
       "selectedColor": "#e81021",
@@ -115,7 +116,17 @@ Page({
    * 页面上拉触底事件的处理函数
    */
   onReachBottom: function () {
-
+    console.log('开始上拉')
+    let that = this;
+    if (that.data.reachBottomState){
+      that.setData({
+        page: ++that.data.page
+      })
+      that.getGiftList(that)
+    } else {
+      console.log('已经到底')
+    }
+    
   },
 
   /**
@@ -136,6 +147,11 @@ Page({
       data: data,
       success(res) {
         let dataArray = that.data.goodsList;
+        if (res.data.rows.length < 20){
+          that.setData({
+            reachBottomState:false,
+          })
+        }
         res.data.rows.forEach(el => {
           el.logo = el.commodity_logo.split(",")
         })