盐都小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

189 lines
4.1 KiB

<template>
<view class="bg">
<view class="step1" v-if="type==1">
<view class="text" v-html="formateRichText(content)"></view>
<view style="width: 1rpx;height: 170rpx;"></view>
</view>
<view class="step2" v-else-if="moneyData">
<view class="container">
<view><text>账单号</text>{{moneyData.bill_id}}</view>
<view><text>停车场名称</text>{{moneyData.park_name}}</view>
<view><text>车牌号</text>{{moneyData.vpl_number}}</view>
<view><text>入站时间</text>{{moneyData.in_time}}</view>
<view style="padding-bottom: 66rpx;"><text>出站时间</text>{{moneyData.out_time}}</view>
<view class="bottom"><view>应付</view><view class="price">{{moneyData.unpaid_charge}}</view></view>
</view>
</view>
<view class="step2" v-else>
<view>未获取到账单信息</view>
</view>
<view class="bottom-cntainer">
<view class="btn" @click="submit()">{{type==1?"同意":"确认支付"}}</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
type: 1, // 1 阅读条款 2 扫码
vpl_number: '',
content:'',
park_code: '',
arm_code: '',
gate_type: '', //in out
moneyData: null
};
},
onLoad(options){
this.vpl_number = decodeURIComponent(options.carNo)
this.park_code = options.park_code
this.arm_code = options.arm_code
this.gate_type = options.gate_type || 'in'
this.getType()
this.getArticle()
},
methods: {
getType () {
// 进站 读协议
if (this.gate_type == 'in') {
this.type = 1
} else {
this.type = 2
this.Post({
park_code: this.park_code,
vpl_number: this.vpl_number,
arm_code: this.arm_code,
},'/api/parking/getParkingBill').then(res => {
this.moneyData = res.data
})
}
},
getArticle () {
this.Post({
id:10309
},'/api/article/getArticleById').then(res => {
this.content = res.data.content
})
},
submit () {
if (this.type == 1 || (this.moneyData && this.moneyData.is_free)) {
this.Post({
park_code: this.park_code,
arm_code: this.arm_code,
agree_status: 1,
vpl_number: this.vpl_number,
}, "/api/parking/raiseCar").then(res=>{
if (res.code == 1) {
uni.showToast({
title: res.msg
})
}
})
} else {
this.Post({
bill_id: this.moneyData.bill_id,
platform: 'miniprogram'
},"/api/parking/createPayment").then(res=>{
uni.requestPayment({
nonceStr: res.data.nonceStr,
package: res.data.package,
paySign: res.data.paySign,
signType: res.data.signType,
timeStamp: res.data.timeStamp,
complete() {
uni.hideLoading()
}
});
})
}
}
}
}
</script>
<style lang="scss" scoped>
.bg{
height: 100vh;
background: linear-gradient(180deg, #E0F4E4, #F7F7F7);
}
.text{
padding: 20rpx;
}
.bottom-cntainer{
width: 100%;
height: 166rpx;
background: #ffffff;
box-shadow: 0rpx -3rpx 9rpx 1rpx rgba(227, 229, 232, 0.5);
display: flex;
position: fixed;
bottom: 0;
padding: 20rpx 20rpx;
align-items: center;
justify-content: center;
}
.btn{
width: 594rpx;
height: 88rpx;
margin: 0 auto;
background: linear-gradient(270deg, #9EE4FE, #7FD491);
border-radius: 43rpx;
text-align: center;
line-height: 88rpx;
font-size: 36rpx;
font-family: PingFang SC;
font-weight: 500;
color: black;
}
.step2{
height: 100vh;
padding: 40rpx 26rpx;
}
.container{
width: 100%;
background: #F7F7F7;
border-radius: 13rpx;
border: 1px solid #6AAC7C;
font-size: 31rpx;
color: #000000;
padding: 78rpx 44rpx 0 44rpx;
&>view{
padding-bottom: 84rpx;
text{
font-weight: bold;
width: 200rpx;
display: inline-block;
}
}
.bottom{
height: 149rpx;
// line-height: 149rpx;
border-top: 1px solid #D8D8D8;
padding-bottom: 62rpx;
display: flex;
font-weight: bold;
font-size: 31rpx;
color: #000000;
align-items: flex-end;
.price{
font-size: 40rpx;
color: #EF2828;
font-weight: normal;
&::before{
content: "¥";
font-size: 30rpx;
}
}
}
}
</style>