123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312 |
- <template>
- <view class="content">
-
- <u-popup :closeable='true' :round="10" :show="popupShow" @close="close" @open="open">
- <view class="popupTitle">回复评论</view>
- <view class="popupView">
- <view class="scrollview">
-
- <view class="one_comment_box">
- <view class="comment">
- <view class="photo">
- <u--image shape="circle" width="48rpx" height="48rpx" :src="popupData.authorLogo" ></u--image>
- </view>
- <view class="rc_1" >{{popupData.authorName || '未知用户'}}</view>
- </view>
- <view class="comment">
- <view class="rc_3" >{{popupData.content}}</view>
- </view>
- <view class="comment_foot">
- <view class="rc_2" @click="toReply(popupData,2)">{{popupData.createTime + ' 回复 '}}</view>
- </view>
- </view>
-
- <u-line margin='10rpx 0' color="#e4e7ed" />
- <view v-for="(item2,index) in popupData.floorList" :key="index">
- <view :class="item2.citeAuthorName?'one_recomment_box':'one_comment_box'">
- <view class="comment">
- <view class="photo">
- <u--image shape="circle" width="48rpx" height="48rpx" :src="item2.authorLogo" ></u--image>
- </view>
- <view class="rc_1">{{item2.authorName || '未知用户'}}</view>
- </view>
- <view class="comment">
- <view class="rc_3" >
- <text v-if="item2.citeAuthorName">{{ '@'+ item2.citeAuthorName + '回复:' }}</text>
- {{item2.content}}
- </view>
- </view>
- <view class="comment_foot">
- <view class="rc_2" @click="toReply(item2,3)">{{item2.createTime + ' 回复 '}}</view>
- <view class="flex" @click="setQalike(item2)" style="align-items: center;">
- <u--image v-if="item2.isLike == '1'" shape="circle" width="48rpx" height="48rpx" src="/static/myinfo/icomx_dianzan1.png" ></u--image>
- <u--image v-else shape="circle" width="48rpx" height="48rpx" src="/static/myinfo/icomx_dianzan.png" ></u--image>
- <text style="margin-left: 8rpx;color: #666666;">{{ item2.likesCount }}</text>
- </view>
- </view>
- </view>
- </view>
- </view>
- </view>
-
- <view class="btnflex">
- <view class="commentInput" >
- <u-input :placeholder="popupPlaceholder" v-model="inputValue2" :auto-height="true" type="text" />
- </view>
- <view class="btn" @click="submit2">
- 提交
- </view>
- </view>
- </u-popup>
- </view>
- </template>
- <script>
- import {Qalike,QareplyPage,Qareplybyid} from '@/http/api/common.js'
- import * as util from '@/pages/util/util.js'
- export default {
- options: { styleIsolation: 'shared' },
- props: {
- showComment: {
- type: Boolean,
- default: false,
- },
- CommentData: {
- type: Object,
- default: null,
- },
-
- },
- watch:{
- showComment: {
- immediate: true,
- handler(val) {
-
- this.popupShow = val
- },
- },
- CommentData: {
- immediate: true,
- handler(val) {
-
- this.popupData = val
- },
- },
- },
- data() {
- return {
- popupShow:false,
- show:false,
- inputValue:'',
- inputValue2:'',
- num:999,
- popupData:{
- authorName:'',
- createTime:'',
- content:'',
- authorLogo:'',
- floorList:[]
- },
- dataList:[],
- curNow:0,
- popupPlaceholder:'点击输入评论',
- pageNum:1,
- pageSize:2,
- jiazaitext:'加载更多',
- replyType:2,
- replyId:''
- }
- },
- onReachBottom() {
- },
- methods: {
- async setQalike(item){
- let res = await Qalike(item.id)
- if (item.isLike == '1') {
- item.isLike = '2'
- item.likesCount = item.likesCount - 1
- }else{
- item.isLike = '1'
- item.likesCount = item.likesCount + 1
- }
- },
- async getTopicReply(){
- let res = await QareplyPage({
- pageNum:1,
- pageSize:100,
- floorId:item.id,
- topicId:item.topicId,
- })
-
- this.CommentData = {
- ...item,
- floorList:res.data.data.rows || []
- }
- },
- async submit2(){
-
- let res = await Qareplybyid({
- floorId:this.popupData.id,
- content:this.inputValue2,
- replyId:this.replyId,
- replyType:this.replyType,
- },this.popupData.topicId)
- if (res.data.code == 200) {
- util.toastFunc('回复成功')
- this.inputValue2 = ''
-
- this.pageNum = 1
- this.dataList = []
-
- this.getTopicReply()
- this.$emit('initDatalist')
- }
- },
- open() {
-
- },
- close() {
-
- this.$emit('closeComment')
- },
- toReply(item,type){
-
- console.log(item);
- this.replyType = type
- if (type == 3) {
- this.replyId = item.id
- }else{
- this.replyId = ''
- }
- this.popupPlaceholder = `对${item.authorName}回复`
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .content{
- width: 750rpx;
- position: fixed;
- bottom: 0;
- z-index: 100;
- }
- .comment{
- display: flex;
- width: 700rpx;
-
- margin-top: 10rpx;
- }
- .right_content{
- width: 598rpx;
- margin-left: 26rpx;
- }
- .rc_1{
- width: 500rpx;
- height: 50rpx;
- font-size: 28rpx;
- font-weight: 400;
- color: #666666;
- word-break: break-all;
- text-overflow: ellipsis;
- overflow: hidden;
- line-height: 50rpx;
- margin-left: 16rpx;
- }
- .rc_2{
- width: 500rpx;
- height: 50rpx;
- font-size: 28rpx;
- font-weight: 400;
- color: #999999;
- line-height: 40rpx;
- }
- .rc_3{
- max-width: 660rpx;
- font-size: 32rpx;
- font-weight: 500;
- color: #333333;
- line-height: 48rpx;
- margin-bottom: 24rpx;
- }
- .btn{
- width: 150rpx;
- height: 70rpx;
- margin-left: 20rpx;
- border-radius: 40rpx;
- background: #46a6ff;
- text-align: center;
- line-height: 70rpx;
- font-size: 28rpx;
- color: #fff;
- }
- .popupTitle{
- width: 140rpx;
- height: 45rpx;
- line-height: 45rpx;
- font-size: 32rpx;
- font-family: PingFang SC, PingFang SC-Bold;
- font-weight: 700;
- text-align: left;
- color: #333333;
- margin: 30rpx;
- }
- .popupView{
- height: 1000rpx;
- display: flex;
- padding-top: 10rpx;
- flex-direction: column;
- align-items: center;
- }
- .scrollview{
- height: 900rpx;
- overflow: auto;
- }
- .btnflex{
- display: flex;
- flex-direction: row;
- align-items: center;
- position: fixed;
- bottom: 0;
- left: 0;
- width: 750rpx;
- height: 100rpx;
- background: #ffffff;
- }
- .commentInput{
- width: 520rpx;
- background: #EEEEEE;
- border-radius: 40rpx 40rpx 40rpx 40rpx;
- margin-left: 30rpx;
- }
- .loadmore{
- height:200rpx;
- text-align: center;
- font-size: 28rpx;
- font-weight: 400;
- color: #999;
- padding-top: 24rpx;
- }
- .commentInput{
- background: #EEEEEE;
- border-radius: 40rpx 40rpx 40rpx 40rpx;
- }
- .one_recomment_box{
- width: 660rpx;
- background: #f6f6f6;
- margin: 0 auto;
- padding: 20rpx;
- }
- .one_comment_box{
- margin: 0 auto;
- padding: 10rpx;
- }
- .comment_foot{
- display: flex;
- justify-content: space-between;
- }
- </style>
-
|