This commit is contained in:
@fawn-nine
2023-09-28 13:31:04 +08:00
parent 9772322df5
commit c785f36086
7 changed files with 367 additions and 298 deletions

View File

@@ -1,6 +1,6 @@
<template>
<view style="background-color: #fff;padding: 30rpx;">
<z-nav-bar title="电子书详情"></z-nav-bar>
<z-nav-bar title="书详情"></z-nav-bar>
<view class="book_neir flexbox">
<view class="bn_img">
<img :src="bookMessage.images" mode="scaleToFill">

View File

@@ -42,41 +42,21 @@
<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 >
<view class="flexbox listenItem">
<view class="info">
<view class="videoBox demo-layout bg-purple" @click="goToListenFree(item)">
<image :src="item.image" mode="scaleToFill" ></image>
<u-col span="4" v-for="(item,index) in bookList" :key="index">
<view class=" listenItem">
<view class="" @click="goDetail(item)">
<image v-if="item.images != '' && item.images != null" :src="item.images" mode="scaleToFill"></image>
<image v-else src="../../static/icon/wufeng.jpg" mode="scaleToFill"></image>
</view>
</view>
<view class="btns">
<!-- <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 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>
<text> </text>
</view>
<view class="item flexbox" @click="goPingshu(item.bookId)">
<!-- <u-icon name="chat" color="#fcbd71" size="24"></u-icon> -->
<image src="../../static/icon/tu3.png" mode="aspectFit"></image>
<text> </text>
</view>
</view>
</view>
<view class="bookName">{{item.bookName}}</view>
<view class="bookName">{{item.name}}</view>
</view>
</u-col>
</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>
<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>
@@ -88,35 +68,21 @@
<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)">
<image :src="item.images" mode="scaleToFill" ></image>
<u-col span="4" v-for="(item,index) in tjBookLIst" :key="index">
<view class=" listenItem">
<view class="" @click="goDetail(item)">
<image v-if="item.images != '' && item.images != null" :src="item.images" mode="scaleToFill"></image>
<image v-else src="../../static/icon/wufeng.jpg" mode="scaleToFill"></image>
</view>
<view class="bookName"><text>{{item.name}}</text></view>
</view>
<view class="btns">
<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)">
<image src="../../static/icon/tu2.png" mode="aspectFit"></image>
<text> </text>
</view>
<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.name}}</view>
</u-col>
</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>
<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>
@@ -154,7 +120,7 @@
contentShow: 1,
page: 1, // 页码
status: 3,
ygtotalPage:1,
totalPage: 1,
tjPage: 1,
tjstatus: 3,
tjTotalPage: 1,
@@ -184,35 +150,29 @@
},
onPullDownRefresh() {
console.log('下拉刷新了')
uni.stopPullDownRefresh();
this.contentShow = 1
// this.contentShow = 1
this.page = 1
this.tjPage = 1
this.bookList = []
this.getfreeBook()
this.tjBookLIst = []
this.getListDate()
uni.stopPullDownRefresh();
},
onReachBottom() {
// 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()
// }else{
// this.status = 1
// console.log('加载完成了',this.page)
// return
// }
if (this.page+1 <= this.totalPage) {
this.page++
this.status = 0
this.getfreeBook()
} else {
this.status = 1
}
} else if (this.contentShow == 2) {
if(this.tjPage+1 < this.tjTotalPage){
if (this.tjPage + 1 <= this.tjTotalPage) {
this.tjPage++
// console.log('加载',this.tjPage)
this.tjstatus = 0
@@ -255,20 +215,28 @@
// 获取已购买书籍
getfreeBook() {
this.$http
.post('book/userebookbuy/buylist', {
.post('book/book/getMyBooks', {
// .post('book/buyorderdetail/querybuy', {
'id': this.userInfo.id,
'userId': this.userInfo.id,
'page': this.page,
'limit': 10
})
.then(res => {
if (res.code == 0) {
// this.ygtotalPage = res.page.totalPage
//var arr = res.page
this.bookList = res.page
console.log(res, '获取已购买书籍')
// this.status = 3
if (res.page.records.length > 0) {
this.bookList = this.bookList.concat(res.page.records)
this.totalPage = res.page.pages
if(this.page == this.totalPage){
this.status = 1
}else{
this.status = 3
}
} else {
this.bookList = []
}
}
});
@@ -336,71 +304,134 @@
<style lang="scss" scoped>
@import '@/style/mixin.scss';
.hehan{width: 50%; margin: 0 auto;}
.hehan {
width: 50%;
margin: 0 auto;
}
.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;
image{
width: 24px !important;height:24px;display: block; margin-right: 10rpx;
}
}
}
.info{width: 50%;
image{width:100% ; height: 280rpx; border-radius: 20rpx;}
}
}
.shuwuLink{ padding: 0 20rpx;
image{border-radius: 30rpx;}
}
.contentButton{margin:50rpx 0;}
height: 80rpx;
margin-bottom: 30rpx;
.quesheng{text-align: center; margin-top: 100rpx; color: #8b8a91;}
.bookName{ margin-top:10rpx; display: block;
white-space: nowrap; font-weight: bold;
.item {
border-radius: 10rpx;
background-color: #c6ead0;
width: 48%;
margin: 0 10rpx;
text-align: center;
color: #3c7f56;
font-size: 36rpx;
line-height: 80rpx;
}
.item.active {
background-color: #3c7f56;
color: #fff;
}
.item1 {
// background-color: #adb6b7;
}
}
.listenItem {
image {
width: 100%;
height: 280rpx;
border-radius: 20rpx;
}
}
.shuwuLink {
padding: 0 20rpx;
image {
border-radius: 30rpx;
}
}
.contentButton {
margin: 50rpx 0;
}
.quesheng {
text-align: center;
margin-top: 100rpx;
color: #8b8a91;
}
.bookName {
margin-top: 10rpx;
display: block;
white-space: nowrap;
// font-weight: bold;
overflow-x: hidden;
text-overflow: ellipsis;
font-size: 30rpx; color: #333; padding: 10rpx 0;
font-size: 30rpx;
color: #333;
padding: 10rpx 0;
}
// .videoBox{position: relative;}
.playButton{position: absolute; z-index: 1; right: 4px; bottom: 4px; padding: 5px; border-radius: 100%; }
.playButton {
position: absolute;
z-index: 1;
right: 4px;
bottom: 4px;
padding: 5px;
border-radius: 100%;
}
uni-image {
width: auto !important;
height: 350rpx;
}
.u-row{flex-wrap: wrap;}
.u-col{overflow: hidden; margin-bottom: 30rpx; overflow: hidden;}
.listenList{padding: 10rpx; box-sizing: border-box; width: calc(100% - 10rpx);}
.flexbox{display: flex;}
.u-row {
flex-wrap: wrap;
}
.u-col {
overflow: hidden;
margin-bottom: 30rpx;
overflow: hidden;
}
.listenList {
padding: 10rpx;
box-sizing: border-box;
width: calc(100% - 10rpx);
}
.flexbox {
display: flex;
}
.scroll-Y {
height: 300rpx;
}
.scroll-view_H {
white-space: nowrap;
width: 100%;
}
.scroll-view-item {
height: 300rpx;
line-height: 300rpx;
text-align: center;
font-size: 36rpx;
}
.scroll-view-item_H {
display: inline-block;
width: 60%;
@@ -409,6 +440,7 @@
text-align: center;
font-size: 36rpx;
}
.head_line {
margin: 50rpx 0;
@@ -435,28 +467,51 @@
margin: 5rpx 35rpx 0 0;
}
}
.home_bg {
background-image: url('@/static/icon/home_bg.jpg');
background-position: center center;
background-repeat: no-repeat;
background-size: cover;
padding: 20rpx;
position: relative; margin-bottom:60rpx;
position: relative;
margin-bottom: 30rpx;
// height: 400rpx; margin-bottom: 130rpx;
.icon_hua_1 {
// margin: 0 auto;
width: 100%; text-align: center;
width: 100%;
text-align: center;
height: 150rpx;
image {
width: 150rpx;
height: 150rpx;
image{width: 150rpx; height: 150rpx;}
}
.icon_hua{width: 100%; text-align: center; display: block;
image{width: 150rpx; height: 150rpx; margin: 0 auto;}
}
.search_box { margin: 0 auto; margin-top: 20rpx; align-items: center;
width: calc(100% - 30rpx); margin-top: 0;
.icon_hua {
width: 100%;
text-align: center;
display: block;
image {
width: 150rpx;
height: 150rpx;
margin: 0 auto;
}
}
.search_box {
margin: 0 auto;
margin-top: 20rpx;
align-items: center;
width: calc(100% - 30rpx);
margin-top: 0;
margin-bottom: 20rpx;
.search{height: 80upx;
.search {
height: 56upx;
display: flex;
width: 100%;
align-items: center;
@@ -465,8 +520,10 @@
border-radius: 20upx;
box-shadow: 0 0px 10px 1px #54a96633;
}
.prompt {
color: #838383; font-size: 24rpx;
color: #838383;
font-size: 24rpx;
}
@@ -480,9 +537,12 @@
margin-right: 20upx;
}
}
.searBtn {
width: 80rpx; align-items: center;
font-size: 30rpx; color: #fff;
width: 80rpx;
align-items: center;
font-size: 30rpx;
color: #fff;
}
}
</style>

View File

@@ -198,7 +198,8 @@
<view class="goods">
<!-- 精选 -->
<view class="" >
<view class="" v-if="tjProList.length > 0">
<view v-if="tjProList.length > 0" >
<view class="flexbox" style="flex-wrap: wrap;">
<view class="goodsItem" v-for="(item,index) in tjProList" :key="index"
@click="goDetail(item.shopproudicts[0].productId)">
<image :src="item.shopproudicts[0].productImages" mode="" class="goodsImg"></image>
@@ -213,7 +214,8 @@
</view>
</view>
</view>
<br clear="both">
</view>
<view class="">
<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>
@@ -222,6 +224,7 @@
<u-divider text="全部加载完成"></u-divider>
</view>
</view>
</view>
<u-divider v-else text="暂无数据哦~"></u-divider>
</view>
@@ -301,6 +304,10 @@
uni.hideTabBar();
// this.requestIapOrder()
},
onHide() {
this.page = 1
this.tjProList = []
},
//页面显示
onShow() {
// 隐藏原生的tabbar
@@ -692,7 +699,9 @@
.price{color: #9b9b9b !important; font-size: inherit; font-weight: normal !important; display: block;}
}
.ProTabs{margin: 20rpx 0; padding:0 20rpx;
text{padding: 4rpx 8rpx; font-size: 32rpx; border-radius: 10rpx; overflow: hidden; background-color: #eee; color: #55aa7f; margin-right: 10rpx;}
text{padding: 12rpx 14rpx; font-size: 32rpx; border-radius: 10rpx; overflow: hidden;
// background-color: #eee;
color: #55aa7f; margin-right: 10rpx;}
text.cur{background-color:#55aa7f ; color: #fff;}
}
.newBook{margin-top: 20rpx;}
@@ -812,8 +821,8 @@
align-content: center;
justify-content: center;
image {
width: 110upx;
height:110upx;
width:90%;
height:156rpx;
display: block;
margin: 0 auto;
// margin: 0 20rpx;
@@ -1104,7 +1113,7 @@
.goodsName {
margin-top: 10rpx;
font-size: 30rpx;
font-weight: bold;
// font-weight: bold;
}
.goodsPrice {
@@ -1113,7 +1122,7 @@
display: flex; justify-content: space-between;
.price{
font-weight: bold;
color: #bf0c0c;
color: #ff0000;
}
.Salesnum{color: #9b9b9b;}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 5.9 KiB