|
@@ -1,29 +1,31 @@
|
|
"use strict";
|
|
"use strict";
|
|
const common_vendor = require("../../common/vendor.js");
|
|
const common_vendor = require("../../common/vendor.js");
|
|
-const common_assets = require("../../common/assets.js");
|
|
|
|
|
|
+const common_config = require("../../common/config.js");
|
|
|
|
+const api_user = require("../../api/user.js");
|
|
const _sfc_main = {
|
|
const _sfc_main = {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
jobDetail: {
|
|
jobDetail: {
|
|
- title: "产品经理",
|
|
|
|
- salary: "20k-30k/月",
|
|
|
|
- department: "产品研发部 全职",
|
|
|
|
- location: "浙江线",
|
|
|
|
- experience: "5-8年",
|
|
|
|
- benefits: ["五险一金", "节日福利", "股权激励"],
|
|
|
|
|
|
+ title: "",
|
|
|
|
+ salary: "",
|
|
|
|
+ department: "",
|
|
|
|
+ location: "",
|
|
|
|
+ experience: "",
|
|
|
|
+ benefits: [],
|
|
description: [
|
|
description: [
|
|
{
|
|
{
|
|
- subtitle: "战略规划与执行",
|
|
|
|
- items: [
|
|
|
|
- "负责敏锐的行业热点感受性,密切追踪行业动态与趋势,为企业战略决策提供参考。",
|
|
|
|
- "结心制定企业战略规划,将长期愿景转化为可操作的战略目标,并有效分解为各阶段具体任务。"
|
|
|
|
- ]
|
|
|
|
|
|
+ subtitle: "岗位要求",
|
|
|
|
+ items: []
|
|
}
|
|
}
|
|
]
|
|
]
|
|
- }
|
|
|
|
|
|
+ },
|
|
|
|
+ selectedJobId: null,
|
|
|
|
+ jobId: null
|
|
};
|
|
};
|
|
},
|
|
},
|
|
- onLoad() {
|
|
|
|
|
|
+ onLoad(options) {
|
|
|
|
+ this.jobId = options.id;
|
|
|
|
+ this.getJobDetail(options.id);
|
|
try {
|
|
try {
|
|
const jobDetailStr = common_vendor.index.getStorageSync("currentJobDetail");
|
|
const jobDetailStr = common_vendor.index.getStorageSync("currentJobDetail");
|
|
if (jobDetailStr) {
|
|
if (jobDetailStr) {
|
|
@@ -44,10 +46,94 @@ const _sfc_main = {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- startInterview() {
|
|
|
|
- common_vendor.index.navigateTo({
|
|
|
|
- url: "/pages/camera/camera"
|
|
|
|
- });
|
|
|
|
|
|
+ async getJobDetail(jobId) {
|
|
|
|
+ try {
|
|
|
|
+ const { data } = await common_vendor.index.request({
|
|
|
|
+ url: `${common_config.apiBaseUrl}/api/mini/job/detail?id=${jobId}&tenant_id=1`,
|
|
|
|
+ method: "GET"
|
|
|
|
+ });
|
|
|
|
+ if (data.code === 2e3) {
|
|
|
|
+ this.jobDetail = {
|
|
|
|
+ title: data.data.title || "",
|
|
|
|
+ salary: data.data.salary_range ? `${data.data.salary_range}/月` : "",
|
|
|
|
+ department: `${data.data.department || ""} ${data.data.job_type === 1 ? "全职" : "兼职"}`,
|
|
|
|
+ location: data.data.location || "",
|
|
|
|
+ experience: data.data.work_experience_required || "不限",
|
|
|
|
+ benefits: data.data.competency_tags || ["五险一金", "带薪年假", "定期体检"],
|
|
|
|
+ description: [
|
|
|
|
+ {
|
|
|
|
+ subtitle: "岗位要求",
|
|
|
|
+ items: [
|
|
|
|
+ data.data.requirements || "",
|
|
|
|
+ data.data.description || ""
|
|
|
|
+ ].filter((item) => item)
|
|
|
|
+ // 过滤掉空值
|
|
|
|
+ }
|
|
|
|
+ ]
|
|
|
|
+ };
|
|
|
|
+ } else {
|
|
|
|
+ common_vendor.index.showToast({
|
|
|
|
+ title: "获取职位详情失败",
|
|
|
|
+ icon: "none"
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ } catch (e) {
|
|
|
|
+ console.error("获取职位详情失败:", e);
|
|
|
|
+ common_vendor.index.showToast({
|
|
|
|
+ title: "获取职位详情失败",
|
|
|
|
+ icon: "none"
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ checkLogin() {
|
|
|
|
+ const userInfo = common_vendor.index.getStorageSync("userInfo");
|
|
|
|
+ if (!userInfo) {
|
|
|
|
+ common_vendor.index.showToast({
|
|
|
|
+ title: "请先登录",
|
|
|
|
+ icon: "none"
|
|
|
|
+ });
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ return true;
|
|
|
|
+ },
|
|
|
|
+ async startInterview() {
|
|
|
|
+ if (!this.checkLogin()) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ try {
|
|
|
|
+ common_vendor.index.setStorageSync("selectedJob", JSON.stringify(this.jobDetail));
|
|
|
|
+ const userInfo = JSON.parse(common_vendor.index.getStorageSync("userInfo"));
|
|
|
|
+ const response = await api_user.applyJob({
|
|
|
|
+ job_id: this.jobId,
|
|
|
|
+ tenant_id: 1,
|
|
|
|
+ openid: userInfo.openid
|
|
|
|
+ });
|
|
|
|
+ if (response && response.id) {
|
|
|
|
+ common_vendor.index.setStorageSync("appId", response.id);
|
|
|
|
+ try {
|
|
|
|
+ userInfo.appId = response.id;
|
|
|
|
+ common_vendor.index.setStorageSync("userInfo", JSON.stringify(userInfo));
|
|
|
|
+ } catch (e) {
|
|
|
|
+ console.error("更新用户信息失败:", e);
|
|
|
|
+ }
|
|
|
|
+ common_vendor.index.navigateTo({
|
|
|
|
+ url: "/pages/Personal/Personal",
|
|
|
|
+ fail: (err) => {
|
|
|
|
+ console.error("页面跳转失败:", err);
|
|
|
|
+ common_vendor.index.showToast({
|
|
|
|
+ title: "页面跳转失败",
|
|
|
|
+ icon: "none"
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ } catch (err) {
|
|
|
|
+ console.error("申请职位失败:", err);
|
|
|
|
+ common_vendor.index.showToast({
|
|
|
|
+ title: "申请职位失败,请重试",
|
|
|
|
+ icon: "none"
|
|
|
|
+ });
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
};
|
|
};
|
|
@@ -58,21 +144,20 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
c: common_vendor.t($data.jobDetail.department),
|
|
c: common_vendor.t($data.jobDetail.department),
|
|
d: common_vendor.t($data.jobDetail.location),
|
|
d: common_vendor.t($data.jobDetail.location),
|
|
e: common_vendor.t($data.jobDetail.experience),
|
|
e: common_vendor.t($data.jobDetail.experience),
|
|
- f: common_assets._imports_0$2,
|
|
|
|
- g: common_vendor.f($data.jobDetail.benefits, (benefit, index, i0) => {
|
|
|
|
|
|
+ f: common_vendor.f($data.jobDetail.benefits, (benefit, index, i0) => {
|
|
return {
|
|
return {
|
|
a: common_vendor.t(benefit),
|
|
a: common_vendor.t(benefit),
|
|
b: index
|
|
b: index
|
|
};
|
|
};
|
|
}),
|
|
}),
|
|
- h: common_vendor.t($data.jobDetail.description[0].subtitle),
|
|
|
|
- i: common_vendor.f($data.jobDetail.description[0].items, (item, index, i0) => {
|
|
|
|
|
|
+ g: common_vendor.t($data.jobDetail.description[0].subtitle),
|
|
|
|
+ h: common_vendor.f($data.jobDetail.description[0].items, (item, index, i0) => {
|
|
return {
|
|
return {
|
|
a: common_vendor.t(item),
|
|
a: common_vendor.t(item),
|
|
b: index
|
|
b: index
|
|
};
|
|
};
|
|
}),
|
|
}),
|
|
- j: common_vendor.o((...args) => $options.startInterview && $options.startInterview(...args))
|
|
|
|
|
|
+ i: common_vendor.o((...args) => $options.startInterview && $options.startInterview(...args))
|
|
};
|
|
};
|
|
}
|
|
}
|
|
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-2bde8e2a"]]);
|
|
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-2bde8e2a"]]);
|