听书页面

This commit is contained in:
@fawn-nine
2023-07-19 17:41:16 +08:00
parent afb1462db6
commit fc9bca37c1
13 changed files with 169 additions and 71 deletions

View File

@@ -26,7 +26,8 @@
<u-tabs :scrollable="false" :list="contentButtonList" @click="contentButtonClick"></u-tabs>
</view>
<!-- 详情 + 评价1 -->
<view class="bookInfo">
<view v-if="contentShow == 0">
<view class="bookInfo" >
<u-row customStyle="margin-bottom: 10px">
<u-col ><span>书名{{productInfo.productName}}</span></u-col>
</u-row>
@@ -48,11 +49,15 @@
</u-row>
</view>
<!-- <view class="commodityIntroduce" v-html="productInfo.productDetails"> -->
<view class="commodityIntroduce">
<view class="commodityIntroduce" >
<view v-if="productInfo.productDetails" >
<rich-text v-if="productInfo.productDetails" class="xiangqing" :nodes="productInfo.productDetails|formatRichText"></rich-text>
<rich-text v-if="productInfo.productDetails" class="xiangqing" :nodes="productInfo.productDetails|formatRichText"></rich-text>
</view>
</view>
</view>
<view v-else>
用户评价
</view>
<view style="height: 120rpx;"></view>
</view>
<uni-goods-nav class="goods_nav" :fill="true" :options="options" :buttonGroup="buttonGroup" @click="onClick"
@@ -69,6 +74,7 @@
export default {
data() {
return {
contentShow:0,
options: [{
icon: 'cart',
text: '购物车'
@@ -86,7 +92,10 @@
],
contentButtonList: [{
name: '商品详情'
}
},
{
name: '商品评论'
}
],
// 轮播图数据
swiperlist: [],
@@ -96,34 +105,47 @@
cartList: [], // 购物车列表
}
},
onLoad(e) {
// 获取商品详情
uni.showLoading({
title: '加载中'
});
this.$http
.post('/book/shopproduct/info/' + e.id)
.then(res => {
this.productInfo = res.shopProduct
if (this.productInfo.productImageList == null || this.productInfo.productImageList == '') {
this.swiperlist.push('../../static/icon/home_ban_1.jpg')
} else {
let imgList = this.productInfo.productImageList.split(",")
// if(this.productInfo.productDetails != null){
// let info = this.formatRichText(this.productInfo.productDetails)
// }
// this.productInfo.productDetails = info
for (var i = 0; i < imgList.length; i++) {
this.swiperlist.push(imgList[i])
}
}
uni.hideLoading();
})
onLoad(e) {
this.getProDetail(e)
this.getComment()
},
computed: {
...mapState(['userInfo']),
},
methods: {
getProDetail(e){
// 获取商品详情
uni.showLoading({
title: '加载中'
});
this.$http
.post('/book/shopproduct/info/' + e.id)
.then(res => {
this.productInfo = res.shopProduct
if (this.productInfo.productImageList == null || this.productInfo.productImageList == '') {
this.swiperlist.push('../../static/icon/home_ban_1.jpg')
} else {
let imgList = this.productInfo.productImageList.split(",")
// if(this.productInfo.productDetails != null){
// let info = this.formatRichText(this.productInfo.productDetails)
// }
// this.productInfo.productDetails = info
for (var i = 0; i < imgList.length; i++) {
this.swiperlist.push(imgList[i])
}
}
uni.hideLoading();
})
},
// 获取商品评论
getComment(){
},
contentButtonClick(e){
this.contentShow = e.index
},
// 点击购物车
onClick(e) {
console.log(e.content.text)