完善书评第二次提交
This commit is contained in:
@@ -47,8 +47,8 @@
|
|||||||
<view class="btns flexbox" style="margin-top:10rpx;">
|
<view class="btns flexbox" style="margin-top:10rpx;">
|
||||||
<span class="left" style="color: #C0C4CC;"></span>
|
<span class="left" style="color: #C0C4CC;"></span>
|
||||||
<span class="right flexbox opbtns">
|
<span class="right flexbox opbtns">
|
||||||
<image class="gzicon" v-if="commentInfo.ilike" src="../../static/icon/gz2.png" mode="aspectFill"></image>
|
<image class="gzicon" v-if="commentInfo.ilike" src="../../static/icon/gz2.png" mode="aspectFill" @click.stop="clickLikeshuping(commentInfo)"></image>
|
||||||
<image class="gzicon" v-else src="../../static/icon/gz.png" mode="aspectFill"></image>
|
<image class="gzicon" v-else src="../../static/icon/gz.png" mode="aspectFill" @click.stop="clickLikeshuping(commentInfo)"></image>
|
||||||
<view style="color: #C0C4CC;">{{commentInfo.contlike}}</view>
|
<view style="color: #C0C4CC;">{{commentInfo.contlike}}</view>
|
||||||
<image class="gzicon" v-if="1" src="../../static/icon/pinglun.png" mode="aspectFill" @click="pinglun()"></image>
|
<image class="gzicon" v-if="1" src="../../static/icon/pinglun.png" mode="aspectFill" @click="pinglun()"></image>
|
||||||
<view style="color: #C0C4CC;" @click="pinglun()">{{commentInfo.commentNum}}</view>
|
<view style="color: #C0C4CC;" @click="pinglun()">{{commentInfo.commentNum}}</view>
|
||||||
@@ -73,14 +73,24 @@
|
|||||||
<view class="item mb30" v-for="item in plList" :key="item.id">
|
<view class="item mb30" v-for="item in plList" :key="item.id">
|
||||||
user
|
user
|
||||||
<view class="content" v-html="item.phtml"></view>
|
<view class="content" v-html="item.phtml"></view>
|
||||||
<view class="btns flexbox">
|
<!-- <view class="btns flexbox"> -->
|
||||||
<span class="time">{{item.createTime}}</span>
|
<!-- <span class="time">{{formatTimeDifferenceFromT(item.createTime)}}</span> -->
|
||||||
<!-- <span class="flexbox opbtns">
|
<!-- <span class="flexbox opbtns">
|
||||||
<span class="flexbox pingjia" @click="pinglun(item.id)">
|
<span class="flexbox pingjia" @click="pinglun(item.id)">
|
||||||
<u-icon name="chat" color="#888" size="26"></u-icon>
|
<u-icon name="chat" color="#888" size="26"></u-icon>
|
||||||
</span>
|
</span>
|
||||||
</span> -->
|
</span> -->
|
||||||
</view>
|
<view class="btns flexbox" style="margin-top:10rpx;">
|
||||||
|
<span class="left" style="color: #C0C4CC;">{{formatTimeDifferenceFromT(item.createTime)}}</span>
|
||||||
|
<span class="right flexbox opbtns">
|
||||||
|
<image class="gzicon" v-if="item.ilike" src="../../static/icon/gz2.png" mode="aspectFill" @click.stop="clickLikehuifu(item)"></image>
|
||||||
|
<image class="gzicon" v-else src="../../static/icon/gz.png" mode="aspectFill" @click.stop="clickLikehuifu(item)"></image>
|
||||||
|
<view style="color: #C0C4CC;">{{item.contlike}}</view>
|
||||||
|
<image class="gzicon" v-if="1" src="../../static/icon/pinglun.png" mode="aspectFill" @click="pinglun()"></image>
|
||||||
|
<view style="color: #C0C4CC;" @click="pinglun()">{{item.commentNum}}</view>
|
||||||
|
</span>
|
||||||
|
</view>
|
||||||
|
<!-- </view> -->
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="quesheng" v-else>
|
<view class="quesheng" v-else>
|
||||||
@@ -210,34 +220,34 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 获得书评评论列表
|
// 获得书评回复列表
|
||||||
getCommPL(){
|
getCommPL(){
|
||||||
let data = {
|
let data = {
|
||||||
'bfa_id':this.bfa_id,
|
'forumId':this.bfa_id,
|
||||||
'limit': 5,
|
'limit': 5,
|
||||||
'page': this.pPage,
|
'page': this.pPage,
|
||||||
}
|
}
|
||||||
console.log(data,'data')
|
console.log(data,'data')
|
||||||
this.$http
|
this.$http
|
||||||
.post('forum/comment/list', data)
|
.post('forum/articles/getCommentByForum', data)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
if(res.code == 0){
|
if(res.code == 0){
|
||||||
console.log(res,'书评评论')
|
console.log(res,'书评评论')
|
||||||
// this.plList = this.plList.concat(res.page.list)
|
// this.plList = this.plList.concat(res.page.list)
|
||||||
this.plList = res.page.list
|
let plList1 = res.page.records
|
||||||
this.pTotal = res.page.totalPage
|
this.pTotal = res.page.size
|
||||||
this.status = 3
|
this.status = 3
|
||||||
// 评论格式化
|
// 评论格式化
|
||||||
var newarr = []
|
var newarr = []
|
||||||
this.plList.forEach((item1)=>{
|
plList1.forEach((item1)=>{
|
||||||
var pjstr = ''
|
var pjstr = ''
|
||||||
pjstr = this.getHtmlComment(item1.content)
|
pjstr = this.getHtmlComment(item1.content)
|
||||||
item1.phtml = pjstr
|
item1.phtml = pjstr
|
||||||
// console.log(pjstr)
|
// console.log(pjstr)
|
||||||
newarr.push(item1)
|
newarr.push(item1)
|
||||||
|
|
||||||
})
|
})
|
||||||
this.plList = newarr
|
this.plList = this.plList.concat(newarr)
|
||||||
console.log('改变格式后', this.plList)
|
console.log('改变格式后', this.plList)
|
||||||
}
|
}
|
||||||
}).catch((e)=>{
|
}).catch((e)=>{
|
||||||
@@ -257,6 +267,41 @@
|
|||||||
console.log(e)
|
console.log(e)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
clickLikeshuping(item){
|
||||||
|
this.$http
|
||||||
|
.post("forum/articles/chickForumContlike?forum_id=" + item.id,)
|
||||||
|
.then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
uni.showToast({
|
||||||
|
title:'点赞成功!',
|
||||||
|
icon:'success'
|
||||||
|
})
|
||||||
|
|
||||||
|
item.contlike++
|
||||||
|
}
|
||||||
|
}).catch((e)=>{
|
||||||
|
console.log(e,'e')
|
||||||
|
})
|
||||||
|
},
|
||||||
|
clickLikehuifu(item){
|
||||||
|
let data = {
|
||||||
|
comment_id: item.id
|
||||||
|
}
|
||||||
|
this.$http
|
||||||
|
.post("forum/articles/chickCommentConlike", data)
|
||||||
|
.then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
uni.showToast({
|
||||||
|
title:'点赞成功!',
|
||||||
|
icon:'success'
|
||||||
|
})
|
||||||
|
|
||||||
|
item.contlike++
|
||||||
|
}
|
||||||
|
}).catch((e)=>{
|
||||||
|
console.log(e,'e')
|
||||||
|
})
|
||||||
|
},
|
||||||
getProDetail(){
|
getProDetail(){
|
||||||
// 获取商品详情
|
// 获取商品详情
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
@@ -404,33 +449,61 @@
|
|||||||
submitPJ(){
|
submitPJ(){
|
||||||
if(this.Pform.comment != ''){
|
if(this.Pform.comment != ''){
|
||||||
|
|
||||||
let data={
|
// let data={
|
||||||
'content':this.Pform.comment,
|
// 'content':this.Pform.comment,
|
||||||
'userid':this.userInfo.id,
|
// 'userid':this.userInfo.id,
|
||||||
'bookid':this.bookid,
|
// 'bookid':this.bookid,
|
||||||
'bfaid' : this.bfa_id,
|
// 'bfaid' : this.bfa_id,
|
||||||
// 'id': this.pinglunId
|
// // 'id': this.pinglunId
|
||||||
|
// }
|
||||||
|
// console.log(data,'data')
|
||||||
|
|
||||||
|
|
||||||
|
let data = {
|
||||||
|
forumId : this.bfa_id,
|
||||||
|
userId: this.userInfo.id,
|
||||||
|
content: this.Pform.comment,
|
||||||
|
pid: '',
|
||||||
|
puserId: '',
|
||||||
}
|
}
|
||||||
console.log(data,'data')
|
this.$http
|
||||||
$http.request({
|
.post("forum/articles/pushMsgToForum", data)
|
||||||
url: "forum/comment/save",
|
.then(res => {
|
||||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
if (res.code == 0) {
|
||||||
data,
|
if (res.code == 0) {
|
||||||
header: { //默认 无 说明:请求头
|
|
||||||
'Content-Type': 'application/json'
|
|
||||||
},
|
|
||||||
}).then(res => {
|
|
||||||
if (res.code == 0) {
|
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title:'评论成功!',
|
title:'评论成功!',
|
||||||
icon:'success'
|
icon:'success'
|
||||||
})
|
})
|
||||||
this.getCommPL()
|
// this.getCommPL()
|
||||||
this.pingjiaShow = false
|
this.pingjiaShow = false
|
||||||
this.Pform.comment = ''
|
this.Pform.comment = ''
|
||||||
this.pinglunId = null
|
this.pinglunId = null
|
||||||
}
|
}
|
||||||
})
|
}
|
||||||
|
}).catch((e)=>{
|
||||||
|
console.log(e,'e')
|
||||||
|
})
|
||||||
|
|
||||||
|
// $http.request({
|
||||||
|
// url: "forum/comment/save",
|
||||||
|
// method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||||
|
// data,
|
||||||
|
// header: { //默认 无 说明:请求头
|
||||||
|
// 'Content-Type': 'application/json'
|
||||||
|
// },
|
||||||
|
// }).then(res => {
|
||||||
|
// if (res.code == 0) {
|
||||||
|
// uni.showToast({
|
||||||
|
// title:'评论成功!',
|
||||||
|
// icon:'success'
|
||||||
|
// })
|
||||||
|
// this.getCommPL()
|
||||||
|
// this.pingjiaShow = false
|
||||||
|
// this.Pform.comment = ''
|
||||||
|
// this.pinglunId = null
|
||||||
|
// }
|
||||||
|
// })
|
||||||
}else{
|
}else{
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title:'请先输入您的评价内容 !',
|
title:'请先输入您的评价内容 !',
|
||||||
@@ -460,12 +533,35 @@
|
|||||||
h4{color: #55aa00; font-size: 40rpx; margin:30rpx 0 ; text-align: center;}
|
h4{color: #55aa00; font-size: 40rpx; margin:30rpx 0 ; text-align: center;}
|
||||||
.time{color: #888; font-size: 24rpx;}
|
.time{color: #888; font-size: 24rpx;}
|
||||||
.btns{
|
.btns{
|
||||||
color: #666; justify-content: space-between;
|
font-size: 22rpx;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
.left{
|
||||||
|
width: 300rpx;
|
||||||
|
color: #a1a1a1;
|
||||||
|
}
|
||||||
|
.right{
|
||||||
|
width: 300rpx;
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
.gzicon{
|
||||||
|
margin:0 0 0 20rpx;
|
||||||
|
height: 40rpx;
|
||||||
|
width: 40rpx;
|
||||||
|
// float:left;
|
||||||
|
// border-radius: 20rpx;
|
||||||
|
// border:1rpx solid #e9e9e9;
|
||||||
|
}
|
||||||
|
.opbtns{
|
||||||
|
.pingjia{margin-left: 10px;}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
// .mbtns{padding: 5px; background-color: #f4fff5; border-radius: 10px; font-size: 34rpx; color: #8b8a91; margin:15px 0; justify-content: space-between;}
|
// .mbtns{padding: 5px; background-color: #f4fff5; border-radius: 10px; font-size: 34rpx; color: #8b8a91; margin:15px 0; justify-content: space-between;}
|
||||||
.zhengwen{line-height: 50rpx; font-size: 30rpx;margin-top: 20rpx;}
|
.zhengwen{line-height: 50rpx; font-size: 28rpx;margin-top: 20rpx;}
|
||||||
.flexbox{display: flex;}
|
.flexbox{display: flex;}
|
||||||
.container{padding: 10px;}
|
.container{padding: 10px;}
|
||||||
.star{display: inline-block; width: 20px; height: 20px; margin-right: 10rpx;}
|
.star{display: inline-block; width: 20px; height: 20px; margin-right: 10rpx;}
|
||||||
|
|||||||
@@ -31,8 +31,43 @@
|
|||||||
<view class="btns flexbox" style="margin-top:10rpx;">
|
<view class="btns flexbox" style="margin-top:10rpx;">
|
||||||
<span class="left" style="color: #C0C4CC;">{{formatTimeDifferenceFromT(item.createTime)}}</span>
|
<span class="left" style="color: #C0C4CC;">{{formatTimeDifferenceFromT(item.createTime)}}</span>
|
||||||
<span class="right flexbox opbtns">
|
<span class="right flexbox opbtns">
|
||||||
<image class="gzicon" v-if="item.ilike" src="../../static/icon/gz2.png" mode="aspectFill"></image>
|
<image class="gzicon" v-if="item.ilike" src="../../static/icon/gz2.png" mode="aspectFill" @click.stop="clickLike(item)"></image>
|
||||||
<image class="gzicon" v-else src="../../static/icon/gz.png" mode="aspectFill"></image>
|
<image class="gzicon" v-else src="../../static/icon/gz.png" mode="aspectFill" @click.stop="clickLike(item)"></image>
|
||||||
|
<view style="color: #C0C4CC;">{{item.contlike}}</view>
|
||||||
|
<image class="gzicon" v-if="1" src="../../static/icon/pinglun.png" mode="aspectFill"></image>
|
||||||
|
<view style="color: #C0C4CC;">{{item.commentNum}}</view>
|
||||||
|
</span>
|
||||||
|
</view>
|
||||||
|
<view style="border-bottom:2rpx solid #e9e9e9;height:50rpx;" v-if="index<item.length-1"></view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="quesheng" v-else>
|
||||||
|
暂无书评内容~
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view v-if="commentsListTab == 2">
|
||||||
|
<view v-if="hotList.length > 0">
|
||||||
|
<view class="bookInfo" v-for="(item,index) in hotList" :key="index">
|
||||||
|
<view class="mainContent">
|
||||||
|
<view class="item" @click.stop="toDetail(item)">
|
||||||
|
|
||||||
|
<view class="title">{{item.title}}</view>
|
||||||
|
<image class="feng" v-if="item.bookimage" :src="item.bookimage" mode="aspectFill"></image>
|
||||||
|
<view class="description" v-html="item.content">
|
||||||
|
</view>
|
||||||
|
<view class="btns flexbox">
|
||||||
|
<span class="left">{{item.bookname}}</span>
|
||||||
|
<span class="right flexbox opbtns" style="color:#3c9cff;">
|
||||||
|
全文
|
||||||
|
</span>
|
||||||
|
</view>
|
||||||
|
<view class="btns flexbox" style="margin-top:10rpx;">
|
||||||
|
<span class="left" style="color: #C0C4CC;">{{formatTimeDifferenceFromT(item.createTime)}}</span>
|
||||||
|
<span class="right flexbox opbtns">
|
||||||
|
<image class="gzicon" v-if="item.ilike" src="../../static/icon/gz2.png" mode="aspectFill" @click.stop="clickLike(item)"></image>
|
||||||
|
<image class="gzicon" v-else src="../../static/icon/gz.png" mode="aspectFill" @click.stop="clickLike(item)"></image>
|
||||||
<view style="color: #C0C4CC;">{{item.contlike}}</view>
|
<view style="color: #C0C4CC;">{{item.contlike}}</view>
|
||||||
<image class="gzicon" v-if="1" src="../../static/icon/pinglun.png" mode="aspectFill"></image>
|
<image class="gzicon" v-if="1" src="../../static/icon/pinglun.png" mode="aspectFill"></image>
|
||||||
<view style="color: #C0C4CC;">{{item.commentNum}}</view>
|
<view style="color: #C0C4CC;">{{item.commentNum}}</view>
|
||||||
@@ -54,7 +89,7 @@
|
|||||||
<view class="item">
|
<view class="item">
|
||||||
<view class="btns flexbox" @click.stop="toMore(item)">
|
<view class="btns flexbox" @click.stop="toMore(item)">
|
||||||
<view class="title">{{item.name}}</view>
|
<view class="title">{{item.name}}</view>
|
||||||
<view class="pianshuping">{{item.id}}篇书评</view>
|
<view class="pianshuping">{{item.forumNum}}篇书评</view>
|
||||||
</view>
|
</view>
|
||||||
<image class="feng" v-if="item.images" :src="item.images" mode="aspectFill" @click.stop="toMore(item)"></image>
|
<image class="feng" v-if="item.images" :src="item.images" mode="aspectFill" @click.stop="toMore(item)"></image>
|
||||||
<view class="shupingList">
|
<view class="shupingList">
|
||||||
@@ -145,14 +180,20 @@ import { data } from 'jquery';
|
|||||||
console.log('下拉刷新了')
|
console.log('下拉刷新了')
|
||||||
uni.stopPullDownRefresh();
|
uni.stopPullDownRefresh();
|
||||||
|
|
||||||
this.booklistpage=1, // 页码
|
this.newestpage = 1
|
||||||
this.productList = []
|
this.hotestpage = 1
|
||||||
this.getBookList()
|
this.booksetpage = 1
|
||||||
|
this.newList = []
|
||||||
|
this.hotList = []
|
||||||
|
this.bookList = []
|
||||||
|
this.getBookList(this.commentsListTab, true)
|
||||||
|
|
||||||
},
|
},
|
||||||
onReachBottom() {
|
onReachBottom() {
|
||||||
this.booklistpage++
|
this.newestpage++
|
||||||
this.getBookList()
|
this.hotestpage++
|
||||||
|
this.booksetpage++
|
||||||
|
this.getBookList(this.commentsListTab, true)
|
||||||
},
|
},
|
||||||
onLoad(e) {
|
onLoad(e) {
|
||||||
this.windowWidth = uni.getSystemInfoSync().windowWidth;
|
this.windowWidth = uni.getSystemInfoSync().windowWidth;
|
||||||
@@ -196,6 +237,9 @@ import { data } from 'jquery';
|
|||||||
// 切换tab状态
|
// 切换tab状态
|
||||||
commentsTabCLi(e) {
|
commentsTabCLi(e) {
|
||||||
this.commentsListTab = e
|
this.commentsListTab = e
|
||||||
|
this.newestpage = 1
|
||||||
|
this.hotestpage = 1
|
||||||
|
this.booksetpage = 1
|
||||||
this.newList = []
|
this.newList = []
|
||||||
this.hotList = []
|
this.hotList = []
|
||||||
this.bookList = []
|
this.bookList = []
|
||||||
@@ -215,6 +259,22 @@ import { data } from 'jquery';
|
|||||||
url:'../comments/commentsDetail?bookid='+val.bookid+'&bfa_id='+val.id
|
url:'../comments/commentsDetail?bookid='+val.bookid+'&bfa_id='+val.id
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
clickLike(item){
|
||||||
|
this.$http
|
||||||
|
.post("forum/articles/chickForumContlike?forum_id=" + item.id,)
|
||||||
|
.then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
uni.showToast({
|
||||||
|
title:'点赞成功!',
|
||||||
|
icon:'success'
|
||||||
|
})
|
||||||
|
|
||||||
|
item.contlike++
|
||||||
|
}
|
||||||
|
}).catch((e)=>{
|
||||||
|
console.log(e,'e')
|
||||||
|
})
|
||||||
|
},
|
||||||
getBookList(flag, clear){
|
getBookList(flag, clear){
|
||||||
// 根据tab不同,获取最新书评、最热书评、书集列表
|
// 根据tab不同,获取最新书评、最热书评、书集列表
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
@@ -226,7 +286,7 @@ import { data } from 'jquery';
|
|||||||
}else if(flag == 2){
|
}else if(flag == 2){
|
||||||
httpurl = "forum/articles/getForumsHot?page=" + this.hotestpage + '&limit=10'
|
httpurl = "forum/articles/getForumsHot?page=" + this.hotestpage + '&limit=10'
|
||||||
}else{
|
}else{
|
||||||
httpurl = "forum/articles/getForumsAndBook?page=" + this.booksetpage + '&limit=10&userId=10100'// + this.userId
|
httpurl = "forum/articles/getForumsAndBook?page=" + this.booksetpage + '&limit=10&userId=' + this.userInfo.id
|
||||||
}
|
}
|
||||||
this.$http
|
this.$http
|
||||||
.post(httpurl)
|
.post(httpurl)
|
||||||
@@ -459,10 +519,10 @@ import { data } from 'jquery';
|
|||||||
-webkit-line-clamp: 5;
|
-webkit-line-clamp: 5;
|
||||||
line-clamp: 5;
|
line-clamp: 5;
|
||||||
-webkit-box-orient: vertical;
|
-webkit-box-orient: vertical;
|
||||||
font-size: 24rpx;
|
font-size: 26rpx;
|
||||||
margin-bottom: 20rpx;
|
margin-bottom: 20rpx;
|
||||||
margin-top:10rpx;
|
margin-top:10rpx;
|
||||||
min-height: 144rpx;
|
height: 172rpx;
|
||||||
}
|
}
|
||||||
.btns{
|
.btns{
|
||||||
font-size: 22rpx;
|
font-size: 22rpx;
|
||||||
@@ -540,7 +600,7 @@ import { data } from 'jquery';
|
|||||||
-webkit-line-clamp: 1;
|
-webkit-line-clamp: 1;
|
||||||
line-clamp: 1;
|
line-clamp: 1;
|
||||||
-webkit-box-orient: vertical;
|
-webkit-box-orient: vertical;
|
||||||
font-size: 24rpx;
|
font-size: 26rpx;
|
||||||
margin-bottom: 20rpx;
|
margin-bottom: 20rpx;
|
||||||
margin-top:10rpx;
|
margin-top:10rpx;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user