=【职业图谱】
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<!--suppress HtmlUnknownTag, NpmUsedModulesInstalled, JSFileReferences -->
|
||||
<script setup>
|
||||
import { ref, inject, nextTick, onMounted } from 'vue';
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app';
|
||||
import { inject, nextTick, onMounted, ref } from 'vue';
|
||||
import { onShow } from '@dcloudio/uni-app';
|
||||
import { appUserInfo } from '@/apiRc/user/user.js';
|
||||
import RemindPopup from './components/RemindPopup.vue';
|
||||
import PageHeader from './components/PageHeader.vue';
|
||||
@@ -10,6 +10,9 @@ import CareerRecommend from './components/CareerRecommend.vue';
|
||||
import CareerPath from './components/CareerPath.vue';
|
||||
import SkillDevelopment from './components/SkillDevelopment.vue';
|
||||
import CustomTabBar from '@/components/CustomTabBar/CustomTabBar.vue';
|
||||
import { appToken } from '../../apiRc/user/user';
|
||||
import { setToken } from '../../utilsRc/auth';
|
||||
|
||||
|
||||
const { navBack, navTo } = inject('globalFunction');
|
||||
|
||||
@@ -29,7 +32,6 @@ const selectedJobImprovementSkills = ref([]);
|
||||
const currentJobId = ref(null);
|
||||
const currentJobName = ref('');
|
||||
|
||||
|
||||
const pathSkillsData = ref({
|
||||
pathData: {
|
||||
start: { title: '', skills: [] },
|
||||
@@ -87,6 +89,14 @@ async function getRemindInfo() {
|
||||
|
||||
hasCheckedRemindInfo = true;
|
||||
|
||||
try {
|
||||
const t = uni.getStorageSync('token');
|
||||
const { token } = await appToken(t);
|
||||
setToken(token);
|
||||
} catch (e) {
|
||||
console.warn(e);
|
||||
}
|
||||
|
||||
try {
|
||||
const response = await appUserInfo();
|
||||
const userInfo = response?.data || {};
|
||||
@@ -141,11 +151,11 @@ async function getRemindInfo() {
|
||||
if (!hasSkills) {
|
||||
missingItems.push('技能标签');
|
||||
}
|
||||
remindList.value = [`请完善${missingItems.join('、')}`];
|
||||
remindList.value = [ `请完善${ missingItems.join('、') }` ];
|
||||
} else {
|
||||
// 信息完整,设置职位信息
|
||||
if (hasJobTitle) {
|
||||
currentJobName.value = jobTitles[0];
|
||||
currentJobName.value = jobTitles[ 0 ];
|
||||
} else {
|
||||
currentJobName.value = jobName;
|
||||
currentJobId.value = userInfo?.jobId ??
|
||||
@@ -209,11 +219,11 @@ async function getRemindInfo() {
|
||||
if (!hasSkills) {
|
||||
missingItems.push('技能标签');
|
||||
}
|
||||
remindList.value = [`请完善${missingItems.join('、')}`];
|
||||
remindList.value = [ `请完善${ missingItems.join('、') }` ];
|
||||
} else {
|
||||
// 信息完整,设置职位信息
|
||||
if (hasJobTitle) {
|
||||
currentJobName.value = cachedJobTitles[0];
|
||||
currentJobName.value = cachedJobTitles[ 0 ];
|
||||
} else {
|
||||
currentJobName.value = jobName;
|
||||
currentJobId.value = cachedUserInfo?.jobId ??
|
||||
@@ -276,7 +286,7 @@ function switchTab(index) {
|
||||
let newJobName = '';
|
||||
|
||||
if (cachedJobTitles.length > 0) {
|
||||
newJobName = cachedJobTitles[0];
|
||||
newJobName = cachedJobTitles[ 0 ];
|
||||
} else {
|
||||
// 如果缓存中没有 jobTitles,从其他字段获取
|
||||
newJobName = currentJobName.value ||
|
||||
@@ -325,10 +335,6 @@ function handlePathDataUpdated(data) {
|
||||
};
|
||||
}
|
||||
|
||||
onLoad(() => {
|
||||
getRemindInfo();
|
||||
});
|
||||
|
||||
onShow(() => {
|
||||
// 返回本页后,如果之前因为信息缺失未展示内容,则重新检查
|
||||
if (!showContent.value) {
|
||||
@@ -349,52 +355,36 @@ onMounted(() => {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="career-planning-page">
|
||||
<!-- 提醒弹窗 -->
|
||||
<RemindPopup
|
||||
ref="remindPopup"
|
||||
:remind-list="remindList"
|
||||
@cancel="handleCancel"
|
||||
@confirm="handleConfirm"
|
||||
/>
|
||||
<div class="career-planning-page">
|
||||
<!-- 提醒弹窗 -->
|
||||
<RemindPopup ref="remindPopup" :remind-list="remindList" @cancel="handleCancel" @confirm="handleConfirm" />
|
||||
|
||||
<!-- 技能详情弹出层 -->
|
||||
<SkillDetailPopup
|
||||
ref="skillDetailPopup"
|
||||
:job-title="selectedJobTitle"
|
||||
:possessed-skills="selectedJobPossessedSkills"
|
||||
:improvement-skills="selectedJobImprovementSkills"
|
||||
/>
|
||||
<!-- 技能详情弹出层 -->
|
||||
<SkillDetailPopup ref="skillDetailPopup" :improvement-skills="selectedJobImprovementSkills" :job-title="selectedJobTitle" :possessed-skills="selectedJobPossessedSkills" />
|
||||
|
||||
<!-- 页面内容 -->
|
||||
<div class="page-content" v-if="showContent">
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<!-- 小程序背景图片 -->
|
||||
<image class="mp-background" src="/static/icon/background2.png" mode="aspectFill"></image>
|
||||
<!-- #endif -->
|
||||
<!-- 页面内容 -->
|
||||
<div v-if="showContent" class="page-content">
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<!-- 小程序背景图片 -->
|
||||
<image class="mp-background" mode="aspectFill" src="/static/icon/background2.png"></image>
|
||||
<!-- #endif -->
|
||||
|
||||
<!-- 头部区域 -->
|
||||
<PageHeader
|
||||
:active-tab="activeTab"
|
||||
@tab-change="switchTab"
|
||||
@search-click="handleSearchClick"
|
||||
@menu-click="handleMenuClick"
|
||||
@more-click="handleMoreClick"
|
||||
/>
|
||||
<!-- 头部区域 -->
|
||||
<PageHeader :active-tab="activeTab" @tab-change="switchTab" @search-click="handleSearchClick" @menu-click="handleMenuClick" @more-click="handleMoreClick" />
|
||||
|
||||
<!-- 内容区域 -->
|
||||
<scroll-view scroll-y class="content-scroll">
|
||||
<CareerRecommend v-if="activeTab === 0"/>
|
||||
<CareerPath v-else-if="activeTab === 1" />
|
||||
<SkillDevelopment v-else />
|
||||
</scroll-view>
|
||||
</div>
|
||||
|
||||
<!-- 底部导航栏 -->
|
||||
<div class="tabbar-wrapper" v-if="showContent">
|
||||
<CustomTabBar :currentPage="0" />
|
||||
</div>
|
||||
<!-- 内容区域 -->
|
||||
<scroll-view class="content-scroll" scroll-y>
|
||||
<CareerRecommend v-if="activeTab === 0" />
|
||||
<CareerPath v-else-if="activeTab === 1" />
|
||||
<SkillDevelopment v-else />
|
||||
</scroll-view>
|
||||
</div>
|
||||
|
||||
<!-- 底部导航栏 -->
|
||||
<div v-if="showContent" class="tabbar-wrapper">
|
||||
<CustomTabBar :currentPage="0" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="scss">
|
||||
@@ -484,6 +474,7 @@ onMounted(() => {
|
||||
height: 728rpx;
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
/* #endif */
|
||||
|
||||
.page-content {
|
||||
@@ -495,7 +486,6 @@ onMounted(() => {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
|
||||
.content-scroll {
|
||||
flex: 1;
|
||||
height: 0;
|
||||
|
||||
@@ -78,7 +78,7 @@ export const useCareerRecommendationStore = defineStore('career-recommendation',
|
||||
const fetchData = async () => {
|
||||
try {
|
||||
const { code, msg, data } = await getProfessions();
|
||||
if (code !== 0) {
|
||||
if (code !== 200) {
|
||||
uni.showToast({
|
||||
title: msg,
|
||||
icon: 'none'
|
||||
|
||||
@@ -26,7 +26,7 @@ const request = config => {
|
||||
const isZytpApi = baseType === 'zytp'
|
||||
// 从存储中获取微信登录的 token
|
||||
const token = getToken()
|
||||
if (token && !isToken && !isZytpApi) {
|
||||
if (token && !isToken) {
|
||||
// config.header['Authorization'] = 'Bearer ' + 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJsb2dpblR5cGUiOiJsb2dpbiIsImxvZ2luSWQiOiJzeXNfdXNlcjoxIiwicm5TdHIiOiJhb0Y4RmJPQWJ6ZVA3NlpzaENyM0tPSEZTbU85U0ZhViIsInVzZXJJZCI6MX0.kPEDm7D8eVvFlwAiUiE57evWaCX5EcSEOq-LEYGTm9Q'
|
||||
config.header['Authorization'] = 'Bearer ' + token
|
||||
}
|
||||
@@ -47,7 +47,7 @@ const request = config => {
|
||||
requestUrl += (requestUrl.includes('?') ? '&' : '?') + url
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 如果是 getJobPathById 接口,打印完整 URL(调试用,生产环境可注释)
|
||||
// if (config.url && config.url.includes('getJobPathById')) {
|
||||
// console.log('[请求URL] getJobPathById 完整请求URL:', requestUrl);
|
||||
@@ -55,7 +55,7 @@ const request = config => {
|
||||
// console.log('[请求URL] 接口路径:', config.url);
|
||||
// console.log('[请求URL] 请求参数:', config.params);
|
||||
// }
|
||||
|
||||
|
||||
// 如果是 recommendJob 接口,打印详细信息(调试用,生产环境可注释)
|
||||
// if (config.url && config.url.includes('recommendJob')) {
|
||||
// console.log('[请求URL] recommendJob 完整请求URL:', requestUrl);
|
||||
@@ -66,7 +66,7 @@ const request = config => {
|
||||
// console.log('[请求URL] 请求数据 (data):', config.data);
|
||||
// console.log('[请求URL] Content-Type:', config.header?.['content-type']);
|
||||
// }
|
||||
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.request({
|
||||
method: config.method || 'get',
|
||||
|
||||
Reference in New Issue
Block a user