This commit is contained in:
@fawn-nine
2023-09-22 13:42:32 +08:00
parent 8f970b3d0e
commit ce389485d6
2 changed files with 455 additions and 309 deletions

File diff suppressed because it is too large Load Diff

View File

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