微信小程序兼容修改
This commit is contained in:
5
package-lock.json
generated
5
package-lock.json
generated
@@ -27,8 +27,9 @@
|
||||
},
|
||||
"node_modules/sm-crypto": {
|
||||
"version": "0.3.13",
|
||||
"resolved": "https://registry.npmjs.org/sm-crypto/-/sm-crypto-0.3.13.tgz",
|
||||
"resolved": "https://registry.npmmirror.com/sm-crypto/-/sm-crypto-0.3.13.tgz",
|
||||
"integrity": "sha512-ztNF+pZq6viCPMA1A6KKu3bgpkmYti5avykRHbcFIdSipFdkVmfUw2CnpM2kBJyppIalqvczLNM3wR8OQ0pT5w==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"jsbn": "^1.1.0"
|
||||
}
|
||||
@@ -52,7 +53,7 @@
|
||||
},
|
||||
"sm-crypto": {
|
||||
"version": "0.3.13",
|
||||
"resolved": "https://registry.npmjs.org/sm-crypto/-/sm-crypto-0.3.13.tgz",
|
||||
"resolved": "https://registry.npmmirror.com/sm-crypto/-/sm-crypto-0.3.13.tgz",
|
||||
"integrity": "sha512-ztNF+pZq6viCPMA1A6KKu3bgpkmYti5avykRHbcFIdSipFdkVmfUw2CnpM2kBJyppIalqvczLNM3wR8OQ0pT5w==",
|
||||
"requires": {
|
||||
"jsbn": "^1.1.0"
|
||||
|
||||
@@ -21,15 +21,25 @@
|
||||
</view>
|
||||
<view class="companyinfo-right">
|
||||
<view class="row1">{{ companyInfo?.companyName }}</view>
|
||||
<view class="row2">
|
||||
{{ companyInfo?.scale }}
|
||||
<view class="row2" v-if="companyInfo?.industry || companyInfo?.scale">
|
||||
<dict-tree-Label
|
||||
v-if="companyInfo?.industry"
|
||||
dictType="industry"
|
||||
:value="companyInfo?.industry"
|
||||
></dict-tree-Label>
|
||||
<span v-if="companyInfo?.industry && companyInfo?.scale"> · </span>
|
||||
<dict-Label
|
||||
v-if="companyInfo?.scale"
|
||||
dictType="scale"
|
||||
:value="companyInfo?.scale"
|
||||
></dict-Label>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="conetent-info" :class="{ expanded: isExpanded }">
|
||||
<view class="info-title">公司介绍</view>
|
||||
<view class="info-desirption">{{
|
||||
companyInfo.companyIntroduction
|
||||
companyInfo.description
|
||||
}}</view>
|
||||
<!-- <view class="info-title title2">公司地址</view>
|
||||
<view class="locationCompany"></view> -->
|
||||
@@ -46,32 +56,39 @@
|
||||
<view class="views">
|
||||
<view class="Detail-title"><text class="title">在招职位</text></view>
|
||||
<template v-if="companyInfo.jobInfoList.length != 0">
|
||||
<view v-for="job in companyInfo.jobInfoList" :key="job.id">
|
||||
<!-- @click="navTo(`/packageA/pages/post/post?jobId=${JSON.stringify(job)}`)" -->
|
||||
<view class="cards" :style="getItemBackgroundStyle('bj2.png')">
|
||||
<view class="card-company">
|
||||
<text class="company">{{ job.jobTitle }}</text>
|
||||
<view class="salary"> ¥{{ job.salaryRange }}/月 </view>
|
||||
</view>
|
||||
<view class="card-tags">
|
||||
<view class="tag jy">
|
||||
<image :src="`${baseUrl}/jobfair/jy.png`" mode=""></image>
|
||||
{{ job.experienceRequirement }}
|
||||
</view>
|
||||
<view class="tag xl">
|
||||
<image :src="`${baseUrl}/jobfair/xx.png`" mode=""></image>
|
||||
{{ job.educationRequirement }}
|
||||
</view>
|
||||
<view class="tag yd" v-if="job.jobRequirement">
|
||||
<image :src="`${baseUrl}/jobfair/lx-1.png`" mode=""></image>
|
||||
{{ job.jobRequirement }}
|
||||
<view v-for="job in companyInfo.jobInfoList" :key="job.jobId" class="job-card-wrapper">
|
||||
<view class="cards" @click="navTo(`/packageA/pages/post/post?jobId=${job.jobId}`)">
|
||||
<view class="card-header">
|
||||
<view class="card-title-row">
|
||||
<text class="job-title">{{ job.jobTitle }}</text>
|
||||
<view class="card-pay">
|
||||
<view class="pay-text">
|
||||
<text class="salary-amount">¥{{ formatSalary(job.minSalary, job.maxSalary) }}</text>
|
||||
<text class="salary-unit">/月</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="card-companyName">
|
||||
<image :src="`${baseUrl}/jobfair/hd.png`" mode=""></image>
|
||||
{{ job.jobDescription }}
|
||||
</view>
|
||||
|
||||
<view class="card-tags" v-if="job.experience || job.education">
|
||||
<view class="tag tag-experience" v-if="job.experience">
|
||||
<image class="tag-icon" :src="`${baseUrl}/jobfair/jy.png`" mode="aspectFit"></image>
|
||||
<view class="tag-text">
|
||||
<dict-Label dictType="experience" :value="job.experience"></dict-Label>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tag tag-education" v-if="job.education">
|
||||
<image class="tag-icon" :src="`${baseUrl}/jobfair/xx.png`" mode="aspectFit"></image>
|
||||
<view class="tag-text">
|
||||
<dict-Label dictType="education" :value="job.education"></dict-Label>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="card-location" v-if="job.jobLocation">
|
||||
<image class="location-icon" src="/static/icon/point3.png" mode="aspectFit"></image>
|
||||
<text class="location-text">{{ job.jobLocation }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -90,7 +107,7 @@ import config from "@/config.js";
|
||||
import { storeToRefs } from "pinia";
|
||||
import useLocationStore from "@/stores/useLocationStore";
|
||||
const { longitudeVal, latitudeVal } = storeToRefs(useLocationStore());
|
||||
const { $api, navTo, vacanciesTo, navBack } = inject("globalFunction");
|
||||
const { $api, navTo, vacanciesTo, navBack, parseQueryParams } = inject("globalFunction");
|
||||
const isExpanded = ref(false);
|
||||
const pageState = reactive({
|
||||
page: 0,
|
||||
@@ -101,9 +118,16 @@ const pageState = reactive({
|
||||
});
|
||||
const companyInfo = ref({
|
||||
jobInfoList: [],
|
||||
companyName: '',
|
||||
scale: '',
|
||||
industry: '',
|
||||
description: '',
|
||||
isCollection: false
|
||||
});
|
||||
|
||||
const baseUrl = config.imgBaseUrl;
|
||||
const companyIdRef = ref(null);
|
||||
|
||||
const getItemBackgroundStyle = (imageName) => ({
|
||||
backgroundImage: `url(${baseUrl}/jobfair/${imageName})`,
|
||||
backgroundSize: "100% 100%", // 覆盖整个容器
|
||||
@@ -111,14 +135,167 @@ const getItemBackgroundStyle = (imageName) => ({
|
||||
backgroundRepeat: "no-repeat",
|
||||
});
|
||||
|
||||
// 获取公司详情
|
||||
function getCompanyDetail(companyId) {
|
||||
if (!companyId) {
|
||||
console.error('companyId 不能为空');
|
||||
return;
|
||||
}
|
||||
|
||||
// 尝试获取公司详情,如果接口不存在,可能公司详情会包含在职位数据中
|
||||
$api.createRequest(`/app/company/${companyId}`).then((resData) => {
|
||||
if (resData && resData.data) {
|
||||
const data = resData.data;
|
||||
companyInfo.value = {
|
||||
...companyInfo.value,
|
||||
...data,
|
||||
companyName: data.name || data.companyName || data.company?.name || '',
|
||||
scale: data.scale || data.company?.scale || '',
|
||||
industry: data.industry || data.company?.industry || '',
|
||||
description: data.description || data.companyIntroduction || data.introduction || data.company?.introduction || '',
|
||||
isCollection: data.isCollection || false,
|
||||
// 如果接口直接返回了职位列表,也设置进去
|
||||
jobInfoList: data.jobInfoList || data.jobs || data.list || companyInfo.value.jobInfoList || []
|
||||
};
|
||||
console.log('companyInfo',companyInfo.value);
|
||||
}
|
||||
// 获取在招职位列表
|
||||
getCompanyJobs(companyId);
|
||||
}).catch((error) => {
|
||||
console.error('获取公司详情失败:', error);
|
||||
// 如果获取公司详情失败,尝试通过职位列表接口获取公司信息
|
||||
// 或者直接获取职位列表
|
||||
getCompanyJobs(companyId);
|
||||
});
|
||||
}
|
||||
|
||||
// 获取公司在招职位列表
|
||||
function getCompanyJobs(companyId) {
|
||||
if (!companyId) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 使用正确的 API 路径:/app/company/job/{companyId}
|
||||
$api.createRequest(`/app/company/job/${companyId}`, {}, 'GET').then((resData) => {
|
||||
console.log('获取职位列表返回数据:', resData);
|
||||
if (resData) {
|
||||
// 优先检查 rows 字段(根据实际返回的数据结构)
|
||||
if (resData.rows && Array.isArray(resData.rows)) {
|
||||
companyInfo.value.jobInfoList = resData.rows;
|
||||
}
|
||||
// 如果返回的是数组
|
||||
else if (Array.isArray(resData)) {
|
||||
companyInfo.value.jobInfoList = resData;
|
||||
}
|
||||
// 如果返回的是对象,包含列表字段
|
||||
else if (resData.data) {
|
||||
if (Array.isArray(resData.data)) {
|
||||
companyInfo.value.jobInfoList = resData.data;
|
||||
} else if (resData.data.rows && Array.isArray(resData.data.rows)) {
|
||||
companyInfo.value.jobInfoList = resData.data.rows;
|
||||
} else if (resData.data.list && Array.isArray(resData.data.list)) {
|
||||
companyInfo.value.jobInfoList = resData.data.list;
|
||||
} else if (resData.data.jobInfoList && Array.isArray(resData.data.jobInfoList)) {
|
||||
companyInfo.value.jobInfoList = resData.data.jobInfoList;
|
||||
} else {
|
||||
companyInfo.value.jobInfoList = [];
|
||||
}
|
||||
} else {
|
||||
companyInfo.value.jobInfoList = [];
|
||||
}
|
||||
} else {
|
||||
companyInfo.value.jobInfoList = [];
|
||||
}
|
||||
}).catch((error) => {
|
||||
console.error('获取在招职位列表失败:', error);
|
||||
companyInfo.value.jobInfoList = [];
|
||||
});
|
||||
}
|
||||
|
||||
onLoad((options) => {
|
||||
companyInfo.value = JSON.parse(options.job);
|
||||
console.log(companyInfo.value, "companyInfo.value");
|
||||
console.log('options',options);
|
||||
let companyId = null;
|
||||
|
||||
// 优先从 options 中获取 companyId(小程序和 H5 都支持)
|
||||
if (options && options.companyId) {
|
||||
companyId = decodeURIComponent(options.companyId);
|
||||
}
|
||||
// 如果 options 中没有,尝试从 URL 解析(仅 H5 环境)
|
||||
else {
|
||||
// 使用 try-catch 包裹,避免在小程序环境中访问 window.location 报错
|
||||
try {
|
||||
// #ifdef H5
|
||||
const params = parseQueryParams();
|
||||
companyId = params.companyId;
|
||||
// #endif
|
||||
} catch (e) {
|
||||
console.warn('解析 URL 参数失败:', e);
|
||||
}
|
||||
}
|
||||
|
||||
console.log('companyId', companyId);
|
||||
|
||||
if (companyId) {
|
||||
companyIdRef.value = companyId;
|
||||
getCompanyDetail(companyId);
|
||||
} else {
|
||||
console.error('未获取到 companyId 参数');
|
||||
// 如果参数名是 job,尝试兼容旧的方式
|
||||
if (options && options.job) {
|
||||
try {
|
||||
const parsedData = JSON.parse(options.job);
|
||||
if (parsedData.companyId) {
|
||||
companyIdRef.value = parsedData.companyId;
|
||||
getCompanyDetail(parsedData.companyId);
|
||||
} else {
|
||||
companyInfo.value = { ...companyInfo.value, ...parsedData };
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('解析 job 参数失败:', e);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
onShow(() => {
|
||||
// 仅在 H5 环境中从 URL 获取参数(小程序环境中 onShow 不会传递 URL 参数)
|
||||
// #ifdef H5
|
||||
try {
|
||||
const params = parseQueryParams();
|
||||
const companyId = params.companyId;
|
||||
|
||||
if (companyId && companyId !== companyIdRef.value) {
|
||||
companyIdRef.value = companyId;
|
||||
getCompanyDetail(companyId);
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn('onShow 中解析 URL 参数失败:', e);
|
||||
}
|
||||
// #endif
|
||||
});
|
||||
|
||||
function expand() {
|
||||
isExpanded.value = !isExpanded.value;
|
||||
}
|
||||
|
||||
// 格式化薪资范围
|
||||
function formatSalary(minSalary, maxSalary) {
|
||||
if (minSalary && maxSalary) {
|
||||
return `${minSalary}-${maxSalary}`;
|
||||
} else if (minSalary) {
|
||||
return `${minSalary}起`;
|
||||
} else if (maxSalary) {
|
||||
return `最高${maxSalary}`;
|
||||
}
|
||||
return '面议';
|
||||
}
|
||||
|
||||
// 截断文本,超过指定长度显示省略号
|
||||
function truncateText(text, maxLength) {
|
||||
if (!text) return '';
|
||||
if (text.length <= maxLength) return text;
|
||||
return text.substring(0, maxLength) + '...';
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
@@ -259,94 +436,136 @@ image {
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.cards {
|
||||
padding: 32rpx;
|
||||
background: #FFFFFF;
|
||||
box-shadow: 0rpx 0rpx 8rpx 0rpx rgba(0, 0, 0, 0.04);
|
||||
border-radius: 20rpx 20rpx 20rpx 20rpx;
|
||||
.job-card-wrapper {
|
||||
margin-top: 22rpx;
|
||||
padding-bottom: 18rpx;
|
||||
|
||||
.card-company {
|
||||
&:first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.cards {
|
||||
padding: 30rpx;
|
||||
background: #FFFFFF;
|
||||
box-shadow: 0rpx 2rpx 12rpx 0rpx rgba(0, 0, 0, 0.08);
|
||||
border-radius: 24rpx;
|
||||
transition: all 0.3s ease;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
|
||||
&:active {
|
||||
transform: scale(0.98);
|
||||
box-shadow: 0rpx 1rpx 8rpx 0rpx rgba(0, 0, 0, 0.12);
|
||||
}
|
||||
|
||||
.card-header {
|
||||
margin-bottom: 0;
|
||||
|
||||
.card-title-row {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: flex-start;
|
||||
align-items: center;
|
||||
gap: 20rpx;
|
||||
|
||||
.company {
|
||||
font-weight: 600;
|
||||
.job-title {
|
||||
flex: 1;
|
||||
font-family: 'PingFangSC-Medium', 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', sans-serif;
|
||||
text-align: left;
|
||||
word-break: break-all;
|
||||
font-weight: 500;
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.salary {
|
||||
font-weight: 600;
|
||||
font-size: 28rpx;
|
||||
color: #F83A3C;
|
||||
white-space: nowrap;
|
||||
line-height: 48rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.card-companyName {
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #fff;
|
||||
margin-top: 23rpx;
|
||||
.card-pay {
|
||||
flex-shrink: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
image{
|
||||
width: 24rpx;
|
||||
height: 24rpx;
|
||||
margin-right: 8rpx;
|
||||
|
||||
.pay-text {
|
||||
font-family: DIN-Medium;
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #4C6EFB;
|
||||
line-height: 45rpx;
|
||||
white-space: nowrap;
|
||||
|
||||
.salary-amount {
|
||||
font-family: DIN-Medium;
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #4C6EFB;
|
||||
line-height: 45rpx;
|
||||
}
|
||||
|
||||
.salary-unit {
|
||||
font-weight: 400;
|
||||
font-size: 20rpx;
|
||||
color: #4C6EFB;
|
||||
margin-left: 4rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.card-tags {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
margin: 25rpx 0 35rpx;
|
||||
image{
|
||||
gap: 10rpx;
|
||||
margin-top: 20rpx;
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
.tag {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: fit-content;
|
||||
height: 30rpx;
|
||||
padding: 6rpx 20rpx;
|
||||
border-radius: 4rpx;
|
||||
background: #F4F4F4;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #6C7282;
|
||||
white-space: nowrap;
|
||||
line-height: 30rpx;
|
||||
text-align: center;
|
||||
|
||||
.tag-icon {
|
||||
width: 24rpx;
|
||||
height: 24rpx;
|
||||
margin-right: 8rpx;
|
||||
}
|
||||
.jy {
|
||||
background: #D9EDFF;
|
||||
color: #0086FF;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.xl {
|
||||
background: #FFF1D5;
|
||||
color: #FF7F01;
|
||||
.tag-text {
|
||||
line-height: 1;
|
||||
}
|
||||
}
|
||||
.yd {
|
||||
background: #FFD8D8;
|
||||
color: #F83A3C;
|
||||
}
|
||||
|
||||
.tag {
|
||||
width: fit-content;
|
||||
height: 30rpx;
|
||||
border-radius: 4rpx;
|
||||
padding: 6rpx 20rpx;
|
||||
line-height: 30rpx;
|
||||
.card-location {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
margin-top: 20rpx;
|
||||
|
||||
.location-icon {
|
||||
width: 28rpx;
|
||||
height: 28rpx;
|
||||
margin-right: 4rpx;
|
||||
margin-top: 0;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.location-text {
|
||||
flex: 1;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
margin-right: 20rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
color: #999999;
|
||||
line-height: 25rpx;
|
||||
word-break: break-all;
|
||||
}
|
||||
}
|
||||
|
||||
.card-bottom {
|
||||
margin-top: 32rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
font-size: 28rpx;
|
||||
color: #6C7282;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
<template>
|
||||
<AppLayout title="我的浏览" :show-bg-image="false" :use-scroll-view="false">
|
||||
<template #headerleft>
|
||||
<view class="btnback">
|
||||
<image src="@/static/icon/back.png" @click="navBack"></image>
|
||||
</view>
|
||||
</template>
|
||||
<view class="collection-content">
|
||||
<view class="collection-search">
|
||||
<view class="search-content">
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
<template>
|
||||
<AppLayout title="我的收藏" :show-bg-image="false" :use-scroll-view="false">
|
||||
<template #headerleft>
|
||||
<view class="btn">
|
||||
<image src="@/static/icon/back.png" @click="navBack"></image>
|
||||
</view>
|
||||
</template>
|
||||
<view class="collection-content">
|
||||
<view class="header">
|
||||
<view class="button-click" :class="{ active: type === 0 }" @click="changeType(0)">工作职位</view>
|
||||
|
||||
@@ -16,25 +16,52 @@ const props = defineProps({
|
||||
},
|
||||
});
|
||||
|
||||
// 获取雷达图数据
|
||||
function getRadarData() {
|
||||
if (!props.value || !props.value.radarChart) {
|
||||
// 如果没有数据,使用默认值0
|
||||
const defaultRadarChart = {
|
||||
skill: 0,
|
||||
experience: 0,
|
||||
education: 0,
|
||||
salary: 0,
|
||||
age: 0,
|
||||
location: 0
|
||||
};
|
||||
const labels = ['学历', '年龄', '工作地', '技能', '工作经验', '期望薪资'];
|
||||
const data = [defaultRadarChart.education, defaultRadarChart.age, defaultRadarChart.location,
|
||||
defaultRadarChart.skill, defaultRadarChart.experience, defaultRadarChart.salary].map((item) => item * 0.05);
|
||||
return { labels, data };
|
||||
}
|
||||
|
||||
const { skill, experience, education, salary, age, location } = props.value.radarChart;
|
||||
const labels = ['学历', '年龄', '工作地', '技能', '工作经验', '期望薪资'];
|
||||
const data = [education, age, location, skill, experience, salary].map((item) => item * 0.05);
|
||||
return { labels, data };
|
||||
}
|
||||
|
||||
// 监听页面初始化
|
||||
onMounted(() => {
|
||||
if (Object.keys(props.value).length > 0) {
|
||||
rawRadarChart();
|
||||
}
|
||||
// 延迟执行,确保 canvas 已经渲染
|
||||
setTimeout(() => {
|
||||
const { labels, data } = getRadarData();
|
||||
rawRadarChart(labels, data);
|
||||
}, 100);
|
||||
});
|
||||
|
||||
// 监听 props.value 变化
|
||||
watch(
|
||||
() => props.value,
|
||||
(newVal) => {
|
||||
if (newVal && Object.keys(newVal).length > 0) {
|
||||
const { skill, experience, education, salary, age, location } = newVal.radarChart;
|
||||
const labels = ['学历', '年龄', '工作地', '技能', '工作经验', '期望薪资'];
|
||||
const data = [education, age, location, skill, experience, salary].map((item) => item * 0.05);
|
||||
if (newVal) {
|
||||
// 延迟执行,确保数据更新完成
|
||||
setTimeout(() => {
|
||||
const { labels, data } = getRadarData();
|
||||
rawRadarChart(labels, data);
|
||||
}, 50);
|
||||
}
|
||||
},
|
||||
{ deep: true, immediate: false } // deep 递归监听对象内部变化
|
||||
{ deep: true, immediate: true } // deep 递归监听对象内部变化,immediate 立即执行一次
|
||||
);
|
||||
|
||||
function rawRadarChart(labels, data) {
|
||||
|
||||
@@ -208,7 +208,20 @@ const jobInfo = ref({});
|
||||
const state = reactive({});
|
||||
const mapCovers = ref([]);
|
||||
const jobIdRef = ref();
|
||||
const raderData = ref({});
|
||||
// 竞争力分析数据,初始化为包含默认值的完整结构,确保雷达图能正常渲染
|
||||
const raderData = ref({
|
||||
matchScore: 0,
|
||||
rank: 0,
|
||||
percentile: 0,
|
||||
radarChart: {
|
||||
skill: 0,
|
||||
experience: 0,
|
||||
education: 0,
|
||||
salary: 0,
|
||||
age: 0,
|
||||
location: 0
|
||||
}
|
||||
});
|
||||
const videoPalyerRef = ref(null);
|
||||
const explainUrlRef = ref('');
|
||||
|
||||
@@ -246,10 +259,17 @@ onLoad((option) => {
|
||||
});
|
||||
|
||||
onShow(() => {
|
||||
// 仅在 H5 环境中从 URL 获取参数(小程序环境中 onShow 不会传递 URL 参数)
|
||||
// #ifdef H5
|
||||
try {
|
||||
const option = parseQueryParams(); // 兼容微信内置浏览器
|
||||
if (option.jobId) {
|
||||
initLoad(option);
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn('onShow 中解析 URL 参数失败:', e);
|
||||
}
|
||||
// #endif
|
||||
});
|
||||
|
||||
function initLoad(option) {
|
||||
@@ -317,8 +337,59 @@ function getTextWidth(text, size = 12) {
|
||||
|
||||
function getCompetivetuveness(jobId) {
|
||||
$api.createRequest(`/app/job/competitiveness/${jobId}`, {}, 'GET').then((resData) => {
|
||||
raderData.value = resData.data;
|
||||
currentStep.value = resData.data.matchScore * 0.04;
|
||||
// 如果接口返回的数据为 null 或空,使用默认值0
|
||||
if (resData && resData.data) {
|
||||
// 确保 radarChart 字段存在,如果不存在则使用默认值
|
||||
const radarChart = resData.data.radarChart || {
|
||||
skill: 0,
|
||||
experience: 0,
|
||||
education: 0,
|
||||
salary: 0,
|
||||
age: 0,
|
||||
location: 0
|
||||
};
|
||||
|
||||
raderData.value = {
|
||||
matchScore: resData.data.matchScore || 0,
|
||||
rank: resData.data.rank || 0,
|
||||
percentile: resData.data.percentile || 0,
|
||||
radarChart: radarChart
|
||||
};
|
||||
currentStep.value = (resData.data.matchScore || 0) * 0.04;
|
||||
} else {
|
||||
// 接口返回 null 或空数据时,使用默认值0
|
||||
raderData.value = {
|
||||
matchScore: 0,
|
||||
rank: 0,
|
||||
percentile: 0,
|
||||
radarChart: {
|
||||
skill: 0,
|
||||
experience: 0,
|
||||
education: 0,
|
||||
salary: 0,
|
||||
age: 0,
|
||||
location: 0
|
||||
}
|
||||
};
|
||||
currentStep.value = 0;
|
||||
}
|
||||
}).catch((error) => {
|
||||
// 接口请求失败时,使用默认值0
|
||||
console.error('获取竞争力分析失败:', error);
|
||||
raderData.value = {
|
||||
matchScore: 0,
|
||||
rank: 0,
|
||||
percentile: 0,
|
||||
radarChart: {
|
||||
skill: 0,
|
||||
experience: 0,
|
||||
education: 0,
|
||||
salary: 0,
|
||||
age: 0,
|
||||
location: 0
|
||||
}
|
||||
};
|
||||
currentStep.value = 0;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
104
pages.json
104
pages.json
@@ -4,9 +4,9 @@
|
||||
"path": "pages/index/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "喀什智慧就业平台",
|
||||
"navigationBarTitleTextSize": "30rpx",
|
||||
"navigationBarTitleTextSize": "30rpx"
|
||||
// #ifdef H5
|
||||
"navigationStyle": "custom"
|
||||
//"navigationStyle": "custom"
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
@@ -14,8 +14,8 @@
|
||||
"path": "pages/mine/mine",
|
||||
"style": {
|
||||
"navigationBarTitleText": "我的",
|
||||
"navigationBarTitleTextSize": "30rpx",
|
||||
"navigationStyle": "custom"
|
||||
"navigationBarTitleTextSize": "30rpx"
|
||||
//"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -23,7 +23,7 @@
|
||||
"style": {
|
||||
"navigationBarTitleText": "消息",
|
||||
"navigationBarTitleTextSize": "30rpx"
|
||||
// "navigationStyle": "custom",
|
||||
//"navigationStyle": "custom",
|
||||
// "enablePullDownRefresh": false
|
||||
}
|
||||
},
|
||||
@@ -32,7 +32,7 @@
|
||||
"style": {
|
||||
"navigationBarTitleText": "招聘会",
|
||||
"navigationBarTitleTextSize": "30rpx"
|
||||
// "navigationStyle": "custom"
|
||||
//"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -40,7 +40,7 @@
|
||||
"style": {
|
||||
"navigationBarTitleText": "补全信息",
|
||||
"navigationBarTitleTextSize": "30rpx"
|
||||
// "navigationStyle": "custom"
|
||||
//"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -48,14 +48,14 @@
|
||||
"style": {
|
||||
"navigationBarTitleText": "企业信息",
|
||||
"navigationBarTitleTextSize": "30rpx"
|
||||
// "navigationStyle": "custom"
|
||||
//"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/complete-info/components/map-location-picker",
|
||||
"style": {
|
||||
"navigationBarTitleText": "选择地址",
|
||||
"navigationStyle": "custom"
|
||||
"navigationBarTitleText": "选择地址"
|
||||
//"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -63,57 +63,57 @@
|
||||
"style": {
|
||||
"navigationBarTitleText": "附近",
|
||||
"navigationBarBackgroundColor": "#4778EC",
|
||||
"navigationBarTextStyle": "white",
|
||||
"navigationStyle": "custom"
|
||||
"navigationBarTextStyle": "white"
|
||||
//"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/test/userTypeTest",
|
||||
"style": {
|
||||
"navigationBarTitleText": "用户类型测试",
|
||||
"navigationStyle": "custom"
|
||||
//"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/test/tabbar-test",
|
||||
"style": {
|
||||
"navigationBarTitleText": "TabBar测试",
|
||||
"navigationStyle": "custom"
|
||||
//"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/test/homepage-test",
|
||||
"style": {
|
||||
"navigationBarTitleText": "首页内容测试",
|
||||
"navigationStyle": "custom"
|
||||
//"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/test/tabbar-user-type-test",
|
||||
"style": {
|
||||
"navigationBarTitleText": "TabBar用户类型测试",
|
||||
"navigationStyle": "custom"
|
||||
//"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/test/company-search-test",
|
||||
"style": {
|
||||
"navigationBarTitleText": "企业搜索功能测试",
|
||||
"navigationStyle": "custom"
|
||||
//"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/test/company-mine-test",
|
||||
"style": {
|
||||
"navigationBarTitleText": "企业我的页面测试",
|
||||
"navigationStyle": "custom"
|
||||
//"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/job/publishJob",
|
||||
"style": {
|
||||
"navigationBarTitleText": "发布岗位"
|
||||
// "navigationStyle": "custom",
|
||||
//"navigationStyle": "custom",
|
||||
// "disableScroll": false,
|
||||
// "enablePullDownRefresh": false,
|
||||
// "onReachBottomDistance": 50,
|
||||
@@ -124,7 +124,7 @@
|
||||
"path": "pages/job/companySearch",
|
||||
"style": {
|
||||
"navigationBarTitleText": "选择企业",
|
||||
"navigationStyle": "custom",
|
||||
//"navigationStyle": "custom",
|
||||
"disableScroll": false,
|
||||
"enablePullDownRefresh": false,
|
||||
"backgroundColor": "#f5f5f5"
|
||||
@@ -139,7 +139,7 @@
|
||||
"navigationBarTextStyle": "white",
|
||||
"enablePullDownRefresh": false
|
||||
// #ifdef H5
|
||||
// "navigationStyle": "custom"
|
||||
//"navigationStyle": "custom"
|
||||
//#endif
|
||||
}
|
||||
},
|
||||
@@ -147,7 +147,7 @@
|
||||
"path": "pages/search/search",
|
||||
"style": {
|
||||
"navigationBarTitleText": ""
|
||||
// "navigationStyle": "custom"
|
||||
//"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -155,7 +155,7 @@
|
||||
"style": {
|
||||
"navigationBarTitleText": "我的",
|
||||
"navigationBarTitleTextSize": "30rpx"
|
||||
// "navigationStyle": "custom"
|
||||
//"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -183,15 +183,15 @@
|
||||
{
|
||||
"navigationBarTitleText" : "添加工作经历",
|
||||
"navigationBarTitleTextSize": "30rpx"
|
||||
// "navigationStyle": "custom"
|
||||
//"navigationStyle": "custom"
|
||||
}
|
||||
},{
|
||||
"path": "pages/choiceness/choiceness",
|
||||
"style": {
|
||||
"navigationBarTitleText": "精选",
|
||||
"navigationBarBackgroundColor": "#4778EC",
|
||||
"navigationBarTextStyle": "white",
|
||||
"navigationStyle": "custom"
|
||||
"navigationBarTextStyle": "white"
|
||||
//"navigationStyle": "custom"
|
||||
}
|
||||
}, {
|
||||
"path": "pages/post/post",
|
||||
@@ -206,7 +206,7 @@
|
||||
"navigationBarTitleText": "单位详情"
|
||||
// "navigationBarBackgroundColor": "#4778EC",
|
||||
// "navigationBarTextStyle": "white"
|
||||
// "navigationStyle": "custom"
|
||||
//"navigationStyle": "custom"
|
||||
}
|
||||
}, {
|
||||
"path": "pages/exhibitors/exhibitors",
|
||||
@@ -214,7 +214,7 @@
|
||||
"navigationBarTitleText": "参展单位",
|
||||
"navigationBarBackgroundColor": "#FFFFFF",
|
||||
"navigationBarTextStyle": "black"
|
||||
// "navigationStyle": "custom"
|
||||
//"navigationStyle": "custom"
|
||||
}
|
||||
}, {
|
||||
"path": "pages/myResume/myResume",
|
||||
@@ -235,8 +235,8 @@
|
||||
"style": {
|
||||
"navigationBarTitleText": "我的收藏",
|
||||
"navigationBarTitleTextSize": "30rpx",
|
||||
"navigationBarBackgroundColor": "#FFFFFF",
|
||||
"navigationStyle": "custom"
|
||||
"navigationBarBackgroundColor": "#FFFFFF"
|
||||
//"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -244,31 +244,31 @@
|
||||
"style": {
|
||||
"navigationBarTitleText": "我的浏览",
|
||||
"navigationBarTitleTextSize": "30rpx",
|
||||
"navigationBarBackgroundColor": "#FFFFFF",
|
||||
"navigationStyle": "custom"
|
||||
"navigationBarBackgroundColor": "#FFFFFF"
|
||||
//"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/addPosition/addPosition",
|
||||
"style": {
|
||||
"navigationBarTitleText": "添加岗位",
|
||||
"navigationBarTitleTextSize": "30rpx",
|
||||
"navigationStyle": "custom"
|
||||
"navigationBarTitleTextSize": "30rpx"
|
||||
//"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/selectDate/selectDate",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"navigationStyle": "custom"
|
||||
"navigationBarTitleText": ""
|
||||
//"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/personalInfo/personalInfo",
|
||||
"style": {
|
||||
"navigationBarTitleText": "个人信息",
|
||||
"navigationBarTitleTextSize": "30rpx",
|
||||
"navigationStyle": "custom"
|
||||
"navigationBarTitleTextSize": "30rpx"
|
||||
//"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -276,7 +276,7 @@
|
||||
"style": {
|
||||
"navigationBarTitleText": "求职期望",
|
||||
"navigationBarTitleTextSize": "30rpx"
|
||||
// "navigationStyle": "custom"
|
||||
//"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -292,8 +292,8 @@
|
||||
"style": {
|
||||
"navigationBarTitleText": "精选企业",
|
||||
"navigationBarTitleTextSize": "30rpx",
|
||||
"navigationBarBackgroundColor": "#FFFFFF",
|
||||
"navigationStyle": "custom"
|
||||
"navigationBarBackgroundColor": "#FFFFFF"
|
||||
//"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -316,8 +316,8 @@
|
||||
"path": "pages/tiktok/tiktok",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"navigationBarBackgroundColor": "#FFFFFF",
|
||||
"navigationStyle": "custom"
|
||||
"navigationBarBackgroundColor": "#FFFFFF"
|
||||
//"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -355,7 +355,7 @@
|
||||
{
|
||||
"navigationBarTitleText" : "招聘会详情",
|
||||
"navigationBarTitleTextSize": "30rpx"
|
||||
// "navigationStyle": "custom"
|
||||
//"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -364,7 +364,7 @@
|
||||
{
|
||||
"navigationBarTitleText" : "登录",
|
||||
"navigationBarTitleTextSize": "30rpx"
|
||||
// "navigationStyle": "custom"
|
||||
//"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -373,7 +373,7 @@
|
||||
{
|
||||
"navigationBarTitleText" : "技能评价",
|
||||
"navigationBarTitleTextSize": "30rpx"
|
||||
// "navigationStyle": "custom"
|
||||
//"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -382,7 +382,7 @@
|
||||
{
|
||||
"navigationBarTitleText" : "专项训练",
|
||||
"navigationBarTitleTextSize": "30rpx"
|
||||
// "navigationStyle": "custom"
|
||||
//"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -391,7 +391,7 @@
|
||||
{
|
||||
"navigationBarTitleText" : "视频学习",
|
||||
"navigationBarTitleTextSize": "30rpx"
|
||||
// "navigationStyle": "custom"
|
||||
//"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -400,7 +400,7 @@
|
||||
{
|
||||
"navigationBarTitleText" : "视频详情",
|
||||
"navigationBarTitleTextSize": "30rpx"
|
||||
// "navigationStyle": "custom"
|
||||
//"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -409,7 +409,7 @@
|
||||
{
|
||||
"navigationBarTitleText" : "模拟考试",
|
||||
"navigationBarTitleTextSize": "30rpx"
|
||||
// "navigationStyle": "custom"
|
||||
//"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -418,7 +418,7 @@
|
||||
{
|
||||
"navigationBarTitleText" : "查看成绩",
|
||||
"navigationBarTitleTextSize": "30rpx"
|
||||
// "navigationStyle": "custom"
|
||||
//"navigationStyle": "custom"
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -508,7 +508,7 @@
|
||||
"backgroundColor": "#F8F8F8",
|
||||
"navigationBarTitleTextSize": "18px"
|
||||
// "enablePullDownRefresh": false,
|
||||
// "navigationStyle": "custom"
|
||||
//"navigationStyle": "custom"
|
||||
},
|
||||
"easycom": {
|
||||
"autoscan": true,
|
||||
|
||||
@@ -701,9 +701,43 @@ const handleServiceClick = (serviceType) => {
|
||||
}
|
||||
};
|
||||
|
||||
// 处理直播按钮点击
|
||||
// 处理直播按钮点击 - 跳转微信视频号
|
||||
const handleLiveClick = () => {
|
||||
$api.msg('该功能正在开发中');
|
||||
// #ifdef MP-WEIXIN
|
||||
const feedId = 'sphKH1AEeLfTJJE';
|
||||
|
||||
// 使用微信原生 API 打开视频号直播
|
||||
if (typeof wx !== 'undefined' && wx.openChannelsUserProfile) {
|
||||
wx.openChannelsUserProfile({
|
||||
// feedId: feedId,
|
||||
finderUserName: feedId, // 视频号 finderUserName,如果feedId足够可以留空
|
||||
success: (res) => {
|
||||
console.log('打开视频号成功', res);
|
||||
},
|
||||
fail: (err) => {
|
||||
console.error('打开视频号失败', err);
|
||||
$api.msg(err.errMsg || '无法打开直播,请稍后重试');
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// 如果 API 不存在,尝试使用 uni API
|
||||
uni.openChannelsLive({
|
||||
feedId: feedId,
|
||||
success: (res) => {
|
||||
console.log('打开视频号成功', res);
|
||||
},
|
||||
fail: (err) => {
|
||||
console.error('打开视频号失败', err);
|
||||
$api.msg('无法打开直播,请检查微信版本或稍后重试');
|
||||
}
|
||||
});
|
||||
}
|
||||
// #endif
|
||||
|
||||
// #ifndef MP-WEIXIN
|
||||
// 非微信小程序环境提示
|
||||
$api.msg('该功能仅在微信小程序中可用');
|
||||
// #endif
|
||||
};
|
||||
|
||||
// 跳转到测试页面
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<AppLayout title="我的" back-gorund-color="#F4F4F4">
|
||||
<AppLayout back-gorund-color="#F4F4F4">
|
||||
<!-- 自定义tabbar -->
|
||||
<CustomTabBar :currentPage="4" />
|
||||
<!-- 企业用户信息卡片 -->
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<AppLayout title="附近" :use-scroll-view="false">
|
||||
<AppLayout :use-scroll-view="false">
|
||||
<template #headerleft>
|
||||
<view class="btnback">
|
||||
<image src="@/static/icon/back.png" @click="navBack"></image>
|
||||
@@ -19,10 +19,10 @@
|
||||
<component :is="components[index]" :ref="(el) => handelComponentsRef(el, index)" />
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<oneComponent v-show="currentIndex === 0" :ref="(el) => handelComponentsRef(el, index)" />
|
||||
<twoComponent v-show="currentIndex === 1" :ref="(el) => handelComponentsRef(el, index)" />
|
||||
<threeComponent v-show="currentIndex === 2" :ref="(el) => handelComponentsRef(el, index)" />
|
||||
<fourComponent v-show="currentIndex === 3" :ref="(el) => handelComponentsRef(el, index)" />
|
||||
<oneComponent v-if="index === 0" :ref="(el) => handelComponentsRef(el, index)" />
|
||||
<twoComponent v-if="index === 1" :ref="(el) => handelComponentsRef(el, index)" />
|
||||
<threeComponent v-if="index === 2" :ref="(el) => handelComponentsRef(el, index)" />
|
||||
<fourComponent v-if="index === 3" :ref="(el) => handelComponentsRef(el, index)" />
|
||||
<!-- #endif -->
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
|
||||
Reference in New Issue
Block a user