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">
<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 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>
</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>
<!-- <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

@@ -3,25 +3,27 @@
<!-- 公共组件-每个页面必须引入 -->
<!-- <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="home_bg">
<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>
<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 class="home_lunbo">
<u-swiper :list="list3" indicator indicatorMode="line" circular style="height: 180rpx;"></u-swiper>
</view>
</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>
@@ -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,49 +433,52 @@
}
}
.home_bg {
background-image: url('@/static/icon/home_bg1.jpg');
background-position: center center;
background-repeat: no-repeat;
background-size: cover;
padding: 100rpx 20rpx 40rpx 20rpx;
position: relative;
height: 400rpx; margin-bottom: 130rpx;
.icon_hua_1 {
// margin: 0 auto;
width: 150rpx;
height: 150rpx;
}
.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;
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;
// height: 400rpx; margin-bottom: 130rpx;
.icon_hua_1 {
// margin: 0 auto;
width: 100%; text-align: center;
height: 150rpx;
image{width: 150rpx; height: 150rpx;}
}
.prompt {
color: #838383; font-size: 24rpx;
.icon_hua{width: 100%; text-align: center; display: block;
image{width: 150rpx; height: 150rpx; margin: 0 auto;}
}
.icon_search {
background-image: url('@/static/icon/map_ic_search.png');
background-position: center center;
background-repeat: no-repeat;
background-size: cover;
width:36upx;
height: 36upx;
margin-right: 20upx;
.search_box { margin: 0 auto; margin-top: 20rpx; align-items: center;
width: calc(100% - 30rpx); margin-bottom: -52rpx;
.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: #838383; font-size: 24rpx;
}
.icon_search {
background-image: url('@/static/icon/map_ic_search.png');
background-position: center center;
background-repeat: no-repeat;
background-size: cover;
width:36upx;
height: 36upx;
margin-right: 20upx;
}
}
.searBtn{
width: 80rpx; align-items: center;
font-size: 30rpx; color: #fff;
}
}
.searBtn{
width: 80rpx; align-items: center;
font-size: 30rpx; color: #fff;
}
}
</style>

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('用户点击确定');
// }
// }
// });
},
@@ -335,42 +343,8 @@
url: '../eBook/bookMessage?Id=' + id + '&typ=' + e
});
},
// 第一次加载音乐播放器
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
@@ -430,16 +404,17 @@
if(res.BookCatalogue.length > 0){
this.libLIst = res.BookCatalogue
// this.fengImg = res.images
}else{
uni.showToast({
title:'暂无可听章节哦~',
icon:'none'
})
setTimeout(()=>{
uni.navigateBack({ // 返回上一页
delta: 1
});
},2000)
}else{
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;}

File diff suppressed because it is too large Load Diff