作者 niufei

首页数据加载的bug

@@ -24,26 +24,11 @@ Page({ @@ -24,26 +24,11 @@ Page({
24 activity_pageNum: 4 24 activity_pageNum: 4
25 } 25 }
26 app.post(url, params, head).then((res) => { 26 app.post(url, params, head).then((res) => {
27 - if (res.news.length > 0) {  
28 - that.setData({  
29 - page_type: true  
30 - })  
31 - } else {  
32 - that.setData({  
33 - page_type: false  
34 - })  
35 - }  
36 - if (that.data.news == null) {  
37 - that.setData({  
38 - datalist: res,  
39 - activity: res.activity,  
40 - news: res.news  
41 - })  
42 - } else {  
43 - that.setData({  
44 - news: that.data.news.concat(res.news)  
45 - })  
46 - } 27 + that.setData({
  28 + datalist: res,
  29 + activity: res.activity,
  30 + news: res.news
  31 + })
47 }).catch((err) => { 32 }).catch((err) => {
48 33
49 }) 34 })