1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- <template>
- <view>
- <view class="taking-pictures">
-
- </view>
- <view class="wrap">
- <view class="title">手输车牌号</view>
- <view class="new-plate-number">
- <view class="message-input-wrap" @click="messageInputClick">
- <u-message-input :maxlength="8" width="70" font-size="50" :disabled-keyboard="true" v-model="newPlateNumber"></u-message-input>
- </view>
- <u-keyboard ref="uKeyboard" mode="car" @change="keyboardChange" @backspace="backspace" v-model="keyboardshow"></u-keyboard>
- </view>
- <view class="bottom-btn" @click="submit">确认</view>
- </view>
-
- <u-toast ref="uToast" />
- </view>
- </template>
- <script>
- import getUrlParams from "../../utils/getUrlParams.js";
- export default{
- data(){
- return{
- keyboardshow:false,
- newPlateNumber:'',
- spaceId:'',
- }
- },
- onLoad(){
- let locationLocaturl = window.location.hash;
- // console.log('locationLocaturl',locationLocaturl)
- this.spaceId = getUrlParams(locationLocaturl,"spaceId");
-
- },
- methods:{
- messageInputClick(){
- this.keyboardshow = true;
- },
- // 按键被点击(点击退格键不会触发此事件)
- keyboardChange(val) {
- // 将每次按键的值拼接到value变量中,注意+=写法
- this.newPlateNumber += val;
- console.log(this.newPlateNumber);
- },
- // 退格键被点击
- backspace() {
- // 删除value的最后一个字符
- if(this.newPlateNumber.length) this.newPlateNumber = this.newPlateNumber.substr(0, this.newPlateNumber.length - 1);
- console.log(this.newPlateNumber);
- },
- submit(){
- let param ={
- spaceId:this.spaceId,
- vehicleNo:this.newPlateNumber,
-
- };
- this.$u.api.entrance(param)
- .then(res=>{
- this.$refs.uToast.show({
- title: res.msg,
- type: 'success',
- url:'pages/getout/getout'
- });
- console.log('entrance',res)
- }).catch(err=>{
- this.$refs.uToast.show({
- title: err.msg,
- type: 'error',
- url:'pages/parking/parking'
- });
- console.log('entrance ',err)
- });
- }
-
- }
- }
- </script>
- <style lang="scss" scoped>
- @import "./getcarno.scss";
- </style>
|