|
|
@@ -19,8 +19,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
- <scroll-view scroll-y="true" class="scroll-view-css">
|
|
|
- <view class="scroll-view-css">
|
|
|
+ <scroll-view scroll-y="true" class="scroll-view-css" @scrolltolower="scrolltolower">
|
|
|
+
|
|
|
<view class="box-border-box mb-26" v-if="obj.image.length > 0">
|
|
|
<swiper class="swiper mb-32 " circular indicator-dots indicator-active-color="#4FB3EF" :autoplay="true" :interval="3000" :duration="500">
|
|
|
<swiper-item v-for="(item,i) in obj.image" :key="i">
|
|
|
@@ -48,9 +48,9 @@
|
|
|
<view class=" box-border-box plr-24">
|
|
|
<view class="list-box flex-justify-space" v-for="(item,i) in list" :key="i">
|
|
|
<image class="list-box-img" src="@/static/img/my/bg.png" mode="scaleToFill"></image>
|
|
|
- <view class="flex-1">
|
|
|
+ <view class="flex-1 p-b-20">
|
|
|
<view class=" flex-justify-space">
|
|
|
- <view class="p-b-20 b-b-F9F9F9 mr-20">
|
|
|
+ <view class=" b-b-F9F9F9 mr-20">
|
|
|
<view class="fs-28 fw-400 fc-9 mb-8 align-items-center">
|
|
|
{{item.nickname}}
|
|
|
<span v-if="item.is_author == 1" class='only-box text-align-center fs-24 fc-41ABF5 ml-10'>作者</span>
|
|
|
@@ -69,64 +69,89 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
- <view v-if="item.isOpen" class="fs-24 fc-6 text-align-center mb-12" @click="openReply(1,item,i)">展开更多评论</view>
|
|
|
+ <view v-if="item.isOpen" class="fs-24 fc-6 text-align-center mb-12" @click="openReply(1,item)">展开更多评论</view>
|
|
|
|
|
|
- <!-- <view class="list-box flex-justify-space" v-for="(info,index) in 5" :key="index">
|
|
|
- <image class="list-box-img" src="@/static/img/my/bg.png" mode="scaleToFill"></image>
|
|
|
- <view class="flex-1">
|
|
|
- <view class=" flex-justify-space">
|
|
|
- <view class="p-b-20 b-b-F9F9F9 mr-20">
|
|
|
- <view class="fs-28 fw-400 fc-9 mb-8">
|
|
|
- 最佳损友最佳损友
|
|
|
- <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)">
|
|
|
- <uni-icons type="trash" size="18"></uni-icons>
|
|
|
+ <!-- 回复 -->
|
|
|
+ <view class="mb-16" v-if="item.replyList.length > 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>
|
|
|
+ <view class="flex-1">
|
|
|
+ <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}}
|
|
|
+ <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)">
|
|
|
+ <uni-icons type="trash" size="18"></uni-icons>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="fs-30 fw-400 mb-8" @click.stop="openInput(2,info)">
|
|
|
+ {{info.content}}
|
|
|
</view>
|
|
|
+ <view class="fs-24 fw-400 fc-9 mb-8">{{info.created_date}}</view>
|
|
|
</view>
|
|
|
- <view class="fs-30 fw-400 mb-8" @click="openInput()">
|
|
|
- 回关一下啊,这么近这么近这么近这么近这么近这么近
|
|
|
+ <view class="display-flex" @click.stop="handUp(2,info)">
|
|
|
+ <uni-icons type="hand-up" size="20" :color="info.is_like==1?'#FD5C02':'#999'"></uni-icons>
|
|
|
+ <view class="fs-24 fw-400 mt-5" :class="info.is_like==1?'fc-FD5C02':'fc-9'">{{info.like}}</view>
|
|
|
</view>
|
|
|
- <view class="fs-24 fw-400 fc-9 mb-8">2021-04-17 15:53</view>
|
|
|
- </view>
|
|
|
- <view class="display-flex">
|
|
|
- <uni-icons type="hand-up" size="20" color="#999"></uni-icons>
|
|
|
- <view class="fs-24 fw-400 fc-9 mt-5">11</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- </view> -->
|
|
|
+ <view v-if="item.replyList.length < item.count" class="fs-24 fc-6 text-align-center mb-12" @click="openReply(2,item)">展开更多评论</view>
|
|
|
+ </view>
|
|
|
+
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- </view>
|
|
|
+
|
|
|
</scroll-view>
|
|
|
|
|
|
- <view class="card-5 flex-justify-space box-border-box ">
|
|
|
- <view class="align-items-center"></view>
|
|
|
- <view class="align-items-center" @click.stop="handUp(1,obj)">
|
|
|
- <uni-icons type="hand-up" size="22" :color="obj.is_like==1?'#FD5C02':'#999'"></uni-icons>
|
|
|
- <view class="fs-24 " :class="obj.is_like==1?'fc-FD5C02':'fc-9'">{{obj.like}}</view>
|
|
|
- </view>
|
|
|
- <view class="align-items-center" @click.stop="openInput(0,item)">
|
|
|
- <image src="@/static/img/school/info.png" mode=""></image>
|
|
|
- <view class="fs-24 fc-9">{{obj.remark}}</view>
|
|
|
+ <view class="card-5 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>
|
|
|
+ <view class="flex-1 display-flex">
|
|
|
+ <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>
|
|
|
+ <view class="fs-24 " :class="obj.is_like==1?'fc-FD5C02':'fc-9'">{{obj.like}}</view>
|
|
|
+ </view>
|
|
|
+ <view class="align-items-center" @click.stop="openRepot(obj)">
|
|
|
+ <image src="@/static/img/school/info.png" mode=""></image>
|
|
|
+ <view class="fs-24 fc-9">举报</view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
+
|
|
|
</view>
|
|
|
|
|
|
<uni-popup ref="popup" type="bottom">
|
|
|
<view class="pop-input">
|
|
|
<view class="head-pop flex-justify-space align-items-center mb-24 box-border-box p-24">
|
|
|
- <uni-icons @click="closeInput()" type="closeempty" size="24"></uni-icons>
|
|
|
+ <view class="fs-28 fw-600 fc-41ABF5"></view>
|
|
|
<view class="fs-36 fc-0 fw-600">评论</view>
|
|
|
- <view class="fs-28 fw-600 fc-41ABF5" @click="save()">确定</view>
|
|
|
+ <uni-icons @click="closeInput()" type="closeempty" size="24"></uni-icons>
|
|
|
</view>
|
|
|
<view class="scroll-view-css">
|
|
|
<view class="bgc-f box-border-box p-32">
|
|
|
<view class="fs-34 fw-600 mb-20">评论</view>
|
|
|
- <textarea class=" fs-24" placeholder='友善评论,文明发言'></textarea>
|
|
|
+ <textarea v-model="msgData.content" maxlength="100" class=" fs-24" placeholder='友善评论,文明发言'></textarea>
|
|
|
</view>
|
|
|
</view>
|
|
|
+ <view class="box-border-box p-24">
|
|
|
+ <view class="save-box" @click.stop="save()">评论</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </uni-popup>
|
|
|
+
|
|
|
+ <uni-popup ref="popupRepot" type="bottom">
|
|
|
+ <view class="pop-box pop-h-30 box-border-box p-24">
|
|
|
+ <view class="head-pop flex-justify-space align-items-center mb-24">
|
|
|
+ <uni-icons @click.stop="closePop(1)" type="closeempty" size="24"></uni-icons>
|
|
|
+ <view class="fs-36 fc-0 fw-600">请输入举报内容</view>
|
|
|
+ <view class="fs-28 fw-600 fc-41ABF5">确定</view>
|
|
|
+ </view>
|
|
|
+ <view class="scroll-view-css">
|
|
|
+ <textarea style="height: 100%;" v-model="reportData.content" class=" fs-24" :maxlength='50' placeholder='请输入举报内容'></textarea>
|
|
|
+ </view>
|
|
|
+ <view @click.stop="closePop(2)" class="b-bottom text-align-center fs-32 fw-600 fc-f">确认举报</view>
|
|
|
</view>
|
|
|
</uni-popup>
|
|
|
</view>
|
|
|
@@ -134,14 +159,13 @@
|
|
|
|
|
|
<script>
|
|
|
import EnBlank from "@/components/en-utils/en-blank/en-blank";
|
|
|
- import {alumnInfo,getRemarkList,setAlumniLike,delRemark} from '@/api/alumni.js';
|
|
|
+ import {alumnInfo,getRemarkList,setAlumniLike,delRemark,setCreateRemark,setRemarkLike,alumniReport} from '@/api/alumni.js';
|
|
|
import tools from "@/service/tools";
|
|
|
export default {
|
|
|
components:{EnBlank},
|
|
|
data(){
|
|
|
return{
|
|
|
- id:0,
|
|
|
-
|
|
|
+ isAJAX:false,
|
|
|
news_id:'',
|
|
|
obj:{
|
|
|
image:[],
|
|
|
@@ -149,10 +173,28 @@
|
|
|
list:[],
|
|
|
page:1,
|
|
|
total:0,
|
|
|
+
|
|
|
+ // 发起评论
|
|
|
+ msgData:{
|
|
|
+ news_id:'',
|
|
|
+ remark_id:'',
|
|
|
+ content:'',
|
|
|
+ reply_id:'',
|
|
|
+ },
|
|
|
+ // 回复评论
|
|
|
+ replyData:{
|
|
|
+ page:1,
|
|
|
+ },
|
|
|
+ // 举报
|
|
|
+ reportData:{
|
|
|
+ news_id:'',
|
|
|
+ content:'',
|
|
|
+ },
|
|
|
}
|
|
|
},
|
|
|
onLoad(e) {
|
|
|
this.news_id = e.news_id;
|
|
|
+ this.msgData.news_id = e.news_id;
|
|
|
this.getInfo();
|
|
|
this.getList();
|
|
|
},
|
|
|
@@ -167,6 +209,12 @@
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ scrolltolower(){
|
|
|
+ if(this.list.length < this.total){
|
|
|
+ this.page += 1;
|
|
|
+ this.getList();
|
|
|
+ }
|
|
|
+ },
|
|
|
getList(){
|
|
|
getRemarkList({news_id:this.news_id,remark_id:0,page:this.page}).then((res)=>{
|
|
|
if(res.code === 1){
|
|
|
@@ -181,7 +229,31 @@
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ // 获取回复列表
|
|
|
+ openReply(type,item){
|
|
|
+ // type 1获取其他 2加载更多
|
|
|
+ if(this.isAJAX){
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.isAJAX = true;
|
|
|
+ if(type == 1){
|
|
|
+ item.replyList = [];
|
|
|
+ this.replyData.page = 1;
|
|
|
+ }else{
|
|
|
+ this.replyData.page += 1;
|
|
|
+ }
|
|
|
|
|
|
+ getRemarkList({news_id:item.news_id,remark_id:item.id,page:this.replyData.page}).then((res)=>{
|
|
|
+ if(res.code === 1){
|
|
|
+ this.isAJAX = false;
|
|
|
+ item.replyList = [...item.replyList,...res.data.items];
|
|
|
+ item.isOpen = false;
|
|
|
+ }else{
|
|
|
+ this.isAJAX = false;
|
|
|
+ tools.error(res.msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
|
|
|
// 点赞
|
|
|
handUp(type,item){
|
|
|
@@ -233,10 +305,30 @@
|
|
|
},
|
|
|
closeInput(){
|
|
|
this.$refs.popup.close();
|
|
|
+ this.msgData.remark_id = '';
|
|
|
+ this.msgData.content = '';
|
|
|
+ this.msgData.reply_id = '';
|
|
|
},
|
|
|
-
|
|
|
save(){
|
|
|
- this.closeInput()
|
|
|
+ if(this.isAJAX){
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.isAJAX = true;
|
|
|
+ setCreateRemark(this.msgData).then((res)=>{
|
|
|
+ if(res.code == 1){
|
|
|
+ tools.success('评论成功')
|
|
|
+ setTimeout(()=>{
|
|
|
+ this.isAJAX = false;
|
|
|
+ this.closeInput()
|
|
|
+ this.list = [];
|
|
|
+ this.page = 1;
|
|
|
+ this.getList();
|
|
|
+ },1500)
|
|
|
+ }else{
|
|
|
+ this.isAJAX = false;
|
|
|
+ tools.error(res.msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
|
|
|
|
|
|
@@ -249,6 +341,7 @@
|
|
|
if(res.code === 1){
|
|
|
tools.success('删除成功')
|
|
|
setTimeout(()=>{
|
|
|
+ this.isAJAX = false;
|
|
|
this.list = [];
|
|
|
this.page = 1;
|
|
|
this.getList();
|
|
|
@@ -259,18 +352,64 @@
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+
|
|
|
+ // 打开举报
|
|
|
+ openRepot(item){
|
|
|
+ this.reportData.news_id = item.news_id;
|
|
|
+ this.$refs.popupRepot.open();
|
|
|
+ },
|
|
|
+ // 举报
|
|
|
+ closePop(type){
|
|
|
+ if(type === 1){
|
|
|
+ this.reportData.news_id = '';
|
|
|
+ this.reportData.content = '';
|
|
|
+ this.$refs.popupRepot.close();
|
|
|
+ }else{
|
|
|
+ if(this.isAJAX){
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.isAJAX = true;
|
|
|
+ alumniReport(this.reportData).then((res)=>{
|
|
|
+ if(res.code === 1){
|
|
|
+ tools.success(res.msg)
|
|
|
+ setTimeout(()=>{
|
|
|
+ this.isAJAX = false;
|
|
|
+ this.closePop(1);
|
|
|
+ },1000)
|
|
|
+ }else{
|
|
|
+ tools.error(res.msg);
|
|
|
+ this.isAJAX = false;;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
},
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
.circle-info-box{
|
|
|
+
|
|
|
+ .boder-b-t{
|
|
|
+ border-top: 1rpx solid #F2F2F2;
|
|
|
+ }
|
|
|
+
|
|
|
.card-5{
|
|
|
- padding: 50rpx;
|
|
|
+ padding: 20rpx 24rpx 0 24rpx;
|
|
|
image{
|
|
|
width: 40rpx;
|
|
|
height: 40rpx;
|
|
|
margin-right: 8rpx;
|
|
|
+
|
|
|
+ }
|
|
|
+ .input-box-box{
|
|
|
+ width: 436rpx;
|
|
|
+ height: 72rpx;
|
|
|
+ line-height: 72rpx;
|
|
|
+ background: #F2F2F2;
|
|
|
+ border-radius: 200rpx;
|
|
|
+ box-sizing: border-box;
|
|
|
+ padding: 0 24rpx;
|
|
|
}
|
|
|
}
|
|
|
.w348{
|
|
|
@@ -328,6 +467,17 @@
|
|
|
border-radius: 20rpx 20rpx 0 0;
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
+ .save-box{
|
|
|
+ text-align: center;
|
|
|
+ line-height: 88rpx;
|
|
|
+ font-weight: 600;
|
|
|
+ font-size: 32rpx;
|
|
|
+ color: #FFFFFF;
|
|
|
+ width: 100%;
|
|
|
+ height: 80rpx;
|
|
|
+ border-radius: 200rpx;
|
|
|
+ background: linear-gradient( 105deg, #57CAFF 0%, #41ABF5 100%);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
.pop-box{
|