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.
843 lines
23 KiB
843 lines
23 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">
|
|
<style>
|
|
/* ============================================================
|
|
* 账号换绑手机页 - Traework 设计系统规范
|
|
* 浅色/深色双主题
|
|
* ============================================================ */
|
|
|
|
* {
|
|
margin: 0;
|
|
padding: 0;
|
|
box-sizing: border-box;
|
|
-webkit-tap-highlight-color: transparent;
|
|
}
|
|
|
|
html, body {
|
|
height: 100%;
|
|
}
|
|
|
|
body {
|
|
font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'SF Pro Display', 'Helvetica Neue', sans-serif;
|
|
background: var(--youth-bg-page);
|
|
color: var(--youth-text-primary);
|
|
min-height: 100vh;
|
|
overflow-x: hidden;
|
|
transition: background 0.3s ease, color 0.3s ease;
|
|
}
|
|
|
|
/* 页面容器 - 一屏紧凑布局 */
|
|
.page-container {
|
|
width: 375px;
|
|
min-height: 812px;
|
|
margin: 0 auto;
|
|
background: var(--youth-bg-page);
|
|
position: relative;
|
|
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 4px;
|
|
height: 44px;
|
|
flex-shrink: 0;
|
|
position: relative;
|
|
}
|
|
|
|
.nav-left,
|
|
.nav-right {
|
|
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-bg-hover);
|
|
}
|
|
|
|
.nav-btn svg {
|
|
width: 20px;
|
|
height: 20px;
|
|
stroke-width: 2;
|
|
stroke-linecap: round;
|
|
stroke-linejoin: round;
|
|
}
|
|
|
|
.nav-title {
|
|
font-size: 17px;
|
|
font-weight: 600;
|
|
color: var(--youth-text-primary);
|
|
position: absolute;
|
|
left: 50%;
|
|
transform: translateX(-50%);
|
|
}
|
|
|
|
/* ============================================================
|
|
* 内容区
|
|
* ============================================================ */
|
|
.content {
|
|
flex: 1;
|
|
padding: 8px 16px 20px;
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 20px;
|
|
}
|
|
|
|
/* 当前手机号卡片 */
|
|
.phone-card {
|
|
background: var(--youth-bg-card);
|
|
border-radius: 12px;
|
|
padding: 16px;
|
|
box-shadow: 0 2px 12px var(--youth-shadow-card, rgba(0, 0, 0, 0.04));
|
|
border: 1px solid var(--youth-border-light, #F0F1F3);
|
|
}
|
|
|
|
.phone-card-label {
|
|
font-size: 13px;
|
|
color: var(--youth-text-tertiary);
|
|
margin-bottom: 6px;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 6px;
|
|
}
|
|
|
|
.phone-card-label svg {
|
|
width: 14px;
|
|
height: 14px;
|
|
stroke-width: 2;
|
|
stroke-linecap: round;
|
|
stroke-linejoin: round;
|
|
color: var(--youth-primary);
|
|
}
|
|
|
|
.phone-card-number {
|
|
font-size: 20px;
|
|
font-weight: 700;
|
|
color: var(--youth-text-primary);
|
|
line-height: 1.4;
|
|
letter-spacing: 0.5px;
|
|
}
|
|
|
|
.phone-card-tip {
|
|
font-size: 12px;
|
|
color: var(--youth-text-tertiary);
|
|
margin-top: 8px;
|
|
padding-top: 10px;
|
|
border-top: 1px solid var(--youth-border-lighter, #F5F6F8);
|
|
line-height: 1.5;
|
|
display: flex;
|
|
align-items: flex-start;
|
|
gap: 6px;
|
|
}
|
|
|
|
.phone-card-tip svg {
|
|
width: 14px;
|
|
height: 14px;
|
|
stroke-width: 2;
|
|
stroke-linecap: round;
|
|
stroke-linejoin: round;
|
|
flex-shrink: 0;
|
|
margin-top: 1px;
|
|
color: var(--youth-primary);
|
|
}
|
|
|
|
/* 表单区 */
|
|
.form-section {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 14px;
|
|
}
|
|
|
|
.form-group-title {
|
|
font-size: 14px;
|
|
font-weight: 600;
|
|
color: var(--youth-text-primary);
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
}
|
|
|
|
.form-group-title .title-dot {
|
|
width: 3px;
|
|
height: 14px;
|
|
border-radius: 2px;
|
|
background: var(--youth-gradient-primary);
|
|
}
|
|
|
|
.input-wrapper {
|
|
background: var(--youth-bg-card);
|
|
border-radius: 12px;
|
|
padding: 2px 16px;
|
|
border: 1px solid var(--youth-border-light, #F0F1F3);
|
|
box-shadow: 0 2px 8px var(--youth-shadow-card, rgba(0, 0, 0, 0.03));
|
|
transition: all 0.2s ease;
|
|
display: flex;
|
|
align-items: center;
|
|
height: 52px;
|
|
}
|
|
|
|
.input-wrapper:focus-within {
|
|
border-color: var(--youth-primary, #26C2BB);
|
|
box-shadow: 0 0 0 3px rgba(38, 194, 187, 0.1);
|
|
}
|
|
|
|
.input-icon {
|
|
width: 18px;
|
|
height: 18px;
|
|
margin-right: 10px;
|
|
color: var(--youth-text-tertiary);
|
|
flex-shrink: 0;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
}
|
|
|
|
.input-icon svg {
|
|
width: 18px;
|
|
height: 18px;
|
|
stroke-width: 2;
|
|
stroke-linecap: round;
|
|
stroke-linejoin: round;
|
|
}
|
|
|
|
.input-field {
|
|
flex: 1;
|
|
height: 44px;
|
|
border: none;
|
|
background: transparent;
|
|
font-size: 15px;
|
|
color: var(--youth-text-primary);
|
|
outline: none;
|
|
font-family: inherit;
|
|
min-width: 0;
|
|
}
|
|
|
|
.input-field::placeholder {
|
|
color: var(--youth-text-placeholder, #B0B0B0);
|
|
}
|
|
|
|
.code-btn {
|
|
flex-shrink: 0;
|
|
height: 32px;
|
|
padding: 0 14px;
|
|
border-radius: 16px;
|
|
background: var(--youth-primary-bg, #E6F7F6);
|
|
color: var(--youth-primary, #26C2BB);
|
|
font-size: 13px;
|
|
font-weight: 500;
|
|
border: none;
|
|
cursor: pointer;
|
|
transition: all 0.2s ease;
|
|
margin-left: 10px;
|
|
white-space: nowrap;
|
|
}
|
|
|
|
.code-btn:active {
|
|
opacity: 0.8;
|
|
transform: scale(0.96);
|
|
}
|
|
|
|
.code-btn.disabled {
|
|
background: var(--youth-bg-disabled, #F0F0F0);
|
|
color: var(--youth-text-tertiary);
|
|
cursor: not-allowed;
|
|
}
|
|
|
|
/* 错误提示 */
|
|
.error-text {
|
|
font-size: 12px;
|
|
color: var(--youth-danger-500, #F5222D);
|
|
margin-top: -8px;
|
|
padding-left: 4px;
|
|
display: none;
|
|
line-height: 1.4;
|
|
}
|
|
|
|
.error-text.show {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 4px;
|
|
}
|
|
|
|
.error-text svg {
|
|
width: 12px;
|
|
height: 12px;
|
|
stroke-width: 2;
|
|
stroke-linecap: round;
|
|
stroke-linejoin: round;
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
/* 底部操作区 */
|
|
.action-section {
|
|
margin-top: auto;
|
|
padding-top: 8px;
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
gap: 12px;
|
|
}
|
|
|
|
.btn-primary {
|
|
width: 100%;
|
|
height: 44px;
|
|
border-radius: 8px;
|
|
background: var(--youth-gradient-primary);
|
|
color: #FFFFFF;
|
|
font-size: 15px;
|
|
font-weight: 600;
|
|
border: none;
|
|
cursor: pointer;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
gap: 8px;
|
|
box-shadow: 0 2px 8px rgba(38, 194, 187, 0.25);
|
|
transition: all 0.2s ease;
|
|
}
|
|
|
|
.btn-primary:active {
|
|
transform: scale(0.98);
|
|
box-shadow: 0 1px 4px rgba(38, 194, 187, 0.2);
|
|
}
|
|
|
|
.btn-primary.disabled {
|
|
background: var(--youth-bg-disabled, #F0F0F0);
|
|
color: var(--youth-text-tertiary);
|
|
box-shadow: none;
|
|
cursor: not-allowed;
|
|
}
|
|
|
|
.security-tip {
|
|
font-size: 12px;
|
|
color: var(--youth-text-tertiary);
|
|
line-height: 1.5;
|
|
text-align: center;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 5px;
|
|
}
|
|
|
|
.security-tip svg {
|
|
width: 13px;
|
|
height: 13px;
|
|
stroke-width: 2;
|
|
stroke-linecap: round;
|
|
stroke-linejoin: round;
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
/* ============================================================
|
|
* 成功弹窗
|
|
* ============================================================ */
|
|
.modal-overlay {
|
|
position: fixed;
|
|
top: 0;
|
|
left: 50%;
|
|
transform: translateX(-50%);
|
|
width: 375px;
|
|
height: 100%;
|
|
background: rgba(0, 0, 0, 0.5);
|
|
z-index: 100;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
opacity: 0;
|
|
visibility: hidden;
|
|
transition: all 0.3s ease;
|
|
}
|
|
|
|
.modal-overlay.show {
|
|
opacity: 1;
|
|
visibility: visible;
|
|
}
|
|
|
|
.modal-dialog {
|
|
width: 280px;
|
|
background: var(--youth-bg-card);
|
|
border-radius: 16px;
|
|
padding: 28px 20px 20px;
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
transform: scale(0.9) translateY(20px);
|
|
opacity: 0;
|
|
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
|
box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12);
|
|
}
|
|
|
|
.modal-overlay.show .modal-dialog {
|
|
transform: scale(1) translateY(0);
|
|
opacity: 1;
|
|
}
|
|
|
|
.modal-icon {
|
|
width: 56px;
|
|
height: 56px;
|
|
border-radius: 50%;
|
|
background: rgba(82, 196, 26, 0.12);
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
margin-bottom: 16px;
|
|
position: relative;
|
|
}
|
|
|
|
.modal-icon::before {
|
|
content: '';
|
|
position: absolute;
|
|
inset: -6px;
|
|
border-radius: 50%;
|
|
background: rgba(82, 196, 26, 0.06);
|
|
z-index: -1;
|
|
}
|
|
|
|
.modal-icon svg {
|
|
width: 28px;
|
|
height: 28px;
|
|
stroke: var(--youth-success-500, #52C41A);
|
|
fill: none;
|
|
stroke-width: 2.5;
|
|
stroke-linecap: round;
|
|
stroke-linejoin: round;
|
|
}
|
|
|
|
.modal-title {
|
|
font-size: 17px;
|
|
font-weight: 700;
|
|
color: var(--youth-text-primary);
|
|
margin-bottom: 8px;
|
|
}
|
|
|
|
.modal-desc {
|
|
font-size: 13px;
|
|
color: var(--youth-text-tertiary);
|
|
text-align: center;
|
|
line-height: 1.5;
|
|
margin-bottom: 20px;
|
|
}
|
|
|
|
.modal-btn {
|
|
width: 100%;
|
|
height: 40px;
|
|
border-radius: 8px;
|
|
background: var(--youth-gradient-primary);
|
|
color: #fff;
|
|
font-size: 14px;
|
|
font-weight: 600;
|
|
border: none;
|
|
cursor: pointer;
|
|
transition: all 0.2s ease;
|
|
}
|
|
|
|
.modal-btn:active {
|
|
transform: scale(0.97);
|
|
}
|
|
|
|
/* ============================================================
|
|
* 深色主题
|
|
* ============================================================ */
|
|
[data-theme="dark"] .phone-card,
|
|
[data-theme="dark"] .input-wrapper {
|
|
border-color: rgba(255, 255, 255, 0.08);
|
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
|
|
}
|
|
|
|
[data-theme="dark"] .phone-card-tip {
|
|
border-top-color: rgba(255, 255, 255, 0.08);
|
|
}
|
|
|
|
[data-theme="dark"] .input-wrapper:focus-within {
|
|
border-color: var(--youth-primary, #26C2BB);
|
|
box-shadow: 0 0 0 3px rgba(38, 194, 187, 0.15);
|
|
}
|
|
|
|
[data-theme="dark"] .code-btn {
|
|
background: rgba(38, 194, 187, 0.15);
|
|
}
|
|
|
|
[data-theme="dark"] .code-btn.disabled {
|
|
background: rgba(255, 255, 255, 0.06);
|
|
color: var(--youth-text-tertiary);
|
|
}
|
|
|
|
[data-theme="dark"] .btn-primary.disabled {
|
|
background: rgba(255, 255, 255, 0.08);
|
|
color: var(--youth-text-tertiary);
|
|
}
|
|
|
|
[data-theme="dark"] .modal-dialog {
|
|
box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
|
|
}
|
|
|
|
[data-theme="dark"] .modal-icon {
|
|
background: rgba(82, 196, 26, 0.2);
|
|
}
|
|
|
|
[data-theme="dark"] .modal-icon::before {
|
|
background: rgba(82, 196, 26, 0.08);
|
|
}
|
|
|
|
[data-theme="dark"] .error-text {
|
|
color: #FF4D4F;
|
|
}
|
|
|
|
/* 主题切换按钮(演示用) */
|
|
.theme-toggle {
|
|
position: absolute;
|
|
top: 4px;
|
|
right: 4px;
|
|
width: 36px;
|
|
height: 36px;
|
|
border-radius: 50%;
|
|
background: var(--youth-bg-card);
|
|
border: 1px solid var(--youth-border-light, #F0F1F3);
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
cursor: pointer;
|
|
z-index: 10;
|
|
box-shadow: 0 2px 8px var(--youth-shadow-card, rgba(0, 0, 0, 0.04));
|
|
transition: all 0.3s ease;
|
|
}
|
|
|
|
.theme-toggle:active {
|
|
transform: scale(0.9);
|
|
}
|
|
|
|
.theme-toggle svg {
|
|
width: 18px;
|
|
height: 18px;
|
|
stroke: var(--youth-text-secondary);
|
|
fill: none;
|
|
stroke-width: 2;
|
|
stroke-linecap: round;
|
|
stroke-linejoin: round;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body data-theme="light">
|
|
<div class="page-container">
|
|
<!-- 主题切换按钮(演示) -->
|
|
<button class="theme-toggle" id="themeToggle" aria-label="切换主题">
|
|
<svg class="icon-sun" viewBox="0 0 24 24">
|
|
<circle cx="12" cy="12" r="4"></circle>
|
|
<path d="M12 2v2"></path>
|
|
<path d="M12 20v2"></path>
|
|
<path d="m4.93 4.93 1.41 1.41"></path>
|
|
<path d="m17.66 17.66 1.41 1.41"></path>
|
|
<path d="M2 12h2"></path>
|
|
<path d="M20 12h2"></path>
|
|
<path d="m6.34 17.66-1.41 1.41"></path>
|
|
<path d="m19.07 4.93-1.41 1.41"></path>
|
|
</svg>
|
|
</button>
|
|
|
|
<!-- 状态栏 -->
|
|
<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>
|
|
<rect x="4.5" y="5" width="3" height="6" rx="0.5"></rect>
|
|
<rect x="9" y="2.5" width="3" height="8.5" rx="0.5"></rect>
|
|
<rect x="13.5" y="0" width="3" height="11" rx="0.5"></rect>
|
|
</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"></path>
|
|
</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>
|
|
<rect x="2" y="2" width="18" height="8" rx="1.5" fill="currentColor"></rect>
|
|
<rect x="22.5" y="4" width="1.5" height="4" rx="0.5" fill="currentColor" opacity="0.5"></rect>
|
|
</svg>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 顶部导航栏 -->
|
|
<div class="top-nav">
|
|
<div class="nav-left">
|
|
<button class="nav-btn" id="btn-back" aria-label="返回">
|
|
<svg viewBox="0 0 24 24">
|
|
<path d="M15 18 9 12l6-6"></path>
|
|
</svg>
|
|
</button>
|
|
</div>
|
|
<div class="nav-title">更换手机号</div>
|
|
<div class="nav-right">
|
|
<div style="width: 36px;"></div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 内容区 -->
|
|
<div class="content">
|
|
<!-- 当前手机号卡片 -->
|
|
<div class="phone-card">
|
|
<div class="phone-card-label">
|
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor">
|
|
<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>
|
|
<div class="phone-card-number">138 **** 8888</div>
|
|
<div class="phone-card-tip">
|
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor">
|
|
<circle cx="12" cy="12" r="10"></circle>
|
|
<path d="M12 16v-4"></path>
|
|
<path d="M12 8h.01"></path>
|
|
</svg>
|
|
更换手机号后,登录方式将同步更新
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 表单输入区 -->
|
|
<div class="form-section">
|
|
<div class="form-group-title">
|
|
<span class="title-dot"></span>
|
|
新手机号
|
|
</div>
|
|
|
|
<!-- 新手机号输入 -->
|
|
<div class="input-wrapper">
|
|
<div class="input-icon">
|
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor">
|
|
<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="input-field" id="input-phone" placeholder="请输入新手机号" maxlength="11">
|
|
</div>
|
|
<div class="error-text" id="error-phone">
|
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor">
|
|
<circle cx="12" cy="12" r="10"></circle>
|
|
<line x1="12" y1="8" x2="12" y2="12"></line>
|
|
<line x1="12" y1="16" x2="12.01" y2="16"></line>
|
|
</svg>
|
|
请输入正确的手机号
|
|
</div>
|
|
|
|
<!-- 验证码输入 -->
|
|
<div class="input-wrapper">
|
|
<div class="input-icon">
|
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor">
|
|
<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="text" class="input-field" id="input-code" placeholder="请输入验证码" maxlength="6">
|
|
<button class="code-btn" id="btn-code">获取验证码</button>
|
|
</div>
|
|
<div class="error-text" id="error-code">
|
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor">
|
|
<circle cx="12" cy="12" r="10"></circle>
|
|
<line x1="12" y1="8" x2="12" y2="12"></line>
|
|
<line x1="12" y1="16" x2="12.01" y2="16"></line>
|
|
</svg>
|
|
验证码错误,请重新输入
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 底部操作区 -->
|
|
<div class="action-section">
|
|
<button class="btn-primary" id="btn-confirm">确认更换</button>
|
|
<div class="security-tip">
|
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" style="color: var(--youth-text-tertiary);">
|
|
<path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"></path>
|
|
</svg>
|
|
请确认新手机号可正常接收短信
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 成功弹窗 -->
|
|
<div class="modal-overlay" id="success-modal">
|
|
<div class="modal-dialog">
|
|
<div class="modal-icon">
|
|
<svg viewBox="0 0 24 24">
|
|
<path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"></path>
|
|
<polyline points="22 4 12 14.01 9 11.01"></polyline>
|
|
</svg>
|
|
</div>
|
|
<div class="modal-title">手机号更换成功</div>
|
|
<div class="modal-desc">您的绑定手机号已更新,请使用新手机号登录</div>
|
|
<button class="modal-btn" id="btn-modal-ok">我知道了</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
// 返回按钮
|
|
document.getElementById('btn-back').addEventListener('click', function() {
|
|
console.log('返回账号安全页');
|
|
if (window.history.length > 1) {
|
|
window.history.back();
|
|
}
|
|
});
|
|
|
|
// 获取验证码
|
|
const btnCode = document.getElementById('btn-code');
|
|
const inputPhone = document.getElementById('input-phone');
|
|
const errorPhone = document.getElementById('error-phone');
|
|
let countdown = 0;
|
|
let timer = null;
|
|
|
|
btnCode.addEventListener('click', function() {
|
|
if (this.classList.contains('disabled')) return;
|
|
|
|
const phone = inputPhone.value.trim();
|
|
// 校验手机号
|
|
if (!phone || !/^1[3-9]\d{9}$/.test(phone)) {
|
|
errorPhone.classList.add('show');
|
|
return;
|
|
}
|
|
errorPhone.classList.remove('show');
|
|
|
|
// 开始倒计时
|
|
countdown = 60;
|
|
this.classList.add('disabled');
|
|
this.textContent = countdown + 's 后重发';
|
|
|
|
timer = setInterval(() => {
|
|
countdown--;
|
|
if (countdown <= 0) {
|
|
clearInterval(timer);
|
|
btnCode.classList.remove('disabled');
|
|
btnCode.textContent = '获取验证码';
|
|
} else {
|
|
btnCode.textContent = countdown + 's 后重发';
|
|
}
|
|
}, 1000);
|
|
});
|
|
|
|
// 手机号输入时隐藏错误
|
|
inputPhone.addEventListener('input', function() {
|
|
errorPhone.classList.remove('show');
|
|
});
|
|
|
|
// 验证码输入时隐藏错误
|
|
const inputCode = document.getElementById('input-code');
|
|
const errorCode = document.getElementById('error-code');
|
|
inputCode.addEventListener('input', function() {
|
|
errorCode.classList.remove('show');
|
|
});
|
|
|
|
// 确认更换
|
|
const btnConfirm = document.getElementById('btn-confirm');
|
|
const successModal = document.getElementById('success-modal');
|
|
|
|
btnConfirm.addEventListener('click', function() {
|
|
const phone = inputPhone.value.trim();
|
|
const code = inputCode.value.trim();
|
|
let hasError = false;
|
|
|
|
// 校验手机号
|
|
if (!phone || !/^1[3-9]\d{9}$/.test(phone)) {
|
|
errorPhone.classList.add('show');
|
|
hasError = true;
|
|
} else {
|
|
errorPhone.classList.remove('show');
|
|
}
|
|
|
|
// 校验验证码
|
|
if (!code || code.length !== 6) {
|
|
errorCode.classList.add('show');
|
|
hasError = true;
|
|
} else {
|
|
errorCode.classList.remove('show');
|
|
}
|
|
|
|
if (hasError) return;
|
|
|
|
// 显示成功弹窗
|
|
successModal.classList.add('show');
|
|
});
|
|
|
|
// 弹窗确认按钮
|
|
document.getElementById('btn-modal-ok').addEventListener('click', function() {
|
|
successModal.classList.remove('show');
|
|
console.log('返回账号安全页');
|
|
});
|
|
|
|
// 点击遮罩关闭弹窗
|
|
successModal.addEventListener('click', function(e) {
|
|
if (e.target === successModal) {
|
|
successModal.classList.remove('show');
|
|
}
|
|
});
|
|
|
|
// 主题切换(演示用)
|
|
const themeToggle = document.getElementById('themeToggle');
|
|
themeToggle.addEventListener('click', function() {
|
|
const body = document.body;
|
|
const current = body.getAttribute('data-theme');
|
|
const next = current === 'light' ? 'dark' : 'light';
|
|
body.setAttribute('data-theme', next);
|
|
|
|
const sunIcon = this.querySelector('.icon-sun');
|
|
if (next === 'dark') {
|
|
sunIcon.innerHTML = `
|
|
<path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"></path>
|
|
`;
|
|
} else {
|
|
sunIcon.innerHTML = `
|
|
<circle cx="12" cy="12" r="4"></circle>
|
|
<path d="M12 2v2"></path>
|
|
<path d="M12 20v2"></path>
|
|
<path d="m4.93 4.93 1.41 1.41"></path>
|
|
<path d="m17.66 17.66 1.41 1.41"></path>
|
|
<path d="M2 12h2"></path>
|
|
<path d="M20 12h2"></path>
|
|
<path d="m6.34 17.66-1.41 1.41"></path>
|
|
<path d="m19.07 4.93-1.41 1.41"></path>
|
|
`;
|
|
}
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|
|
|