|
|
@@ -32,11 +32,28 @@
|
|
|
<empty :isShow="false" v-if="content.length == 0" />
|
|
|
</scroll-view>
|
|
|
</view>
|
|
|
- <view class="footer-btn">
|
|
|
+ <view class="buttons flex align-center">
|
|
|
<view class="white-btn" @click="handleWeChatUpload">微信上传</view>
|
|
|
- <view class="white-btn" @click="handlUploadFile">附件简历一键识别</view>
|
|
|
- <fileSelector title="简历上传" allowType=".doc,.docx,.xls,.xlsx,.pdf" @fileSelected="uploadResumes"
|
|
|
- @filesChanged="onFilesChanged" />
|
|
|
+ <view class="button pain" @click="showTipPopup = true">Ai一键解析简历</view>
|
|
|
+ <view class="button primary">
|
|
|
+ 简历上传
|
|
|
+ <fileSelector title="" allowType=".doc,.docx,.xls,.xlsx,.pdf" @fileSelected="uploadResumes"
|
|
|
+ @filesChanged="onFilesChanged" />
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <!-- 简历解析确认弹窗 -->
|
|
|
+ <view class="popup-container" v-if="showTipPopup" @click="showTipPopup = false">
|
|
|
+ <view class="popup-content">
|
|
|
+ <view class="popup-title">温馨提示</view>
|
|
|
+ <view class="tip-container">
|
|
|
+ <view>1-2页简历识别预计耗时1分钟;</view>
|
|
|
+ <view>3-5页简历识别预计耗时1-3分钟;</view>
|
|
|
+ <view>5页简历以上耗时将会超过5分;</view>
|
|
|
+ <view>请您耐心等待!</view>
|
|
|
+ </view>
|
|
|
+ <image src="@/static/upload-tip.png" class="upload-tip"></image>
|
|
|
+ <view class="button-primary" @click.stop="handlUploadFile">知道了</view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
<!-- 简历解析加载 -->
|
|
|
<view class="load-container" v-if="showLoadCard">
|
|
|
@@ -131,7 +148,8 @@ export default {
|
|
|
value: '',
|
|
|
},
|
|
|
],
|
|
|
- loading: false
|
|
|
+ loading: false,
|
|
|
+ showTipPopup: false
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -200,95 +218,6 @@ export default {
|
|
|
url: '../jifen/myaddress'
|
|
|
});
|
|
|
},
|
|
|
- // uploadImg() {
|
|
|
- // let token = uni.getStorageSync('token')
|
|
|
-
|
|
|
- // if (!token) {
|
|
|
- // this.goLoginInfo();
|
|
|
- // return;
|
|
|
- // }
|
|
|
- // let that = this;
|
|
|
- // var url = null;
|
|
|
- // uni.showActionSheet({
|
|
|
- // // itemList按钮的文字接受的是数组
|
|
|
- // itemList: ["查看头像", "从相册选择图片"],
|
|
|
- // async success(e) {
|
|
|
- // var index = e.tapIndex
|
|
|
- // if (index === 0) {
|
|
|
- // // 用户点击了预览当前图片
|
|
|
- // // 可以自己实现当前头像链接的读取
|
|
|
- // let url = that.avatar;
|
|
|
- // let arr = []
|
|
|
- // arr.push(url)
|
|
|
- // uni.previewImage({
|
|
|
- // // 预览功能图片也必须是数组的
|
|
|
- // urls: arr
|
|
|
- // })
|
|
|
- // } else if (index === 1) {
|
|
|
- // // 1. 检查权限状态
|
|
|
- // const hasPermission = await this.$queue.checkPermission(
|
|
|
- // 'camera',
|
|
|
- // '选择/拍摄照片需要相机/相册权限,用于上传用户头像',
|
|
|
- // this
|
|
|
- // );
|
|
|
-
|
|
|
- // // 2. 如果未授权或者用户拒绝,显示提示
|
|
|
- // if (!hasPermission) {
|
|
|
- // return;
|
|
|
- // }
|
|
|
- // uni.chooseImage({
|
|
|
- // count: 1, //默认9
|
|
|
- // sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
|
|
|
- // sourceType: ['album'], //从相册选择
|
|
|
- // success: function (res) {
|
|
|
- // uni.showLoading({
|
|
|
- // title: '上传中...'
|
|
|
- // });
|
|
|
- // let token = uni.getStorageSync('token');
|
|
|
- // let userId = uni.getStorageSync('userId');
|
|
|
- // uni.uploadFile({
|
|
|
- // url: this.$Request.config("APIHOST1") +
|
|
|
- // '/alioss/upload', //真实的接口地址
|
|
|
-
|
|
|
- // filePath: res.tempFilePaths[0],
|
|
|
- // header: {
|
|
|
- // token: token
|
|
|
- // },
|
|
|
- // name: 'file',
|
|
|
- // success: uploadFileRes => {
|
|
|
- // url = JSON.parse(uploadFileRes.data);
|
|
|
- // that.avatar = url.data
|
|
|
- // uni.hideLoading();
|
|
|
- // }
|
|
|
- // });
|
|
|
- // }
|
|
|
- // });
|
|
|
- // }
|
|
|
- // }
|
|
|
- // })
|
|
|
- // },
|
|
|
- // config: function (name) {
|
|
|
- // var info = null;
|
|
|
- // if (name) {
|
|
|
- // var name2 = name.split("."); //字符分割
|
|
|
- // if (name2.length > 1) {
|
|
|
- // info = configdata[name2[0]][name2[1]] || null;
|
|
|
- // } else {
|
|
|
- // info = configdata[name] || null;
|
|
|
- // }
|
|
|
- // if (info == null) {
|
|
|
- // let web_config = cache.get("web_config");
|
|
|
- // if (web_config) {
|
|
|
- // if (name2.length > 1) {
|
|
|
- // info = web_config[name2[0]][name2[1]] || null;
|
|
|
- // } else {
|
|
|
- // info = web_config[name] || null;
|
|
|
- // }
|
|
|
- // }
|
|
|
- // }
|
|
|
- // }
|
|
|
- // return info;
|
|
|
- // },
|
|
|
getUserInfo() {
|
|
|
this.$Request.get("/app/resumes/getAttachment").then(res => {
|
|
|
if (res.code == 0) {
|
|
|
@@ -438,6 +367,7 @@ export default {
|
|
|
// 附件一键识别
|
|
|
handlUploadFile() {
|
|
|
if (this.content.length >= 3) {
|
|
|
+ this.showTipPopup = false
|
|
|
this.$queue.showToast('最多保存三张附件简历,请删除后再试')
|
|
|
return
|
|
|
}
|
|
|
@@ -470,7 +400,7 @@ export default {
|
|
|
fileType,
|
|
|
name
|
|
|
}
|
|
|
- this.uploadFile(file)
|
|
|
+ this.uploadAndAnalysisResumes(file)
|
|
|
}
|
|
|
})
|
|
|
// #endif
|
|
|
@@ -478,7 +408,7 @@ export default {
|
|
|
uni.chooseFile({
|
|
|
count: 1,
|
|
|
success: res => {
|
|
|
- this.uploadFile({
|
|
|
+ this.uploadAndAnalysisResumes({
|
|
|
path: res.tempFilePaths[0],
|
|
|
name: 'file'
|
|
|
})
|
|
|
@@ -486,56 +416,33 @@ export default {
|
|
|
})
|
|
|
// #endif
|
|
|
},
|
|
|
- // 上传文件
|
|
|
- uploadFile(file) {
|
|
|
+ // 上传解析简历
|
|
|
+ uploadAndAnalysisResumes(file) {
|
|
|
+ this.showTipPopup = false
|
|
|
+ this.showLoadCard = true
|
|
|
this.$queue.uploadFiles({
|
|
|
- url: '/app/resumes/aiResumesUpload',
|
|
|
+ url: '/app/resumes/resumesAnalysisPlus',
|
|
|
path: file.path,
|
|
|
- name: 'file'
|
|
|
+ name: 'file',
|
|
|
+ timeout: 480000,
|
|
|
+ hideUploadTask: true
|
|
|
}, (res) => {
|
|
|
- if (res && res.code === 0) {
|
|
|
- const id = res.data?.id
|
|
|
- const resumesAttachmentId = res.data?.resumesAttachmentId || ''
|
|
|
- if (id) {
|
|
|
- this.getAiResumesAnalysis(id, resumesAttachmentId)
|
|
|
- }
|
|
|
+ if (!res) {
|
|
|
+ this.showModal('解析失败,请稍后重试')
|
|
|
+ this.stopLoadStatus()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (res.code == 0 && res.data) {
|
|
|
+ // 识别前,先清空数据
|
|
|
+ this.clearResumeData()
|
|
|
+ this.setAiResumesAnalysis(JSON.parse(res.data))
|
|
|
|
|
|
- // 上传成功,获取简历列表数据
|
|
|
this.getUserInfo()
|
|
|
} else {
|
|
|
- this.$queue.showToast(res ? res.msg : '文件上传失败')
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- // 获取简历解析数据
|
|
|
- getAiResumesAnalysis(fileId, resumesAttachmentId) {
|
|
|
- this.showLoadCard = true
|
|
|
- uni.request({
|
|
|
- url: this.$Request.config('APIHOST') + '/app/resumes/aiResumesAnalysis',
|
|
|
- header: {
|
|
|
- 'content-type': 'application/x-www-form-urlencoded', // 模拟 form-data
|
|
|
- token: uni.getStorageSync('token'),
|
|
|
- },
|
|
|
- method: 'post',
|
|
|
- data: {
|
|
|
- fileId,
|
|
|
- resumesAttachmentId
|
|
|
- },
|
|
|
- timeout: 180000,
|
|
|
- success: (res) => {
|
|
|
- this.stopLoadStatus()
|
|
|
-
|
|
|
- if (res.data?.code == 0) {
|
|
|
- const data = res.data.data.data
|
|
|
- // 识别前,先清空数据
|
|
|
- this.clearResumeData()
|
|
|
- this.setAiResumesAnalysis(data.output)
|
|
|
- }
|
|
|
- },
|
|
|
- fail: (err) => {
|
|
|
this.showModal('解析失败,请稍后重试')
|
|
|
- this.stopLoadStatus()
|
|
|
}
|
|
|
+
|
|
|
+ this.stopLoadStatus()
|
|
|
})
|
|
|
},
|
|
|
stopLoadStatus() {
|
|
|
@@ -873,16 +780,39 @@ button {
|
|
|
border: none;
|
|
|
}
|
|
|
|
|
|
-.footer-btn .usermain-btn {
|
|
|
- color: rgba(255, 255, 255, 1);
|
|
|
- background: rgba(1, 107, 246, 1);
|
|
|
- text-align: center;
|
|
|
- width: 90%;
|
|
|
- height: 80rpx;
|
|
|
- font-size: 32rpx;
|
|
|
- line-height: 80rpx;
|
|
|
- margin: 20rpx auto;
|
|
|
- border-radius: 40rpx;
|
|
|
+.buttons {
|
|
|
+ padding: 40rpx 40rpx 60rpx;
|
|
|
+ .button {
|
|
|
+ position: relative;
|
|
|
+ flex: 1;
|
|
|
+ height: 80rpx;
|
|
|
+ line-height: 80rpx;
|
|
|
+ text-align: center;
|
|
|
+ border-radius: 80rpx;
|
|
|
+ &:first-child {
|
|
|
+ margin-right: 16rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .pain {
|
|
|
+ color: rgba(1, 107, 246, 1);
|
|
|
+ background: rgba(1, 107, 246, 0.1);
|
|
|
+ }
|
|
|
+ .primary {
|
|
|
+ color: #fff;
|
|
|
+ background: linear-gradient(90.00deg, rgba(13, 39, 247, 1),rgba(19, 193, 234, 1));
|
|
|
+ }
|
|
|
+ ::v-deep .main {
|
|
|
+ position: absolute;
|
|
|
+ left: 0;
|
|
|
+ top: 0;
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ padding: 0;
|
|
|
+ .upload-area {
|
|
|
+ margin: 0;
|
|
|
+ background: transparent;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/* 选择器样式 - 参考workExperience页面 */
|
|
|
@@ -1026,4 +956,51 @@ button {
|
|
|
background: rgba(230, 230, 230, 1);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+// 简历解析提示弹窗
|
|
|
+.popup-container {
|
|
|
+ position: fixed;
|
|
|
+ left: 0;
|
|
|
+ top: 0;
|
|
|
+ width: 100vw;
|
|
|
+ height: 100vh;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ background: rgba(0, 0, 0, 0.4);
|
|
|
+ .popup-content {
|
|
|
+ padding: 40rpx 0;
|
|
|
+ border-radius: 20rpx;
|
|
|
+ background: #fff;
|
|
|
+ .popup-title {
|
|
|
+ font-size: 32rpx;
|
|
|
+ font-weight: 600;
|
|
|
+ line-height: 56rpx;
|
|
|
+ color: rgba(16, 24, 40, 1);
|
|
|
+ text-align: center;
|
|
|
+ margin-bottom: 20rpx;
|
|
|
+ }
|
|
|
+ .tip-container {
|
|
|
+ padding: 0 130rpx;
|
|
|
+ color: rgba(96, 96, 96, 1);
|
|
|
+ font-size: 28rpx;
|
|
|
+ line-height: 36rpx;
|
|
|
+ }
|
|
|
+ .upload-tip {
|
|
|
+ display: block;
|
|
|
+ width: 654rpx;
|
|
|
+ height: 802rpx;
|
|
|
+ }
|
|
|
+ .button-primary {
|
|
|
+ height: 80rpx;
|
|
|
+ border-radius: 80rpx;
|
|
|
+ text-align: center;
|
|
|
+ color: #fff;
|
|
|
+ font-size: 32rpx;
|
|
|
+ line-height: 80rpx;
|
|
|
+ margin: 0 40rpx;
|
|
|
+ background: linear-gradient(90.00deg, rgba(13, 39, 247, 1),rgba(19, 193, 234, 1));
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|