From 9a63b4c5f5dfcfa14a52fb726a0f5604077bba9c Mon Sep 17 00:00:00 2001 From: qingyiay <2386314947@qq.com> Date: 星期二, 28 十一月 2023 11:06:41 +0800 Subject: [PATCH] 修改原发信息提交限制 称重限制 --- pages/login/resetPassword/resetPassword.vue | 86 ++++++++++++++++++++++++++++++++++--------- 1 files changed, 68 insertions(+), 18 deletions(-) diff --git a/pages/login/resetPassword/resetPassword.vue b/pages/login/resetPassword/resetPassword.vue index a9f0586..ffd1ac8 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,24 +64,46 @@ 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'] + } + ] } } }, @@ -68,6 +114,10 @@ this.$refs.uForm.setRules(this.rules) }, methods: { + 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