diff --git a/pages/articleList/article.vue b/pages/articleList/article.vue index a440bb37..9e24d895 100644 --- a/pages/articleList/article.vue +++ b/pages/articleList/article.vue @@ -130,12 +130,11 @@ {{ articleInfo.readCount }}人阅读 - + - @@ -167,15 +166,19 @@ 点赞 - - + {{ - articleInfo.likeCount ? articleInfo.likeCount : "0" + articleInfo.commentCount ? articleInfo.commentCount : "0" }} 评论 @@ -195,27 +198,34 @@ - - - 全部{{commentData.length?commentData.length:' 0'}} 条评论 + + + 全部 {{ articleInfo.commentCount }} 条评论 - - + - - + + @@ -242,8 +252,8 @@ export default { }, data() { return { - orderModalShow:false, - commentData:[], + orderModalShow: false, + commentData: [], articleInfo: {}, editorOption: {}, options: {}, @@ -384,16 +394,13 @@ export default { }, 800); }, methods: { - onHandleClickBuy() { - - console.log('111 at line 384:', 111) - this.orderModalShow = true; - - }, - closeOrderModalShow() { - - this.orderModalShow = false; - }, + onHandleClickOpenComment() { + console.log("111 at line 384:", 111); + this.orderModalShow = true; + }, + closeOrderModalShow() { + this.orderModalShow = false; + }, saveContens(content) { console.log("content at line 322:", content); this.formData.message = content; @@ -526,29 +533,7 @@ export default { console.log(this.selectedItems); console.log(this.selectedId); }, - //基因模糊查询列表 - getGenes(name) { - this.$http - .request({ - url: "taihumed/precisionMedicine/getPrecisionMedicineGenes", - method: "POST", - data: { name: name }, - header: { - "Content-Type": "application/json", - }, - }) - .then((res) => { - if (res.code == 0) { - if (res.genes && res.genes.length > 0) { - this.searchResults = res.genes; - this.searchResultStatus = true; - } else { - this.searchResults = ""; - this.searchResultStatus = false; - } - } - }); - }, + //勾选 toggleCheck() { this.isChecked = !this.isChecked; @@ -597,7 +582,7 @@ export default { console.log(e); }); }, - + //点击每个记录 clickRecord(item, index) { //重新定义id @@ -686,7 +671,6 @@ export default { return; } //创建对话 获取sessionId - this.createChat(); }, //创建新对话 createChat() { @@ -711,15 +695,15 @@ export default { }); }, //创建新对话 - createComment() { + sendComment(comment,pid) { this.$http .request({ url: "common/taihuTalentArticle/addArticleComment", method: "POST", data: { - "pid":"", //第一条评论为0 - "articleId":"", //文章id - "content":"" //内容 + pid: pid?pid:0, //第一条评论为0 + articleId: this.options.id, //文章id + content: comment, //内容 }, header: { "Content-Type": "application/json", @@ -728,28 +712,29 @@ export default { .then((res) => { console.log("res at line 713:", res); if (res.code == 0) { - + } else { + this.$commonJS.showToast("评论失败"); } }); }, //交谈请求,获取回答 getTree(data) { - let result = []; - let map = {}; - data.forEach(item => { + let result = []; + let map = {}; + data.forEach((item) => { map[item.id] = item; - }); - data.forEach(item => { + }); + data.forEach((item) => { let parent = map[item.parentId]; if (parent) { - (parent.children || (parent.children = [])).push(item); + (parent.children || (parent.children = [])).push(item); } else { - result.push(item); + result.push(item); } - }); - return result; -}, + }); + return result; + }, getMedicalDetail(fn) { //清空消息记录 @@ -771,15 +756,11 @@ export default { this.articleInfo = res.article; this.commentData = res.comments; - res={ - "readNumer": 193, - "commentList": [] -} this.commentData = { - "readNumer": res.readNumer, - "commentSize": res.commentList.length, - "comment": this.getTree(res.commentList) -} + + commentSize: res.commentCount, + comment: this.getTree(this.commentData), + }; this.$forceUpdate(); // 滚动到最底部锚点 @@ -1360,21 +1341,22 @@ h3 { font-size: 24rpx; line-height: 28rpx; } -} .orderModalShow { - width: 100%; - // max-height: 48vh; - // padding-bottom: 120rpx; - } - - .popup_box { - padding: 20rpx; - - box-sizing: border-box; - .curriulum_title_box { - .title { - text-align: center; - font-size: 34rpx !important; - } +} +.orderModalShow { + width: 100%; + // max-height: 48vh; + // padding-bottom: 120rpx; +} + +.popup_box { + padding: 20rpx; + + box-sizing: border-box; + .curriulum_title_box { + .title { + text-align: center; + font-size: 34rpx !important; } } +} diff --git a/uni_modules/hb-comment/components/hb-comment/hb-comment.vue b/uni_modules/hb-comment/components/hb-comment/hb-comment.vue index 01bfd3f4..28159b84 100644 --- a/uni_modules/hb-comment/components/hb-comment/hb-comment.vue +++ b/uni_modules/hb-comment/components/hb-comment/hb-comment.vue @@ -13,21 +13,21 @@ - + @@ -36,56 +36,46 @@ - - - - - {{ item.nickName }} - - - {{ - item.likeNum == 0 ? "抢首赞" : item.likeNum - }} - - + {{ + item.user.nickname ? item.user.nickname : "普通用户" + }} - - {{ + + {{ item.content }} + + - {{ item.createTime }} 回复{{ item.createTime }} 回复 + @@ -93,7 +83,7 @@ @@ -101,50 +91,46 @@ - {{ each.nickName }} - - {{ - each.likeNum == 0 ? "抢首赞" : each.likeNum - }} - - - + {{ + each.user.nickname ? each.user.nickname : "普通用户" + }} - - {{ - each.content.length > 60 - ? each.content.slice(0, 59) - : each.content - }} - - {{ each.hasShowMore ? each.content.slice(59) : "..." }} - - {{ each.hasShowMore ? "收起" : "展开" }} - - + + {{ each.content }} - {{ each.createTime }} + {{ each.createTime }} 回复 - 删除 - + --> @@ -157,54 +143,70 @@ - - + - - - - - - - + + + 清空发送 + 写评论... + + + 取消发送 + +