微信小程序兼容修改

This commit is contained in:
冯辉
2025-11-04 21:12:12 +08:00
parent 81aae7a9ad
commit 349d17b5c4
10 changed files with 528 additions and 186 deletions

5
package-lock.json generated
View File

@@ -27,8 +27,9 @@
}, },
"node_modules/sm-crypto": { "node_modules/sm-crypto": {
"version": "0.3.13", "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==", "integrity": "sha512-ztNF+pZq6viCPMA1A6KKu3bgpkmYti5avykRHbcFIdSipFdkVmfUw2CnpM2kBJyppIalqvczLNM3wR8OQ0pT5w==",
"license": "MIT",
"dependencies": { "dependencies": {
"jsbn": "^1.1.0" "jsbn": "^1.1.0"
} }
@@ -52,7 +53,7 @@
}, },
"sm-crypto": { "sm-crypto": {
"version": "0.3.13", "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==", "integrity": "sha512-ztNF+pZq6viCPMA1A6KKu3bgpkmYti5avykRHbcFIdSipFdkVmfUw2CnpM2kBJyppIalqvczLNM3wR8OQ0pT5w==",
"requires": { "requires": {
"jsbn": "^1.1.0" "jsbn": "^1.1.0"

View File

@@ -21,15 +21,25 @@
</view> </view>
<view class="companyinfo-right"> <view class="companyinfo-right">
<view class="row1">{{ companyInfo?.companyName }}</view> <view class="row1">{{ companyInfo?.companyName }}</view>
<view class="row2"> <view class="row2" v-if="companyInfo?.industry || companyInfo?.scale">
{{ companyInfo?.scale }} <dict-tree-Label
v-if="companyInfo?.industry"
dictType="industry"
:value="companyInfo?.industry"
></dict-tree-Label>
<span v-if="companyInfo?.industry && companyInfo?.scale">&nbsp;·&nbsp;</span>
<dict-Label
v-if="companyInfo?.scale"
dictType="scale"
:value="companyInfo?.scale"
></dict-Label>
</view> </view>
</view> </view>
</view> </view>
<view class="conetent-info" :class="{ expanded: isExpanded }"> <view class="conetent-info" :class="{ expanded: isExpanded }">
<view class="info-title">公司介绍</view> <view class="info-title">公司介绍</view>
<view class="info-desirption">{{ <view class="info-desirption">{{
companyInfo.companyIntroduction companyInfo.description
}}</view> }}</view>
<!-- <view class="info-title title2">公司地址</view> <!-- <view class="info-title title2">公司地址</view>
<view class="locationCompany"></view> --> <view class="locationCompany"></view> -->
@@ -46,32 +56,39 @@
<view class="views"> <view class="views">
<view class="Detail-title"><text class="title">在招职位</text></view> <view class="Detail-title"><text class="title">在招职位</text></view>
<template v-if="companyInfo.jobInfoList.length != 0"> <template v-if="companyInfo.jobInfoList.length != 0">
<view v-for="job in companyInfo.jobInfoList" :key="job.id"> <view v-for="job in companyInfo.jobInfoList" :key="job.jobId" class="job-card-wrapper">
<!-- @click="navTo(`/packageA/pages/post/post?jobId=${JSON.stringify(job)}`)" --> <view class="cards" @click="navTo(`/packageA/pages/post/post?jobId=${job.jobId}`)">
<view class="cards" :style="getItemBackgroundStyle('bj2.png')"> <view class="card-header">
<view class="card-company"> <view class="card-title-row">
<text class="company">{{ job.jobTitle }}</text> <text class="job-title">{{ job.jobTitle }}</text>
<view class="salary"> {{ job.salaryRange }}/ </view> <view class="card-pay">
</view> <view class="pay-text">
<view class="card-tags"> <text class="salary-amount">{{ formatSalary(job.minSalary, job.maxSalary) }}</text>
<view class="tag jy"> <text class="salary-unit">/</text>
<image :src="`${baseUrl}/jobfair/jy.png`" mode=""></image> </view>
{{ job.experienceRequirement }} </view>
</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> </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>
</view> </view>
</template> </template>
@@ -90,7 +107,7 @@ import config from "@/config.js";
import { storeToRefs } from "pinia"; import { storeToRefs } from "pinia";
import useLocationStore from "@/stores/useLocationStore"; import useLocationStore from "@/stores/useLocationStore";
const { longitudeVal, latitudeVal } = storeToRefs(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 isExpanded = ref(false);
const pageState = reactive({ const pageState = reactive({
page: 0, page: 0,
@@ -101,9 +118,16 @@ const pageState = reactive({
}); });
const companyInfo = ref({ const companyInfo = ref({
jobInfoList: [], jobInfoList: [],
companyName: '',
scale: '',
industry: '',
description: '',
isCollection: false
}); });
const baseUrl = config.imgBaseUrl; const baseUrl = config.imgBaseUrl;
const companyIdRef = ref(null);
const getItemBackgroundStyle = (imageName) => ({ const getItemBackgroundStyle = (imageName) => ({
backgroundImage: `url(${baseUrl}/jobfair/${imageName})`, backgroundImage: `url(${baseUrl}/jobfair/${imageName})`,
backgroundSize: "100% 100%", // 覆盖整个容器 backgroundSize: "100% 100%", // 覆盖整个容器
@@ -111,14 +135,167 @@ const getItemBackgroundStyle = (imageName) => ({
backgroundRepeat: "no-repeat", 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) => { onLoad((options) => {
companyInfo.value = JSON.parse(options.job); console.log('options',options);
console.log(companyInfo.value, "companyInfo.value"); 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() { function expand() {
isExpanded.value = !isExpanded.value; 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> </script>
<style lang="stylus" scoped> <style lang="stylus" scoped>
@@ -259,93 +436,135 @@ image {
z-index: 1; z-index: 1;
} }
.cards { .job-card-wrapper {
padding: 32rpx;
background: #FFFFFF;
box-shadow: 0rpx 0rpx 8rpx 0rpx rgba(0, 0, 0, 0.04);
border-radius: 20rpx 20rpx 20rpx 20rpx;
margin-top: 22rpx; margin-top: 22rpx;
padding-bottom: 18rpx;
.card-company { &:first-child {
display: flex; margin-top: 0;
justify-content: space-between; }
align-items: flex-start; }
.company { .cards {
font-weight: 600; padding: 30rpx;
font-size: 32rpx; background: #FFFFFF;
color: #333333; box-shadow: 0rpx 2rpx 12rpx 0rpx rgba(0, 0, 0, 0.08);
} border-radius: 24rpx;
transition: all 0.3s ease;
position: relative;
overflow: hidden;
.salary { &:active {
font-weight: 600; transform: scale(0.98);
font-size: 28rpx; box-shadow: 0rpx 1rpx 8rpx 0rpx rgba(0, 0, 0, 0.12);
color: #F83A3C;
white-space: nowrap;
line-height: 48rpx;
}
} }
.card-companyName { .card-header {
font-weight: 400; margin-bottom: 0;
font-size: 28rpx;
color: #fff; .card-title-row {
margin-top: 23rpx; display: flex;
display: flex; justify-content: space-between;
align-items: center; align-items: center;
image{ gap: 20rpx;
width: 24rpx;
height: 24rpx; .job-title {
margin-right: 8rpx; 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;
}
.card-pay {
flex-shrink: 0;
display: flex;
align-items: center;
.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 { .card-tags {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
margin: 25rpx 0 35rpx; gap: 10rpx;
image{ 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; width: 24rpx;
height: 24rpx; height: 24rpx;
margin-right: 8rpx; margin-right: 8rpx;
flex-shrink: 0;
} }
.jy {
background: #D9EDFF;
color: #0086FF;
}
.xl { .tag-text {
background: #FFF1D5; line-height: 1;
color: #FF7F01; }
}
.yd {
background: #FFD8D8;
color: #F83A3C;
}
.tag {
width: fit-content;
height: 30rpx;
border-radius: 4rpx;
padding: 6rpx 20rpx;
line-height: 30rpx;
font-weight: 400;
font-size: 24rpx;
text-align: center;
white-space: nowrap;
margin-right: 20rpx;
display: flex;
align-items: center;
} }
} }
.card-bottom { .card-location {
margin-top: 32rpx;
display: flex; display: flex;
justify-content: space-between; align-items: flex-start;
font-size: 28rpx; margin-top: 20rpx;
color: #6C7282;
.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;
color: #999999;
line-height: 25rpx;
word-break: break-all;
}
} }
} }
} }

View File

@@ -1,10 +1,5 @@
<template> <template>
<AppLayout title="我的浏览" :show-bg-image="false" :use-scroll-view="false"> <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-content">
<view class="collection-search"> <view class="collection-search">
<view class="search-content"> <view class="search-content">

View File

@@ -1,10 +1,5 @@
<template> <template>
<AppLayout title="我的收藏" :show-bg-image="false" :use-scroll-view="false"> <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="collection-content">
<view class="header"> <view class="header">
<view class="button-click" :class="{ active: type === 0 }" @click="changeType(0)">工作职位</view> <view class="button-click" :class="{ active: type === 0 }" @click="changeType(0)">工作职位</view>

View File

@@ -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(() => { onMounted(() => {
if (Object.keys(props.value).length > 0) { // 延迟执行,确保 canvas 已经渲染
rawRadarChart(); setTimeout(() => {
} const { labels, data } = getRadarData();
rawRadarChart(labels, data);
}, 100);
}); });
// 监听 props.value 变化 // 监听 props.value 变化
watch( watch(
() => props.value, () => props.value,
(newVal) => { (newVal) => {
if (newVal && Object.keys(newVal).length > 0) { if (newVal) {
const { skill, experience, education, salary, age, location } = newVal.radarChart; // 延迟执行,确保数据更新完成
const labels = ['学历', '年龄', '工作地', '技能', '工作经验', '期望薪资']; setTimeout(() => {
const data = [education, age, location, skill, experience, salary].map((item) => item * 0.05); const { labels, data } = getRadarData();
rawRadarChart(labels, data); rawRadarChart(labels, data);
}, 50);
} }
}, },
{ deep: true, immediate: false } // deep 递归监听对象内部变化 { deep: true, immediate: true } // deep 递归监听对象内部变化immediate 立即执行一次
); );
function rawRadarChart(labels, data) { function rawRadarChart(labels, data) {

View File

@@ -208,7 +208,20 @@ const jobInfo = ref({});
const state = reactive({}); const state = reactive({});
const mapCovers = ref([]); const mapCovers = ref([]);
const jobIdRef = 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 videoPalyerRef = ref(null);
const explainUrlRef = ref(''); const explainUrlRef = ref('');
@@ -246,10 +259,17 @@ onLoad((option) => {
}); });
onShow(() => { onShow(() => {
const option = parseQueryParams(); // 兼容微信内置浏览器 // 仅在 H5 环境中从 URL 获取参数(小程序环境中 onShow 不会传递 URL 参数)
if (option.jobId) { // #ifdef H5
initLoad(option); try {
const option = parseQueryParams(); // 兼容微信内置浏览器
if (option.jobId) {
initLoad(option);
}
} catch (e) {
console.warn('onShow 中解析 URL 参数失败:', e);
} }
// #endif
}); });
function initLoad(option) { function initLoad(option) {
@@ -317,8 +337,59 @@ function getTextWidth(text, size = 12) {
function getCompetivetuveness(jobId) { function getCompetivetuveness(jobId) {
$api.createRequest(`/app/job/competitiveness/${jobId}`, {}, 'GET').then((resData) => { $api.createRequest(`/app/job/competitiveness/${jobId}`, {}, 'GET').then((resData) => {
raderData.value = resData.data; // 如果接口返回的数据为 null 或空使用默认值0
currentStep.value = resData.data.matchScore * 0.04; 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;
}); });
} }

View File

@@ -4,9 +4,9 @@
"path": "pages/index/index", "path": "pages/index/index",
"style": { "style": {
"navigationBarTitleText": "喀什智慧就业平台", "navigationBarTitleText": "喀什智慧就业平台",
"navigationBarTitleTextSize": "30rpx", "navigationBarTitleTextSize": "30rpx"
// #ifdef H5 // #ifdef H5
"navigationStyle": "custom" //"navigationStyle": "custom"
// #endif // #endif
} }
}, },
@@ -14,8 +14,8 @@
"path": "pages/mine/mine", "path": "pages/mine/mine",
"style": { "style": {
"navigationBarTitleText": "我的", "navigationBarTitleText": "我的",
"navigationBarTitleTextSize": "30rpx", "navigationBarTitleTextSize": "30rpx"
"navigationStyle": "custom" //"navigationStyle": "custom"
} }
}, },
{ {
@@ -23,7 +23,7 @@
"style": { "style": {
"navigationBarTitleText": "消息", "navigationBarTitleText": "消息",
"navigationBarTitleTextSize": "30rpx" "navigationBarTitleTextSize": "30rpx"
// "navigationStyle": "custom", //"navigationStyle": "custom",
// "enablePullDownRefresh": false // "enablePullDownRefresh": false
} }
}, },
@@ -32,7 +32,7 @@
"style": { "style": {
"navigationBarTitleText": "招聘会", "navigationBarTitleText": "招聘会",
"navigationBarTitleTextSize": "30rpx" "navigationBarTitleTextSize": "30rpx"
// "navigationStyle": "custom" //"navigationStyle": "custom"
} }
}, },
{ {
@@ -40,7 +40,7 @@
"style": { "style": {
"navigationBarTitleText": "补全信息", "navigationBarTitleText": "补全信息",
"navigationBarTitleTextSize": "30rpx" "navigationBarTitleTextSize": "30rpx"
// "navigationStyle": "custom" //"navigationStyle": "custom"
} }
}, },
{ {
@@ -48,14 +48,14 @@
"style": { "style": {
"navigationBarTitleText": "企业信息", "navigationBarTitleText": "企业信息",
"navigationBarTitleTextSize": "30rpx" "navigationBarTitleTextSize": "30rpx"
// "navigationStyle": "custom" //"navigationStyle": "custom"
} }
}, },
{ {
"path": "pages/complete-info/components/map-location-picker", "path": "pages/complete-info/components/map-location-picker",
"style": { "style": {
"navigationBarTitleText": "选择地址", "navigationBarTitleText": "选择地址"
"navigationStyle": "custom" //"navigationStyle": "custom"
} }
}, },
{ {
@@ -63,57 +63,57 @@
"style": { "style": {
"navigationBarTitleText": "附近", "navigationBarTitleText": "附近",
"navigationBarBackgroundColor": "#4778EC", "navigationBarBackgroundColor": "#4778EC",
"navigationBarTextStyle": "white", "navigationBarTextStyle": "white"
"navigationStyle": "custom" //"navigationStyle": "custom"
} }
}, },
{ {
"path": "pages/test/userTypeTest", "path": "pages/test/userTypeTest",
"style": { "style": {
"navigationBarTitleText": "用户类型测试", "navigationBarTitleText": "用户类型测试",
"navigationStyle": "custom" //"navigationStyle": "custom"
} }
}, },
{ {
"path": "pages/test/tabbar-test", "path": "pages/test/tabbar-test",
"style": { "style": {
"navigationBarTitleText": "TabBar测试", "navigationBarTitleText": "TabBar测试",
"navigationStyle": "custom" //"navigationStyle": "custom"
} }
}, },
{ {
"path": "pages/test/homepage-test", "path": "pages/test/homepage-test",
"style": { "style": {
"navigationBarTitleText": "首页内容测试", "navigationBarTitleText": "首页内容测试",
"navigationStyle": "custom" //"navigationStyle": "custom"
} }
}, },
{ {
"path": "pages/test/tabbar-user-type-test", "path": "pages/test/tabbar-user-type-test",
"style": { "style": {
"navigationBarTitleText": "TabBar用户类型测试", "navigationBarTitleText": "TabBar用户类型测试",
"navigationStyle": "custom" //"navigationStyle": "custom"
} }
}, },
{ {
"path": "pages/test/company-search-test", "path": "pages/test/company-search-test",
"style": { "style": {
"navigationBarTitleText": "企业搜索功能测试", "navigationBarTitleText": "企业搜索功能测试",
"navigationStyle": "custom" //"navigationStyle": "custom"
} }
}, },
{ {
"path": "pages/test/company-mine-test", "path": "pages/test/company-mine-test",
"style": { "style": {
"navigationBarTitleText": "企业我的页面测试", "navigationBarTitleText": "企业我的页面测试",
"navigationStyle": "custom" //"navigationStyle": "custom"
} }
}, },
{ {
"path": "pages/job/publishJob", "path": "pages/job/publishJob",
"style": { "style": {
"navigationBarTitleText": "发布岗位" "navigationBarTitleText": "发布岗位"
// "navigationStyle": "custom", //"navigationStyle": "custom",
// "disableScroll": false, // "disableScroll": false,
// "enablePullDownRefresh": false, // "enablePullDownRefresh": false,
// "onReachBottomDistance": 50, // "onReachBottomDistance": 50,
@@ -124,7 +124,7 @@
"path": "pages/job/companySearch", "path": "pages/job/companySearch",
"style": { "style": {
"navigationBarTitleText": "选择企业", "navigationBarTitleText": "选择企业",
"navigationStyle": "custom", //"navigationStyle": "custom",
"disableScroll": false, "disableScroll": false,
"enablePullDownRefresh": false, "enablePullDownRefresh": false,
"backgroundColor": "#f5f5f5" "backgroundColor": "#f5f5f5"
@@ -139,7 +139,7 @@
"navigationBarTextStyle": "white", "navigationBarTextStyle": "white",
"enablePullDownRefresh": false "enablePullDownRefresh": false
// #ifdef H5 // #ifdef H5
// "navigationStyle": "custom" //"navigationStyle": "custom"
//#endif //#endif
} }
}, },
@@ -147,7 +147,7 @@
"path": "pages/search/search", "path": "pages/search/search",
"style": { "style": {
"navigationBarTitleText": "" "navigationBarTitleText": ""
// "navigationStyle": "custom" //"navigationStyle": "custom"
} }
}, },
{ {
@@ -155,7 +155,7 @@
"style": { "style": {
"navigationBarTitleText": "我的", "navigationBarTitleText": "我的",
"navigationBarTitleTextSize": "30rpx" "navigationBarTitleTextSize": "30rpx"
// "navigationStyle": "custom" //"navigationStyle": "custom"
} }
}, },
{ {
@@ -183,15 +183,15 @@
{ {
"navigationBarTitleText" : "添加工作经历", "navigationBarTitleText" : "添加工作经历",
"navigationBarTitleTextSize": "30rpx" "navigationBarTitleTextSize": "30rpx"
// "navigationStyle": "custom" //"navigationStyle": "custom"
} }
},{ },{
"path": "pages/choiceness/choiceness", "path": "pages/choiceness/choiceness",
"style": { "style": {
"navigationBarTitleText": "精选", "navigationBarTitleText": "精选",
"navigationBarBackgroundColor": "#4778EC", "navigationBarBackgroundColor": "#4778EC",
"navigationBarTextStyle": "white", "navigationBarTextStyle": "white"
"navigationStyle": "custom" //"navigationStyle": "custom"
} }
}, { }, {
"path": "pages/post/post", "path": "pages/post/post",
@@ -206,7 +206,7 @@
"navigationBarTitleText": "单位详情" "navigationBarTitleText": "单位详情"
// "navigationBarBackgroundColor": "#4778EC", // "navigationBarBackgroundColor": "#4778EC",
// "navigationBarTextStyle": "white" // "navigationBarTextStyle": "white"
// "navigationStyle": "custom" //"navigationStyle": "custom"
} }
}, { }, {
"path": "pages/exhibitors/exhibitors", "path": "pages/exhibitors/exhibitors",
@@ -214,7 +214,7 @@
"navigationBarTitleText": "参展单位", "navigationBarTitleText": "参展单位",
"navigationBarBackgroundColor": "#FFFFFF", "navigationBarBackgroundColor": "#FFFFFF",
"navigationBarTextStyle": "black" "navigationBarTextStyle": "black"
// "navigationStyle": "custom" //"navigationStyle": "custom"
} }
}, { }, {
"path": "pages/myResume/myResume", "path": "pages/myResume/myResume",
@@ -235,8 +235,8 @@
"style": { "style": {
"navigationBarTitleText": "我的收藏", "navigationBarTitleText": "我的收藏",
"navigationBarTitleTextSize": "30rpx", "navigationBarTitleTextSize": "30rpx",
"navigationBarBackgroundColor": "#FFFFFF", "navigationBarBackgroundColor": "#FFFFFF"
"navigationStyle": "custom" //"navigationStyle": "custom"
} }
}, },
{ {
@@ -244,31 +244,31 @@
"style": { "style": {
"navigationBarTitleText": "我的浏览", "navigationBarTitleText": "我的浏览",
"navigationBarTitleTextSize": "30rpx", "navigationBarTitleTextSize": "30rpx",
"navigationBarBackgroundColor": "#FFFFFF", "navigationBarBackgroundColor": "#FFFFFF"
"navigationStyle": "custom" //"navigationStyle": "custom"
} }
}, },
{ {
"path": "pages/addPosition/addPosition", "path": "pages/addPosition/addPosition",
"style": { "style": {
"navigationBarTitleText": "添加岗位", "navigationBarTitleText": "添加岗位",
"navigationBarTitleTextSize": "30rpx", "navigationBarTitleTextSize": "30rpx"
"navigationStyle": "custom" //"navigationStyle": "custom"
} }
}, },
{ {
"path": "pages/selectDate/selectDate", "path": "pages/selectDate/selectDate",
"style": { "style": {
"navigationBarTitleText": "", "navigationBarTitleText": ""
"navigationStyle": "custom" //"navigationStyle": "custom"
} }
}, },
{ {
"path": "pages/personalInfo/personalInfo", "path": "pages/personalInfo/personalInfo",
"style": { "style": {
"navigationBarTitleText": "个人信息", "navigationBarTitleText": "个人信息",
"navigationBarTitleTextSize": "30rpx", "navigationBarTitleTextSize": "30rpx"
"navigationStyle": "custom" //"navigationStyle": "custom"
} }
}, },
{ {
@@ -276,7 +276,7 @@
"style": { "style": {
"navigationBarTitleText": "求职期望", "navigationBarTitleText": "求职期望",
"navigationBarTitleTextSize": "30rpx" "navigationBarTitleTextSize": "30rpx"
// "navigationStyle": "custom" //"navigationStyle": "custom"
} }
}, },
{ {
@@ -292,8 +292,8 @@
"style": { "style": {
"navigationBarTitleText": "精选企业", "navigationBarTitleText": "精选企业",
"navigationBarTitleTextSize": "30rpx", "navigationBarTitleTextSize": "30rpx",
"navigationBarBackgroundColor": "#FFFFFF", "navigationBarBackgroundColor": "#FFFFFF"
"navigationStyle": "custom" //"navigationStyle": "custom"
} }
}, },
{ {
@@ -316,8 +316,8 @@
"path": "pages/tiktok/tiktok", "path": "pages/tiktok/tiktok",
"style": { "style": {
"navigationBarTitleText": "", "navigationBarTitleText": "",
"navigationBarBackgroundColor": "#FFFFFF", "navigationBarBackgroundColor": "#FFFFFF"
"navigationStyle": "custom" //"navigationStyle": "custom"
} }
}, },
{ {
@@ -355,7 +355,7 @@
{ {
"navigationBarTitleText" : "招聘会详情", "navigationBarTitleText" : "招聘会详情",
"navigationBarTitleTextSize": "30rpx" "navigationBarTitleTextSize": "30rpx"
// "navigationStyle": "custom" //"navigationStyle": "custom"
} }
}, },
{ {
@@ -364,7 +364,7 @@
{ {
"navigationBarTitleText" : "登录", "navigationBarTitleText" : "登录",
"navigationBarTitleTextSize": "30rpx" "navigationBarTitleTextSize": "30rpx"
// "navigationStyle": "custom" //"navigationStyle": "custom"
} }
}, },
{ {
@@ -373,7 +373,7 @@
{ {
"navigationBarTitleText" : "技能评价", "navigationBarTitleText" : "技能评价",
"navigationBarTitleTextSize": "30rpx" "navigationBarTitleTextSize": "30rpx"
// "navigationStyle": "custom" //"navigationStyle": "custom"
} }
}, },
{ {
@@ -382,7 +382,7 @@
{ {
"navigationBarTitleText" : "专项训练", "navigationBarTitleText" : "专项训练",
"navigationBarTitleTextSize": "30rpx" "navigationBarTitleTextSize": "30rpx"
// "navigationStyle": "custom" //"navigationStyle": "custom"
} }
}, },
{ {
@@ -391,7 +391,7 @@
{ {
"navigationBarTitleText" : "视频学习", "navigationBarTitleText" : "视频学习",
"navigationBarTitleTextSize": "30rpx" "navigationBarTitleTextSize": "30rpx"
// "navigationStyle": "custom" //"navigationStyle": "custom"
} }
}, },
{ {
@@ -400,7 +400,7 @@
{ {
"navigationBarTitleText" : "视频详情", "navigationBarTitleText" : "视频详情",
"navigationBarTitleTextSize": "30rpx" "navigationBarTitleTextSize": "30rpx"
// "navigationStyle": "custom" //"navigationStyle": "custom"
} }
}, },
{ {
@@ -409,7 +409,7 @@
{ {
"navigationBarTitleText" : "模拟考试", "navigationBarTitleText" : "模拟考试",
"navigationBarTitleTextSize": "30rpx" "navigationBarTitleTextSize": "30rpx"
// "navigationStyle": "custom" //"navigationStyle": "custom"
} }
}, },
{ {
@@ -418,7 +418,7 @@
{ {
"navigationBarTitleText" : "查看成绩", "navigationBarTitleText" : "查看成绩",
"navigationBarTitleTextSize": "30rpx" "navigationBarTitleTextSize": "30rpx"
// "navigationStyle": "custom" //"navigationStyle": "custom"
} }
} }
] ]
@@ -508,7 +508,7 @@
"backgroundColor": "#F8F8F8", "backgroundColor": "#F8F8F8",
"navigationBarTitleTextSize": "18px" "navigationBarTitleTextSize": "18px"
// "enablePullDownRefresh": false, // "enablePullDownRefresh": false,
// "navigationStyle": "custom" //"navigationStyle": "custom"
}, },
"easycom": { "easycom": {
"autoscan": true, "autoscan": true,

View File

@@ -701,9 +701,43 @@ const handleServiceClick = (serviceType) => {
} }
}; };
// 处理直播按钮点击 // 处理直播按钮点击 - 跳转微信视频号
const handleLiveClick = () => { 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
}; };
// 跳转到测试页面 // 跳转到测试页面

View File

@@ -1,5 +1,5 @@
<template> <template>
<AppLayout title="我的" back-gorund-color="#F4F4F4"> <AppLayout back-gorund-color="#F4F4F4">
<!-- 自定义tabbar --> <!-- 自定义tabbar -->
<CustomTabBar :currentPage="4" /> <CustomTabBar :currentPage="4" />
<!-- 企业用户信息卡片 --> <!-- 企业用户信息卡片 -->

View File

@@ -1,5 +1,5 @@
<template> <template>
<AppLayout title="附近" :use-scroll-view="false"> <AppLayout :use-scroll-view="false">
<template #headerleft> <template #headerleft>
<view class="btnback"> <view class="btnback">
<image src="@/static/icon/back.png" @click="navBack"></image> <image src="@/static/icon/back.png" @click="navBack"></image>
@@ -19,10 +19,10 @@
<component :is="components[index]" :ref="(el) => handelComponentsRef(el, index)" /> <component :is="components[index]" :ref="(el) => handelComponentsRef(el, index)" />
<!-- #endif --> <!-- #endif -->
<!-- #ifdef MP-WEIXIN --> <!-- #ifdef MP-WEIXIN -->
<oneComponent v-show="currentIndex === 0" :ref="(el) => handelComponentsRef(el, index)" /> <oneComponent v-if="index === 0" :ref="(el) => handelComponentsRef(el, index)" />
<twoComponent v-show="currentIndex === 1" :ref="(el) => handelComponentsRef(el, index)" /> <twoComponent v-if="index === 1" :ref="(el) => handelComponentsRef(el, index)" />
<threeComponent v-show="currentIndex === 2" :ref="(el) => handelComponentsRef(el, index)" /> <threeComponent v-if="index === 2" :ref="(el) => handelComponentsRef(el, index)" />
<fourComponent v-show="currentIndex === 3" :ref="(el) => handelComponentsRef(el, index)" /> <fourComponent v-if="index === 3" :ref="(el) => handelComponentsRef(el, index)" />
<!-- #endif --> <!-- #endif -->
</swiper-item> </swiper-item>
</swiper> </swiper>