|
@@ -5,6 +5,7 @@ const api_position = require("../../api/position.js");
|
|
|
const api_message = require("../../api/message.js");
|
|
const api_message = require("../../api/message.js");
|
|
|
const api_collection = require("../../api/collection.js");
|
|
const api_collection = require("../../api/collection.js");
|
|
|
const api_assessment = require("../../api/assessment.js");
|
|
const api_assessment = require("../../api/assessment.js");
|
|
|
|
|
+const api_order = require("../../api/order.js");
|
|
|
const _sfc_main = {
|
|
const _sfc_main = {
|
|
|
__name: "index",
|
|
__name: "index",
|
|
|
setup(__props) {
|
|
setup(__props) {
|
|
@@ -29,7 +30,7 @@ const _sfc_main = {
|
|
|
});
|
|
});
|
|
|
const positionId = common_vendor.ref(null);
|
|
const positionId = common_vendor.ref(null);
|
|
|
const checkState = async () => {
|
|
const checkState = async () => {
|
|
|
- common_vendor.index.__f__("log", "at pages/jobdetail/index.vue:139", "Checking job state for position:", positionId.value);
|
|
|
|
|
|
|
+ common_vendor.index.__f__("log", "at pages/jobdetail/index.vue:140", "Checking job state for position:", positionId.value);
|
|
|
const userInfo = common_vendor.index.getStorageSync("userInfo");
|
|
const userInfo = common_vendor.index.getStorageSync("userInfo");
|
|
|
if (!userInfo || !userInfo.studentId || !positionId.value) {
|
|
if (!userInfo || !userInfo.studentId || !positionId.value) {
|
|
|
jobState.value = "initial";
|
|
jobState.value = "initial";
|
|
@@ -41,12 +42,42 @@ const _sfc_main = {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
try {
|
|
try {
|
|
|
|
|
+ if (!jobInfo.value || !jobInfo.value.postName) {
|
|
|
|
|
+ const jobRes = await api_position.getPositionDetail(positionId.value);
|
|
|
|
|
+ if (jobRes.code === 200 && jobRes.data) {
|
|
|
|
|
+ jobInfo.value = jobRes.data;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
const evalRes = await api_assessment.getAssessmentList({ positionId: positionId.value, pageNum: 1, pageSize: 100 });
|
|
const evalRes = await api_assessment.getAssessmentList({ positionId: positionId.value, pageNum: 1, pageSize: 100 });
|
|
|
- const isAnyEvalPaid = evalRes.code === 200 && evalRes.rows ? evalRes.rows.some((e) => common_vendor.index.getStorageSync(`audit_paid_${e.id}`)) : common_vendor.index.getStorageSync(`audit_paid_${positionId.value}`);
|
|
|
|
|
|
|
+ const fallbackPaidKey = `audit_paid_pos_${positionId.value}`;
|
|
|
|
|
+ const isFallbackPaid = !!common_vendor.index.getStorageSync(fallbackPaidKey);
|
|
|
|
|
+ let isAnyEvalPaid = evalRes.code === 200 && evalRes.rows ? evalRes.rows.some((e) => common_vendor.index.getStorageSync(`audit_paid_${e.id}`)) || isFallbackPaid : isFallbackPaid || !!common_vendor.index.getStorageSync(`audit_paid_${positionId.value}`);
|
|
|
|
|
+ if (!isAnyEvalPaid) {
|
|
|
|
|
+ try {
|
|
|
|
|
+ const orderRes = await api_order.listOrder({
|
|
|
|
|
+ orderStatus: 1,
|
|
|
|
|
+ buyerId: userInfo.studentId
|
|
|
|
|
+ });
|
|
|
|
|
+ if (orderRes.code === 200 && orderRes.rows) {
|
|
|
|
|
+ isAnyEvalPaid = orderRes.rows.some((order) => {
|
|
|
|
|
+ var _a;
|
|
|
|
|
+ const remark = order.remark || "";
|
|
|
|
|
+ const matchPost = ((_a = jobInfo.value) == null ? void 0 : _a.postName) && remark.includes(jobInfo.value.postName);
|
|
|
|
|
+ const matchEval = evalRes.rows && evalRes.rows.some((e) => e.evaluationName && remark.includes(e.evaluationName));
|
|
|
|
|
+ return matchPost || matchEval;
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (e) {
|
|
|
|
|
+ common_vendor.index.__f__("error", "at pages/jobdetail/index.vue:191", "[JobDetail] 订单校验失败:", e);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ common_vendor.index.__f__("log", "at pages/jobdetail/index.vue:195", "[JobDetail] 支付状态最终综合判定:", isAnyEvalPaid);
|
|
|
if (evalRes.code !== 200 || !evalRes.rows || evalRes.rows.length === 0) {
|
|
if (evalRes.code !== 200 || !evalRes.rows || evalRes.rows.length === 0) {
|
|
|
jobState.value = isAnyEvalPaid ? "paid" : "initial";
|
|
jobState.value = isAnyEvalPaid ? "paid" : "initial";
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
+ linkedAssessmentId.value = evalRes.rows[0].id;
|
|
|
|
|
+ common_vendor.index.__f__("log", "at pages/jobdetail/index.vue:205", "[JobDetail] 关联测评ID:", linkedAssessmentId.value);
|
|
|
const recordRes = await api_assessment.getAssessmentRecordList(userInfo.studentId);
|
|
const recordRes = await api_assessment.getAssessmentRecordList(userInfo.studentId);
|
|
|
if (recordRes.code !== 200 || !recordRes.data) {
|
|
if (recordRes.code !== 200 || !recordRes.data) {
|
|
|
jobState.value = isAnyEvalPaid ? "paid" : "initial";
|
|
jobState.value = isAnyEvalPaid ? "paid" : "initial";
|
|
@@ -64,7 +95,7 @@ const _sfc_main = {
|
|
|
jobState.value = "initial";
|
|
jobState.value = "initial";
|
|
|
}
|
|
}
|
|
|
} catch (err) {
|
|
} catch (err) {
|
|
|
- common_vendor.index.__f__("error", "at pages/jobdetail/index.vue:191", "检查状态失败:", err);
|
|
|
|
|
|
|
+ common_vendor.index.__f__("error", "at pages/jobdetail/index.vue:231", "检查状态失败:", err);
|
|
|
jobState.value = "initial";
|
|
jobState.value = "initial";
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
@@ -72,11 +103,11 @@ const _sfc_main = {
|
|
|
const longitude = common_vendor.ref(121.45039);
|
|
const longitude = common_vendor.ref(121.45039);
|
|
|
const markers = common_vendor.ref([]);
|
|
const markers = common_vendor.ref([]);
|
|
|
const fetchDetail = async (id) => {
|
|
const fetchDetail = async (id) => {
|
|
|
- common_vendor.index.__f__("log", "at pages/jobdetail/index.vue:201", "fetchDetail called with id:", id);
|
|
|
|
|
|
|
+ common_vendor.index.__f__("log", "at pages/jobdetail/index.vue:241", "fetchDetail called with id:", id);
|
|
|
common_vendor.index.showLoading({ title: "加载中..." });
|
|
common_vendor.index.showLoading({ title: "加载中..." });
|
|
|
try {
|
|
try {
|
|
|
const res = await api_position.getPositionDetail(id);
|
|
const res = await api_position.getPositionDetail(id);
|
|
|
- common_vendor.index.__f__("log", "at pages/jobdetail/index.vue:205", "getPositionDetail响应:", res);
|
|
|
|
|
|
|
+ common_vendor.index.__f__("log", "at pages/jobdetail/index.vue:245", "getPositionDetail响应:", res);
|
|
|
if (res.code === 200 && res.data) {
|
|
if (res.code === 200 && res.data) {
|
|
|
jobInfo.value = res.data;
|
|
jobInfo.value = res.data;
|
|
|
positionId.value = res.data.id;
|
|
positionId.value = res.data.id;
|
|
@@ -117,46 +148,46 @@ const _sfc_main = {
|
|
|
t.push(...data.welfareTags.split(",").filter(Boolean));
|
|
t.push(...data.welfareTags.split(",").filter(Boolean));
|
|
|
}
|
|
}
|
|
|
tags.value = t;
|
|
tags.value = t;
|
|
|
- common_vendor.index.__f__("log", "at pages/jobdetail/index.vue:249", "准备检查收藏状态, id:", id);
|
|
|
|
|
|
|
+ common_vendor.index.__f__("log", "at pages/jobdetail/index.vue:289", "准备检查收藏状态, id:", id);
|
|
|
checkCollectionStatus(id);
|
|
checkCollectionStatus(id);
|
|
|
}
|
|
}
|
|
|
} catch (err) {
|
|
} catch (err) {
|
|
|
- common_vendor.index.__f__("error", "at pages/jobdetail/index.vue:253", "获取岗位详情失败:", err);
|
|
|
|
|
|
|
+ common_vendor.index.__f__("error", "at pages/jobdetail/index.vue:293", "获取岗位详情失败:", err);
|
|
|
} finally {
|
|
} finally {
|
|
|
common_vendor.index.hideLoading();
|
|
common_vendor.index.hideLoading();
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
const checkCollectionStatus = async (id) => {
|
|
const checkCollectionStatus = async (id) => {
|
|
|
- common_vendor.index.__f__("log", "at pages/jobdetail/index.vue:261", "checkCollectionStatus called with id:", id);
|
|
|
|
|
|
|
+ common_vendor.index.__f__("log", "at pages/jobdetail/index.vue:301", "checkCollectionStatus called with id:", id);
|
|
|
const userInfo = common_vendor.index.getStorageSync("userInfo");
|
|
const userInfo = common_vendor.index.getStorageSync("userInfo");
|
|
|
- common_vendor.index.__f__("log", "at pages/jobdetail/index.vue:263", "checkCollectionStatus userInfo:", userInfo);
|
|
|
|
|
|
|
+ common_vendor.index.__f__("log", "at pages/jobdetail/index.vue:303", "checkCollectionStatus userInfo:", userInfo);
|
|
|
if (!userInfo || !userInfo.studentId) {
|
|
if (!userInfo || !userInfo.studentId) {
|
|
|
- common_vendor.index.__f__("log", "at pages/jobdetail/index.vue:265", "checkCollectionStatus: 用户未登录");
|
|
|
|
|
|
|
+ common_vendor.index.__f__("log", "at pages/jobdetail/index.vue:305", "checkCollectionStatus: 用户未登录");
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
try {
|
|
try {
|
|
|
- common_vendor.index.__f__("log", "at pages/jobdetail/index.vue:270", "调用checkCollection API, studentId:", userInfo.studentId, "targetId:", id, "type: job");
|
|
|
|
|
|
|
+ common_vendor.index.__f__("log", "at pages/jobdetail/index.vue:310", "调用checkCollection API, studentId:", userInfo.studentId, "targetId:", id, "type: job");
|
|
|
const res = await api_collection.checkCollection(userInfo.studentId, id, "job");
|
|
const res = await api_collection.checkCollection(userInfo.studentId, id, "job");
|
|
|
- common_vendor.index.__f__("log", "at pages/jobdetail/index.vue:272", "checkCollection API响应:", res);
|
|
|
|
|
|
|
+ common_vendor.index.__f__("log", "at pages/jobdetail/index.vue:312", "checkCollection API响应:", res);
|
|
|
if (res.code === 200 && res.data) {
|
|
if (res.code === 200 && res.data) {
|
|
|
isCollected.value = true;
|
|
isCollected.value = true;
|
|
|
collectionId.value = res.data.id;
|
|
collectionId.value = res.data.id;
|
|
|
- common_vendor.index.__f__("log", "at pages/jobdetail/index.vue:276", "设置为已收藏, collectionId:", res.data.id);
|
|
|
|
|
|
|
+ common_vendor.index.__f__("log", "at pages/jobdetail/index.vue:316", "设置为已收藏, collectionId:", res.data.id);
|
|
|
} else {
|
|
} else {
|
|
|
isCollected.value = false;
|
|
isCollected.value = false;
|
|
|
collectionId.value = null;
|
|
collectionId.value = null;
|
|
|
- common_vendor.index.__f__("log", "at pages/jobdetail/index.vue:280", "设置为未收藏");
|
|
|
|
|
|
|
+ common_vendor.index.__f__("log", "at pages/jobdetail/index.vue:320", "设置为未收藏");
|
|
|
}
|
|
}
|
|
|
} catch (err) {
|
|
} catch (err) {
|
|
|
- common_vendor.index.__f__("error", "at pages/jobdetail/index.vue:283", "检查收藏状态失败", err);
|
|
|
|
|
|
|
+ common_vendor.index.__f__("error", "at pages/jobdetail/index.vue:323", "检查收藏状态失败", err);
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
const toggleCollect = async () => {
|
|
const toggleCollect = async () => {
|
|
|
- common_vendor.index.__f__("log", "at pages/jobdetail/index.vue:289", "toggleCollect clicked");
|
|
|
|
|
|
|
+ common_vendor.index.__f__("log", "at pages/jobdetail/index.vue:329", "toggleCollect clicked");
|
|
|
const userInfo = common_vendor.index.getStorageSync("userInfo");
|
|
const userInfo = common_vendor.index.getStorageSync("userInfo");
|
|
|
- common_vendor.index.__f__("log", "at pages/jobdetail/index.vue:291", "userInfo:", userInfo);
|
|
|
|
|
|
|
+ common_vendor.index.__f__("log", "at pages/jobdetail/index.vue:331", "userInfo:", userInfo);
|
|
|
if (!userInfo || !userInfo.studentId) {
|
|
if (!userInfo || !userInfo.studentId) {
|
|
|
- common_vendor.index.__f__("log", "at pages/jobdetail/index.vue:294", "用户未登录");
|
|
|
|
|
|
|
+ common_vendor.index.__f__("log", "at pages/jobdetail/index.vue:334", "用户未登录");
|
|
|
common_vendor.index.showToast({ title: "请先登录", icon: "none" });
|
|
common_vendor.index.showToast({ title: "请先登录", icon: "none" });
|
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
|
common_vendor.index.navigateTo({ url: "/pages/login/login" });
|
|
common_vendor.index.navigateTo({ url: "/pages/login/login" });
|
|
@@ -164,17 +195,17 @@ const _sfc_main = {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
if (!jobInfo.value.id) {
|
|
if (!jobInfo.value.id) {
|
|
|
- common_vendor.index.__f__("log", "at pages/jobdetail/index.vue:303", "jobInfo.value.id 为空:", jobInfo.value);
|
|
|
|
|
|
|
+ common_vendor.index.__f__("log", "at pages/jobdetail/index.vue:343", "jobInfo.value.id 为空:", jobInfo.value);
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- common_vendor.index.__f__("log", "at pages/jobdetail/index.vue:307", "准备发送收藏请求, jobInfo.value.id:", jobInfo.value.id);
|
|
|
|
|
|
|
+ common_vendor.index.__f__("log", "at pages/jobdetail/index.vue:347", "准备发送收藏请求, jobInfo.value.id:", jobInfo.value.id);
|
|
|
common_vendor.index.showLoading({ title: isCollected.value ? "取消收藏中..." : "收藏中..." });
|
|
common_vendor.index.showLoading({ title: isCollected.value ? "取消收藏中..." : "收藏中..." });
|
|
|
try {
|
|
try {
|
|
|
if (isCollected.value) {
|
|
if (isCollected.value) {
|
|
|
- common_vendor.index.__f__("log", "at pages/jobdetail/index.vue:313", "取消收藏, collectionId:", collectionId.value);
|
|
|
|
|
|
|
+ common_vendor.index.__f__("log", "at pages/jobdetail/index.vue:353", "取消收藏, collectionId:", collectionId.value);
|
|
|
if (collectionId.value) {
|
|
if (collectionId.value) {
|
|
|
const res = await api_collection.delCollection(collectionId.value);
|
|
const res = await api_collection.delCollection(collectionId.value);
|
|
|
- common_vendor.index.__f__("log", "at pages/jobdetail/index.vue:316", "取消收藏响应:", res);
|
|
|
|
|
|
|
+ common_vendor.index.__f__("log", "at pages/jobdetail/index.vue:356", "取消收藏响应:", res);
|
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
|
isCollected.value = false;
|
|
isCollected.value = false;
|
|
|
collectionId.value = null;
|
|
collectionId.value = null;
|
|
@@ -187,9 +218,9 @@ const _sfc_main = {
|
|
|
targetId: jobInfo.value.id,
|
|
targetId: jobInfo.value.id,
|
|
|
type: "job"
|
|
type: "job"
|
|
|
};
|
|
};
|
|
|
- common_vendor.index.__f__("log", "at pages/jobdetail/index.vue:330", "添加收藏请求数据:", requestData);
|
|
|
|
|
|
|
+ common_vendor.index.__f__("log", "at pages/jobdetail/index.vue:370", "添加收藏请求数据:", requestData);
|
|
|
const res = await api_collection.addCollection(requestData);
|
|
const res = await api_collection.addCollection(requestData);
|
|
|
- common_vendor.index.__f__("log", "at pages/jobdetail/index.vue:332", "添加收藏响应:", res);
|
|
|
|
|
|
|
+ common_vendor.index.__f__("log", "at pages/jobdetail/index.vue:372", "添加收藏响应:", res);
|
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
|
isCollected.value = true;
|
|
isCollected.value = true;
|
|
|
checkCollectionStatus(jobInfo.value.id);
|
|
checkCollectionStatus(jobInfo.value.id);
|
|
@@ -199,7 +230,7 @@ const _sfc_main = {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
} catch (err) {
|
|
} catch (err) {
|
|
|
- common_vendor.index.__f__("error", "at pages/jobdetail/index.vue:343", "操作收藏失败", err);
|
|
|
|
|
|
|
+ common_vendor.index.__f__("error", "at pages/jobdetail/index.vue:383", "操作收藏失败", err);
|
|
|
common_vendor.index.showToast({ title: "操作失败", icon: "none" });
|
|
common_vendor.index.showToast({ title: "操作失败", icon: "none" });
|
|
|
} finally {
|
|
} finally {
|
|
|
common_vendor.index.hideLoading();
|
|
common_vendor.index.hideLoading();
|
|
@@ -211,11 +242,11 @@ const _sfc_main = {
|
|
|
fetchDetail(options.id);
|
|
fetchDetail(options.id);
|
|
|
}
|
|
}
|
|
|
common_vendor.index.$on("payment_done", (data) => {
|
|
common_vendor.index.$on("payment_done", (data) => {
|
|
|
- common_vendor.index.__f__("log", "at pages/jobdetail/index.vue:357", "收到 payment_done 事件:", data);
|
|
|
|
|
|
|
+ common_vendor.index.__f__("log", "at pages/jobdetail/index.vue:397", "收到 payment_done 事件:", data);
|
|
|
checkState();
|
|
checkState();
|
|
|
});
|
|
});
|
|
|
common_vendor.index.$on("resume_delivered", (data) => {
|
|
common_vendor.index.$on("resume_delivered", (data) => {
|
|
|
- common_vendor.index.__f__("log", "at pages/jobdetail/index.vue:362", "收到 resume_delivered 事件:", data);
|
|
|
|
|
|
|
+ common_vendor.index.__f__("log", "at pages/jobdetail/index.vue:402", "收到 resume_delivered 事件:", data);
|
|
|
if (data && data.postId == positionId.value) {
|
|
if (data && data.postId == positionId.value) {
|
|
|
jobState.value = "added";
|
|
jobState.value = "added";
|
|
|
}
|
|
}
|
|
@@ -256,12 +287,12 @@ const _sfc_main = {
|
|
|
}
|
|
}
|
|
|
} catch (err) {
|
|
} catch (err) {
|
|
|
common_vendor.index.hideLoading();
|
|
common_vendor.index.hideLoading();
|
|
|
- common_vendor.index.__f__("error", "at pages/jobdetail/index.vue:411", "创建会话失败:", err);
|
|
|
|
|
|
|
+ common_vendor.index.__f__("error", "at pages/jobdetail/index.vue:451", "创建会话失败:", err);
|
|
|
common_vendor.index.showToast({ title: "连接失败,请重试", icon: "none" });
|
|
common_vendor.index.showToast({ title: "连接失败,请重试", icon: "none" });
|
|
|
}
|
|
}
|
|
|
} else if (jobState.value === "paid") {
|
|
} else if (jobState.value === "paid") {
|
|
|
common_vendor.index.navigateTo({
|
|
common_vendor.index.navigateTo({
|
|
|
- url: "/pages/assessment/remind?family=audit"
|
|
|
|
|
|
|
+ url: `/pages/assessment/remind?family=audit&id=${linkedAssessmentId.value || ""}`
|
|
|
});
|
|
});
|
|
|
} else if (jobState.value === "assessed") {
|
|
} else if (jobState.value === "assessed") {
|
|
|
const userInfo = common_vendor.index.getStorageSync("userInfo") || {};
|
|
const userInfo = common_vendor.index.getStorageSync("userInfo") || {};
|