feat: 🎸 接口对接调整
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import { useState } from "react";
|
||||
import Modal from "@/components/Modal";
|
||||
import "./index.css";
|
||||
|
||||
@@ -7,35 +6,31 @@ export default ({ visible, onClose, data }) => {
|
||||
onClose();
|
||||
};
|
||||
|
||||
if (!data) return null;
|
||||
|
||||
const { question } = data;
|
||||
|
||||
return (
|
||||
<Modal visible={visible} onClose={handleCloseModal}>
|
||||
<div className="interview-questions-modal">
|
||||
<i className="close-icon" onClick={handleCloseModal} />
|
||||
<p className="interview-questions-modal-title">{data.name}面试题</p>
|
||||
<p className="interview-questions-modal-title">{data?.name}面试题</p>
|
||||
<p className="interview-questions-modal-subtitle">
|
||||
在1V1定制求职策略阶段,企业HR会为您讲解面试题
|
||||
</p>
|
||||
<ul className="interview-questions-modal-list">
|
||||
<li className="interview-questions-modal-item">
|
||||
<p className="interview-questions-modal-question">
|
||||
<span>问题:</span>{question.question}
|
||||
<span>问题:</span>
|
||||
{data?.question?.question}
|
||||
</p>
|
||||
<p className="interview-questions-modal-answer">
|
||||
<span>解答:</span>
|
||||
这是一个{question.difficulty.toLowerCase()}难度的{question.category}相关问题。
|
||||
针对这类问题,建议从以下几个方面来回答:
|
||||
1. 理解问题的核心概念和背景
|
||||
2. 结合实际项目经验进行说明
|
||||
3. 展示对相关技术的深入理解
|
||||
4. 提及可能的优化或改进方案
|
||||
这是一个{data?.question?.difficulty?.toLowerCase()}难度的
|
||||
{data?.question?.category}相关问题。
|
||||
针对这类问题,建议从以下几个方面来回答: 1.
|
||||
理解问题的核心概念和背景 2. 结合实际项目经验进行说明 3.
|
||||
展示对相关技术的深入理解 4. 提及可能的优化或改进方案
|
||||
</p>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</Modal>
|
||||
);
|
||||
};
|
||||
};
|
||||
|
||||
@@ -41,63 +41,6 @@
|
||||
font-weight: 600;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.search-container {
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.search-input {
|
||||
width: 200px;
|
||||
height: 32px;
|
||||
padding: 0 35px 0 12px;
|
||||
border: 1px solid #e5e8ed;
|
||||
border-radius: 16px;
|
||||
font-size: 14px;
|
||||
outline: none;
|
||||
transition: border-color 0.3s;
|
||||
|
||||
&::placeholder {
|
||||
color: #86909c;
|
||||
}
|
||||
|
||||
&:focus {
|
||||
border-color: #2c7aff;
|
||||
box-shadow: 0 0 0 2px rgba(44, 122, 255, 0.1);
|
||||
}
|
||||
}
|
||||
|
||||
.search-icon {
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
background-color: #86909c;
|
||||
mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") center/contain no-repeat;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.clear-button {
|
||||
position: absolute;
|
||||
right: 8px;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
background: none;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: #86909c;
|
||||
font-size: 14px;
|
||||
opacity: 0.7;
|
||||
transition: opacity 0.3s;
|
||||
|
||||
&:hover {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.resume-interview-content-wrapper {
|
||||
@@ -312,4 +255,4 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { useRef, useState, useEffect } from "react";
|
||||
import toast from "@/components/Toast";
|
||||
import InterviewQuestionsModal from "./components/InterviewQuestionsModal";
|
||||
import ResumeModal from "./components/ResumeModal";
|
||||
import ResumeInfoModal from "@/pages/CompanyJobsPage/components/ResumeInfoModal";
|
||||
import { getPageData } from "@/services/resumeInterview";
|
||||
|
||||
import "./index.css";
|
||||
@@ -13,7 +14,6 @@ const ResumeInterviewPage = () => {
|
||||
const [resumeModalData, setResumeModalData] = useState(undefined);
|
||||
const [pageData, setPageData] = useState(null);
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [searchTerm, setSearchTerm] = useState("");
|
||||
const sectionsRef = useRef({});
|
||||
|
||||
// 导航到指定行业段落
|
||||
@@ -27,19 +27,24 @@ const ResumeInterviewPage = () => {
|
||||
|
||||
// 面试题点击处理
|
||||
const handleQuestionClick = (item) => {
|
||||
setInterviewModalData(item);
|
||||
setInterviewModalVisible(true);
|
||||
if (item) {
|
||||
setInterviewModalVisible(true);
|
||||
setInterviewModalData(item);
|
||||
} else {
|
||||
toast.error("加载数据失败");
|
||||
}
|
||||
};
|
||||
|
||||
// 职位点击处理
|
||||
const handlePositionClick = (position, industry) => {
|
||||
// Find resume templates for this industry
|
||||
const templates = pageData.resumeTemplates[industry.name] || [];
|
||||
const selectedTemplate = templates.find(t => t.level === position.level) || templates[0];
|
||||
|
||||
const selectedTemplate =
|
||||
templates.find((t) => t.level === position.level) || templates[0];
|
||||
|
||||
setResumeModalData({
|
||||
selectedTemplate,
|
||||
studentResume: pageData.myResume
|
||||
studentResume: pageData.myResume,
|
||||
});
|
||||
setResumeModalVisible(true);
|
||||
};
|
||||
@@ -54,21 +59,8 @@ const ResumeInterviewPage = () => {
|
||||
setResumeModalData(undefined);
|
||||
};
|
||||
|
||||
// Search functionality
|
||||
const handleSearchChange = (e) => {
|
||||
setSearchTerm(e.target.value);
|
||||
};
|
||||
|
||||
const handleClearSearch = () => {
|
||||
setSearchTerm("");
|
||||
};
|
||||
|
||||
// Filter positions based on search term
|
||||
const filterPositions = (positions) => {
|
||||
if (!searchTerm.trim()) return positions;
|
||||
return positions.filter(position =>
|
||||
position.name.toLowerCase().includes(searchTerm.toLowerCase())
|
||||
);
|
||||
return positions.filter((position) => position.name.toLowerCase());
|
||||
};
|
||||
|
||||
// 获取页面数据
|
||||
@@ -150,21 +142,6 @@ const ResumeInterviewPage = () => {
|
||||
</li>
|
||||
))}
|
||||
</div>
|
||||
<div className="search-container">
|
||||
<input
|
||||
type="text"
|
||||
className="search-input"
|
||||
placeholder="搜索职位名称..."
|
||||
value={searchTerm}
|
||||
onChange={handleSearchChange}
|
||||
/>
|
||||
{searchTerm && (
|
||||
<button className="clear-button" onClick={handleClearSearch}>
|
||||
×
|
||||
</button>
|
||||
)}
|
||||
{!searchTerm && <div className="search-icon" />}
|
||||
</div>
|
||||
</ul>
|
||||
<ul className="resume-interview-content-wrapper">
|
||||
{pageData.industries.map((item) => (
|
||||
@@ -178,8 +155,8 @@ const ResumeInterviewPage = () => {
|
||||
<div className="item-content-wrapper">
|
||||
<ul className="jobs-list">
|
||||
{filterPositions(item.positions).map((position) => (
|
||||
<li
|
||||
className="job-item job-item-change"
|
||||
<li
|
||||
className="job-item job-item-change"
|
||||
key={position.id}
|
||||
onClick={() => handlePositionClick(position, item)}
|
||||
>
|
||||
@@ -190,11 +167,6 @@ const ResumeInterviewPage = () => {
|
||||
</div>
|
||||
</li>
|
||||
))}
|
||||
{searchTerm && filterPositions(item.positions).length === 0 && (
|
||||
<li className="no-results">
|
||||
<p>未找到匹配的职位</p>
|
||||
</li>
|
||||
)}
|
||||
</ul>
|
||||
<ul className="resumes-list">
|
||||
{item.questions.map((question) => (
|
||||
@@ -216,7 +188,7 @@ const ResumeInterviewPage = () => {
|
||||
onClose={handleCloseInterviewModal}
|
||||
data={interviewModalData}
|
||||
/>
|
||||
<ResumeModal
|
||||
<ResumeInfoModal
|
||||
visible={resumeModalVisible}
|
||||
onClose={handleCloseResumeModal}
|
||||
data={resumeModalData}
|
||||
@@ -225,4 +197,4 @@ const ResumeInterviewPage = () => {
|
||||
);
|
||||
};
|
||||
|
||||
export default ResumeInterviewPage;
|
||||
export default ResumeInterviewPage;
|
||||
|
||||
Reference in New Issue
Block a user