Merge branch 'master' of gitee.com:rumosky/mp-Blog

This commit is contained in:
rumosky
2023-11-28 14:35:50 +08:00
+7
View File
@@ -11,6 +11,7 @@ Page({
hasMore: true,
commentsDetail: [],
imgURL: "",
imgURL: "",
emptyContentText: "暂无评论",
},
// 监听页面滚动事件
@@ -100,6 +101,7 @@ Page({
showComments: false,
emptyContentText: "评论获取失败",
imgURL: "/assets/img/empty-image-error.png",
imgURL: "/assets/img/empty-image-error.png",
});
}
wx.hideLoading();
@@ -130,11 +132,13 @@ Page({
if (res.statusCode === 200) {
const data = res.data.data;
// console.log(data, "articleDetail");
// console.log(data, "articleDetail");
// 计算总页数
const commentsNum = data.commentsNum;
const pageSize = that.data.pageSize;
const totalPages = Math.ceil(commentsNum / pageSize);
that.setData({
articleDetail: data,
articleDetail: data,
totalPages: totalPages,
});
@@ -148,6 +152,7 @@ Page({
showComments: false,
emptyContentText: "暂无评论",
imgURL: "/assets/img/custom-empty-image.png",
imgURL: "/assets/img/custom-empty-image.png",
});
}
} else {
@@ -181,10 +186,12 @@ Page({
};
that.setData({
articleDetail: defaultData,
articleDetail: defaultData,
showComments: false,
emptyContentText: "评论获取失败",
imgURL: "/assets/img/empty-image-error.png",
imgURL: "/assets/img/empty-image-error.png",
});
}
wx.hideLoading();