zhaoxiaohai пре 3 година
родитељ
комит
96613a55b8
2 измењених фајлова са 7 додато и 14 уклоњено
  1. 6 13
      pages/businessPartner/index.js
  2. 1 1
      pages/businessPartner/index.wxml

+ 6 - 13
pages/businessPartner/index.js

@@ -11,7 +11,6 @@ Page({
         showIndex: -1, //显示按钮的下标
         cooperationList: [], //合作列表
         condition: "", //模糊搜索条件
-        scrolltolowerThrottle: true, //下拉触底截流
         pageNumber: 1, //请求分页
         pageTotal: 1, //总页数
     },
@@ -70,11 +69,8 @@ Page({
     },
     /* 下拉触底 */
     scrolltolower() {
-        if (!this.data.scrolltolowerThrottle) return;
-        this.setData({
-            scrolltolowerThrottle: false
-        })
-        if (this.data.pageTotal > this.data.pageNumber) this.getList();
+        if (this.data.pageTotal < this.data.pageNumber) return;
+        this.getList();
     },
     getList() {
         _Http.basic({
@@ -97,17 +93,14 @@ Page({
                 title: res.data,
                 icon: "none"
             });
-            let cooperationList = [];
-            if (res.pageNumber == 1) {
-                cooperationList = res.data
-            } else {
-                cooperationList = this.data.requestList.concat(res.data)
+            let cooperationList = res.data;
+            if (res.pageNumber != 1) {
+                cooperationList = this.data.cooperationList.concat(cooperationList)
             };
             this.setData({
                 cooperationList,
                 pageTotal: res.pageTotal,
-                pageNumber: this.data.pageNumber + 1,
-                scrolltolowerThrottle: true
+                pageNumber: this.data.pageNumber + 1
             });
         })
     },

+ 1 - 1
pages/businessPartner/index.wxml

@@ -17,6 +17,6 @@
                 <van-button wx:if="{{index==showIndex}}" custom-class="custom-class-company-data" catchtap="jumpForDetails">合作详情</van-button>
             </view>
         </view>
-        <My_pageReachBottom loadMore="{{scrolltolowerThrottle==true}}" dummyStatus="{{cooperationList.length!=0}}"></My_pageReachBottom>
+        <My_pageReachBottom loadMore="{{pageNumber > pageTotal}}" dummyStatus="{{cooperationList.length!=0}}"></My_pageReachBottom>
     </scroll-view>
 </My_DisplayBox>