1
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -33,27 +33,14 @@
|
||||
<u-divider v-else text="暂无已购买书籍~"></u-divider>
|
||||
</view>
|
||||
|
||||
<view class="wrap" v-if="contentShow == 1">
|
||||
<view v-if="1==1">
|
||||
接口正在调试
|
||||
</view>
|
||||
<u-row gutter="16" justify="flex-start" v-if="tjBookLIst.length > 0 && 6==3">
|
||||
<view class="wrap" v-if="contentShow == 1">
|
||||
<u-row gutter="16" justify="flex-start" v-if="tjBookLIst.length > 0">
|
||||
<u-col span="4" v-for="(item,index) in tjBookLIst" :key="index">
|
||||
<view class="videoBox demo-layout bg-purple" @click="goDetail(item)">
|
||||
<image :src="item.images" mode="scaleToFill"></image>
|
||||
<!-- <u-icon class="playButton" name="play-circle" color="#54a966" size="40"></u-icon> -->
|
||||
</view>
|
||||
<text class="bookName">{{item.name}}</text>
|
||||
<!-- <view class="btns flexbox">
|
||||
<view class="item flexbox" @click="goToListen(item)">
|
||||
<u-icon name="volume" color="#71d5a1" size="24"></u-icon>
|
||||
<text>听 书</text>
|
||||
</view>
|
||||
<view class="item flexbox" @click="wgGoPingshu(item)">
|
||||
<u-icon name="chat" color="#fcbd71" size="24"></u-icon>
|
||||
<text>评 书</text>
|
||||
</view>
|
||||
</view> -->
|
||||
<text class="bookName">{{item.name}}</text>
|
||||
</u-col>
|
||||
</u-row>
|
||||
<u-divider v-else text="暂无推荐书籍~"></u-divider>
|
||||
@@ -94,6 +81,7 @@
|
||||
ygtotalPage: 1,
|
||||
tjPage: 1,
|
||||
tjTotalPage: 1,
|
||||
tjPageSize:9,
|
||||
tjBookLIst: [],
|
||||
contentButtonList: [{
|
||||
name: '已购图书'
|
||||
@@ -112,16 +100,11 @@
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
console.log('下拉刷新了')
|
||||
this.tjBookLIst = []
|
||||
this.getListDate()
|
||||
this.bookList = []
|
||||
this.getfreeBook()
|
||||
uni.stopPullDownRefresh();
|
||||
if (this.contentShow == 0) {
|
||||
// this.page=1, // 页码
|
||||
this.bookList = []
|
||||
this.getfreeBook()
|
||||
} else if (this.contentShow == 1) {
|
||||
// this.tjPage=1, // 页码
|
||||
this.tjBookLIst = []
|
||||
this.getListDate()
|
||||
}
|
||||
},
|
||||
onReachBottom() {
|
||||
this.loadingNow = true
|
||||
@@ -144,7 +127,7 @@
|
||||
// }
|
||||
|
||||
if (this.contentShow == 1) {
|
||||
if (this.tjPage < this.tjTotalPage) {
|
||||
if (this.tjPage+1 < this.tjTotalPage) {
|
||||
this.tjPage++
|
||||
console.log('加载', this.tjPage)
|
||||
this.status = 0
|
||||
@@ -233,21 +216,23 @@
|
||||
.post('book/book/getUserNobuyBooks', { // 磊哥新写
|
||||
// .post('book/shopproduct/booklist', { // 原接口
|
||||
'userId': this.userInfo.id,
|
||||
'limit': 9,
|
||||
'limit': this.tjPageSize,
|
||||
'page': this.tjPage
|
||||
})
|
||||
.then(res => {
|
||||
console.log(res)
|
||||
if (res.code == 0 && res.books.length > 0) {
|
||||
console.log(res,'推荐听书列表')
|
||||
this.tjBookLIst = res.books
|
||||
var yu = res.count % 9
|
||||
if(yu != 0){
|
||||
this.tjTotalPage = parseInt(res.count / 9) + 1
|
||||
.then(res => {
|
||||
console.log(res,'推荐听书列表')
|
||||
if (res.code == 0 && res.page.records.length > 0) {
|
||||
this.tjBookLIst = this.tjBookLIst.concat(res.page.records)
|
||||
// 计算总页数
|
||||
var yu = res.page.total % this.tjPageSize
|
||||
console.log(yu,'yu')
|
||||
if(yu > 0){
|
||||
this.tjTotalPage = parseInt(res.page.total / this.tjPageSize) +1
|
||||
// console.log(this.tjTotalPage,'总页数:this.tjTotalPage')
|
||||
}else{
|
||||
this.tjTotalPage = parseInt(res.count / 9)
|
||||
this.tjTotalPage = parseInt(res.page.total / this.tjPageSize)
|
||||
// console.log(this.tjTotalPage,'总页数:this.tjTotalPage')
|
||||
}
|
||||
console.log(this.tjTotalPage,'tjTotalPage')
|
||||
this.status = 3
|
||||
}else{
|
||||
this.tjTotalPage = 0
|
||||
|
||||
Reference in New Issue
Block a user