Browse Source

简历完成度

lifanagju_citu 6 tháng trước cách đây
mục cha
commit
54e6bc68ad
1 tập tin đã thay đổi với 23 bổ sung13 xóa
  1. 23 13
      pagesA/resumeOnline/index.vue

+ 23 - 13
pagesA/resumeOnline/index.vue

@@ -1,6 +1,16 @@
 <template>
   <layout-page>
     <!-- 基本信息 -->
+    <view class="progress-box">
+      <view>简历完成度</view>
+      <progress
+        :percent="Number.isInteger(completeNum/7*100) ? (completeNum/7*100) : (completeNum/7*100).toFixed(2)"
+        show-info
+        border-radius="50"
+        activeColor="#00897B"
+        stroke-width="8"
+      />
+    </view>
     <view class="baseInfo borderLine" @tap="handleTo('baseInfoEdit')">
       <view>
         <view class="baseInfo-name">
@@ -259,6 +269,8 @@ const educationExp = ref([])
 const workExp = ref([])
 const trainExp = ref([])
 const skillExp = ref([])
+// 简历完成度
+const completeNum = ref(0)
 
 function handleTo (str, id) {
   uni.navigateTo({ url: id ? `/pagesA/resumeOnline/${str}?id=${id}` : `/pagesA/resumeOnline/${str}` })
@@ -273,6 +285,8 @@ function getBaseInfo () {
     phone: phone ? phone : useUserStore.userInfo.phone,
     age: obj.birthday ? getAgeByBirthdayTimestamp(obj.birthday) : 0
   }
+  if (useUserStore.userInfo && Object.keys(useUserStore.userInfo).length) completeNum.value++
+  if (baseInfo.value?.advantage ) completeNum.value++
 }
 
 // 获取求职意向
@@ -281,9 +295,7 @@ async function getJobInterested () {
   if (!data || !data.length) {
     return
   }
-  // 完成度展示
-  // emit('complete', { status: Boolean(data?.length), id: 'jobIntention' })
-  // if (!data.length) return
+  completeNum.value++ // 完成度展示
   intention.value = dealJobData(data)
 }
 
@@ -297,6 +309,7 @@ async function getEduExp () {
   if (!data || !data.length) {
     return
   }
+  completeNum.value++ // 完成度展示
   educationExp.value = data.map(e => {
     const item = dict.data.find(_e => _e.value === e.educationType)
     return {
@@ -305,9 +318,6 @@ async function getEduExp () {
       time: `${timesTampChange(e.startTime ,'Y-M')}-${timesTampChange(e.endTime ,'Y-M')} `
     }
   })
-  // 完成度展示
-  // emit('complete', { status: Boolean(data?.length), id: 'educationExp' })
-  // dataList.value = data
 }
 
 // 获取工作经验
@@ -316,9 +326,7 @@ async function getWorkExp () {
   if (!data || !data.length) {
     return
   }
-  // console.log(data)
-  // 完成度展示
-  // emit('complete', { status: Boolean(data?.length), id: 'workExperience' })
+  completeNum.value++ // 完成度展示
   workExp.value = data.map(e => {
     return {
       ...e,
@@ -333,8 +341,7 @@ async function getTrainExpData () {
   if (!data || !data.length) {
     return
   }
-  // 完成度展示
-  // emit('complete', { status: Boolean(data?.length), id: 'trainingExperience' })
+  completeNum.value++ // 完成度展示
   trainExp.value = data.map(e => {
     return {
       ...e,
@@ -351,6 +358,7 @@ async function getSkillExpData () {
     return
   }
 
+  completeNum.value++ // 完成度展示
   const { data: _skillLevelArr } = await getDict('menduner_skill_level')
   const skillLevelArr = _skillLevelArr?.data
   if (!skillLevelArr || !skillLevelArr.length) {
@@ -361,8 +369,6 @@ async function getSkillExpData () {
   if (!data || !data.length) {
     return
   }
-  // 完成度展示
-  // emit('complete', { status: Boolean(data?.length), id: 'vocationalSkills' })
   skillExp.value = data.map(e => {
     return {
       ...e,
@@ -372,6 +378,7 @@ async function getSkillExpData () {
 }
 
 onShow(() => {
+  completeNum.value = 0
   // 获取基础信息
   getBaseInfo()
   // 获取求职意向
@@ -392,6 +399,9 @@ $px: 30rpx;
 .borderLine {
   border-bottom: 2rpx solid #f5f5f5;
 }
+.progress-box {
+  padding: 20rpx $px;
+}
 .title {
   font-size: 40rpx;
   font-weight: 600;