|
|
@@ -27,13 +27,26 @@
|
|
|
</swiper-item>
|
|
|
</swiper>
|
|
|
</view>
|
|
|
- <view class="box-border-box bz-box bgc-f b-b-F9F9F9 mt-24">
|
|
|
+ <view class="box-border-box bz-box bgc-f b-b-F9F9F9 mt-24 mb-32">
|
|
|
<view class="fs-30 fw-600 mb-32">{{obj.content||''}}</view>
|
|
|
<view class="card-4 flex-wrap-wrap">
|
|
|
- <view class="">{{obj.school_name||''}}</view>
|
|
|
- <view class="">{{obj.topic_name||''}}</view>
|
|
|
+ <view class="label-box align-items-center mr-20 b-rad-200 bgc-F2F2F2">
|
|
|
+ <image class="wz mr-8" src="@/static/img/my/wz-two.png" mode=""></image>
|
|
|
+ <view class="fs-24 fc-9">
|
|
|
+ {{obj.school_name||''}}
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="label-box align-items-center b-rad-200 bgc-F2F2F2">
|
|
|
+ <image class="wz mr-8" src="@/static/img/my/ht.png" mode=""></image>
|
|
|
+ <view class="fs-24 fc-9">
|
|
|
+ {{obj.topic_name||''}}
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
+ <view class="fs-32 fc-3 fw-600 mb-16 plr-32 box-border-box">
|
|
|
+ 评论<text class="fs-24 fc-9">({{list.length}})</text>
|
|
|
+ </view>
|
|
|
<view v-if="list.length == 0" class="scroll-view-css">
|
|
|
<EnBlank :customSrc='true'>
|
|
|
<template v-slot:blankImg>
|
|
|
@@ -52,7 +65,7 @@
|
|
|
{{item.nickname}}
|
|
|
<span v-if="item.is_author == 1"
|
|
|
class='only-box text-align-center fs-24 fc-41ABF5 ml-10'>作者</span>
|
|
|
- <view class="ml-10" v-if="item.is_self == 1" @click="delInfo(item)">
|
|
|
+ <view class="ml-10" v-if="item.is_self == 1" @click="delInfo(item, i, 1, i)">
|
|
|
<uni-icons type="trash" size="18"></uni-icons>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -65,13 +78,14 @@
|
|
|
<uni-icons type="hand-up" size="20"
|
|
|
:color="item.is_like==1?'#FD5C02':'#999'"></uni-icons>
|
|
|
<view class="fs-24 fw-400 mt-5" :class="item.is_like==1?'fc-FD5C02':'fc-9'">
|
|
|
- {{item.like}}</view>
|
|
|
+ {{item.like}}
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view v-if="item.isOpen" class="fs-24 fc-6 text-align-center mb-12"
|
|
|
@click="openReply(1,item)">展开更多评论</view>
|
|
|
<!-- 回复 -->
|
|
|
- <view class="mb-16" v-if="item.replyList.length > 0">
|
|
|
+ <view class="mb-16" v-if="item.count > 0">
|
|
|
<view class="list-box flex-justify-space" v-for="(info,index) in item.replyList"
|
|
|
:key="index">
|
|
|
<image class="list-box-img" src="@/static/img/my/bg.png" mode="scaleToFill"></image>
|
|
|
@@ -79,14 +93,17 @@
|
|
|
<view class=" flex-justify-space">
|
|
|
<view class=" b-b-F9F9F9 mr-20">
|
|
|
<view class="fs-28 fw-400 fc-9 mb-8 align-items-center">
|
|
|
- {{info.nickname}}
|
|
|
+ <view class="">
|
|
|
+ {{info.nickname}}
|
|
|
+ </view>
|
|
|
<span v-if="info.is_author == 1"
|
|
|
class='only-box text-align-center fs-24 fc-41ABF5 ml-10'>作者</span>
|
|
|
- <view class="ml-10" v-if="info.is_self == 1" @click="delInfo(info)">
|
|
|
+ <view class="ml-10" v-if="info.is_self == 1"
|
|
|
+ @click="delInfo(info, index, 2 ,i)">
|
|
|
<uni-icons type="trash" size="18"></uni-icons>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="fs-30 fw-400 mb-8" @click.stop="openInput(2,info)">
|
|
|
+ <view class="fs-30 fw-400 mb-8" @click.stop="openInput(2,info,index)">
|
|
|
{{info.content}}
|
|
|
</view>
|
|
|
<view class="fs-24 fw-400 fc-9 mb-8">{{info.created_date}}</view>
|
|
|
@@ -100,7 +117,7 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view v-if="item.replyList.length < item.count"
|
|
|
+ <view v-if="item.replyList.length < item.count && item.count > 10"
|
|
|
class="fs-24 fc-6 text-align-center mb-12" @click="openReply(2,item)">展开更多评论</view>
|
|
|
</view>
|
|
|
|
|
|
@@ -113,7 +130,8 @@
|
|
|
|
|
|
<view class="card-5 align-items-center flex-justify-space box-border-box boder-b-t">
|
|
|
<!-- <view class="input-box-box fs-28 fc-9 mr-20" @click.stop="openInput(0,'')">友善评论,文明发言</view> -->
|
|
|
- <input class="fs-input" :focus='focus' v-model="msgData.content" @click.stop="openInput(0,'')" type="text" @focus='inputFocus(true)' @blur='inputFocus(false)'/>
|
|
|
+ <input class="fs-input" :focus='focus' v-model="msgData.content" @click.stop="openInput(0,'')" type="text"
|
|
|
+ @focus='inputFocus(true)' @blur='inputFocus(false)' />
|
|
|
<view class="display-flex" v-if="!inputRightType">
|
|
|
<view class="align-items-center mr-20" @click.stop="handUp(1,obj)">
|
|
|
<uni-icons type="hand-up" size="22" :color="obj.is_like==1?'#FD5C02':'#999'"></uni-icons>
|
|
|
@@ -211,7 +229,9 @@
|
|
|
news_id: '',
|
|
|
content: '',
|
|
|
},
|
|
|
- focus: false
|
|
|
+ focus: false,
|
|
|
+ msgType: 0, // 消息类型
|
|
|
+ msgIndex: 0, // 列表一级索引
|
|
|
}
|
|
|
},
|
|
|
onLoad(e) {
|
|
|
@@ -223,7 +243,7 @@
|
|
|
methods: {
|
|
|
inputFocus(type) {
|
|
|
this.inputRightType = type
|
|
|
- if(!type) {
|
|
|
+ if (!type) {
|
|
|
this.focus = false
|
|
|
}
|
|
|
this.$forceUpdate()
|
|
|
@@ -339,8 +359,9 @@
|
|
|
tools.error(res.msg);
|
|
|
}
|
|
|
},
|
|
|
-
|
|
|
- openInput(type, item) {
|
|
|
+ openInput(type, item, index) {
|
|
|
+ this.msgIndex = index
|
|
|
+ this.msgType = type
|
|
|
if (type == 0) {
|
|
|
this.msgData.remark_id = 0;
|
|
|
} else if (type == 1) {
|
|
|
@@ -370,9 +391,29 @@
|
|
|
setTimeout(() => {
|
|
|
this.isAJAX = false;
|
|
|
this.closeInput()
|
|
|
- this.list = [];
|
|
|
- this.page = 1;
|
|
|
- this.getList();
|
|
|
+ if (this.msgType == 0) {
|
|
|
+ this.list.unshift(res.data)
|
|
|
+ } else if (this.msgType == 1) {
|
|
|
+ let replyList = []
|
|
|
+ this.list[this.msgIndex].count += 1
|
|
|
+ if (this.list[this.msgIndex].replyList) {
|
|
|
+ this.list[this.msgIndex].replyList.unshift(res.data)
|
|
|
+ } else {
|
|
|
+ this.list[this.msgIndex].replyList = replyList
|
|
|
+ this.list[this.msgIndex].replyList.unshift(res.data)
|
|
|
+ }
|
|
|
+ console.log(this.list[this.msgIndex], '############');
|
|
|
+ // this.$forceUpdate()
|
|
|
+ } else {
|
|
|
+ this.list[this.msgIndex].count += 1
|
|
|
+ this.list[this.msgIndex].replyList.push(res.data)
|
|
|
+ }
|
|
|
+ this.$forceUpdate()
|
|
|
+ this.msgIndex = 0
|
|
|
+ this.msgType = 0
|
|
|
+ // this.list = [];
|
|
|
+ // this.page = 1;
|
|
|
+ // this.getList();
|
|
|
}, 1500)
|
|
|
} else {
|
|
|
this.isAJAX = false;
|
|
|
@@ -380,9 +421,7 @@
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
-
|
|
|
-
|
|
|
- delInfo(item) {
|
|
|
+ delInfo(item, index, type, i) {
|
|
|
if (this.isAJAX) {
|
|
|
return
|
|
|
}
|
|
|
@@ -394,9 +433,16 @@
|
|
|
tools.success('删除成功')
|
|
|
setTimeout(() => {
|
|
|
this.isAJAX = false;
|
|
|
- this.list = [];
|
|
|
- this.page = 1;
|
|
|
- this.getList();
|
|
|
+ console.log();
|
|
|
+ this.list[i].count -= 1
|
|
|
+ if (type == 1) {
|
|
|
+ this.list.splice(index, 1)
|
|
|
+ } else {
|
|
|
+ this.list[i].replyList.splice(index, 1)
|
|
|
+ }
|
|
|
+ // this.list = [];
|
|
|
+ // this.page = 1;
|
|
|
+ // this.getList();
|
|
|
}, 1500)
|
|
|
} else {
|
|
|
this.isAJAX = false;
|
|
|
@@ -440,7 +486,18 @@
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
- .fs-input{
|
|
|
+ .label-box {
|
|
|
+ padding: 0 12rpx;
|
|
|
+ height: 38rpx;
|
|
|
+ line-height: 38rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .wz {
|
|
|
+ width: 32rpx;
|
|
|
+ height: 32rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .fs-input {
|
|
|
flex: 1;
|
|
|
margin: 0 32rpx 0 0;
|
|
|
height: 72rpx;
|
|
|
@@ -450,10 +507,12 @@
|
|
|
box-sizing: border-box;
|
|
|
padding: 0 24rpx;
|
|
|
}
|
|
|
- .wh64{
|
|
|
+
|
|
|
+ .wh64 {
|
|
|
width: 68rpx;
|
|
|
height: 68rpx;
|
|
|
}
|
|
|
+
|
|
|
.input-box-box {
|
|
|
width: 436rpx;
|
|
|
height: 72rpx;
|
|
|
@@ -520,15 +579,15 @@
|
|
|
padding: 0 32rpx 20rpx 32rpx;
|
|
|
|
|
|
.card-4 {
|
|
|
- view {
|
|
|
- padding: 4rpx 16rpx;
|
|
|
- background: #F2F2F2;
|
|
|
- border-radius: 200rpx;
|
|
|
- font-size: 24rpx;
|
|
|
- color: #999;
|
|
|
- margin-right: 20rpx;
|
|
|
- margin-bottom: 10rpx;
|
|
|
- }
|
|
|
+ // view {
|
|
|
+ // padding: 4rpx 16rpx;
|
|
|
+ // background: #F2F2F2;
|
|
|
+ // border-radius: 200rpx;
|
|
|
+ // font-size: 24rpx;
|
|
|
+ // color: #999;
|
|
|
+ // margin-right: 20rpx;
|
|
|
+ // margin-bottom: 10rpx;
|
|
|
+ // }
|
|
|
}
|
|
|
}
|
|
|
|