|
@@ -4,10 +4,6 @@
|
|
|
<view class="sms-item" @tap="showKeyboard=!showKeyboard">
|
|
|
<u-message-input mode="bottomLine" :maxlength="6" v-model="value" :dot-fill="true" :disabled-keyboard="true"></u-message-input>
|
|
|
</view>
|
|
|
- <!-- <view class="btn-con">
|
|
|
- <u-button class="handle-btn" type="info" size="medium" @click="cancel">取消</u-button>
|
|
|
- <u-button class="handle-btn" type="primary" size="medium" @click="submit">确定</u-button>
|
|
|
- </view> -->
|
|
|
<!-- 数字键盘 -->
|
|
|
<u-keyboard ref="uKeyboard" :dot-enabled="false" :mask="false" :tooltip="false" v-model="showKeyboard" @change="valChange" @backspace="backspace"></u-keyboard>
|
|
|
</view>
|
|
@@ -48,13 +44,21 @@
|
|
|
// 监听输入框输入长度
|
|
|
value: {
|
|
|
handler(newVal) {
|
|
|
- console.log(newVal.length,'NNNNNNNNNNNN')
|
|
|
if(newVal.length==6) {
|
|
|
if(this.nowSetp == 1){
|
|
|
this.oPwd = this.value
|
|
|
- this.value = ''
|
|
|
- this.nowSetp++
|
|
|
- this.showKeyboard = true
|
|
|
+ if(this.oldPwd && this.oPwd === this.oldPwd) {
|
|
|
+ uni.showToast({
|
|
|
+ title: '新密码与原密码相同,请重新输入!',
|
|
|
+ icon: 'none'
|
|
|
+ })
|
|
|
+ this.value = ''
|
|
|
+ return false
|
|
|
+ } else {
|
|
|
+ this.value = ''
|
|
|
+ this.nowSetp++
|
|
|
+ this.showKeyboard = true
|
|
|
+ }
|
|
|
}else if(this.nowSetp == 2){
|
|
|
this.tPwd = this.value
|
|
|
this.showKeyboard = false
|
|
@@ -78,22 +82,6 @@
|
|
|
// 删除value的最后一个字符
|
|
|
if(this.value.length) this.value = this.value.substr(0, this.value.length - 1)
|
|
|
},
|
|
|
- // 确定
|
|
|
- submit(){
|
|
|
- if(!this.value || this.value.length < 6){
|
|
|
- uni.showToast({ title: '请输入6位数字支付密码', icon: 'none' })
|
|
|
- }else{
|
|
|
- if(this.nowSetp == 1){
|
|
|
- this.oPwd = this.value
|
|
|
- this.value = ''
|
|
|
- this.nowSetp++
|
|
|
- this.showKeyboard = true
|
|
|
- }else if(this.nowSetp == 2){
|
|
|
- this.tPwd = this.value
|
|
|
- this.checkPwd()
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
// 密码校验
|
|
|
checkPwd(){
|
|
|
if(this.oPwd == this.tPwd){
|