0309 听书

This commit is contained in:
@fawn-nine
2023-03-09 17:13:31 +08:00
parent aeed8684b1
commit 45cb5d66f7
8 changed files with 367 additions and 197 deletions

View File

@@ -9,7 +9,7 @@
:activeStyle="{color: '#303133',fontWeight: 'bold', transform: 'scale(1.01)'}"></u-tabs>
</view>
</view>
<view class="search_box" @click="onPageJump('./searchFor')">
<view class="search_box" @click="onPageJump('../peanut/searchFor')">
<text class="icon_search"></text>
<text class="prompt">搜索...</text>
</view>
@@ -36,15 +36,15 @@
</view>
<view class="commodityPrice">
<text class="price" v-if="item.price">
<b style="font-size: 40rpx;">{{item.price}}</b><span class="priceTag">折后价</span>
<b style="font-size: 40rpx;">{{item.price}}</b>
<span class="priceTag" v-if="item.activityPrice">原价{{item.activityPrice}}</span>
</text>
<text class="SoldNumber">已售<span>400</span></text>
<text class="SoldNumber" v-if="item.sumSales">已售<span>{{item.sumSales}}</span></text>
<!-- <text class="icon" @click.stop="addShopCar(item)" v-if="item.productStock">
<u-icon name="shopping-cart" :size="26" color="#eba00b"></u-icon>
</text> -->
<view class="publierInfo">
<span class="c999 f24">张三1</span><span class="c999 f24">/ xx出版社出版</span>
<view class="publierInfo" v-if="item.author && item.publisher">
<span class="c999 f24">{{item.author}}</span><span class="c999 f24">/ {{item.publisher}}</span>
</view>
</view>
</view>
@@ -79,13 +79,7 @@
},
// contentButtonClick(e) {
// console.log(e)
// },
// 跳转
onPageJump(url) {
uni.navigateTo({
url: url
});
},
// },
// onLoad(e) {
// //获取一级分类
// this.$http
@@ -104,6 +98,12 @@
...mapState(['userInfo']),
},
methods: {
// 跳转
onPageJump(url) {
uni.navigateTo({
url: url
});
},
// 获取一级分类
getOneLevel() {
this.$http
@@ -123,9 +123,17 @@
if (this.towLevel == '') {
this.commodityList = []
} else {
let newo = {
catId:0,
name:'全部',
parentCid:e.catId
}
this.towLevel.splice(0,0,newo)
// this.getCategoryList(res.list[0])
// console.log(this.towLevel, 'towLevel')
this.getCategoryList(res.list[0])
}
})
},
@@ -372,9 +380,9 @@
.priceTag {
flex-direction: row;
color: #f56c6c;
color: #999;
display: inline-block;
zoom: .7;
zoom: .8;
margin-left: 6rpx;
margin-bottom: 6px;
}

View File

@@ -30,15 +30,17 @@
<u-row customStyle="margin-bottom: 10px">
<u-col span="6"><span>书名{{productInfo.productName}}</span></u-col>
<u-col span="6" v-if="productInfo.author"><span>作者{{productInfo.author}}</span></u-col>
</u-row>
<u-row>
<u-col span="6" v-if="productInfo.publisher"><span>出版社{{productInfo.publisher}}</span></u-col>
<u-col span="6" v-if="productInfo.pubDate"><span>出版时间{{ productInfo.pubDate | formatDate }}</span></u-col>
<u-col span="6" v-if="productInfo.pubDate"><span>出版时间{{ productInfo.pubDate | formatDate }}</span></u-col>
</u-row>
<u-row>
<u-col span="6" v-if="productInfo.format"><span>开本{{productInfo.format}}</span></u-col>
<u-col span="6" v-if="productInfo.pageNum"><span>页数{{productInfo.pageNum}}</span></u-col>
</u-row>
<u-row>
<u-col span="6" v-if="productInfo.quality"><span>内文用纸材质{{productInfo.quality}}</span></u-col>
</u-row>

View File

