浏览代码

直播列表

junyuanz 5 年之前
父节点
当前提交
9b72f6a262
共有 1 个文件被更改,包括 14 次插入7 次删除
  1. 14 7
      pages/livelist/livelist.js

+ 14 - 7
pages/livelist/livelist.js

@@ -2,7 +2,7 @@ var _request = require('../../utils/request.js')
 Page({
   data: {
     projects_page: 1,
-    projects_per_page: 6,
+    projects_per_page: 8,
     projects_more: true,
     projects_change: false,
     projects: [],
@@ -29,7 +29,7 @@ Page({
       projects_page: 1,
       projects_change: true
     })
-    this.getLive()
+    this.getLive('refresh')
     wx.stopPullDownRefresh()
   },
   onReachBottom: function () {
@@ -41,7 +41,7 @@ Page({
       this.getLive()
     }
   },
-  getLive: function () {
+  getLive: function (type) {
     var that = this
     var url = 'v1/live_broad/list'
 	var params = {
@@ -50,10 +50,17 @@ Page({
 	}
     var success = function (res) {
       console.log('res',res);
-	  var result = that.data.projects.concat(res.data.list || [])
-	  that.setData({
-		  projects:result
-	  })
+	  if(type != 'refresh'){
+		 var result = that.data.projects.concat(res.data.list || [])
+		 that.setData({
+		 	projects:result
+		 }) 
+	  }else{
+		  that.setData({
+		  	projects:res.data.list
+		  }) 
+	  }
+	  
 	  
 	  var listMore = res.data.list_count > that.data.projects.length
 	  that.setData({