提交 58212c48 编写于 作者: I iamxjb@gmail.com

修复既没有置顶文章,也没有评论下无法显示的问题

上级 a4bc59d5
......@@ -115,15 +115,14 @@ Page({
postsShowSwiperList: []
});
var isSticky=false;
var isSticky = false;
//先优先获取置顶的文章
wx.request({
url: Api.getStickyPosts(),
success: function (response) {
if (response.data.length>0)
{
if (response.data.length > 0) {
self.setData({
postsShowSwiperList: self.data.postsShowSwiperList.concat(response.data.map(function (item) {
......@@ -134,13 +133,12 @@ Page({
isSticky = true;
self.fetchPostsData(self.data);
}
}
}
});
if (!isSticky)
{
if (isSticky) {
return;
}
......@@ -218,7 +216,8 @@ Page({
self.setData({
displaySwiper: "none"
})
});
self.fetchPostsData(self.data)
}
}
});
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册