留言
This commit is contained in:
@@ -28,6 +28,11 @@
|
||||
</view>
|
||||
</view>
|
||||
<view :class="['courseList',fold ? 'fold' : '']" v-if="courseList.length > 0">
|
||||
<!-- 目录是否已经购买 -->
|
||||
<!-- 0:普通 1超级 2医学 3国学 -->
|
||||
<view class="endBox" v-if="librayList[curIndex].isBuy == 1 && userMsg.vip == '0'">
|
||||
您的课程观看有效期截止到:2025-06-14 00:00
|
||||
</view>
|
||||
<view class="item" v-for="(item, index) in courseList" :key="index" @click="chooseChapter(item, index)">
|
||||
<text>{{item.title}}</text>
|
||||
<uni-tag v-if="item.isAudition == 1" style="margin-left: 10rpx;" :inverted="true" text="试听"
|
||||
@@ -45,7 +50,6 @@
|
||||
</view>
|
||||
<view class="video_audio_audition_list">
|
||||
<!-- 试听视频/音频列表 -->
|
||||
|
||||
</view>
|
||||
<view class="buyBox flexbox" v-if="this.librayList[this.curIndex].isBuy == 0">
|
||||
<!-- 普通未购买 -->
|
||||
@@ -74,9 +78,9 @@
|
||||
<!-- </uni-section> -->
|
||||
<view class="linkPro">
|
||||
<uni-section class="mb-10 graybg" title="相关书籍" type="line">
|
||||
<template v-slot:right>
|
||||
<!-- <template v-slot:right>
|
||||
<span class="more" @click="pageJupm()">查看更多 >></span>
|
||||
</template>
|
||||
</template> -->
|
||||
</uni-section>
|
||||
<view class="list supermarketBox">
|
||||
<scroll-view class="scroll-view_H" scroll-x="true">
|
||||
@@ -109,15 +113,15 @@
|
||||
</uni-section>
|
||||
<view class="liuyanBox">
|
||||
<view class="box" v-if="sayList.length > 0">
|
||||
<view class="firstLeve flexbox leve" v-for="(item, index) in sayList" :key="index">
|
||||
<view class="imgbox">
|
||||
<view class="firstLeve flexbox leve" v-for="(item, index) in sayList" :key="index" style="flex-wrap: wrap;">
|
||||
<view class="imgbox" :style="getBackGround(item.user.avatar)">
|
||||
<view class="img">
|
||||
<image :src="item.user.avatar" mode="aspectFit"></image>
|
||||
</view>
|
||||
</view>
|
||||
<view class="contentBox">
|
||||
<view class="contentBox contentBoxfirstLeve">
|
||||
<view class="name">
|
||||
{{item.user.name}}
|
||||
{{item.user.name == '' ? '暂无昵称': item.user.name}}
|
||||
</view>
|
||||
<view class="content" v-if="item.content != ''">
|
||||
<rich-text class="content" :nodes="formatRichText(item.content)"></rich-text>
|
||||
@@ -130,19 +134,60 @@
|
||||
|
||||
</view>
|
||||
<view class="others flexbox">
|
||||
<view class="dianzan flexbox">
|
||||
<view class="dianzan flexbox" @click="support('one',index,item)">
|
||||
<u-icon v-if="item.support" name="heart-fill" color="#ff5500" size="24"></u-icon>
|
||||
<u-icon v-else name="heart" color="#999" size="24"></u-icon>
|
||||
<text>{{item.supportCount}}</text>
|
||||
</view>
|
||||
<view class="pinglun flexbox" @click="addSay(item)">
|
||||
<view class="pinglun flexbox" @click="addSay(index,item)">
|
||||
<!-- <u-icon name="chat-fill" color="#999" size="24"></u-icon> -->
|
||||
<u-icon name="chat" color="#999" size="24"></u-icon>
|
||||
<text>{{totalP}}</text>
|
||||
<text>{{item.children && item.children.length > 0? item.children.length : 0}}</text>
|
||||
</view>
|
||||
<text>{{item.createTime}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 二级 -->
|
||||
<view class="boxB" v-if="item.Bchildren && item.Bchildren.length > 0" style="width: 100%;">
|
||||
<view class=" flexbox leve" v-for="(citem, cindex) in item.Bchildren" :key="cindex">
|
||||
<view class="imgbox" :style="getBackGround(citem.user.avatar)">
|
||||
<view class="img">
|
||||
<image :src="citem.user.avatar" mode="aspectFit"></image>
|
||||
</view>
|
||||
</view>
|
||||
<view class="contentBox">
|
||||
<view class="name">
|
||||
{{citem.user.name == '' ? '暂无昵称': citem.user.name}}
|
||||
</view>
|
||||
<view class="content" v-if="citem.content != ''">
|
||||
<rich-text class="content" :nodes="formatRichText(citem.content)"></rich-text>
|
||||
</view>
|
||||
<view class="imagesList flexbox" v-if="citem.images !=''">
|
||||
<view class="item" v-for="(item3, index3) in citem.imgList" :key="index3">
|
||||
<image @click="previewImage(item3)" :src="item3" mode="widthFix"
|
||||
style="width: 80rpx; height: 80rpx;"></image>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="others flexbox">
|
||||
<view class="dianzan flexbox" @click="support(index,cindex,citem)">
|
||||
<u-icon v-if="citem.support" name="heart-fill" color="#ff5500" size="24"></u-icon>
|
||||
<u-icon v-else name="heart" color="#999" size="24"></u-icon>
|
||||
<text>{{citem.supportCount}}</text>
|
||||
</view>
|
||||
<!-- <view class="pinglun flexbox" @click="addSay(cindex,citem)">
|
||||
<u-icon name="chat" color="#999" size="24"></u-icon>
|
||||
<text>{{citem.children && citem.children.length > 0? item.children.length : 0}}</text>
|
||||
</view> -->
|
||||
<text style="margin-left: 20rpx;">{{citem.createTime}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="loadMore" v-show="item.Bchildren.length < item.children.length" @click="showMoreChildren(index,item)">
|
||||
<text>加载更多追评</text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- end -->
|
||||
</view>
|
||||
</view>
|
||||
<u-divider v-show="status == 2" text="已加载全部"></u-divider>
|
||||
@@ -179,7 +224,7 @@
|
||||
<!-- </view> -->
|
||||
<!-- 评论弹出 -->
|
||||
<u-popup key="2" :show="sayVisible" :round="10" @close="sayclose">
|
||||
<view class="contentBox">
|
||||
<view class="contentBox" style="padding: 20rpx;">
|
||||
<view class="" v-if="fatherSay.id != undefined">
|
||||
<view class="" style="font-size: 26rpx; margin-bottom: 20rpx;">
|
||||
<text>回复@:{{fatherSay.user.name}} 的留言</text>
|
||||
@@ -243,7 +288,7 @@
|
||||
</view>
|
||||
<!-- 表情 -->
|
||||
<view class="emoji" v-if="showEmoji">
|
||||
<text class="" @click="closeEmoji">关闭</text>
|
||||
<!-- <text class="" @click="closeEmoji">关闭</text> -->
|
||||
<emotion @emotion="handleEmj" :height="220" :windowWidth="windowWidth">
|
||||
</emotion>
|
||||
</view>
|
||||
@@ -284,6 +329,7 @@
|
||||
color: '#258feb',
|
||||
},
|
||||
tjProList: [],
|
||||
userMsg: {}, // 用户信息
|
||||
scrollTop: 0,
|
||||
activeStyle: {
|
||||
color: '#333',
|
||||
@@ -323,6 +369,7 @@
|
||||
status: 88,
|
||||
loadFlag: false,
|
||||
fatherSay:{},
|
||||
supportFlag:false,
|
||||
};
|
||||
},
|
||||
//第一次加载
|
||||
@@ -332,10 +379,10 @@
|
||||
this.windowWidth = uni.getSystemInfoSync().windowWidth;
|
||||
// this.pageTitle = e.title
|
||||
console.log(e, '传入分类id')
|
||||
this.getUserInfo()
|
||||
this.courseId = e.id
|
||||
// this.getCateList(this.courseId)
|
||||
this.getData(e.id)
|
||||
this.getSuperMarketList()
|
||||
this.getData(e.id)
|
||||
this.getSayList()
|
||||
},
|
||||
onPageScroll(e) {
|
||||
@@ -369,16 +416,137 @@
|
||||
},
|
||||
//方法
|
||||
methods: {
|
||||
getUserInfo() {
|
||||
// 用户详情
|
||||
// if (this.userInfo.id != undefined) {
|
||||
this.$http
|
||||
.post('book/user/info/' + this.userInfo.id)
|
||||
.then(res => {
|
||||
this.userMsg = res.user
|
||||
});
|
||||
// }
|
||||
},
|
||||
// 评论
|
||||
// 提交
|
||||
submitSay() {
|
||||
this.editorCtx.getContents({
|
||||
success: (res) => {
|
||||
console.log("save = >", res);
|
||||
this.htmlContent = res.html
|
||||
// 加载更多子评论
|
||||
showMoreChildren(i,val){
|
||||
console.log('更多评论');
|
||||
if(val.children.length <= val.Bchildren.length){
|
||||
uni.showToast({
|
||||
title:'没有更多了哦',
|
||||
icon:'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
let _list = []
|
||||
let _cc = [...val.children]
|
||||
_list = _cc.slice(val.Bchildren.length, val.Bchildren.length + 6)
|
||||
this.sayList[i].Bchildren = this.sayList[i].Bchildren.concat(_list)
|
||||
},
|
||||
// 点赞
|
||||
support(index1,index,val){
|
||||
console.log(index1,index,val);
|
||||
if(this.supportFlag){
|
||||
uni.showToast({
|
||||
title:'操作太快了,歇一下吧~',
|
||||
icon:'non'
|
||||
})
|
||||
return
|
||||
}
|
||||
this.supportFlag = true
|
||||
if(!val.support){
|
||||
$http.request({
|
||||
url: "common/courseGuestbook/addCourseGuestbookSupport",
|
||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||
data: {
|
||||
"userId": this.userInfo.id,
|
||||
"guestbookId":val.id ,
|
||||
},
|
||||
header: { //默认 无 说明:请求头
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
})
|
||||
.then(res => {
|
||||
// console.log('sayList =>', res);
|
||||
uni.showToast({
|
||||
title:"点赞成功",
|
||||
icon:'success'
|
||||
})
|
||||
if(index1 == 'one'){ // 一级
|
||||
this.sayList[index].support = true
|
||||
this.sayList[index].supportCount++
|
||||
}
|
||||
if(index1 != undefined && index1 != null && index1 != 'one'){
|
||||
this.sayList[index1].Bchildren[index].support = true
|
||||
this.sayList[index1].Bchildren[index].supportCount++
|
||||
}
|
||||
this.supportFlag = false
|
||||
}).catch(e => {
|
||||
uni.showToast({
|
||||
title:"点赞失败",
|
||||
icon:'error'
|
||||
})
|
||||
console.log(e,'e')
|
||||
this.supportFlag = false
|
||||
})
|
||||
|
||||
}else{
|
||||
$http.request({
|
||||
url: "common/courseGuestbook/cancelCourseGuestbookSupport",
|
||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||
data: {
|
||||
"userId": this.userInfo.id,
|
||||
"guestbookId":val.id ,
|
||||
},
|
||||
header: { //默认 无 说明:请求头
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
})
|
||||
.then(res => {
|
||||
// console.log('sayList =>', res);
|
||||
uni.showToast({
|
||||
title:"取消成功",
|
||||
icon:'success'
|
||||
})
|
||||
if(index1 == 'one'){ // 一级
|
||||
this.sayList[index].support = false
|
||||
this.sayList[index].supportCount--
|
||||
}
|
||||
if(index1 != undefined && index1 != null && index1 != 'one'){
|
||||
this.sayList[index1].Bchildren[index].support = false
|
||||
this.sayList[index1].Bchildren[index].supportCount--
|
||||
}
|
||||
this.supportFlag = false
|
||||
}).catch(e => {
|
||||
uni.showToast({
|
||||
title:"取消失败",
|
||||
icon:'error'
|
||||
})
|
||||
// console.log('888888888888888');
|
||||
this.supportFlag = false
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
// 获取内容
|
||||
getHtml(){
|
||||
return new Promise((resolve,reject) => {
|
||||
this.editorCtx.getContents({
|
||||
success:(res)=>{
|
||||
resolve(res)
|
||||
},
|
||||
fail:(error)=>{
|
||||
reject(err)
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
},
|
||||
// 提交
|
||||
async submitSay() {
|
||||
// await console.log(this.getHtml())
|
||||
let data = await this.getHtml()
|
||||
this.htmlContent = data.html
|
||||
console.log(this.htmlContent,'this.htmlContent--++++');
|
||||
|
||||
if (this.htmlContent == '' && this.uploadPicLIst.length == 0) {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
@@ -400,6 +568,8 @@
|
||||
forUserId = this.fatherSay.user.id
|
||||
pid = this.fatherSay.id
|
||||
}
|
||||
console.log(this.fatherSay.cIndex,'this.fatherSay.cIndex');
|
||||
// return false
|
||||
$http.request({
|
||||
url: "common/courseGuestbook/addCourseGuestbook",
|
||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||
@@ -426,9 +596,24 @@
|
||||
title: '提交成功'
|
||||
})
|
||||
}
|
||||
this.sayList.unshift(res.courseGuestbook)
|
||||
// console.log(res, '提交成功',this.sayList);
|
||||
let _obj = {...res.courseGuestbook}
|
||||
_obj.children = []
|
||||
_obj.Bchildren = []
|
||||
if (_obj.images != '') {
|
||||
_obj.imgList = _obj.images.split(',')
|
||||
}else{
|
||||
_obj.imgList = []
|
||||
}
|
||||
|
||||
console.log(this.sayList[this.fatherSay.cIndex],'this.fatherSay.cIndex------------')
|
||||
if(this.fatherSay.cIndex != undefined && this.fatherSay.cIndex != null ){ // 二级
|
||||
this.sayList[this.fatherSay.cIndex].Bchildren.unshift(_obj)
|
||||
|
||||
}else{ // 一级
|
||||
this.sayList.unshift(_obj)
|
||||
}
|
||||
this.sayVisible = false
|
||||
this.fatherSay = {}
|
||||
// this.getSayList()
|
||||
// 获得的新实例,插入到数组的前面
|
||||
|
||||
@@ -437,7 +622,7 @@
|
||||
icon: 'error',
|
||||
title: '提交失败'
|
||||
})
|
||||
console.log('提交报错');
|
||||
console.log('提交报错',e);
|
||||
})
|
||||
},
|
||||
// 查询课程的评论
|
||||
@@ -469,7 +654,12 @@
|
||||
this.totalP = res.page.total
|
||||
myList.map((item) => {
|
||||
if (item.images != '') {
|
||||
item.imgList = item.images.split(',')
|
||||
item.imgList = item.images.split(',')
|
||||
}
|
||||
if(item.children.length > 0){
|
||||
item.Bchildren = item.children.slice(0,5)
|
||||
}else{
|
||||
item.Bchildren = []
|
||||
}
|
||||
})
|
||||
this.sayList = this.sayList.concat(myList)
|
||||
@@ -589,44 +779,24 @@
|
||||
// #ifdef APP-PLUS || MP-WEIXIN || H5
|
||||
uni.createSelectorQuery().select('#editor').context((res) => {
|
||||
this.editorCtx = res.context
|
||||
this.editorCtx.clear()
|
||||
// this.editorCtx.clear()
|
||||
this.editorCtx.setContents(res.context)
|
||||
}).exec()
|
||||
// #endif
|
||||
},
|
||||
// end
|
||||
addSay(item) {
|
||||
this.sayVisible = true
|
||||
item ? this.fatherSay = item : ''
|
||||
addSay(fIndex,item) {
|
||||
this.sayVisible = true
|
||||
if(item){
|
||||
this.fatherSay = item
|
||||
this.fatherSay.cIndex = fIndex
|
||||
}
|
||||
console.log('fatherSay =>',this.fatherSay);
|
||||
},
|
||||
sayclose() {
|
||||
this.sayVisible = false
|
||||
this.fatherSay = {}
|
||||
},
|
||||
getSuperMarketList() {
|
||||
$http.request({
|
||||
url: "medical/labelAndMarket/getMarketShopProductList",
|
||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||
data: {
|
||||
"current": 1,
|
||||
"limit": 12,
|
||||
"medicineMarketId": "28"
|
||||
},
|
||||
header: { //默认 无 说明:请求头
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
})
|
||||
.then(res => {
|
||||
if (res.code == 0) {
|
||||
if (res.result.records.length > 0) {
|
||||
this.tjProList = res.result.records
|
||||
} else {
|
||||
this.tjProList = []
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
},
|
||||
},
|
||||
getData(id) {
|
||||
$http.request({
|
||||
url: "sociology/course/getCourseDetail",
|
||||
@@ -647,6 +817,11 @@
|
||||
this.catalogueId = this.librayList[0].id
|
||||
this.curId = this.librayList[0].id
|
||||
this.curIndex = 0
|
||||
if(res.data.shopProductList && res.data.shopProductList.length > 0){
|
||||
this.tjProList = res.data.shopProductList
|
||||
}else{
|
||||
this.tjProList
|
||||
}
|
||||
this.getChapterList(this.catalogueId)
|
||||
}
|
||||
}
|
||||
@@ -704,6 +879,7 @@
|
||||
// });
|
||||
},
|
||||
chooseChapter(item, index) {
|
||||
return false
|
||||
// 检查课程是否已经购买了 是否为试听
|
||||
if (item.isAudition == 1) {
|
||||
// 未购买仅试听
|
||||
@@ -806,11 +982,14 @@
|
||||
});
|
||||
},
|
||||
// 跳转
|
||||
onPageJump(url) {
|
||||
onPageJump(url,id) {
|
||||
uni.navigateTo({
|
||||
url: `${url}`
|
||||
url: `${url}?id=${id}`
|
||||
});
|
||||
},
|
||||
getBackGround(src){
|
||||
return `background: url(${src});background-size: contain;`
|
||||
},
|
||||
formatRichText(html) { //控制图片大小
|
||||
let newContent = html.replace(/<img[^>]*>/gi, function(match, capture) {
|
||||
match = match.replace(/style="[^"]+"/gi, '').replace(/style='[^']+'/gi, '');
|
||||
@@ -833,9 +1012,16 @@
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@import '@/style/mixin.scss';
|
||||
|
||||
.endBox{
|
||||
// @include theme("vipbtnbg");
|
||||
background-color: #d3f9e8;
|
||||
// color: #fff;
|
||||
font-size: 26rpx; margin: 20rpx 0;
|
||||
padding: 10rpx 20rpx;
|
||||
}
|
||||
::v-deep .contentBox {
|
||||
.ql-editor {
|
||||
|
||||
font-size: 26rpx;
|
||||
font-style: normal;
|
||||
min-height: 50rpx !important;
|
||||
@@ -850,7 +1036,22 @@
|
||||
margin: 0 auto;
|
||||
}
|
||||
}
|
||||
|
||||
.firstLeve{padding-bottom: 10rpx; border-bottom: 1px solid #f7f8f9;}
|
||||
.loadMore{text-align: center; margin-bottom: 20rpx;
|
||||
text{color: $themeColor; font-size: 26rpx;}
|
||||
}
|
||||
.boxB{margin-left: 60rpx; margin-top: 20rpx; background-color: #f7f8f9;
|
||||
padding-top: 20rpx; padding-left:10rpx;
|
||||
.imgbox{
|
||||
width: 40rpx !important;
|
||||
height: 40rpx !important;
|
||||
}
|
||||
.contentBox{width: calc(100% - 60rpx);}
|
||||
// .img{ width: 60rpx;
|
||||
// height: 60rpx;
|
||||
// image{width:60rpx; height: 60rpx; border-radius: 100%;}
|
||||
// }
|
||||
}
|
||||
.chooseImgType {
|
||||
margin-top: 20rpx;
|
||||
|
||||
@@ -906,7 +1107,7 @@
|
||||
margin-right: 20rpx;
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
position: relative;
|
||||
position: relative; overflow: hidden;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
@@ -956,7 +1157,7 @@
|
||||
}
|
||||
|
||||
.contentBox {
|
||||
padding: 20rpx;
|
||||
padding: 0 20rpx;
|
||||
|
||||
.icon {
|
||||
width: 80rpx;
|
||||
@@ -972,7 +1173,7 @@
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
|
||||
.imagesList {
|
||||
.imagesList { margin-top: 20rpx;
|
||||
.item {
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
@@ -984,25 +1185,32 @@
|
||||
.liuyanBox {
|
||||
padding: 0 20rpx;
|
||||
margin-top: 20rpx;
|
||||
.contentBoxfirstLeve{
|
||||
width: calc(100% - 70rpx);
|
||||
}
|
||||
}
|
||||
|
||||
.leve {
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
.imgbox {
|
||||
border: 1px solid #eee;
|
||||
margin-right: 10rpx;
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
border-radius: 100%; overflow: hidden;
|
||||
}
|
||||
|
||||
.img {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
border-radius: 100%;
|
||||
// .img {
|
||||
// width: 80rpx;
|
||||
// height: 80rpx;
|
||||
// border-radius: 100%;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 80rpx;
|
||||
}
|
||||
}
|
||||
// image {
|
||||
// width: 100%;
|
||||
// height: 80rpx;
|
||||
// }
|
||||
// }
|
||||
|
||||
.contentBox {
|
||||
font-size: 24rpx;
|
||||
@@ -1282,10 +1490,11 @@
|
||||
.courseList {
|
||||
position: relative;
|
||||
// background-color: #fff;
|
||||
padding: 0 20rpx;
|
||||
// padding: 0 20rpx;
|
||||
background-image: linear-gradient(0deg, #e9f0ff 0%, #fbfbff 100%);
|
||||
|
||||
.item {
|
||||
padding: 0 20rpx;
|
||||
font-size: 26rpx;
|
||||
height: 96rpx;
|
||||
line-height: 96rpx;
|
||||
|
||||
@@ -130,6 +130,14 @@
|
||||
}
|
||||
// console.log(this.scrollTop,'this.scrollTop')
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
console.log('下拉刷新')
|
||||
this.status = 3
|
||||
this.page = 1
|
||||
this.courseList = []
|
||||
this.getData(this.subTabId)
|
||||
uni.stopPullDownRefresh()
|
||||
},
|
||||
onReachBottom() {
|
||||
if (this.status != 2) {
|
||||
this.page++
|
||||
|
||||
Reference in New Issue
Block a user