|
@@ -4,13 +4,13 @@
|
|
|
<view class="key-input">
|
|
|
<u-message-input :focus="true" :value="form.carNum" :maxlength="maxlength" :disabled-keyboard="true"></u-message-input>
|
|
|
</view>
|
|
|
- <ucarkeyboard ref="uKeyboard" mode="car" :showTips="true" :confirmBtn="false" :tooltip="false" v-model="keyShow" @change="valChange" @backspace="backspace"></ucarkeyboard>
|
|
|
+ <ucarkeyboard ref="uKeyboard" mode="car" :showTips="true" :confirmBtn="false" :mask-close-able="false" :tooltip="false" v-model="keyShow" @change="valChange" @backspace="backspace"></ucarkeyboard>
|
|
|
<view class="default">
|
|
|
<u-checkbox-group>
|
|
|
<u-checkbox class="tips" v-model="form.defaultFlag" shape="circle" @change="checkboxChange()">设为默认车辆</u-checkbox>
|
|
|
</u-checkbox-group>
|
|
|
</view>
|
|
|
- <u-button class="login-btn" type="success" shape="circle" @click="sure">保存</u-button>
|
|
|
+ <u-button class="login-btn" type="success" shape="circle" @click="keepCar">保存</u-button>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
@@ -46,6 +46,9 @@
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
+ onReady() {
|
|
|
+ this.$refs.uKeyboard.changeCarInputMode();
|
|
|
+ },
|
|
|
methods: {
|
|
|
checkboxChange() {
|
|
|
this.form.defaultFlag = !this.form.defaultFlag;
|
|
@@ -55,15 +58,24 @@
|
|
|
// 将每次按键的值拼接到form.carNum变量中,注意+=写法
|
|
|
this.form.carNum += val;
|
|
|
console.log(this.form.carNum);
|
|
|
- // this.$refs.uKeyboard.changeCarInputMode()
|
|
|
+
|
|
|
+ if(this.form.carNum.length == 1) {
|
|
|
+ this.$refs.uKeyboard.changeCarInputMode();
|
|
|
+ }
|
|
|
},
|
|
|
// 退格键被点击
|
|
|
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);
|
|
|
+
|
|
|
+ var aaa = this.$refs.uKeyboard.changeCarInputValue();
|
|
|
+ if(this.form.carNum.length == 0 && aaa) {
|
|
|
+ this.$refs.uKeyboard.changeCarInputMode();
|
|
|
+ }
|
|
|
},
|
|
|
keepCar() {
|
|
|
+ console.log(this.form)
|
|
|
uni.showLoading({
|
|
|
title: "加载中",
|
|
|
mask: true,
|
|
@@ -96,6 +108,9 @@
|
|
|
}
|
|
|
</style>
|
|
|
<style lang="scss" scoped>
|
|
|
+ .u-drawer{
|
|
|
+ z-index: -1 !important;
|
|
|
+ }
|
|
|
/deep/.u-char-item {
|
|
|
width: 32px !important;
|
|
|
height: 40px !important;
|