This commit is contained in:
zhaofang
2022-11-14 18:28:25 +08:00
parent e4a1862d6f
commit 56bcfe91ea
2 changed files with 49 additions and 33 deletions

View File

@@ -22,7 +22,7 @@
<view style="display: flex;line-height: 40upx;">
<author-info :name="detailData.sysCreateBy" :avatar="detailData.avatar" :sex="detailData.sex" :info="detailData.ucode" :showInfo="true"></author-info>
</view>
<view class="concern" v-if="hasFollow" @click="followShow = true">
<view class="concern" style="color: #979797;" v-if="hasFollow" @click="followShow = true">
已关注
</view>
<view class="concern" v-else @click="addFollow()">
@@ -41,7 +41,7 @@
<view>
<view class="comments">
<view class="comments-top">
<view v-if="detailData.id">回答<text style="color: #818181;margin-left: 5px;">{{ answers }}</text></view>
<view v-if="detailData.id">回答<text style="color: #333333;margin-left: 5px;">({{ answers }})</text></view>
<!-- <view class="share-btn" @click="openShare">
<view class="share-btn-icon"><img src="../../static/images/icon/share.png" alt="" /></view>
<view class="share-btn-name">分享</view>
@@ -52,14 +52,16 @@
<view v-for="(an, anidx) in answerList" :key="anidx" class="comment">
<view class="comment-top">
<view style="display: flex;">
<author v-if="an" :showInfo="true" :data="an"></author>
<!-- {{an}} -->
<author-img :avatar="an.avatar" :sex="an.sex" width="30px" height="30px" :size="30"></author-img>
<text style="color: #333333;font-weight: 500;font-size: 28upx;margin-left: 22upx;">{{an.sysCreateBy}}</text>
</view>
<view class="comment-time">
<view style="display: flex;">
<view>
<view v-if="detailData.isResolve">
<text v-if="an.isBest" style="color:#FFB30F;">最佳答案</text>
</view>
<view style="margin-left: 10px"><time-show :time="an.sysCreateTime"></time-show></view>
</view>
</view>
</view>
@@ -69,17 +71,32 @@
<text style="color: #00aaff;word-break: normal; " v-if="an.content.length>minTextLen" @click="changeIsAll(an)">{{an.isAll?' 收起':' 全文'}}</text>
</view>
<view class="comment-btns">
<view style="display: flex;">
<view style="margin-left: 10px"><time-show :time="an.sysCreateTime"></time-show></view>
<view class="" style="display: flex;">
<view style="font-size: 12px;color: #999999;line-height: 50upx;" @click="openReply(an,{})">
<image style="width: 32upx;height: 32upx;vertical-align: middle;margin-right: 10upx;" src="../../static/images/icon/bar-comment.png" size="24"></image>回复
</view>
<view v-if="!an.isPraise" style="font-size: 12px;color: #999999;line-height: 50upx;margin-left: 40upx;" @click="addPraise(anidx)">
<image style="width: 32upx;height: 32upx;vertical-align: middle;margin-right: 10upx;" src="../../static/images/icon/bar-praise.png" size="24"></image>
<text> {{an.praises}}</text>
</view>
<view v-if="an.isPraise" style="font-size: 12px;color: #999999;line-height: 50upx;margin-left: 40upx;" @click="removePraise(anidx)">
<image style="width: 32upx;height: 32upx;vertical-align: middle;margin-right: 10upx;" src="../../static/images/icon/bar-praise-active.png" size="24"></image>
<text style="color: #387DF7;"> {{an.praises}}</text>
</view>
<!-- <interact-bar :data="comm" :comments="false" :favorites="false"></interact-bar> -->
</view>
<!-- <view style="display: flex;">
<u-icon style="margin-right: 15px;" @click="openReply(an,{})" name="chat" color="#979797" size="18" label="回复"></u-icon>
<u-icon v-if="an.isPraise" style="margin-right: 10px;" @click="removePraise(anidx)" name="thumb-up-fill" color="#979797" size="18" :label="an.praises"></u-icon>
<u-icon v-if="!an.isPraise" style="margin-right: 10px;" @click="addPraise(anidx)" name="thumb-up" color="#979797" size="18" :label="an.praises"></u-icon>
</view>
<view>
</view> -->
<!-- <view>
<u-icon v-if="userInfo.aid==an.sysCreateAid" @click="openBtns(an,anidx)" name="more-dot-fill" size="20"></u-icon>
</view>
</view> -->
</view>
<!--一级评论二级数据-->
<view v-if="an.answers && an.answers.length!=0" class="comment-replys">
<view v-if="an.answers && an.answers.length!=0" class="comment-replys" style="margin-left: 60upx;">
<view v-for="(ele, replyIndex) in an.answers" :key="replyIndex" class="comment">
<view class="comment-top">
<view style="display: flex;">
@@ -150,24 +167,22 @@
</view>
</interact-fixed>
<!--弹出回答的窗口-->
<u-popup :show="replyShow" @close="closeReply">
<u-popup :show="replyShow" @close="closeReply" :round="16">
<view>
<view style="display: flex;justify-content: space-around;">
<view style="padding: 20rpx;flex: 1; white-space: pre-wrap; word-break: break-all;">
<u--textarea :height="120" v-model="answercontent" :placeholder="placeholder" count maxlength="200"></u--textarea>
<view>
<view style="padding: 40rpx;flex: 1; white-space: pre-wrap; word-break: break-all;">
<u--textarea style="border: none;background: #F4F4F4;" :height="50" v-model="answercontent" :placeholder="placeholder" count maxlength="200"></u--textarea>
</view>
<view style="padding: 20px 10px">
<view style="line-height: 82upx;text-align: center;margin-bottom: 20upx" @click="askQuestioner">
<text v-if="replyLevel=='one'">@</text>
</view>
<u-button style="height: 60px;" @click="submitReply" type="primary" size="small" :text="replyLevel=='one'? '提交回答':'提交回复'"></u-button>
<view style="padding: 0 10px 40upx 0;text-align: right;">
<text v-if="replyLevel=='one'" @click="askQuestioner">@</text>
<u-button style="padding: 10upx 30upx;height: 52upx;background: #87B3FF;border-color: #87B3FF;margin: 0 40upx 0 40upx;" @click="submitReply" type="primary" size="small" :text="replyLevel=='one'? '提交回答':'提交回复'"></u-button>
</view>
</view>
</view>
</u-popup>
<u-popup :show="answerEdit.show" @close="closeAnswerEdit" @open="openAnswerEdit">
<u-popup :show="answerEdit.show" @close="closeAnswerEdit" @open="openAnswerEdit" :round="16">
<view>
<view style="display: flex;justify-content: space-around;">
<view>
<view style="padding: 20rpx;flex: 1;">
<u--textarea :height="120" v-model="curItem.content" placeholder="请输入5-1000个字" count maxlength="1000"></u--textarea>
</view>
@@ -353,11 +368,11 @@ export default {
if(rs.status==200){
if(rs.result!='' && rs.result.length>0){
let author=rs.result[0];
if(author.avatar != '') {
res.result.avatar=$this.fileUrl+author.avatar;
} else {
res.result.avatar='';
}
// if(author.avatar != '') {
// res.result.avatar=$this.fileUrl+author.avatar;
// } else {
// res.result.avatar='';
// }
res.result.sex = author.sex;
res.result.orgInfo=author.orgInfo;
res.result.ucode=author.code;
@@ -561,9 +576,9 @@ export default {
list.forEach(item=>{
res.result.some(author=>{
if(author.aid==item.sysCreateAid){
if(author.avatar!=''){
item.avatar=$this.fileUrl+author.avatar;
}
// if(author.avatar!=''){
// item.avatar=$this.fileUrl+author.avatar;
// }
item.sex=author.sex;
item.ucode=author.code;
item.orgInfo=author.orgInfo;
@@ -885,8 +900,9 @@ export default {
.comments-top {
display: flex;
justify-content: space-between;
padding-bottom: 30upx;
border-bottom: 1px solid #f4f4f4;
padding-top: 20upx;
// padding-bottom: 30upx;
// border-bottom: 1px solid #f4f4f4;
font-weight: 500;
font-size: 30upx;
}
@@ -924,13 +940,13 @@ export default {
}
}
.comment-body{
padding: 6upx 0upx 0upx 60upx;
padding: 14upx 0upx 0upx 0;
color: #373737;
.comment-content{
word-break:break-all;
padding: 0upx 10upx 10upx 0upx;
font-size: 28upx;
color: #333333;
color: #666666;
}
.comment-btns{
display: flex;