gjy 3 years ago
parent
commit
e17a9573df
3 changed files with 111 additions and 63 deletions
  1. 64 57
      pages/mine/driverCertificationNext.vue
  2. 12 5
      pages/mine/index.vue
  3. 35 1
      pages/mine/settings/editAvatar.vue

+ 64 - 57
pages/mine/driverCertificationNext.vue

@@ -441,41 +441,45 @@
 					})
 					return true
 				}
-				if (uni.$u.test.isEmpty(this.dataDetails.trailerLicenseHomePage)) {
-					this.$refs.uToast.show({
-						type: 'error',
-						message: "挂车行驶证主页不能为空!",
-					})
-					return true
-				}
-				if (uni.$u.test.isEmpty(this.dataDetails.trailerLicenseBackPage)) {
-					this.$refs.uToast.show({
-						type: 'error',
-						message: "挂车行驶证副页不能为空!",
-					})
-					return true
-				}
-				if (uni.$u.test.isEmpty(this.dataDetails.trailerLicenseBackPage)) {
-					this.$refs.uToast.show({
-						type: 'error',
-						message: "行驶证副页不能为空!",
-					})
-					return true
-				}
-				if (uni.$u.test.isEmpty(this.dataDetails.trailerLicenseNumber)) {
-					this.$refs.uToast.show({
-						type: 'error',
-						message: "挂车行驶证档案编号不能为空!",
-					})
-					return true
-				}
-				if (uni.$u.test.isEmpty(this.dataDetails.trailerLicenseValidityDate)) {
-					this.$refs.uToast.show({
-						type: 'error',
-						message: "挂车行驶证有效期不能为空!",
-					})
-					return true
+				if(this.radiovalue=='挂车司机'){
+					if (uni.$u.test.isEmpty(this.dataDetails.trailerLicenseHomePage)) {
+						this.$refs.uToast.show({
+							type: 'error',
+							message: "挂车行驶证主页不能为空!",
+						})
+						return true
+					}
+					if (uni.$u.test.isEmpty(this.dataDetails.trailerLicenseBackPage)) {
+						this.$refs.uToast.show({
+							type: 'error',
+							message: "挂车行驶证副页不能为空!",
+						})
+						return true
+					}
+					if (uni.$u.test.isEmpty(this.dataDetails.trailerLicenseNumber)) {
+						this.$refs.uToast.show({
+							type: 'error',
+							message: "挂车行驶证档案编号不能为空!",
+						})
+						return true
+					}
+					if (uni.$u.test.isEmpty(this.dataDetails.trailerLicenseValidityDate)) {
+						this.$refs.uToast.show({
+							type: 'error',
+							message: "挂车行驶证有效期不能为空!",
+						})
+						return true
+					}
 				}
+				
+				// if (uni.$u.test.isEmpty(this.dataDetails.trailerLicenseBackPage)) {
+				// 	this.$refs.uToast.show({
+				// 		type: 'error',
+				// 		message: "行驶证副页不能为空!",
+				// 	})
+				// 	return true
+				// }
+				
 				if (uni.$u.test.isEmpty(this.dataDetails.qualificationCertificate)) {
 					this.$refs.uToast.show({
 						type: 'error',
@@ -511,26 +515,28 @@
 					})
 					return true
 				}
-				if (uni.$u.test.isEmpty(this.dataDetails.trailerOperationCertificate)) {
-					this.$refs.uToast.show({
-						type: 'error',
-						message: "挂车道路运输证不能为空!",
-					})
-					return true
-				}
-				if (uni.$u.test.isEmpty(this.dataDetails.trailerOperationCertificateNumber)) {
-					this.$refs.uToast.show({
-						type: 'error',
-						message: "挂车道路运输证号不能为空!",
-					})
-					return true
-				}
-				if (uni.$u.test.isEmpty(this.dataDetails.trailerOperationCertificateValidityDate)) {
-					this.$refs.uToast.show({
-						type: 'error',
-						message: "挂车道路运输证有效期不能为空!",
-					})
-					return true
+				if(this.radiovalue=='挂车司机'){
+					if (uni.$u.test.isEmpty(this.dataDetails.trailerOperationCertificate)) {
+						this.$refs.uToast.show({
+							type: 'error',
+							message: "挂车道路运输证不能为空!",
+						})
+						return true
+					}
+					if (uni.$u.test.isEmpty(this.dataDetails.trailerOperationCertificateNumber)) {
+						this.$refs.uToast.show({
+							type: 'error',
+							message: "挂车道路运输证号不能为空!",
+						})
+						return true
+					}
+					if (uni.$u.test.isEmpty(this.dataDetails.trailerOperationCertificateValidityDate)) {
+						this.$refs.uToast.show({
+							type: 'error',
+							message: "挂车道路运输证有效期不能为空!",
+						})
+						return true
+					}
 				}
 				return false
 			},
@@ -539,7 +545,7 @@
 			
 				// 校验
 				if (this.validate()) return
-				debugger
+				// debugger
 				if(this.dataDetails.driverSex=='男'){
 					this.dataDetails.driverCall = this.dataDetails.driverCall+'先生'
 				}else{
@@ -556,11 +562,12 @@
 
 
 				this.$request.baseRequest('post', '/driverInfo/api/addInfo', this.dataDetails).then(res => {
-						if(res.data.code==200){
+						if(res.code==200){
 							uni.$u.route('/pages/mine/index');
+						}else{
+							uni.$u.toast(res.message);
 						}
 
-
 					})
 					.catch(res => {
 						uni.$u.toast(res.message);

+ 12 - 5
pages/mine/index.vue

@@ -50,7 +50,7 @@
 					</image>
 					<view>管理银行卡</view>
 				</view>
-				<view> > </view>
+				<view> <image src="../../static/images/myimg/gengduo1@3x.png" class="arrow"></image> </view>
 			</view>
 			<view class="flex flex-space-between" @click="goDetailPage('/pages/mine/manageVehicles/index',3)">
 				<view class="flex align-center">
@@ -58,7 +58,7 @@
 					</image>
 					<view>管理车辆</view>
 				</view>
-				<view> > </view>
+				<view><image src="../../static/images/myimg/gengduo1@3x.png" class="arrow"></image></view>
 			</view>
 			<view class="flex flex-space-between" @click="$helper.contactCustomerService">
 				<view class="flex align-center">
@@ -66,7 +66,7 @@
 					</image>
 					<view>联系客服</view>
 				</view>
-				<view> > </view>
+				<view> <image src="../../static/images/myimg/gengduo1@3x.png" class="arrow"></image></view>
 			</view>
 			<view class="flex flex-space-between" @click="goDetailPage('/pages/mine/helpDescription')">
 				<view class="flex align-center">
@@ -74,7 +74,7 @@
 					</image>
 					<view>帮助说明</view>
 				</view>
-				<view> > </view>
+				<view> <image src="../../static/images/myimg/gengduo1@3x.png" class="arrow"></image></view>
 			</view>
 			<view class="flex flex-space-between" @click="goDetailPage('/pages/mine/set')">
 				<view class="flex align-center">
@@ -82,7 +82,7 @@
 					</image>
 					<view>设置</view>
 				</view>
-				<view> > </view>
+				<view> <image src="../../static/images/myimg/gengduo1@3x.png" class="arrow"></image></view>
 			</view>
 		</view>
 		<u-modal :show="isShowAlert" :title="alertTitle" :content='alertContent' :closeOnClickOverlay='true'
@@ -266,6 +266,13 @@
 		height: var(--status-bar-height);
 	}
 
+.arrow {
+		margin-left: 15px;
+		width: 8px;
+		height: 12px;
+		// justify-content: flex-end
+
+	}
 	.head {
 		.row1 {
 			display: flex;

+ 35 - 1
pages/mine/settings/editAvatar.vue

@@ -81,7 +81,41 @@
 					});
 
 				} else {
-
+					uni.chooseImage({
+						count: 1,
+						sourceType: 'camera',
+						success: function(res) {
+							console.log(JSON.stringify(res.tempFilePaths));
+							uploadImage(res.tempFilePaths[0], 'appData/',
+								result => {
+									// 上传成功
+									console.log('图片地址', result)
+									that.$request.baseRequest('get', '/BDAccessToken/getAuth', {
+											apiKey: 'yNWLRW6unoUxo2KXiCZxOxGS',
+											secretKey: 'E8hqzKWdFdTGnFnpAwZ7ixtL89SN3deR'
+										}).then(res => {
+											console.log(res)
+											that.$request.baseRequest('post',
+													'/commonUser/getUserDefinedBean', {
+														accessToken: res.data,
+														imagePath: result
+													}).then(res1 => {
+													that.deptListurl.avatarUrl = result
+												})
+												.catch(res => {
+													uni.$u.toast(res.message);
+												});
+										})
+										.catch(res => {
+											uni.$u.toast(res.message);
+										});
+					
+					
+					
+								}
+							)
+						}
+					});
 				}
 
 			},