This commit is contained in:
zhaofang
2022-07-29 11:16:29 +08:00
parent 86e2ddd95d
commit c47a660565
2 changed files with 13 additions and 8 deletions

View File

@@ -18,7 +18,7 @@
<view v-for="(comm,commidx) in list" :key="commidx" class="comment">
<view class="comment-top">
<view style="display: flex;">
<author :showInfo="true" :data="comm" ></author>
<author :showInfo="true" :data="comm"></author>
<!-- <author-info :avatar="comm.avatar" :name="comm.sysCreateBy"></author-info> -->
</view>
<view class="comment-time">
@@ -26,7 +26,7 @@
</view>
</view>
<view class="comment-body">
<view class="comment-content">{{comm.content}}</view>
<view class="comment-content" v-html="comm.content"></view>
<view class="comment-btns">
<view>
<u-icon @click="openInput(commidx)" name="chat" color="#979797" size="18" label="回复"></u-icon>
@@ -51,7 +51,7 @@
</view>
</view>
<view class="comment-body">
<view class="comment-content">{{reply.content}}</view>
<view class="comment-content" v-html="reply.content"></view>
<view class="comment-btns">
<view>
<u-icon @click="openInput(commidx,replyIdx)" name="chat" color="#979797" size="18" label="回复"></u-icon>
@@ -214,6 +214,7 @@
item.avatar='';
item.orgInfo='';
item.sex = null;
item.content = item.content.replace(/(\n){2,}/,'<br>');
allList.push(item);
ids.push(item.sysCreateAid);
if(item.replyList && item.replyList!=''){
@@ -221,6 +222,7 @@
reply.avatar='';
reply.orgInfo='';
reply.sex = null;
reply.content = reply.content.replace(/(\n){2,}/,'<br>');
allList.push(reply);
ids.push(reply.sysCreateAid);
})
@@ -333,6 +335,7 @@
this.inputValue='';
this.loadData()
// this.loadAuthorInfo([this.result],[res.result.sysCreateAid])
res.result.content = res.result.content.replace(/(\n){2,}/,'<br>');
this.list[this.curCommentIndex].replyList.push(res.result);
this.$refs.interactToast.show({message:'发布成功',type:'success'});
this.inputShow=false;

View File

@@ -107,7 +107,7 @@
</view>
<view class="comment-body">
<view class="comment-content" style="word-break: break-all;white-space: pre-wrap;">
{{ displayAll(row) }}
<text v-html="displayAll(row)"></text>
<text style="color: #00aaff; white-space: nowrap;" v-if="row.content.length>minTextLen" @click="changeIsAll(row)">{{row.isAll?' 收起':' 全文'}}</text>
</view>
<view class="comment-btns">
@@ -222,7 +222,6 @@ export default {
...mapGetters(['userInfo']),
placeholder(){
let txt='请写下您的答案(200字以内),可以@提问者哦~';
console.log(this.curItem.clevel,'this.curItem.clevel');
if(this.curItem && this.curItem.id){
//if(this.curItem.clevel>1){
txt='请写下您的回复(200字以内)';
@@ -381,6 +380,9 @@ export default {
}
},
displayAll(item) {
let content = '';
content = item.content.replace(/(\n){2,}/,'<br>');
item.content = content;
if(!item.isAll && item.content.length > this.minTextLen) {
return item.content.slice(0, this.minTextLen) + "...";
}
@@ -454,7 +456,7 @@ export default {
// answercontent=this.answercontent.slice(this.detailData.sysCreateBy.length+1)
// }
else{
answercontent=this.answercontent
answercontent=this.answercontent.trim()
}
apiQa.saveAnswer({
qid: this.questionId,
@@ -554,7 +556,7 @@ export default {
let d={
id:this.curItem.id,
sysCreateAid:this.curItem.sysCreateAid,
content:this.curItem.content
content:this.curItem.content.trim()
}
apiQa.updateAnswer(d).then(rs=>{
if(rs.status==200){
@@ -597,7 +599,7 @@ export default {
let postData={
replayAid: this.curItem.sysCreateAid,
replayName: this.curItem.sysCreateBy,
content: this.answercontent,
content: this.answercontent.trim(),
parentId: this.curItem.id,
commentId: "",
clevel: 2