@@ -39,7 +39,7 @@
<view class="itemPrice">
<text>{{item.price*item.productAmount}}</text>
<u-number-box v-model="item.productAmount" @change="valChange($event, item)" :input-width="50"
:input-height="20" :min="1" :max="item.productStock" integer @overlimit='overlimit'></u-number-box>
:input-height="20" :min="1" :max="item.productStock" integer ></u-number-box>
</view>
</view>
</view>
@@ -72,29 +72,39 @@
<view class="zhif_radio">
<u-radio-group v-model="payType">
<view style="width: 100%;">
<view v-for="(item, index) in paylist" @click="choseType(item.id)" class="zhif_xuanx">
<view v-for="(item, index) in paylist" class="zhif_xuanx">
<image :src="item.img"></image>
{{item.title}}
<span v-if="item.id == 4" style="color: #bbb; margin-left: 10px;">{{userMes.peanutCoin}}疯币可用</span>
<span @click.stop="buPoint" style="color: #bf0c0c; margin-left: 10px;" v-if="item.id == 4" class="chongBtn">去充值</span>
<u-radio :key="index" activeColor="#fe6e09" :name='item.id'
style="float: right;margin-top: 5rpx;"></u-radio>
style="float: right;margin-top: 5rpx;" ></u-radio>
</view>
</view>
</u-radio-group>
</view>
</view>
<view class="footer">
<view class="commodityPrice">
<view class="footer" >
<view class="commodityPrice" v-if="payType != 4">
<span style="color: #666;margin-right: 10rpx; font-size: 15px;">实付款: </span>
<span></span>{{realPrice}}
</view>
<view class="operate" @click="goBuyJie">
<view class="commodityPrice" v-if="payType == 4">
<span style="color: #666;margin-right: 10rpx; font-size: 15px;">实付款: </span>
{{realPrice}}<span>疯币</span>
</view>
<view class="operate" @click="goBuyJie" v-if="payType != 4">
<view class="goBuy">
立即支付
</view>
</view>
</view>
<view class="operate" @click="goPoinBuy" v-if="payType == 4">
<view class="goBuy">
立即支付
</view>
</view>
</view>
<!-- 地址弹出 -->
<u-popup :show="dizhiShow" :round="10" @close="dizhiShow=false">
<view class="tanchu">
@@ -185,6 +195,7 @@
shangIDNum: 0,
cartIDNum: [],
cartList: [],
userMes:{}, // 用户信息
amount:null, // 商品总价
addressList: [],
adressMoRen: {},
@@ -206,7 +217,12 @@
title: '支付宝',
id: 1,
img: '../../static/icon/pay_1.png'
}
},
{
title: '疯币购买',
id: 4,
img: '../../static/icon/oder_chong.png'
}
// {
// title: '微信',
// id: 2,
@@ -231,19 +247,41 @@
// this.getYunFei()
},
onShow() {
onShow() {
if (this.typeId == 1) {
this.getCartList()
} else if (this.typeId == 0) {
this.getShangList(this.shangIDNum);
}
// this.getUserAddress()
this.getData()
},
computed: {
...mapState(['userInfo']),
},
methods: {
// 充值疯币
buPoint() {
uni.navigateTo({
url: '../peanut/reCharge'
});
},
getData() {
let that = this
// 获取个人信息
// 用户详情
if (this.userInfo.id != undefined) {
this.$http
.post('book/user/info/' + this.userInfo.id)
.then(res => {
this.userMes = res.user
// consol.log(this.userMes.peanutCoin,'呼呼')
if (this.userMes.vip != 0) {
this.typeFen = 2
}
});
}
},
// 获取地址列表
getUserAddress() {
this.$http
@@ -264,7 +302,18 @@
}
})
},
goPoinBuy(){
if(this.realPrice > this.userMes.peanutCoin){
uni.showToast({
title:'疯币不足,请充值',
icon: 'error',
duration: 2000
})
return
}else{
this.goBuyJie()
}
},
// 获取优惠券列表
getCourpe() {
let proId = ''
@@ -470,7 +519,7 @@
city: this.adressMoRen.areaidpathtext.split(' ')[1], //市
district: this.adressMoRen.areaidpathtext.split(' ')[2], //区
address: this.adressMoRen.useraddress, //地址
paymentMethod: this.payType, //支付方式 1支付宝,2微信3ios内购
paymentMethod: this.payType, //支付方式 2支付宝,1微信3ios内购 4疯币购买
orderMoney: this.totalPrice, //订单金额
realMoney: this.realPrice, //实收金额
shippingMoney: this.farePrice, //运费
@@ -482,8 +531,7 @@
products: xiaBiao, //订单列表
orderType: "order", //订单类型
addressId:this.adressMoRen.addressid // 地址ID
}
}
$http.request({
url: "book/buyorder/save",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
@@ -500,6 +548,8 @@
image: '../../static/icon/ic_close.png'
});
} else {
if(this.payType != 4){
// 常规支付
uni.showToast({
title: "正在支付",
icon: "loading"
@@ -534,6 +584,18 @@
}, 1000)
}
})
}else{
// 疯币支付
uni.showToast({
title: "购买成功",
icon: "success"
});
setTimeout(() => {
uni.navigateTo({
url: './orderList'
});
}, 1000)
}
}
@@ -875,4 +937,13 @@
border-color: #fd6004;
}
}
.chongBtn {
background-color: #54a966;
color: #fff !important;
margin-left: 20rpx;
border-radius: 10rpx;
padding: 2rpx 10rpx;
font-size: 20rpx;
display: inline-block;
}
</style>