1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060 |
- <!DOCTYPE html>
- <html lang="zh-CN">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>AI招聘系统</title>
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.4.2/css/all.min.css">
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/swiper@9.4.1/swiper-bundle.min.css">
- <style>
- :root {
- --primary-blue: #2A5CAA;
- --accent-orange: #FF6B35;
- --bg-light: #F5F7FA;
- --text-dark: #2D3748;
- --success-green: #48BB78;
- --card-shadow: 0 10px 20px rgba(0,0,0,0.08);
- }
-
- * {
- margin: 0;
- padding: 0;
- box-sizing: border-box;
- font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
- }
-
- body {
- background-color: var(--bg-light);
- color: var(--text-dark);
- line-height: 1.6;
- }
-
- /* 登录页面样式 */
- .login-container {
- display: flex;
- min-height: 100vh;
- align-items: center;
- justify-content: center;
- background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
- }
-
- .login-box {
- width: 90%;
- max-width: 400px;
- background: white;
- border-radius: 16px;
- padding: 30px;
- box-shadow: var(--card-shadow);
- text-align: center;
- }
-
- .login-logo {
- font-size: 24px;
- font-weight: bold;
- color: var(--primary-blue);
- margin-bottom: 30px;
- display: flex;
- align-items: center;
- justify-content: center;
- gap: 10px;
- }
-
- .login-tabs {
- display: flex;
- margin-bottom: 20px;
- border-bottom: 1px solid #e2e8f0;
- }
-
- .login-tab {
- flex: 1;
- padding: 12px;
- cursor: pointer;
- font-weight: 500;
- transition: all 0.2s;
- }
-
- .login-tab.active {
- color: var(--primary-blue);
- border-bottom: 2px solid var(--primary-blue);
- }
-
- .login-form {
- display: none;
- }
-
- .login-form.active {
- display: block;
- }
-
- .form-group {
- margin-bottom: 20px;
- text-align: left;
- }
-
- .form-group label {
- display: block;
- margin-bottom: 8px;
- font-weight: 500;
- }
-
- .form-control {
- width: 100%;
- padding: 12px 16px;
- border: 1px solid #e2e8f0;
- border-radius: 8px;
- font-size: 16px;
- transition: all 0.2s;
- }
-
- .form-control:focus {
- border-color: var(--primary-blue);
- box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
- outline: none;
- }
-
- .btn {
- width: 100%;
- padding: 12px;
- border: none;
- border-radius: 8px;
- font-size: 16px;
- font-weight: 500;
- cursor: pointer;
- transition: all 0.2s;
- }
-
- .btn-primary {
- background: var(--primary-blue);
- color: white;
- }
-
- .btn-primary:hover {
- background: #1d4ed8;
- }
-
- .login-links {
- margin-top: 20px;
- display: flex;
- justify-content: space-between;
- }
-
- .login-link {
- color: var(--primary-blue);
- font-size: 14px;
- cursor: pointer;
- }
- /* 主界面容器 */
- .main-container {
- max-width: 800px;
- margin: 0 auto;
- padding: 20px;
- padding-bottom: 80px;
- }
-
- /* 顶部导航 */
- .header {
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-bottom: 30px;
- }
-
- .logo {
- font-size: 24px;
- font-weight: bold;
- background: linear-gradient(to right, var(--primary-blue), var(--accent-orange));
- -webkit-background-clip: text;
- -webkit-text-fill-color: transparent;
- }
-
- .user-avatar {
- width: 40px;
- height: 40px;
- border-radius: 50%;
- background-color: var(--primary-blue);
- display: flex;
- justify-content: center;
- align-items: center;
- color: white;
- font-size: 18px;
- cursor: pointer;
- }
-
- /* 用户欢迎区域 */
- .welcome-section {
- margin-bottom: 30px;
- }
-
- .welcome-card {
- background: linear-gradient(135deg, var(--primary-blue), #3A7BD5);
- color: white;
- border-radius: 16px;
- padding: 25px;
- box-shadow: var(--card-shadow);
- position: relative;
- overflow: hidden;
- }
-
- .welcome-card::after {
- content: '';
- position: absolute;
- top: -50px;
- right: -50px;
- width: 200px;
- height: 200px;
- background: rgba(255,255,255,0.1);
- border-radius: 50%;
- }
-
- .welcome-title {
- font-size: 22px;
- margin-bottom: 10px;
- font-weight: 500;
- position: relative;
- z-index: 1;
- }
-
- .welcome-subtitle {
- font-size: 16px;
- opacity: 0.9;
- margin-bottom: 20px;
- position: relative;
- z-index: 1;
- }
-
- .start-btn {
- background-color: white;
- color: var(--primary-blue);
- border: none;
- padding: 12px 25px;
- border-radius: 30px;
- font-size: 16px;
- font-weight: 500;
- cursor: pointer;
- display: inline-flex;
- align-items: center;
- box-shadow: 0 4px 15px rgba(0,0,0,0.1);
- transition: all 0.3s ease;
- position: relative;
- z-index: 1;
- }
-
- .start-btn:hover {
- transform: translateY(-3px);
- box-shadow: 0 6px 20px rgba(0,0,0,0.15);
- }
-
- .start-btn i {
- margin-left: 8px;
- }
-
- /* 岗位推荐轮播 */
- .section-title {
- font-size: 20px;
- margin-bottom: 20px;
- display: flex;
- justify-content: space-between;
- align-items: center;
- }
-
- .see-all {
- font-size: 14px;
- color: var(--primary-blue);
- text-decoration: none;
- }
-
- .swiper {
- width: 100%;
- height: 100%;
- margin-bottom: 40px;
- }
-
- .swiper-slide {
- background: white;
- border-radius: 12px;
- padding: 20px;
- box-shadow: var(--card-shadow);
- cursor: pointer;
- transition: all 0.3s ease;
- }
-
- .swiper-slide:hover {
- transform: translateY(-5px);
- box-shadow: 0 15px 30px rgba(0,0,0,0.12);
- }
-
- .job-card {
- height: 100%;
- display: flex;
- flex-direction: column;
- }
-
- .job-header {
- display: flex;
- justify-content: space-between;
- margin-bottom: 15px;
- }
-
- .job-title {
- font-size: 18px;
- font-weight: 600;
- }
-
- .job-salary {
- color: var(--accent-orange);
- font-weight: bold;
- }
-
- .job-company {
- display: flex;
- align-items: center;
- margin-bottom: 15px;
- }
-
- .company-logo {
- width: 30px;
- height: 30px;
- border-radius: 6px;
- background-color: #EDF2F7;
- margin-right: 10px;
- display: flex;
- justify-content: center;
- align-items: center;
- color: var(--primary-blue);
- font-size: 12px;
- }
-
- .company-name {
- font-size: 14px;
- color: #718096;
- }
-
- .job-tags {
- display: flex;
- flex-wrap: wrap;
- gap: 8px;
- margin-bottom: 15px;
- }
-
- .tag {
- background: #EDF2F7;
- padding: 4px 10px;
- border-radius: 20px;
- font-size: 12px;
- color: #4A5568;
- }
-
- .match-bar {
- margin-top: auto;
- }
-
- .match-text {
- display: flex;
- justify-content: space-between;
- margin-bottom: 5px;
- font-size: 14px;
- }
-
- .match-value {
- color: var(--primary-blue);
- font-weight: 600;
- }
-
- .progress-bar {
- height: 6px;
- background: #EDF2F7;
- border-radius: 3px;
- overflow: hidden;
- }
-
- .progress-fill {
- height: 100%;
- border-radius: 3px;
- background: linear-gradient(to right, var(--primary-blue), var(--accent-orange));
- }
-
- /* 快速入口 */
- .quick-actions {
- display: grid;
- grid-template-columns: repeat(2, 1fr);
- gap: 15px;
- margin-bottom: 30px;
- }
-
- .action-card {
- background: white;
- border-radius: 12px;
- padding: 20px;
- box-shadow: var(--card-shadow);
- text-align: center;
- cursor: pointer;
- transition: all 0.3s ease;
- }
-
- .action-card:hover {
- transform: translateY(-3px);
- box-shadow: 0 10px 25px rgba(0,0,0,0.1);
- }
-
- .action-icon {
- width: 50px;
- height: 50px;
- border-radius: 50%;
- background: linear-gradient(135deg, var(--primary-blue), #3A7BD5);
- display: flex;
- justify-content: center;
- align-items: center;
- color: white;
- font-size: 20px;
- margin: 0 auto 15px;
- }
-
- .action-title {
- font-size: 16px;
- font-weight: 500;
- margin-bottom: 5px;
- }
-
- .action-desc {
- font-size: 12px;
- color: #718096;
- }
-
- /* 底部导航 */
- .bottom-nav {
- position: fixed;
- bottom: 0;
- left: 0;
- right: 0;
- background: white;
- box-shadow: 0 -5px 15px rgba(0,0,0,0.05);
- padding: 10px 0;
- z-index: 100;
- }
-
- .nav-container {
- max-width: 800px;
- margin: 0 auto;
- display: flex;
- justify-content: space-around;
- }
-
- .nav-item {
- display: flex;
- flex-direction: column;
- align-items: center;
- color: #718096;
- text-decoration: none;
- font-size: 12px;
- }
-
- .nav-item.active {
- color: var(--primary-blue);
- }
-
- .nav-icon {
- font-size: 20px;
- margin-bottom: 5px;
- }
- /* 用户下拉菜单 */
- .user-dropdown {
- position: relative;
- }
-
- .dropdown-menu {
- position: absolute;
- top: 50px;
- right: 0;
- width: 160px;
- background: white;
- border-radius: 8px;
- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
- padding: 10px 0;
- z-index: 100;
- display: none;
- }
-
- .dropdown-item {
- padding: 10px 16px;
- cursor: pointer;
- transition: all 0.2s;
- font-size: 14px;
- }
-
- .dropdown-item:hover {
- background: #f1f5f9;
- }
-
- .dropdown-divider {
- height: 1px;
- background: #e2e8f0;
- margin: 5px 0;
- }
- /* 响应式调整 */
- @media (max-width: 600px) {
- .main-container {
- padding: 15px;
- padding-bottom: 70px;
- }
-
- .welcome-card {
- padding: 20px;
- }
-
- .welcome-title {
- font-size: 20px;
- }
-
- .quick-actions {
- grid-template-columns: 1fr;
- }
- .login-box {
- padding: 20px;
- }
- }
- </style>
- </head>
- <body>
- <!-- 登录页面 -->
- <div class="login-container" id="loginPage">
- <div class="login-box">
- <div class="login-logo">
- <i class="fas fa-briefcase"></i>
- <span>AI招聘系统</span>
- </div>
-
- <div class="login-tabs">
- <div class="login-tab active" data-tab="candidate">应聘者登录</div>
- <div class="login-tab" data-tab="recruiter">招聘者登录</div>
- </div>
-
- <!-- 应聘者登录表单 -->
- <div class="login-form active" id="candidateLogin">
- <div class="form-group">
- <label for="candidateUsername">用户名</label>
- <input type="text" id="candidateUsername" class="form-control" placeholder="请输入用户名">
- </div>
- <div class="form-group">
- <label for="candidatePassword">密码</label>
- <input type="password" id="candidatePassword" class="form-control" placeholder="请输入密码">
- </div>
- <button class="btn btn-primary" id="candidateLoginBtn">登录</button>
- <div class="login-links">
- <span class="login-link" id="showRegister">注册账号</span>
- <span class="login-link" id="showForgot">忘记密码</span>
- </div>
- </div>
-
- <!-- 招聘者登录表单 -->
- <div class="login-form" id="recruiterLogin">
- <div class="form-group">
- <label for="recruiterUsername">用户名</label>
- <input type="text" id="recruiterUsername" class="form-control" placeholder="请输入用户名">
- </div>
- <div class="form-group">
- <label for="recruiterPassword">密码</label>
- <input type="password" id="recruiterPassword" class="form-control" placeholder="请输入密码">
- </div>
- <button class="btn btn-primary" id="recruiterLoginBtn">登录</button>
- <div class="login-links">
- <span class="login-link" id="showRegister2">注册账号</span>
- <span class="login-link" id="showForgot2">忘记密码</span>
- </div>
- </div>
- </div>
- </div>
-
- <!-- 注册页面 -->
- <div class="login-container" id="registerPage" style="display: none;">
- <div class="login-box">
- <div class="login-logo">
- <i class="fas fa-user-plus"></i>
- <span>注册账号</span>
- </div>
-
- <div class="login-tabs">
- <div class="login-tab active" data-tab="candidateReg">应聘者注册</div>
- <div class="login-tab" data-tab="recruiterReg">招聘者注册</div>
- </div>
-
- <!-- 应聘者注册表单 -->
- <div class="login-form active" id="candidateRegister">
- <div class="form-group">
- <label for="regCandidateUsername">用户名</label>
- <input type="text" id="regCandidateUsername" class="form-control" placeholder="请输入用户名">
- </div>
- <div class="form-group">
- <label for="regCandidatePassword">密码</label>
- <input type="password" id="regCandidatePassword" class="form-control" placeholder="请输入密码">
- </div>
- <div class="form-group">
- <label for="regCandidateConfirm">确认密码</label>
- <input type="password" id="regCandidateConfirm" class="form-control" placeholder="请再次输入密码">
- </div>
- <div class="form-group">
- <label for="regCandidateEmail">电子邮箱</label>
- <input type="email" id="regCandidateEmail" class="form-control" placeholder="请输入电子邮箱">
- </div>
- <button class="btn btn-primary" id="candidateRegisterBtn">注册</button>
- <div class="login-links">
- <span class="login-link" id="backToLogin">返回登录</span>
- </div>
- </div>
-
- <!-- 招聘者注册表单 -->
- <div class="login-form" id="recruiterRegister">
- <div class="form-group">
- <label for="regRecruiterUsername">用户名</label>
- <input type="text" id="regRecruiterUsername" class="form-control" placeholder="请输入用户名">
- </div>
- <div class="form-group">
- <label for="regRecruiterPassword">密码</label>
- <input type="password" id="regRecruiterPassword" class="form-control" placeholder="请输入密码">
- </div>
- <div class="form-group">
- <label for="regRecruiterConfirm">确认密码</label>
- <input type="password" id="regRecruiterConfirm" class="form-control" placeholder="请再次输入密码">
- </div>
- <div class="form-group">
- <label for="regRecruiterEmail">电子邮箱</label>
- <input type="email" id="regRecruiterEmail" class="form-control" placeholder="请输入电子邮箱">
- </div>
- <div class="form-group">
- <label for="regCompany">公司名称</label>
- <input type="text" id="regCompany" class="form-control" placeholder="请输入公司名称">
- </div>
- <button class="btn btn-primary" id="recruiterRegisterBtn">注册</button>
- <div class="login-links">
- <span class="login-link" id="backToLogin2">返回登录</span>
- </div>
- </div>
- </div>
- </div>
-
- <!-- 忘记密码页面 -->
- <div class="login-container" id="forgotPage" style="display: none;">
- <div class="login-box">
- <div class="login-logo">
- <i class="fas fa-key"></i>
- <span>找回密码</span>
- </div>
-
- <div class="form-group">
- <label for="forgotEmail">电子邮箱</label>
- <input type="email" id="forgotEmail" class="form-control" placeholder="请输入注册时使用的电子邮箱">
- </div>
- <button class="btn btn-primary" id="forgotBtn">发送重置链接</button>
- <div class="login-links">
- <span class="login-link" id="backToLogin3">返回登录</span>
- </div>
- </div>
- </div>
- <!-- 主界面 - 应聘者 -->
- <div class="main-container" id="candidateContainer" style="display: none;">
- <!-- 顶部导航 -->
- <div class="header">
- <div class="logo">AI招聘官</div>
- <div class="user-dropdown">
- <div class="user-avatar" id="userAvatar">
- <i class="fas fa-user"></i>
- </div>
- <div class="dropdown-menu" id="userDropdown">
- <div class="dropdown-item">
- <i class="fas fa-user"></i> 个人中心
- </div>
- <div class="dropdown-item">
- <i class="fas fa-cog"></i> 系统设置
- </div>
- <div class="dropdown-divider"></div>
- <div class="dropdown-item">
- <i class="fas fa-sign-out-alt"></i> 退出登录
- </div>
- </div>
- </div>
- </div>
-
- <!-- 欢迎区域 -->
- <div class="welcome-section">
- <div class="welcome-card">
- <h1 class="welcome-title">下午好,张伟</h1>
- <p class="welcome-subtitle">您有3个匹配的岗位待面试,准备好了吗?</p>
- <button class="start-btn">
- 开始模拟面试 <i class="fas fa-arrow-right"></i>
- </button>
- </div>
- </div>
-
- <!-- 岗位推荐 -->
- <div class="job-section">
- <h2 class="section-title">
- 为您推荐
- <a href="#" class="see-all">查看全部</a>
- </h2>
-
- <div class="swiper mySwiper">
- <div class="swiper-wrapper">
- <!-- 岗位卡片1 -->
- <div class="swiper-slide">
- <div class="job-card">
- <div class="job-header">
- <h3 class="job-title">前端开发工程师</h3>
- <div class="job-salary">25-40K·15薪</div>
- </div>
- <div class="job-company">
- <div class="company-logo">TX</div>
- <div class="company-name">腾讯科技 · 深圳</div>
- </div>
- <div class="job-tags">
- <span class="tag">Vue.js</span>
- <span class="tag">React</span>
- <span class="tag">TypeScript</span>
- </div>
- <div class="match-bar">
- <div class="match-text">
- <span>匹配度</span>
- <span class="match-value">87%</span>
- </div>
- <div class="progress-bar">
- <div class="progress-fill" style="width: 87%"></div>
- </div>
- </div>
- </div>
- </div>
-
- <!-- 岗位卡片2 -->
- <div class="swiper-slide">
- <div class="job-card">
- <div class="job-header">
- <h3 class="job-title">Java高级工程师</h3>
- <div class="job-salary">30-50K·16薪</div>
- </div>
- <div class="job-company">
- <div class="company-logo">AL</div>
- <div class="company-name">阿里巴巴 · 杭州</div>
- </div>
- <div class="job-tags">
- <span class="tag">Spring Cloud</span>
- <span class="tag">分布式</span>
- <span class="tag">MySQL</span>
- </div>
- <div class="match-bar">
- <div class="match-text">
- <span>匹配度</span>
- <span class="match-value">76%</span>
- </div>
- <div class="progress-bar">
- <div class="progress-fill" style="width: 76%"></div>
- </div>
- </div>
- </div>
- </div>
-
- <!-- 岗位卡片3 -->
- <div class="swiper-slide">
- <div class="job-card">
- <div class="job-header">
- <h3 class="job-title">产品经理</h3>
- <div class="job-salary">20-35K·14薪</div>
- </div>
- <div class="job-company">
- <div class="company-logo">BD</div>
- <div class="company-name">百度 · 北京</div>
- </div>
- <div class="job-tags">
- <span class="tag">Axure</span>
- <span class="tag">用户研究</span>
- <span class="tag">PRD</span>
- </div>
- <div class="match-bar">
- <div class="match-text">
- <span>匹配度</span>
- <span class="match-value">92%</span>
- </div>
- <div class="progress-bar">
- <div class="progress-fill" style="width: 92%"></div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
-
- <!-- 快速入口 -->
- <div class="quick-section">
- <h2 class="section-title">快速开始</h2>
-
- <div class="quick-actions">
- <div class="action-card">
- <div class="action-icon">
- <i class="fas fa-robot"></i>
- </div>
- <h3 class="action-title">AI模拟面试</h3>
- <p class="action-desc">智能评估您的表现</p>
- </div>
-
- <div class="action-card">
- <div class="action-icon" style="background: linear-gradient(135deg, #9F7AEA, #6B46C1);">
- <i class="fas fa-vr-cardboard"></i>
- </div>
- <h3 class="action-title">VR企业展厅</h3>
- <p class="action-desc">沉浸式了解企业</p>
- </div>
-
- <div class="action-card">
- <div class="action-icon" style="background: linear-gradient(135deg, #F6AD55, #DD6B20);">
- <i class="fas fa-book"></i>
- </div>
- <h3 class="action-title">面试题库</h3>
- <p class="action-desc">海量真题练习</p>
- </div>
-
- <div class="action-card">
- <div class="action-icon" style="background: linear-gradient(135deg, #48BB78, #38A169);">
- <i class="fas fa-chart-line"></i>
- </div>
- <h3 class="action-title">成长报告</h3>
- <p class="action-desc">查看历史表现</p>
- </div>
- </div>
- </div>
- </div>
-
- <!-- 底部导航 -->
- <div class="bottom-nav" id="bottomNav" style="display: none;">
- <div class="nav-container">
- <a href="#" class="nav-item active">
- <i class="fas fa-home nav-icon"></i>
- <span>首页</span>
- </a>
- <a href="#" class="nav-item">
- <i class="fas fa-search nav-icon"></i>
- <span>发现</span>
- </a>
- <a href="#" class="nav-item">
- <i class="fas fa-comments nav-icon"></i>
- <span>面试</span>
- </a>
- <a href="#" class="nav-item">
- <i class="fas fa-user nav-icon"></i>
- <span>我的</span>
- </a>
- </div>
- </div>
-
- <!-- Swiper JS -->
- <script src="https://cdn.jsdelivr.net/npm/swiper@9.4.1/swiper-bundle.min.js"></script>
-
- <script>
- // 用户类型: candidate(应聘者) 或 recruiter(招聘者)
- let userType = '';
- let currentUser = null;
-
- // 初始化页面
- const initPages = () => {
- // 绑定登录/注册切换事件
- document.querySelectorAll('.login-tab').forEach(tab => {
- tab.addEventListener('click', function() {
- const tabId = this.getAttribute('data-tab');
-
- // 更新标签页状态
- document.querySelectorAll('.login-tab').forEach(t => t.classList.remove('active'));
- this.classList.add('active');
-
- // 显示对应的表单
- if (tabId.includes('Reg')) {
- // 注册表单
- document.querySelectorAll('.login-form').forEach(form => form.classList.remove('active'));
- document.getElementById(tabId === 'candidateReg' ? 'candidateRegister' : 'recruiterRegister').classList.add('active');
- } else {
- // 登录表单
- document.querySelectorAll('.login-form').forEach(form => form.classList.remove('active'));
- document.getElementById(tabId === 'candidate' ? 'candidateLogin' : 'recruiterLogin').classList.add('active');
- }
- });
- });
-
- // 绑定显示注册页面事件
- document.getElementById('showRegister').addEventListener('click', showRegisterPage);
- document.getElementById('showRegister2').addEventListener('click', showRegisterPage);
-
- // 绑定显示忘记密码页面事件
- document.getElementById('showForgot').addEventListener('click', showForgotPage);
- document.getElementById('showForgot2').addEventListener('click', showForgotPage);
-
- // 绑定返回登录事件
- document.getElementById('backToLogin').addEventListener('click', showLoginPage);
- document.getElementById('backToLogin2').addEventListener('click', showLoginPage);
- document.getElementById('backToLogin3').addEventListener('click', showLoginPage);
-
- // 绑定登录按钮事件
- document.getElementById('candidateLoginBtn').addEventListener('click', () => login('candidate'));
- document.getElementById('recruiterLoginBtn').addEventListener('click', () => login('recruiter'));
-
- // 绑定注册按钮事件
- document.getElementById('candidateRegisterBtn').addEventListener('click', () => register('candidate'));
- document.getElementById('recruiterRegisterBtn').addEventListener('click', () => register('recruiter'));
-
- // 绑定忘记密码按钮事件
- document.getElementById('forgotBtn').addEventListener('click', forgotPassword);
-
- // 绑定用户头像点击事件
- document.getElementById('userAvatar').addEventListener('click', toggleUserDropdown);
-
- // 绑定退出登录事件
- document.querySelectorAll('.dropdown-item').forEach(item => {
- if (item.textContent.includes('退出登录')) {
- item.addEventListener('click', logout);
- }
- });
- // 初始化轮播
- const swiper = new Swiper(".mySwiper", {
- slidesPerView: 1.1,
- spaceBetween: 15,
- grabCursor: true,
- breakpoints: {
- 600: {
- slidesPerView: 2.1,
- spaceBetween: 20
- }
- }
- });
-
- // 模拟点击事件
- document.querySelector('.start-btn').addEventListener('click', function() {
- alert('即将跳转到面试准备页面');
- });
-
- document.querySelectorAll('.job-card, .action-card').forEach(card => {
- card.addEventListener('click', function() {
- alert('即将跳转到对应功能页面');
- });
- });
- };
-
- // 显示登录页面
- const showLoginPage = () => {
- document.getElementById('loginPage').style.display = 'flex';
- document.getElementById('registerPage').style.display = 'none';
- document.getElementById('forgotPage').style.display = 'none';
- };
-
- // 显示注册页面
- const showRegisterPage = () => {
- document.getElementById('loginPage').style.display = 'none';
- document.getElementById('registerPage').style.display = 'flex';
- document.getElementById('forgotPage').style.display = 'none';
- };
-
- // 显示忘记密码页面
- const showForgotPage = () => {
- document.getElementById('loginPage').style.display = 'none';
- document.getElementById('registerPage').style.display = 'none';
- document.getElementById('forgotPage').style.display = 'flex';
- };
-
- // 切换用户下拉菜单
- const toggleUserDropdown = () => {
- const dropdown = document.getElementById('userDropdown');
- dropdown.style.display = dropdown.style.display === 'block' ? 'none' : 'block';
- };
-
- // 登录功能
- const login = (type) => {
- const usernameField = type === 'candidate' ? 'candidateUsername' : 'recruiterUsername';
- const passwordField = type === 'candidate' ? 'candidatePassword' : 'recruiterPassword';
-
- const username = document.getElementById(usernameField).value;
- const password = document.getElementById(passwordField).value;
-
- if (!username || !password) {
- alert('请输入用户名和密码');
- return;
- }
-
- // 模拟登录成功
- userType = type;
- currentUser = {
- username: username,
- type: type,
- name: type === 'candidate' ? '张伟' : '李明',
- company: type === 'recruiter' ? 'XX科技公司' : null
- };
-
- // 显示主界面
- document.getElementById('loginPage').style.display = 'none';
- document.getElementById('candidateContainer').style.display = 'block';
- document.getElementById('bottomNav').style.display = 'block';
- };
-
- // 注册功能
- const register = (type) => {
- const usernameField = type === 'candidate' ? 'regCandidateUsername' : 'regRecruiterUsername';
- const passwordField = type === 'candidate' ? 'regCandidatePassword' : 'regRecruiterPassword';
- const confirmField = type === 'candidate' ? 'regCandidateConfirm' : 'regRecruiterConfirm';
- const emailField = type === 'candidate' ? 'regCandidateEmail' : 'regRecruiterEmail';
-
- const username = document.getElementById(usernameField).value;
- const password = document.getElementById(passwordField).value;
- const confirm = document.getElementById(confirmField).value;
- const email = document.getElementById(emailField).value;
- const company = type === 'recruiter' ? document.getElementById('regCompany').value : null;
-
- if (!username || !password || !confirm || !email) {
- alert('请填写所有必填字段');
- return;
- }
-
- if (password !== confirm) {
- alert('两次输入的密码不一致');
- return;
- }
-
- if (type === 'recruiter' && !company) {
- alert('请填写公司名称');
- return;
- }
-
- // 模拟注册成功
- alert('注册成功!请登录');
- showLoginPage();
- };
-
- // 忘记密码功能
- const forgotPassword = () => {
- const email = document.getElementById('forgotEmail').value;
-
- if (!email) {
- alert('请输入电子邮箱');
- return;
- }
-
- // 模拟发送重置链接
- alert(`重置链接已发送至 ${email},请查收邮件并按照指示操作`);
- showLoginPage();
- };
-
- // 退出登录
- const logout = () => {
- userType = '';
- currentUser = null;
-
- // 隐藏主界面
- document.getElementById('candidateContainer').style.display = 'none';
- document.getElementById('bottomNav').style.display = 'none';
-
- // 显示登录页面
- showLoginPage();
- };
-
- // 初始化页面
- initPages();
- </script>
- </body>
- </html>
|