|
@@ -57,8 +57,19 @@ Page({
|
|
|
}, function (json) {
|
|
|
var list = json.data.list;
|
|
|
list.forEach(function(item){
|
|
|
- item.labels = ["精选"]
|
|
|
+ item.times = new Date(item.time.replace("-","/")).getTime();
|
|
|
})
|
|
|
+ list.sort(function(a,b){
|
|
|
+ return a.times<b.times
|
|
|
+ })
|
|
|
+ list.forEach(function(item,index){
|
|
|
+ if(index%2==1){
|
|
|
+ item.labels=["精选"];
|
|
|
+ }else{
|
|
|
+ item.labels=["热议"];
|
|
|
+ }
|
|
|
+ })
|
|
|
+ console.log(JSON.stringify(list));
|
|
|
if(list.length==1){
|
|
|
list = list.concat(list,list);
|
|
|
}
|