Tang 4 yıl önce
ebeveyn
işleme
c6d26a96b4
1 değiştirilmiş dosya ile 59 ekleme ve 5 silme
  1. 59 5
      pages2/resume/addResume.vue

+ 59 - 5
pages2/resume/addResume.vue

@@ -415,7 +415,6 @@
 import tkiTree from '@/components/tki-tree/tki-tree.vue';
 import { mapGetters } from 'vuex';
 import * as baseUrls from '@/common/request.js';
-import * as fileUrls from '@/common/methodTool.js';
 export default {
 	components: { tkiTree },
 	data() {
@@ -492,11 +491,14 @@ export default {
 						self.index_level = self.dictObj['edu_level'].indexOf(res.data.data.eduLevel)
 					}
 					if (res.data.data.attachUrl) {
-						self.attachUrl = fileUrls.BASE_IMG_URL + res.data.data.attachUrl;
+						self.attachUrl = baseUrls.BASE_IMG_URL + res.data.data.attachUrl;
 						self.attachName = res.data.data.attachName
 					}
 					if (res.data.data.introduceVideoUrl) {
-						self.videoUrl = fileUrls.BASE_IMG_URL + res.data.data.introduceVideoUrl;
+						self.videoUrl = baseUrls.BASE_IMG_URL + res.data.data.introduceVideoUrl;
+					}
+					if(res.data.data.startYear){
+					res.data.data.startYear = res.data.data.startYear + "年"
 					}
 					this.formTableInfos = res.data.data;
 				}
@@ -725,7 +727,6 @@ export default {
 			this.formTableInfos.jobType = this.array_JobType[this.jobIntentionForm.index_JobType];
 			this.formTableInfos.comeWorkTime = this.array_Arrivaltime[this.jobIntentionForm.index_Arrivaltime];
 			this.formTableInfos.startYear = this.jobIntentionForm.startYear;
-			console.log(this.jobIntentionForm.index_PriceType)
 			this.qzYX = false;
 		},
 		//保存工作经历
@@ -938,9 +939,12 @@ export default {
 			});
 			var data = JSON.parse(JSON.stringify(this.formTableInfos));
 			if(self.videoUrl){
-				const waitUpload1 = await self.uploadFile(self.videoUrl, 6, '视频');
+				const waitUpload1 = await self.uploadFileVids(self.videoUrl, 6);
 				if(waitUpload1 !== undefined){
 				data.introduceVideoUrl = waitUpload1;}
+				// const waitUpload1 = await self.uploadFile(self.videoUrl, 6, '视频');
+				// if(waitUpload1 !== undefined){
+				// data.introduceVideoUrl = waitUpload1;}
 				
 			}else{
 				data.introduceVideoUrl = null
@@ -954,6 +958,9 @@ export default {
 				data.attachUrl = null;
 				data.attachName = null;
 			}
+			if(data.startYear.indexOf("年") === -1){}else{
+				data.startYear = Number(data.startYear.slice(0,data.startYear.indexOf("年")))
+			}
 			data.sex = self.userInfo.sex === 0 ? 1 : self.userInfo.sex === 1 ? 2 : null;
 			data.userBirth = self.userInfo.userBirth;
 			data.eduLevel = self.dictObj['edu_level'][self.index_level];
@@ -1133,6 +1140,53 @@ export default {
 				}
 			});
 		},
+		uploadFileVids(options, int) {
+			return new Promise((resolve, reject) => {
+				var self = this;
+				var data = {
+					imageStatus: int
+				};
+				this.$api.aliyunpolicy(data).then(res => {
+					var ossToken = res.data.data.resultContent;
+					var fileExtension = options.split('.').pop().toLowerCase()
+					uni.uploadFile({
+						url: ossToken.host,
+						name: 'file',
+						filePath: options,
+						fileType: 'video',
+						header: {
+							AuthorizationToken: 'WX ' + uni.getStorageSync('token')
+						},
+						formData: {
+							key: ossToken.dir + "." + fileExtension,
+							OSSAccessKeyId: ossToken.accessid,
+							policy: ossToken.policy,
+							Signature: ossToken.signature,
+							callback: ossToken.callback,
+							success_action_status: 200
+						},
+						success: result => {
+							if (result.statusCode === 200) {
+								resolve(ossToken.dir + "." + fileExtension);
+							} else {
+								uni.showToast({
+									title: '视频上传失败',
+									icon: 'none'
+								});
+								resolve();
+							}
+						},
+						fail: error => {
+							uni.showToast({
+								title: '上传接口报错',
+								icon: 'none'
+							});
+							resolve();
+						}
+					});
+				});
+			});
+		},
 		uploadFile(options, int, names) {
 			return new Promise((resolve, reject) => {
 				var self = this;