processDoubanDate: function (douban){
for (var idx in douban.subjects) {
var subject = douban.subjects[idx];
var title = subject.title;
if (title.length >= 6) {
title = title.substring(0, 6) + "...";
}
//[1,1,1,1,1]5星[1,1,1,0,0]3星
var temp = {
title: title,
coverageUrl: subject.images.large,
average: subject.rating.average,
stars: util.convertToStarsArray(subject.rating.stars),
movieId: subject.id
}
this.data._movies.push(temp);
}
this.setData({movies: this.data._movies });
wx.hideNavigationBarLoading();
wx.stopPullDownRefresh();
this.data.total += 20;
},
onPullDownRefresh: function(event){
this.data.movies = {};
this.data._movies = [];
this.data.total = 0;
var _url = this.data.requesturl + "?start=0&count=20"
util.http(_url, this.processDoubanDate);
wx.showNavigationBarLoading();
},