Compare commits
11 Commits
b4ff618477
...
yxl
| Author | SHA1 | Date | |
|---|---|---|---|
| e6e1b6ada1 | |||
| c4e1f7585a | |||
| 6153e9e38b | |||
| 65dea06316 | |||
| 30b5caf87b | |||
| d42128be8b | |||
| d15765973a | |||
| 2e40eec875 | |||
| 9a09edf54c | |||
| 8578c96931 | |||
| 4faaedcbbd |
@@ -3,7 +3,21 @@
|
|||||||
* @LastEditors: shirlwang
|
* @LastEditors: shirlwang
|
||||||
* @LastEditTime: 2025-12-16 16:35:06
|
* @LastEditTime: 2025-12-16 16:35:06
|
||||||
*/
|
*/
|
||||||
import { createRequest } from '../../utils/request';
|
import request from '@/utilsRc/request'
|
||||||
|
import { createRequest } from '@/utils/request';
|
||||||
|
|
||||||
|
// 获取职业图谱token
|
||||||
|
export function appToken(token) {
|
||||||
|
return request({
|
||||||
|
url: '/loginByToken',
|
||||||
|
method: 'post',
|
||||||
|
data: {
|
||||||
|
token,
|
||||||
|
loginWay: '2'
|
||||||
|
},
|
||||||
|
baseUrlType: 'zytp'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// 获取用户信息(职业规划推荐用)
|
// 获取用户信息(职业规划推荐用)
|
||||||
export function appUserInfo() {
|
export function appUserInfo() {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<!--suppress HtmlUnknownTag, NpmUsedModulesInstalled, JSFileReferences -->
|
<!--suppress HtmlUnknownTag, NpmUsedModulesInstalled, JSFileReferences -->
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, inject, nextTick, onMounted } from 'vue';
|
import { inject, nextTick, onMounted, ref } from 'vue';
|
||||||
import { onLoad, onShow } from '@dcloudio/uni-app';
|
import { onShow } from '@dcloudio/uni-app';
|
||||||
import { appUserInfo } from '@/apiRc/user/user.js';
|
import { appUserInfo } from '@/apiRc/user/user.js';
|
||||||
import RemindPopup from './components/RemindPopup.vue';
|
import RemindPopup from './components/RemindPopup.vue';
|
||||||
import PageHeader from './components/PageHeader.vue';
|
import PageHeader from './components/PageHeader.vue';
|
||||||
@@ -10,6 +10,9 @@ import CareerRecommend from './components/CareerRecommend.vue';
|
|||||||
import CareerPath from './components/CareerPath.vue';
|
import CareerPath from './components/CareerPath.vue';
|
||||||
import SkillDevelopment from './components/SkillDevelopment.vue';
|
import SkillDevelopment from './components/SkillDevelopment.vue';
|
||||||
import CustomTabBar from '@/components/CustomTabBar/CustomTabBar.vue';
|
import CustomTabBar from '@/components/CustomTabBar/CustomTabBar.vue';
|
||||||
|
import { appToken } from '@/apiRc/user/user';
|
||||||
|
import { setToken } from '@/utilsRc/auth';
|
||||||
|
|
||||||
|
|
||||||
const { navBack, navTo } = inject('globalFunction');
|
const { navBack, navTo } = inject('globalFunction');
|
||||||
|
|
||||||
@@ -29,7 +32,6 @@ const selectedJobImprovementSkills = ref([]);
|
|||||||
const currentJobId = ref(null);
|
const currentJobId = ref(null);
|
||||||
const currentJobName = ref('');
|
const currentJobName = ref('');
|
||||||
|
|
||||||
|
|
||||||
const pathSkillsData = ref({
|
const pathSkillsData = ref({
|
||||||
pathData: {
|
pathData: {
|
||||||
start: { title: '', skills: [] },
|
start: { title: '', skills: [] },
|
||||||
@@ -87,6 +89,14 @@ async function getRemindInfo() {
|
|||||||
|
|
||||||
hasCheckedRemindInfo = true;
|
hasCheckedRemindInfo = true;
|
||||||
|
|
||||||
|
try {
|
||||||
|
const t = uni.getStorageSync('token');
|
||||||
|
const { token } = await appToken(t);
|
||||||
|
uni.setStorageSync('cryptogram', token);
|
||||||
|
} catch (e) {
|
||||||
|
console.warn(e);
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await appUserInfo();
|
const response = await appUserInfo();
|
||||||
const userInfo = response?.data || {};
|
const userInfo = response?.data || {};
|
||||||
@@ -141,11 +151,11 @@ async function getRemindInfo() {
|
|||||||
if (!hasSkills) {
|
if (!hasSkills) {
|
||||||
missingItems.push('技能标签');
|
missingItems.push('技能标签');
|
||||||
}
|
}
|
||||||
remindList.value = [`请完善${missingItems.join('、')}`];
|
remindList.value = [ `请完善${ missingItems.join('、') }` ];
|
||||||
} else {
|
} else {
|
||||||
// 信息完整,设置职位信息
|
// 信息完整,设置职位信息
|
||||||
if (hasJobTitle) {
|
if (hasJobTitle) {
|
||||||
currentJobName.value = jobTitles[0];
|
currentJobName.value = jobTitles[ 0 ];
|
||||||
} else {
|
} else {
|
||||||
currentJobName.value = jobName;
|
currentJobName.value = jobName;
|
||||||
currentJobId.value = userInfo?.jobId ??
|
currentJobId.value = userInfo?.jobId ??
|
||||||
@@ -209,11 +219,11 @@ async function getRemindInfo() {
|
|||||||
if (!hasSkills) {
|
if (!hasSkills) {
|
||||||
missingItems.push('技能标签');
|
missingItems.push('技能标签');
|
||||||
}
|
}
|
||||||
remindList.value = [`请完善${missingItems.join('、')}`];
|
remindList.value = [ `请完善${ missingItems.join('、') }` ];
|
||||||
} else {
|
} else {
|
||||||
// 信息完整,设置职位信息
|
// 信息完整,设置职位信息
|
||||||
if (hasJobTitle) {
|
if (hasJobTitle) {
|
||||||
currentJobName.value = cachedJobTitles[0];
|
currentJobName.value = cachedJobTitles[ 0 ];
|
||||||
} else {
|
} else {
|
||||||
currentJobName.value = jobName;
|
currentJobName.value = jobName;
|
||||||
currentJobId.value = cachedUserInfo?.jobId ??
|
currentJobId.value = cachedUserInfo?.jobId ??
|
||||||
@@ -276,7 +286,7 @@ function switchTab(index) {
|
|||||||
let newJobName = '';
|
let newJobName = '';
|
||||||
|
|
||||||
if (cachedJobTitles.length > 0) {
|
if (cachedJobTitles.length > 0) {
|
||||||
newJobName = cachedJobTitles[0];
|
newJobName = cachedJobTitles[ 0 ];
|
||||||
} else {
|
} else {
|
||||||
// 如果缓存中没有 jobTitles,从其他字段获取
|
// 如果缓存中没有 jobTitles,从其他字段获取
|
||||||
newJobName = currentJobName.value ||
|
newJobName = currentJobName.value ||
|
||||||
@@ -325,10 +335,6 @@ function handlePathDataUpdated(data) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
onLoad(() => {
|
|
||||||
getRemindInfo();
|
|
||||||
});
|
|
||||||
|
|
||||||
onShow(() => {
|
onShow(() => {
|
||||||
// 返回本页后,如果之前因为信息缺失未展示内容,则重新检查
|
// 返回本页后,如果之前因为信息缺失未展示内容,则重新检查
|
||||||
if (!showContent.value) {
|
if (!showContent.value) {
|
||||||
@@ -349,52 +355,36 @@ onMounted(() => {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="career-planning-page">
|
<div class="career-planning-page">
|
||||||
<!-- 提醒弹窗 -->
|
<!-- 提醒弹窗 -->
|
||||||
<RemindPopup
|
<RemindPopup ref="remindPopup" :remind-list="remindList" @cancel="handleCancel" @confirm="handleConfirm" />
|
||||||
ref="remindPopup"
|
|
||||||
:remind-list="remindList"
|
|
||||||
@cancel="handleCancel"
|
|
||||||
@confirm="handleConfirm"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<!-- 技能详情弹出层 -->
|
<!-- 技能详情弹出层 -->
|
||||||
<SkillDetailPopup
|
<SkillDetailPopup ref="skillDetailPopup" :improvement-skills="selectedJobImprovementSkills" :job-title="selectedJobTitle" :possessed-skills="selectedJobPossessedSkills" />
|
||||||
ref="skillDetailPopup"
|
|
||||||
:job-title="selectedJobTitle"
|
|
||||||
:possessed-skills="selectedJobPossessedSkills"
|
|
||||||
:improvement-skills="selectedJobImprovementSkills"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<!-- 页面内容 -->
|
<!-- 页面内容 -->
|
||||||
<div class="page-content" v-if="showContent">
|
<div v-if="showContent" class="page-content">
|
||||||
<!-- #ifdef MP-WEIXIN -->
|
<!-- #ifdef MP-WEIXIN -->
|
||||||
<!-- 小程序背景图片 -->
|
<!-- 小程序背景图片 -->
|
||||||
<image class="mp-background" src="/static/icon/background2.png" mode="aspectFill"></image>
|
<image class="mp-background" mode="aspectFill" src="/static/icon/background2.png"></image>
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
|
|
||||||
<!-- 头部区域 -->
|
<!-- 头部区域 -->
|
||||||
<PageHeader
|
<PageHeader :active-tab="activeTab" @tab-change="switchTab" @search-click="handleSearchClick" @menu-click="handleMenuClick" @more-click="handleMoreClick" />
|
||||||
:active-tab="activeTab"
|
|
||||||
@tab-change="switchTab"
|
|
||||||
@search-click="handleSearchClick"
|
|
||||||
@menu-click="handleMenuClick"
|
|
||||||
@more-click="handleMoreClick"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<!-- 内容区域 -->
|
<!-- 内容区域 -->
|
||||||
<scroll-view scroll-y class="content-scroll">
|
<scroll-view class="content-scroll" scroll-y>
|
||||||
<CareerRecommend v-if="activeTab === 0"/>
|
<CareerRecommend v-if="activeTab === 0" />
|
||||||
<CareerPath v-else-if="activeTab === 1" />
|
<CareerPath v-else-if="activeTab === 1" />
|
||||||
<SkillDevelopment v-else />
|
<SkillDevelopment v-else />
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 底部导航栏 -->
|
|
||||||
<div class="tabbar-wrapper" v-if="showContent">
|
|
||||||
<CustomTabBar :currentPage="0" />
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- 底部导航栏 -->
|
||||||
|
<div v-if="showContent" class="tabbar-wrapper">
|
||||||
|
<CustomTabBar :currentPage="0" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
@@ -484,6 +474,7 @@ onMounted(() => {
|
|||||||
height: 728rpx;
|
height: 728rpx;
|
||||||
z-index: 0;
|
z-index: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* #endif */
|
/* #endif */
|
||||||
|
|
||||||
.page-content {
|
.page-content {
|
||||||
@@ -495,7 +486,6 @@ onMounted(() => {
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.content-scroll {
|
.content-scroll {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
height: 0;
|
height: 0;
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ const store = useCareerRecommendationStore();
|
|||||||
<div v-for="(job, index) in store.result" :key="index" class="job-item-card">
|
<div v-for="(job, index) in store.result" :key="index" class="job-item-card">
|
||||||
<div class="job-header">
|
<div class="job-header">
|
||||||
<span class="job-title">{{ job.title }}</span>
|
<span class="job-title">{{ job.title }}</span>
|
||||||
|
<div class="job-search" @click="store.eventJobSearch(job)">职位搜索</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="job-header">
|
<div class="job-header">
|
||||||
<span>职业相似度:{{ job.percentage }}%</span>
|
<span>职业相似度:{{ job.percentage }}%</span>
|
||||||
@@ -157,6 +158,20 @@ const store = useCareerRecommendationStore();
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.job-search {
|
||||||
|
position: absolute;
|
||||||
|
top: 15rpx;
|
||||||
|
right: 15rpx;
|
||||||
|
padding: 6rpx 20rpx;
|
||||||
|
border-radius: 5px;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #333333;
|
||||||
|
background: #ffd4b8;
|
||||||
|
border: none;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: all 0.2s ease;
|
||||||
|
}
|
||||||
|
|
||||||
.job-skills {
|
.job-skills {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
|
|||||||
@@ -74,11 +74,16 @@ async function choosePosition(index) {
|
|||||||
getJobList('add');
|
getJobList('add');
|
||||||
}
|
}
|
||||||
|
|
||||||
onLoad(() => {
|
onLoad((query) => {
|
||||||
let arr = uni.getStorageSync('searchList');
|
let arr = uni.getStorageSync('searchList');
|
||||||
if (arr) {
|
if (arr) {
|
||||||
historyList.value = uni.getStorageSync('searchList');
|
historyList.value = uni.getStorageSync('searchList');
|
||||||
}
|
}
|
||||||
|
const {job} = query;
|
||||||
|
if (job) {
|
||||||
|
searchValue.value = job;
|
||||||
|
searchBtn();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
function changeType(type) {
|
function changeType(type) {
|
||||||
@@ -192,14 +197,14 @@ function dataToImg(data) {
|
|||||||
padding: 0 28rpx 28rpx 28rpx
|
padding: 0 28rpx 28rpx 28rpx
|
||||||
}
|
}
|
||||||
.Detailscroll-view{
|
.Detailscroll-view{
|
||||||
flex: 1
|
flex: 1;
|
||||||
overflow: hidden
|
overflow: hidden;
|
||||||
|
|
||||||
}
|
}
|
||||||
.container{
|
.container{
|
||||||
display: flex
|
display: flex;
|
||||||
flex-direction: column
|
flex-direction: column;
|
||||||
background: #F4f4f4
|
background: #F4f4f4;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
.custom-header {
|
.custom-header {
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
@@ -214,7 +219,7 @@ function dataToImg(data) {
|
|||||||
.top {
|
.top {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between
|
justify-content: space-between;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
padding: 20rpx 20rpx;
|
padding: 20rpx 20rpx;
|
||||||
.btnback{
|
.btnback{
|
||||||
@@ -224,11 +229,9 @@ function dataToImg(data) {
|
|||||||
.search-box{
|
.search-box{
|
||||||
flex: 1;
|
flex: 1;
|
||||||
padding: 0 24rpx 0 6rpx;
|
padding: 0 24rpx 0 6rpx;
|
||||||
position: relative
|
position: relative;
|
||||||
.inputed {
|
.inputed {
|
||||||
padding-left: 30rpx
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
background: #F8F8F8;
|
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
font-family: PingFang SC;
|
font-family: PingFang SC;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
@@ -241,9 +244,9 @@ function dataToImg(data) {
|
|||||||
border-radius: 75rpx 75rpx 75rpx 75rpx;
|
border-radius: 75rpx 75rpx 75rpx 75rpx;
|
||||||
}
|
}
|
||||||
.iconsearch{
|
.iconsearch{
|
||||||
position: absolute
|
position: absolute;
|
||||||
top: 50%
|
top: 50%;
|
||||||
left: 36rpx
|
left: 36rpx;
|
||||||
transform: translate(0, -50%)
|
transform: translate(0, -50%)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -258,14 +261,14 @@ function dataToImg(data) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
.main-content{
|
.main-content{
|
||||||
background: #FFFFFF
|
background: #FFFFFF;
|
||||||
height: 100%
|
height: 100%;
|
||||||
margin-top: 140rpx;
|
margin-top: 140rpx;
|
||||||
.content-top{
|
.content-top{
|
||||||
padding: 28rpx
|
padding: 28rpx;
|
||||||
display: flex
|
display: flex;
|
||||||
justify-content: space-between
|
justify-content: space-between;
|
||||||
align-items: center
|
align-items: center;
|
||||||
.top-left{
|
.top-left{
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
font-size: 36rpx;
|
font-size: 36rpx;
|
||||||
@@ -275,12 +278,12 @@ function dataToImg(data) {
|
|||||||
}
|
}
|
||||||
.content-history{
|
.content-history{
|
||||||
padding: 0 28rpx;
|
padding: 0 28rpx;
|
||||||
display: flex
|
display: flex;
|
||||||
flex-wrap: wrap
|
flex-wrap: wrap;
|
||||||
.history-tag{
|
.history-tag{
|
||||||
margin-right: 40rpx
|
margin-right: 40rpx;
|
||||||
margin-bottom: 20rpx
|
margin-bottom: 20rpx;
|
||||||
white-space: nowrap
|
white-space: nowrap;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
color: #333333;
|
color: #333333;
|
||||||
@@ -292,17 +295,17 @@ function dataToImg(data) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
.Detailscroll-view{
|
.Detailscroll-view{
|
||||||
flex: 1
|
flex: 1;
|
||||||
overflow: hidden
|
overflow: hidden;
|
||||||
margin-top: 140rpx;
|
margin-top: 140rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.slot-item
|
.slot-item {
|
||||||
// background: #f4f4f4;
|
// background: #f4f4f4;
|
||||||
background: #FFFFFF;
|
background: #FFFFFF;
|
||||||
.job-info{
|
.job-info{
|
||||||
padding: 10rpx 24rpx 24rpx 24rpx
|
padding: 10rpx 24rpx 24rpx 24rpx;
|
||||||
}
|
}
|
||||||
.job-image{
|
.job-image{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@@ -319,14 +322,14 @@ function dataToImg(data) {
|
|||||||
.cover-triangle{
|
.cover-triangle{
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 20rpx;
|
right: 20rpx;
|
||||||
top: 20rpx
|
top: 20rpx;
|
||||||
width: 36rpx
|
width: 36rpx;
|
||||||
height: 36rpx
|
height: 36rpx;
|
||||||
border-radius: 50%
|
border-radius: 50%;
|
||||||
background: rgba(0,0,0,0.3)
|
background: rgba(0,0,0,0.3);
|
||||||
}
|
}
|
||||||
.cover-triangle::after {
|
.cover-triangle::after {
|
||||||
content: '';
|
content: "";
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 50%;
|
top: 50%;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
@@ -338,26 +341,32 @@ function dataToImg(data) {
|
|||||||
border-bottom: 12rpx solid #fff;
|
border-bottom: 12rpx solid #fff;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.salary
|
.salary {
|
||||||
color: #4C6EFB;
|
color: #4C6EFB;
|
||||||
font-size: 28rpx
|
font-size: 28rpx;
|
||||||
display: flex
|
display: flex;
|
||||||
align-items: flex-start
|
align-items: flex-start;
|
||||||
justify-content: space-between
|
justify-content: space-between;
|
||||||
.flame
|
|
||||||
margin-top: 4rpx
|
.flame {
|
||||||
margin-right: 4rpx
|
margin-top: 4rpx;
|
||||||
width: 24rpx
|
margin-right: 4rpx;
|
||||||
height: 31rpx
|
width: 24rpx;
|
||||||
.title
|
height: 31rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.title {
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
color: #333333;
|
color: #333333;
|
||||||
margin-top: 6rpx;
|
margin-top: 6rpx;
|
||||||
white-space: pre-wrap
|
white-space: pre-wrap;
|
||||||
.desc
|
}
|
||||||
|
.desc {
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
color: #6C7282;
|
color: #6C7282;
|
||||||
margin-top: 6rpx;
|
margin-top: 6rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ export const useCareerPathStore = defineStore('career-path', () => {
|
|||||||
const fetchData = async () => {
|
const fetchData = async () => {
|
||||||
try {
|
try {
|
||||||
const { code, msg, data } = await getCurrentPosition();
|
const { code, msg, data } = await getCurrentPosition();
|
||||||
if (code !== 0) {
|
if (code !== 200) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: msg,
|
title: msg,
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
@@ -104,7 +104,7 @@ export const useCareerPathStore = defineStore('career-path', () => {
|
|||||||
const fetchDataPath = async () => {
|
const fetchDataPath = async () => {
|
||||||
try {
|
try {
|
||||||
const { code, msg, data } = await getPath();
|
const { code, msg, data } = await getPath();
|
||||||
if (code !== 0) {
|
if (code !== 200) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: msg,
|
title: msg,
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
@@ -137,7 +137,7 @@ export const useCareerPathStore = defineStore('career-path', () => {
|
|||||||
};
|
};
|
||||||
try {
|
try {
|
||||||
const { code, msg, data } = await getPathDetail(params);
|
const { code, msg, data } = await getPathDetail(params);
|
||||||
if (code !== 0) {
|
if (code !== 200) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: msg,
|
title: msg,
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
import { computed, ref, watch } from 'vue';
|
import { computed, ref, watch, inject } from 'vue';
|
||||||
import { defineStore, storeToRefs } from 'pinia';
|
import { defineStore, storeToRefs } from 'pinia';
|
||||||
import useUserStore from '@/stores/useUserStore';
|
import useUserStore from '@/stores/useUserStore';
|
||||||
import { getProfessions, getRecommend, getSkillTags } from '@/apiRc/service/careerRecommendation';
|
import { getProfessions, getRecommend, getSkillTags } from '@/apiRc/service/careerRecommendation';
|
||||||
|
|
||||||
|
|
||||||
export const useCareerRecommendationStore = defineStore('career-recommendation', () => {
|
export const useCareerRecommendationStore = defineStore('career-recommendation', () => {
|
||||||
|
const { navTo } = inject('globalFunction');
|
||||||
const { userInfo: ui } = storeToRefs(useUserStore());
|
const { userInfo: ui } = storeToRefs(useUserStore());
|
||||||
const userInfo = ref({
|
const userInfo = ref({
|
||||||
userName: '',
|
userName: '',
|
||||||
@@ -78,7 +79,7 @@ export const useCareerRecommendationStore = defineStore('career-recommendation',
|
|||||||
const fetchData = async () => {
|
const fetchData = async () => {
|
||||||
try {
|
try {
|
||||||
const { code, msg, data } = await getProfessions();
|
const { code, msg, data } = await getProfessions();
|
||||||
if (code !== 0) {
|
if (code !== 200) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: msg,
|
title: msg,
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
@@ -105,7 +106,7 @@ export const useCareerRecommendationStore = defineStore('career-recommendation',
|
|||||||
};
|
};
|
||||||
try {
|
try {
|
||||||
const { code, msg, data } = await getSkillTags(params);
|
const { code, msg, data } = await getSkillTags(params);
|
||||||
if (code !== 0) {
|
if (code !== 200) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: msg,
|
title: msg,
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
@@ -126,7 +127,7 @@ export const useCareerRecommendationStore = defineStore('career-recommendation',
|
|||||||
};
|
};
|
||||||
try {
|
try {
|
||||||
const { code, msg, data } = await getRecommend(params);
|
const { code, msg, data } = await getRecommend(params);
|
||||||
if (code !== 0) {
|
if (code !== 200) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: msg,
|
title: msg,
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
@@ -161,6 +162,11 @@ export const useCareerRecommendationStore = defineStore('career-recommendation',
|
|||||||
|
|
||||||
void fetchData();
|
void fetchData();
|
||||||
|
|
||||||
|
const eventJobSearch = (job) => {
|
||||||
|
console.log(job);
|
||||||
|
navTo('/pages/search/search?job=' + job.title);
|
||||||
|
};
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => profession.value,
|
() => profession.value,
|
||||||
() => {
|
() => {
|
||||||
@@ -192,6 +198,7 @@ export const useCareerRecommendationStore = defineStore('career-recommendation',
|
|||||||
skillTags,
|
skillTags,
|
||||||
result,
|
result,
|
||||||
eventProfession,
|
eventProfession,
|
||||||
eventSearch
|
eventSearch,
|
||||||
|
eventJobSearch
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ export const useSkillDevelopmentStore = defineStore('skill-development', () => {
|
|||||||
const fetchData = async () => {
|
const fetchData = async () => {
|
||||||
try {
|
try {
|
||||||
const { code, msg, data } = await getCurrentPosition();
|
const { code, msg, data } = await getCurrentPosition();
|
||||||
if (code !== 0) {
|
if (code !== 200) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: msg,
|
title: msg,
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
@@ -116,7 +116,7 @@ export const useSkillDevelopmentStore = defineStore('skill-development', () => {
|
|||||||
const fetchDataPath = async () => {
|
const fetchDataPath = async () => {
|
||||||
try {
|
try {
|
||||||
const { code, msg, data } = await getPath();
|
const { code, msg, data } = await getPath();
|
||||||
if (code !== 0) {
|
if (code !== 200) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: msg,
|
title: msg,
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
@@ -149,7 +149,7 @@ export const useSkillDevelopmentStore = defineStore('skill-development', () => {
|
|||||||
};
|
};
|
||||||
try {
|
try {
|
||||||
const { code, msg, data } = await getCareerPath(params);
|
const { code, msg, data } = await getCareerPath(params);
|
||||||
if (code !== 0) {
|
if (code !== 200) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: msg,
|
title: msg,
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
@@ -195,7 +195,7 @@ export const useSkillDevelopmentStore = defineStore('skill-development', () => {
|
|||||||
};
|
};
|
||||||
try {
|
try {
|
||||||
const { code, msg, data } = await getSkillResult(params);
|
const { code, msg, data } = await getSkillResult(params);
|
||||||
if (code !== 0) {
|
if (code !== 200) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: msg,
|
title: msg,
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
|
|||||||
@@ -29,7 +29,8 @@ let exports = {
|
|||||||
// baseUrl: 'http://ks.zhaopinzao8dian.com/api/ks', // 已从根目录config.js引用,不再重复配置
|
// baseUrl: 'http://ks.zhaopinzao8dian.com/api/ks', // 已从根目录config.js引用,不再重复配置
|
||||||
|
|
||||||
// ========== 职业图谱专用baseUrl ==========
|
// ========== 职业图谱专用baseUrl ==========
|
||||||
zytpBaseUrl: 'https://www.xjksly.cn/career-map/api/ks_zytp/admin-api/zytp',
|
zytpBaseUrl: 'https://www.xjksly.cn/career-map/api/ks_zytp/zytp',
|
||||||
|
// zytpBaseUrl: 'http://ks.zhaopinzao8dian.com/api/ks_zytp/zytp',
|
||||||
|
|
||||||
// ========== 用户接口专用baseUrl(其他用户接口使用) ==========
|
// ========== 用户接口专用baseUrl(其他用户接口使用) ==========
|
||||||
userBaseUrl: 'http://ks.zhaopinzao8dian.com/api/ks', // 用户相关接口使用根目录config.js的baseUrl
|
userBaseUrl: 'http://ks.zhaopinzao8dian.com/api/ks', // 用户相关接口使用根目录config.js的baseUrl
|
||||||
|
|||||||
@@ -26,13 +26,15 @@ const request = config => {
|
|||||||
const isZytpApi = baseType === 'zytp'
|
const isZytpApi = baseType === 'zytp'
|
||||||
// 从存储中获取微信登录的 token
|
// 从存储中获取微信登录的 token
|
||||||
const token = getToken()
|
const token = getToken()
|
||||||
if (token && !isToken && !isZytpApi) {
|
if (token && !isToken) {
|
||||||
// config.header['Authorization'] = 'Bearer ' + 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJsb2dpblR5cGUiOiJsb2dpbiIsImxvZ2luSWQiOiJzeXNfdXNlcjoxIiwicm5TdHIiOiJhb0Y4RmJPQWJ6ZVA3NlpzaENyM0tPSEZTbU85U0ZhViIsInVzZXJJZCI6MX0.kPEDm7D8eVvFlwAiUiE57evWaCX5EcSEOq-LEYGTm9Q'
|
// config.header['Authorization'] = 'Bearer ' + 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJsb2dpblR5cGUiOiJsb2dpbiIsImxvZ2luSWQiOiJzeXNfdXNlcjoxIiwicm5TdHIiOiJhb0Y4RmJPQWJ6ZVA3NlpzaENyM0tPSEZTbU85U0ZhViIsInVzZXJJZCI6MX0.kPEDm7D8eVvFlwAiUiE57evWaCX5EcSEOq-LEYGTm9Q'
|
||||||
config.header['Authorization'] = 'Bearer ' + token
|
config.header['Authorization'] = 'Bearer ' + token
|
||||||
}
|
}
|
||||||
let requestBaseUrl = baseUrl
|
let requestBaseUrl = baseUrl
|
||||||
if (baseType === 'zytp' && zytpBaseUrl) {
|
if (baseType === 'zytp' && zytpBaseUrl) {
|
||||||
requestBaseUrl = zytpBaseUrl
|
requestBaseUrl = zytpBaseUrl
|
||||||
|
const cryptogram = uni.getStorageSync('cryptogram');
|
||||||
|
config.header['Authorization'] = 'Bearer ' + cryptogram
|
||||||
} else if (baseType === 'user' && userBaseUrl) {
|
} else if (baseType === 'user' && userBaseUrl) {
|
||||||
requestBaseUrl = userBaseUrl
|
requestBaseUrl = userBaseUrl
|
||||||
} else if (baseType === 'appUserInfo' && appUserInfoBaseUrl) {
|
} else if (baseType === 'appUserInfo' && appUserInfoBaseUrl) {
|
||||||
|
|||||||
Reference in New Issue
Block a user