Skip to content

Commit

Permalink
update posts page
Browse files Browse the repository at this point in the history
get request for the trending tags
  • Loading branch information
Cha0s0000 committed Apr 14, 2018
1 parent f642ca2 commit e3170a6
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion pages/post/post.js
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,28 @@ Page({
}
})

}
},
showTags:function(e){
var that =this;
var tagsList = [];
wx.request({
url: 'https://api.steemjs.com/get_trending_tags?limit=30',
method: 'GET',
success: function(res) {
if(res.statusCode == '200'){
var tagsDatas = res.data;
for (var tagsData in tagsDatas){
var obj = new Object();
obj.tag = tagsDatas[tagsData].name;
tagsList.push(obj);
}
console.log(tagsList);
that.setData({ tagsList: tagsList})
}
},
complete: function(res) {},
})
this.data.open ? this.setData({ open: false }) : this.setData({ open: true });
},
})

0 comments on commit e3170a6

Please sign in to comment.