From aef949a659d073443e81f22686b44bd440a69a0e Mon Sep 17 00:00:00 2001
From: qingyiay <2386314947@qq.com>
Date: 星期一, 25 十二月 2023 14:15:46 +0800
Subject: [PATCH] 修改称重连点问题 增加司机注册字段

---
 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