From e52e720168541aa02e0326a505d251f42828aedf Mon Sep 17 00:00:00 2001
From: 819527061@qq.com <123456>
Date: 星期二, 30 七月 2024 11:14:08 +0800
Subject: [PATCH] 添加复磅申请及质检同意功能

---
 pages/register/register.vue | 1063 ++++++++++++++++++++++++++++++++++++++--------------------
 1 files changed, 690 insertions(+), 373 deletions(-)

diff --git a/pages/register/register.vue b/pages/register/register.vue
index 94eb142..80eb369 100644
--- a/pages/register/register.vue
+++ b/pages/register/register.vue
@@ -1,42 +1,159 @@
 <template>
 	<view class="register">
 		<view class="registerForm">
-			<u--form :rules="rules" :model="registerFormModel" ref="regesterFormRef">
-				<u-form-item labelWidth="20%" label="閫夋嫨韬唤" borderBottom ref="roleRef" required>
-					<u-radio-group v-model="radiovalue1" placement="row" @change="groupChange" size="30" shape="circle" iconSize="20">
-						<u-radio
-							labelSize="14px"
+			<u--form :rules="rules"
+				:model="registerFormModel"
+				ref="regesterFormRef"
+				:labelStyle="labelStyle">
+				<u-form-item labelWidth="160"
+					label="閫夋嫨韬唤"
+					borderBottom
+					ref="roleRef"
+					required>
+					<u-radio-group v-model="radiovalue1"
+						placement="row"
+						@change="groupChange"
+						size="30"
+						shape="circle"
+						iconSize="20">
+						<u-radio labelSize="14px"
 							size="20px"
 							:customStyle="{ marginBottom: '8px' }"
 							v-for="(item, index) in radiolist1"
 							:key="index"
 							:label="item.name"
 							:name="item.name"
-							@change="radioChange"
-						></u-radio>
+							@change="radioChange"></u-radio>
 					</u-radio-group>
 				</u-form-item>
-				<u-form-item prop="name" label="濮撳悕" labelWidth="20%" borderBottom required>
-					<u--input v-model="registerFormModel.name" placeholder="璇疯緭鍏ュ唴瀹�" clearable></u--input>
+        <u-form-item
+            v-if="radiovalue1 == '鍙告満'"
+            labelWidth="200"
+                     label="鏄惁鏈夎溅杈�"
+                     borderBottom
+                     required>
+          <u-radio-group v-model="isHaveCar"
+                         placement="row"
+                         size="30"
+                         shape="circle"
+                         iconSize="20">
+            <u-radio labelSize="14px"
+                     size="20px"
+                     :customStyle="{ marginBottom: '8px' }"
+                     v-for="(item, index) in isHaveCarList"
+                     :key="index"
+                     :label="item.label"
+                     :name="item.value"
+                     @change="radioChange"></u-radio>
+          </u-radio-group>
+        </u-form-item>
+				<u-form-item prop="name"
+					 label="濮撳悕"
+           labelWidth="160"
+					 borderBottom
+					 required>
+					<u--input v-model="registerFormModel.name"
+						placeholder="璇疯緭鍏ュ唴瀹�"
+						fontSize='40'
+						clearable></u--input>
 				</u-form-item>
-				<u-form-item prop="idCard" label="韬唤璇�" labelWidth="20%" borderBottom required>
-					<u--input v-model="registerFormModel.idCard" placeholder="璇疯緭鍏ュ唴瀹�" clearable></u--input>
+				<u-form-item prop="idCard"
+					label="韬唤璇�"
+					labelWidth="160"
+					borderBottom
+					required>
+					<u--input v-model="registerFormModel.idCard"
+						placeholder="璇疯緭鍏ュ唴瀹�"
+						fontSize='40'
+						clearable></u--input>
 				</u-form-item>
-				<u-form-item prop="phone" label="鎵嬫満鍙�" labelWidth="20%" borderBottom required>
-					<u--input v-model="registerFormModel.phone" placeholder="璇疯緭鍏ュ唴瀹�" clearable></u--input>
+				<u-form-item prop="phone"
+					label="鎵嬫満鍙�"
+					labelWidth="160"
+					borderBottom
+					required>
+					<u--input v-model="registerFormModel.phone"
+						fontSize='40'
+						placeholder="璇疯緭鍏ュ唴瀹�"
+						clearable></u--input>
 				</u-form-item>
-				<u-form-item prop="password" label="瀵嗙爜" labelWidth="20%" borderBottom required>
-					<u--input v-model="registerFormModel.password" placeholder="璇疯緭鍏ュ唴瀹�" password clearable></u--input>
+				<u-form-item prop="password"
+					label="瀵嗙爜"
+					labelWidth="160"
+					borderBottom
+					required>
+					<u--input v-model="registerFormModel.password"
+						placeholder="璇疯緭鍏ュ唴瀹�"
+						fontSize='40'
+						password
+						clearable></u--input>
 				</u-form-item>
