|
@@ -15,10 +15,10 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="list-commnet-box" v-if="info.comment_list.length>0">
|
|
|
- <view class="item" v-for="(item,index) in info.comment_list" :key="index">
|
|
|
+ <template class="item" v-for="(item,index) in info.comment_list" >
|
|
|
<image class="avatar" :src="item.qa_avatar_url" mode="aspectFill" lazy-load="false" :key="index"/>
|
|
|
<text :key="index">{{item.comment}}</text>
|
|
|
- </view>
|
|
|
+ </template>
|
|
|
|
|
|
</view>
|
|
|
|
|
@@ -70,7 +70,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import {apiSetLike,apiHotComment,apiMyComment} from '@/api/question'
|
|
|
+import {apiSetLike,apiHotComment,apiMyComment,apiPublishComment,apiDelComment} from '@/api/question'
|
|
|
export default {
|
|
|
props:{
|
|
|
videoInfo:null
|
|
@@ -143,11 +143,12 @@ export default {
|
|
|
qa_avatar_url:item.qa_avatar_url
|
|
|
}
|
|
|
})
|
|
|
+ this.info.comment_total=arr.length
|
|
|
}
|
|
|
},
|
|
|
|
|
|
//删除我的评论
|
|
|
- delCommentHandle(){
|
|
|
+ delCommentHandle({community_question_comment_id},index){
|
|
|
wx.showModal({
|
|
|
title: "",
|
|
|
content: "评论删除后不可恢复,确认删除吗?",
|
|
@@ -155,14 +156,14 @@ export default {
|
|
|
cancelColor: '#333',
|
|
|
success: async(res) => {
|
|
|
if( res.cancel) return
|
|
|
- // const { code } = await apiDelComment({ community_question_comment_id });
|
|
|
- // if( code !== 200 ) return
|
|
|
+ const { code } = await apiDelComment({ community_question_comment_id });
|
|
|
+ if( code !== 200 ) return
|
|
|
|
|
|
- // this.commentList.splice(index,1)
|
|
|
- // this.comment_obj.total--
|
|
|
+ this.commentList.splice(index,1)
|
|
|
+ this.comment_obj.total--
|
|
|
|
|
|
- // wx.showToast({title: '删除成功'});
|
|
|
- // this.refreshPage()
|
|
|
+ wx.showToast({title: '删除成功'});
|
|
|
+ this.getComment('refresh')
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -237,7 +238,7 @@ export default {
|
|
|
margin-top: 34rpx;
|
|
|
background-color: #F9F9F9;
|
|
|
padding: 20rpx;
|
|
|
- .item{
|
|
|
+ // .item{
|
|
|
color: #666;
|
|
|
font-size: 28rpx;
|
|
|
.avatar{
|
|
@@ -252,7 +253,7 @@ export default {
|
|
|
line-height: 56rpx;
|
|
|
margin-right: 20rpx;
|
|
|
}
|
|
|
- }
|
|
|
+ // }
|
|
|
}
|
|
|
.comment-cont {
|
|
|
height: calc(100vh - 250rpx);
|