听书页面

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

@@ -6,7 +6,7 @@ if (process.env.NODE_ENV === 'development') {
// socketUrl = "ws://localhost:6001/";
// baseUrl = "https://twin-ui.com/demo/";
// baseUrl = "http://59.110.212.44:9100/pb/";
baseUrl = "http://192.168.110.100:9100/pb/";
baseUrl = "http://192.168.110.100:9100/pb/";
// socketUrl = "ws://8.129.186.35:6001/";
} else if (process.env.NODE_ENV === 'production') {
// 生产环境

View File

@@ -28,7 +28,7 @@
"navigationBarTitleText": "我的",
"enablePullDownRefresh":false
}
},
},
{
"path": "pages/peanut/searchFor",
"style": {
@@ -210,7 +210,8 @@
{
"path": "pages/bookShop/settlement",
"style": {
"navigationBarTitleText": "商品结算"
"navigationBarTitleText": "商品结算",
"enablePullDownRefresh": false
}
},
{
@@ -234,7 +235,8 @@
{
"path": "pages/user/address",
"style": {
"navigationBarTitleText": "地址管理"
"navigationBarTitleText": "地址管理",
"enablePullDownRefresh": false
}
},
{
@@ -259,6 +261,33 @@
}
}
,{
"path" : "pages/listen/listen",
"style" :
{
"navigationBarTitleText": "悦耳列表",
"enablePullDownRefresh": false
}
}
,{
"path" : "pages/listen/home",
"style" :
{
"navigationBarTitleText": "悦耳听书",
"enablePullDownRefresh": true
}
}
,{
"path" : "pages/listen/search",
"style" :
{
"navigationBarTitleText": "搜索听书",
"enablePullDownRefresh": false
}
}
],
"globalStyle": {
"navigationBarTextStyle": "black",

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)

View File

@@ -1,18 +1,23 @@
<template>
<view style="font-size: 28upx;">
<!-- <z-nav-bar backState="2000" title="首页"></z-nav-bar> -->
<view class="home_bg">
<view class="home_bg" >
<image src="../../static/icon/home_icon_1.png" mode="aspectFit" class="icon_hua_1"></image>
<view v-if="showEbook" class="search_box" @click="onPageJump('./searchFor')">
<text class="icon_search"></text>
<text class="prompt">搜索...</text>
</view>
</view>
<view class="home_nar" v-if="showEbook">
<view class="hn_cl_tit dianzishu" @click="onPageJump('../eBook/bookList')">
<!-- <view class="home_nar" v-if="showEbook"> -->
<view class="home_nar">
<view class="hn_cl_tit dianzishu" @click="onPageJump('../listen/home')">
<image src="../../static/icon/home_bar_1.png" mode="aspectFit"></image>
<text>听书</text>
</view>
<!-- <view class="hn_cl_tit dianzishu" @click="onPageJump('../eBook/bookList')">
<image src="../../static/icon/home_bar_1.png" mode="aspectFit"></image>
<text>电子书</text>
</view>
</view> -->
<!-- <view class="hn_cl_tit" @click="onPageJump('../bookShop/bookShopIndex')"> -->
<view class="hn_cl_tit chaoshi" @click="onPageJump('../bookShop/classify')">
<image src="../../static/icon/home_bar_2.png" mode="aspectFit"></image>

View File

@@ -55,9 +55,12 @@
</view>
<view class="xiugai">
<view class="nav_list" @click="onPageJump('../bookShop/orderList')">
<view class="nav_list" @click="switchTab('../bookShop/orderList')">
<text>我的订单</text>
</view>
<view class="nav_list" @click="onPageJump('../listen/home')">
<text>我的听书</text>
</view>
<!-- <view v-if="showEbook" class="nav_list" @click="onPageJump('../eBook/bookBuy')">
<text>电子书购买记录</text>
</view> -->
@@ -70,6 +73,7 @@
<view class="nav_list" @click="onPageJump('../user/address')">
<text>地址管理</text>
</view>
<!-- <view class="nav_list" @click="onGoing()">
<text>帮助与反馈</text>
</view> -->
@@ -127,6 +131,11 @@
},
//方法
methods: {
switchTab(url){
uni.switchTab({
url: url
});
},
getData() {
// 获取个人信息
if (this.userInfo.id != undefined) {
@@ -148,14 +157,14 @@
//分享app
onShare(){
let shareData = {
shareUrl:"https://sj.qq.com/appdetail/com.cn.nuttyreading?source=gdaq",
shareUrl:"https://www.nuttyreading.com/nuttyreading.apk",
shareTitle:"疯子读书",
type:'0',
shareContent:"疯子读书",
shareContent:"疯子读书,请使用浏览器打开本链接,自动下载安装包",
shareImg:"static/fengziIcon.jpg",
appId : "wx47134a8f15083734", // 默认不传type的时候必须传appId和appPath才会显示小程序图标1
appPath : "https://sj.qq.com/appdetail/com.cn.nuttyreading?source=gdaq",
appWebUrl : "https://sj.qq.com/appdetail/com.cn.nuttyreading?source=gdaq",
appId : "wx47134a8f15083734", // 默认不传type的时候必须传appId和appPath才会显示小程序图标
appPath : "https://www.nuttyreading.com/nuttyreading.apk",
appWebUrl : "https://www.nuttyreading.com/nuttyreading.apk",
};
// 调用
let shareObj = appShare(shareData,res => {

View File

@@ -329,7 +329,7 @@
duration:2000
});
setTimeout(()=>{
uni.navigateTo({
uni.switchTab({
url: '../bookShop/orderList'
});
},1000)

View File

@@ -62,7 +62,7 @@
columnDatas: [], //区地址
switchTrue: true,
switchFalse: false,
addressChanged:false, // 地址修改标记
navName: '', // 顶部导航栏标题
provId: '', // 存储省id
cityId: '', // 存储市id
@@ -237,6 +237,7 @@
},
changeHandler(e) { //城市选择时触发
this.addressChanged = true
const {
columnIndex, //当前选择的列,省 / 市 / 区
value, // 当前选择的数组内容
@@ -259,13 +260,14 @@
},
addconfirm(e) { //点击确定按钮
this.addressChanged = true
this.addreShow = false;
this.addressForm.areaidpathtext = e.value[0].UName + ' ' + e.value[1].UName + ' ' + e.value[2].UName
this.provId = e.value[0].provId
this.cityId = e.value[1].cityId
this.countyId = e.value[2].countyId
},
addcancel() { //点击取消按钮
this.addreShow = false;
},
@@ -280,6 +282,7 @@
link_add = 'book/useraddress/save'
} else {
link_add = 'book/useraddress/update'
// this.addconfirm(e)
}
if (this.addressForm.areaidpath == '') {
uni.showToast({
@@ -289,7 +292,10 @@
return
}
this.addressForm.userid = this.userInfo.id
this.addressForm.areaidpath = `${this.provId}_${this.cityId}_${this.countyId}`
if(this.addressChanged){ // 如果修改过地址区域,就重新赋值,否则保持不变
this.addressForm.areaidpath = `${this.provId}_${this.cityId}_${this.countyId}`
this.addressChanged = false
}
this.addressForm.areaid = this.countyId
this.addressForm.isdefault = this.addressForm.isDafault ? 1 : 0

View File

@@ -155,15 +155,19 @@
title: '手机验证成功',
duration: 1000,
});
console.log(res)
res.userInfo.token = res.token.token;
this.setUserInfo(res.userInfo);
setTimeout(() => {
uni.navigateBack({
delta: 1
});
}, 1000);
this.setUserInfo(res.userInfo);
// socket.init();
setTimeout(() => {
uni.switchTab({
url: '/pages/peanut/home'
});
}, 1000);
// uni.showModal({
// title: '提示',

View File

@@ -2934,9 +2934,10 @@ import { nextTick } from "vue";
})
}
// 检查是否已经购买
// this.bookMessage.isBuy==0&&this.bookMessage.chapterNum==null&&this.bookMessage.freeChapterCount!=0
// this.bookMessage.isBuy==0&&this.bookMessage.chapterNum==null&&this.bookMessage.freeChapterCount!=0
// book/bookchaptercontent/appBooksChapterContent?bookid=89&id=4039&userId=10176
return this.$http
.post('book/bookchaptercontent/appGetBookChapterContent', {
.post('book/bookchaptercontent/appBooksChapterContent', {
'userId': this.userInfo.id,
'bookid': this.bookId_mark,
'chapterid': chapterId