Merge branch 'xie0925'
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
<view class="bookinfo">
|
||||
<view class="case">
|
||||
<view class="book flexbox">
|
||||
<image src="../../static/icon/x1.jpg" mode="aspectFill"></image>
|
||||
<image src="../../static/icon/home_icon_0.png" mode="aspectFill"></image>
|
||||
<view class="clockInfo">
|
||||
<span>中医免疫学</span>
|
||||
<h3>#第三课:专业变现:你的专业 = 超级杠杆! 第一笔只是财富#</h3>
|
||||
@@ -51,7 +51,7 @@
|
||||
|
||||
<view class="case">
|
||||
<view class="book flexbox">
|
||||
<image src="../../static/icon/x1.jpg" mode="aspectFill"></image>
|
||||
<image src="../../static/icon/home_icon_0.png" mode="aspectFill"></image>
|
||||
<view class="clockInfo">
|
||||
<span>中医免疫学</span>
|
||||
<h3>#第三课:专业变现:你的专业 = 超级杠杆! 第一笔只是财富#</h3>
|
||||
@@ -93,7 +93,7 @@
|
||||
<view class="bookinfo">
|
||||
<view class="case">
|
||||
<view class="book flexbox">
|
||||
<image src="../../static/icon/x1.jpg" mode="aspectFill"></image>
|
||||
<image src="../../static/icon/home_icon_0.png" mode="aspectFill"></image>
|
||||
<view class="clockInfo">
|
||||
<span>中医免疫学</span>
|
||||
<h3>#第三课:专业变现:你的专业 = 超级杠杆! 第一笔只是财富#</h3>
|
||||
@@ -129,7 +129,7 @@
|
||||
|
||||
<view class="case">
|
||||
<view class="book flexbox">
|
||||
<image src="../../static/icon/x1.jpg" mode="aspectFill"></image>
|
||||
<image src="../../static/icon/home_icon_0.png" mode="aspectFill"></image>
|
||||
<view class="clockInfo">
|
||||
<span>中医免疫学</span>
|
||||
<h3>#第三课:专业变现:你的专业 = 超级杠杆! 第一笔只是财富#</h3>
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
<view class="bookinfo">
|
||||
<view class="case" v-for="(item, index) in recordList" :key="index">
|
||||
<view class="book flexbox" >
|
||||
<!-- <image src="../../static/icon/x1.jpg" mode="aspectFill"></image> -->
|
||||
<!-- <image src="../../static/icon/home_icon_0.png" mode="aspectFill"></image> -->
|
||||
<view class="clockInfo" >
|
||||
<!-- <span>中医免疫学</span> -->
|
||||
<h3><span class="day">第 <em>{{item.dayId}}</em> 天</span><br/>#{{item.TaskHeading}}#</h3>
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
{{bookMessage.name}}
|
||||
</view>
|
||||
<view style="color: #9b9b9b;font-size: 28rpx;margin:20rpx 0 0 0;max-width: 400rpx;line-height: 38rpx;">
|
||||
<p @click="onAuCHJump(bookMessage.authorId,1)" style="margin-bottom: 20rpx;">
|
||||
{{bookMessage.authorName}} [著] >
|
||||
<p @click="onAuCHJump(bookMessage.author.id,1)" style="margin-bottom: 20rpx;">
|
||||
{{bookMessage.author.authorName}} [著] >
|
||||
</p>
|
||||
<!-- <p @click="onAuCHJump(item.id,2)" v-for="item in this.bookMessage.publisherNIList">
|
||||
{{item.title}} >
|
||||
@@ -52,14 +52,17 @@
|
||||
<view class="item" v-for="(item,index) in libLIst" :key="index" >
|
||||
<view >
|
||||
<view v-if="3 > index"
|
||||
:class="[freeChapterCount < index ? 'graytitle' : '',
|
||||
userInfo.playingInfo.bookid==item.bookid && userInfo.playingInfo.chapterId == item.chapterId ? 'playing' : '']" @click="listenOne(item, index)">
|
||||
<span :class="[freeChapterCount-1 < index ? 'graytitle' : '']">{{item.chapterName}}</span>
|
||||
<uni-tag v-if="freeChapterCount-1 >= index" class="tag" size="small" :inverted="true" text="试听" type="success" />
|
||||
:class="[
|
||||
userInfo.playingInfo.bookId==item.bookId && userInfo.playingInfo.id == item.id ? 'playing' : '']" @click="listenOne(item, index)">
|
||||
<span :class="['graytitle']">{{item.chapter}}</span>
|
||||
<uni-tag v-if="item.isFree == 1" class="tag" size="small" :inverted="true" text="试听" type="success" />
|
||||
<!-- <image class="playingFig" src="/static/playingGif.gif" mode="aspectFill"></image> -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="" style="text-align: center;" @click="gotoListen">
|
||||
<text style="font-size: 28rpx; color:#27b386">查看完整目录</text>
|
||||
</view>
|
||||
</view>
|
||||
<u-divider v-else text="暂无试听数据"></u-divider>
|
||||
|
||||
@@ -124,7 +127,9 @@
|
||||
tab_muJian: 0,
|
||||
bookId: '',
|
||||
bookMessage: {
|
||||
flag: false
|
||||
flag: false,
|
||||
author:{authorName:''}
|
||||
|
||||
},
|
||||
bookCatalogue: [],
|
||||
bgiStyle: {
|
||||
@@ -171,7 +176,11 @@
|
||||
getData() {
|
||||
// 获取电子书详情
|
||||
this.$http
|
||||
.post('book/book/appinfo/' + this.bookId + '/' + this.userInfo.id)
|
||||
// .post('book/book/appinfo/' + this.bookId + '/' + this.userInfo.id)
|
||||
.post('book/book/getBookInfo', {
|
||||
'bookId': this.bookId,
|
||||
'userId': this.userInfo.id
|
||||
})
|
||||
.then(res => {
|
||||
console.log('书详细',res.book)
|
||||
this.bookMessage = res.book
|
||||
@@ -180,7 +189,6 @@
|
||||
this.bokMesDet.images = res.book.images
|
||||
this.isBuy = res.book.isBuy
|
||||
this.freeChapterCount = res.book.freeChapterCount
|
||||
|
||||
this.bokMesDet.userId = this.userInfo.id
|
||||
|
||||
if (this.bookMessage.publisherName.indexOf(',') > 0) {
|
||||
@@ -230,7 +238,7 @@
|
||||
// 去购买
|
||||
goBuy(){
|
||||
uni.navigateTo({
|
||||
url: '../bookShop/settlementBook?type=2&list=' + this.bookId
|
||||
url: '../bookShop/commodityDetail?id=' + this.bookMessage.productId
|
||||
});
|
||||
},
|
||||
// 获取书评
|
||||
@@ -280,8 +288,8 @@
|
||||
getLibList(){
|
||||
this.$http
|
||||
.post('book/book/getBookCatalogue', {
|
||||
'userid': this.userInfo.id,
|
||||
'bookid': this.bookId,
|
||||
'userId': this.userInfo.id,
|
||||
'bookId': this.bookId,
|
||||
// 'id': this.playid
|
||||
})
|
||||
.then(res => {
|
||||
@@ -330,6 +338,7 @@
|
||||
<style lang="scss" scoped>
|
||||
@import '@/style/mixin.scss';
|
||||
.playing{color: #1daa5c;}
|
||||
.graytitle{color: #666;}
|
||||
.flexbox{display: flex;}
|
||||
.tags{
|
||||
.tag{
|
||||
|
||||
@@ -38,8 +38,9 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="listenList" v-if="bookList.length > 0">
|
||||
<view class="wrap" v-if="contentShow == 1">
|
||||
<view class="listenList" >
|
||||
<view class="wrap" v-if="contentShow == 1">
|
||||
<view class="" v-if="bookList.length > 0">
|
||||
<u-row gutter="16" justify="flex-start">
|
||||
<u-col span="6" v-for="(item,index) in bookList" :key="index">
|
||||
<view >
|
||||
@@ -71,46 +72,60 @@
|
||||
<view class="bookName">{{item.bookName}}</view>
|
||||
</view>
|
||||
</u-col>
|
||||
</u-row>
|
||||
</u-row>
|
||||
<view>
|
||||
<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>
|
||||
</view>
|
||||
<view v-if="status==1">
|
||||
<u-divider text="全部加载完成"></u-divider>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<u-divider v-else text="暂无已购买图书~"></u-divider>
|
||||
</view>
|
||||
<view class="wrap" v-if="contentShow == 2">
|
||||
<u-row gutter="16" justify="flex-start">
|
||||
<view class="wrap" v-if="contentShow == 2">
|
||||
<view class="" v-if="tjBookLIst.length > 0">
|
||||
<u-row gutter="16" justify="flex-start" >
|
||||
<u-col span="6" v-for="(item,index) in tjBookLIst" :key="index">
|
||||
<view class="flexbox listenItem">
|
||||
<view class="info">
|
||||
<view class="videoBox demo-layout bg-purple" @click="goDetail(item.product)">
|
||||
<image :src="item.product.productImages" mode="scaleToFill" ></image>
|
||||
<view class="videoBox demo-layout bg-purple" @click="goDetail(item)">
|
||||
<image :src="item.images" mode="scaleToFill" ></image>
|
||||
</view>
|
||||
</view>
|
||||
<view class="btns">
|
||||
<view class="item flexbox" @click="goDetail(item.product)">
|
||||
<view class="item flexbox" @click="goDetail(item)">
|
||||
<image src="../../static/icon/tu1.png" mode="aspectFit"></image>
|
||||
<text>读 书</text>
|
||||
</view>
|
||||
<view class="item flexbox" @click="goToListen(item.product)">
|
||||
<view class="item flexbox" @click="goToListen(item)">
|
||||
<image src="../../static/icon/tu2.png" mode="aspectFit"></image>
|
||||
<text>听 书</text>
|
||||
</view>
|
||||
<view class="item flexbox" @click="wgGoPingshu(item.product)">
|
||||
<view class="item flexbox" @click="wgGoPingshu(item)">
|
||||
<image src="../../static/icon/tu3.png" mode="aspectFit"></image>
|
||||
<text>评 书</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bookName">{{item.product.productName}}</view>
|
||||
<view class="bookName">{{item.name}}</view>
|
||||
</u-col>
|
||||
</u-row>
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<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>
|
||||
</view>
|
||||
<view v-if="status==1">
|
||||
<u-divider text="全部加载完成"></u-divider>
|
||||
</view>
|
||||
</view>
|
||||
</u-row>
|
||||
<view>
|
||||
<view v-if="tjstatus==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>
|
||||
</view>
|
||||
<view v-if="tjstatus==1">
|
||||
<u-divider text="全部加载完成"></u-divider>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<u-divider v-else text="暂无推荐图书~"></u-divider>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="shuwuLink">
|
||||
<image @click="" src="../../static/icon/shuwu.jpg" mode="aspectFit"></image>
|
||||
</view> -->
|
||||
@@ -141,6 +156,7 @@
|
||||
status: 3,
|
||||
ygtotalPage:1,
|
||||
tjPage:1,
|
||||
tjstatus:3,
|
||||
tjTotalPage:1,
|
||||
tjBookLIst:[],
|
||||
contentButtonList: [{
|
||||
@@ -153,54 +169,58 @@
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
|
||||
},
|
||||
onHide() {
|
||||
// this.contentShow = 1
|
||||
this.page = 1
|
||||
this.tjPage = 1
|
||||
this.bookList = []
|
||||
this.tjBookLIst = []
|
||||
},
|
||||
onShow() {
|
||||
this.getListDate()
|
||||
this.getfreeBook()
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
console.log('下拉刷新了')
|
||||
uni.stopPullDownRefresh();
|
||||
if(this.contentShow == 1){
|
||||
// this.page=1, // 页码
|
||||
this.bookList = []
|
||||
this.getfreeBook()
|
||||
}
|
||||
else if(this.contentShow == 2){
|
||||
// this.tjPage=1, // 页码
|
||||
this.tjBookLIst = []
|
||||
this.getListDate()
|
||||
}
|
||||
this.contentShow = 1
|
||||
this.page = 1
|
||||
this.tjPage = 1
|
||||
this.bookList = []
|
||||
this.getfreeBook()
|
||||
this.tjBookLIst = []
|
||||
this.getListDate()
|
||||
},
|
||||
onReachBottom() {
|
||||
this.loadingNow = true
|
||||
// this.loadingNow = true
|
||||
console.log('到底了')
|
||||
|
||||
// if(this.contentShow == 1){
|
||||
// //console.log(this.page , this.ygtotalPage)
|
||||
// if(this.page < this.ygtotalPage){
|
||||
// this.page++
|
||||
// console.log('加载',this.page)
|
||||
// this.status = 0
|
||||
// this.getfreeBook()
|
||||
if(this.contentShow == 1){
|
||||
//console.log(this.page , this.ygtotalPage)
|
||||
// if(this.page < this.ygtotalPage){
|
||||
// this.page++
|
||||
// console.log('加载',this.page)
|
||||
// this.status = 0
|
||||
// this.getfreeBook()
|
||||
|
||||
// }else{
|
||||
// this.status = 1
|
||||
// console.log('加载完成了',this.page)
|
||||
// return
|
||||
// }
|
||||
// }else{
|
||||
// this.status = 1
|
||||
// console.log('加载完成了',this.page)
|
||||
// return
|
||||
// }
|
||||
|
||||
// }else if(this.contentShow == 2){
|
||||
// if(this.tjPage < this.tjTotalPage){
|
||||
// this.tjPage++
|
||||
// console.log('加载',this.tjPage)
|
||||
// this.status = 0
|
||||
// this.getListDate()
|
||||
|
||||
// }else{
|
||||
// this.status = 1
|
||||
// console.log('加载完成了',this.tjPage)
|
||||
// return
|
||||
// }
|
||||
// }
|
||||
}else if(this.contentShow == 2){
|
||||
if(this.tjPage+1 < this.tjTotalPage){
|
||||
this.tjPage++
|
||||
// console.log('加载',this.tjPage)
|
||||
this.tjstatus = 0
|
||||
this.getListDate()
|
||||
}else{
|
||||
this.tjstatus = 1
|
||||
}
|
||||
}
|
||||
},
|
||||
components:{
|
||||
musicPlay
|
||||
@@ -216,7 +236,7 @@
|
||||
wgGoPingshu(item){
|
||||
console.log('未购买评书',item)
|
||||
uni.navigateTo({
|
||||
url: '../comments/comments?bookid='+item.bookId,
|
||||
url: '../comments/comments?bookid='+item.id,
|
||||
// url:'../bookShop/commodityDetail'
|
||||
|
||||
});
|
||||
@@ -233,8 +253,7 @@
|
||||
this.contentShow = e.index
|
||||
},
|
||||
// 获取已购买书籍
|
||||
getfreeBook(){
|
||||
console.log('获取已购买书籍')
|
||||
getfreeBook(){
|
||||
this.$http
|
||||
.post('book/userebookbuy/buylist', {
|
||||
// .post('book/buyorderdetail/querybuy', {
|
||||
@@ -247,28 +266,20 @@
|
||||
if(res.code == 0){
|
||||
// this.ygtotalPage = res.page.totalPage
|
||||
//var arr = res.page
|
||||
res.page.forEach(item => {
|
||||
if(item.canListen){
|
||||
this.bookList.push(item)
|
||||
}
|
||||
})
|
||||
// console.log(this.bookList,'arr')
|
||||
//this.bookList = arr
|
||||
// this.bookList = this.bookList.concat(res.page.list)
|
||||
console.log(res,'已购买')
|
||||
this.status = 3
|
||||
this.bookList = res.page
|
||||
console.log(res,'获取已购买书籍')
|
||||
// this.status = 3
|
||||
}
|
||||
|
||||
});
|
||||
},
|
||||
|
||||
// 获取推荐图书(未购买)
|
||||
getListDate(){
|
||||
console.log('获取推荐图书(未购买)')
|
||||
getListDate(){
|
||||
this.loadingNow = false
|
||||
// 获取书架列表
|
||||
this.$http
|
||||
.post('book/shopproduct/booklist', {
|
||||
.post('book/book/getBestBooks', {
|
||||
'userId': this.userInfo.id,
|
||||
'limit':10,
|
||||
'page':this.tjPage
|
||||
@@ -278,24 +289,15 @@
|
||||
if(res.code == 0){
|
||||
// this.tjTotalPage = res.pages.totalPage
|
||||
var arr = []
|
||||
if(res.pages.length > 0){
|
||||
// for (var i=0; i<res.pages.list.length; i++ ) {
|
||||
// var booidArr = []
|
||||
// if(res.pages.list[i].bookId != null){
|
||||
// booidArr = res.pages.list[i].bookId.split(',')
|
||||
// //res.pages.list[i].bookId = booidArr
|
||||
// res.pages.list[i].bookId = booidArr
|
||||
// }else{
|
||||
// res.pages.list[i].bookId = []
|
||||
// }
|
||||
// }
|
||||
//console.log(res.pages,'res.pages.list')
|
||||
// var arr = res.pages.list
|
||||
this.tjBookLIst = res.pages
|
||||
// this.tjBookLIst = this.tjBookLIst.concat(res.pages.list)
|
||||
// console.log(this.tjBookLIst[0])
|
||||
this.status = 3
|
||||
} }
|
||||
if(res.page.records.length > 0){
|
||||
this.tjBookLIst = this.tjBookLIst.concat(res.page.records)
|
||||
this.tjTotalPage = res.page.pages
|
||||
this.tjstatus = 3
|
||||
}else{
|
||||
this.tjBookLIst = []
|
||||
this.tjTotalPage = 1
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
},
|
||||
@@ -304,14 +306,14 @@
|
||||
goDetail(item) {
|
||||
console.log(item,'goDetail-----')
|
||||
uni.navigateTo({
|
||||
url: '../bookShop/commodityDetail?id=' + item.productId
|
||||
url: '../eBook/bookContent?Id=' + item.id
|
||||
// url: '../bookShop/commodityDetail?id=' + item.id
|
||||
});
|
||||
},
|
||||
goToListen(item){
|
||||
console.log(item,'item')
|
||||
|
||||
console.log(item,'item')
|
||||
uni.navigateTo({
|
||||
url: "../listen/listen?bookid="+item.bookId
|
||||
url: "../listen/listen?bookid="+item.id
|
||||
});
|
||||
|
||||
},
|
||||
@@ -334,7 +336,7 @@
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import '@/style/mixin.scss';
|
||||
.hehan{width: 80%; margin: 0 auto;}
|
||||
.hehan{width: 50%; margin: 0 auto;}
|
||||
.home_lunbo {
|
||||
margin: 40rpx 30rpx 0 30rpx;
|
||||
}
|
||||
|
||||
@@ -10,7 +10,9 @@
|
||||
</view> -->
|
||||
<!-- 正在播放章节 -->
|
||||
<view class="playTitle flexbox">
|
||||
<text class="nowPlayTitle">正在播放:</text><text-scroll :myStyle="StyleSheet" :text="boardRemark" class="textScroll"></text-scroll>
|
||||
<text class="nowPlayTitle">正在播放:</text>
|
||||
<text-scroll v-if="userInfo.playTitle && userInfo.playTitle != ''" :myStyle="StyleSheet" :text="userInfo.playTitle" class="textScroll"></text-scroll>
|
||||
<text-scroll v-else :myStyle="StyleSheet" :text="noplayTitle" class="textScroll"></text-scroll>
|
||||
</view>
|
||||
|
||||
<!-- 播放器 -->
|
||||
@@ -52,7 +54,7 @@
|
||||
export default {
|
||||
components: {
|
||||
cxAdudioPlay,
|
||||
textScroll,
|
||||
textScroll,
|
||||
// musicPlay
|
||||
},
|
||||
data() {
|
||||
@@ -60,7 +62,7 @@
|
||||
playData:{},
|
||||
stopPlay:false, // 关闭音频
|
||||
jia:false, // 下一首
|
||||
|
||||
noplayTitle:'未在播放',
|
||||
current:0,
|
||||
bookid:null, // 书籍id
|
||||
playid:null, // 正在播放的章节id
|
||||
@@ -115,10 +117,10 @@
|
||||
},
|
||||
computed: {
|
||||
...mapState(['userInfo']),
|
||||
boardRemark(){
|
||||
return this.userInfo.playTitle
|
||||
// console.log(this.userInfo, 'this.userInfo')
|
||||
},
|
||||
// boardRemark(){
|
||||
// //console.log(this.userInfo, 'this.userInfo')
|
||||
// return this.userInfo.playTitle
|
||||
// },
|
||||
},
|
||||
methods: {
|
||||
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
{{bookInfo.name}}
|
||||
</view>
|
||||
<view style="color: #9b9b9b;font-size: 28rpx;margin:20rpx 0 0 0;max-width: 400rpx;line-height: 38rpx;">
|
||||
<p @click="onAuCHJump(bookInfo.authorId,1)" style="margin-bottom: 20rpx;">
|
||||
{{bookInfo.authorName}} [著] >
|
||||
<p @click="onAuCHJump(bookInfo.author.id,1)" style="margin-bottom: 20rpx;">
|
||||
{{bookInfo.author.authorName}} [著] >
|
||||
</p>
|
||||
<p @click="onAuCHJump(item.id,2)" v-for="item in this.bookInfo.publisherNIList">
|
||||
{{item.title}} >
|
||||
@@ -57,7 +57,7 @@
|
||||
</view>
|
||||
<!-- 试听组 -->
|
||||
<view class="home_nar flexbox" v-else>
|
||||
<view class="hn_cl_tit shiting" @click="buyBook">
|
||||
<view class="hn_cl_tit shiting" @click="buyBook" v-if="bookInfo.productId != null">
|
||||
<image src="../../static/icon/goumai.png" mode="aspectFit"></image>
|
||||
<text>立即购买</text>
|
||||
</view>
|
||||
@@ -76,12 +76,14 @@
|
||||
-->
|
||||
<view class="playList" v-if="libLIst.length > 0">
|
||||
<view class="item" v-for="(item,index) in libLIst" :key="index" >
|
||||
<!-- {{userInfo.playingInfo.bookId}}-{{item.bookId}}
|
||||
{{userInfo.playingInfo.id}} - {{item.id}} -->
|
||||
<view >
|
||||
<view
|
||||
:class="['flexbox',freeChapterCount < index && isBuy == false ? 'graytitle' : '',
|
||||
userInfo.playingInfo.bookid==item.bookid && userInfo.playingInfo.chapterId == item.chapterId ? 'playing' : '']" @click="listenOne(item, index)">
|
||||
<span :class="[freeChapterCount-1 < index && isBuy == false ? 'graytitle' : '','muluspan']">{{item.chapterName}}</span>
|
||||
<view><uni-tag v-if="freeChapterCount-1 >= index && isBuy == false" class="tag" size="small" :inverted="true" text="试听" type="success" /></view>
|
||||
:class="['flexbox',
|
||||
userInfo.playingInfo.bookId == item.bookId && userInfo.playingInfo.id == item.id ? 'playing' : '']" @click="listenOne(item, index)">
|
||||
<span :class="['graytitle','muluspan']">{{item.chapter}}</span>
|
||||
<view><uni-tag v-if="item.isFree == 1" class="tag" size="small" :inverted="true" text="试听" type="success" /></view>
|
||||
<!-- <image class="playingFig" src="/static/playingGif.gif" mode="aspectFill"></image> -->
|
||||
</view>
|
||||
</view>
|
||||
@@ -118,7 +120,9 @@
|
||||
jia:false, // 下一I首
|
||||
forceRefresh:true,
|
||||
current:0,
|
||||
bookInfo:{}, // 书籍详情
|
||||
bookInfo:{
|
||||
author:{authorName:''}
|
||||
}, // 书籍详情
|
||||
bookid:null, // 书籍id
|
||||
playid:null, // 正在播放的章节id
|
||||
playchapName:'', // 正在播放的章节名称
|
||||
@@ -162,6 +166,7 @@
|
||||
boardRemark: '',
|
||||
StyleSheet:'font-size:36rpx; text-align:center',
|
||||
jian:false, // 上一曲切换
|
||||
productId:null,
|
||||
}
|
||||
},
|
||||
//第一次加载
|
||||
@@ -172,9 +177,6 @@
|
||||
uni.hideTabBar();
|
||||
this.bookid = e.bookid
|
||||
//console.log(this.userInfo.playFlag,'this.userInfo.playFlag')
|
||||
this.getLibList()
|
||||
this.getBookInfo()
|
||||
|
||||
},
|
||||
created() {
|
||||
|
||||
@@ -184,13 +186,32 @@
|
||||
if(this.userInfo.orderPlayBtn != undefined){
|
||||
this.orderPlayBtn = this.userInfo.orderPlayBtn
|
||||
}
|
||||
|
||||
console.log(this.userInfo.playingInfo,'userInfo.playingInfo------')
|
||||
this.getLibList()
|
||||
this.getBookInfo()
|
||||
//this.getProductID()
|
||||
},
|
||||
computed: {
|
||||
...mapState(['userInfo'])
|
||||
},
|
||||
methods: {
|
||||
...mapMutations(['setUserInfo']),
|
||||
|
||||
// bookid查商品id
|
||||
// getProductID(){
|
||||
// $http.post('book/shopproduct/bookinfo/' + this.bookid)
|
||||
// .then(res => {
|
||||
// console.log(res,'查询到的商品id')
|
||||
// if (res.code == 0 && res.shopProduct != null) {
|
||||
// this.productId = res.shopProduct.productId
|
||||
// }else{
|
||||
// this.productId = null
|
||||
// }
|
||||
|
||||
// }).catch(e => {
|
||||
// console.log(e,'eid')
|
||||
// });
|
||||
// },
|
||||
// 查看本书更多书评
|
||||
toMore(val){
|
||||
console.log(val,'val')
|
||||
@@ -206,8 +227,11 @@
|
||||
},
|
||||
getBookInfo(){
|
||||
// 获取书本基本信息
|
||||
this.$http
|
||||
.post('book/book/appinfo/' + this.bookid + '/' + this.userInfo.id)
|
||||
this.$http
|
||||
.post('book/book/getBookInfo', {
|
||||
'bookId': this.bookid,
|
||||
'userId': this.userInfo.id
|
||||
})
|
||||
.then(res => {
|
||||
if(res.code == 0){
|
||||
console.log(res,'res')
|
||||
@@ -241,10 +265,11 @@
|
||||
},
|
||||
}).then(res => {
|
||||
console.log(res,'历史记录')
|
||||
|
||||
if(res.readRate != null){
|
||||
// 有听书进度时
|
||||
var item = res.readRate
|
||||
if(this.$bgm._options.src != '' && res.readRate.chapterId == this.userInfo.playingInfo.chapterId && res.readRate.bookId == this.userInfo.playingInfo.bookid ){
|
||||
if(this.$bgm._options.src != '' && res.readRate.chapterId == this.userInfo.playingInfo.id && res.readRate.bookId == this.userInfo.playingInfo.bookId ){
|
||||
// console.log(this.$bgm)
|
||||
if(this.$bgm.playing){
|
||||
console.log('线上存储进度是同一条数据,不做处理')
|
||||
@@ -257,7 +282,7 @@
|
||||
|
||||
this.onlineH.playIndex = this.libLIst.findIndex(function(info){
|
||||
// console.log(info,'info')
|
||||
if(item.chapterId == info.chapterId && item.bookId == info.bookid ){
|
||||
if(item.chapterId == info.id && item.bookId == info.bookId ){
|
||||
return info;
|
||||
}
|
||||
})
|
||||
@@ -268,18 +293,23 @@
|
||||
this.onlineH.time = 0
|
||||
console.log('到这++')
|
||||
|
||||
}
|
||||
console.log('到这')
|
||||
}
|
||||
this.$music.setList(this.libLIst,'autoPlay',this.onlineH.playIndex, this.onlineH.time)
|
||||
})
|
||||
},
|
||||
addMusicList(){
|
||||
addMusicList(){
|
||||
if(this.libLIst.length == 0){
|
||||
uni.showToast({
|
||||
title:'没有音频可以播放哦~',
|
||||
icon:'none'
|
||||
})
|
||||
return false
|
||||
}
|
||||
this.getListenRate()
|
||||
// this.playData = {
|
||||
// 'myList' : this.libLIst,
|
||||
// // 'fengImg' : this.fengImg,
|
||||
// }
|
||||
|
||||
// }
|
||||
// 显示播放组件
|
||||
this.setUserInfo({'playVisible':true})
|
||||
uni.setStorage({
|
||||
@@ -299,14 +329,15 @@
|
||||
if(this.libLIst.length > 0){
|
||||
this.setUserInfo({'playIndex': index})
|
||||
this.$music.setList(this.libLIst,'autoPlay',index)
|
||||
this.setUserInfo({'playVisible': true})
|
||||
this.setUserInfo({'playVisible': true})
|
||||
|
||||
uni.setStorage({
|
||||
key: 'playVisible',
|
||||
data: true,
|
||||
success: function () {
|
||||
console.log('success');
|
||||
}
|
||||
});
|
||||
});
|
||||
// this.fengImg = newVal.fengImg
|
||||
|
||||
// 本地存储播放列表
|
||||
@@ -332,8 +363,8 @@
|
||||
// 购买
|
||||
buyBook(){
|
||||
uni.navigateTo({
|
||||
url: '../bookShop/settlementBook?type=2&list=' + this.bookid
|
||||
});
|
||||
url: '../bookShop/commodityDetail?id=' + this.bookInfo.productId
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
@@ -394,8 +425,8 @@
|
||||
getLibList(){
|
||||
this.$http
|
||||
.post('book/book/getBookCatalogue', {
|
||||
'userid': this.userInfo.id,
|
||||
'bookid': this.bookid,
|
||||
'userId': this.userInfo.id,
|
||||
'bookId': this.bookid,
|
||||
// 'id': this.playid
|
||||
})
|
||||
.then(res => {
|
||||
@@ -525,10 +556,12 @@
|
||||
}
|
||||
}
|
||||
.charType{display: inline; width:20px !important;}
|
||||
.graytitle{color: #999;}
|
||||
.graytitle{color: #666;}
|
||||
.yigoumai{background-color: #ffc773;}
|
||||
.shiting{background-color:#f47983 ; }
|
||||
.playing{color: #1daa5c;}
|
||||
.playing{color: #1daa5c;
|
||||
.graytitle{color: #1daa5c !important;}
|
||||
}
|
||||
.chaoshi{background-color:#1daa5c ; }
|
||||
.home_nar{margin: 30rpx 0; justify-content: space-between;}
|
||||
.hn_cl_tit {
|
||||
|
||||
@@ -380,9 +380,7 @@
|
||||
// 获取推荐数据
|
||||
this.getJtData()
|
||||
},
|
||||
getJtData(){
|
||||
|
||||
console.log('++++++++')
|
||||
getJtData(){
|
||||
this.$http
|
||||
.post('book/label/list',{
|
||||
'splId': this.tabsid,
|
||||
|
||||
@@ -96,7 +96,7 @@ import { data } from 'jquery';
|
||||
getBooks(){
|
||||
this.$http
|
||||
.post('book/teach/getTeachBooks',{
|
||||
'limit': 9,
|
||||
'limit': 100,
|
||||
'page': this.page
|
||||
})
|
||||
.then(res => {
|
||||
|
||||
@@ -5,14 +5,14 @@
|
||||
<view class="title">{{talkBookDetail.title}}</view>
|
||||
<view class="voices" v-if="talkBookDetail.voices != '' && audioShow">
|
||||
<audio style="text-align: left" :src="talkBookDetail.voices" poster="../../static/icon/fengziIcon.jpg"
|
||||
:name="talkBookDetail.title" :author="bookInfo.authorName" :action="audioAction" controls></audio>
|
||||
:name="talkBookDetail.title" :author="bookInfo.author.authorName" :action="audioAction" controls></audio>
|
||||
</view>
|
||||
<view class="content" v-if="talkBookDetail.content != ''" v-html="talkBookDetail.content"></view>
|
||||
<view class="content" v-else></view>
|
||||
<view class="time">
|
||||
<text>{{talkBookDetail.createTime}}</text>
|
||||
</view>
|
||||
<view class="tuijin" v-if="!isBuy">
|
||||
<view class="tuijin" v-if="!isBuy && bookInfo.productId != null">
|
||||
<p>觉得这本书还不错?</p>
|
||||
<view class="flexbox" style="justify-content: space-between; border: 1px solid #55aa7f; padding: 10rpx; border-radius: 10rpx;">
|
||||
<view class="flexbox">
|
||||
@@ -22,7 +22,7 @@
|
||||
</view>
|
||||
<view>
|
||||
<text style=" display: inline-block; margin-top: 40rpx;">{{bookInfo.name}}</text><br/>
|
||||
<text>作者:{{bookInfo.authorName}}</text>
|
||||
<text>作者:{{bookInfo.author.authorName}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="btn" @click="gotoBuy()">
|
||||
@@ -57,7 +57,11 @@
|
||||
playData: {},
|
||||
teachId: null, // 讲书id
|
||||
bookId: null, // 书籍id
|
||||
bookInfo: {}, // 书籍信息
|
||||
bookInfo: {
|
||||
author:{
|
||||
authorName:''
|
||||
}
|
||||
}, // 书籍信息
|
||||
talkBookDetail: {},
|
||||
}
|
||||
},
|
||||
@@ -78,13 +82,16 @@
|
||||
// 购买
|
||||
gotoBuy(){
|
||||
uni.navigateTo({
|
||||
url: '../bookShop/settlementBook?type=2&list=' + this.bookId
|
||||
url: '../bookShop/commodityDetail?id=' + this.bookInfo.productId
|
||||
});
|
||||
},
|
||||
getBookInfo() {
|
||||
// 获取书本基本信息
|
||||
this.$http
|
||||
.post('book/book/appinfo/' + this.bookId + '/' + this.userInfo.id)
|
||||
this.$http
|
||||
.post('book/book/getBookInfo', {
|
||||
'bookId': this.bookId,
|
||||
'userId': this.userInfo.id
|
||||
})
|
||||
.then(res => {
|
||||
if (res.code == 0) {
|
||||
console.log(res, 'res')
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<template>
|
||||
<!--父组件-->
|
||||
|
||||
<view class="container">
|
||||
<view class="container" style="padding-bottom: 10rpx;">
|
||||
<!-- <view class="mini"></view> -->
|
||||
<view>
|
||||
<z-nav-bar title="讲书目录"></z-nav-bar>
|
||||
<!-- 基本信息 -->
|
||||
<!-- 基本信息 -->
|
||||
<view class="book_neir">
|
||||
<view class="flexbox info">
|
||||
<view class="item">
|
||||
@@ -24,8 +24,8 @@
|
||||
</view>
|
||||
<view
|
||||
style="color: #9b9b9b;font-size: 28rpx;margin:20rpx 0 0 0;max-width: 400rpx;line-height: 38rpx;">
|
||||
<p @click="onAuCHJump(bookInfo.authorId,1)" style="margin-bottom: 20rpx;">
|
||||
{{bookInfo.authorName}} [著] >
|
||||
<p @click="onAuCHJump(bookInfo.author.id,1)" style="margin-bottom: 20rpx;">
|
||||
{{bookInfo.author.authorName}} [著] >
|
||||
</p>
|
||||
<p @click="onAuCHJump(item.id,2)" v-for="item in this.bookInfo.publisherNIList">
|
||||
{{item.title}} >
|
||||
@@ -58,6 +58,15 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<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>
|
||||
</view>
|
||||
<view v-if="status==1">
|
||||
<u-divider text="全部加载完成"></u-divider>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<u-divider v-else text="暂无讲书目录"></u-divider>
|
||||
<music-play :playData="playData"></music-play>
|
||||
@@ -84,81 +93,57 @@
|
||||
data() {
|
||||
return {
|
||||
isBuy: false, // true 已购买,false 未购买
|
||||
playData: {},
|
||||
stopPlay: false, // 关闭音频
|
||||
jia: false, // 下一I首
|
||||
forceRefresh: true,
|
||||
current: 0,
|
||||
bookInfo: {}, // 书籍详情
|
||||
playData: {},
|
||||
bookInfo: {
|
||||
author:{
|
||||
authorName:''
|
||||
}
|
||||
}, // 书籍详情
|
||||
bookid: null, // 书籍id
|
||||
playid: null, // 正在播放的章节id
|
||||
playchapName: '', // 正在播放的章节名称
|
||||
playIndex: null, // 正在播放的序号值
|
||||
onlineH: { // 线上的历史听书
|
||||
playIndex: null, // 存储的播放index
|
||||
time: 0, // 存储的播放秒数
|
||||
},
|
||||
currentTime: {
|
||||
time: 0,
|
||||
flag: ''
|
||||
},
|
||||
freeChapterCount: 0, // 免费章节数
|
||||
pageTab: [{
|
||||
name: '正在播放'
|
||||
},
|
||||
{
|
||||
name: '播放列表'
|
||||
}
|
||||
],
|
||||
fengImg: '', // 播放封面
|
||||
libLIst: [
|
||||
// {
|
||||
// name:"第二章",
|
||||
// url: 'https://ehh-private-01.oss-cn-beijing.aliyuncs.com/2023/07/14/6c6d7f7b947c4dc18881e8682b4dc36a2ce742.mp3'
|
||||
// },
|
||||
|
||||
], // 书籍目录
|
||||
videoList: [], //音频文件
|
||||
BsNav: [ //倍数-自定义
|
||||
{
|
||||
id: 1.0,
|
||||
bs: '1.0'
|
||||
}, {
|
||||
id: 1.5,
|
||||
bs: '1.5'
|
||||
}, {
|
||||
id: 2.0,
|
||||
bs: '2.0'
|
||||
}
|
||||
],
|
||||
orderPlayBtn: false, // 是否开启按顺序播放
|
||||
LibVisible: false,
|
||||
boardRemark: '',
|
||||
StyleSheet: 'font-size:36rpx; text-align:center',
|
||||
jian: false, // 上一曲切换
|
||||
status:3,
|
||||
freeChapterCount: 0, // 免费章节数
|
||||
libLIst: [], // 书籍目录
|
||||
videoList: [], //音频文件
|
||||
page:1,
|
||||
totalPage:0,
|
||||
}
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
console.log('下拉刷新了')
|
||||
this.libLIst = []
|
||||
this.page = 1
|
||||
this.totalPage = 0
|
||||
uni.stopPullDownRefresh();
|
||||
},
|
||||
onReachBottom() {
|
||||
console.log('到底了')
|
||||
if(this.page+1 <= this.totalPage){
|
||||
this.page++
|
||||
this.status = 0
|
||||
this.getLibList()
|
||||
}else{
|
||||
this.status = 1
|
||||
}
|
||||
},
|
||||
onHide() {
|
||||
this.libLIst = []
|
||||
this.page = 1
|
||||
},
|
||||
//第一次加载
|
||||
onLoad(e) {
|
||||
console.log('------------------')
|
||||
// 隐藏原生的tabbar
|
||||
console.log(e, 'e')
|
||||
uni.hideTabBar();
|
||||
this.bookid = e.bookid
|
||||
//console.log(this.userInfo.playFlag,'this.userInfo.playFlag')
|
||||
this.bookid = e.bookid
|
||||
},
|
||||
onShow() {
|
||||
// this.libLIst = []
|
||||
// this.page = 1
|
||||
// this.totalPage = 0
|
||||
this.getLibList()
|
||||
this.getBookInfo()
|
||||
|
||||
},
|
||||
created() {
|
||||
|
||||
},
|
||||
onShow() {
|
||||
// console.log(this.userInfo.orderPlayBtn,'初始化')
|
||||
if (this.userInfo.orderPlayBtn != undefined) {
|
||||
this.orderPlayBtn = this.userInfo.orderPlayBtn
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
computed: {
|
||||
...mapState(['userInfo'])
|
||||
@@ -181,8 +166,11 @@
|
||||
},
|
||||
getBookInfo() {
|
||||
// 获取书本基本信息
|
||||
this.$http
|
||||
.post('book/book/appinfo/' + this.bookid + '/' + this.userInfo.id)
|
||||
this.$http
|
||||
.post('book/book/getBookInfo', {
|
||||
'bookId': this.bookid,
|
||||
'userId': this.userInfo.id
|
||||
})
|
||||
.then(res => {
|
||||
if (res.code == 0) {
|
||||
console.log(res, 'res')
|
||||
@@ -218,123 +206,30 @@
|
||||
.post('book/teach/getBookTeachItems', {
|
||||
'bookId': this.bookid,
|
||||
'limit': 10,
|
||||
'page': 1
|
||||
'page': this.page
|
||||
// 'userid': this.userInfo.id,
|
||||
// 'bookid':
|
||||
// 'id': this.playid
|
||||
})
|
||||
.then(res => {
|
||||
if (res.code == 0) {
|
||||
console.log(res, 999)
|
||||
console.log(res, '章节目录')
|
||||
if (res.page.records.length > 0) {
|
||||
this.libLIst = res.page.records
|
||||
// this.fengImg = res.images
|
||||
this.libLIst = this.libLIst.concat(res.page.records)
|
||||
this.status = 3
|
||||
this.totalPage = res.page.pages
|
||||
|
||||
} else {
|
||||
this.libLIst = []
|
||||
// uni.showToast({
|
||||
// title:'暂无可听章节哦~',
|
||||
// icon:'none'
|
||||
// })
|
||||
// setTimeout(()=>{
|
||||
// uni.navigateBack({ // 返回上一页
|
||||
// delta: 1
|
||||
// });
|
||||
// },2000)
|
||||
this.totalPage = 0
|
||||
}
|
||||
}
|
||||
}).catch((e) => {
|
||||
console.log(e.msg)
|
||||
})
|
||||
},
|
||||
// 获取音频数据
|
||||
listen(e, index) {
|
||||
console.log(this.currentTime, 'this.currentTime')
|
||||
// console.log(e,'playchapName')
|
||||
this.playid = e.chapterId
|
||||
this.playIndex = index
|
||||
this.playchapName = e.chapterName
|
||||
this.playIndex >= this.libLIst.length - 1 ? this.jia = true : this.jia = false
|
||||
this.playIndex > 0 ? this.jian = true : this.jian = false
|
||||
// console.log(this.jian,45454545)
|
||||
this.forceRefresh = false
|
||||
this.$http
|
||||
.post('book/bookchaptercontent/appBooksChapterContent', {
|
||||
'userId': this.userInfo.id,
|
||||
'bookid': this.bookid,
|
||||
'id': this.playid
|
||||
})
|
||||
.then(res => {
|
||||
//this.tmpChapter.text = res.bookCatalogue
|
||||
if (res.code == 0) {
|
||||
// console.log(res)
|
||||
if (res.bookCatalogue.voices[0] != null && res.bookCatalogue.voices[0].length > 15) {
|
||||
// console.log('走这')
|
||||
|
||||
this.videoList = []
|
||||
this.boardRemark = res.bookCatalogue.chapter[0]
|
||||
this.fengImg = res.image
|
||||
this.videoList.push({
|
||||
'recorPath': res.bookCatalogue.voices[0]
|
||||
})
|
||||
console.log(res.bookCatalogue.voices[0], 'path')
|
||||
this.forceRefresh = true
|
||||
} else {
|
||||
this.forceRefresh = true
|
||||
uni.showToast({
|
||||
title: '暂无可播放音频,加载下一章',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
})
|
||||
setTimeout(() => {
|
||||
if (this.playIndex + 1 >= this.libLIst.length) {
|
||||
// this.stopPlay = true
|
||||
uni.showToast({
|
||||
title: '本书已全部播放完毕',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
})
|
||||
} else {
|
||||
this.listen(this.libLIst[this.playIndex], this.playIndex)
|
||||
}
|
||||
}, 2000)
|
||||
|
||||
}
|
||||
}
|
||||
}).catch((e) => {})
|
||||
},
|
||||
// 下一首
|
||||
xiayishou() {
|
||||
console.log('加载下一首')
|
||||
if (this.playIndex + 1 <= this.libLIst.length - 1) {
|
||||
this.playIndex += 1
|
||||
this.saveRate(0)
|
||||
this.currentTime.time = 0
|
||||
this.currentTime.flag = ''
|
||||
this.listen(this.libLIst[this.playIndex], this.playIndex)
|
||||
} else {
|
||||
this.jia = false
|
||||
uni.showToast({
|
||||
title: "音频已经播放完毕!",
|
||||
icon: "none"
|
||||
})
|
||||
}
|
||||
},
|
||||
TabChange(e) {
|
||||
// tab 切换
|
||||
this.current = e.index
|
||||
// console.log(e)
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
|
||||
// watch:{
|
||||
// list: {
|
||||
// handler (newName, oldName) {
|
||||
// console.log(newName)
|
||||
// },
|
||||
// immediate: true
|
||||
// }
|
||||
// }
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user