Z1hgq 7 rokov pred
rodič
commit
c3c26740eb
2 zmenil súbory, kde vykonal 36 pridanie a 9 odobranie
  1. 31 7
      Gkzs/index/result/result.js
  2. 5 2
      Gkzs/index/result/result.wxml

+ 31 - 7
Gkzs/index/result/result.js

xqd xqd xqd xqd
@@ -27,6 +27,7 @@ Page({
     showPayButton: true,
     showPaidInfo: false,
     paidInfo:[],
+    next_page_url:'',
   },
 
   /**
@@ -89,7 +90,28 @@ Page({
    * 页面上拉触底事件的处理函数
    */
   onReachBottom: function () {
-
+    wx.showLoading({
+      title: 'loading',
+    })
+    var that = this
+    wx.request({
+      url: that.data.next_page_url,
+      data:{
+        userid: that.data.userid,
+        username: that.data.username,
+        batch: that.data.batch,
+        province: that.data.province,
+        class: that.data.class
+      },
+      method:'POST',
+      success:function(res){
+        that.setData({
+          paidInfo: [...that.data.paidInfo.concat(res.data.data.major.data)],
+          next_page_url: res.data.data.major.next_page_url
+        })
+        wx.hideLoading()
+      }
+    })
   },
 
   /**
@@ -182,13 +204,14 @@ Page({
                       console.log('已付费')
                       console.log(res.data)
                       that.setData({
-                        paidInfo:[...res.data.data.major],
-                        major_count:res.data.data.count,
+                        paidInfo:[...res.data.data.major.data],
+                        major_count:res.data.data.major.total,
                         showFreeInfo: false,
                         showPayButton: false,
                         showPaidInfo: true,
+                        next_page_url:res.data.data.major.next_page_url
                       })
-                      console.log(that.data.paidInfo)
+                      console.log(that.data)
                     }
                   })
                 }
@@ -198,13 +221,14 @@ Page({
         } else {
           console.log('已付费')
           that.setData({
-            paidInfo: [...res.data.data.major],
-            major_count: res.data.data.count,
+            paidInfo: [...res.data.data.major.data],
+            major_count: res.data.data.major.total,
             showFreeInfo: false,
             showPayButton: false,
             showPaidInfo: true,
+            next_page_url: res.data.data.major.next_page_url
           })
-          console.log(that.data.paidInfo)
+          console.log(that.data)
         }
       }
     })

+ 5 - 2
Gkzs/index/result/result.wxml

xqd
@@ -32,8 +32,11 @@
 
     <view class='majorInfo' wx:if="{{showPaidInfo}}" wx:for="{{paidInfo}}">
       <view class='weui-flex'>
-        <view class='weui-flex__item'><view class='college'>{{item.college}}</view></view>
-        <view class='weui-flex__item' style='margin-top:10rpx'><image style='width:15px;height:15px;' src='../../images/IP.png' mode='aspectFit'></image>{{item.province}}</view>
+        <view class='weui-flex__item'>
+          <view class='college'>{{item.college}}</view>
+        </view>
+        <view class='weui-flex__item' style='margin-top:10rpx'>
+          <image style='width:15px;height:15px;' src='../../images/IP.png' mode='aspectFit'></image>{{item.province}}</view>
       </view>
       <view class='weui-flex'>
         <view class='weui-flex__item'>专业:{{item.major}} {{item.type}}</view>