|
@@ -47,7 +47,6 @@
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
import { saveResumeInfo, resumeParser2 } from '@/api/user'
|
|
import { saveResumeInfo, resumeParser2 } from '@/api/user'
|
|
-// import { envObj, baseUrl } from '@/utils/config'
|
|
|
|
import resume from '../resume/index.vue'
|
|
import resume from '../resume/index.vue'
|
|
import { ref, shallowRef } from 'vue'
|
|
import { ref, shallowRef } from 'vue'
|
|
import avatarEdit from './components/avatarEdit.vue'
|
|
import avatarEdit from './components/avatarEdit.vue'
|
|
@@ -56,7 +55,8 @@ import advantageEdit from './components/advantage.vue'
|
|
import educationEdit from './components/educationExp.vue'
|
|
import educationEdit from './components/educationExp.vue'
|
|
import workExperienceEdit from './components/workExperience.vue'
|
|
import workExperienceEdit from './components/workExperience.vue'
|
|
import trainingExperienceEdit from './components/trainingExperience.vue'
|
|
import trainingExperienceEdit from './components/trainingExperience.vue'
|
|
-import { resumeParser2Data } from './testData.js'
|
|
|
|
|
|
+// import { resumeParser2Data } from './testData.js'
|
|
|
|
+import { userStore } from '@/store/user'; const useUserStore = userStore()
|
|
|
|
|
|
const step = ref(1)
|
|
const step = ref(1)
|
|
|
|
|
|
@@ -137,9 +137,9 @@ const handleAnalysis = async (url) => {
|
|
loading.value = true
|
|
loading.value = true
|
|
step.value = 3
|
|
step.value = 3
|
|
try {
|
|
try {
|
|
- // const res = await resumeParser2({ fileUrl: url })
|
|
|
|
- // result.value = res?.data || {}
|
|
|
|
- result.value = resumeParser2Data
|
|
|
|
|
|
+ const res = await resumeParser2({ fileUrl: url })
|
|
|
|
+ result.value = res?.data || {}
|
|
|
|
+ // result.value = resumeParser2Data // 测试数据
|
|
await transformToLIst(result.value)
|
|
await transformToLIst(result.value)
|
|
step.value = 2
|
|
step.value = 2
|
|
} catch (error) {
|
|
} catch (error) {
|
|
@@ -152,7 +152,7 @@ const handleAnalysis = async (url) => {
|
|
|
|
|
|
const handleResumeAnalysis = (url) => {
|
|
const handleResumeAnalysis = (url) => {
|
|
if (!url) {
|
|
if (!url) {
|
|
- return uni.showToast({ icon: 'none', title: '请选择要解析的简历' })
|
|
|
|
|
|
+ return uni.showToast({ icon: 'none', title: '请选择要解析的简历', duration: 2000 })
|
|
}
|
|
}
|
|
handleAnalysis(url)
|
|
handleAnalysis(url)
|
|
}
|
|
}
|
|
@@ -171,7 +171,7 @@ const getValue = async () => {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (text) {
|
|
if (text) {
|
|
- uni.showToast({ icon: 'none', title: `请完整填写 ${text} 后提交!` })
|
|
|
|
|
|
+ uni.showToast({ icon: 'none', title: `请完整填写 ${text} 后提交!`, duration: 2000 })
|
|
return
|
|
return
|
|
}
|
|
}
|
|
// 处理data
|
|
// 处理data
|
|
@@ -194,21 +194,30 @@ const getValue = async () => {
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|
|
- console.log('123456:', obj)
|
|
|
|
- return obj && Object.keys(obj).length ? JSON.stringify(obj) : null
|
|
|
|
|
|
+ console.log('getValue:', obj)
|
|
|
|
+ return (obj && Object.keys(obj).length) ? JSON.stringify(obj) : null
|
|
}
|
|
}
|
|
|
|
|
|
const submitLoading = ref(false)
|
|
const submitLoading = ref(false)
|
|
const submit = async () => {
|
|
const submit = async () => {
|
|
- const obj = await getValue()
|
|
|
|
- if (!obj) return
|
|
|
|
- submitLoading.value = true
|
|
|
|
- await saveResumeInfo(obj)
|
|
|
|
- dialogType = 'submitSuccess'
|
|
|
|
- dialogContent.value = '提交成功,立即前往在线简历查看'
|
|
|
|
- showClose.value = false
|
|
|
|
- confirmRef.value.open()
|
|
|
|
- // await useUserStore().getUserBaseInfos() // 更新用户信息
|
|
|
|
|
|
+ try {
|
|
|
|
+ const obj = await getValue()
|
|
|
|
+ if (!obj) return
|
|
|
|
+ submitLoading.value = true
|
|
|
|
+ uni.showLoading({ title: '提交中' })
|
|
|
|
+ await saveResumeInfo(obj)
|
|
|
|
+ await useUserStore.getInfo()
|
|
|
|
+ uni.hideLoading()
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ uni.showToast({ title: '提交成功', icon: 'success', duration: 2000 })
|
|
|
|
+ }, 500)
|
|
|
|
+ uni.navigateTo({ url: '/pagesA/resumeOnline/index' })
|
|
|
|
+ } catch (error) {
|
|
|
|
+ console.log('saveResumeInfoError:', error)
|
|
|
|
+ } finally {
|
|
|
|
+ submitLoading.value = false
|
|
|
|
+ uni.hideLoading()
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
</script>
|
|
</script>
|