阶段性上传

This commit is contained in:
@fawn-nine
2023-09-08 18:06:39 +08:00
parent 7b9044f4df
commit b0cc2b8663
62 changed files with 5075 additions and 506 deletions

View File

@@ -2,21 +2,45 @@
<view>
<!-- 公共组件-每个页面必须引入 -->
<!-- <public-module></public-module> -->
<z-nav-bar title="我的图书"></z-nav-bar>
<view class="home_bg" >
<image src="../../static/icon/home_icon_1.png" mode="aspectFit" class="icon_hua_1"></image>
<view class="search_box" @click="onPageJump('./searchFor')">
<text class="icon_search"></text>
<text class="prompt">搜索...</text>
<!-- <z-nav-bar title="我的图书"></z-nav-bar> -->
<view class="home_bg " >
<view class="flexbox" style=" justify-content: space-between; ">
<view class="icon_hua">
<image src="../../static/icon/home_icon_3.png" mode="aspectFit" class="icon_hua_1"></image>
</view>
<view class="search_box flexbox" @click="onPageJump('../peanut/searchFor')">
<view class="search">
<text class="icon_search"></text>
<text class="prompt">请输入想要搜索的书名</text>
</view>
</view>
<view class="searBtn flexbox">
<text>搜索</text>
</view>
</view>
<view class="home_lunbo">
<u-swiper :list="list3" indicator indicatorMode="line" circular style="height: 180rpx;"></u-swiper>
</view>
</view>
<!-- <view class="contentButton">
<u-tabs :scrollable="false" bg-color="#d4d4d4" active-color="#2979ff" inactive-color="#606266" bar-height="10" :list="contentButtonList" @click="contentButtonClick" lineWidth="42" :inactiveStyle="{fontSize:'32rpx'}" :activeStyle="{color: '#303133',fontWeight: 'bold', transform: 'scale(1.01)'}"></u-tabs>
</view> -->
<view class="" style="padding: 20rpx;">
<view class="mytabs flexbox">
<view :class="['item','item1', contentShow == 1 ? 'active' :'']" @click="setData(1)">
已购图书
</view>
<view :class="['item','item2', contentShow == 2 ? 'active' :'']" @click="setData(2)">
推荐图书
</view>
</view>
<view class="contentButton">
<u-tabs :scrollable="false" bg-color="#d4d4d4" active-color="#2979ff" inactive-color="#606266" bar-height="10" :list="contentButtonList" @click="contentButtonClick" lineWidth="42" :inactiveStyle="{fontSize:'32rpx'}" :activeStyle="{color: '#303133',fontWeight: 'bold', transform: 'scale(1.01)'}"></u-tabs>
</view>
<view class="listenList" v-if="bookList.length > 0">
<view class="wrap" v-if="contentShow == 0">
<view class="wrap" v-if="contentShow == 1">
<u-row gutter="16" justify="flex-start">
<u-col span="6" v-for="(item,index) in bookList" :key="index">
<view >
<view class="flexbox listenItem">
<view class="info">
<view class="videoBox demo-layout bg-purple" @click="goToListenFree(item)">
@@ -25,11 +49,11 @@
</view>
<view class="btns">
<view class="item flexbox" @click="">
<!-- <u-icon name="bookmark" color="#55aaff" size="24"></u-icon> -->
<!-- <view class="item flexbox" @click="">
<u-icon name="bookmark" color="#55aaff" size="24"></u-icon>
<image src="../../static/icon/tu1.png" mode="aspectFit"></image>
<text > </text>
</view>
</view> -->
<view class="item flexbox" @click="goToListenFree(item)">
<!-- <u-icon name="volume" color="#71d5a1" size="24"></u-icon> -->
<image src="../../static/icon/tu2.png" mode="aspectFit"></image>
@@ -42,35 +66,36 @@
</view>
</view>
</view>
<view class="bookName">{{item.bookName}}</view>
<view class="bookName">{{item.bookName}}</view>
</view>
</u-col>
</u-row>
</view>
<view class="wrap" v-if="contentShow == 1">
<view class="wrap" v-if="contentShow == 2">
<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)">
<image :src="item.productImages" mode="scaleToFill" ></image>
<view class="videoBox demo-layout bg-purple" @click="goDetail(item.product)">
<image :src="item.product.productImages" mode="scaleToFill" ></image>
</view>
</view>
<view class="btns">
<view class="item flexbox" @click="">
<view class="item flexbox" @click="goDetail(item.product)">
<image src="../../static/icon/tu1.png" mode="aspectFit"></image>
<text> </text>
</view>
<view class="item flexbox" @click="goToListen(item)">
<view class="item flexbox" @click="goToListen(item.product)">
<image src="../../static/icon/tu2.png" mode="aspectFit"></image>
<text> </text>
</view>
<view class="item flexbox" @click="wgGoPingshu(item)">
<view class="item flexbox" @click="wgGoPingshu(item.product)">
<image src="../../static/icon/tu3.png" mode="aspectFit"></image>
<text> </text>
</view>
</view>
</view>
<view class="bookName">{{item.productName}}</view>
<view class="bookName">{{item.product.productName}}</view>
</u-col>
</u-row>
</view>
@@ -100,11 +125,16 @@
export default {
data() {
return {
list3: [
// '../../static/icon/home_ban_1.jpg',
'../../static/icon/home_ban_2.jpg',
'../../static/icon/home_ban_3.jpg',
],
showEbook:false,
playData:{},
loadingNow : false,
bookList:[],
contentShow:0,
contentShow:1,
page:1, // 页码
status: 3,
ygtotalPage:1,
@@ -127,13 +157,13 @@
onPullDownRefresh() {
console.log('下拉刷新了')
uni.stopPullDownRefresh();
if(this.contentShow == 0){
this.page=1, // 页码
if(this.contentShow == 1){
// this.page=1, // 页码
this.bookList = []
this.getfreeBook()
}
else if(this.contentShow == 1){
this.tjPage=1, // 页码
else if(this.contentShow == 2){
// this.tjPage=1, // 页码
this.tjBookLIst = []
this.getListDate()
}
@@ -142,33 +172,33 @@
this.loadingNow = true
console.log('到底了')
if(this.contentShow == 0){
//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 == 1){
if(this.tjPage < this.tjTotalPage){
this.tjPage++
console.log('加载',this.tjPage)
this.status = 0
this.getListDate()
// }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{
// this.status = 1
// console.log('加载完成了',this.tjPage)
// return
// }
// }
},
components:{
musicPlay
@@ -177,36 +207,24 @@
...mapState(['userInfo'])
},
methods: {
setData(e){
this.contentShow = e
},
// 未购买图书,评书跳转
wgGoPingshu(item){
console.log('未购买评书',item)
if(item.bookId == null || item.bookId.length <= 0){
//uni.showModal()
uni.showModal({
title: '提示',
showCancel:false,
content: '当前未关联图书信息,请联系联系管理员',
success: function (res) {
if (res.confirm) {
console.log('好的');
}
}
});
}else{
uni.navigateTo({
url: '../comments/comments?bookid='+item.bookId[0],
url: '../comments/comments?bookid='+item.bookId,
// url:'../bookShop/commodityDetail'
});
}
},
// 跳转到评书
goPingshu(val){
console.log('评书',val)
uni.navigateTo({
url: '../comments/comments?bookid='+val,
// url:'../bookShop/commodityDetail'
});
},
contentButtonClick(e){
@@ -214,6 +232,7 @@
},
// 获取已购买书籍
getfreeBook(){
console.log('获取已购买书籍')
this.$http
.post('book/userebookbuy/buylist', {
// .post('book/buyorderdetail/querybuy', {
@@ -224,8 +243,16 @@
.then(res => {
if(res.code == 0){
this.ygtotalPage = res.page.totalPage
this.bookList = this.bookList.concat(res.page.list)
// 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
}
@@ -235,6 +262,7 @@
// 获取推荐图书(未购买)
getListDate(){
console.log('获取推荐图书(未购买)')
this.loadingNow = false
// 获取书架列表
this.$http
@@ -244,63 +272,52 @@
'page':this.tjPage
})
.then(res => {
console.log(res)
console.log(res,'获取推荐图书(未购买)')
if(res.code == 0){
this.tjTotalPage = res.pages.totalPage
// this.tjTotalPage = res.pages.totalPage
var arr = []
if(res.pages.list.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.list,'res.pages.list')
// var arr = res.pages.list
this.tjBookLIst = this.tjBookLIst.concat(res.pages.list)
// console.log(res)
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
} }
});
},
// 跳转详情页
goDetail(item) {
console.log(item,'goDetail-----')
console.log(item,'goDetail-----')
uni.navigateTo({
url: '../bookShop/commodityDetail?id=' + item.productId
});
},
goToListen(item){
if(item.bookId == null || item.bookId.length <= 0){
//uni.showModal()
uni.showModal({
title: '提示',
showCancel:false,
content: '当前图书暂不支持试听',
success: function (res) {
if (res.confirm) {
console.log('好的');
}
}
});
}else{
goToListen(item){
console.log(item,'item')
uni.navigateTo({
url: "../listen/listen?bookid="+item.bookId[0]
url: "../listen/listen?bookid="+item.bookId
});
}
},
// 跳转到听书详情
goToListenFree(item){
console.log(item,'item')
// console.log(item,'item')
uni.navigateTo({
// url: "./musicbg?bookid="+item.bookid+"&fengImg="+item.image // 台播放版本
url: "../listen/listen?bookid="+item.bookId+"&fengImg="+item.image // 前台播放版本
// url: "./bgMusix"
url: "../listen/listen?bookid="+item.bookId+"&fengImg="+item.image // 台播放版本
});
},
// 跳转11
@@ -315,6 +332,22 @@
<style lang="scss" scoped>
@import '@/style/mixin.scss';
.home_lunbo {
margin: 40rpx 30rpx 0 30rpx;
}
.mytabs{
// background: url('@/static/icon/bgtushu.png') no-repeat left top;
height:110rpx ; margin-bottom: 50rpx;
.item{
border-radius: 10rpx;background-color: #adb6b7; width: 48%; margin: 0 10rpx; text-align: center; color:#fff ; font-size: 36rpx; line-height:110rpx ;
}
.item.active{
background-color: #73837b;
}
.item1{
background-color: #adb6b7;
}
}
.listenItem{
.btns{margin-top: 60rpx; margin-left: 20rpx; font-size: 34rpx; justify-content: space-between;
.item{ margin-bottom:30rpx;
@@ -398,35 +431,33 @@
}
}
.home_bg {
background-image: url('@/static/icon/home_bg.jpg');
background-image: url('@/static/icon/home_bg1.jpg');
background-position: center center;
background-repeat: no-repeat;
background-size: cover;
padding: 100rpx 0 40rpx 0;
padding: 100rpx 20rpx 40rpx 20rpx;
position: relative;
height: 400rpx; margin-bottom: 130rpx;
.icon_hua_1 {
margin: 0 auto;
// margin: 0 auto;
width: 150rpx;
height: 150rpx;
}
.search_box {
width: 90%;
height: 64upx;
background-color: #fff;
border-radius: 32upx;
display: flex;
align-items: center;
padding: 0upx 40upx;
position: absolute;
margin-left: -46%;
left: 50%;
bottom: -40rpx;
box-shadow: 0 0px 10px 1px #54a96633;
.icon_hua{width: 150rpx; display: block;}
.search_box { margin-top: 20rpx; align-items: center;
width: calc(100% - 300rpx);
.search{height: 80upx;
display: flex;
width: 100%;
align-items: center;
padding: 0upx 40upx;
background-color: #fff;
border-radius: 20upx;
box-shadow: 0 0px 10px 1px #54a96633;
}
.prompt {
color: #cccccc;
color: #838383; font-size: 24rpx;
}
@@ -435,10 +466,14 @@
background-position: center center;
background-repeat: no-repeat;
background-size: cover;
width: 29upx;
height: 28upx;
width:36upx;
height: 36upx;
margin-right: 20upx;
}
}
.searBtn{
width: 80rpx; align-items: center;
font-size: 30rpx; color: #fff;
}
}
</style>