| | |
| | | </view> |
| | | <u-modal :show="showModal" title="修改密码" :showConfirmButton="false" :closeOnClickOverlay="true" ref="uModal" :asyncClose="true" @close="closeModal()"> |
| | | <view> |
| | | <u--form labelPosition="top" labelWidth="120" :model="pwdForm" :rules="rules" ref="uForm"> |
| | | <u-form labelPosition="top" labelWidth="120" :model="pwdForm" :rules="rules" ref="uForm"> |
| | | <u-form-item |
| | | prop="password" |
| | | ref="password" |
| | | label="新密码" |
| | | > |
| | | <u--input |
| | | v-model="pwdForm.password" |
| | | placeholder="请输入新密码" |
| | | :type="codeType1" |
| | | > |
| | | <u-input v-show="isPwd1" v-model="pwdForm.password" placeholder="请输入新密码" :password="true"> |
| | | <template slot="suffix"> |
| | | <u-icon v-show="codeType1 == 'password'" name="eye" color="#999" size="20" @click="viewCode(1)"></u-icon> |
| | | <u-icon v-show="codeType1 == 'text'" name="eye-off" color="#999" size="20" @click="viewCode(1)"></u-icon> |
| | | <u-icon name="eye" color="#999" size="20" @click="isPwd1 = false"></u-icon> |
| | | </template> |
| | | </u--input> |
| | | </u-input> |
| | | <u-input v-show="!isPwd1" v-model="pwdForm.password" placeholder="请输入新密码" :password="false"> |
| | | <template slot="suffix"> |
| | | <u-icon name="eye-off" color="#999" size="20" @click="isPwd1 = true"></u-icon> |
| | | </template> |
| | | </u-input> |
| | | </u-form-item> |
| | | <u-form-item |
| | | prop="rePassword" |
| | | ref="rePassword" |
| | | label="确认密码" |
| | | > |
| | | <u--input |
| | | v-model="pwdForm.rePassword" |
| | | placeholder="请确认密码" |
| | | :type="codeType2" |
| | | ><template slot="suffix"> |
| | | <u-icon v-show="codeType2 == 'password'" name="eye" color="#999" size="20" @click="viewCode(2)"></u-icon> |
| | | <u-icon v-show="codeType2 == 'text'" name="eye-off" color="#999" size="20" @click="viewCode(2)"></u-icon> |
| | | </template></u--input> |
| | | <u-input v-show="isPwd2" v-model="pwdForm.rePassword" placeholder="请输入新密码" :password="true"> |
| | | <template slot="suffix"> |
| | | <u-icon name="eye" color="#999" size="20" @click="isPwd2 = false"></u-icon> |
| | | </template> |
| | | </u-input> |
| | | <u-input v-show="!isPwd2" v-model="pwdForm.rePassword" placeholder="请输入新密码" :password="false"> |
| | | <template slot="suffix"> |
| | | <u-icon name="eye-off" color="#999" size="20" @click="isPwd2 = true"></u-icon> |
| | | </template> |
| | | </u-input> |
| | | </u-form-item> |
| | | </u--form> |
| | | </u-form> |
| | | <u-button type="primary" style="margin-top: 20px" text="确认" @click="confirmPwd()"></u-button> |
| | | </view> |
| | | </u-modal> |
| | |
| | | } |
| | | ] |
| | | }, |
| | | codeType1: 'password', |
| | | codeType2: 'password' |
| | | isPwd1: true, |
| | | isPwd2: true |
| | | } |
| | | |
| | | }, |
| | |
| | | t.showModal = true |
| | | }, |
| | | |
| | | viewCode(type){ |
| | | const t = this |
| | | if(type == 1){ |
| | | if(this.codeType1 == 'password'){ |
| | | this.codeType1 = 'text' |
| | | } else{ |
| | | this.codeType1 = 'password' |
| | | } |
| | | }else{ |
| | | if(this.codeType2 == 'password'){ |
| | | this.codeType2 = 'text' |
| | | } else{ |
| | | this.codeType2 = 'password' |
| | | } |
| | | } |
| | | }, |
| | | |
| | | confirmPwd(){ |
| | | const t = this |
| | | t.$refs.uForm.validate().then(res => { |
| | |
| | | password: '', |
| | | rePassword: '' |
| | | } |
| | | this.isPwd1 = true |
| | | this.isPwd2 = true |
| | | } |
| | | } |
| | | } |