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

@@ -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