Explorar o código

个人资料编辑

zhengnaiwen_citu hai 7 meses
pai
achega
abe4357c57

+ 11 - 6
api/resume.js

@@ -1,12 +1,17 @@
 import request from "@/utils/request"
 
 // 保存基本信息
-// export const saveResumeBasicInfo = async (data) => {
-//   return await request.post({
-//     url: '/app-api/menduner/system/person/resume/info/save',
-//     data
-//   })
-// }
+export const saveResumeBasicInfo = async (data) => {
+  return request({
+    url: '/app-api/menduner/system/person/resume/info/save',
+    method: 'POST',
+    data,
+    custom: {
+      showLoading: false,
+      auth: true
+    }
+  })
+}
 
 // // 保存个人优势
 // export const saveResumeAdvantage = async (data) => {

+ 1 - 1
hooks/useDictionaries.js

@@ -24,7 +24,7 @@ export const getDict = (type, params, apiType = 'dict') => {
     return new Promise((resolve) => {
       const item = uni.getStorageSync(type)
       const catchData = item ? JSON.parse(item) : null
-      if (catchData && catchData.expire && (Date.now() <= catchData.expire) && catchData.data) {
+      if (catchData && catchData.expire && (Date.now() <= catchData.expire) && catchData.data && catchData.data?.data?.length) {
         return resolve({ data: catchData.data })
       }
       // 传参按照规范参数传

+ 0 - 1
hooks/useIM.js

@@ -212,7 +212,6 @@ export const useIM = () => {
 
   async function resetConfig () {
     const { uid, wssUrl, token } = await getKey()
-    console.log(uid, wssUrl, token)
     IM.setUid(uid)
     // 单机模式可以直接设置地址
     WKSDK.shared().config.addr = 'wss://' + wssUrl// 默认端口为5200 + wsUrl 

+ 6 - 0
pages.json

@@ -48,6 +48,12 @@
 						"navigationBarTitleText": "在线简历"
 					}
 				},
+				{
+					"path": "resumeOnline/baseInfoEdit",
+					"style": {
+						"navigationBarTitleText": "个人信息"
+					}
+				},
 				{
 					"path": "resume/index",
 					"style": {

+ 12 - 0
pagesA/resumeOnline/baseInfoEdit.vue

@@ -0,0 +1,12 @@
+<template>
+  <Info></Info>
+</template>
+
+<script setup>
+import Info from '@/pagesA/info/index'
+
+</script>
+
+<style lang="scss" scoped>
+
+</style>

+ 95 - 0
pagesA/resumeOnline/dict.js

@@ -0,0 +1,95 @@
+import { reactive } from 'vue'
+import { getDict } from '@/hooks/useDictionaries'
+
+const dictObj = reactive({})
+const dictList = [
+  { 
+    type: 'positionData', 
+    apiType: 'positionData', 
+    key: 'positionId', 
+    label: 'position', 
+    value: 'positionTypeData', 
+    itemKey: 'id', 
+    itemText: 'nameCn'
+  },
+  { 
+    type: 'industryList', 
+    apiType: 'industryList', 
+    key: 'industryIdList', 
+    label: 'industry', 
+    isArray: true, 
+    value: 'industryTypeData', 
+    itemKey: 'id', 
+    itemText: 'nameCn' 
+  },
+  { 
+    type: 'menduner_area_type',
+    apiType: 'areaList',
+    key: 'workAreaId',
+    params: { type: undefined },
+    label: 'workArea',
+    value: 'areaTypeData',
+    itemKey: 'id',
+    itemText: 'name'
+  },
+  { 
+    type: 'menduner_job_type',
+    key: 'jobType',
+    label: 'jobTypeName',
+    value: 'jobTypeData',
+    itemKey: 'value',
+    itemText: 'label'
+  },
+  { 
+    type: 'menduner_area_type', 
+    apiType: 'areaList', 
+    key: 'interestedAreaIdList', 
+    label: 'interestedArea', 
+    params: { type: undefined },
+    isArray: true, 
+    value: 'areaTypeData', 
+    itemKey: 'id', 
+    itemText: 'name' 
+  }
+]
+
+// 字典
+const getDictList = async () => {
+  dictList.forEach(async (val) => {
+    const { data } = await getDict(val.type, val.params, val.apiType)
+    console.log(val.type, val.params, val.apiType,data)
+    if (!data?.data) {
+      dictObj[val.value] = []
+      return
+    }
+    dictObj[val.value] = data.data
+  })
+}
+
+const getData = async () => {
+  await getDictList()
+}
+getData()
+
+export const dealJobData = (list) => {
+  let res = {}
+  dictList.forEach(item => {
+    res = list.map(e => {
+      let obj = {}
+      if (item.isArray) {
+        if (e[item.key] && e[item.key].length) {
+          const result = e[item.key].map(val => {
+            return obj = dictObj[item.value].find(i => i[item.itemKey] === val)
+          })
+          e[item.label] = result && result.length ? result.filter(Boolean) : []
+        }
+      } else {
+        obj = dictObj[item.value].find(k => Number(k[item.itemKey]) === Number(e[item.key]))
+        if (!obj) return
+        e[item.label] = obj[item.itemText]
+      }
+      return e
+    })
+  })
+  return res
+}

+ 127 - 19
pagesA/resumeOnline/index.vue

@@ -1,6 +1,6 @@
 <template>
-  <view>
-    <view class="baseInfo borderLine">
+  <layout-page>
+    <view class="baseInfo borderLine" @tap="handleTo('baseInfoEdit')">
       <view>
         <view class="baseInfo-name">
           <text class="name title">{{ baseInfo.name }}</text>
@@ -11,6 +11,7 @@
             size="20"
           ></uni-icons>
         </view>
+        <view class="baseInfo-desc">{{ baseInfo.jobStatusText }}</view>
         <view class="baseInfo-desc">{{ baseInfo.expTypeText }} - {{ baseInfo.age }}岁 - {{ baseInfo.eduTypeText }}</view>
         <view class="baseInfo-phone">
           <uni-icons
@@ -29,7 +30,7 @@
         />
       </view>
     </view>
-    <view class="characteristic">
+    <view class="characteristic borderLine">
       <view class="titleBox">
         <text class="title">个人画像</text>
         <uni-icons
@@ -49,15 +50,6 @@
         </view>
       </view>
     </view>
-    <view>
-      <uni-list>
-        <uni-list-item showArrow :rightText="baseInfo.jobStatusText">
-          <template v-slot:body>
-            <view class="title flex-1 soloHeight">求职状态</view>
-          </template>
-        </uni-list-item>
-      </uni-list>
-    </view>
     <view class="advantage borderLine">
       <view class="titleBox">
         <text class="title">个人优势</text>
@@ -68,7 +60,7 @@
           size="18"
         ></uni-icons>
       </view>
-      <view class="ellipsis-2 text">{{ baseInfo.advantage }}</view>
+      <view class="ellipsis-2 text px-20">{{ baseInfo.advantage ? baseInfo.advantage : '请填写您的个人优势...' }}</view>
     </view>
     <view class="intention borderLine">
       <view class="titleBox">
@@ -82,6 +74,28 @@
       </view>
       <view class="content">
         <view class="text" v-if="!intention.length">请填写您的求职意向...</view>
+        <uni-list :border="false">
+          <uni-list-item
+            v-for="int in intention"
+            :key="int.id"
+            :border="false"
+            showArrow
+          >
+            <template v-slot:body>
+              <view class="item">
+                <view class="item-title">{{ int.jobTypeName}}</view>
+                <view>
+                  <text class="mr-20">{{ int.position}}</text>
+                  <text>{{ int.payFrom }} {{ int.payFrom  && int.payTo ? '-' : ''}} {{ int.payTo}}</text>
+                </view>
+                <view>{{ int.workArea }}</view>
+                <view class="item-tags">
+                  <view v-for="industry in int.industry" :key="industry.id" class="tag">{{ industry.nameCn }}</view>
+                </view>
+              </view>
+            </template>
+          </uni-list-item>
+        </uni-list>
       </view>
     </view>
     <view class="educationExp borderLine">
@@ -227,7 +241,34 @@
         </view>
       </view>
     </view>
-  </view>
+      <view class="popup">
+        <view class="popup-title">
+          <text class="title">求职状态</text>
+          <uni-icons
+            type="closeempty"
+            size="24"
+          />
+        </view>
+        <view class="popup-content">
+          <view
+            v-for="status in jobStatusList"
+            :key="status.id"
+            class="box"
+            :class="{ active: jobStatusCheck === status.value }"
+            @tap="handleChangeJobStatus(status.value)"
+          >
+            <text>{{ status.label }}</text>
+            <uni-icons
+              v-if="jobStatusCheck === status.value"
+              type="checkmarkempty"
+              color="#008978"
+              size="24"
+            />
+          </view>
+        </view>
+      </view>
+
+  </layout-page>
 </template>
 
 <script setup>
@@ -244,11 +285,11 @@ import {
 import { getText } from '@/utils/getText'
 import { getDict } from '@/hooks/useDictionaries'
 import { userStore } from '@/store/user'
+import { dealJobData } from './dict'
 
 const useUserStore = userStore()
 
 const baseInfo = ref({})
-
 const intention = ref([])
 const educationExp = ref([])
 const workExp = ref([])
@@ -256,6 +297,13 @@ const projectExp = ref([])
 const trainExp = ref([])
 const skillExp = ref([])
 
+function handleTo (str) {
+  uni.navigateTo({ url: `/pagesA/resumeOnline/${str}` })
+}
+
+
+
+
 // 获取基础信息
 function getBaseInfo () {
   const { name, phone, ...obj } = useUserStore.baseInfo
@@ -276,8 +324,7 @@ async function getJobInterested () {
   // 完成度展示
   // emit('complete', { status: Boolean(data?.length), id: 'jobIntention' })
   // if (!data.length) return
-  // interestList.value = data
-  // interestList.value = dealJobData(data)
+  intention.value = dealJobData(data)
 }
 
 // 获取教育经历
@@ -362,7 +409,7 @@ async function getSkillExpData () {
 
   const { data: _skillLevelArr } = await getDict('menduner_skill_level')
   const skillLevelArr = _skillLevelArr?.data
-    if (!skillLevelArr || !skillLevelArr.length) {
+  if (!skillLevelArr || !skillLevelArr.length) {
     return
   }
 
@@ -378,9 +425,10 @@ async function getSkillExpData () {
       title: `${getText(e.skillId, skillList, 'nameCn', 'id')} / ${getText(e.level, skillLevelArr)}`
     }
   })
-  console.log(skillExp.value)
 }
 
+// 求职状态字典
+// getJobStatus()
 // 获取基础信息
 getBaseInfo()
 // 获取求职意向
@@ -418,6 +466,9 @@ $px: 30rpx;
   padding-right: 20rpx;
   box-sizing: border-box;
 }
+.mr-20 {
+  margin-right: 20rpx;
+}
 .ellipsis-2 {
   overflow: hidden;
   display: -webkit-box;
@@ -525,4 +576,61 @@ $px: 30rpx;
     }
   }
 }
+.intention {
+  .content {
+    .item {
+      font-size: 28rpx;
+      color: #666;
+      &-title {
+        color: #000;
+        font-weight: 600;
+      }
+      &-tags {
+        display: flex;
+        .tag {
+          border: 2rpx solid #008978;
+          color: #008978;
+          padding: 4rpx 16rpx;
+          font-size: 24rpx;
+          margin: 10rpx 10rpx 0 0;
+          border-radius: 10rpx;
+        }
+      }
+    }
+  }
+}
+
+
+.popup {
+  padding: $px;
+  padding-bottom: 100rpx;
+  &-title {
+    width: 100%;
+    display: flex;
+    justify-content: space-between;
+    margin-bottom: $px;
+    font-size: 24rpx;
+    .title {
+      font-size: 36rpx;
+    }
+  }
+  &-content {
+    .box {
+      display: flex;
+      justify-content: space-between;
+      border-bottom: 2rpx solid #eee;
+      padding: $px 0;
+      font-size: 30rpx;
+      font-weight: 500;
+      color: #000;
+      &:last-of-type {
+        border-bottom: none;
+      }
+      &.active {
+        color: #008978;
+        font-weight: 600;
+      }
+    }
+  }
+}
 </style>