You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
715 lines
22 KiB
715 lines
22 KiB
<!DOCTYPE html>
|
|
<html lang="zh-CN">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=375, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
|
<title>青核 Youthome - 重置密码</title>
|
|
<link rel="stylesheet" href="../colors_and_type.css">
|
|
<script src="https://cdn.tailwindcss.com"></script>
|
|
<style>
|
|
:root {
|
|
--youth-primary: #26C2BB;
|
|
--youth-primary-light: #54CAC5;
|
|
--primary-dark: #1DA9A3;
|
|
--primary-bg: #E6F7F6;
|
|
--primary-border: #B3E8E4;
|
|
--bg-page: #F7F8FA;
|
|
--bg-card: #FFFFFF;
|
|
--text-title: #1F1F1F;
|
|
--text-body: #595959;
|
|
--text-muted: #8C8C8C;
|
|
--youth-border-light: #E8E8E8;
|
|
--tag-bg: #F0F1F3;
|
|
--mint-light: #E8F8F5;
|
|
--btn-gradient: linear-gradient(135deg, #54CAC5 0%, #26C2BB 50%, #1FA8A2 100%);
|
|
|
|
/* =====================================================
|
|
* Traework 设计系统 - 组件规范
|
|
* 圆角 / 间距 / 阴影 / 高度
|
|
* ===================================================== */
|
|
--radius-xs: 4px;
|
|
--radius-sm: 8px; /* 按钮、输入框 */
|
|
--radius-md: 12px; /* 卡片 */
|
|
--radius-lg: 16px; /* 标签、弹窗 */
|
|
--radius-xl: 20px;
|
|
--radius-full: 9999px;
|
|
|
|
/* 组件高度 */
|
|
--height-btn: 44px;
|
|
--height-input: 44px;
|
|
--height-nav-bottom: 64px;
|
|
|
|
/* 间距(4px 基础栅格) */
|
|
--space-1: 4px;
|
|
--space-2: 8px;
|
|
--space-3: 12px;
|
|
--space-4: 16px;
|
|
--space-5: 20px;
|
|
--space-6: 24px;
|
|
--space-page-x: 16px;
|
|
--space-card: 16px;
|
|
|
|
/* 柔和弥散阴影 */
|
|
--shadow-card: 0 2px 12px rgba(0, 0, 0, 0.04);
|
|
--shadow-card-hover: 0 6px 20px rgba(0, 0, 0, 0.06);
|
|
--shadow-btn: 0 2px 8px rgba(38, 194, 187, 0.25);
|
|
--shadow-btn-hover: 0 4px 16px rgba(38, 194, 187, 0.35);
|
|
--shadow-modal: 0 16px 48px rgba(0, 0, 0, 0.12);
|
|
--shadow-float: 0 4px 24px rgba(0, 0, 0, 0.08);
|
|
|
|
/* 内阴影浮雕(输入框) */
|
|
--shadow-inset: inset 0 1px 3px rgba(0, 0, 0, 0.04);
|
|
--shadow-inset-focus: inset 0 1px 3px rgba(38, 194, 187, 0.08);
|
|
|
|
/* 毛玻璃 */
|
|
--glass-bg: rgba(255, 255, 255, 0.72);
|
|
--glass-blur: blur(20px);
|
|
--glass-border: rgba(255, 255, 255, 0.3);
|
|
|
|
}
|
|
|
|
* {
|
|
|
|
|
|
margin: 0;
|
|
padding: 0;
|
|
box-sizing: border-box;
|
|
-webkit-tap-highlight-color: transparent;
|
|
}
|
|
|
|
body {
|
|
font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'SF Pro Display', 'Helvetica Neue', sans-serif;
|
|
background: var(--youth-bg-page);
|
|
color: var(--youth-text-secondary);
|
|
min-height: 100vh;
|
|
overflow-x: hidden;
|
|
}
|
|
|
|
.page-container {
|
|
width: 375px;
|
|
height: 812px;
|
|
margin: 0 auto;
|
|
background: var(--youth-bg-page);
|
|
position: relative;
|
|
overflow: hidden;
|
|
display: flex;
|
|
flex-direction: column;
|
|
}
|
|
|
|
/* 状态栏 */
|
|
.status-bar {
|
|
height: 44px;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
padding: 0 16px;
|
|
font-size: 15px;
|
|
font-weight: 600;
|
|
color: var(--youth-text-primary);
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.status-bar .right-icons {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 6px;
|
|
}
|
|
|
|
/* 顶部导航 */
|
|
.top-nav {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
padding: 0 8px;
|
|
height: 44px;
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.nav-left {
|
|
display: flex;
|
|
align-items: center;
|
|
}
|
|
|
|
.nav-btn {
|
|
width: 36px;
|
|
height: 36px;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
border-radius: 50%;
|
|
color: var(--youth-text-primary);
|
|
cursor: pointer;
|
|
transition: background 0.2s ease;
|
|
border: none;
|
|
background: transparent;
|
|
}
|
|
|
|
.nav-btn:active {
|
|
background: var(--youth-border-light);
|
|
}
|
|
|
|
.nav-title {
|
|
font-size: 17px;
|
|
font-weight: 700;
|
|
color: var(--youth-text-primary);
|
|
}
|
|
|
|
/* 表单区 */
|
|
.form-section {
|
|
flex: 1;
|
|
padding: 32px 20px 0;
|
|
display: flex;
|
|
flex-direction: column;
|
|
}
|
|
|
|
.page-title {
|
|
font-size: 24px;
|
|
font-weight: 700;
|
|
color: var(--youth-text-primary);
|
|
margin-bottom: 6px;
|
|
}
|
|
|
|
.page-subtitle {
|
|
font-size: 14px;
|
|
color: var(--youth-text-tertiary);
|
|
margin-bottom: 12px;
|
|
line-height: 1.5;
|
|
}
|
|
|
|
/* 表单项 */
|
|
.form-group {
|
|
margin-bottom: 16px;
|
|
}
|
|
|
|
.form-label {
|
|
font-size: 13px;
|
|
font-weight: 600;
|
|
color: var(--youth-text-primary);
|
|
margin-bottom: 8px;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 4px;
|
|
}
|
|
|
|
.form-label .required {
|
|
color: var(--youth-primary);
|
|
}
|
|
|
|
.input-wrap {
|
|
display: flex;
|
|
align-items: center;
|
|
height: 44px;
|
|
background: var(--youth-bg-card);
|
|
border: 1px solid var(--youth-border-light);
|
|
border-radius: 8px;
|
|
padding: 0 14px;
|
|
transition: all 0.2s ease;
|
|
}
|
|
|
|
.input-wrap:focus-within {
|
|
border-color: var(--youth-primary);
|
|
box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.03);
|
|
}
|
|
|
|
.input-icon {
|
|
color: var(--youth-text-tertiary);
|
|
margin-right: 10px;
|
|
flex-shrink: 0;
|
|
display: flex;
|
|
align-items: center;
|
|
}
|
|
|
|
.form-input {
|
|
flex: 1;
|
|
height: 42px;
|
|
border: none;
|
|
outline: none;
|
|
background: transparent;
|
|
font-size: 14px;
|
|
color: var(--youth-text-primary);
|
|
box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.03);
|
|
}
|
|
|
|
.form-input::placeholder {
|
|
color: var(--youth-text-tertiary);
|
|
}
|
|
|
|
/* 验证码按钮 */
|
|
.code-btn {
|
|
height: 32px;
|
|
padding: 0 12px;
|
|
border: none;
|
|
border-radius: 16px;
|
|
background: var(--youth-primary-bg);
|
|
color: var(--youth-primary);
|
|
font-size: 12px;
|
|
font-weight: 600;
|
|
cursor: pointer;
|
|
transition: all 0.2s ease;
|
|
flex-shrink: 0;
|
|
white-space: nowrap;
|
|
}
|
|
|
|
.code-btn:active {
|
|
opacity: 0.8;
|
|
}
|
|
|
|
.code-btn:disabled {
|
|
background: var(--tag-bg);
|
|
color: var(--youth-text-tertiary);
|
|
cursor: not-allowed;
|
|
}
|
|
|
|
/* 密码强度 */
|
|
.password-strength {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 6px;
|
|
margin-top: 8px;
|
|
}
|
|
|
|
.strength-bar {
|
|
flex: 1;
|
|
height: 4px;
|
|
border-radius: 2px;
|
|
background: var(--tag-bg);
|
|
overflow: hidden;
|
|
}
|
|
|
|
.strength-fill {
|
|
height: 100%;
|
|
width: 0%;
|
|
border-radius: 2px;
|
|
transition: all 0.3s ease;
|
|
}
|
|
|
|
.strength-fill.weak {
|
|
width: 33%;
|
|
background: #F5222D;
|
|
}
|
|
|
|
.strength-fill.medium {
|
|
width: 66%;
|
|
background: #FAAD14;
|
|
}
|
|
|
|
.strength-fill.strong {
|
|
width: 100%;
|
|
background: #52C41A;
|
|
}
|
|
|
|
.strength-text {
|
|
font-size: 11px;
|
|
color: var(--youth-text-tertiary);
|
|
min-width: 40px;
|
|
text-align: right;
|
|
}
|
|
|
|
/* 密码提示 */
|
|
.password-tip {
|
|
font-size: 12px;
|
|
color: var(--youth-text-tertiary);
|
|
margin-top: 6px;
|
|
display: flex;
|
|
align-items: flex-start;
|
|
gap: 4px;
|
|
line-height: 1.5;
|
|
}
|
|
|
|
.password-tip svg {
|
|
margin-top: 1px;
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
/* 提交按钮 */
|
|
.submit-btn {
|
|
width: 100%;
|
|
height: 44px;
|
|
border: none;
|
|
border-radius: 8px;
|
|
background: var(--youth-gradient-primary);
|
|
color: #FFFFFF;
|
|
font-size: 16px;
|
|
font-weight: 600;
|
|
cursor: pointer;
|
|
transition: all 0.2s ease;
|
|
position: relative;
|
|
overflow: hidden;
|
|
box-shadow: 0 4px 12px rgba(38, 194, 187, 0.25);
|
|
margin-top: 12px;
|
|
}
|
|
|
|
.submit-btn::before {
|
|
content: '';
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
right: 0;
|
|
height: 50%;
|
|
background: linear-gradient(180deg, rgba(255,255,255,0.25) 0%, rgba(255,255,255,0) 100%);
|
|
pointer-events: none;
|
|
}
|
|
|
|
.submit-btn:active {
|
|
transform: scale(0.98);
|
|
box-shadow: 0 2px 8px rgba(38, 194, 187, 0.2);
|
|
}
|
|
|
|
.submit-btn:disabled {
|
|
opacity: 0.5;
|
|
cursor: not-allowed;
|
|
box-shadow: none;
|
|
}
|
|
|
|
/* 返回登录 */
|
|
.back-login {
|
|
text-align: center;
|
|
margin-top: 16px;
|
|
font-size: 13px;
|
|
color: var(--youth-text-tertiary);
|
|
}
|
|
|
|
.back-login a {
|
|
color: var(--youth-primary);
|
|
text-decoration: none;
|
|
font-weight: 500;
|
|
cursor: pointer;
|
|
}
|
|
|
|
/* 底部版权 */
|
|
.footer {
|
|
padding: 20px 16px 32px;
|
|
text-align: center;
|
|
font-size: 11px;
|
|
color: var(--youth-text-tertiary);
|
|
opacity: 0.7;
|
|
}
|
|
|
|
|
|
/* SVG 图标统一尺寸 */
|
|
.icon-svg {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
width: 1em;
|
|
height: 1em;
|
|
vertical-align: middle;
|
|
line-height: 1;
|
|
}
|
|
.icon-svg svg {
|
|
width: 100%;
|
|
height: 100%;
|
|
stroke: currentColor;
|
|
}
|
|
/* 侧栏图标 */
|
|
.sidebar-icon .icon-svg { width: 22px; height: 22px; font-size: 22px; }
|
|
/* 社团logo图标 */
|
|
.club-logo .icon-svg { width: 28px; height: 28px; font-size: 28px; color: #fff; }
|
|
/* 头图大图标 */
|
|
.hero-icon .icon-svg { width: 56px; height: 56px; font-size: 56px; opacity: 0.3; }
|
|
/* meta 小图标 */
|
|
.club-meta .icon-svg { width: 12px; height: 12px; font-size: 12px; }
|
|
/* 分类选择网格图标 */
|
|
.cat-option .icon-svg { width: 26px; height: 26px; font-size: 26px; }
|
|
/* logo预览图标 */
|
|
.logo-preview .icon-svg { width: 40px; height: 40px; font-size: 40px; color: #fff; }
|
|
/* 提示图标 */
|
|
.notice-icon .icon-svg { width: 18px; height: 18px; font-size: 18px; }
|
|
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="page-container" data-dom-id="page-container">
|
|
<!-- 状态栏 -->
|
|
<div class="status-bar">
|
|
<span>9:41</span>
|
|
<div class="right-icons">
|
|
<svg width="17" height="11" viewBox="0 0 17 11" fill="currentColor">
|
|
<rect x="0" y="7" width="3" height="4" rx="0.5"/>
|
|
<rect x="4.5" y="5" width="3" height="6" rx="0.5"/>
|
|
<rect x="9" y="2.5" width="3" height="8.5" rx="0.5"/>
|
|
<rect x="13.5" y="0" width="3" height="11" rx="0.5"/>
|
|
</svg>
|
|
<svg width="15" height="11" viewBox="0 0 15 11" fill="currentColor">
|
|
<path d="M7.5 1C5.3 1 3.2 1.7 1.5 3C-0.5 4.7 -0.5 7.5 1.5 9.2C1.9 9.6 2.5 9.6 2.9 9.2C3.3 8.8 3.3 8.2 2.9 7.8C1.6 6.5 1.6 4.4 2.9 3.1C4.2 1.8 6.3 1.4 8 2C10.1 2.7 11.7 4.4 12.2 6.5C12.5 7.3 12.4 8.1 11.8 8.7C11.4 9.1 11.4 9.7 11.8 10.1C12.2 10.5 12.8 10.5 13.2 10.1C14.2 9.1 14.5 7.7 14.2 6.3C13.6 4 12.1 2.3 10.2 1.3C9.3 1 8.4 0.9 7.5 1Z"/>
|
|
</svg>
|
|
<svg width="25" height="12" viewBox="0 0 25 12" fill="none">
|
|
<rect x="0.5" y="0.5" width="21" height="11" rx="2.5" stroke="currentColor" opacity="0.5"/>
|
|
<rect x="2" y="2" width="18" height="8" rx="1.5" fill="currentColor"/>
|
|
<rect x="22.5" y="4" width="1.5" height="4" rx="0.5" fill="currentColor" opacity="0.5"/>
|
|
</svg>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 顶部导航 -->
|
|
<div class="top-nav">
|
|
<div class="nav-left">
|
|
<button class="nav-btn" data-dom-id="btn-back" onclick="goBack()">
|
|
<svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
<polyline points="15 18 9 12 15 6"></polyline>
|
|
</svg>
|
|
</button>
|
|
</div>
|
|
<div class="nav-title">重置密码</div>
|
|
<div style="width: 36px;"></div>
|
|
</div>
|
|
|
|
<!-- 表单区 -->
|
|
<div class="form-section">
|
|
<div class="page-title">找回你的账号</div>
|
|
<div class="page-subtitle">请输入注册时使用的手机号<br/>我们将发送验证码帮你重置密码</div>
|
|
|
|
<!-- 手机号 -->
|
|
<div class="form-group">
|
|
<div class="form-label">
|
|
<span class="required">*</span>手机号
|
|
</div>
|
|
<div class="input-wrap">
|
|
<div class="input-icon">
|
|
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
<rect x="5" y="2" width="14" height="20" rx="2" ry="2"></rect>
|
|
<line x1="12" y1="18" x2="12.01" y2="18"></line>
|
|
</svg>
|
|
</div>
|
|
<input
|
|
type="tel"
|
|
class="form-input"
|
|
placeholder="请输入手机号"
|
|
maxlength="11"
|
|
data-dom-id="input-phone"
|
|
id="input-phone"
|
|
oninput="checkForm()"
|
|
>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 验证码 -->
|
|
<div class="form-group">
|
|
<div class="form-label">
|
|
<span class="required">*</span>验证码
|
|
</div>
|
|
<div class="input-wrap">
|
|
<div class="input-icon">
|
|
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
<path d="M12 2L2 7l10 5 10-5-10-5z"></path>
|
|
<path d="M2 17l10 5 10-5"></path>
|
|
<path d="M2 12l10 5 10-5"></path>
|
|
</svg>
|
|
</div>
|
|
<input
|
|
type="text"
|
|
class="form-input"
|
|
placeholder="请输入验证码"
|
|
maxlength="6"
|
|
data-dom-id="input-code"
|
|
id="input-code"
|
|
oninput="checkForm()"
|
|
>
|
|
<button class="code-btn" data-dom-id="btn-code" id="btn-code" onclick="sendCode()">获取验证码</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 新密码 -->
|
|
<div class="form-group">
|
|
<div class="form-label">
|
|
<span class="required">*</span>设置新密码
|
|
</div>
|
|
<div class="input-wrap">
|
|
<div class="input-icon">
|
|
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
<rect x="3" y="11" width="18" height="11" rx="2" ry="2"></rect>
|
|
<path d="M7 11V7a5 5 0 0 1 10 0v4"></path>
|
|
</svg>
|
|
</div>
|
|
<input
|
|
type="password"
|
|
class="form-input"
|
|
placeholder="请输入6-20位新密码"
|
|
maxlength="20"
|
|
data-dom-id="input-password"
|
|
id="input-password"
|
|
oninput="checkPasswordStrength(); checkForm()"
|
|
>
|
|
<div style="color: var(--youth-text-tertiary); cursor: pointer; padding: 4px;" onclick="togglePassword('input-password', this)">
|
|
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
<path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"></path>
|
|
<circle cx="12" cy="12" r="3"></circle>
|
|
</svg>
|
|
</div>
|
|
</div>
|
|
<div class="password-strength">
|
|
<div class="strength-bar">
|
|
<div class="strength-fill" id="strength-fill"></div>
|
|
</div>
|
|
<span class="strength-text" id="strength-text">弱</span>
|
|
</div>
|
|
<div class="password-tip">
|
|
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
<circle cx="12" cy="12" r="10"></circle>
|
|
<line x1="12" y1="16" x2="12" y2="12"></line>
|
|
<line x1="12" y1="8" x2="12.01" y2="8"></line>
|
|
</svg>
|
|
密码需包含字母和数字,长度6-20位
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 确认密码 -->
|
|
<div class="form-group">
|
|
<div class="form-label">
|
|
<span class="required">*</span>确认新密码
|
|
</div>
|
|
<div class="input-wrap">
|
|
<div class="input-icon">
|
|
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
<rect x="3" y="11" width="18" height="11" rx="2" ry="2"></rect>
|
|
<path d="M7 11V7a5 5 0 0 1 10 0v4"></path>
|
|
</svg>
|
|
</div>
|
|
<input
|
|
type="password"
|
|
class="form-input"
|
|
placeholder="请再次输入新密码"
|
|
maxlength="20"
|
|
data-dom-id="input-password2"
|
|
id="input-password2"
|
|
oninput="checkForm()"
|
|
>
|
|
<div style="color: var(--youth-text-tertiary); cursor: pointer; padding: 4px;" onclick="togglePassword('input-password2', this)">
|
|
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
<path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"></path>
|
|
<circle cx="12" cy="12" r="3"></circle>
|
|
</svg>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 提交按钮 -->
|
|
<button class="submit-btn" data-dom-id="btn-submit" id="btn-submit" disabled onclick="resetPassword()">
|
|
确认重置
|
|
</button>
|
|
|
|
<div class="back-login">
|
|
想起密码了?<a onclick="goLogin()">返回登录</a>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 底部 -->
|
|
<div class="footer">青核 Youthome · 校园实名社交</div>
|
|
|
|
</div>
|
|
|
|
<script>// 主题切换
|
|
icon.innerHTML = '<path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"></path>';
|
|
}
|
|
}
|
|
|
|
// 返回
|
|
function goBack() {
|
|
window.history.back();
|
|
}
|
|
|
|
// 去登录
|
|
function goLogin() {
|
|
window.location.href = 'login.html';
|
|
}
|
|
|
|
// 切换密码显示
|
|
function togglePassword(inputId, el) {
|
|
const input = document.getElementById(inputId);
|
|
if (input.type === 'password') {
|
|
input.type = 'text';
|
|
el.innerHTML = '<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"></path><line x1="1" y1="1" x2="23" y2="23"></line></svg>';
|
|
} else {
|
|
input.type = 'password';
|
|
el.innerHTML = '<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"></path><circle cx="12" cy="12" r="3"></circle></svg>';
|
|
}
|
|
}
|
|
|
|
// 密码强度检测
|
|
function checkPasswordStrength() {
|
|
const pwd = document.getElementById('input-password').value;
|
|
const fill = document.getElementById('strength-fill');
|
|
const text = document.getElementById('strength-text');
|
|
|
|
fill.className = 'strength-fill';
|
|
text.textContent = '';
|
|
|
|
if (!pwd) return;
|
|
|
|
let score = 0;
|
|
if (pwd.length >= 6) score++;
|
|
if (pwd.length >= 10) score++;
|
|
if (/[a-zA-Z]/.test(pwd) && /[0-9]/.test(pwd)) score++;
|
|
if (/[^a-zA-Z0-9]/.test(pwd)) score++;
|
|
|
|
if (score <= 1) {
|
|
fill.classList.add('weak');
|
|
text.textContent = '弱';
|
|
text.style.color = '#F5222D';
|
|
} else if (score <= 2) {
|
|
fill.classList.add('medium');
|
|
text.textContent = '中';
|
|
text.style.color = '#FAAD14';
|
|
} else {
|
|
fill.classList.add('strong');
|
|
text.textContent = '强';
|
|
text.style.color = '#52C41A';
|
|
}
|
|
}
|
|
|
|
// 发送验证码
|
|
let countdown = 0;
|
|
function sendCode() {
|
|
const phone = document.getElementById('input-phone').value;
|
|
if (!phone || phone.length !== 11) {
|
|
alert('请输入正确的手机号');
|
|
return;
|
|
}
|
|
|
|
const btn = document.getElementById('btn-code');
|
|
countdown = 60;
|
|
btn.disabled = true;
|
|
btn.textContent = countdown + 's 后重发';
|
|
|
|
const timer = setInterval(function() {
|
|
countdown--;
|
|
if (countdown <= 0) {
|
|
clearInterval(timer);
|
|
btn.disabled = false;
|
|
btn.textContent = '获取验证码';
|
|
} else {
|
|
btn.textContent = countdown + 's 后重发';
|
|
}
|
|
}, 1000);
|
|
}
|
|
|
|
// 表单校验
|
|
function checkForm() {
|
|
const phone = document.getElementById('input-phone').value;
|
|
const code = document.getElementById('input-code').value;
|
|
const pwd = document.getElementById('input-password').value;
|
|
const pwd2 = document.getElementById('input-password2').value;
|
|
const btn = document.getElementById('btn-submit');
|
|
|
|
if (phone.length === 11 && code.length === 6 && pwd.length >= 6 && pwd2.length >= 6) {
|
|
btn.disabled = false;
|
|
} else {
|
|
btn.disabled = true;
|
|
}
|
|
}
|
|
|
|
// 重置密码
|
|
function resetPassword() {
|
|
const pwd = document.getElementById('input-password').value;
|
|
const pwd2 = document.getElementById('input-password2').value;
|
|
|
|
if (pwd !== pwd2) {
|
|
alert('两次输入的密码不一致');
|
|
return;
|
|
}
|
|
|
|
alert('密码重置成功,请重新登录');
|
|
window.location.href = 'login.html';
|
|
}</script>
|
|
</body>
|
|
</html>
|
|
|