|
@@ -10,7 +10,8 @@
|
|
|
</view>
|
|
|
<view class="carDet">
|
|
|
<u-form :model="form" ref="uForm">
|
|
|
- <u-form-item label="车牌号码" label-width="150rpx"><u-input input-align="right" v-model="form.carNum" /></u-form-item>
|
|
|
+ <u-keyboard ref="uKeyboard" mode="car" v-model="keyShow" @change="valChange" @backspace="backspace"></u-keyboard>
|
|
|
+ <u-form-item label="车牌号码" label-width="150rpx"><u-input input-align="right" v-model="form.carNum" @click="keyShow=true" /></u-form-item>
|
|
|
<u-form-item label="车辆类型" label-width="150rpx"><u-input input-align="right" placeholder="新能源车" placeholder-style="color:black" disabled /></u-form-item>
|
|
|
<u-form-item label="设为默认车辆" label-width="180rpx"><u-switch slot="right" v-model="form.defaultFlag"></u-switch></u-form-item>
|
|
|
</u-form>
|
|
@@ -25,6 +26,7 @@
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
+ keyShow: false,
|
|
|
show: false,
|
|
|
title: '删除车辆',
|
|
|
content: '是否删除此车牌号?',
|
|
@@ -38,13 +40,35 @@
|
|
|
},
|
|
|
onLoad(op) {
|
|
|
if(op.id){
|
|
|
- this.form.id = op.id;
|
|
|
- this.getCarList();
|
|
|
+ var str1 = res.slice(0,19);
|
|
|
+ var str2 = res.slice(20,21);
|
|
|
+ var str3 = res.slice(22);
|
|
|
+
|
|
|
+ if(str1 == 'jp_team51_charge_id') {
|
|
|
+ if(str2 == 'A') {
|
|
|
+ this.code = str2;
|
|
|
+ this.codeId = str3;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.form.id = op.id;
|
|
|
+ this.getCarList();
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- getCarList() {
|
|
|
-
|
|
|
+ // 按键被点击(点击退格键不会触发此事件)
|
|
|
+ valChange(val) {
|
|
|
+ // 将每次按键的值拼接到form.carNum变量中,注意+=写法
|
|
|
+ this.form.carNum += val;
|
|
|
+ console.log(this.form.carNum);
|
|
|
+ },
|
|
|
+ // 退格键被点击
|
|
|
+ backspace() {
|
|
|
+ // 删除form.carNum的最后一个字符
|
|
|
+ if(this.form.carNum.length) this.form.carNum = this.form.carNum.substr(0, this.form.carNum.length - 1);
|
|
|
+ console.log(this.form.carNum);
|
|
|
+ },
|
|
|
+ getCarList() {
|
|
|
uni.showLoading({
|
|
|
title: "加载中",
|
|
|
mask: true,
|
|
@@ -98,10 +122,16 @@
|
|
|
})
|
|
|
userApi.addRegUserCar(this.form).then((res) => {
|
|
|
uni.hideLoading();
|
|
|
-
|
|
|
- uni.redirectTo({
|
|
|
- url: '/pages/user/car/index'
|
|
|
- })
|
|
|
+
|
|
|
+ if(this.code == 'A') {
|
|
|
+ uni.redirectTo({
|
|
|
+ url: '/pages/searchPile/stationAndPile/chargingPileDetails?id=' + this.codeId
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ uni.redirectTo({
|
|
|
+ url: '/pages/user/car/index'
|
|
|
+ })
|
|
|
+ }
|
|
|
}).catch(error => {
|
|
|
uni.showToast({
|
|
|
title: error,
|