diff --git a/components/renderCompanyCollectionRecord/renderCompanyCollectionRecord.vue b/components/renderCompanyCollectionRecord/renderCompanyCollectionRecord.vue new file mode 100644 index 0000000..12c768b --- /dev/null +++ b/components/renderCompanyCollectionRecord/renderCompanyCollectionRecord.vue @@ -0,0 +1,157 @@ + + + + + \ No newline at end of file diff --git a/components/renderCompanys/renderCompanys.vue b/components/renderCompanys/renderCompanys.vue index 0310e6f..1234a2d 100644 --- a/components/renderCompanys/renderCompanys.vue +++ b/components/renderCompanys/renderCompanys.vue @@ -2,18 +2,17 @@ - {{ job.gsmc }} + {{ job.name }} - - - - {{job.gsxy}} + + + + - + 在招职位· - {{ job.zzgwsl || '-' }} + {{ job.totalRecruitment || '-' }} @@ -21,14 +20,10 @@ - {{ vacanciesTo(job.vacancies) }} - - {{job.qyxz}} - @@ -56,10 +51,6 @@ const props = defineProps({ type: String, default: '', }, - zphId: { - type: String, - default: '', - }, }); const listData = computed(() => { @@ -67,7 +58,7 @@ const listData = computed(() => { }); function nextDetail(company) { - navTo(`/packageA/pages/UnitDetails/UnitDetails?companyId=${company.gsID}&companyName=${company.gsmc}&zphId=${props.zphId}`); + navTo(`/packageA/pages/UnitDetails/UnitDetails?companyId=${company.companyId}`); } @@ -128,7 +119,7 @@ function nextDetail(company) { } } .card-bottom{ - margin-top: 15rpx + margin-top: 4rpx margin-bottom: 10rpx display: flex justify-content: space-between @@ -139,4 +130,4 @@ function nextDetail(company) { .ris{ font-family: 'PingFangSC-Medium', 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', sans-serif; } - + \ No newline at end of file diff --git a/components/renderCompanysOutData/renderCompanysOutData.vue b/components/renderCompanysOutData/renderCompanysOutData.vue new file mode 100644 index 0000000..87f22fa --- /dev/null +++ b/components/renderCompanysOutData/renderCompanysOutData.vue @@ -0,0 +1,142 @@ + + + + + diff --git a/components/renderDeliveryRecord/renderDeliveryRecord.vue b/components/renderDeliveryRecord/renderDeliveryRecord.vue new file mode 100644 index 0000000..07967ef --- /dev/null +++ b/components/renderDeliveryRecord/renderDeliveryRecord.vue @@ -0,0 +1,201 @@ + + + + + \ No newline at end of file diff --git a/components/renderJobCollectionRecord/renderJobCollectionRecord.vue b/components/renderJobCollectionRecord/renderJobCollectionRecord.vue new file mode 100644 index 0000000..c1f6888 --- /dev/null +++ b/components/renderJobCollectionRecord/renderJobCollectionRecord.vue @@ -0,0 +1,202 @@ + + + + + \ No newline at end of file diff --git a/components/renderJobViewRecord/renderJobViewRecord.vue b/components/renderJobViewRecord/renderJobViewRecord.vue new file mode 100644 index 0000000..111a610 --- /dev/null +++ b/components/renderJobViewRecord/renderJobViewRecord.vue @@ -0,0 +1,201 @@ + + + + + \ No newline at end of file diff --git a/components/renderJobs/renderJobs.vue b/components/renderJobs/renderJobs.vue index 1f67ae3..c2d0623 100644 --- a/components/renderJobs/renderJobs.vue +++ b/components/renderJobs/renderJobs.vue @@ -2,33 +2,33 @@ - {{ job.gwmc }} + {{ job.jobTitle }} - {{ job.gsmc }} + {{ job.gwmc }} - {{job.xlyq == '不限' ? '学历不限' : job.xlyq}} + - {{job.gwgzjy == '不限' ? '经验不限' : job.gwgzjy}} + - {{ vacanciesTo(job.zprs) }} + {{ vacanciesTo(job.vacancies) }} - {{ parseDateTime(job.createTime).date }} + {{ job.postingDate }} - + @@ -77,25 +77,7 @@ function nextDetail(job) { const recordData = recommedIndexDb.JobParameter(job); recommedIndexDb.addRecord(recordData); } - navTo(`/packageA/pages/post/post?jobId=${btoa(job.id)}`); -} -function parseDateTime(datetimeStr) { - if (!datetimeStr) return { time: '', date: '' }; - - const dateObj = new Date(datetimeStr); - - if (isNaN(dateObj.getTime())) return { time: '', date: '' }; // 无效时间 - - const year = dateObj.getFullYear(); - const month = String(dateObj.getMonth() + 1).padStart(2, '0'); - const day = String(dateObj.getDate()).padStart(2, '0'); - const hours = String(dateObj.getHours()).padStart(2, '0'); - const minutes = String(dateObj.getMinutes()).padStart(2, '0'); - - return { - time: `${hours}:${minutes}`, - date: `${year}-${month}-${day}`, - }; + navTo(`/packageA/pages/post/post?jobId=${btoa(job.jobId)}&dataType=1`); } diff --git a/components/renderJobsOutData/renderJobsOutData.vue b/components/renderJobsOutData/renderJobsOutData.vue new file mode 100644 index 0000000..ba50080 --- /dev/null +++ b/components/renderJobsOutData/renderJobsOutData.vue @@ -0,0 +1,167 @@ + + + + + diff --git a/main.js b/main.js index 8ae9e2a..5255af7 100644 --- a/main.js +++ b/main.js @@ -12,6 +12,12 @@ import SelectPopup from '@/components/selectPopup/selectPopup.vue' import SelectPopupPlugin from '@/components/selectPopup/selectPopupPlugin'; import RenderJobs from '@/components/renderJobs/renderJobs.vue'; import RenderCompanys from '@/components/renderCompanys/renderCompanys.vue'; +import RenderJobsOutData from '@/components/renderJobsOutData/renderJobsOutData.vue'; +import RenderCompanysOutData from '@/components/renderCompanysOutData/renderCompanysOutData.vue'; +import renderDeliveryRecord from '@/components/renderDeliveryRecord/renderDeliveryRecord.vue'; +import renderJobCollectionRecord from '@/components/renderJobCollectionRecord/renderJobCollectionRecord.vue'; +import renderCompanyCollectionRecord from '@/components/renderCompanyCollectionRecord/renderCompanyCollectionRecord.vue'; +import renderJobViewRecord from '@/components/renderJobViewRecord/renderJobViewRecord.vue'; // import Tabbar from '@/components/tabbar/midell-box.vue' // 自动导入 directives 目录下所有指令 const directives = import.meta.glob('./directives/*.js', { @@ -36,6 +42,12 @@ export function createApp() { app.component('SelectPopup', SelectPopup) app.component('RenderJobs', RenderJobs) app.component('RenderCompanys', RenderCompanys) + app.component('RenderJobsOutData', RenderJobsOutData) //渲染外部岗位数据列表 + app.component('RenderCompanysOutData', RenderCompanysOutData) //渲染外部公司数据列表 + app.component('renderDeliveryRecord', renderDeliveryRecord) //渲染岗位投递记录 + app.component('renderJobCollectionRecord', renderJobCollectionRecord) //渲染岗位收藏记录 + app.component('renderCompanyCollectionRecord', renderCompanyCollectionRecord) //渲染公司收藏记录 + app.component('renderJobViewRecord', renderJobViewRecord) //渲染岗位浏览记录 // app.component('tabbar-custom', Tabbar) for (const path in directives) { diff --git a/packageA/pages/Intendedposition/Intendedposition.vue b/packageA/pages/Intendedposition/Intendedposition.vue index 1ed76e9..edc81c5 100644 --- a/packageA/pages/Intendedposition/Intendedposition.vue +++ b/packageA/pages/Intendedposition/Intendedposition.vue @@ -1,12 +1,12 @@ @@ -41,9 +41,7 @@ onReachBottom(() => { getJobList(); }); -function navToPost(jobId) { - navTo(`/packageA/pages/post/post?jobId=${btoa(jobId)}`); -} + function getJobList(type = 'add') { if (type === 'refresh') { diff --git a/packageA/pages/UnitDetails/UnitDetails.vue b/packageA/pages/UnitDetails/UnitDetails.vue index 1ebea1d..c9a1998 100644 --- a/packageA/pages/UnitDetails/UnitDetails.vue +++ b/packageA/pages/UnitDetails/UnitDetails.vue @@ -21,7 +21,7 @@ - {{ companyInfo?.gsmc }} + {{ dataType === 2 ? companyInfo?.gsmc : companyInfo?.name }}   - {{companyInfo.gsxy}} + {{ companyInfo.gsxy }} 公司介绍 - {{ companyInfo.qyxz }} - + {{ dataType === 2 ? companyInfo.qyxz : companyInfo.description }} {{ isExpanded ? '收起' : '展开' }} @@ -48,12 +46,18 @@ src="@/static/icon/downs.png" > - - + 在招职位 + + { console.log(options); - getCompanyInfo(options.companyId,options.companyName,options.zphId); + dataType.value = options.dataType ? parseInt(options.dataType) : 1; + pageOptions.value = options; + + if (dataType.value === 2) { + // 第三方数据 + getCompanyInfo(options.companyId, options.zphId); + getJobsList('refresh'); + } else { + // 原数据 + getCompanyInfo(options.companyId || options.bussinessId); + } }); function companyCollection() { - const companyId = companyInfo.value.gsID; - if (companyInfo.value.isCollection) { - $api.createRequest(`/app/company/collection/${companyId}`, {}, 'DELETE').then((resData) => { - // getCompanyInfo(companyId); - $api.msg('取消收藏成功'); + if (dataType.value === 2) { + // 第三方数据收藏逻辑 + const id = companyInfo.value.id; + const companyId = companyInfo.value.gsID; + const zphId = companyInfo.value.zphID; + if (companyInfo.value.isCollection) { + $api.createRequest(`/app/company/collection/${id}/2`, {}, 'DELETE').then((resData) => { + getCompanyInfo(companyId, zphId); + $api.msg('取消收藏成功'); + }); + } else { + $api.createRequest(`/app/company/collection/${id}/2`, {}, 'POST').then((resData) => { + getCompanyInfo(companyId, zphId); + $api.msg('收藏成功'); + }); + } + } else { + // 原数据收藏逻辑 + const companyId = companyInfo.value.companyId; + if (companyInfo.value.isCollection) { + $api.createRequest(`/app/company/collection/${companyId}`, {}, 'DELETE').then((resData) => { + getCompanyInfo(companyId); + $api.msg('取消收藏成功'); + }); + } else { + $api.createRequest(`/app/company/collection/${companyId}`, {}, 'POST').then((resData) => { + getCompanyInfo(companyId); + $api.msg('收藏成功'); + }); + } + } +} + +function getCompanyInfo(...args) { + if (dataType.value === 2) { + // 第三方数据接口 + const [companyId, zphId] = args; + $api.createRequest(`/app/internal/companyThirdPart/${companyId}/${zphId}`).then((resData) => { + companyInfo.value = resData.data; }); } else { - $api.createRequest(`/app/company/collection/${companyId}`, {}, 'POST').then((resData) => { - // getCompanyInfo(companyId); - $api.msg('收藏成功'); + // 原数据接口 + const [companyId] = args; + $api.createRequest(`/app/company/${companyId}`).then((resData) => { + companyInfo.value = resData.data; + getJobsList(); }); } } -function getCompanyInfo(companyId,companyName,zphId) { - $api.createRequest(`/app/internal/companyThirdPart/${companyId}/${zphId}`).then((resData) => { - companyInfo.value = resData.data; - getJobsList(companyId,companyName,zphId); +function getJobsList(type = 'add') { + if (dataType.value === 2) { + // 第三方数据职位列表 + getThirdPartyJobsList(type); + } else { + // 原数据职位列表 + getOriginalJobsList(type); + } +} + +function getThirdPartyJobsList(type = 'add') { + const { companyId, companyName, zphId } = pageOptions.value; + + if (type === 'refresh') { + pageState.current = 1; + pageState.maxPage = 1; + } + if (type === 'add' && pageState.current < pageState.maxPage) { + pageState.current += 1; + } + + let params = { + current: pageState.current, + pageSize: pageState.pageSize, + }; + + $api.createRequest(`/app/internal/jobThirdPart?gsID=${companyId}&gsmc=${companyName}&zphID=${zphId}`, params).then((resData) => { + const { rows, total } = resData; + handleJobsListResponse(type, rows, total, 'current'); }); } -function getJobsList(companyId,companyName,zphId,type='add') { +function getOriginalJobsList(type = 'add') { if (type === 'refresh') { pageState.page = 1; pageState.maxPage = 1; @@ -120,26 +198,31 @@ function getJobsList(companyId,companyName,zphId,type='add') { if (type === 'add' && pageState.page < pageState.maxPage) { pageState.page += 1; } + let params = { current: pageState.page, pageSize: pageState.pageSize, }; - $api.createRequest(`/app/internal/jobThirdPart?gsID=${companyId}&gsmc=${companyName}&zphID=${zphId}`, ).then((resData) => { + + $api.createRequest(`/app/company/job/${companyInfo.value.companyId}`, params).then((resData) => { const { rows, total } = resData; - if (type === 'add') { - // const str = pageState.pageSize * (pageState.page - 1); - // const end = pageState.list.length; - // const reslist = rows; - // pageState.list.splice(str, end, ...reslist); - pageState.list = rows - } else { - pageState.list = rows; - } - pageState.total = resData.total; - pageState.maxPage = Math.ceil(pageState.total / pageState.pageSize); + handleJobsListResponse(type, rows, total, 'page'); }); } +function handleJobsListResponse(type, rows, total, pageKey) { + if (type === 'add') { + const str = pageState.pageSize * (pageState[pageKey] - 1); + const end = pageState.list.length; + const reslist = rows; + pageState.list.splice(str, end, ...reslist); + } else { + pageState.list = rows; + } + pageState.total = total; + pageState.maxPage = Math.ceil(pageState.total / pageState.pageSize); +} + function expand() { isExpanded.value = !isExpanded.value; } @@ -177,7 +260,6 @@ image { margin-right: 24rpx } .companyinfo-right{ - .row1{ font-weight: 500; font-size: 32rpx; @@ -213,7 +295,7 @@ image { } } .expanded { - max-height: 1000rpx; // 足够显示完整内容 + max-height: 1000rpx; } .expand{ display: flex @@ -288,7 +370,7 @@ image { } .card-companyName{ font-weight: 400; - font-size: 28rpx; + font-size: 28rpx; color: #6C7282; } .card-tags{ @@ -320,4 +402,4 @@ image { } } } - + \ No newline at end of file diff --git a/packageA/pages/browseJob/browseJob.vue b/packageA/pages/browseJob/browseJob.vue index 3b2f8f0..0f9aa20 100644 --- a/packageA/pages/browseJob/browseJob.vue +++ b/packageA/pages/browseJob/browseJob.vue @@ -25,12 +25,12 @@ - + > @@ -88,9 +88,7 @@ function toSelectDate() { }); } -function navToPost(jobId) { - navTo(`/packageA/pages/post/post?jobId=${btoa(jobId)}`); -} + function searchCollection(e) { const value = e.detail.value; diff --git a/packageA/pages/collection/collection.vue b/packageA/pages/collection/collection.vue index 928dd70..d1204c9 100644 --- a/packageA/pages/collection/collection.vue +++ b/packageA/pages/collection/collection.vue @@ -15,12 +15,12 @@ - + :latitude="latitudeVal"> + @@ -28,12 +28,12 @@ - + > diff --git a/packageA/pages/exhibitors/exhibitors.vue b/packageA/pages/exhibitors/exhibitors.vue index 82a649b..171d0eb 100644 --- a/packageA/pages/exhibitors/exhibitors.vue +++ b/packageA/pages/exhibitors/exhibitors.vue @@ -69,18 +69,18 @@ src="@/static/icon/downs.png" > - + - 参会单位({{ companyList.length }}) + 参会单位({{ pageState.total }}) - + > @@ -111,13 +111,24 @@ const { longitudeVal, latitudeVal } = storeToRefs(useLocationStore()); const isExpanded = ref(false); const fairInfo = ref({}); -const companyList = ref([]); + +const pageState = reactive({ + current: 0, + list: [], + total: 0, + maxPage: 1, + pageSize: 10, +}); const hasnext = ref(true); + const zphId = ref(''); +const pageOptions = ref({}) + onLoad((options) => { zphId.value = options.jobFairId + pageOptions.value = options getJobFairInfo(options.jobFairId, options.jobFairName); - getCompanyInfo(options.jobFairId, options.jobFairName); + getCompanyList('refresh'); }); function getJobFairInfo(id,name) { @@ -126,20 +137,43 @@ function getJobFairInfo(id,name) { hasAppointment(); }); } -function getCompanyInfo(id,name) { - $api.createRequest(`/app/internal/companyThirdPart/?zphID=${id}&zphmc=${name}`).then((resData) => { - companyList.value = resData.rows; +function getCompanyList(type='add') { + const { jobFairId,jobFairName} = pageOptions.value + if (type === 'refresh') { + pageState.current = 1; + pageState.maxPage = 1; + } + if (type === 'add' && pageState.current < pageState.maxPage) { + pageState.current += 1; + } + let params = { + current: pageState.current, + pageSize: pageState.pageSize, + }; + $api.createRequest(`/app/internal/companyThirdPart/?zphID=${jobFairId}&zphmc=${jobFairName}`,params ).then((resData) => { + const { rows, total } = resData; + if (type === 'add') { + const str = pageState.pageSize * (pageState.current - 1); + const end = pageState.list.length; + const reslist = rows; + pageState.list.splice(str, end, ...reslist); + } else { + pageState.list = rows; + } + pageState.total = resData.total; + pageState.maxPage = Math.ceil(pageState.total / pageState.pageSize); }); } const hasAppointment = () => { const isTimePassed = (timeStr) => { + if(!timeStr) return false const targetTime = new Date(timeStr.replace(/-/g, '/')).getTime(); // 兼容格式 const now = Date.now(); return now < targetTime; }; - hasnext.value = isTimePassed(fairInfo.value.startTime); + hasnext.value = isTimePassed(fairInfo.value.zphjbsj); }; function openMap(lat, lng, name = '位置') { @@ -157,16 +191,16 @@ function expand() { // 取消/收藏岗位 function applyExhibitors() { - const fairId = fairInfo.value.jobFairId; + const fairId = fairInfo.value.zphID; if (fairInfo.value.isCollection) { - // $api.createRequest(`/app/fair/collection/${fairId}`, {}, 'DELETE').then((resData) => { - // getCompanyInfo(fairId); - // $api.msg('取消预约成功'); - // }); + $api.createRequest(`/app/fair/collection/${fairId}`, {}, 'DELETE').then((resData) => { + getJobFairInfo(fairId); + $api.msg('取消预约成功'); + }); $api.msg('已预约成功'); } else { $api.createRequest(`/app/fair/collection/${fairId}`, {}, 'POST').then((resData) => { - getCompanyInfo(fairId); + getJobFairInfo(fairId); $api.msg('预约成功'); }); } diff --git a/packageA/pages/myResume/myResume.vue b/packageA/pages/myResume/myResume.vue index 2123cf4..78e47e4 100644 --- a/packageA/pages/myResume/myResume.vue +++ b/packageA/pages/myResume/myResume.vue @@ -5,6 +5,13 @@ + + + + {{userInfo.resumeOcrStatus}} + + + { getUserResume(); }); +function closeNotice() { + showNotice.value=false +} + function chooseResume() { uni.chooseImage({ sizeType: ["original", "compressed"], @@ -254,6 +266,36 @@ function uploadResume(tempFilePath, loading) { text-align: center; } } + +.notice-line + width 100%; + height:60rpx; + display: flex; + align-items: center; + justify-content: space-between; + box-sizing: border-box; + padding:0 30rpx + margin-bottom: 20rpx + .icon + width:35rpx; + height:35rpx; + .text + flex: 1; + overflow hidden + padding:0 25rpx + .close + width:25rpx; + height:25rpx; + +.notice-line.blue{ + background: #E8F1FF + color: #1677ff +} +.notice-line.green{ + background: #D4FFF1 + color: #38bb8f +} + image{ width: 100%; height: 100% diff --git a/packageA/pages/post/post.vue b/packageA/pages/post/post.vue index d593bae..92f3818 100644 --- a/packageA/pages/post/post.vue +++ b/packageA/pages/post/post.vue @@ -6,45 +6,59 @@ + + + - + - {{ jobInfo.gwmc }} + + + + {{ dataType === 2 ? jobInfo.gwmc : jobInfo.jobTitle }} - - + + {{jobInfo.xlyq == '不限' ? '学历不限' : jobInfo.xlyq}} + + + + + - - + + {{jobInfo.gwgzjy == '不限' ? '经验不限' : jobInfo.gwgzjy}} + + + + 来源  - 青岛人才网 + {{ dataType === 2 ? '青岛人才网' : jobInfo.dataSource }} + + @@ -54,20 +68,24 @@ 点击查看 + + 职位描述 - {{ jobInfo.gwms }} + {{ dataType === 2 ? jobInfo.gwms : jobInfo.description }} + + 公司信息 单位详情 @@ -77,16 +95,20 @@ - {{ jobInfo.gsmc }} + {{ dataType === 2 ? jobInfo.gsmc : jobInfo.company?.name }} -   - - {{jobInfo.qyxz}} +   + + {{jobInfo.qyxz}} 在招 @@ -104,7 +126,9 @@ > - + + + 竞争力分析 @@ -132,11 +156,15 @@ + + @@ -150,8 +178,10 @@ import { reactive, inject, watch, ref, onMounted, computed } from 'vue'; import { onLoad, onShow, onHide } from '@dcloudio/uni-app'; import dictLabel from '@/components/dict-Label/dict-Label.vue'; import RadarMap from './component/radarMap.vue'; + const { $api, navTo, getLenPx, parseQueryParams, navBack, isEmptyObject } = inject('globalFunction'); import config from '@/config.js'; + const matchingDegree = ref(['一般', '良好', '优秀', '极好']); const currentStep = ref(1); const companyCount = ref(0); @@ -162,9 +192,11 @@ const jobIdRef = ref(); const raderData = ref({}); const videoPalyerRef = ref(null); const explainUrlRef = ref(''); +const dataType = ref(1); // 1: 原数据, 2: 第三方数据 onLoad((option) => { if (option.jobId) { + dataType.value = option.dataType ? parseInt(option.dataType) : 1; initLoad(option); } }); @@ -172,6 +204,7 @@ onLoad((option) => { onShow(() => { const option = parseQueryParams(); // 兼容微信内置浏览器 if (option.jobId) { + dataType.value = option.dataType ? parseInt(option.dataType) : 1; initLoad(option); } }); @@ -187,92 +220,165 @@ function initLoad(option) { function seeExplain() { if (jobInfo.value.explainUrl) { videoPalyerRef.value?.open(jobInfo.value.explainUrl); - // console.log(jobInfo.value.explainUrl); - // explainUrlRef.value = jobInfo.value.explainUrl; } } function getDetail(jobId) { - return new Promise((reslove, reject) => { - $api.createRequest(`/app/internal/jobThirdPart/${jobId}`).then((resData) => { - const { gsID, gsmc, zphID} = resData.data; + if (dataType.value === 2) { + // 第三方数据接口 + return new Promise((reslove, reject) => { + $api.createRequest(`/app/internal/jobThirdPart/${jobId}`).then((resData) => { + const { gsID, gsmc, zphID } = resData.data; + jobInfo.value = resData.data; + reslove(resData.data); + getCompanyIsAJobs(gsID, gsmc, zphID); + + if (resData.data.latitude && resData.data.longitude) { + initMapCovers(resData.data.latitude, resData.data.longitude, resData.data.gsmc); + } + }); + }); + } else { + // 原数据接口 + $api.createRequest(`/app/job/${jobId}`).then((resData) => { + const { latitude, longitude, companyName, companyId } = resData.data; jobInfo.value = resData.data; - reslove(resData.data); - getCompanyIsAJobs(gsID, gsmc, zphID); - // getCompetivetuveness(jobId); - return + getCompanyIsAJobs(companyId); + getCompetivetuveness(jobId); + if (latitude && longitude) { - mapCovers.value = [ - { - latitude: latitude, - longitude: longitude, - iconPath: point, - label: { - content: companyName, - textAlign: 'center', - padding: 3, - fontSize: 12, - bgColor: '#FFFFFF', - anchorX: getTextWidth(companyName), // X 轴调整,负数向左 - borderRadius: 5, - }, - width: 34, - }, - ]; + initMapCovers(latitude, longitude, companyName); } }); - }); + } } -function getCompanyIsAJobs(gsID, gsmc, zphID) { - $api.createRequest(`/app/internal/jobThirdPart?gsID=${gsID}&gsmc=${gsmc}&zphID=${zphID}`).then((resData) => { - companyCount.value = resData.total; - }); +function initMapCovers(latitude, longitude, companyName) { + mapCovers.value = [ + { + latitude: latitude, + longitude: longitude, + iconPath: point, + label: { + content: companyName, + textAlign: 'center', + padding: 3, + fontSize: 12, + bgColor: '#FFFFFF', + anchorX: getTextWidth(companyName), + borderRadius: 5, + }, + width: 34, + }, + ]; +} + +function getCompanyIsAJobs(...args) { + if (dataType.value === 2) { + // 第三方数据获取公司职位数量 + const [gsID, gsmc, zphID] = args; + $api.createRequest(`/app/internal/jobThirdPart?gsID=${gsID}&gsmc=${gsmc}&zphID=${zphID}`).then((resData) => { + companyCount.value = resData.total; + }); + } else { + // 原数据获取公司职位数量 + const [companyId] = args; + $api.createRequest(`/app/company/count/${companyId}`).then((resData) => { + companyCount.value = resData.data; + }); + } } function getTextWidth(text, size = 12) { const canvas = document.createElement('canvas'); const context = canvas.getContext('2d'); context.font = `${12}px Arial`; - return -(context.measureText(text).width / 2) - 20; // 计算文字中心点 + return -(context.measureText(text).width / 2) - 20; } function getCompetivetuveness(jobId) { - $api.createRequest(`/app/job/competitiveness/${jobId}`, {}, 'GET').then((resData) => { - raderData.value = resData.data; - currentStep.value = resData.data.matchScore * 0.04; - }); + if (dataType.value !== 2) { + $api.createRequest(`/app/job/competitiveness/${jobId}`, {}, 'GET').then((resData) => { + raderData.value = resData.data; + currentStep.value = resData.data.matchScore * 0.04; + }); + } } // 申请岗位 function jobApply() { - const jobId = jobInfo.value.id; - if (jobInfo.value.isApply) { - const jobUrl = jobInfo.value.jobUrl; - return window.open(jobUrl); - } else { - $api.createRequest(`/app/job/apply/${jobId}`, {}, 'GET').then((resData) => { - getDetail(jobId); - $api.msg('申请成功'); + if (dataType.value === 2) { + $api.msg('敬请期待'); + return + // 第三方数据申请逻辑 + const jobId = jobInfo.value.id; + if (jobInfo.value.isApply) { const jobUrl = jobInfo.value.jobUrl; return window.open(jobUrl); - }); + } else { + $api.createRequest(`/app/job/apply/${jobId}`, {}, 'GET').then((resData) => { + getDetail(jobIdRef.value); + $api.msg('投递成功'); + const jobUrl = jobInfo.value.jobUrl; + return window.open(jobUrl); + }); + } + } else { + // 原数据申请逻辑 + const jobId = jobInfo.value.jobId; + if (jobInfo.value.isApply) { + const jobUrl = jobInfo.value.jobUrl; + return window.open(jobUrl); + } else { + $api.createRequest(`/app/job/apply/${jobId}`, {}, 'GET').then((resData) => { + getDetail(jobId); + $api.msg('申请成功'); + const jobUrl = jobInfo.value.jobUrl; + return window.open(jobUrl); + }); + } } } // 取消/收藏岗位 function jobCollection() { - const jobId = jobInfo.value.jobId; - if (jobInfo.value.isCollection) { - $api.createRequest(`/app/job/collection/${jobId}`, {}, 'DELETE').then((resData) => { - getDetail(jobId); - $api.msg('取消收藏成功'); - }); + if (dataType.value === 2) { + // 第三方数据收藏逻辑 + const id = jobInfo.value.id; + if (jobInfo.value.isCollection) { + $api.createRequest(`/app/job/collection/${id}/2`, {}, 'DELETE').then((resData) => { + getDetail(jobIdRef.value); + $api.msg('取消收藏成功'); + }); + } else { + $api.createRequest(`/app/job/collection/${id}/2`, {}, 'POST').then((resData) => { + getDetail(jobIdRef.value); + $api.msg('收藏成功'); + }); + } } else { - $api.createRequest(`/app/job/collection/${jobId}`, {}, 'POST').then((resData) => { - getDetail(jobId); - $api.msg('收藏成功'); - }); + // 原数据收藏逻辑 + const jobId = jobInfo.value.jobId; + if (jobInfo.value.isCollection) { + $api.createRequest(`/app/job/collection/${jobId}`, {}, 'DELETE').then((resData) => { + getDetail(jobId); + $api.msg('取消收藏成功'); + }); + } else { + $api.createRequest(`/app/job/collection/${jobId}`, {}, 'POST').then((resData) => { + getDetail(jobId); + $api.msg('收藏成功'); + }); + } + } +} + +// 处理公司详情跳转 +function handleCompanyDetail() { + if (dataType.value === 2) { + navTo(`/packageA/pages/UnitDetails/UnitDetails?companyId=${jobInfo.value.gsID}&companyName=${jobInfo.value.gsmc}&zphId=${jobInfo.value.zphID}&dataType=2`); + } else { + navTo(`/packageA/pages/UnitDetails/UnitDetails?companyId=${jobInfo.value.company.companyId}`); } } @@ -293,6 +399,7 @@ function getClass(index) { + \ No newline at end of file diff --git a/packageA/pages/reservation/reservation.vue b/packageA/pages/reservation/reservation.vue index 313a73d..89bf7c7 100644 --- a/packageA/pages/reservation/reservation.vue +++ b/packageA/pages/reservation/reservation.vue @@ -15,24 +15,24 @@ - + - + - {{ item.name }} + {{ item.zphmc }} - {{ item.location }} - - {{ item.zphdz }} + + - + 取消预约 @@ -72,6 +72,7 @@ const ranOptions = ref([ ]); function isTimePassed(timeStr) { + if(!timeStr) return false const targetTime = new Date(timeStr.replace(/-/g, '/')).getTime(); // 兼容格式 const now = Date.now(); return now < targetTime; @@ -88,11 +89,22 @@ function chnageRanOption(item) { } function updateCancel(item) { - const fairId = item.jobFairId; - $api.createRequest(`/app/fair/collection/${fairId}`, {}, 'DELETE').then((resData) => { - getList('refresh'); - $api.msg('取消预约成功'); - }); + const fairId = item.zphID; + uni.showModal({ + title: '提示', + content: '确定要取消预约吗?', + showCancel: true, + success: ({ confirm, cancel }) => { + if(confirm){ + $api.createRequest(`/app/fair/collection/${fairId}`, {}, 'DELETE').then((resData) => { + getList('refresh'); + $api.msg('取消预约成功'); + }); + } + } + }) + + } function getList(type = 'add', loading = true) { @@ -166,6 +178,7 @@ function getList(type = 'add', loading = true) { display: flex align-items: center } + } .card-Title{ font-family: 'PingFangSC-Medium', 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', sans-serif; diff --git a/static/icon/close-blue.png b/static/icon/close-blue.png new file mode 100644 index 0000000..024fd7b Binary files /dev/null and b/static/icon/close-blue.png differ diff --git a/static/icon/close-green.png b/static/icon/close-green.png new file mode 100644 index 0000000..39ddb3c Binary files /dev/null and b/static/icon/close-green.png differ diff --git a/static/icon/notice-blue.png b/static/icon/notice-blue.png new file mode 100644 index 0000000..373531a Binary files /dev/null and b/static/icon/notice-blue.png differ diff --git a/static/icon/notice-green.png b/static/icon/notice-green.png new file mode 100644 index 0000000..d335ce5 Binary files /dev/null and b/static/icon/notice-green.png differ diff --git a/utils/request.js b/utils/request.js index 6746c7f..09d141b 100644 --- a/utils/request.js +++ b/utils/request.js @@ -85,6 +85,7 @@ export function createRequest(url, data = {}, method = 'GET', loading = false, h msg } = resData.data if (code === 200) { + console.log(resData.data) resolve(resData.data) return }