|
@@ -32,12 +32,12 @@
|
|
|
<template v-if="info.typeName!=='通知公告'">
|
|
|
|
|
|
|
|
|
- <view class="comment" v-if="info.title&&info.listComment&&info.listComment.length" >
|
|
|
+ <view class="comment" v-if="info.title&&infolistComment&&infolistComment.length" >
|
|
|
<view class="title">
|
|
|
精华评论
|
|
|
</view>
|
|
|
|
|
|
- <view class="comment-item" v-for="(item,i) in info.listComment" :key="i" >
|
|
|
+ <view class="comment-item" v-for="(item,i) in infolistComment" :key="i" >
|
|
|
<view class="photo">
|
|
|
<img v-if="item.headImg" :src="item.headImg" alt="">
|
|
|
<u-avatar v-else size="80" ></u-avatar>
|
|
@@ -46,9 +46,9 @@
|
|
|
<view class="details">
|
|
|
<view class="name-date">
|
|
|
<view class="name" :class="{
|
|
|
- red:!item.name
|
|
|
+ red:!item.userName
|
|
|
}" >
|
|
|
- {{item.name?item.name:'用户异常'}}
|
|
|
+ {{item.userName?item.userName:'用户异常'}}
|
|
|
</view>
|
|
|
<view class="date">
|
|
|
{{item.date}}
|
|
@@ -56,7 +56,7 @@
|
|
|
</view>
|
|
|
<view class="comment-content">
|
|
|
{{item.content}}
|
|
|
- <view class="mine" v-if="item.isMine">
|
|
|
+ <view class="mine" v-if="userInfo&&(item.userId==userInfo.id)">
|
|
|
<view class="my-comment">
|
|
|
我的评论<span style="color:red;margin-left: 2px;" v-if="item.status==0">[审批中]</span>
|
|
|
</view>
|
|
@@ -69,6 +69,8 @@
|
|
|
|
|
|
</view>
|
|
|
</view>
|
|
|
+ <u-divider v-if="infolistComment.length==recordsTotal" border-color="#CFD2D5">已经到底了</u-divider>
|
|
|
+
|
|
|
</view>
|
|
|
|
|
|
<view class="bottom" v-if="userInfo" >
|
|
@@ -136,6 +138,13 @@
|
|
|
showMessage:false,
|
|
|
userInfo:null,
|
|
|
list:[],
|
|
|
+ infolistComment:[],
|
|
|
+ listForm:{
|
|
|
+ pageIndex:1,
|
|
|
+ newsId:"",
|
|
|
+ queryStatus:0,
|
|
|
+ pageSize:5,
|
|
|
+ },
|
|
|
back:true,
|
|
|
recordsTotal:0,
|
|
|
|
|
@@ -146,12 +155,22 @@
|
|
|
this.back=false
|
|
|
}
|
|
|
this.id=op.id
|
|
|
+ this.listForm.newsId=this.id;
|
|
|
this.userInfo=this.carhelp.getPersonInfo()
|
|
|
this.getInfo(true)
|
|
|
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
+ onReachBottom() {
|
|
|
+ if (this.infolistComment.length < this.recordsTotal) {
|
|
|
+ this.myLoadmore();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ myLoadmore(){
|
|
|
+ this.listForm.pageIndex += 1;
|
|
|
+ this.getNewsCommentsList();
|
|
|
+ },
|
|
|
issueMethod(){
|
|
|
uni.showModal({
|
|
|
title:"提示",
|
|
@@ -237,23 +256,54 @@
|
|
|
})
|
|
|
},
|
|
|
changeLikes(){
|
|
|
+ if(!this.info.iLike){
|
|
|
+ uni.showLoading({
|
|
|
+ title: "加载中",
|
|
|
+ mask: true,
|
|
|
+ })
|
|
|
+
|
|
|
+
|
|
|
+ API.changeLikes({
|
|
|
+ newsId:this.id
|
|
|
+ }).then((res) => {
|
|
|
+
|
|
|
+ this.getInfo(true)
|
|
|
+ }).catch(error => {
|
|
|
+ uni.showToast({
|
|
|
+ title: error,
|
|
|
+ icon: "none"
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ uni.showToast({
|
|
|
+ title: "您已经点过赞了",
|
|
|
+ icon: "none"
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+ getNewsCommentsList(){
|
|
|
uni.showLoading({
|
|
|
title: "加载中",
|
|
|
mask: true,
|
|
|
})
|
|
|
-
|
|
|
-
|
|
|
- API.changeLikes({
|
|
|
- newsId:this.id
|
|
|
- }).then((res) => {
|
|
|
-
|
|
|
- this.getInfo(true)
|
|
|
+ if(this.userInfo){
|
|
|
+ this.listForm.queryStatus =1
|
|
|
+ }
|
|
|
+ API.newsCommentsList(this.listForm).then((res) => {
|
|
|
+ uni.hideLoading();
|
|
|
+ this.infolistComment = [
|
|
|
+ ...this.infolistComment,
|
|
|
+ ...res.data.data
|
|
|
+ ];
|
|
|
+ this.recordsTotal = res.data.recordsTotal;
|
|
|
}).catch(error => {
|
|
|
uni.showToast({
|
|
|
title: error,
|
|
|
icon: "none"
|
|
|
})
|
|
|
})
|
|
|
+
|
|
|
},
|
|
|
getInfo(bl){
|
|
|
if(bl){
|
|
@@ -292,6 +342,7 @@
|
|
|
}
|
|
|
|
|
|
})
|
|
|
+ this.getNewsCommentsList();
|
|
|
}).catch(error => {
|
|
|
uni.showToast({
|
|
|
title: error,
|