From 217808e8c83d7d665aea720b0d59a4085e7012e1 Mon Sep 17 00:00:00 2001 From: 819527061@qq.com <123456> Date: 星期二, 12 三月 2024 15:20:26 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- pages/login/resetPassword/resetPassword.vue | 108 ++++++++++++++++++++++++++++++++++++++++++++--------- 1 files changed, 89 insertions(+), 19 deletions(-) diff --git a/pages/login/resetPassword/resetPassword.vue b/pages/login/resetPassword/resetPassword.vue index a9f0586..b862f88 100644 --- a/pages/login/resetPassword/resetPassword.vue +++ b/pages/login/resetPassword/resetPassword.vue @@ -9,19 +9,31 @@ label="瀵嗙爜" required borderBottom> - <u--input v-model="modelForm.password" + <u-input v-if='inputType==="password"' + v-model="modelForm.password" border="surround" - placeholder="璇疯緭鍏ュ瘑鐮�" - type='password'></u--input> + placeholder="璇疯緭鍏ュ瘑鐮�(浠呮敮鎸佹暟瀛楀瓧姣嶄笅鍒掔嚎)" + :type='inputType' /> + <u-input v-else + v-model="modelForm.password" + border="surround" + placeholder="璇疯緭鍏ュ瘑鐮�(浠呮敮鎸佹暟瀛楀瓧姣嶄笅鍒掔嚎)" + :type='inputType' /> </u-form-item> <u-form-item prop="secondPassword" label="浜屾纭" required borderBottom> - <u--input v-model="modelForm.secondPassword" + <u-input v-if='inputType==="password"' + v-model="modelForm.secondPassword" border="surround" - placeholder="璇峰啀娆¤緭鍏ュ瘑鐮�" - type='password'></u--input> + placeholder="璇峰啀娆¤緭鍏ュ瘑鐮�(浠呮敮鎸佹暟瀛楀瓧姣嶄笅鍒掔嚎)" + type='password' /> + <u-input v-else + v-model="modelForm.secondPassword" + border="surround" + placeholder="璇峰啀娆¤緭鍏ュ瘑鐮�(浠呮敮鎸佹暟瀛楀瓧姣嶄笅鍒掔嚎)" + type='text' /> </u-form-item> <u-form-item> <view class="process-button"> @@ -30,6 +42,18 @@ :loading="processLoading" @click.stop="process"></u-button> </view> + </u-form-item> + <u-form-item prop="checkboxValue"> + <u-checkbox-group v-model="checkboxValue" + @change="checkChange"> + <u-checkbox label="鏄剧ず瀵嗙爜" + name="鏄剧ず" + iconSize="32" + label-size="32" + size="40" + shape="circle"> + </u-checkbox> + </u-checkbox-group> </u-form-item> </u-form> </view> @@ -40,34 +64,80 @@ data() { return { userInfo: {}, + checkboxValue: [], + inputType: 'password', + isFocus: false, modelForm: { password: '', secondPassword: '' }, processLoading: false, rules: { - password: { - type: 'string', - required: true, - message: '璇峰~鍐欏瘑鐮�', - trigger: ['blur', 'change'] - }, - secondPassword: { - type: 'string', - required: true, - message: '璇峰~鍐欎簩娆″瘑鐮�', - trigger: ['blur', 'change'] - } + password: [{ + type: 'string', + required: true, + message: '璇峰~鍐欏瘑鐮�', + trigger: ['blur', 'change'] + }, + { + min: 2, + max: 10, + message: '瀵嗙爜闀垮害搴斾笉灏忎簬2浣�,涓嶅ぇ浜�10浣� ', + trigger: ['blur', 'change'] + }, + { + pattern: /^[a-zA-Z0-9_]+$/, + message: '璇疯緭鍏ユ纭牸寮忕殑瀵嗙爜', + trigger: ['blur', 'change'] + } + ], + secondPassword: [{ + type: 'string', + required: true, + message: '璇峰~鍐欎簩娆″瘑鐮�', + trigger: ['blur', 'change'] + }, + { + min: 2, + max: 10, + message: '瀵嗙爜闀垮害搴斾笉灏忎簬2,涓嶅ぇ浜�10', + trigger: ['blur', 'change'] + } + ] } } }, + computed: { + roleType() { + return uni.getStorageSync('roleType') + } + }, onLoad(params) { - this.userInfo = JSON.parse(params.userInfo) + if (this.roleType === 3) { + this.userInfo = JSON.parse(params.userInfo) + } else { + this.getUserInfo(params.phone, params.idCard) + } + }, onReady() { this.$refs.uForm.setRules(this.rules) }, methods: { + getUserInfo(phone, idCard) { + this.$reqGet('phoneAndCard', { phone, idCard }).then(res => { + if (res.code === 0) { + this.userInfo = res.data + } else { + uni.$u.toast('鍔犺浇澶辫触') + } + }) + + }, + checkChange(name) { + this.inputType = name.length === 0 ? 'password' : '' + this.isFocus = true + }, process() { if (this.modelForm.password !== this.modelForm.secondPassword) return uni.$u.toast('瀵嗙爜涓嶄竴鑷�,璇锋鏌�') this.userInfo.password = this.modelForm.secondPassword; -- Gitblit v1.9.1