|
|
@@ -78,11 +78,11 @@
|
|
|
<image src="@/static/img/school/fx.png" mode=""></image>
|
|
|
<view class="fs-24 fc-9">分享</view>
|
|
|
</view>
|
|
|
- <view class="align-items-center" @click.stop="handUp(item)">
|
|
|
+ <view class="align-items-center" @click.stop="handUp(1,item)">
|
|
|
<uni-icons type="hand-up" size="22" :color="item.is_like==1?'#FD5C02':'#999'"></uni-icons>
|
|
|
<view class="fs-24 " :class="item.is_like==1?'fc-FD5C02':'fc-9'">{{item.like}}</view>
|
|
|
</view>
|
|
|
- <view class="align-items-center" @click.stop="openMsg(item)">
|
|
|
+ <view class="align-items-center" @click.stop="openMsg(item,0)">
|
|
|
<image src="@/static/img/school/info.png" mode=""></image>
|
|
|
<view class="fs-24 fc-9">{{item.remark}}</view>
|
|
|
</view>
|
|
|
@@ -120,43 +120,57 @@
|
|
|
<!-- 输入框 -->
|
|
|
<view class="pop-input" v-if="isShowIpnut">
|
|
|
<view class="head-pop flex-justify-space align-items-center mb-24 box-border-box p-24">
|
|
|
- <uni-icons @click.stop="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.stop="save">确定</view>
|
|
|
+ <uni-icons @click.stop="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>
|
|
|
-
|
|
|
+ <!-- ----- -->
|
|
|
<view class="head-pop flex-justify-space align-items-center mb-24">
|
|
|
<view class=""></view>
|
|
|
- <view class="fs-36 fc-0 fw-600">评论(4)</view>
|
|
|
+ <view class="fs-36 fc-0 fw-600">评论({{remarkData.total||'0'}})</view>
|
|
|
<uni-icons @click.stop="closeMsg()" type="closeempty" size="24"></uni-icons>
|
|
|
</view>
|
|
|
- <view class="scroll-view-css box-border-box plr-24">
|
|
|
+
|
|
|
+ <view v-if="remarkData.list.length === 0" class="scroll-view-css">
|
|
|
+ <EnBlank :customSrc='true'>
|
|
|
+ <template v-slot:blankImg>
|
|
|
+ <image class="black-custom-img" src="@/static/img/common/no-order.png" mode=""></image>
|
|
|
+ </template>
|
|
|
+ </EnBlank>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <view v-else class="scroll-view-css box-border-box plr-24">
|
|
|
<view class="list-box flex-justify-space" v-for="(item,i) in remarkData.list" :key="i">
|
|
|
<image class="list-box-img" :src="item.head_img" 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">
|
|
|
- {{item.nickname}} <span v-if="is_author == 1" class='only-box text-align-center fs-24 fc-41ABF5 ml-10'>作者</span>
|
|
|
+ {{item.nickname}} <span v-if="item.is_author == 1" class='only-box text-align-center fs-24 fc-41ABF5 ml-10'>作者</span>
|
|
|
</view>
|
|
|
- <view class="fs-30 fw-400 mb-8" @click.stop="openInput()">
|
|
|
+ <view class="fs-30 fw-400 mb-8" @click.stop="openInput(1,item)">
|
|
|
{{item.content}}
|
|
|
</view>
|
|
|
<view class="fs-24 fw-400 fc-9 mb-8">{{item.created_date}}</view>
|
|
|
</view>
|
|
|
- <view class="display-flex">
|
|
|
+ <view class="display-flex" @click.stop="handUp(2,item)">
|
|
|
<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>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="list-box flex-justify-space" v-for="(info,index) in 1" :key="index">
|
|
|
+ <!-- 回复 -->
|
|
|
+ <!-- <view class="list-box flex-justify-space" v-for="(info,index) in 1" :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">
|
|
|
@@ -164,7 +178,7 @@
|
|
|
<view class="fs-28 fw-400 fc-9 mb-8">
|
|
|
最佳损友最佳损友 <span class='only-box text-align-center fs-24 fc-41ABF5 ml-10'>作者</span>
|
|
|
</view>
|
|
|
- <view class="fs-30 fw-400 mb-8" @click.stop="openInput()">
|
|
|
+ <view class="fs-30 fw-400 mb-8" @click.stop="openInput(1,info)">
|
|
|
回关一下啊,这么近这么近这么近这么近这么近这么近
|
|
|
</view>
|
|
|
<view class="fs-24 fw-400 fc-9 mb-8">2021-04-17 15:53</view>
|
|
|
@@ -175,10 +189,13 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- </view>
|
|
|
+ </view> -->
|
|
|
</view>
|
|
|
</view>
|
|
|
+ <view v-if="remarkData.list.length < remarkData.total" class="text-align-center fs-26" @click="scrolltolowerList">加载更多评论</view>
|
|
|
</view>
|
|
|
+
|
|
|
+ <view class="input-box text-align-left fs-28 fc-9 box-border-box plr-24" @click.stop="openInput(0,'')">友善评论,文明发言</view>
|
|
|
</view>
|
|
|
|
|
|
</uni-popup>
|
|
|
@@ -187,7 +204,7 @@
|
|
|
|
|
|
<script>
|
|
|
import EnBlank from "@/components/en-utils/en-blank/en-blank";
|
|
|
- import {getAlumniList,setAlumniLike,getRemarkList,alumniReport} from '@/api/alumni.js';
|
|
|
+ import {getAlumniList,setAlumniLike,getRemarkList,alumniReport,setCreateRemark,setRemarkLike} from '@/api/alumni.js';
|
|
|
import {getTopic} from '@/api/category.js';
|
|
|
import tools from '@/service/tools';
|
|
|
|
|
|
@@ -209,19 +226,28 @@
|
|
|
},
|
|
|
isAJAX:false,
|
|
|
|
|
|
+ schoolData:{
|
|
|
+ school_name:'',
|
|
|
+ },
|
|
|
+ // 举报
|
|
|
+ reportData:{
|
|
|
+ news_id:'',
|
|
|
+ content:'',
|
|
|
+ },
|
|
|
+
|
|
|
remarkData:{
|
|
|
+ remark_id:'',
|
|
|
+ news_id:'',
|
|
|
total:0,
|
|
|
list:[],
|
|
|
page:1,
|
|
|
},
|
|
|
-
|
|
|
- schoolData:{
|
|
|
- school_name:'',
|
|
|
- },
|
|
|
-
|
|
|
- reportData:{
|
|
|
+ // 评论
|
|
|
+ msgData:{
|
|
|
news_id:'',
|
|
|
+ remark_id:'',
|
|
|
content:'',
|
|
|
+ reply_id:'',
|
|
|
},
|
|
|
}
|
|
|
},
|
|
|
@@ -290,54 +316,140 @@
|
|
|
}
|
|
|
},
|
|
|
|
|
|
-
|
|
|
- handUp(item){
|
|
|
+ // 点赞
|
|
|
+ handUp(type,item){
|
|
|
if(this.isAJAX){
|
|
|
return
|
|
|
}
|
|
|
this.isAJAX = true;
|
|
|
let is_like = item.is_like == 1?0:1;
|
|
|
- setAlumniLike({news_id:item.news_id,is_like:is_like}).then((res)=>{
|
|
|
- if(res.code === 1){
|
|
|
- item.is_like = is_like;
|
|
|
- if(is_like == 0){
|
|
|
- item.like -= 1
|
|
|
- }else{
|
|
|
- item.like += 1
|
|
|
- }
|
|
|
- this.isAJAX = false;
|
|
|
- tools.success(res.msg);
|
|
|
+ if(type == 1){
|
|
|
+ // 点赞贴子
|
|
|
+ setAlumniLike({news_id:item.news_id,is_like:is_like}).then((res)=>{
|
|
|
+ this.handUpFun(res,item,is_like)
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ // 点赞评论
|
|
|
+ setRemarkLike({news_id:item.news_id,is_like:is_like,remark_id:item.id}).then((res)=>{
|
|
|
+ this.handUpFun(res,item,is_like)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 点赞
|
|
|
+ handUpFun(res,item,is_like){
|
|
|
+ if(res.code === 1){
|
|
|
+ item.is_like = is_like;
|
|
|
+ if(is_like == 0){
|
|
|
+ item.like -= 1
|
|
|
}else{
|
|
|
- this.isAJAX = false;
|
|
|
- tools.error(res.msg);
|
|
|
+ item.like += 1
|
|
|
}
|
|
|
- })
|
|
|
+ this.isAJAX = false;
|
|
|
+ tools.success(res.msg);
|
|
|
+ }else{
|
|
|
+ this.isAJAX = false;
|
|
|
+ tools.error(res.msg);
|
|
|
+ }
|
|
|
},
|
|
|
+ // 打开评论
|
|
|
openMsg(item){
|
|
|
+ this.remarkData.news_id = item.news_id;
|
|
|
+ this.msgData.news_id = item.news_id;
|
|
|
+ this.remarkData.remark_id = 0;
|
|
|
+ this.getMsg();
|
|
|
+ },
|
|
|
+ // 获取评论
|
|
|
+ getMsg(){
|
|
|
if(this.isAJAX){
|
|
|
return
|
|
|
}
|
|
|
this.isAJAX = true;
|
|
|
- getRemarkList({news_id:item.news_id,remark_id:0,page:this.remarkData.page}).then((res)=>{
|
|
|
+ getRemarkList({news_id:this.remarkData.news_id,remark_id:this.remarkData.remark_id,page:this.remarkData.page}).then((res)=>{
|
|
|
if(res.code === 1){
|
|
|
+ this.isAJAX = false;
|
|
|
this.remarkData.list = [...this.remarkData.list,...res.data.items];
|
|
|
this.remarkData.total = res.data.total;
|
|
|
- this.remarkData.list.forEach((v)=>{
|
|
|
- v.isOpne = false;
|
|
|
- })
|
|
|
+ // this.remarkData.list.forEach((v)=>{
|
|
|
+ // v.isOpne = false;
|
|
|
+ // })
|
|
|
this.$refs.popmsg.open();
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ // 加载更多评论
|
|
|
+ scrolltolowerList(){
|
|
|
+ if(this.remarkData.list.length < this.remarkData.total){
|
|
|
+ this.remarkData.page += 1;
|
|
|
+ this.getMsg();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 关闭评论
|
|
|
+ closeMsg(){
|
|
|
+ this.$refs.popmsg.close();
|
|
|
+ this.remarkData.list = [];
|
|
|
+ this.remarkData.page = 1;
|
|
|
+ this.msgData.news_id = '';
|
|
|
+ this.remarkData.remark_id = '';
|
|
|
+ },
|
|
|
+ openInput(type,item){
|
|
|
+ if(type == 0){
|
|
|
+ this.msgData.remark_id = 0;
|
|
|
+ }else{
|
|
|
+ this.msgData.remark_id = item.id;
|
|
|
+ this.msgData.reply_id = item.m_id;
|
|
|
+ }
|
|
|
+ this.isShowIpnut = true;
|
|
|
+ },
|
|
|
+ closeInput(){
|
|
|
+ this.isShowIpnut = false;
|
|
|
+ this.msgData.remark_id = '';
|
|
|
+ this.msgData.content = '';
|
|
|
+ this.msgData.reply_id = '';
|
|
|
+ },
|
|
|
+ save(){
|
|
|
+ if(this.isAJAX){
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.isAJAX = true;
|
|
|
+ setCreateRemark(this.msgData).then((res)=>{
|
|
|
+ if(res.code == 1){
|
|
|
+ tools.success('评论成功')
|
|
|
+ setTimeout(()=>{
|
|
|
+ this.isAJAX = false;
|
|
|
+ this.closeInput()
|
|
|
+ if(this.msgData.remark_id == 0){
|
|
|
+ this.remarkData.list = [];
|
|
|
+ this.remarkData.page = 1;
|
|
|
+ this.getMsg();
|
|
|
+ this.list = [];
|
|
|
+ this.fromData.page = 1;
|
|
|
+ this.getList();
|
|
|
+ }else{
|
|
|
+ this.remarkData.list = [];
|
|
|
+ this.remarkData.page = 1;
|
|
|
+ this.getMsg();
|
|
|
+ }
|
|
|
+ },1500)
|
|
|
+ }else{
|
|
|
+ this.isAJAX = false;
|
|
|
+ tools.success(res.msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ // 添加贴子
|
|
|
add(){
|
|
|
uni.navigateTo({
|
|
|
url:"/pages-school/add-circle"
|
|
|
})
|
|
|
},
|
|
|
+ // 打开举报
|
|
|
openRepot(item){
|
|
|
this.reportData.news_id = item.news_id;
|
|
|
this.$refs.popup.open();
|
|
|
},
|
|
|
+ // 举报
|
|
|
closePop(type){
|
|
|
if(type === 1){
|
|
|
this.reportData.news_id = '';
|
|
|
@@ -395,23 +507,19 @@
|
|
|
})
|
|
|
},
|
|
|
|
|
|
- closeMsg(){
|
|
|
- this.$refs.popmsg.close();
|
|
|
- },
|
|
|
- openInput(){
|
|
|
- this.isShowIpnut = true;
|
|
|
- },
|
|
|
- closeInput(){
|
|
|
- this.isShowIpnut = false;
|
|
|
- },
|
|
|
- save(){
|
|
|
- this.isShowIpnut = false;
|
|
|
- },
|
|
|
+
|
|
|
},
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
+ .input-box{
|
|
|
+ width: 100%;
|
|
|
+ height: 80rpx;
|
|
|
+ background: #F2F2F2;
|
|
|
+ border-radius: 200rpx;
|
|
|
+ line-height: 80rpx;
|
|
|
+ }
|
|
|
.b-bottom{
|
|
|
width: 100%;
|
|
|
height: 88rpx;
|
|
|
@@ -465,6 +573,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%);
|
|
|
+ }
|
|
|
}
|
|
|
.head-pop{
|
|
|
padding-bottom: 34rpx !important;
|