diff --git a/package-lock.json b/package-lock.json index 6e2278d..be866e3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,38 @@ { "requires": true, - "lockfileVersion": 1, + "packages": { + "": { + "dependencies": { + "@dcloudio/uni-ui": "^1.5.11", + "dayjs": "^1.11.19", + "sm-crypto": "^0.3.13" + } + }, + "node_modules/@dcloudio/uni-ui": { + "version": "1.5.11", + "resolved": "https://registry.npmjs.org/@dcloudio/uni-ui/-/uni-ui-1.5.11.tgz", + "integrity": "sha512-DBtk046ofmeFd82zRI7d89SoEwrAxYzUN3WVPm1DIBkpLPG5F5QDNkHMnZGu2wNrMEmGBjBpUh3vqEY1L3jaMw==" + }, + "node_modules/dayjs": { + "version": "1.11.19", + "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.19.tgz", + "integrity": "sha512-t5EcLVS6QPBNqM2z8fakk/NKel+Xzshgt8FFKAn+qwlD1pzZWxh0nVCrvFK7ZDb6XucZeF9z8C7CBWTRIVApAw==" + }, + "node_modules/jsbn": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-1.1.0.tgz", + "integrity": "sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==" + }, + "node_modules/sm-crypto": { + "version": "0.3.13", + "resolved": "https://registry.npmmirror.com/sm-crypto/-/sm-crypto-0.3.13.tgz", + "integrity": "sha512-ztNF+pZq6viCPMA1A6KKu3bgpkmYti5avykRHbcFIdSipFdkVmfUw2CnpM2kBJyppIalqvczLNM3wR8OQ0pT5w==", + "license": "MIT", + "dependencies": { + "jsbn": "^1.1.0" + } + } + }, "dependencies": { "@dcloudio/uni-ui": { "version": "1.5.11", @@ -19,7 +51,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" diff --git a/packageA/pages/UnitDetails/UnitDetails.vue b/packageA/pages/UnitDetails/UnitDetails.vue index c11cc7d..61eba48 100644 --- a/packageA/pages/UnitDetails/UnitDetails.vue +++ b/packageA/pages/UnitDetails/UnitDetails.vue @@ -21,15 +21,25 @@ {{ companyInfo?.companyName }} - - {{ companyInfo?.scale }} + + +  ·  + 公司介绍 {{ - companyInfo.companyIntroduction + companyInfo.description }} @@ -46,32 +56,39 @@ 在招职位 @@ -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) + '...'; +} diff --git a/pages.json b/pages.json index 6a77234..2a0177b 100644 --- a/pages.json +++ b/pages.json @@ -1,21 +1,17 @@ { - "pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages + "pages": [ { "path": "pages/index/index", "style": { "navigationBarTitleText": "喀什智慧就业平台", - "navigationBarTitleTextSize": "30rpx", - // #ifdef H5 - "navigationStyle": "custom" - // #endif + "navigationBarTitleTextSize": "30rpx" } }, { "path": "pages/mine/mine", "style": { "navigationBarTitleText": "我的", - "navigationBarTitleTextSize": "30rpx", - "navigationStyle": "custom" + "navigationBarTitleTextSize": "30rpx" } }, { @@ -23,8 +19,6 @@ "style": { "navigationBarTitleText": "消息", "navigationBarTitleTextSize": "30rpx" - // "navigationStyle": "custom", - // "enablePullDownRefresh": false } }, { @@ -32,7 +26,6 @@ "style": { "navigationBarTitleText": "招聘会", "navigationBarTitleTextSize": "30rpx" - // "navigationStyle": "custom" } }, { @@ -40,7 +33,6 @@ "style": { "navigationBarTitleText": "补全信息", "navigationBarTitleTextSize": "30rpx" - // "navigationStyle": "custom" } }, { @@ -48,14 +40,12 @@ "style": { "navigationBarTitleText": "企业信息", "navigationBarTitleTextSize": "30rpx" - // "navigationStyle": "custom" } }, { "path": "pages/complete-info/components/map-location-picker", "style": { - "navigationBarTitleText": "选择地址", - "navigationStyle": "custom" + "navigationBarTitleText": "选择地址" } }, { @@ -63,68 +53,55 @@ "style": { "navigationBarTitleText": "附近", "navigationBarBackgroundColor": "#4778EC", - "navigationBarTextStyle": "white", - "navigationStyle": "custom" + "navigationBarTextStyle": "white" } }, { "path": "pages/test/userTypeTest", "style": { - "navigationBarTitleText": "用户类型测试", - "navigationStyle": "custom" + "navigationBarTitleText": "用户类型测试" } }, { "path": "pages/test/tabbar-test", "style": { - "navigationBarTitleText": "TabBar测试", - "navigationStyle": "custom" + "navigationBarTitleText": "TabBar测试" } }, { "path": "pages/test/homepage-test", "style": { - "navigationBarTitleText": "首页内容测试", - "navigationStyle": "custom" + "navigationBarTitleText": "首页内容测试" } }, { "path": "pages/test/tabbar-user-type-test", "style": { - "navigationBarTitleText": "TabBar用户类型测试", - "navigationStyle": "custom" + "navigationBarTitleText": "TabBar用户类型测试" } }, { "path": "pages/test/company-search-test", "style": { - "navigationBarTitleText": "企业搜索功能测试", - "navigationStyle": "custom" + "navigationBarTitleText": "企业搜索功能测试" } }, { "path": "pages/test/company-mine-test", "style": { - "navigationBarTitleText": "企业我的页面测试", - "navigationStyle": "custom" + "navigationBarTitleText": "企业我的页面测试" } }, { "path": "pages/job/publishJob", "style": { "navigationBarTitleText": "发布岗位" - // "navigationStyle": "custom", - // "disableScroll": false, - // "enablePullDownRefresh": false, - // "onReachBottomDistance": 50, - // "backgroundColor": "#f5f5f5" } }, { "path": "pages/job/companySearch", "style": { "navigationBarTitleText": "选择企业", - "navigationStyle": "custom", "disableScroll": false, "enablePullDownRefresh": false, "backgroundColor": "#f5f5f5" @@ -138,16 +115,12 @@ "navigationBarBackgroundColor": "#4778EC", "navigationBarTextStyle": "white", "enablePullDownRefresh": false - // #ifdef H5 - // "navigationStyle": "custom" - //#endif } }, { "path": "pages/search/search", "style": { "navigationBarTitleText": "" - // "navigationStyle": "custom" } }, { @@ -155,7 +128,6 @@ "style": { "navigationBarTitleText": "我的", "navigationBarTitleTextSize": "30rpx" - // "navigationStyle": "custom" } }, { @@ -172,454 +144,463 @@ "navigationBarTitleTextSize": "30rpx" } } - ], - "subpackages": [{ - "root": "packageA", - "pages": [ - { - "path" : "pages/addWorkExperience/addWorkExperience", - "style" : + "subpackages": [ + { + "root": "packageA", + "pages": [ { - "navigationBarTitleText" : "添加工作经历", - "navigationBarTitleTextSize": "30rpx" - // "navigationStyle": "custom" - } - },{ - "path": "pages/choiceness/choiceness", - "style": { - "navigationBarTitleText": "精选", - "navigationBarBackgroundColor": "#4778EC", - "navigationBarTextStyle": "white", - "navigationStyle": "custom" - } - }, { - "path": "pages/post/post", - "style": { - "navigationBarTitleText": "职位详情", - "navigationBarBackgroundColor": "#4778EC", - "navigationBarTextStyle": "white" - } - }, { - "path": "pages/UnitDetails/UnitDetails", - "style": { - "navigationBarTitleText": "单位详情" - // "navigationBarBackgroundColor": "#4778EC", - // "navigationBarTextStyle": "white" - // "navigationStyle": "custom" - } - }, { - "path": "pages/exhibitors/exhibitors", - "style": { - "navigationBarTitleText": "参展单位", - "navigationBarBackgroundColor": "#FFFFFF", - "navigationBarTextStyle": "black" - // "navigationStyle": "custom" - } - }, { - "path": "pages/myResume/myResume", - "style": { - "navigationBarTitleText": "我的简历", - "navigationBarTitleTextSize": "30rpx", - "navigationBarBackgroundColor": "#FFFFFF" - } - }, { - "path": "pages/Intendedposition/Intendedposition", - "style": { - "navigationBarTitleText": "投递记录", - "navigationBarTitleTextSize": "30rpx", - "navigationBarBackgroundColor": "#FFFFFF" - } - }, { - "path": "pages/collection/collection", - "style": { - "navigationBarTitleText": "我的收藏", - "navigationBarTitleTextSize": "30rpx", - "navigationBarBackgroundColor": "#FFFFFF", - "navigationStyle": "custom" - } - }, - { - "path": "pages/browseJob/browseJob", - "style": { - "navigationBarTitleText": "我的浏览", - "navigationBarTitleTextSize": "30rpx", - "navigationBarBackgroundColor": "#FFFFFF", - "navigationStyle": "custom" - } - }, - { - "path": "pages/addPosition/addPosition", - "style": { - "navigationBarTitleText": "添加岗位", - "navigationBarTitleTextSize": "30rpx", - "navigationStyle": "custom" - } - }, - { - "path": "pages/selectDate/selectDate", - "style": { - "navigationBarTitleText": "", - "navigationStyle": "custom" - } - }, - { - "path": "pages/personalInfo/personalInfo", - "style": { - "navigationBarTitleText": "个人信息", - "navigationBarTitleTextSize": "30rpx", - "navigationStyle": "custom" - } - }, - { - "path": "pages/jobExpect/jobExpect", - "style": { - "navigationBarTitleText": "求职期望", - "navigationBarTitleTextSize": "30rpx" - // "navigationStyle": "custom" - } - }, - { - "path": "pages/reservation/reservation", - "style": { - "navigationBarTitleText": "我的预约", - "navigationBarTitleTextSize": "30rpx", - "navigationBarBackgroundColor": "#FFFFFF" - } - }, - { - "path": "pages/choicenessList/choicenessList", - "style": { - "navigationBarTitleText": "精选企业", - "navigationBarTitleTextSize": "30rpx", - "navigationBarBackgroundColor": "#FFFFFF", - "navigationStyle": "custom" - } - }, - { - "path": "pages/newJobPosition/newJobPosition", - "style": { - "navigationBarTitleText": "新职位推荐", - "navigationBarTitleTextSize": "30rpx", - "navigationBarBackgroundColor": "#FFFFFF" - } - }, - { - "path": "pages/systemNotification/systemNotification", - "style": { - "navigationBarTitleText": "系统通知", - "navigationBarTitleTextSize": "30rpx", - "navigationBarBackgroundColor": "#FFFFFF" - } - }, - { - "path": "pages/tiktok/tiktok", - "style": { - "navigationBarTitleText": "", - "navigationBarBackgroundColor": "#FFFFFF", - "navigationStyle": "custom" - } - }, - { - "path": "pages/moreJobs/moreJobs", - "style": { - "navigationBarTitleText": "更多岗位", - "navigationBarTitleTextSize": "30rpx", - "navigationBarBackgroundColor": "#FFFFFF" - } - }, - { - "path": "pages/collection/compare", - "style": { - "navigationBarTitleText": " 岗位对比", - "navigationBarTitleTextSize": "30rpx", - "navigationBarBackgroundColor": "#FFFFFF" - } - }, - { - "path": "pages/myResume/corporateInformation", - "style": { - "navigationBarTitleText": " 企业详情", - "navigationBarTitleTextSize": "30rpx", - "navigationBarBackgroundColor": "#FFFFFF" - } - } - ] - }, - { - "root": "packageB", - "pages": [ - { - "path" : "jobFair/detail", - "style" : - { - "navigationBarTitleText" : "招聘会详情", - "navigationBarTitleTextSize": "30rpx" - // "navigationStyle": "custom" - } - }, - { - "path" : "login", - "style" : - { - "navigationBarTitleText" : "登录", - "navigationBarTitleTextSize": "30rpx" - // "navigationStyle": "custom" - } - }, - { - "path" : "train/index", - "style" : - { - "navigationBarTitleText" : "技能评价", - "navigationBarTitleTextSize": "30rpx" - // "navigationStyle": "custom" - } - }, - { - "path" : "train/practice/startPracticing", - "style" : - { - "navigationBarTitleText" : "专项训练", - "navigationBarTitleTextSize": "30rpx" - // "navigationStyle": "custom" - } - }, - { - "path" : "train/video/videoList", - "style" : - { - "navigationBarTitleText" : "视频学习", - "navigationBarTitleTextSize": "30rpx" - // "navigationStyle": "custom" - } - }, - { - "path" : "train/video/videoDetail", - "style" : - { - "navigationBarTitleText" : "视频详情", - "navigationBarTitleTextSize": "30rpx" - // "navigationStyle": "custom" - } - }, - { - "path" : "train/mockExam/examList", - "style" : - { - "navigationBarTitleText" : "模拟考试", - "navigationBarTitleTextSize": "30rpx" - // "navigationStyle": "custom" - } - }, - { - "path" : "train/mockExam/viewGrades", - "style" : - { - "navigationBarTitleText" : "查看成绩", - "navigationBarTitleTextSize": "30rpx" - // "navigationStyle": "custom" - } - } - ] - }, - { - "root": "packageRc", - "pages": [ - { - "path" : "pages/index/index", - "style" : + "path": "pages/addWorkExperience/addWorkExperience", + "style": { + "navigationBarTitleText": "添加工作经历", + "navigationBarTitleTextSize": "30rpx" + } + }, { - "navigationBarTitleText" : "高校毕业生智慧就业" + "path": "pages/choiceness/choiceness", + "style": { + "navigationBarTitleText": "精选", + "navigationBarBackgroundColor": "#4778EC", + "navigationBarTextStyle": "white" + } + }, + { + "path": "pages/post/post", + "style": { + "navigationBarTitleText": "职位详情", + "navigationBarBackgroundColor": "#4778EC", + "navigationBarTextStyle": "white" + } + }, + { + "path": "pages/UnitDetails/UnitDetails", + "style": { + "navigationBarTitleText": "单位详情" + } + }, + { + "path": "pages/exhibitors/exhibitors", + "style": { + "navigationBarTitleText": "参展单位", + "navigationBarBackgroundColor": "#FFFFFF", + "navigationBarTextStyle": "black" + } + }, + { + "path": "pages/myResume/myResume", + "style": { + "navigationBarTitleText": "我的简历", + "navigationBarTitleTextSize": "30rpx", + "navigationBarBackgroundColor": "#FFFFFF" + } + }, + { + "path": "pages/Intendedposition/Intendedposition", + "style": { + "navigationBarTitleText": "投递记录", + "navigationBarTitleTextSize": "30rpx", + "navigationBarBackgroundColor": "#FFFFFF" + } + }, + { + "path": "pages/collection/collection", + "style": { + "navigationBarTitleText": "我的收藏", + "navigationBarTitleTextSize": "30rpx", + "navigationBarBackgroundColor": "#FFFFFF" + } + }, + { + "path": "pages/browseJob/browseJob", + "style": { + "navigationBarTitleText": "我的浏览", + "navigationBarTitleTextSize": "30rpx", + "navigationBarBackgroundColor": "#FFFFFF" + } + }, + { + "path": "pages/addPosition/addPosition", + "style": { + "navigationBarTitleText": "添加岗位", + "navigationBarTitleTextSize": "30rpx" + } + }, + { + "path": "pages/selectDate/selectDate", + "style": { + "navigationBarTitleText": "" + } + }, + { + "path": "pages/personalInfo/personalInfo", + "style": { + "navigationBarTitleText": "个人信息", + "navigationBarTitleTextSize": "30rpx" + } + }, + { + "path": "pages/jobExpect/jobExpect", + "style": { + "navigationBarTitleText": "求职期望", + "navigationBarTitleTextSize": "30rpx" + } + }, + { + "path": "pages/reservation/reservation", + "style": { + "navigationBarTitleText": "我的预约", + "navigationBarTitleTextSize": "30rpx", + "navigationBarBackgroundColor": "#FFFFFF" + } + }, + { + "path": "pages/choicenessList/choicenessList", + "style": { + "navigationBarTitleText": "精选企业", + "navigationBarTitleTextSize": "30rpx", + "navigationBarBackgroundColor": "#FFFFFF" + } + }, + { + "path": "pages/newJobPosition/newJobPosition", + "style": { + "navigationBarTitleText": "新职位推荐", + "navigationBarTitleTextSize": "30rpx", + "navigationBarBackgroundColor": "#FFFFFF" + } + }, + { + "path": "pages/systemNotification/systemNotification", + "style": { + "navigationBarTitleText": "系统通知", + "navigationBarTitleTextSize": "30rpx", + "navigationBarBackgroundColor": "#FFFFFF" + } + }, + { + "path": "pages/tiktok/tiktok", + "style": { + "navigationBarTitleText": "", + "navigationBarBackgroundColor": "#FFFFFF" + } + }, + { + "path": "pages/moreJobs/moreJobs", + "style": { + "navigationBarTitleText": "更多岗位", + "navigationBarTitleTextSize": "30rpx", + "navigationBarBackgroundColor": "#FFFFFF" + } + }, + { + "path": "pages/collection/compare", + "style": { + "navigationBarTitleText": " 岗位对比", + "navigationBarTitleTextSize": "30rpx", + "navigationBarBackgroundColor": "#FFFFFF" + } + }, + { + "path": "pages/myResume/corporateInformation", + "style": { + "navigationBarTitleText": " 企业详情", + "navigationBarTitleTextSize": "30rpx", + "navigationBarBackgroundColor": "#FFFFFF" + } } - } , { - "path": "pages/personalList/personalList", - "style": { - "navigationBarTitleText": "添加帮扶" + ] + }, + { + "root": "packageB", + "pages": [ + { + "path": "jobFair/detail", + "style": { + "navigationBarTitleText": "招聘会详情", + "navigationBarTitleTextSize": "30rpx" + } + }, + { + "path": "login", + "style": { + "navigationBarTitleText": "登录", + "navigationBarTitleTextSize": "30rpx" + } + }, + { + "path": "train/index", + "style": { + "navigationBarTitleText": "技能评价", + "navigationBarTitleTextSize": "30rpx" + } + }, + { + "path": "train/practice/startPracticing", + "style": { + "navigationBarTitleText": "专项训练", + "navigationBarTitleTextSize": "30rpx" + } + }, + { + "path": "train/video/videoList", + "style": { + "navigationBarTitleText": "视频学习", + "navigationBarTitleTextSize": "30rpx" + } + }, + { + "path": "train/video/videoDetail", + "style": { + "navigationBarTitleText": "视频详情", + "navigationBarTitleTextSize": "30rpx" + } + }, + { + "path": "train/mockExam/examList", + "style": { + "navigationBarTitleText": "模拟考试", + "navigationBarTitleTextSize": "30rpx" + } + }, + { + "path": "train/mockExam/viewGrades", + "style": { + "navigationBarTitleText": "查看成绩", + "navigationBarTitleTextSize": "30rpx" + } } - },{ - "path": "pages/daiban/daiban", - "style": { - "navigationBarTitleText": "待办任务" + ] + }, + { + "root": "packageRc", + "pages": [ + { + "path": "pages/index/index", + "style": { + "navigationBarTitleText": "高校毕业生智慧就业" + } + }, + { + "path": "pages/personalList/personalList", + "style": { + "navigationBarTitleText": "添加帮扶" + } + }, + { + "path": "pages/daiban/daiban", + "style": { + "navigationBarTitleText": "待办任务" + } + }, + { + "path": "pages/daiban/daibandetail", + "style": { + "navigationBarTitleText": "待办详情" + } + }, + { + "path": "pages/demand/demandail", + "style": { + "navigationBarTitleText": "新增需求" + } + }, + { + "path": "pages/daiban/addbangfu", + "style": { + "navigationBarTitleText": "添加帮扶" + } + }, + { + "path": "pages/service/serviceDetail", + "style": { + "navigationBarTitleText": "服务" + } + }, + { + "path": "pages/needs/needDetail", + "style": { + "navigationBarTitleText": "需求" + } + }, + { + "path": "pages/daiban/daibandetail", + "style": { + "navigationBarTitleText": "待办详情" + } + }, + { + "path": "pages/demand/demandail", + "style": { + "navigationBarTitleText": "新增需求" + } + }, + { + "path": "pages/daiban/addbangfu", + "style": { + "navigationBarTitleText": "添加帮扶" + } + }, + { + "path": "pages/service/serviceDetail", + "style": { + "navigationBarTitleText": "服务" + } + }, + { + "path": "pages/needs/needDetail", + "style": { + "navigationBarTitleText": "需求" + } } - }, - { - "path": "pages/daiban/daibandetail", - "style": { - "navigationBarTitleText": "待办详情" + ] + }, + { + "root": "packageCa", + "pages": [ + { + "path" : "search/search", + "style" : { + "navigationBarTitleText" : "生涯规划", + "navigationStyle": "custom" + } + }, + { + "path": "job/index", + "style": { + "navigationBarTitleText": "职业库" + } + }, + { + "path": "job/midList", + "style": { + "navigationBarTitleText": "职业库-中类" + } + }, + { + "path": "job/smallList", + "style": { + "navigationBarTitleText": "职业库-小类" + } + }, + { + "path": "job/details", + "style": { + "navigationBarTitleText": "职业详情" + } + }, + { + "path": "userCenter/professionPath", + "style": { + "navigationBarTitleText": "职业路径", + "navigationStyle": "custom" + } + }, + { + "path": "userCenter/personDocument", + "style": { + "navigationBarTitleText": "生涯档案", + "navigationStyle": "custom" + } + }, + { + "path": "userCenter/careerCompass", + "style": { + "navigationBarTitleText": "生涯罗盘", + "navigationStyle": "custom" + } + }, + { + "path": "userCenter/learningPlan", + "style": { + "navigationBarTitleText": "学业规划", + "navigationStyle": "custom" + } + }, + { + "path": "userCenter/smartTarget", + "style": { + "navigationBarTitleText": "学业规划", + "navigationStyle": "custom" + } + }, + { + "path": "userCenter/fillInInformation", + "style": { + "navigationBarTitleText": "完善个人信息" + } + }, + { + "path": "pagesTest/testList", + "style": { + "navigationBarTitleText": "生涯测评", + "navigationStyle": "custom" + } + }, + { + "path": "pagesTest/customTestTitle", + "style": { + "navigationBarTitleText": "自定义测评", + "navigationStyle": "custom" + } + }, + { + "path": "pagesTest/interestTestTitle", + "style": { + "navigationBarTitleText": "职业兴趣测评", + "navigationStyle": "custom" + } + }, + { + "path": "pagesTest/workValuesTestTitle", + "style": { + "navigationBarTitleText": "工作价值观测评", + "navigationStyle": "custom" + } + }, + { + "path": "pagesTest/personalTestTitle", + "style": { + "navigationBarTitleText": "人格测评", + "navigationStyle": "custom" + } + }, + { + "path": "testReport/workValuesTestReport", + "style": { + "navigationBarTitleText": "工作价值观测评报告", + "navigationStyle": "custom" + } + }, + { + "path": "testReport/multipleAbilityTestReport", + "style": { + "navigationBarTitleText": "多元能力测评报告", + "navigationStyle": "custom" + } + }, + { + "path": "testReport/generalCareerTestReport", + "style": { + "navigationBarTitleText": "通用职业能力测评报告", + "navigationStyle": "custom" + } + }, + { + "path": "testReport/personalTestReport", + "style": { + "navigationBarTitleText": "人格测评报告", + "navigationStyle": "custom" + } + }, + { + "path": "testReport/interestTestReport", + "style": { + "navigationBarTitleText": "职业兴趣测评报告", + "navigationStyle": "custom" + } } - }, - - { - "path": "pages/demand/demandail", - "style": { - "navigationBarTitleText": "新增需求" - } - } , { - "path": "pages/daiban/addbangfu", - "style": { - "navigationBarTitleText": "添加帮扶" - } - } , { - "path": "pages/service/serviceDetail", - "style": { - "navigationBarTitleText": "服务" - } - } , { - "path": "pages/needs/needDetail", - "style": { - "navigationBarTitleText": "需求" - } - } - ] - }, - { - "root": "packageCa", - "pages": [ - { - "path" : "search/search", - "style" : { - "navigationBarTitleText" : "生涯规划", - "navigationStyle": "custom" - } - }, - { - "path": "job/index", - "style": { - "navigationBarTitleText": "职业库" - } - }, - { - "path": "job/midList", - "style": { - "navigationBarTitleText": "职业库-中类" - } - }, - { - "path": "job/smallList", - "style": { - "navigationBarTitleText": "职业库-小类" - } - }, - { - "path": "job/details", - "style": { - "navigationBarTitleText": "职业详情" - } - }, - { - "path": "userCenter/professionPath", - "style": { - "navigationBarTitleText": "职业路径", - "navigationStyle": "custom" - } - }, - { - "path": "userCenter/personDocument", - "style": { - "navigationBarTitleText": "生涯档案", - "navigationStyle": "custom" - } - }, - { - "path": "userCenter/careerCompass", - "style": { - "navigationBarTitleText": "生涯罗盘", - "navigationStyle": "custom" - } - }, - { - "path": "userCenter/learningPlan", - "style": { - "navigationBarTitleText": "学业规划", - "navigationStyle": "custom" - } - }, - { - "path": "userCenter/smartTarget", - "style": { - "navigationBarTitleText": "学业规划", - "navigationStyle": "custom" - } - }, - { - "path": "userCenter/fillInInformation", - "style": { - "navigationBarTitleText": "完善个人信息" - } - }, - { - "path": "pagesTest/testList", - "style": { - "navigationBarTitleText": "生涯测评", - "navigationStyle": "custom" - } - }, - { - "path": "pagesTest/customTestTitle", - "style": { - "navigationBarTitleText": "自定义测评", - "navigationStyle": "custom" - } - }, - { - "path": "pagesTest/interestTestTitle", - "style": { - "navigationBarTitleText": "职业兴趣测评", - "navigationStyle": "custom" - } - }, - { - "path": "pagesTest/workValuesTestTitle", - "style": { - "navigationBarTitleText": "工作价值观测评", - "navigationStyle": "custom" - } - }, - { - "path": "pagesTest/personalTestTitle", - "style": { - "navigationBarTitleText": "人格测评", - "navigationStyle": "custom" - } - }, - { - "path": "testReport/workValuesTestReport", - "style": { - "navigationBarTitleText": "工作价值观测评报告", - "navigationStyle": "custom" - } - }, - { - "path": "testReport/multipleAbilityTestReport", - "style": { - "navigationBarTitleText": "多元能力测评报告", - "navigationStyle": "custom" - } - }, - { - "path": "testReport/generalCareerTestReport", - "style": { - "navigationBarTitleText": "通用职业能力测评报告", - "navigationStyle": "custom" - } - }, - { - "path": "testReport/personalTestReport", - "style": { - "navigationBarTitleText": "人格测评报告", - "navigationStyle": "custom" - } - }, - { - "path": "testReport/interestTestReport", - "style": { - "navigationBarTitleText": "职业兴趣测评报告", - "navigationStyle": "custom" - } - } - ] - } + ] + } ], // "tabBar": { // "custom": true, @@ -665,8 +646,6 @@ "navigationBarBackgroundColor": "#F8F8F8", "backgroundColor": "#F8F8F8", "navigationBarTitleTextSize": "18px" - // "enablePullDownRefresh": false, - // "navigationStyle": "custom" }, "easycom": { "autoscan": true, @@ -679,4 +658,4 @@ } }, "uniIdRouter": {} -} +} \ No newline at end of file diff --git a/pages/careerfair/careerfair.vue b/pages/careerfair/careerfair.vue index 2b49310..eb984e8 100644 --- a/pages/careerfair/careerfair.vue +++ b/pages/careerfair/careerfair.vue @@ -3,6 +3,10 @@ + + + + { } }; -// 处理直播按钮点击 +// 处理直播按钮点击 - 跳转微信视频号 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 }; // 跳转到测试页面 diff --git a/pages/mine/mine.vue b/pages/mine/mine.vue index aa9f5e1..f87fa1f 100644 --- a/pages/mine/mine.vue +++ b/pages/mine/mine.vue @@ -1,5 +1,5 @@