-				<u-form-item prop="confirmPassword" label="纭瀵嗙爜" labelWidth="20%" borderBottom required>
-					<u--input v-model="registerFormModel.confirmPassword" placeholder="璇疯緭鍏ュ唴瀹�" password clearable @blur="jiaoYanPassword"></u--input>
+        <view class="intensity">
+          <view class="psdText">瀵嗙爜寮哄害</view>
+          <view
+              class="line"
+              :class="[level.includes('low') ? 'low' : '']"></view>
+          <view
+              class="line"
+              :class="[level.includes('middle') ? 'middle' : '']"></view>
+          <view
+              class="line"
+              :class="[level.includes('high') ? 'high' : '']"></view>
+          <div class="warningtext">
+            瀵嗙爜搴旂敱8-16浣嶆暟瀛椼�佸瓧姣嶃�佺鍙风粍鎴愩�傝涓嶈浣跨敤瀹规槗琚寽鍒扮殑瀵嗙爜
+          </div>
+        </view>
+				<u-form-item prop="confirmPassword"
+					label="纭瀵嗙爜"
+					labelWidth="160"
+					borderBottom
+					required>
+					<u--input v-model="registerFormModel.confirmPassword"
+						placeholder="璇疯緭鍏ュ唴瀹�"
+						fontSize='40'
+						password
+						clearable
+						@blur="jiaoYanPassword"></u--input>
 				</u-form-item>
-				<u-form-item prop="carNo" label="杞︾墝鍙�" labelWidth="20%" borderBottom v-if="radiovalue1 == '鍙告満'" required>
-					<u--input v-model="registerFormModel.carNo" placeholder="璇疯緭鍏ュ唴瀹�" clearable></u--input>
+				<u-form-item prop="carNo"
+					label="杞︾墝鍙�"
+					labelWidth="160"
+					borderBottom
+					v-if="radiovalue1 == '鍙告満' && isHaveCar == '1'"
+					required>
+					<u--input v-model="registerFormModel.carNo"
+						placeholder="璇疯緭鍏ュ唴瀹�"
+						fontSize='40'
+						clearable></u--input>
 				</u-form-item>
-				<u-form-item prop="carImg" label="杞﹁締鐓х墖" labelWidth="20%" borderBottom v-if="radiovalue1 == '鍙告満'" required @click="beforeRead">
-					<u-upload
-						:fileList="fileList1"
+				<u-form-item labelWidth="160"
+					label="杞︾墝棰滆壊"
+					borderBottom
+					v-if="radiovalue1 == '鍙告満'  && isHaveCar == '1'"
+					required
+					prop="vehicleColour">
+					<u-radio-group v-model="registerFormModel.vehicleColour"
+						placement="row"
+						size="30"
+						shape="circle"
+						iconSize="20">
+						<u-radio labelSize="14px"
+							size="20px"
+							:customStyle="{ marginBottom: '8px' }"
+							v-for="(item, index) in radiolist2"
+							:key="index"
+							:label="item.name"
+							:name="item.value"></u-radio>
+					</u-radio-group>
+				</u-form-item>
+				<u-form-item prop="carImg"
+					label="杞﹁締鐓х墖"
+					labelWidth="160"
+					borderBottom
+					v-if="radiovalue1 == '鍙告満'  && isHaveCar == '1'"
+					required
+					@click="beforeRead">
+					<u-upload :fileList="fileList1"
 						deletable
 						@afterRead="afterRead"
 						@delete="deletePic"
@@ -45,15 +162,40 @@
 						:maxCount="1"
 						width="250"
 						height="150"
-						:previewFullImage="true"
-					>
-						<!-- <image src="https://cdn.uviewui.com/uview/demo/upload/positive.png"
-						mode="widthFix" style="width: 250px;height: 150px;"></image> -->
+						:previewFullImage="true">
 					</u-upload>
 				</u-form-item>
-				<u-form-item prop="drivingImg" label="琛岄┒璇�" labelWidth="20%" borderBottom v-if="radiovalue1 == '鍙告満'" required @click="beforeRead">
-					<u-upload
-						:fileList="fileList2"
+        <div class="column-box">
+          <u-form-item
+              prop="bodyofcarJpg"
+              label="杞﹀ご銆佽溅灏俱�佽溅韬収鐗�"
+              labelWidth="auto"
+              borderBottom
+              v-if="radiovalue1 == '鍙告満'  && isHaveCar == '1'"
+              required
+              @click="beforeRead">
+            <u-upload :fileList="fileList3"
+                      deletable
+                      @afterRead="afterRead"
+                      @delete="deletePic"
+                      name="3"
+                      multiple
+                      :maxCount="3"
+                      width="250"
+                      height="150"
+                      :previewFullImage="true">
+            </u-upload>
+          </u-form-item>
+        </div>
+
+				<u-form-item prop="drivingImg"
+					label="琛岄┒璇�"
+					labelWidth="160"
+					borderBottom
+					v-if="radiovalue1 == '鍙告満'  && isHaveCar == '1'"
+					required
+					@click="beforeRead">
+					<u-upload :fileList="fileList2"
 						deletable
 						@afterRead="afterRead"
 						@delete="deletePic"
@@ -62,21 +204,31 @@
 						:maxCount="1"
 						width="250"
 						height="150"
-						:previewFullImage="true"
-					>
-						<!-- <image src="https://cdn.uviewui.com/uview/demo/upload/positive.png"
-						mode="widthFix" style="width: 250px;height: 150px;"></image> -->
+						:previewFullImage="true">
 					</u-upload>
 				</u-form-item>
