Merge branch 'master-xie'

This commit is contained in:
@fawn-nine
2023-09-20 09:06:13 +08:00
9 changed files with 715 additions and 476 deletions

View File

@@ -13,34 +13,39 @@
</swiper>
</view>
<view class="commodityContent">
<view class="commodityPrice">
<view class="commodityPrice" v-if="productInfo.activityPrice && productInfo.activityPrice > 0">
<span style="font-size: 28rpx;" ></span><em>{{productInfo.activityPrice}}</em>
<span class="oldPrice " >原价<span style="font-size: 20rpx;padding-left:10rpx;"></span>{{productInfo.price}}</span>
</view>
<view class="commodityPrice" v-else>
<span style="font-size: 28rpx;" ></span><em>{{productInfo.price}}</em>
<span class="oldPrice " v-if="productInfo.activityPrice">原价<span style="font-size: 20rpx;padding-left:10rpx;"></span>{{productInfo.activityPrice}}</span>
</view>
<view class="commodityyName">
{{productInfo.productName}}
<span v-if="productInfo.productStock==0" style="color: #aaa;font-size:26rpx;">无货</span>
<view><text class="SoldNumber">已售<span style="padding-left:10rpx;">{{productInfo.sumSales}}</span></text></view>
</view>
<view class="pingjia" v-if="listenList && listenList.length > 0 && listenList[0]">
<view class="pingjia" v-if="linkProducts && linkProducts.length > 0 && linkProducts[0]">
<view class="">
<view style="font-weight: 600;margin-bottom: 30rpx;">商品包含</view>
<view style="font-weight: 600;margin-bottom: 30rpx;">商品列表</view>
<!-- <view class="icon-del rotate"></view> -->
</view>
<!-- 商品包含 -->
<view v-if="listenList && listenList.length > 0 && listenList[0]">
<view class="spbh" v-for="item in listenList" :key="item.id">
<view class="flexbox aligncenter" @click="previewImage(item.images)">
<view v-if="linkProducts && linkProducts.length > 0 && linkProducts[0]">
<view class="spbh" v-for="(item, index) in linkProducts" :key="item.id">
<view class="flexbox aligncenter" @click="previewProduct(item,index)">
<view class="spbhimg">
<image :src="item.images" mode="aspectFit"></image>
<image :src="item.productImages" mode="aspectFit"></image>
</view>
<text class="username nowrap ">{{item.name}}</text>
<text class="username nowrap ">{{item.productName}}</text>
<text class="price" v-if="item.activityPrice && item.activityPrice > 0">{{item.activityPrice}}</text>
<text class="price" v-else>{{item.price}}</text>
</view>
</view>
</view>
<view class="quesheng" v-else>
<text>暂无评价~</text>
</view>
<!-- <view class="quesheng" v-else>
<text>暂无关联商品~</text>
</view> -->
</view>
<view class="contentButton">
@@ -155,6 +160,34 @@
</view>
<view style="height: 120rpx;"></view>
</view>
<view class="" v-if="upoShow">
<u-popup :show="upoShow" :round="10" @close="closeUpo">
<view class="tanchu">
<view class="list">
<view class="imgBox">
<image v-if="linkimg == ''" src="../../static/icon/wufeng.jpg" mode="aspectFit" style="width: 100%; height: 100%;"></image>
<image v-else :src="linkimg" mode="aspectFit" style="width: 100%; height: 100%;"></image>
<view class="xiangxi" v-if="productId != linkProducts[linkCur].productId" @click="gotoDetail(linkProducts[linkCur])">
<text>查看详情</text>
</view>
</view>
<view :class="['spbh', linkCur == index ? 'cur' :'']" v-for="(item, index) in linkProducts" :key="item.id">
<view class="flexbox aligncenter" @click="previewProduct(item,index)">
<view class="spbhimg">
<image :src="item.productImages" mode="aspectFit"></image>
</view>
<text class="username nowrap ">{{item.productName}}</text>
<text class="price" v-if="item.activityPrice && item.activityPrice > 0">{{item.activityPrice}}</text>
<text class="price" v-else>{{item.price}}</text>
</view>
</view>
</view>
<uni-goods-nav style="left: 0;" class="goods_nav" :fill="true" :options="options" :buttonGroup="buttonGroup" @click="onClick"
@buttonClick="buttonClickLink" />
</view>
</u-popup>
</view>
<uni-goods-nav class="goods_nav" :fill="true" :options="options" :buttonGroup="buttonGroup" @click="onClick"
@buttonClick="buttonClick" />
<music-play :playData="playData"></music-play>
@@ -172,6 +205,7 @@
export default {
data() {
return {
linkimg:'', // 选中的关联商品图片
playData:{},
contentShow:0,
options: [{
@@ -204,13 +238,17 @@
cartList: [], // 购物车列表
commentsList:[], // 评论列表
productId:null, // 商品评论
listenList:[] // 关联得听书
listenList:[], // 关联得听书
linkProducts:[], // 关联的商品,
upoShow:false, // 显示底部购买选项
linkCur : 0, // 当前选中的关联项
}
},
onLoad(e) {
this.productId = e.id
this.getProDetail(e)
this.getComments()
this.getLinkPros(this.productId)
// console.log(emojiList1,'emojiList1')
},
computed: {
@@ -220,6 +258,41 @@
musicPlay
},
methods: {
gotoDetail(item){
console.log(item,'gotoDetail')
uni.navigateTo({
url: '../bookShop/commodityDetail?id=' + item.productId
});
},
closeUpo(){
console.log('关闭弹窗')
this.upoShow = false
},
// 点击其他套餐
previewProduct(item,index){
console.log(item,'item')
this.linkimg = item.productImages
this.upoShow = true
this.linkCur = index
},
// 获取商品关联商品
getLinkPros(id){
this.$http
.post('book/shopproduct/bookinfolists/'+id)
.then(res => {
console.log('关联商品', res)
if(res.code == 0){
this.linkProducts = res.result
if(this.linkProducts.length > 0){
this.linkimg = this.linkProducts[0].productImages
this.linkCur = 0
}
}
})
.catch(e => {
console.log(e,'e')
})
},
goToListen(id){
// 跳转到听书
uni.navigateTo({
@@ -331,15 +404,51 @@
url: '../peanut/shopping'
});
},
// 关联商品点击按钮组件
buttonClickLink(e){
console.log('点击的是关联商品的组件')
if(e.index == 0){
// 点击的是加入购物车
if (this.linkProducts[this.linkCur].productStock == 0) {
uni.showToast({
title: '商品库存不足',
icon: "none",
duration: 1000,
});
} else {
this.$http
.post(`book/ordercart/getCartList?userId=${this.userInfo.id}`)
.then(res => {
this.cartList = res.cartList
this.isAddLink(this.linkProducts[this.linkCur])
})
}
}else{
// 点击的是立即购买
if (this.linkProducts[this.linkCur].productStock == 0) {
uni.showToast({
title: '商品库存不足',
icon: "none",
duration: 1000,
});
} else {
uni.navigateTo({
url: '../bookShop/settlement?type=2&list=' + this.linkProducts[this.linkCur].productId
});
}
}
},
// 点击按钮组间
buttonClick(e) {
console.log(e)
if(e.index == 0){
// 点击的是加入购物车
this.addCart()
this.upoShow = true
// this.addCart()
}else{
// 点击的是立即购买
this.goPurse()
this.upoShow = true
// this.goPurse()
}
},
goToListenNone(){
@@ -366,6 +475,83 @@
}
},
isAddLink(item) {
// 统计商品信息
let data = {
"userId": this.userInfo.id,
"productId": item.productId,
"productAmount": this.productAmount,
"price": item.price
}
// 判断列表是否为空
if (this.cartList.length > 0) {
let flag = ''
let shagnpin = {}
// 循环购物车列表
flag = this.cartList.some((item, index) => {
if (item.productId == data.productId) {
shagnpin = item
shagnpin.productAmount = item.productAmount + 1
return true
}
})
if (flag) {
// 已在购物车中添加
$http.request({
url: "book/ordercart/update",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data: shagnpin,
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
}).then(res => {
if (res.code == 0) {
this.upoShow = false
uni.showToast({
title: '加入购物车成功',
duration: 1000,
});
}
})
} else {
// 加入购物车
$http.request({
url: "book/ordercart/save",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data,
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
}).then(res => {
if (res.code == 0) {
this.upoShow = false
uni.showToast({
title: '加入购物车成功',
duration: 1000,
});
}
})
}
} else {
// 购物车列表为空时直接加入购物车
$http.request({
url: "book/ordercart/save",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data,
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
}).then(res => {
if (res.code == 0) {
uni.showToast({
title: '加入购物车成功',
duration: 1000,
});
}
})
}
},
isAdd() {
// 统计商品信息
let data = {
@@ -517,6 +703,30 @@ formatRichText (html) { //控制小程序中图片大小
}
</script>
<style lang="scss" scoped>
.tanchu { background: #fff;position: relative;
padding: 40rpx 30rpx 40rpx 30rpx;
position: relative;
.list{margin-bottom: 140rpx;
.imgBox{height: 500rpx; width: 100%; margin-bottom: 10rpx; position: relative;
.xiangxi{text-align: center; position: absolute; left: 0; bottom: 20rpx; width: 100%;
text{padding: 10rpx 20rpx; font-size: 32rpx; background-color: rgba(235, 160, 11, .9); color: #def0ea; border-radius: 10px;}
}
}
}
.spbh{ border: 2rpx solid #fff;
.spbhimg {
image{
border: none !important;
}
}
}
.spbh.cur{
border: 2rpx solid #eba00b;
border-radius: 10rpx;
overflow: hidden;
}
}
.tingshuList{margin-top: 20rpx; background-color: #fff; padding: 20rpx;
border-radius: 20rpx; margin-bottom: 20rpx; padding-top: 40rpx;
background-image: linear-gradient(0deg, #f7fffc 0%, #def0ea 100%);
@@ -554,7 +764,7 @@ formatRichText (html) { //控制小程序中图片大小
}
.spbh{
padding-bottom: 10rpx;
font-size: 26rpx;
font-size: 26rpx; padding: 0 10rpx;
}
.spbhimg{
width:40px; overflow: hidden; text-align: center;
@@ -566,8 +776,12 @@ formatRichText (html) { //控制小程序中图片大小
border-radius: 6rpx;
overflow: hidden;
}
.username{font-size: 24rpx; color: #999; margin-top: 6rpx; }
}
.username{ margin-left: 10rpx; }
.price{margin-left: 5px;
color: #ffa200;
font-weight: bold;}
.nowrap {
white-space: nowrap;
overflow-x: hidden;

View File

@@ -1,7 +1,9 @@
<template>
<view>
<z-nav-bar title="读书打卡"></z-nav-bar>
<view class="tip">
<text>请选择要打卡的书籍</text>
</view>
<view class="listenList" v-if="bookList.length > 0">
<view class="wrap" >
<u-row gutter="16" justify="flex-start">
@@ -99,6 +101,10 @@
<style lang="scss" scoped>
@import '@/style/mixin.scss';
.tip{
padding: 20rpx; background-color: #fff;
text{ font-size: 36rpx;}
}
.contentButton{margin: 20rpx 0;}
.btns{margin-top: 15rpx; background-color: #f1f1f1; border-radius: 10rpx; font-size: 28rpx; justify-content: space-between;

View File

@@ -8,6 +8,7 @@
<image :src="productInfo.images" mode="aspectFill"></image>
<view>
<span class="title">{{productInfo.name}}</span>
<view class="description" v-if="productInfo.description == ''">暂无简介内容</view>
<view class="description">{{productInfo.description}}</view>
</view>

View File

@@ -70,8 +70,9 @@
<view class="list shupingList" v-if="shupingList.length > 0">
<view class="item" @click.stop="toDetail(item)" v-for="item in shupingList" :key="item.id">
<h4>{{item.title}}</h4>
<view class="info" v-if="item.content != ''" v-html="item.content">
<view class="" v-if="item.content && item.content != '' ">
<view class="info" v-html="item.content">
</view>
</view>
<view class="more" @click.stop="toDetail(item)">立即查看</view>
</view>
@@ -331,7 +332,9 @@
.playing{color: #1daa5c;}
.flexbox{display: flex;}
.tags{
.tag{
margin-left: 0; margin-right: 10rpx;
}
}
.moreBtn{text-align: center; margin-top: 20rpx;
text{padding: 6rpx 20rpx; border: 1px solid #27b386; color: #27b386; border-radius: 10rpx;}

View File

@@ -38,7 +38,8 @@
<text>作者<text style="color: #333;">{{item.authorName}}</text></text>
</view>
<view v-if="shouTyp==1">
<text>出版商<text style="color: #333;">{{item.publisherName}}</text></text>
<text>简介<text style="color: #333;" v-if="item.description == ''">暂无简介内容</text>
<text style="color: #333;" class="jianjie">{{item.description}}</text></text>
</view>
<view>
<text style="line-height: 20rpx;">{{item.title}}</text>
@@ -169,7 +170,13 @@
</script>
<style lang="scss" scoped>
@import '@/style/mixin.scss';
.jianjie{overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 4;
-webkit-box-orient: vertical;
text-align:justify;
}
.author_mess {
padding: 30rpx 30rpx;
box-shadow: 0 0px 10px 1px #d3d1d133;

View File

@@ -4,24 +4,26 @@
<!-- <public-module></public-module> -->
<!-- <z-nav-bar title="我的图书"></z-nav-bar> -->
<view class="home_bg">
<view class="flexbox" style=" justify-content: space-between; ">
<view class="" style=" ">
<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="hehan">
<image src="../../static/icon/hehan.png" mode="aspectFit" class="icon_hua_1"></image>
</view>
<view class="search_box flexbox" @click="onPageJump('./searchFor')">
<view class="search">
<text class="icon_search"></text>
<text class="prompt">请输入想要搜索的书名</text>
</view>
</view>
<view class="searBtn flexbox">
<!-- <view class="searBtn flexbox">
<text>搜索</text>
</view> -->
</view>
</view>
<view class="home_lunbo">
<!-- <view class="home_lunbo">
<u-swiper :list="list3" indicator indicatorMode="line" circular style="height: 180rpx;"></u-swiper>
</view>
</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>
@@ -109,9 +111,9 @@
<u-divider text="全部加载完成"></u-divider>
</view>
</view>
<view class="shuwuLink">
<!-- <view class="shuwuLink">
<image @click="" src="../../static/icon/shuwu.jpg" mode="aspectFit"></image>
</view>
</view> -->
<music-play :playData="playData"></music-play>
<z-navigation></z-navigation>
</view>
@@ -431,21 +433,24 @@
}
}
.home_bg {
background-image: url('@/static/icon/home_bg1.jpg');
background-image: url('@/static/icon/home_bg.jpg');
background-position: center center;
background-repeat: no-repeat;
background-size: cover;
padding: 100rpx 20rpx 40rpx 20rpx;
position: relative;
height: 400rpx; margin-bottom: 130rpx;
padding: 20rpx;
position: relative; margin-bottom:60rpx;
// height: 400rpx; margin-bottom: 130rpx;
.icon_hua_1 {
// margin: 0 auto;
width: 150rpx;
width: 100%; text-align: center;
height: 150rpx;
image{width: 150rpx; height: 150rpx;}
}
.icon_hua{width: 150rpx; display: block;}
.search_box { margin-top: 20rpx; align-items: center;
width: calc(100% - 300rpx);
.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-bottom: -52rpx;
.search{height: 80upx;
display: flex;

View File

@@ -54,6 +54,7 @@
</view>
</view>
<u-divider v-else text="暂无买书籍数据~"></u-divider>
<view>
<view v-if="status==0" style="text-align: center;">
<u-loading-icon style="display: inline-block;"></u-loading-icon>

View File

@@ -30,6 +30,11 @@
{{item.title}} >
</p>
</view>
<view class="tags">
<uni-tag class="tag" @click="toMore()" :inverted="true" text="书评" type="success"></uni-tag>
<!-- 1:打卡2不打卡 -->
<uni-tag @click="gotoclock()" v-if="bookInfo.clockIn == 1" class="tag" :inverted="true" text="签到" type="warning"></uni-tag>
</view>
<!-- <view class="price">
<text class="light">98.00</text>
</view> -->
@@ -69,7 +74,7 @@
sort:0 可以听
sort:1 不可以听
-->
<view class="playList" >
<view class="playList" v-if="libLIst.length > 0">
<view class="item" v-for="(item,index) in libLIst" :key="index" >
<view >
<view
@@ -82,6 +87,7 @@
</view>
</view>
</view>
<u-divider v-else text="暂无听书目录"></u-divider>
<music-play :playData="playData"></music-play>
<!-- <z-navigation></z-navigation> -->
@@ -185,6 +191,19 @@
},
methods: {
...mapMutations(['setUserInfo']),
// 查看本书更多书评
toMore(val){
console.log(val,'val')
uni.navigateTo({
url: '../comments/comments?bookid='+ this.bookid,
});
},
// 去打卡
gotoclock(){
uni.navigateTo({
url: '../clock/clock?bookid='+ this.bookid,
});
},
getBookInfo(){
// 获取书本基本信息
this.$http
@@ -315,17 +334,6 @@
uni.navigateTo({
url: '../bookShop/settlementBook?type=2&list=' + this.bookid
});
// uni.showModal({
// title: '提示',
// cancelText: '暂不购买',
// confirmText:'立即购买',
// content: '确定花费¥95元购买本书电子版吗',
// success: function (res) {
// if (res.confirm) {
// console.log('用户点击确定');
// }
// }
// });
},
@@ -336,41 +344,7 @@
});
},
// 第一次加载音乐播放器
firstListen(){
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){
if(res.bookCatalogue.voices[0] != null){
// 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{
uni.showToast({
title:'暂无可播放音频~',
icon:'none',
duration:2000
})
setTimeout(()=>{
uni.navigateBack({ // 返回上一页
delta: 1
});
},2000)
}
}
}).catch((e)=>{})
},
// 存储播放进度
saveRate(val){
this.$http
@@ -431,15 +405,16 @@
this.libLIst = res.BookCatalogue
// this.fengImg = res.images
}else{
uni.showToast({
title:'暂无可听章节哦~',
icon:'none'
})
setTimeout(()=>{
uni.navigateBack({ // 返回上一页
delta: 1
});
},2000)
this.libLIst = []
// uni.showToast({
// title:'暂无可听章节哦~',
// icon:'none'
// })
// setTimeout(()=>{
// uni.navigateBack({ // 返回上一页
// delta: 1
// });
// },2000)
}
}
}).catch((e)=>{
@@ -541,6 +516,11 @@
.price{ margin-top: 160rpx; overflow: hidden;
.light{font-size: 50rpx; font-weight: bold; color: #f05654;}
}
.tags{
.tag{
margin-left: 0; margin-right: 10rpx;
}
}
.charType{display: inline; width:20px !important;}
.graytitle{color: #999;}
.yigoumai{background-color: #ffc773;}

View File

@@ -2,19 +2,22 @@
<view style="font-size: 28upx;">
<!-- <z-nav-bar backState="2000" title="首页"></z-nav-bar> -->
<view class="home_bg">
<view class="flexbox" style=" justify-content: space-between; ">
<view class="" style=" ">
<view class="icon_hua">
<image src="../../static/icon/home_icon_3.png" mode="aspectFit" class="icon_hua_1"></image>
</view>
<view class="hehan">
<image src="../../static/icon/hehan.png" mode="aspectFit" class="icon_hua_1"></image>
</view>
<view class="search_box flexbox" @click="onPageJump('./searchFor')">
<view class="search">
<text class="icon_search"></text>
<text class="prompt">请输入想要搜索的书名</text>
</view>
</view>
<view class="searBtn flexbox">
<!-- <view class="searBtn flexbox">
<text>搜索</text>
</view>
</view> -->
</view>
<!-- <view class="home_lunbo">
<u-swiper :list="list3" indicator indicatorMode="line" circular style="height: 180rpx;"></u-swiper>
@@ -48,16 +51,16 @@
<u-swiper :list="list3" indicator indicatorMode="line" circular style="height: 180rpx;"></u-swiper>
</view> -->
<view class="home_shujia" v-if="showEbook">
<!-- <view class="home_shujia" v-if="showEbook">
<view class="hn_sj" @click="onTabJump('./bookshelf')">
<image src="../../static/icon/midBtn_01.png" mode="aspectFit"></image>
我的书架
</view>
</view> -->
<!-- <view class="hn_sj">
<image src="../../static/icon/midBtn_02.png" mode="aspectFit"></image>
图书推荐
</view> -->
<view class="hn_sj" @click="onPageJumpData('../eBook/bookList',1)">
<!-- <view class="hn_sj" @click="onPageJumpData('../eBook/bookList',1)">
<image src="../../static/icon/midBtn_03.png" mode="aspectFit"></image>
</view>
@@ -73,15 +76,15 @@
<image src="../../static/icon/midBtn_06.png" mode="aspectFit"></image>
</view>
</view>
<view class="head_line" v-if="seckillList!=null">
</view> -->
<!-- <view class="head_line" v-if="seckillList!=null">
<b></b>
<text>商品秒杀</text>
<i @click="onShopMore('Sale')">查看更多 ></i>
</view>
</view>-->
<!-- 限时秒杀 -->
<view class="limited" v-if="seckillList!=null">
<!-- <view class="limited" v-if="seckillList!=null">
<view class="limitedSymbol">
<image src="../../static/icon/shopping_xsh.png"></image>
</view>
@@ -96,7 +99,7 @@
</view>
</u-scroll-list>
</view>
</view>
</view> -->
<view class="head_line" >
<b></b>
@@ -115,17 +118,85 @@
</view>
</scroll-view>
</view>
<!-- end -->
<view class="head_line" style="margin-bottom: 10px;">
<!-- <view class="home_xinshu" v-if="showEbook">
<view v-for="(item, index) in xinsList" @click="onBookJump(item)" v-if="index<3" class="hx_list">
<image :src="item.image"></image>
<view class="hx_title">{{item.bookName}}</view>
<view class="hx_author">{{item.authorName}} []</view>
<b v-if="item.isVip==1" style="background: #c79119;">VIP</b>
<b v-if="item.isVip==2" style="background: #c74119;">付费</b>
</view>
<br clear='both'>
<view v-for="(item, index) in xinsList" @click="onBookJump(item)" v-if="index>2&&index<6" class="hx_list">
<image :src="item.image"></image>
<view class="hx_title">{{item.bookName}}</view>
<view class="hx_author">{{item.authorName}} []</view>
<b v-if="item.isVip==1" style="background: #c79119;">VIP</b>
<b v-if="item.isVip==2" style="background: #c74119;">付费</b>
</view>
<br clear='both'>
</view> -->
<!-- end -->
<!-- <view class="head_line" v-if="showEbook">
<b></b>
<text>限时特价</text>
<i @click="onBookMore('Sale')">查看更多 ></i>
</view>
<view class="home_limit" v-if="showEbook">
<u-scroll-list indicatorActiveColor="#27b386">
<view v-for="(item, index) in limiTist" :key="index" @click="onBookJump(item)" class="lt_list">
<image :src="item.image"></image>
<view class="lt_title">{{item.bookName}}</view>
<view class="lt_author">{{item.authorName}} []</view>
<view class="lt_yuan">{{item.price}}疯币</view>
<view class="lt_xian">{{item.salePrice}}疯币</view>
<b v-if="item.isVip==1" style="background: #c79119;">VIP</b>
<b v-if="item.isVip==2" style="background: #c74119;">付费</b>
</view>
</u-scroll-list>
</view> -->
<!-- <view class="head_line" v-if="showEbook">
<b></b>
<text>精选书单</text>
<i @click="onBookMore('Best')">查看更多 ></i>
</view>
<view class="home_jingxu" v-if="showEbook">
<view class="hj_hot" v-for="(item,index) in jingList" @click="onBookJump(item)">
<view>
<text class="bok_name">{{item.bookName}}</text>
<text style="margin-left: 50rpx;" v-if="item.authorName!=''">{{item.authorName}}</text>
</view>
<view v-if="item.publisherName!=''">
<text>出版社{{item.publisherName}}</text>
</view>
<view>
<text>{{item.introduce | ellipsis}}</text>
</view>
<image :src="item.image"></image>
<b v-if="item.isVip==0">免费</b>
<b v-if="item.isVip==1" style="background: #c79119;">VIP</b>
<b v-if="item.isVip==2" style="background: #c74119;">付费</b>
</view>
</view> -->
<view class="head_line" style="margin: 30rpx 0;">
<b></b>
<text>精选商品</text>
<!-- <i @click="onShopMore('Hot')">查看更多 ></i> -->
<i @click="onPageJump('../bookShop/classify')">查看更多 ></i>
</view>
<view class="ProTabs">
<text :class="[tabsNumber == 0 ? 'cur' :'']" @click="tabsChange(0)">精选图书</text>
<text :class="[tabsNumber == 1 ? 'cur' :'']" @click="tabsChange(1)">折扣图书</text>
</view>
<!-- 商品展示 -->
<view class="goods">
<!-- 精选 -->
<view class="" v-show="tabsNumber == 0">
<view class="" v-if="goodsList.length > 0">
<view class="goodsItem" v-for="(item,index) in goodsList" :key="item.productId"
@click="goDetail(item.productId)">
<image :src="item.productImages" mode="" class="goodsImg"></image>
@@ -134,20 +205,44 @@
{{item.productName}}
</view>
<view class="goodsPrice">
<span class="price">{{item.price}}</span>
<span class="price" v-if="item.activityPrice && item.activityPrice > 0">{{item.activityPrice}}</span>
<span class="price" v-else>{{item.price}}</span>
<span class="Salesnum">已售{{item.sumSales}} </span>
</view>
</view>
</view>
<br clear="both">
</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>
<u-divider v-else text="暂无精选书籍哦~"></u-divider>
</view>
<view v-if="status==1">
<u-divider text="全部加载完成"></u-divider>
<!-- 折扣 -->
<view class="zhekou" v-show="tabsNumber == 1">
<view v-if="offSaleList.length > 0">
<view class="goodsItem" v-for="(item,index) in offSaleList" :key="item.productId"
@click="goDetail(item.productId)">
<image :src="item.productImages" mode="" class="goodsImg"></image>
<view class="goodsContent">
<view class="goodsName">
{{item.productName}}
</view>
<view class="goodsPrice flexbox">
<view class="activityPrice">
<span class="price" v-if="item.activityPrice && item.activityPrice > 0">
<i style="font-style: normal; font-size: 28rpx;"></i>{{item.activityPrice}}</span>
</view>
<view class="priceAndnum">
<span class="price">原价<span style="text-decoration:line-through;">{{item.price}}</span></span>
<span class="Salesnum">已售{{item.sumSales}} </span>
</view>
</view>
</view>
</view>
<br clear="both">
</view>
<u-divider v-else text="暂无折扣书籍哦~"></u-divider>
</view>
</view>
<view>
<u-back-top :scroll-top="scrollTop" bottom="60" :customStyle='bgiStyle' :iconStyle="iconStyle"></u-back-top>
@@ -165,8 +260,7 @@
import repciptData from '@/static/json/repcipt.json'
import $http from '@/config/requestConfig.js';
import {
mapState,
mapMutations
mapState,mapMutations
} from 'vuex';
export default {
data() {
@@ -176,9 +270,7 @@
transaction: { // 成功回调
},
status: 3,
jPage: 1,
jTotal: 0,
tabsNumber : 0,
scrollLeft:0,
maxTimes:1, // 轮询最大次数
ComplateRequestInterval:null, // 轮询定时器
@@ -195,6 +287,7 @@
limiTist: [],
jingList: [],
seckillList: [],
offSaleList:[], // 折扣列表
goodsList: [],
bgiStyle: {
background: '#fff'
@@ -220,7 +313,6 @@
onShow() {
// 隐藏原生的tabbar
uni.hideTabBar();
this.goodsList = []
this.getData();
@@ -231,27 +323,12 @@
},
// 下拉刷新
onPullDownRefresh() {
console.log('下拉刷新')
this.jPage = 1
this.goodsList = []
this.getData()
uni.stopPullDownRefresh()
this.requestIapOrder()
},
onHide() {
this.jPage = 1
this.goodsList = []
},
onReachBottom() {
console.log('到底了')
// if (this.jPage + 1 <= this.jTotal) {
// this.jPage++
// this.getJBook()
// } else {
// this.status = 1
// }
},
filters: {
// 控制字数
ellipsis(value) {
@@ -274,19 +351,25 @@
//方法
methods: {
...mapMutations(['setUserInfo']),
gotopingshu(val) {
uni.navigateTo({
url: '../comments/comments?bookid=' + val.id,
});
tabsChange(num){
if(num != this.tabsNumber){
this.tabsNumber = num
}
},
// 去打卡
gotoclock(item) {
this.onPageJump('../clock/clock?bookid=' + item.id)
},
// 去听书
gotoListen(item) {
uni.navigateTo({
url: "../listen/listen?bookid=" + item.id
// 获取折扣图书
getOffSale(){
this.$http
.post('book/shopproduct/listactivityprice?limit=10&page=1')
.then(res => {
console.log(res,'折扣')
if(res.code == 0 && res.page.list.length > 0){
this.offSaleList = res.page.list
this.tabsNumber = 0
}
}).catch(e => {
console.log(e,'e')
});
},
// 新书上市
@@ -368,9 +451,7 @@
console.log('关闭订单成功',index);
if(index == this.ComplateRequestArr.length-1){ // 最后一个支付订单
this.setUserInfo({
restoreFlag: false
});
this.setUserInfo({restoreFlag:false});
// console.log(this.userInfo.restoreFlag,'this.ComplateRequestArr.length+++')
}
@@ -468,36 +549,33 @@
},
// 获取列表数据
getData() {
this.$http
.post('book/book/bookIndex')
.then(res => {
this.xinsList = res.bookIndex.newBookList
this.limiTist = res.bookIndex.saleList
this.jingList = res.bookIndex.topBookList
});
// this.$http
// .post('book/book/bookIndex')
// .then(res => {
// // this.xinsList = res.bookIndex.newBookList
// // this.limiTist = res.bookIndex.saleList
// // this.jingList = res.bookIndex.topBookList
// });
// 获取限时秒杀
this.$http
.get(`book/shopseckill/getSeckillProd`)
.then(res => {
this.seckillList = res.list
// this.seckillList = null
})
// this.$http
// .get(`book/shopseckill/getSeckillProd`)
// .then(res => {
// this.seckillList = res.list
// // this.seckillList = null
// })
// 获取精选图书
this.getJBook()
this.getNewBook()
},
// 获取精选图书
getJBook() {
// 获取精选商品
this.$http
.post('book/shopproduct/appGetList?limit=30&page=1&istop=1')
.then(res => {
console.log(res.page.list,'首页商品')
this.goodsList = res.page.list
})
this.getOffSale()
this.getNewBook()
},
// 跳转
onPageJump(url) {
uni.navigateTo({
@@ -527,7 +605,7 @@
// 电子书内容跳转
onBookJump(e) {
uni.navigateTo({
url: '../eBook/bookContent?Id=' + e.id
url: '../eBook/bookContent?Id=' + e.bookid
});
},
// 商品详情页
@@ -559,62 +637,37 @@
</script>
<style lang="scss" scoped>
@import '@/style/mixin.scss';
.tags {
uni-tag {
margin-right: 10rpx;
.zhekou{
.goodsName{margin-bottom: 20rpx;}
}
.activityPrice{font-size: 60rpx;}
.priceAndnum{ font-size: 24rpx !important;
.price{color: #9b9b9b !important; font-size: inherit; font-weight: normal !important; display: block;}
}
.newBook {
margin-top: 20rpx;
.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.cur{background-color:#55aa7f ; color: #fff;}
}
.newBook{margin-top: 20rpx;}
.scroll-view_H{background-color: #fff;white-space: nowrap;
width: 100%; padding:10rpx ; }
.scroll-view_H{
background-color: #fff;
white-space: nowrap;
width: 100%;
padding: 10rpx;
}
.scroll-view_H {
.item {
padding: 10rpx;
overflow: hidden;
display: inline-block;
width: 180rpx !important;
margin-right: 20rpx;
border-radius: 10rpx;
.item { padding: 10rpx; overflow: hidden; display: inline-block;
width: 180rpx !important; margin-right: 20rpx; border-radius: 10rpx;
.videoBox{
image {
display: block;
width: 150rpx;
image{display: block; width:150rpx;
height: 170rpx;
}
}
.bookName {
display: block;
margin-top: 20rpx;
color: #666;
font-size: 24rpx;
white-space: nowrap;
overflow-x: hidden;
overflow: hidden;
text-overflow: ellipsis;
.bookName{display: block; margin-top: 20rpx; color: #666; font-size: 24rpx; white-space: nowrap;
overflow-x: hidden; overflow: hidden;
text-overflow: ellipsis;}
}
}
// .item.active{margin-right: 20rpx; border: 1px solid #55aa00; border-radius: 10rpx;}
}
.flexbox {
display: flex;
}
.flexbox{display: flex;}
.head_line {
margin: 30rpx 0 0 0;
margin: 20rpx 0 0 0;
b {
@@ -641,32 +694,26 @@
}
.home_bg {
background-image: url('@/static/icon/home_bg1.jpg');
background-image: url('@/static/icon/home_bg.jpg');
background-position: center center;
background-repeat: no-repeat;
background-size: cover;
padding: 20rpx;
position: relative;
position: relative; margin-bottom:60rpx;
// height: 400rpx; margin-bottom: 130rpx;
.icon_hua_1 {
// margin: 0 auto;
width: 150rpx;
width: 100%; text-align: center;
height: 150rpx;
image{width: 150rpx; height: 150rpx;}
}
.icon_hua {
width: 150rpx;
display: block;
.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-bottom: -52rpx;
.search_box {
margin-top: 20rpx;
align-items: center;
width: calc(100% - 300rpx);
.search {
height: 80upx;
.search{height: 80upx;
display: flex;
width: 100%;
align-items: center;
@@ -675,10 +722,8 @@
border-radius: 20upx;
box-shadow: 0 0px 10px 1px #54a96633;
}
.prompt {
color: #838383;
font-size: 24rpx;
color: #838383; font-size: 24rpx;
}
@@ -692,40 +737,30 @@
margin-right: 20upx;
}
}
.searBtn{
width: 80rpx;
align-items: center;
font-size: 30rpx;
color: #fff;
width: 80rpx; align-items: center;
font-size: 30rpx; color: #fff;
}
}
.home_nar {
padding-bottom: 20rpx;
margin: 30rpx 20rpx;
justify-content: space-between;
margin: 30rpx 20rpx; justify-content: space-between;
display: flex;
color: #333; margin-bottom: 0 !important;
color: #333; margin-bottom: 0;
// .dianzishu{ margin-right:10rpx;
// background-color:#f8d6f4 ; border: 2px solid #edcce9;
// }
// .chaoshi{background-color:#fff2d8 ; border: 2px solid #ede6d3; }
// .shuping{ background-color: #d6ffda; border: 2px solid #bae9bf;}
// .shuguan{ background-color:#e3f9f9 ; border: 2px solid #d7eced; }
.hn_cl_tit {
padding-bottom: 10rpx;
.hn_cl_tit { padding-bottom: 10rpx;
// width: 23%;
width: 31%;
text-align: center;
border-radius: 20rpx;
padding-top: 10rpx;
border-radius: 20rpx ; padding-top: 10rpx;
// line-height: 110upx;
//display: flex;
align-content: center;
justify-content: center;
image {
width: 110upx;
height:110upx;
@@ -733,15 +768,7 @@
margin: 0 auto;
// margin: 0 20rpx;
}
text {
display: block;
text-align: center;
margin-top: 10px;
font-size: 36rpx;
color: #000;
font-weight: blod;
}
text{ display:block; text-align: center; margin-top:4rpx; font-size: 36rpx; color: #000; font-weight:blod;}
}
@@ -1005,7 +1032,7 @@
.goods {
width: 100%;
margin: 40rpx 0 50rpx 0;
margin:18rpx 0 50rpx 0;
.goodsItem {
display: inline-block;
@@ -1033,17 +1060,12 @@
.goodsPrice {
font-size: 30rpx;
margin: 5rpx 0 0 3rpx;
display: flex;
justify-content: space-between;
display: flex; justify-content: space-between;
.price{
font-weight: bold;
color: #bf0c0c;
}
.Salesnum {
color: #9b9b9b;
}
.Salesnum{color: #9b9b9b;}
}
}
}