Merge branch 'main' into yxl
This commit is contained in:
@@ -13,7 +13,7 @@
|
|||||||
v-for="(card, index) in localJobCardsList"
|
v-for="(card, index) in localJobCardsList"
|
||||||
:key="index"
|
:key="index"
|
||||||
class="custom-card"
|
class="custom-card"
|
||||||
@tap="navigateToJobDetail(card.jobId)"
|
@tap="navigateToJobDetail(card.encryptJobId)"
|
||||||
>
|
>
|
||||||
<view class="card-title">
|
<view class="card-title">
|
||||||
<text class="title-text">{{ card.jobTitle }}</text>
|
<text class="title-text">{{ card.jobTitle }}</text>
|
||||||
@@ -76,26 +76,24 @@ watch(() => renderedHtml.value, (newVal) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// 微信小程序端导航到岗位详情页面
|
// 微信小程序端导航到岗位详情页面
|
||||||
const navigateToJobDetail = (jobId) => {
|
const navigateToJobDetail = (encryptJobId) => {
|
||||||
console.log('navigateToJobDetail called with jobId:', jobId);
|
console.log('navigateToJobDetail called with encryptJobId:', encryptJobId);
|
||||||
if (jobId && jobId !== 'undefined' && jobId !== 'null') {
|
if (encryptJobId && encryptJobId !== 'undefined' && encryptJobId !== 'null') {
|
||||||
// 跳转到岗位详情页面
|
let url = `/packageA/pages/post/post?encryptJobId=${encryptJobId}`
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/packageA/pages/post/post?jobId=${jobId}`,
|
url: url,
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
console.log('navigateTo success:', res);
|
console.log('navigateTo success:', res);
|
||||||
},
|
},
|
||||||
fail: (err) => {
|
fail: (err) => {
|
||||||
console.error('navigateTo failed:', err);
|
console.error('navigateTo failed:', err);
|
||||||
// 如果navigateTo失败,尝试redirectTo
|
|
||||||
uni.redirectTo({
|
uni.redirectTo({
|
||||||
url: `/packageA/pages/post/post?jobId=${jobId}`,
|
url: url,
|
||||||
success: (res2) => {
|
success: (res2) => {
|
||||||
console.log('redirectTo success:', res2);
|
console.log('redirectTo success:', res2);
|
||||||
},
|
},
|
||||||
fail: (err2) => {
|
fail: (err2) => {
|
||||||
console.error('redirectTo also failed:', err2);
|
console.error('redirectTo also failed:', err2);
|
||||||
// 如果还是失败,显示错误提示
|
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '跳转失败,请稍后重试',
|
title: '跳转失败,请稍后重试',
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
@@ -105,7 +103,7 @@ const navigateToJobDetail = (jobId) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
console.error('Invalid jobId:', jobId);
|
console.error('Invalid encryptJobId:', encryptJobId);
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '岗位信息不完整',
|
title: '岗位信息不完整',
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
@@ -134,36 +132,33 @@ const handleH5Click = (e) => {
|
|||||||
console.log('Found elements:', { cardElement, moreElement });
|
console.log('Found elements:', { cardElement, moreElement });
|
||||||
|
|
||||||
if (cardElement) {
|
if (cardElement) {
|
||||||
// 尝试多种方式获取jobId
|
let encryptJobId = cardElement.getAttribute('data-encrypt-job-id');
|
||||||
let jobId = cardElement.getAttribute('data-job-id');
|
console.log('Found custom-card, data-encrypt-job-id attribute:', encryptJobId);
|
||||||
console.log('Found custom-card, data-job-id attribute:', jobId);
|
|
||||||
|
|
||||||
// 如果data-job-id为空,尝试从onclick事件中提取jobId
|
if (!encryptJobId) {
|
||||||
if (!jobId) {
|
|
||||||
const onclick = cardElement.getAttribute('onclick');
|
const onclick = cardElement.getAttribute('onclick');
|
||||||
if (onclick) {
|
if (onclick) {
|
||||||
const match = onclick.match(/jobId=(\w+)/);
|
const match = onclick.match(/encryptJobId=([^'"]+)/);
|
||||||
if (match && match[1]) {
|
if (match && match[1]) {
|
||||||
jobId = match[1];
|
encryptJobId = match[1];
|
||||||
console.log('Extracted jobId from onclick:', jobId);
|
console.log('Extracted encryptJobId from onclick:', encryptJobId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (jobId) {
|
if (encryptJobId) {
|
||||||
console.log('Final jobId for navigation:', jobId);
|
console.log('Final encryptJobId for navigation:', encryptJobId);
|
||||||
try {
|
try {
|
||||||
// 直接使用uni.navigateTo,避免navTo函数的潜在问题
|
let url = `/packageA/pages/post/post?encryptJobId=${encryptJobId}`
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/packageA/pages/post/post?jobId=${jobId}`,
|
url: url,
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
console.log('navigateTo success:', res);
|
console.log('navigateTo success:', res);
|
||||||
},
|
},
|
||||||
fail: (err) => {
|
fail: (err) => {
|
||||||
console.error('navigateTo failed:', err);
|
console.error('navigateTo failed:', err);
|
||||||
// 如果navigateTo失败,尝试redirectTo
|
|
||||||
uni.redirectTo({
|
uni.redirectTo({
|
||||||
url: `/packageA/pages/post/post?jobId=${jobId}`,
|
url: url,
|
||||||
success: (res2) => {
|
success: (res2) => {
|
||||||
console.log('redirectTo success:', res2);
|
console.log('redirectTo success:', res2);
|
||||||
},
|
},
|
||||||
@@ -178,39 +173,36 @@ const handleH5Click = (e) => {
|
|||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
console.error('No jobId found for custom-card');
|
console.error('No encryptJobId found for custom-card');
|
||||||
}
|
}
|
||||||
} else if (moreElement) {
|
} else if (moreElement) {
|
||||||
// 尝试多种方式获取jobId
|
let encryptJobId = moreElement.getAttribute('data-encrypt-job-id');
|
||||||
let jobId = moreElement.getAttribute('data-job-id');
|
console.log('Found custom-more, data-encrypt-job-id attribute:', encryptJobId);
|
||||||
console.log('Found custom-more, data-job-id attribute:', jobId);
|
|
||||||
|
|
||||||
// 如果data-job-id为空,尝试从onclick事件中提取jobId
|
if (!encryptJobId) {
|
||||||
if (!jobId) {
|
|
||||||
const onclick = moreElement.getAttribute('onclick');
|
const onclick = moreElement.getAttribute('onclick');
|
||||||
if (onclick) {
|
if (onclick) {
|
||||||
const match = onclick.match(/jobId=(\w+)/);
|
const match = onclick.match(/encryptJobId=([^'"]+)/);
|
||||||
if (match && match[1]) {
|
if (match && match[1]) {
|
||||||
jobId = match[1];
|
encryptJobId = match[1];
|
||||||
console.log('Extracted jobId from onclick:', jobId);
|
console.log('Extracted encryptJobId from onclick:', encryptJobId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (jobId) {
|
if (encryptJobId) {
|
||||||
console.log('Final jobId for more jobs:', jobId);
|
console.log('Final encryptJobId for more jobs:', encryptJobId);
|
||||||
try {
|
try {
|
||||||
// 直接使用uni.navigateTo,避免navTo函数的潜在问题
|
let url = `/packageA/pages/moreJobs/moreJobs?encryptJobId=${encryptJobId}`
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/packageA/pages/moreJobs/moreJobs?jobId=${jobId}`,
|
url: url,
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
console.log('navigateTo success:', res);
|
console.log('navigateTo success:', res);
|
||||||
},
|
},
|
||||||
fail: (err) => {
|
fail: (err) => {
|
||||||
console.error('navigateTo failed:', err);
|
console.error('navigateTo failed:', err);
|
||||||
// 如果navigateTo失败,尝试redirectTo
|
|
||||||
uni.redirectTo({
|
uni.redirectTo({
|
||||||
url: `/packageA/pages/moreJobs/moreJobs?jobId=${jobId}`,
|
url: url,
|
||||||
success: (res2) => {
|
success: (res2) => {
|
||||||
console.log('redirectTo success:', res2);
|
console.log('redirectTo success:', res2);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ onReachBottom(() => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
function navToPost(job) {
|
function navToPost(job) {
|
||||||
navTo(`/packageA/pages/post/post?jobId=${encodeURIComponent(job.jobId)}&encryptJobId=${encodeURIComponent(job.encryptJobId)}`);
|
navTo(`/packageA/pages/post/post?encryptJobId=${encodeURIComponent(job.encryptJobId)}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getJobList(type = 'add') {
|
function getJobList(type = 'add') {
|
||||||
|
|||||||
@@ -368,7 +368,7 @@
|
|||||||
function navToJobDetail(jobId) {
|
function navToJobDetail(jobId) {
|
||||||
return
|
return
|
||||||
if (jobId) {
|
if (jobId) {
|
||||||
navTo(`/packageA/pages/post/post?jobId=${encodeURIComponent(jobId)}`);
|
navTo(`/packageA/pages/post/post`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ function toSelectDate() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function navToPost(job) {
|
function navToPost(job) {
|
||||||
navTo(`/packageA/pages/post/post?jobId=${encodeURIComponent(job.jobId)}&encryptJobId=${encodeURIComponent(job.encryptJobId)}`);
|
navTo(`/packageA/pages/post/post?encryptJobId=${encodeURIComponent(job.encryptJobId)}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
function searchCollection(e) {
|
function searchCollection(e) {
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ onReachBottom(() => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
function navToPost(job) {
|
function navToPost(job) {
|
||||||
navTo(`/packageA/pages/post/post?jobId=${encodeURIComponent(job.jobId)}&encryptJobId=${encodeURIComponent(job.encryptJobId)}`);
|
navTo(`/packageA/pages/post/post?encryptJobId=${encodeURIComponent(job.encryptJobId)}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getJobList(type = 'add') {
|
function getJobList(type = 'add') {
|
||||||
|
|||||||
@@ -197,7 +197,7 @@ onLoad(() => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
function navToPost(jobId) {
|
function navToPost(jobId) {
|
||||||
navTo(`/packageA/pages/post/post?jobId=${encodeURIComponent(jobId)}`);
|
navTo(`/packageA/pages/post/post`);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function loadData() {
|
async function loadData() {
|
||||||
|
|||||||
@@ -187,7 +187,7 @@ const fromValue = reactive({
|
|||||||
politicalAffiliation: '',
|
politicalAffiliation: '',
|
||||||
idCard: '',
|
idCard: '',
|
||||||
phone: '',
|
phone: '',
|
||||||
userType: ''
|
userTag: ''
|
||||||
});
|
});
|
||||||
|
|
||||||
// 输入校验相关
|
// 输入校验相关
|
||||||
@@ -280,9 +280,9 @@ function initLoad() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 回显人员类型
|
// 回显人员类型
|
||||||
if (currentUserInfo.userType) {
|
if (currentUserInfo.userTag) {
|
||||||
fromValue.userType = currentUserInfo.userType;
|
fromValue.userTag = currentUserInfo.userTag;
|
||||||
const userTypeValues = currentUserInfo.userType.split(',');
|
const userTypeValues = currentUserInfo.userTag.split(',');
|
||||||
state.userTypeValues = userTypeValues;
|
state.userTypeValues = userTypeValues;
|
||||||
initUserTypeText(userTypeValues);
|
initUserTypeText(userTypeValues);
|
||||||
}
|
}
|
||||||
@@ -355,10 +355,10 @@ function initUserTypeText(userTypeValues) {
|
|||||||
|
|
||||||
getDictSelectOption('user_type').then(data => {
|
getDictSelectOption('user_type').then(data => {
|
||||||
if (!trySetText(data)) {
|
if (!trySetText(data)) {
|
||||||
state.userTypeText = fromValue.userType;
|
state.userTypeText = fromValue.userTag;
|
||||||
}
|
}
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
state.userTypeText = fromValue.userType;
|
state.userTypeText = fromValue.userTag;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -375,9 +375,7 @@ const confirm = () => {
|
|||||||
if (!fromValue.politicalAffiliation) {
|
if (!fromValue.politicalAffiliation) {
|
||||||
return $api.msg('请选择政治面貌');
|
return $api.msg('请选择政治面貌');
|
||||||
}
|
}
|
||||||
if (!fromValue.userType) {
|
|
||||||
return $api.msg('请选择人员类型');
|
|
||||||
}
|
|
||||||
if (!checkingPhoneRegExp(fromValue.phone)) {
|
if (!checkingPhoneRegExp(fromValue.phone)) {
|
||||||
return $api.msg('请输入正确手机号');
|
return $api.msg('请输入正确手机号');
|
||||||
}
|
}
|
||||||
@@ -724,7 +722,7 @@ async function changeUserType() {
|
|||||||
defaultValues: state.userTypeValues,
|
defaultValues: state.userTypeValues,
|
||||||
success: (selectedValues, selectedItems) => {
|
success: (selectedValues, selectedItems) => {
|
||||||
state.userTypeValues = selectedValues;
|
state.userTypeValues = selectedValues;
|
||||||
fromValue.userType = selectedValues.join(',');
|
fromValue.userTag = selectedValues.join(',');
|
||||||
state.userTypeText = selectedItems.map(item => item.label).join('、');
|
state.userTypeText = selectedItems.map(item => item.label).join('、');
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -272,7 +272,6 @@ const jobInfo = ref({});
|
|||||||
const state = reactive({});
|
const state = reactive({});
|
||||||
const mapCovers = ref([]);
|
const mapCovers = ref([]);
|
||||||
const jobIdRef = ref();
|
const jobIdRef = ref();
|
||||||
const jobId = ref();
|
|
||||||
// 竞争力分析数据,初始化为包含默认值的完整结构,确保雷达图能正常渲染
|
// 竞争力分析数据,初始化为包含默认值的完整结构,确保雷达图能正常渲染
|
||||||
const raderData = ref({
|
const raderData = ref({
|
||||||
matchScore: 0,
|
matchScore: 0,
|
||||||
@@ -316,9 +315,6 @@ onShow(() => {
|
|||||||
});
|
});
|
||||||
function initLoad(option) {
|
function initLoad(option) {
|
||||||
const encryptJobId = decodeURIComponent(option.encryptJobId);
|
const encryptJobId = decodeURIComponent(option.encryptJobId);
|
||||||
if (option.jobId) {
|
|
||||||
jobId.value = decodeURIComponent(option.jobId);
|
|
||||||
}
|
|
||||||
if (encryptJobId !== jobIdRef.value) {
|
if (encryptJobId !== jobIdRef.value) {
|
||||||
jobIdRef.value = encryptJobId;
|
jobIdRef.value = encryptJobId;
|
||||||
getDetail(encryptJobId);
|
getDetail(encryptJobId);
|
||||||
@@ -468,12 +464,9 @@ function confirmAction() {
|
|||||||
const encryptJobId = jobIdRef.value;
|
const encryptJobId = jobIdRef.value;
|
||||||
if (jobInfo.value.isApply === 1) {
|
if (jobInfo.value.isApply === 1) {
|
||||||
// 取消投递
|
// 取消投递
|
||||||
const cancelJobId = jobId.value || jobInfo.value.jobId;
|
$api.createRequest(`/app/job/applyJobCencal/${encryptJobId}`, {}, 'DELETE').then((resData) => {
|
||||||
|
|
||||||
console.log(jobInfo.value.jobId, 'jobInfo.value.jobId');
|
|
||||||
$api.createRequest(`/app/job/applyJobCencal`, { jobId: jobInfo.value.jobId }, 'DELETE').then((resData) => {
|
|
||||||
$api.msg('取消投递成功');
|
$api.msg('取消投递成功');
|
||||||
getDetail(encryptJobId); // 刷新职位信息
|
getDetail(encryptJobId);
|
||||||
showConfirmDialog.value = false;
|
showConfirmDialog.value = false;
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
@@ -501,8 +494,7 @@ function confirmApply() {
|
|||||||
|
|
||||||
// 取消投递
|
// 取消投递
|
||||||
function cancelApply() {
|
function cancelApply() {
|
||||||
const cancelJobId = jobId.value || jobInfo.value.jobId;
|
$api.createRequest(`/app/job/applyJobCencal`, { jobId: jobIdRef.value }, 'DELETE').then((resData) => {
|
||||||
$api.createRequest(`/app/job/applyJobCencal`, { jobId: cancelJobId }, 'DELETE').then((resData) => {
|
|
||||||
$api.msg('取消投递成功');
|
$api.msg('取消投递成功');
|
||||||
showConfirmDialog.value = false;
|
showConfirmDialog.value = false;
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ function nextDetail() {
|
|||||||
recommedIndexDb.addRecord(recordData);
|
recommedIndexDb.addRecord(recordData);
|
||||||
}
|
}
|
||||||
console.log(job.jobId);
|
console.log(job.jobId);
|
||||||
navTo(`/packageA/pages/post/post?jobId=${encodeURIComponent(job.jobId)}`);
|
navTo(`/packageA/pages/post/post`);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getNextVideoSrc(num) {
|
function getNextVideoSrc(num) {
|
||||||
|
|||||||
@@ -1102,7 +1102,7 @@ function clearfindJob(job) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function nextDetail(job) {
|
function nextDetail(job) {
|
||||||
navTo(`/packageA/pages/post/post?jobId=${encodeURIComponent(job.jobId)}&encryptJobId=${encodeURIComponent(job.encryptJobId)}`);
|
navTo(`/packageA/pages/post/post?encryptJobId=${encodeURIComponent(job.encryptJobId)}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
function navToService(serviceType) {
|
function navToService(serviceType) {
|
||||||
|
|||||||
@@ -151,7 +151,7 @@ function nextDetail(job) {
|
|||||||
const recordData = recommedIndexDb.JobParameter(job);
|
const recordData = recommedIndexDb.JobParameter(job);
|
||||||
recommedIndexDb.addRecord(recordData);
|
recommedIndexDb.addRecord(recordData);
|
||||||
}
|
}
|
||||||
navTo(`/packageA/pages/post/post?jobId=${encodeURIComponent(job.jobId)}`);
|
navTo(`/packageA/pages/post/post`);
|
||||||
}
|
}
|
||||||
|
|
||||||
function nextVideo(job) {
|
function nextVideo(job) {
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ function handleMsgClick() {
|
|||||||
|
|
||||||
if (item.noticeType === '4') {
|
if (item.noticeType === '4') {
|
||||||
if (item.bussinessIdEncrypt) {
|
if (item.bussinessIdEncrypt) {
|
||||||
navTo(`/packageA/pages/post/post?jobId=${encodeURIComponent(item.bussinessId)}&encryptJobId=${encodeURIComponent(item.bussinessIdEncrypt)}`);
|
navTo(`/packageA/pages/post/post?encryptJobId=${encodeURIComponent(item.bussinessIdEncrypt)}`);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ function nextDetail(job) {
|
|||||||
const recordData = recommedIndexDb.JobParameter(job);
|
const recordData = recommedIndexDb.JobParameter(job);
|
||||||
recommedIndexDb.addRecord(recordData);
|
recommedIndexDb.addRecord(recordData);
|
||||||
}
|
}
|
||||||
navTo(`/packageA/pages/post/post?jobId=${encodeURIComponent(job.jobId)}&encryptJobId=${encodeURIComponent(job.encryptJobId)}`);
|
navTo(`/packageA/pages/post/post?encryptJobId=${encodeURIComponent(job.encryptJobId)}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
function nextVideo(job) {
|
function nextVideo(job) {
|
||||||
|
|||||||
@@ -19,30 +19,31 @@ const md = new MarkdownIt({
|
|||||||
if (lang === 'job-json') {
|
if (lang === 'job-json') {
|
||||||
const result = safeExtractJson(str);
|
const result = safeExtractJson(str);
|
||||||
if (result) { // json解析成功
|
if (result) { // json解析成功
|
||||||
let jobId = result.appJobUrl;
|
let encryptJobId = result.appJobUrl;
|
||||||
// If appJobUrl contains 'jobId=', extract the value after it, otherwise use it directly
|
// If appJobUrl contains 'jobId=', extract the value after it, otherwise use it directly
|
||||||
if (jobId && jobId.includes('jobId=')) {
|
if (encryptJobId && encryptJobId.includes('jobId=')) {
|
||||||
jobId = jobId.split('jobId=')[1];
|
encryptJobId = encryptJobId.split('jobId=')[1];
|
||||||
// 如果还有额外的参数,只取jobId部分
|
// 如果还有额外的参数,只取encryptJobId部分
|
||||||
if (jobId.includes('&')) {
|
if (encryptJobId.includes('&')) {
|
||||||
jobId = jobId.split('&')[0];
|
encryptJobId = encryptJobId.split('&')[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log('Job JSON result:', result, 'Extracted jobId:', jobId);
|
console.log('Job JSON result:', result, 'Extracted encryptJobId:', encryptJobId);
|
||||||
|
|
||||||
// 确保jobId有效
|
// 确保encryptJobId有效
|
||||||
if (!jobId || jobId === 'undefined' || jobId === 'null') {
|
if (!encryptJobId || encryptJobId === 'undefined' || encryptJobId === 'null') {
|
||||||
console.error('Invalid jobId extracted:', jobId, 'from appJobUrl:', result.appJobUrl);
|
console.error('Invalid encryptJobId extracted:', encryptJobId, 'from appJobUrl:', result.appJobUrl);
|
||||||
// 尝试从其他字段获取jobId
|
// 尝试从其他字段获取encryptJobId
|
||||||
if (result.jobId) {
|
if (result.jobId) {
|
||||||
jobId = result.jobId;
|
encryptJobId = result.jobId;
|
||||||
console.log('Using jobId from result.jobId:', jobId);
|
console.log('Using jobId from result.jobId as encryptJobId:', encryptJobId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 添加到岗位卡片列表,供小程序端单独渲染
|
// 添加到岗位卡片列表,供小程序端单独渲染
|
||||||
jobCardsList.push({
|
jobCardsList.push({
|
||||||
jobId,
|
jobId: encryptJobId,
|
||||||
|
encryptJobId,
|
||||||
jobTitle: result.jobTitle,
|
jobTitle: result.jobTitle,
|
||||||
salary: result.salary,
|
salary: result.salary,
|
||||||
location: result.location,
|
location: result.location,
|
||||||
@@ -50,16 +51,16 @@ const md = new MarkdownIt({
|
|||||||
education: result.education,
|
education: result.education,
|
||||||
experience: result.experience
|
experience: result.experience
|
||||||
});
|
});
|
||||||
|
|
||||||
// 生成岗位卡片HTML,注意:微信小程序rich-text组件只支持部分HTML属性
|
// 生成岗位卡片HTML,注意:微信小程序rich-text组件只支持部分HTML属性
|
||||||
// 使用普通的href属性,微信小程序rich-text会将其转换为可点击链接
|
// 使用普通的href属性,微信小程序rich-text会将其转换为可点击链接
|
||||||
// 添加data-job-id属性,方便获取jobId
|
// 添加data-encrypt-job-id属性,方便获取encryptJobId
|
||||||
// 为所有平台添加onclick事件,微信小程序可能会忽略,但H5端会生效
|
// 为所有平台添加onclick事件,微信小程序可能会忽略,但H5端会生效
|
||||||
// 内联基础样式确保在所有平台上正确显示(使用px单位以确保H5兼容性)
|
// 内联基础样式确保在所有平台上正确显示(使用px单位以确保H5兼容性)
|
||||||
let domContext = `<a class="custom-card" href="/packageA/pages/post/post?jobId=${jobId}" data-job-id="${jobId}" data-jobid="${jobId}" onclick="if(typeof uni !== 'undefined'){uni.navigateTo({url: '/packageA/pages/post/post?jobId=${jobId}'});return false;}" style="display: flex; flex-direction: column; margin-bottom: 11px; background: #FFFFFF; box-shadow: 0 0 4px rgba(0,0,0,0.04); border-radius: 10px; padding: 14px 12px; font-weight: 400; font-size: 14px; color: #333333; text-decoration: none; overflow: hidden; box-sizing: border-box; width: 100%; max-width: 100%;"><div class="card-title" style="font-weight: 600; display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px;"><span class="title-text" style="font-family: 'PingFangSC-Medium', 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', sans-serif; font-size: 16px; line-height: 1.4; color: #333333; max-width: calc(100% - 80px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">${result.jobTitle}</span><div class="card-salary" style="font-family: DIN-Medium; font-size: 16px; color: #4C6EFB; line-height: 1.4; font-weight: 500;">${result.salary}</div></div><div class="card-company" style="margin-bottom: 9px; font-size: 14px; color: #6C7282; line-height: 1.4; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">${result.location}·${result.companyName}</div><div class="card-info" style="display: flex; align-items: center; justify-content: space-between; padding-right: 20px;"><div class="info-item" style="display: flex; position: relative; align-items: center;"><div class="card-tag" style="font-weight: 400; font-size: 12px; color: #6C7282; width: fit-content; background: #F4F4F4; border-radius: 2px; padding: 3px 10px; margin-right: 10px; display: inline-flex; align-items: center; justify-content: center; height: 15px; line-height: 15px;">${result.education}</div><div class="card-tag" style="font-weight: 400; font-size: 12px; color: #6C7282; width: fit-content; background: #F4F4F4; border-radius: 2px; padding: 3px 10px; margin-right: 10px; display: inline-flex; align-items: center; justify-content: center; height: 15px; line-height: 15px;">${result.experience}</div></div><div class="info-item" style="color: #256BFA; font-size: 14px; padding-right: 5px; position: relative;">查看详情<div class="position-nav" style="position: absolute; right: -5px; top: 50%; transform: translateY(-50%);"></div></div></div></a>`
|
let domContext = `<a class="custom-card" href="/packageA/pages/post/post?encryptJobId=${encryptJobId}" data-encrypt-job-id="${encryptJobId}" onclick="if(typeof uni !== 'undefined'){uni.navigateTo({url: '/packageA/pages/post/post?encryptJobId=${encryptJobId}'});return false;}" style="display: flex; flex-direction: column; margin-bottom: 11px; background: #FFFFFF; box-shadow: 0 0 4px rgba(0,0,0,0.04); border-radius: 10px; padding: 14px 12px; font-weight: 400; font-size: 14px; color: #333333; text-decoration: none; overflow: hidden; box-sizing: border-box; width: 100%; max-width: 100%;"><div class="card-title" style="font-weight: 600; display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px;"><span class="title-text" style="font-family: 'PingFangSC-Medium', 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', sans-serif; font-size: 16px; line-height: 1.4; color: #333333; max-width: calc(100% - 80px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">${result.jobTitle}</span><div class="card-salary" style="font-family: DIN-Medium; font-size: 16px; color: #4C6EFB; line-height: 1.4; font-weight: 500;">${result.salary}</div></div><div class="card-company" style="margin-bottom: 9px; font-size: 14px; color: #6C7282; line-height: 1.4; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">${result.location}·${result.companyName}</div><div class="card-info" style="display: flex; align-items: center; justify-content: space-between; padding-right: 20px;"><div class="info-item" style="display: flex; position: relative; align-items: center;"><div class="card-tag" style="font-weight: 400; font-size: 12px; color: #6C7282; width: fit-content; background: #F4F4F4; border-radius: 2px; padding: 3px 10px; margin-right: 10px; display: inline-flex; align-items: center; justify-content: center; height: 15px; line-height: 15px;">${result.education}</div><div class="card-tag" style="font-weight: 400; font-size: 12px; color: #6C7282; width: fit-content; background: #F4F4F4; border-radius: 2px; padding: 3px 10px; display: inline-flex; align-items: center; justify-content: center; height: 15px; line-height: 15px;">${result.experience}</div></div><div class="info-item">查看详情<div class="position-nav" style="width: 14px; height: 14px; background: url('@/static/svg/position-nav.svg') center center no-repeat; background-size: 100% 100%; margin-left: 10px;padding-right: 50rpx"></div></div></div></a>`
|
||||||
if (result.data) {
|
if (result.data) {
|
||||||
jobMoreMap.set(jobId, result.data)
|
jobMoreMap.set(encryptJobId, result.data)
|
||||||
domContext += `<a class="custom-more" href="/packageA/pages/moreJobs/moreJobs?jobId=${jobId}" data-job-id="${jobId}" data-jobid="${jobId}" onclick="if(typeof uni !== 'undefined'){uni.navigateTo({url: '/packageA/pages/moreJobs/moreJobs?jobId=${jobId}'});return false;}" style="display: flex; justify-content: center; align-items: center; color: #FFFFFF; background: linear-gradient(135deg, #256BFA 0%, #9E74FD 100%); border-radius: 25px; padding: 10px 16px; margin: 10px 0; font-size: 14px; font-weight: 600; box-shadow: 0 4px 12px rgba(37, 107, 250, 0.3); text-decoration: none; box-sizing: border-box; width: 100%;">查看更多岗位<div class="more-icon" style="width: 16px; height: 16px; background: url('@/static/svg/seemore.svg') center center no-repeat; background-size: 100% 100%; margin-left: 6px;"></div></a>`
|
domContext += `<a class="custom-more" href="/packageA/pages/moreJobs/moreJobs?encryptJobId=${encryptJobId}" data-encrypt-job-id="${encryptJobId}" onclick="if(typeof uni !== 'undefined'){uni.navigateTo({url: '/packageA/pages/moreJobs/moreJobs?encryptJobId=${encryptJobId}'});return false;}" style="display: flex; justify-content: center; align-items: center; color: #FFFFFF; background: linear-gradient(135deg, #256BFA 0%, #9E74FD 100%); border-radius: 25px; padding: 10px 16px; margin: 10px 0; font-size: 14px; font-weight: 600; box-shadow: 0 4px 12px rgba(37, 107, 250, 0.3); text-decoration: none; box-sizing: border-box; width: 100%;">查看更多岗位<div class="more-icon" style="width: 16px; height: 16px; background: url('@/static/svg/seemore.svg') center center no-repeat; background-size: 100% 100%; margin-left: 6px;"></div></a>`
|
||||||
}
|
}
|
||||||
return domContext
|
return domContext
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -188,8 +188,8 @@ export function createRequest(url, data = {}, method = 'GET', loading = false, h
|
|||||||
header,
|
header,
|
||||||
success: resData => {
|
success: resData => {
|
||||||
const responseData = handleResponseData(resData.data)
|
const responseData = handleResponseData(resData.data)
|
||||||
// console.log('[请求] 接口地址:', config.baseUrl + url)
|
console.log('[请求] 接口地址:', config.baseUrl + url)
|
||||||
// console.log('[请求] 解密后数据:', JSON.stringify(responseData))
|
console.log('[请求] 解密后数据:', JSON.stringify(responseData))
|
||||||
// 响应拦截
|
// 响应拦截
|
||||||
if (resData.statusCode === 200) {
|
if (resData.statusCode === 200) {
|
||||||
const {
|
const {
|
||||||
|
|||||||
Reference in New Issue
Block a user