From 285536c73942691b956698aa6e96d76a5fd60079 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=A7=8B=E4=BA=8E=E5=88=9D=E8=A7=81?= <752204717@qq.com>
Date: Mon, 11 Aug 2025 17:47:51 +0800
Subject: [PATCH] tijiao
---
pages/articleList/article.vue | 182 +++++-----
.../components/hb-comment/hb-comment.vue | 328 ++++++++++--------
2 files changed, 256 insertions(+), 254 deletions(-)
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 @@
点赞
-
@@ -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 @@