From 59f4dc012a2c42eebd31301444e0f8df9af088e0 Mon Sep 17 00:00:00 2001
From: wjt <1797368093@qq.com>
Date: 星期三, 26 六月 2024 10:13:12 +0800
Subject: [PATCH] Merge branch 'master' of http://218.28.192.34:9999/r/sqys/sqys_xcx

---
 pages/registerCompany/registerCompany.vue |   50 ++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 46 insertions(+), 4 deletions(-)

diff --git a/pages/registerCompany/registerCompany.vue b/pages/registerCompany/registerCompany.vue
index 8efc6a1..1710cf7 100644
--- a/pages/registerCompany/registerCompany.vue
+++ b/pages/registerCompany/registerCompany.vue
@@ -39,7 +39,7 @@
 			</view>
 			<view style="text-align: center;" @click="startUpload">
 				<img src="/static/i07.png" v-if="!form.companyImg" alt="" class="sc" />
-				<image :src="config + form.companyImg" mode="widthFix" class="sc" v-else></image>
+				<image :src="config + form.companyImg" mode="aspectFit" class="sc border" v-else></image>
 			</view>
 			
 		</view>
@@ -83,7 +83,7 @@
 </template>
 
 <script>
-	import { registerCompany, checkCode, getCode } from '@/api/auth.js'
+	import { registerCompany, checkCode, getNewVerify } from '@/api/auth.js'
 	import { upload } from '@/common/upload'
 	import { config } from '@/common/config.js'
 	export default {
@@ -137,11 +137,13 @@
 					uni.showLoading({
 						title: '姝e湪鑾峰彇楠岃瘉鐮�'
 					})
-					getCode({phone: this.form.companyPhone }).then(val => {
+					getNewVerify({phone: this.form.companyPhone }).then(val => {
+						if(val.data.code == 200) {
 							this.startCountdown()
 							uni.hideLoading();
 							this.tips = `${this.countdownTime}s鍚庨噸鏂拌幏鍙朻
 							uni.$u.toast('楠岃瘉鐮佸凡鍙戦��');
+						}
 					})
 				} else {
 					uni.$u.toast('鍊掕鏃剁粨鏉熷悗鍐嶅彂閫�');
@@ -160,12 +162,39 @@
 					success: val => {
 						// console.log(val.tempFilePaths[0])
 						this.uploadImage(val.tempFilePaths[0])
+					},
+					fail: err => {
+						uni.showToast({
+							title: "涓婁紶鍑洪敊",
+							icon: 'none'
+						})
 					}
 				})
 			},
 			// 鏍¢獙瀛楁
 			authField(){
-				
+				if(!this.form.companyUser) {
+					return '璇疯緭鍏ュ鍚�'
+				}
+				if(!this.form.companyPhone) {
+					return '璇疯緭鍏ユ墜鏈哄彿'
+				}
+				if(!this.form.code){
+					return '璇疯緭鍏ラ獙璇佺爜'
+				}
+				if(!this.form.companyName) {
+					return "璇疯緭鍏ヤ紒涓氬悕绉�"
+				}
+				if(!this.form.companyCode){
+					return '璇疯緭鍏ョ粺涓�绀句細淇$敤浠g爜'
+				}
+				if(!this.form.companyAddress){
+					return "璇疯緭鍏ヤ紒涓氬湴鍧�"
+				}
+				if(!this.form.companyImg || !this.form.companyImg.length){
+					return '璇蜂笂浼犺惀涓氭墽鐓�'
+				}
+				return false
 			},
 			// 鏍¢獙code
 			async checkCode() {
@@ -186,9 +215,18 @@
 					throw "鏍¢獙澶辫触"
 				}
 			},
+			
 			// 娉ㄥ唽鎺ュ彛
 			async register(){
 				try{
+					const value = this.authField()
+					if(value){
+						uni.showToast({
+							title: value,
+							icon: 'none'
+						})
+						return
+					}
 					await this.checkCode()
 					// this.form.companyStatus = 1
 					registerCompany(this.form).then(val=>{
@@ -286,5 +324,9 @@
 	height: 346rpx;
 	margin-bottom: 20rpx;
 	border-radius: 20rpx;
+	
+}
+.border{
+	border: 2rpx solid #efefef;
 }
 </style>

--
Gitblit v1.9.1