diff --git a/mp/pages/articleDetail/index.js b/mp/pages/articleDetail/index.js index e9a5b89..542f525 100644 --- a/mp/pages/articleDetail/index.js +++ b/mp/pages/articleDetail/index.js @@ -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();