Browse Source

抬杆

master
jiazhipeng 4 months ago
parent
commit
e847bccb68
  1. 9
      pages.json
  2. 115
      subPackages/service/carNo.vue
  3. 80
      subPackages/service/gate.vue

9
pages.json

@ -52,7 +52,7 @@
{ {
"path": "service/gate", "path": "service/gate",
"style": { "style": {
"navigationBarTitleText": "" "navigationBarTitleText": "扫码抬杆"
} }
}, },
{ {
@ -317,6 +317,13 @@
"style": { "style": {
"navigationBarTitleText": "活动规则" "navigationBarTitleText": "活动规则"
} }
},
{
"path" : "service/carNo",
"style" :
{
"navigationBarTitleText" : "扫码抬杆"
}
} }
] ]
}], }],

115
subPackages/service/carNo.vue

@ -0,0 +1,115 @@
<template>
<view class="bg">
<view class="title">请输入车牌号码</view>
<view style="font-weight: 500;font-size: 25rpx;color: #333333;padding:20rpx 25rpx 0;">车牌信息仅用于进出停车场我们会严格保护您的信息</view>
<input class="arm-input" v-model="carNo">
<view class="btn" @click="confirmCarNo">确定</view>
</view>
</template>
<script>
export default {
data() {
return {
carNo: '',
park_code: '',
arm_code: '',
gate_type: '',
}
},
onLoad(options){
this.park_code = options.park_code
this.arm_code = options.arm_code
},
onShow() {
if (!this.gate_type) {
this.getCarNo()
}
},
methods: {
getCarNo () {
this.Post({
park_code: this.park_code,
arm_code: this.arm_code
},'/api/parking/getArmPassInfo').then(res => {
if (res && res.data && res.data.gate_type) {
this.carNo = res.data.vpl
this.gate_type = res.data.gate_type
}
})
},
confirmCarNo () {
if (this.carNo && this.carNo.trim()) {
//
if (this.gate_type == 'in') {
this.Post({park_code:this.park_code},'/api/parking/isAgree').then(res => {
if (res.data.is_agree) {
this.Post({
park_code: this.park_code,
arm_code: this.arm_code,
agree_status: 1,
}, "/api/parking/raiseCar").then(res=>{
uni.showToast({
title: res.msg
})
})
} else {
uni.navigateTo({
url: `/subPackages/service/gate?park_code=${this.park_code}&arm_code=${this.arm_code}&carNo=${this.carNo}&gate_type=${this.gate_type}`
})
}
})
} else {
uni.navigateTo({
url: `/subPackages/service/gate?park_code=${this.park_code}&arm_code=${this.arm_code}&carNo=${this.carNo}&gate_type=${this.gate_type}`
})
}
} else {
uni.showToast({
title: '请输入车牌号',
icon: 'none'
})
}
},
}
}
</script>
<style lang="scss">
.bg{
height: 100vh;
background: linear-gradient(180deg, #E0F4E4, #F7F7F7);
}
.title{
padding: 120rpx 25rpx 0;
font-weight: bold;
font-size: 40rpx;
color: #333333;
}
.arm-input{
width: 697rpx;
font-weight: 500;
font-size: 35rpx;
color: #000000;
height: 100rpx;
background: white;
margin: 50rpx auto;
padding: 0 20rpx;
box-sizing: border-box;
}
.btn{
width: 697rpx;
height: 73rpx;
background: linear-gradient(270deg, #9EE4FE, #7FD491);
border-radius: 37rpx;
margin: 0 auto;
line-height: 73rpx;
text-align: center;
font-weight: 500;
font-size: 35rpx;
color: #000000;
}
</style>

80
subPackages/service/gate.vue

@ -1,11 +1,27 @@
<template> <template>
<view class="bg"> <view class="bg">
<view class="step1" v-if="type==1">
<view class="text" v-html="formateRichText(content)"></view> <view class="text" v-html="formateRichText(content)"></view>
<view style="width: 1rpx;height: 170rpx;"></view> <view style="width: 1rpx;height: 170rpx;"></view>
</view>
<view class="step2" v-else-if="moneyData">
<view style="padding-top: 200rpx;">账单号 {{moneyData.bill_id}}</view>
<view>停车场名称{{moneyData.park_name}}</view>
<view>车牌号{{moneyData.vpl_number}}</view>
<view>入站时间{{moneyData.in_time}}</view>
<view>出站时间{{moneyData.out_time}}</view>
<view>应付{{moneyData.unpaid_charge}}</view>
</view>
<view class="step2" v-else>
<view>未获取到账单信息</view>
</view>
<view class="bottom-cntainer"> <view class="bottom-cntainer">
<view class="btn" @click="submit()">同意</view> <view class="btn" @click="submit()">{{type==1?"同意":"确认支付"}}</view>
</view> </view>
</view> </view>
</template> </template>
@ -13,38 +29,82 @@
export default { export default {
data() { data() {
return { return {
type: 1, // 1 2
vpl_number: '',
content:'', content:'',
park_code: '', park_code: '',
arm_code: '', arm_code: '',
gate_type: '', //in out
moneyData: null
}; };
}, },
onLoad(options){ onLoad(options){
this.vpl_number = options.carNo
this.park_code = options.park_code this.park_code = options.park_code
this.arm_code = options.arm_code this.arm_code = options.arm_code
this.gate_type = options.gate_type || 'in'
this.getType()
this.getArticle() this.getArticle()
}, },
methods: { 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 () { getArticle () {
this.Post({ this.Post({
id:10309 id:10309
},'/api/article/getArticleById').then(res => { },'/api/article/getArticleById').then(res => {
uni.setNavigationBarTitle({
title:res.data.title
})
this.content = res.data.content this.content = res.data.content
}) })
}, },
submit () { submit () {
if (this.type == 1 || (this.moneyData && this.moneyData.is_free)) {
this.Post({ this.Post({
park_code: this.park_code, park_code: this.park_code,
arm_code: this.arm_code, arm_code: this.arm_code,
agree_status: 1, agree_status: 1,
vpl_number: this.vpl_number,
}, "/api/parking/raiseCar").then(res=>{ }, "/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> </script>
<style lang="scss"> <style lang="scss">
@ -67,7 +127,7 @@
width: 594rpx; width: 594rpx;
height: 88rpx; height: 88rpx;
margin: 0 auto; margin: 0 auto;
background: #F84A56; background: linear-gradient(270deg, #9EE4FE, #7FD491);
border-radius: 43rpx; border-radius: 43rpx;
text-align: center; text-align: center;
line-height: 88rpx; line-height: 88rpx;
@ -76,4 +136,12 @@
font-weight: 500; font-weight: 500;
color: #FFFFFF; color: #FFFFFF;
} }
.step2{
text-align: center;
font-weight: bold;
font-size: 40rpx;
height: 100vh;
line-height: 2;
}
</style> </style>

Loading…
Cancel
Save