This commit is contained in:
徐哼唧L
2024-01-31 15:24:52 +08:00
parent c1e414bcab
commit 5ae322d192
17 changed files with 912 additions and 449 deletions

View File

@@ -1,11 +1,11 @@
<template>
<!--父组件-->
<view class="container" style="padding-bottom: 10rpx;">
<!-- <view class="mini"></view> -->
<view>
<z-nav-bar :title="'医案-'+bookname"></z-nav-bar>
<!-- 基本信息 -->
<!-- 基本信息 -->
<view class="book_neir">
<view class="flexbox info">
<view class="item">
@@ -52,8 +52,8 @@
<!-- <view >
<uni-tag v-if="item.voices != ''" class="tag" size="small" :inverted="true" text="音频"
type="success" /></view> -->
<view ><uni-tag v-if="item.content != ''" class="tag" size="small" :inverted="true" text="文字"
type="primary" /></view>
<view><uni-tag v-if="item.content != ''" class="tag" size="small" :inverted="true" text="文字"
type="primary" /></view>
<!-- <image class="playingFig" src="/static/playingGif.gif" mode="aspectFill"></image> -->
</view>
</view>
@@ -61,17 +61,18 @@
<view style="width: 100%;">
<view v-if="status==0" style="text-align: center;">
<u-loading-icon style="display: inline-block;"></u-loading-icon>
<font style='vertical-align: super;margin-left: 10px;font-size: 26rpx;color: #909399;'>努力加载中</font>
<font style='vertical-align: super;margin-left: 10px;font-size: 26rpx;color: #909399;'>努力加载中
</font>
</view>
<view v-if="status==1">
<u-divider text="全部加载完成"></u-divider>
</view>
</view>
</view>
</view>
<u-divider v-else text="暂无讲书目录"></u-divider>
<music-play :playData="playData"></music-play>
<!-- 公共组件-每个页面必须引入 -->
<public-module></public-module>
<public-module></public-module>
<!-- <z-navigation></z-navigation> -->
</view>
</view>
@@ -98,19 +99,19 @@
data() {
return {
isBuy: false, // true 已购买false 未购买
playData: {},
playData: {},
bookInfo: {
author:{
authorName:''
author: {
authorName: ''
}
}, // 书籍详情
bookid: null, // 书籍id
status:3,
status: 3,
freeChapterCount: 0, // 免费章节数
yianList: [], // 书籍目录
videoList: [], //音频文件
page:1,
totalPage:0,
page: 1,
totalPage: 0,
}
},
onPullDownRefresh() {
@@ -122,13 +123,13 @@
uni.stopPullDownRefresh();
},
onReachBottom() {
console.log('到底了',this.page+1 , this.totalPage)
if(this.page+1 <= this.totalPage){
console.log('到底了', this.page + 1, this.totalPage)
if (this.page + 1 <= this.totalPage) {
this.page++
this.status = 0
this.getyianList()
}else{
} else {
this.status = 1
}
},
@@ -143,15 +144,15 @@
console.log(e, 'e')
uni.hideTabBar();
this.bookid = e.bookid
this.bookname = e.bookname
},
this.bookname = e.bookname
},
onShow() {
// this.yianList = []
// this.page = 1
// this.totalPage = 0
this.getyianList()
this.getBookInfo()
},
computed: {
...mapState(['userInfo'])
@@ -166,20 +167,20 @@
'userId': this.userInfo.id,
'bookId': this.bookid
}
checkBookRight(data,res=>{
checkBookRight(data, res => {
console.log(res)
if(res.success){
if (res.success) {
uni.navigateTo({
url: '../comments/comments?bookid=' + this.bookid,
});
}else{
} else {
uni.showToast({
title:'购买本书后方可查看此内容!',
icon:'none'
title: '购买本书后方可查看此内容!',
icon: 'none'
})
}
})
},
// 去打卡
gotoclock() {
@@ -189,7 +190,7 @@
},
getBookInfo() {
// 获取书本基本信息
this.$http
this.$http
.post('book/book/getBookInfo', {
'bookId': this.bookid,
'userId': this.userInfo.id
@@ -216,7 +217,7 @@
// url: './talkBookDetail?teachId=' + item.teachId +"&bookId="+item.bookId
// });
uni.navigateTo({
url: '../yian/yianDetail?medicalRecordsId='+item.medicalRecordsId,
url: '../yian/yianDetail?medicalRecordsId=' + item.medicalRecordsId,
});
},
@@ -226,39 +227,31 @@
url: '../eBook/bookMessage?Id=' + id + '&typ=' + e
});
},
// 获取章节列表
// 获取医案列表
getyianList() {
$http.request({
url: "book/bookMedicalRecords/listByBookId",
method: "POST",
data: {
"page": this.page,
"limit": 20,
"bookId": this.bookid
},
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
})
// this.$http
// .post('book/teach/getBookTeachItems', {
// 'bookId': this.bookid,
// 'limit': 20,
// 'page': this.page
// // 'userid': this.userInfo.id,
// // 'bookid':
// // 'id': this.playid
// })
url: "book/bookMedicalRecords/listByBookId",
method: "POST",
data: {
"page": this.page,
"limit": 20,
"bookId": this.bookid
},
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
})
.then(res => {
if (res.code == 0) {
console.log(res, '章节目录')
if (res.page.records.length > 0) {
this.yianList = this.yianList.concat(res.page.records)
this.status = 3
this.totalPage = res.page.pages
if(this.totalPage = res.page.current){
this.totalPage = res.page.pages
if (this.page == this.totalPage) {
this.status = 1
}
} else {
this.status = 3
}
} else {
this.yianList = []
this.totalPage = 0
@@ -268,19 +261,20 @@
console.log(e.msg)
})
},
},
}
</script>
<style lang="less">
.muluitem{
span{
.muluitem {
span {
white-space: nowrap;
overflow-x: hidden;
text-overflow: ellipsis;
}
}
.playingFig {
width: 100rpx;
height: 100rpx;