浏览代码

设置支付密码修改

gcz 1 年之前
父节点
当前提交
58c682c3f5
共有 1 个文件被更改,包括 29 次插入8 次删除
  1. 29 8
      center/setPaypass.vue

+ 29 - 8
center/setPaypass.vue

@@ -8,7 +8,7 @@
 			 :safeAreaInsetTop="true"
 		>
 		</u-navbar>
-		<view class="step-reset" v-show="step=='reset'&&noPaypass==false">
+		<view class="step-reset"  v-if="step=='reset'&&noPaypass==false">
 			<view class="title">请输入当前密码,以身份认证</view>
 			<u-code-input v-model="paypass0" 
 				ref="paypass0"
@@ -18,12 +18,12 @@
 				:maxlength="codeInput.maxlength" 
 				:adjustPosition="codeInput.adjustPosition"
 				:dot="codeInput.dot"
-				:focus="true"
+				:focus="paypass0Focus"
 				:disabled-keyboard="codeInput.disabledKeyboard" >
 			</u-code-input>
 			<view class="findpaypass" @click="$u.route('/center/findpaypass')">忘记密码?</view>
 		</view>
-		<view class="step-1" v-show="step==1">
+		<view class="step-1"  v-if="step==1">
 			<view class="title">设置6位数数字支付密码</view>
 			<u-code-input v-model="paypass1" 
 				ref="paypass1"
@@ -33,12 +33,12 @@
 				:maxlength="codeInput.maxlength" 
 				:adjustPosition="codeInput.adjustPosition"
 				:dot="codeInput.dot"
-				:focus="true"
+				:focus="paypass1Focus"
 				:disabled-keyboard="codeInput.disabledKeyboard" >
 			</u-code-input>
 			<view class="tip">建议密码不重复,不连续,不同于登录密码</view>
 		</view>
-		<view class="step-2" v-show="step==2">
+		<view class="step-2"  v-if="step==2">
 			<view class="title">请在再次输入</view>
 			<u-code-input v-model="paypass2" 
 				ref="paypass2"
@@ -48,7 +48,7 @@
 				:maxlength="codeInput.maxlength" 
 				:adjustPosition="codeInput.adjustPosition"
 				:dot="codeInput.dot"
-				:focus="true"
+				:focus="paypass2Focus"
 				:disabled-keyboard="codeInput.disabledKeyboard" >
 			</u-code-input>
 		</view>
@@ -65,6 +65,9 @@
 				paypass0:'',
 				paypass1:'',
 				paypass2:'',
+				paypass0Focus:false,
+				paypass1Focus:false,
+				paypass2Focus:false,
 				codeInput:{
 					space:10,
 					size:45,
@@ -82,7 +85,15 @@
 		onLoad(page) {
 			this.fromPage = page.fromPage;
 			this.code = page.code;
-			
+			if(this.fromPage == 'reset'){
+				this.$nextTick(()=>{
+					this.paypass0Focus = true;
+				})
+			}else{
+				this.$nextTick(()=>{
+					this.paypass1Focus = true;
+				})
+			}
 		},
 		methods: {
 			checkPaypass(){
@@ -96,6 +107,9 @@
 						if(this.fromPage=='reset'){
 							this.step = 'reset'
 						}
+						if(this.fromPage=='reset'){
+							this.step = 'reset'
+						}
 					}
 					console.log('this.noPaypass',this.noPaypass);
 				}).catch(err=>{
@@ -106,7 +120,10 @@
 				this.$u.api.checkPayPassword({payPassword:this.paypass0}).then(res=>{
 					console.log('res',res.data);
 					if(res.msg=='操作成功'){//密码正确
-						this.step = 1
+						this.step = 1;
+						this.$nextTick(()=>{
+							this.paypass1Focus = true;
+						})
 					}else{
 						this.paypass0 = ''
 					}
@@ -120,6 +137,10 @@
 			},
 			finish1(){
 				this.step = 2;
+				this.$nextTick(()=>{
+					this.paypass2Focus = true;
+					console.log('this.paypass2Focus',this.paypass2Focus);
+				})
 				console.log('paypass',this.paypass1);
 				console.log('paypass2',this.paypass2);
 			},