听书页面

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)

View File

@@ -2,8 +2,10 @@
<view class="">
<view class="header">
<!-- 顶部导航栏 -->
<z-nav-bar title="物流详情" bgColor="red"></z-nav-bar>
<u-tabs active-color="#2979ff" inactive-color="#606266" bar-height="6" bar-width="40" v-if="deliverList"
<z-nav-bar title="物流详情" bgColor="red"></z-nav-bar>
</view>
<view v-if="deliverList.length > 0">
<u-tabs active-color="#2979ff" inactive-color="#606266" bar-height="6" bar-width="40"
name="name" :list="deliverList" :is-scroll="false" :current="current" @change="tabchange"></u-tabs>
<view class="deliverCntent">
<view class="" v-for="(list, index1) in deliverDetails" :key="index1">
@@ -22,6 +24,10 @@
</view>
</view>
</view>
<view class="quesheng" v-else>
<image src="../../static/icon/kongbai.png" ></image>
<text>- 暂无物流信息 -</text>
</view>
<!-- <u-loading color="red" :show="loading"></u-loading> -->
</view>
</template>
@@ -76,7 +82,7 @@
this.$http
.post(`/book/buyorder/queryFMS?orderId=${this.orderId}`)
.then(res => {
// console.log(res, '物流信息')
console.log(res, '物流信息')
if (res && res.code === 0) {
uni.hideLoading()
this.deliverDetails = res.rntStr
@@ -101,6 +107,13 @@
}
</style>
<style lang="scss" scoped>
.quesheng{text-align: center; margin-top: 20px;
image{ width: 150rpx; height: 170rpx; display: block; margin: 10px auto;
}
text{
color: #888;
}
}
.copyCode{display: inline-block; margin-left: 20rpx; }
.u-tabs {
background: #fff

View File

@@ -241,7 +241,7 @@
icon: 'none',
title: '取消订单成功'
})
uni.navigateTo({
uni.switchTab({
url: './orderList'
});
})

View File

@@ -2,7 +2,8 @@
<view>
<!-- 公共组件-每个页面必须引入 -->
<public-module></public-module>
<z-nav-bar title="我的订单"></z-nav-bar>
<!-- <z-nav-bar title="我的订单"></z-nav-bar> -->
<z-nav-bar backState="2000" title="我的订单"></z-nav-bar>
<view class="orderTabs">
<view v-for="(item,index) in orderTabs" @click="orderTabCLi(item.value)"
@@ -68,7 +69,7 @@
</view>
</view>
</view>
<z-navigation></z-navigation>
</view>
</template>

View File

@@ -346,6 +346,7 @@
this.adressMoRen = this.addressList[this.adressMoRIndex]
console.log(this.adressMoRen, '默认')
if(this.adressMoRen != {}){
console.log('运费之前')
this.getYunFei()
}else{
this.getUserAddress()
@@ -429,18 +430,21 @@
})
},
// 获取运费
getYunFei(){
getYunFei(){
let key = []
let dataToString = ''
// console.log(this.adressMoRen, '默认地址')
this.cartList.forEach((item, index) => {
key.push({productsid: item.productId, productAmount:item.productAmount})
dataToString = dataToString.concat(item.productId+"="+item.productAmount+"&")
})
})
console.log(this.adressMoRen.areaidpath,dataToString,'this.adressMoRen.areaidpath')
$http.request({
url: "book/buyorder/getTransPrice/" + this.adressMoRen.areaidpath + "?" + dataToString,
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
// data: key,
data:{
loadAnimate:'none', // 请求加载动画
} ,
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
@@ -511,7 +515,7 @@
})
},
// 更改地址
choseDizhi(e) {
choseDizhi(e) {
this.adressMoRIndex = e
this.adressMoRen = this.addressList[this.adressMoRIndex]
console.log(this.adressMoRen)
@@ -619,9 +623,12 @@
title: "支付成功"
});
setTimeout(() => {
uni.navigateTo({
uni.switchTab({
url: './orderList'
});
// uni.navigateTo({
// url: './orderList'
// });
}, 1000)
} else {
uni.showToast({
@@ -629,11 +636,12 @@
icon: "none",
image: '../../static/icon/ic_close.png'
});
setTimeout(() => {
uni.navigateTo({
url: './orderList'
});
}, 1000)
// setTimeout(() => {
// uni.navigateTo({
// url: './orderList'
// });
// }, 1000)
}
})
}else if(this.payType == 1){
@@ -649,7 +657,7 @@
title: "支付成功"
});
setTimeout(() => {
uni.navigateTo({
uni.switchTab({
url: './orderList'
});
}, 1000)
@@ -677,7 +685,7 @@
icon: "success"
});
setTimeout(() => {
uni.navigateTo({
uni.switchTab({
url: './orderList'
});
}, 1000)