Ver código fonte

修改上传

wangchao 3 anos atrás
pai
commit
447311c199

+ 36 - 36
components/upload.vue

@@ -407,42 +407,42 @@
 					}
 					}
 				)
 				)
 				// 创建上传对象
 				// 创建上传对象
-				const task = uni.uploadFile({
-					url: this.action,
-					filePath: this.lists[index].url,
-					name: this.name,
-					formData: this.formData,
-					header: this.header,
-					success: res => {
-						// 判断是否json字符串,将其转为json格式
-						let data = this.toJson && this.checkIsJSON(res.data) ? JSON.parse(res.data) : res
-							.data;
-						if (![200, 201].includes(res.statusCode)) {
-							this.uploadError(index, data);
-						} else {
-							// 上传成功
-							this.lists[index].response = data;
-							this.lists[index].progress = 100;
-							this.lists[index].error = false;
-							this.$emit('on-success', data, index, this.lists);
-						}
-					},
-					fail: e => {
-						this.uploadError(index, e);
-					},
-					complete: res => {
-						uni.hideLoading();
-						this.uploading = false;
-						this.uploadFile(index + 1);
-						this.$emit('on-change', res, index, this.lists);
-					}
-				});
-				task.onProgressUpdate(res => {
-					if (res.progress > 0) {
-						this.lists[index].progress = res.progress;
-						this.$emit('on-progress', res, index, this.lists);
-					}
-				});
+				// const task = uni.uploadFile({
+				// 	url: this.action,
+				// 	filePath: this.lists[index].url,
+				// 	name: this.name,
+				// 	formData: this.formData,
+				// 	header: this.header,
+				// 	success: res => {
+				// 		// 判断是否json字符串,将其转为json格式
+				// 		let data = this.toJson && this.checkIsJSON(res.data) ? JSON.parse(res.data) : res
+				// 			.data;
+				// 		if (![200, 201].includes(res.statusCode)) {
+				// 			this.uploadError(index, data);
+				// 		} else {
+				// 			// 上传成功
+				// 			this.lists[index].response = data;
+				// 			this.lists[index].progress = 100;
+				// 			this.lists[index].error = false;
+				// 			// this.$emit('on-success', data, index, this.lists);
+				// 		}
+				// 	},
+				// 	fail: e => {
+				// 		this.uploadError(index, e);
+				// 	},
+				// 	complete: res => {
+				// 		uni.hideLoading();
+				// 		this.uploading = false;
+				// 		this.uploadFile(index + 1);
+				// 		this.$emit('on-change', res, index, this.lists);
+				// 	}
+				// });
+				// task.onProgressUpdate(res => {
+				// 	if (res.progress > 0) {
+				// 		this.lists[index].progress = res.progress;
+				// 		this.$emit('on-progress', res, index, this.lists);
+				// 	}
+				// });
 			},
 			},
 			// 上传失败
 			// 上传失败
 			uploadError(index, err) {
 			uploadError(index, err) {

+ 0 - 1
pageD/identity/companyIdentity.vue

@@ -211,7 +211,6 @@
 				this.imgUrls.splice(index, 1);
 				this.imgUrls.splice(index, 1);
 			},
 			},
 			jumpUrl() {
 			jumpUrl() {
-				debugger
 				if (this.consentStatus) {
 				if (this.consentStatus) {
 					if (!this.identityAuthenticationInfo.compName) {
 					if (!this.identityAuthenticationInfo.compName) {
 						this.$api.msg('公司名称不能为空')
 						this.$api.msg('公司名称不能为空')

+ 4 - 4
pageD/identity/driverIdentity.vue

@@ -144,12 +144,12 @@
 				this.imgUrls.splice(index, 1);
 				this.imgUrls.splice(index, 1);
 			},
 			},
 			//身份证正面
 			//身份证正面
-			getImgUrl1(res) {
-				console.log(res)
+			getImgUrl1(src) {
+				console.log(src)
 				console.log('------------res-----------')
 				console.log('------------res-----------')
 				let that = this;
 				let that = this;
-				that.id[0] = res
-				that.id1 = res
+				that.id[0] = src
+				that.id1 = src
 				that.certificates = false
 				that.certificates = false
 				that.personImgs.personImg = that.id[0]
 				that.personImgs.personImg = that.id[0]
 				that.$api.doRequest('get', '/driverViewInfo/personShibie', that
 				that.$api.doRequest('get', '/driverViewInfo/personShibie', that

+ 74 - 72
pageD/identity/driverIdentityThree.vue

@@ -101,10 +101,10 @@
 					"text": "上传从业资格证",
 					"text": "上传从业资格证",
 					"bgc": ""
 					"bgc": ""
 				},
 				},
-				// travels: "../../static/img/authentication/travel(3).png",
-				// drives: "../../static/img/authentication/drive(3).png",
-				// practices: "../../static/img/authentication/business@3x.png",
-				// operates: "../../static/img/authentication/business@3x.png",
+				travels: "../../static/img/authentication/travel(3).png",
+				drives: "../../static/img/authentication/drive(3).png",
+				practices: "../../static/img/authentication/business@3x.png",
+				operates: "../../static/img/authentication/business@3x.png",
 				DriverViewInfo: {},
 				DriverViewInfo: {},
 				addressUrl: [],
 				addressUrl: [],
 				certificates: true,
 				certificates: true,
@@ -135,7 +135,7 @@
 			},
 			},
 			getImgUrl(res) {
 			getImgUrl(res) {
 				console.log(res)
 				console.log(res)
-				console.log('------------res-----------')
+				console.log('------------res1-----------')
 				this.travels = res
 				this.travels = res
 				this.addressUrl[0] = res
 				this.addressUrl[0] = res
 				this.certificates = false
 				this.certificates = false
@@ -143,26 +143,28 @@
 			},
 			},
 			getImgUrl1(res) {
 			getImgUrl1(res) {
 				console.log(res)
 				console.log(res)
-				console.log('------------res-----------')
-				this.travels = res
+				console.log('------------res2-----------')
+				this.drives = res
 				this.addressUrl[1] = res
 				this.addressUrl[1] = res
-				this.certificates = false
+				this.certificatesTwo = false
 			
 			
 			},
 			},
 			getImgUrl2(res) {
 			getImgUrl2(res) {
 				console.log(res)
 				console.log(res)
-				console.log('------------res-----------')
-				this.travels = res
+				console.log('------------res3-----------')
+				this.practices = res
 				this.addressUrl[2] = res
 				this.addressUrl[2] = res
-				this.certificates = false
+				this.certificatesThree = false
+				
 			
 			
 			},
 			},
 			getImgUrl3(res) {
 			getImgUrl3(res) {
 				console.log(res)
 				console.log(res)
-				console.log('------------res-----------')
-				this.travels = res
-				this.addressUrl[3] = res
-				this.certificates = false
+				console.log('------------res4-----------')
+				
+				this.operates =res
+				this.addressUrl[3] =res
+				this.certificatesFour = false
 			
 			
 			},
 			},
 			onError(error) {
 			onError(error) {
@@ -380,63 +382,63 @@
 			// 		}
 			// 		}
 			// 	})
 			// 	})
 			// },
 			// },
-			drive() {
-				var that = this
-				uni.chooseImage({
-					success: function(res) {
-						uni.uploadFile({
-							url: 'https://www.zthymaoyi.com/upload/admin',
-							filePath: res.tempFilePaths[0],
-							name: 'file',
-							success(res) {
-								var data = res.data
-								var strToObj = JSON.parse(data)
-								that.drives = strToObj.url
-								that.addressUrl[1] = strToObj.url
-								that.certificatesTwo = false
-							}
-						})
-					}
-				})
-			},
-			practice() {
-				var that = this
-				uni.chooseImage({
-					success: function(res) {
-						uni.uploadFile({
-							url: 'https://www.zthymaoyi.com/upload/admin',
-							filePath: res.tempFilePaths[0],
-							name: 'file',
-							success(res) {
-								var data = res.data
-								var strToObj = JSON.parse(data)
-								that.practices = strToObj.url
-								that.addressUrl[2] = strToObj.url
-								that.certificatesThree = false
-							}
-						})
-					}
-				})
-			},
-			operate() {
-				var that = this
-				uni.chooseImage({
-					success: function(res) {
-						uni.uploadFile({
-							url: 'https://www.zthymaoyi.com/upload/admin',
-							filePath: res.tempFilePaths[0],
-							name: 'file',
-							success(res) {
-								var data = res.data
-								var strToObj = JSON.parse(data)
-								that.operates = strToObj.url
-								that.addressUrl[3] = strToObj.url
-								that.certificatesFour = false
-							}
-						})
-					}
-				})
-			},
+			// drive() {
+			// 	var that = this
+			// 	uni.chooseImage({
+			// 		success: function(res) {
+			// 			uni.uploadFile({
+			// 				url: 'https://www.zthymaoyi.com/upload/admin',
+			// 				filePath: res.tempFilePaths[0],
+			// 				name: 'file',
+			// 				success(res) {
+			// 					var data = res.data
+			// 					var strToObj = JSON.parse(data)
+			// 					that.drives = strToObj.url
+			// 					that.addressUrl[1] = strToObj.url
+			// 					that.certificatesTwo = false
+			// 				}
+			// 			})
+			// 		}
+			// 	})
+			// },
+			// practice() {
+			// 	var that = this
+			// 	uni.chooseImage({
+			// 		success: function(res) {
+			// 			uni.uploadFile({
+			// 				url: 'https://www.zthymaoyi.com/upload/admin',
+			// 				filePath: res.tempFilePaths[0],
+			// 				name: 'file',
+			// 				success(res) {
+			// 					var data = res.data
+			// 					var strToObj = JSON.parse(data)
+			// 					that.practices = strToObj.url
+			// 					that.addressUrl[2] = strToObj.url
+			// 					that.certificatesThree = false
+			// 				}
+			// 			})
+			// 		}
+			// 	})
+			// },
+			// operate() {
+			// 	var that = this
+			// 	uni.chooseImage({
+			// 		success: function(res) {
+			// 			uni.uploadFile({
+			// 				url: 'https://www.zthymaoyi.com/upload/admin',
+			// 				filePath: res.tempFilePaths[0],
+			// 				name: 'file',
+			// 				success(res) {
+			// 					var data = res.data
+			// 					var strToObj = JSON.parse(data)
+			// 					that.operates = strToObj.url
+			// 					that.addressUrl[3] = strToObj.url
+			// 					that.certificatesFour = false
+			// 				}
+			// 			})
+			// 		}
+			// 	})
+			// },
 
 
 		}
 		}
 	}
 	}