v1.2.1 用户协议版本 - 添加用户协议勾选功能

This commit is contained in:
longda 2026-03-20 17:29:26 +08:00
parent d92559a3e3
commit 617f1401e7
2 changed files with 25 additions and 3 deletions

View File

@ -4,7 +4,7 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-capable" content="yes">
<title>甲辰收藏 v1.2.0</title> <title>甲辰收藏 v1.2.1</title>
<!-- Favicon --> <!-- Favicon -->
<link rel="icon" type="image/x-icon" href="/static/icons/favicon.ico" /> <link rel="icon" type="image/x-icon" href="/static/icons/favicon.ico" />

View File

@ -12,7 +12,7 @@ export default function Login() {
// //
const [showRegister, setShowRegister] = useState(false) const [showRegister, setShowRegister] = useState(false)
const [registerData, setRegisterData] = useState({ const [registerData, setRegisterData] = useState({ agreeTerms: false,
username: '', username: '',
password: '', password: '',
confirmPassword: '', confirmPassword: '',
@ -97,6 +97,11 @@ export default function Login() {
return return
} }
if (!registerData.agreeTerms) {
setRegisterError('请先同意用户协议')
return
}
if (registerData.username.length < 2) { if (registerData.username.length < 2) {
setRegisterError('用户名至少 2 个字符') setRegisterError('用户名至少 2 个字符')
return return
@ -250,7 +255,6 @@ export default function Login() {
background: '#fff' background: '#fff'
}} }}
/> />
<h1 style={{ color: '#fbbf24', fontSize: '28px', fontWeight: '700', margin: '16px 0 8px' }}>甲辰收藏</h1>
<p style={{ color: 'rgba(255,255,255,0.6)', fontSize: '14px', margin: 0 }}>生肖纪念钞管理系统</p> <p style={{ color: 'rgba(255,255,255,0.6)', fontSize: '14px', margin: 0 }}>生肖纪念钞管理系统</p>
</div> </div>
@ -599,6 +603,24 @@ export default function Login() {
/> />
</div> </div>
{/* 用户协议勾选 */}
<div style={{ marginBottom: '20px', display: 'flex', alignItems: 'flex-start', gap: '8px' }}>
<input
type="checkbox"
checked={registerData.agreeTerms}
onChange={(e) => setRegisterData(prev => ({ ...prev, agreeTerms: e.target.checked }))}
style={{ width: '18px', height: '18px', marginTop: '2px', cursor: 'pointer' }}
/>
<div style={{ fontSize: '12px', color: 'rgba(255,255,255,0.7)', lineHeight: '1.5' }}>
我已阅读并同意
<span
onClick={() => window.open('/user_agreement.html', '_blank')}
style={{ color: '#fbbf24', cursor: 'pointer', textDecoration: 'underline' }}
>用户协议</span>
</div>
</div>
{/* 按钮 */} {/* 按钮 */}
<div style={{ display: 'flex', gap: '12px' }}> <div style={{ display: 'flex', gap: '12px' }}>
<button <button