-				<u-form-item label="鎺ㄨ崘浜鸿处鍙�" labelWidth="25%" borderBottom>
-					<u--input v-model="registerFormModel.tuiJianMa" placeholder="璇疯緭鍏ュ唴瀹�" clearable></u--input>
+				<u-form-item label="鎺ㄨ崘浜鸿处鍙�"
+					labelWidth="200"
+					borderBottom>
+					<u--input v-model="registerFormModel.tuiJianMa"
+						placeholder="璇疯緭鍏ュ唴瀹�"
+						fontSize='40'
+						clearable></u--input>
 				</u-form-item>
 			</u--form>
 		</view>
 		<view class="roleModel">
-			<u-modal :show="editRoleModelShow" :title="title" :content="content" :showCancelButton="true" @confirm="roleConfirm" @cancel="roleCancel"></u-modal>
+			<u-modal :show="editRoleModelShow"
+				:title="title"
+				:content="content"
+				:showCancelButton="true"
+				@confirm="roleConfirm"
+				@cancel="roleCancel"></u-modal>
 		</view>
-		<view class="registerBtn"><u-button text="娉ㄥ唽" type="primary" @click="registerClick"></u-button></view>
+		<view class="registerBtn"><u-button text="娉ㄥ唽"
+				type="primary"
+				@click="registerClick"
+        :loading="registerClickloading"></u-button></view>
 		<!-- 鍥剧墖棰勮寮瑰嚭妗� -->
 		<!-- <view class="previewImage-container">
 			<u-popup :show="previewImageShow" mode="center" @close="previewImageClose" @open="previewImageOpen">
@@ -87,358 +239,523 @@
 </template>
 
 <script>
-import { apiRegister } from '@/api/publicInterface.js';
-import { BaseUrl } from '@/api/publicInterface.js';
-import { mapMutations } from 'vuex';
-export default {
-	// onLoad: function() {
-	//   // 鏌ョ湅鏄惁鎺堟潈
-	//   wx.getSetting({
-	//     success (res){
-	//       if (res.authSetting['scope.userInfo']) {
-	//         // 宸茬粡鎺堟潈锛屽彲浠ョ洿鎺ヨ皟鐢� getUserInfo 鑾峰彇澶村儚鏄电О
-	//         wx.getUserInfo({
-	//           success: function(res) {
-	//             console.log('res.userInfo',res.userInfo)
-	//           }
-	//         })
-	//       }
-	//     }
-	//   })
-	// },
-	// 鐩戝惉椤甸潰鍒濇娓叉煋瀹屾垚銆傛敞鎰忓鏋滄覆鏌撻�熷害蹇紝浼氬湪椤甸潰杩涘叆鍔ㄧ敾瀹屾垚鍓嶈Е鍙�
-	onReady() {
-		this.$refs.regesterFormRef.setRules(this.rules);
-		// this.$refs.regesterFormRef.validate().then(res => {}).catch(err => {
-		//   console.log(err);
-		// })
-	},
-	onLoad(params) {
-		if (params) {
-			this.registerFormModel.openId = params.code;
-			console.log('椤甸潰鍔犺浇', this.registerFormModel.openId);
-		}
-	},
-	data() {
-		return {
-			// 杞︾墝鍙烽敭鐩樻帶鍒�
-			carNumShow: false,
-			keyValue: '',
-			registerFormModel: {
-				phone: '',
-				password: '',
-				name: '',
-				username: '',
-				openId: '',
-				type: 2,
-				idCard: '',
-				carNo: '',
-				carImg: '',
-				drivingImg: '',
-				tuiJianMa: '',
-				confirmPassword: ''
-			},
-			fileList1: [],
-			fileList2: [],
-			rules: {
-				name: {
-					type: 'string',
-					required: true,
-					message: '璇峰~鍐欏鍚�',
-					trigger: ['blur', 'change']
+	import { apiRegister, BaseUrl } from '@/api/publicInterface.js';
+	import { mapMutations } from 'vuex';
+	export default {
+		// onLoad: function() {
+		//   // 鏌ョ湅鏄惁鎺堟潈
+		//   wx.getSetting({
+		//     success (res){
+		//       if (res.authSetting['scope.userInfo']) {
+		//         // 宸茬粡鎺堟潈锛屽彲浠ョ洿鎺ヨ皟鐢� getUserInfo 鑾峰彇澶村儚鏄电О
+		//         wx.getUserInfo({
+		//           success: function(res) {
+		//             console.log('res.userInfo',res.userInfo)
+		//           }
+		//         })
+		//       }
+		//     }
+		//   })
+		// },
+		// 鐩戝惉椤甸潰鍒濇娓叉煋瀹屾垚銆傛敞鎰忓鏋滄覆鏌撻�熷害蹇紝浼氬湪椤甸潰杩涘叆鍔ㄧ敾瀹屾垚鍓嶈Е鍙�
+		onReady() {
+			this.$refs.regesterFormRef.setRules(this.rules);
+		},
+		onLoad(params) {
+			if (params) {
+				this.registerFormModel.openId = params.code;
+			}
+		},
+		data() {
+      const validatePass = (rule, value, callback) => {
+        if (this.registerFormModel.confirmPassword !== "") {
+          if (value !== this.registerFormModel.password) {
+            callback(new Error("涓ゆ杈撳叆瀵嗙爜涓嶄竴鑷�!"));
+          } else {
+            callback();
+          }
+        } else {
+          callback();
+        }
+      };
+      const checkPassword = (rule, value, callback) => {
+        // let roles = this.$store.getters.roles;//褰撳墠鐢ㄦ埛瑙掕壊id
+        // let passL = 8;
+        // if (roles.concat(1)){
+        //   passL = 10
+        // }
+        let passL = 8;
+        this.level = []
+        if(!value) {
+          return callback('瀵嗙爜涓嶈兘涓虹┖')
+        }
+        if(value.length < passL) {
+          return callback(`瀵嗙爜涓嶈兘灏戜簬${passL}浣峘)
+        }
+        if(value.length > 16) {
+          return callback('瀵嗙爜涓嶈兘澶т簬16浣�')
+        }
+        //鏍¢獙鏄暟瀛�
+        const regex1 = /^\d+$/
+        // 鏍¢獙瀛楁瘝
+        const regex2 = /^[A-Za-z]+$/
+        // 鏍¢獙绗﹀彿
+        const regex3 =
+            /^[`~!@#$%^&*()_\-+=<>?:"{}|,.\/;'\\[\]路~锛丂#锟�%鈥︹��&*锛堬級鈥斺�擻-+={}|銆娿�嬶紵锛氣�溾�濄�愩�戙�侊紱鈥�'锛屻�傘�乚+$/
+        if(regex1.test(value)) {
+          this.level.push('low')
+          return callback('瀵嗙爜寮哄害杩囦綆锛岃鎸変笅鏂瑰瘑鐮佽鍒欒緭鍏�')
+        }else if(regex2.test(value)) {
+          this.level.push('low')
+          return callback('瀵嗙爜寮哄害杩囦綆锛岃鎸変笅鏂瑰瘑鐮佽鍒欒緭鍏�')
+        }else if(regex3.test(value)) {
+          this.level.push('low')
+          return callback('瀵嗙爜寮哄害杩囦綆锛岃鎸変笅鏂瑰瘑鐮佽鍒欒緭鍏�')
+        }else if(/^[A-Za-z\d]+$/.test(value)) {
+          this.level.push('low')
+          this.level.push('middle')
+          return callback('瀵嗙爜寮哄害杩囦綆锛岃鎸変笅鏂瑰瘑鐮佽鍒欒緭鍏�')
+        }else if(
+            /^[`~!@#$%^&*()_\-+=<>?:"{}|,.\/;'\\[\]路~锛丂#锟�%鈥︹��&*锛堬級鈥斺�擻-+={}|銆娿�嬶紵锛氣�溾�濄�愩�戙�侊紱鈥�'锛屻�傘�乗d]+$/.test(
+                value
+            )
+        ) {
+          this.level.push('low')
+          this.level.push('middle')
+          return callback('瀵嗙爜寮哄害杩囦綆锛岃鎸変笅鏂瑰瘑鐮佽鍒欒緭鍏�')
+        }else if(
+            /^[`~!@#$%^&*()_\-+=<>?:"{}|,.\/;'\\[\]路~锛丂#锟�%鈥︹��&*锛堬級鈥斺�擻-+={}|銆娿�嬶紵锛氣�溾�濄�愩�戙�侊紱鈥�'锛屻�傘�丄-Za-z]+$/.test(
+                value
+            )
+        ) {
+          this.level.push('low')
+          this.level.push('middle')
+          return callback('瀵嗙爜寮哄害杩囦綆锛岃鎸変笅鏂瑰瘑鐮佽鍒欒緭鍏�')
+        } else if (
+            /^[`~!@#$%^&*()_\-+=<>?:"{}|,.\/;'\\[\]路~锛丂#锟�%鈥︹��&*锛堬級鈥斺�擻-+={}|銆娿�嬶紵锛氣�溾�濄�愩�戙�侊紱鈥�'锛屻�傘�丄-Za-z\d]+$/.test(
+                value
+            )
+        ) {
+          this.level.push('low')
+          this.level.push('middle')
+          this.level.push('high')
+        }
+        return callback()
+      };
+			return {
+        isHaveCar:'1', //鏄惁鏈夎溅杈�
+        level:[],  //瀵嗙爜寮哄害鏁扮粍
+				labelStyle: {
+					fontSize: '36rpx'
 				},
-				idCard: [
-					{
+				// 杞︾墝鍙烽敭鐩樻帶鍒�
+				carNumShow: false,
+				keyValue: '',
+				registerFormModel: {
+					phone: '',
+					password: '',
+					name: '',
+					username: '',
+					openId: '',
+					type: 2,
+					idCard: '',
+					carNo: '',
+					carImg: '',
+					drivingImg: '',
+					tuiJianMa: '',
+					confirmPassword: '',
+					vehicleColour: '',
+					bodyofcarJpg: ''
+				},
+				fileList1: [],
+				fileList2: [],
+				fileList3: [],
+				carBody: [],
+				rules: {
+					name: {
 						type: 'string',
 						required: true,
-						message: '璇疯緭鍏ヨ韩浠借瘉鍙�',
+						message: '璇峰~鍐欏鍚�',
 						trigger: ['blur', 'change']
 					},
-					{
-						pattern: /^([1-6][1-9]|50)\d{4}(18|19|20)\d{2}((0[1-9])|10|11|12)(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/,
-						message: '韬唤璇佸彿鏍煎紡涓嶆纭�'
-					}
-				],
-				phone: [
-					{
-						required: true,
-						message: '姝や负蹇呭~瀛楁',
-						// blur鍜宑hange浜嬩欢瑙﹀彂妫�楠�
-						trigger: ['blur', 'change']
-					},
-					{
-						min: 11,
-						max: 11,
-						message: '璇疯緭鍏ュ悎娉曟墜鏈哄彿'
-					},
-					{
-						validator: (rule, value, callback) => {
-							return uni.$u.test.mobile(value);
+					idCard: [{
+							type: 'string',
+							required: true,
+							message: '璇疯緭鍏ヨ韩浠借瘉鍙�',
+							trigger: ['blur', 'change']
 						},
-						message: '鎵嬫満鍙风爜涓嶆纭�',
-						trigger: ['change', 'blur']
-					}
-				],
-				password: [
-					{
-						required: true,
-						message: '璇疯缃垵濮嬪瘑鐮�',
-						trigger: ['blur', 'change']
-					},
-					{
-						min: 6,
-						max: 12,
-						message: '闀垮害鍦�6-12涓瓧绗︿箣闂�'
-					}
-				],
-				confirmPassword: [
-					{
-						required: true,
-						message: '璇疯缃垵濮嬪瘑鐮�',
-						trigger: ['blur', 'change']
-					},
-					{
-						min: 6,
-						max: 12,
-						message: '闀垮害鍦�6-12涓瓧绗︿箣闂�'
-					}
-				],
-				carNo: [
-					{
-						type: 'string',
-						required: true,
-						message: '璇疯緭鍏ヨ溅鐗屽彿',
-						trigger: ['blur', 'change']
-					},
-					{
-						transform(value) {
-							return String(value);
-						},
-						validator: (rule, value, callback) => {
-							return uni.$u.test.carNo(value);
-						},
-						message: '璇疯緭鍏ユ纭殑杞︾墝鍙�',
-						trigger: ['change', 'blur']
-					}
-				],
-				carImg: {
-					type: 'string',
-					required: true,
-					message: '璇蜂笂浼犺溅杈嗗浘鐗�',
-					trigger: ['blur', 'change']
-				},
-				drivingImg: {
-					type: 'string',
-					required: true,
-					message: '璇蜂笂浼犺椹惰瘉鐓х墖',
-					trigger: ['blur', 'change']
-				}
-			},
-			// 鍩烘湰妗堝垪鏁版嵁
-			radiolist1: [
-				{
-					name: '璐т唬',
-					disabled: false
-				},
-				{
-					name: '鍙告満',
-					disabled: false
-				}
-			],
-			// u-radio-group鐨剉-model缁戝畾鐨勫�煎鏋滆缃负鏌愪釜radio鐨刵ame锛屽氨浼氳榛樿閫変腑
-			radiovalue1: '璐т唬',
-			beforeChangeValue: '',
-			// 鏇存崲瑙掕壊寮规
-			editRoleModelShow: false,
-			title: '鎻愮ず',
-			content: '褰撳墠濉叆淇℃伅锛屽垏鎹㈣鑹插悗锛屽嵆娓呴櫎锛屾槸鍚﹀垏鎹紵',
-			wxcode: '',
-			openid: ''
-		};
-	},
-	watch: {
-		radiovalue1(newV) {
-			if (this.registerFormModel.name || this.registerFormModel.idCard || this.registerFormModel.phone || this.registerFormModel.carNo || this.registerFormModel.password) {
-				if (this.editRoleModelShow == true) {
-					this.editRoleModelShow = false;
-				} else {
-					this.editRoleModelShow = true;
-				}
-			}
-			switch (newV) {
-				case '璐т唬':
-					this.registerFormModel.type = 2;
-					break;
-				case '鍙告満':
-					this.registerFormModel.type = 3;
-					break;
-				default:
-					break;
-			}
-			return;
-		}
-	},
-	methods: {
-		...mapMutations(['changeisUploadimg']),
-		registerClick() {
-			if (this.registerFormModel.password == this.registerFormModel.confirmPassword) {
-				this.$refs.regesterFormRef
-					.validate()
-					.then(res => {
-						console.log(this.registerFormModel);
-						this.registerFormModel.username = this.registerFormModel.phone;
-						apiRegister(this.registerFormModel)
-							.then(res => {
-								if (res.data.code == 0) {
-									uni.showToast({
-										title: '娉ㄥ唽鎴愬姛,鍗冲皢杩斿洖鐧诲綍椤�',
-										icon: 'none',
-										duration: 1000
-									});
-									setTimeout(() => {
-										uni.redirectTo({ url: '/pages/login/login' });
-									}, 1000);
-								} else {
-									this.$u.toast(res.msg ? res.msg : '娣诲姞澶辫触');
-								}
-							})
-							.catch(err => {
-								console.log('閿欒', err);
-							});
-					})
-					.catch(err => {
-						console.log('err', err);
-						uni.$u.toast('璇疯鑼冭緭鍏ュ唴瀹�');
-					});
-			} else {
-				this.$u.toast('涓ゆ瀵嗙爜涓嶄竴鑷�');
-			}
-		},
-		// 鍗曢�夋浜嬩欢
-		groupChange(e) {},
-		radioChange(e) {
-			if (
-				this.registerFormModel.name == '' &&
-				this.registerFormModel.idCard == '' &&
-				this.registerFormModel.phone == '' &&
-				this.registerFormModel.carNo == '' &&
-				this.registerFormModel.password == ''
-			) {
-				this.$refs.regesterFormRef.clearValidate();
-				this.beforeChangeValue = e;
-			}
-		},
-		jiaoYanPassword() {
-			if (this.registerFormModel.password != this.registerFormModel.confirmPassword) {
-				this.$u.toast('涓ゆ瀵嗙爜涓嶄竴鑷�');
-			}
-		},
-		// 涓婁紶鍥剧墖鏂规硶
-		beforeRead() {
-			this.changeisUploadimg(true);
-		},
-		// 鍒犻櫎鍥剧墖
-		deletePic(event) {
-			this.changeisUploadimg(true);
-			this[`fileList${event.name}`].splice(event.index, 1);
-		},
-		// 鏂板鍥剧墖
-		async afterRead(event) {
-			// 褰撹缃� mutiple 涓� true 鏃�, file 涓烘暟缁勬牸寮忥紝鍚﹀垯涓哄璞℃牸寮�
-			let lists = [].concat(event.file);
-			let fileListLen = this[`fileList${event.name}`].length;
-			lists.map(item => {
-				this[`fileList${event.name}`].push({
-					...item,
-					status: 'uploading',
-					message: '涓婁紶涓�'
-				});
-			});
-			for (let i = 0; i < lists.length; i++) {
-				const result = await this.uploadFilePromise(lists[i].url, event.name);
-				let item = this[`fileList${event.name}`][fileListLen];
-				this[`fileList${event.name}`].splice(
-					fileListLen,
-					1,
-					Object.assign(item, {
-						status: 'success',
-						message: '涓婁紶鎴愬姛',
-						url: result
-					})
-				);
-				fileListLen++;
-			}
-		},
-		uploadFilePromise(url, num) {
-			return new Promise((resolve, reject) => {
-				let a = uni.uploadFile({
-					url: BaseUrl + '/admin/sys-file/uploadUnToken',
-					filePath: url,
-					name: 'file',
-					formData: {
-						// user: ''
-					},
-					success: res => {
-						if (num == 1) {
-							this.registerFormModel.carImg = JSON.parse(res.data).data.url;
-							resolve(`${BaseUrl}${JSON.parse(res.data).data.url}`);
-						} else if (num == 2) {
-							this.registerFormModel.drivingImg = JSON.parse(res.data).data.url;
-							resolve(`${BaseUrl}${JSON.parse(res.data).data.url}`);
+						{
+							pattern: /^([1-6][1-9]|50)\d{4}(18|19|20)\d{2}((0[1-9])|10|11|12)(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/,
+							message: '韬唤璇佸彿鏍煎紡涓嶆纭�'
 						}
+					],
+					phone: [{
+							required: true,
+							message: '姝ら」涓哄繀濉」',
+							// blur鍜宑hange浜嬩欢瑙﹀彂妫�楠�
+							trigger: ['blur', 'change']
+						},
+						{
+							min: 11,
+							max: 11,
+							message: '璇疯緭鍏ュ悎娉曟墜鏈哄彿'
+						},
+						{
+							validator: (rule, value, callback) => {
+								return uni.$u.test.mobile(value);
+							},
+							message: '鎵嬫満鍙风爜涓嶆纭�',
+							trigger: ['change', 'blur']
+						}
+					],
+					password: [{
+							required: true,
+							message: '璇疯缃瘑鐮�',
+							trigger: ['blur', 'change']
+						},
+            {
+              validator: checkPassword,
+              trigger: 'change'
+            }
+					],
+					confirmPassword: [{
+							required: true,
+              validator: validatePass,
+							trigger: ['blur', 'change']
+						}
+					],
+					carNo: [{
+							type: 'string',
+							required: true,
+							message: '璇疯緭鍏ヨ溅鐗屽彿',
+							trigger: ['blur', 'change']
+						},
+						{
+							transform(value) {
+								return String(value);
+							},
+							validator: (rule, value, callback) => {
+								return uni.$u.test.carNo(value);
+							},
+							message: '璇疯緭鍏ユ纭殑杞︾墝鍙�',
+							trigger: ['change', 'blur']
+						}
+					],
+					vehicleColour: {
+						type: 'string',
+						required: true,
+						message: '璇烽�夋嫨杞︾墝棰滆壊',
+						trigger: ['blur', 'change']
+					},
+					carImg: {
+						type: 'string',
+						required: true,
+						message: '璇蜂笂浼犺溅杈嗗浘鐗�',
+						trigger: ['blur', 'change']
+					},
+					bodyofcarJpg: {
+						type: 'string',
+						required: true,
+						message: '璇蜂笂浼犺溅杈嗗浘鐗�',
+						trigger: ['blur', 'change']
+					},
+					drivingImg: {
+						type: 'string',
+						required: true,
+						message: '璇蜂笂浼犺椹惰瘉鐓х墖',
+						trigger: ['blur', 'change']
+					}
+				},
+				radiolist1: [{
+						name: '璐т唬',
+						disabled: false
+					},
+					{
+						name: '鍙告満',
+						disabled: false
+					}
+				],
+        isHaveCarList: [{
+          value: '1',
+          label: '鏄�',
+        },{
+          value: '2',
+          label: '鍚�'
+        }],
+				radiovalue1: '璐т唬',
+				radiolist2: [{
+						name: '榛勮壊',
+						value: '榛勮壊'
+					},
+					{
+						name: '榛勭豢鑹�',
+						value: '榛勭豢鑹�'
+					},
+					{
+						name: '钃濊壊',
+						value: '钃濊壊'
+					}
+				],
+				beforeChangeValue: '',
+				// 鏇存崲瑙掕壊寮规
+				editRoleModelShow: false,
+				title: '鎻愮ず',
+				content: '褰撳墠濉叆淇℃伅锛屽垏鎹㈣鑹插悗锛屽嵆娓呴櫎锛屾槸鍚﹀垏鎹紵',
+				wxcode: '',
+				openid: '',
+        registerClickloading: false,
+			};
+		},
+		watch: {
+			radiovalue1(newV) {
+				if (this.registerFormModel.name || this.registerFormModel.idCard || this.registerFormModel.phone || this
+					.registerFormModel.carNo || this.registerFormModel.password) {
+					if (this.editRoleModelShow == true) {
+						this.editRoleModelShow = false;
+					} else {
+						this.editRoleModelShow = true;
+					}
+				}
+				switch (newV) {
+					case '璐т唬':
+						this.registerFormModel.type = 2;
+						break;
+					case '鍙告満':
+						this.registerFormModel.type = 3;
+						break;
+					default:
+						break;
+				}
+				return;
+			}
+		},
+		methods: {
+			...mapMutations(['changeisUploadimg']),
+			registerClick() {
+        if(this.fileList3 && this.fileList3.length > 0) {  //杞﹀ご杞﹀熬杞﹁韩闇�瑕�3寮犲浘鐗囦篃鍙互涓�寮犱篃涓嶄紶
+          if(this.fileList3.length !== 3) {
+            this.$u.toast('杞﹀ご杞﹀熬杞﹁韩闇�瑕�3寮犲浘鐗�');
+            return
+          }
+        }
+        this.$refs.regesterFormRef
+            .validate()
+            .then(res => {
+              console.log(this.registerFormModel);
+              this.registerClickloading = true;
+              this.registerFormModel.username = this.registerFormModel.phone;
+              apiRegister(this.registerFormModel)
+                  .then(res => {
+                    if (res.data.code == 0) {
+                      this.registerClickloading = false;
+                      uni.showToast({
+                        title: '娉ㄥ唽鎴愬姛,鍗冲皢杩斿洖鐧诲綍椤�',
+                        icon: 'none',
+                        duration: 1000
+                      });
+                      setTimeout(() => {
+                        uni.redirectTo({ url: '/pages/login/login' });
+                      }, 1000);
+                    } else {
+                      this.$u.toast(res.data.msg ? res.data.msg : '娣诲姞澶辫触');
+                    }
+                  })
+                  .catch(err => {
+                    console.log('閿欒', err);
+                  });
+            })
+            .catch(err => {
+              console.log('err', err);
+              this.$u.toast('璇疯鑼冭緭鍏ュ唴瀹�');
+            }).finally(() => {
+              this.registerClickloading = false;
+        });
+			},
+			// 鍗曢�夋浜嬩欢
+			groupChange(e) {},
+			radioChange(e) {
+				if (
+					this.registerFormModel.name == '' &&
+					this.registerFormModel.idCard == '' &&
+					this.registerFormModel.phone == '' &&
+					this.registerFormModel.carNo == '' &&
+					this.registerFormModel.password == ''
+				) {
+					this.$refs.regesterFormRef.clearValidate();
+					this.beforeChangeValue = e;
+				}
+			},
+			jiaoYanPassword() {
+				if (this.registerFormModel.password != this.registerFormModel.confirmPassword) {
+					this.$u.toast('涓ゆ瀵嗙爜涓嶄竴鑷�');
+				}
+			},
+			// 涓婁紶鍥剧墖鏂规硶
+			beforeRead() {
+				this.changeisUploadimg(true);
+			},
+			// 鍒犻櫎鍥剧墖
+			deletePic(event) {
+				this.changeisUploadimg(true);
+				this[`fileList${event.name}`].splice(event.index, 1);
+			},
+			// 鏂板鍥剧墖
+			async afterRead(event) {
+				// 褰撹缃� mutiple 涓� true 鏃�, file 涓烘暟缁勬牸寮忥紝鍚﹀垯涓哄璞℃牸寮�
+				let lists = [].concat(event.file);
+				let fileListLen = this[`fileList${event.name}`].length;
+				lists.map(item => {
+					this[`fileList${event.name}`].push({
+						...item,
+						status: 'uploading',
+						message: '涓婁紶涓�'
+					});
+				});
+				for (let i = 0; i < lists.length; i++) {
+					const result = await this.uploadFilePromise(lists[i].url, event.name);
+					let item = this[`fileList${event.name}`][fileListLen];
+					this[`fileList${event.name}`].splice(
+						fileListLen,
+						1,
+						Object.assign(item, {
+							status: 'success',
+							message: '涓婁紶鎴愬姛',
+							url: result
+						})
+					);
+					fileListLen++;
+				}
+			},
+			uploadFilePromise(url, num) {
+				return new Promise((resolve, reject) => {
+					let a = uni.uploadFile({
+						url: BaseUrl + '/admin/sys-file/uploadUnToken',
+						filePath: url,
+						name: 'file',
+						formData: {
+							// user: ''
+						},
+						success: res => {
+							if (num == 1) {
+								this.registerFormModel.carImg = JSON.parse(res.data).data.url;
+								resolve(`${BaseUrl}${JSON.parse(res.data).data.url}`);
+							} else if (num == 2) {
+								this.registerFormModel.drivingImg = JSON.parse(res.data).data.url;
+								resolve(`${BaseUrl}${JSON.parse(res.data).data.url}`);
+							} else if (num == 3) {
+								let imageUrl = JSON.parse(res.data).data.url
+								this.carBody.push(imageUrl)
+								this.registerFormModel.bodyofcarJpg = this.carBody.join(',')
+								resolve(`${BaseUrl}${JSON.parse(res.data).data.url}`);
+							}
+						}
+					});
+				});
+			},
+			// 鏇存崲瑙掕壊寮瑰嚭妗�
+			roleConfirm() {
+				console.log('閬嶅巻瀵硅薄', Object.keys(this.registerFormModel));
+				Object.keys(this.registerFormModel).forEach(item => {
+					if (item !== 'type') {
+						if (this.registerFormModel[item]) this.registerFormModel[item] = '';
 					}
 				});
-			});
-		},
-		// 鏇存崲瑙掕壊寮瑰嚭妗�
-		roleConfirm() {
-			console.log('閬嶅巻瀵硅薄', Object.keys(this.registerFormModel));
-			Object.keys(this.registerFormModel).forEach(item => {
-				if (item !== 'type') {
-					if (this.registerFormModel[item]) this.registerFormModel[item] = '';
-				}
-			});
-			/**
-			 * @resetFields 涓嶇鐢ㄦ椂鍊欑敤涓婅竟鐨勪唬鏇�
-			 */
-			this.$refs.regesterFormRef.resetFields();
-			this.editRoleModelShow = false;
-		},
-		roleCancel() {
-			this.radiovalue1 = this.beforeChangeValue;
-			this.$nextTick(() => {
+				/**
+				 * @resetFields 涓嶇鐢ㄦ椂鍊欑敤涓婅竟鐨勪唬鏇�
+				 */
+				this.$refs.regesterFormRef.resetFields();
 				this.editRoleModelShow = false;
-			});
+			},
+			roleCancel() {
+				this.radiovalue1 = this.beforeChangeValue;
+				this.$nextTick(() => {
+					this.editRoleModelShow = false;
+				});
+			}
 		}
-	}
-};
+	};
 </script>
 
-<style lang="scss" scoped>
-::v-deep.register {
-	width: 94%;
-	padding: 0 0 vww(20) 0;
-	margin: 0 auto;
-	.registerForm {
+<style lang="scss"
+	scoped>
+	::v-deep.register {
 		width: 94%;
+		padding: 0 0 vww(20) 0;
 		margin: 0 auto;
-		font-size: 16px !important;
-		.u-form {
-			.u-radio {
-				width: 33%;
+
+		.registerForm {
+			width: 94%;
+			margin: 0 auto;
+			font-size: 16px !important;
+
+			.u-form {
+				.u-radio {
+					width: 33%;
+				}
+			}
+		}
+
+		.registerBtn {
+			width: 94%;
+			margin: vww(50) auto 0;
+		}
+
+		.utils {
+			line-height: vww(30);
+			text-align: center;
+
+			text:nth-of-type(1) {
+				margin-right: vww(10);
 			}
 		}
 	}
-	.registerBtn {
-		width: 94%;
-		margin: vww(50) auto 0;
-	}
-	.utils {
-		line-height: vww(30);
-		text-align: center;
-		text:nth-of-type(1) {
-			margin-right: vww(10);
-		}
-	}
-}
+  .intensity {
+    width: 100%;
+    margin-top: 10rpx;
+    .psdText {
+      font-size: 14px;
+      margin-right: 10px;
+    }
+
+    .line {
+      display: inline-block;
+      width: 70rpx;
+      height: 8rpx;
+      background: #d8d8d8;
+      border-radius: 6rpx;
+      margin-right: 16rpx;
+
+      &.low {
+        background: #f4664a;
+      }
+
+      &.middle {
+        background: #ffb700;
+      }
+
+      &.high {
+        background: #2cbb79;
+      }
+    }
+
+    .level {
+      margin: 0 32rpx 0 16rpx;
+    }
+
+    .warningtext {
+      color: #5a5a5a;
+      font-size: 24rpx;
+      margin-top: 10rpx;
+    }
+  }
+  .column-box{
+    ::v-deep{
+      .u-form-item__body{
+        flex-direction: column!important;
+      }
+      .u-form-item__body__right{
+        margin-top: 20rpx;
+      }
+    }
+  }
 </style>

--
Gitblit v1.9.1