login.html 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  6. <title>登录/注册</title>
  7. <link rel="stylesheet" href="../../css/login/login.css" />
  8. <link rel="stylesheet" href="../../css/hint-view.css" />
  9. </head>
  10. <body>
  11. <!-- 半透明背景遮罩 -->
  12. <div class="login-overlay" id="loginOverlay" style="display: none;"></div>
  13. <!-- 登录/注册容器 -->
  14. <div class="login-container" id="loginContainer" style="display: none;">
  15. <!-- 关闭按钮 -->
  16. <button class="close-btn" id="closeBtn">×</button>
  17. <!-- 标签切换 -->
  18. <div class="tab-switcher">
  19. <button class="tab-btn active" data-tab="login">登录</button>
  20. <button class="tab-btn" data-tab="register">注册</button>
  21. </div>
  22. <!-- 登录表单 -->
  23. <div class="form-container" id="loginForm">
  24. <!-- 登录方式切换 -->
  25. <div class="login-type-switcher">
  26. <button class="type-btn active" data-type="account">账号密码</button>
  27. <button class="type-btn" data-type="phone">手机验证码</button>
  28. </div>
  29. <!-- 账号密码登录 -->
  30. <div class="login-type-content" id="accountLogin">
  31. <div class="form-group">
  32. <label for="loginAccount">账号</label>
  33. <input type="text" id="loginAccount" placeholder="请输入账号" />
  34. </div>
  35. <div class="form-group">
  36. <label for="loginPassword">密码</label>
  37. <input type="password" id="loginPassword" placeholder="请输入密码" />
  38. </div>
  39. </div>
  40. <!-- 手机验证码登录 -->
  41. <div class="login-type-content" id="phoneLogin" style="display: none;">
  42. <div class="form-group">
  43. <label for="loginPhone">手机号</label>
  44. <input type="tel" id="loginPhone" placeholder="请输入手机号" maxlength="11" />
  45. </div>
  46. <div class="form-group">
  47. <label for="loginCode">验证码</label>
  48. <div class="code-input-group">
  49. <input type="text" id="loginCode" placeholder="请输入验证码" maxlength="6" />
  50. <button class="code-btn" id="getLoginCode">获取验证码</button>
  51. </div>
  52. </div>
  53. </div>
  54. <div class="error-message" id="loginError"></div>
  55. <button class="submit-btn" id="loginSubmit">登录</button>
  56. </div>
  57. <!-- 注册表单 -->
  58. <div class="form-container" id="registerForm" style="display: none;">
  59. <div class="form-group">
  60. <div class="avatar-upload">
  61. <div class="avatar-preview" id="avatarPreview">
  62. <img id="avatarImage" src="" alt="头像预览" style="display: none;" />
  63. <span class="avatar-placeholder">点击上传</span>
  64. </div>
  65. <input type="file" id="registerAvatar" accept="image/*" style="display: none;" />
  66. </div>
  67. </div>
  68. <div class="form-group">
  69. <label for="registerUsername">用户名</label>
  70. <input type="text" id="registerUsername" placeholder="请输入用户名" />
  71. </div>
  72. <div class="form-group">
  73. <label for="registerPhone">手机号</label>
  74. <input type="tel" id="registerPhone" placeholder="请输入手机号" maxlength="11" />
  75. </div>
  76. <div class="form-group">
  77. <label for="registerCode">验证码</label>
  78. <div class="code-input-group">
  79. <input type="text" id="registerCode" placeholder="请输入验证码" maxlength="6" />
  80. <button class="code-btn" id="getRegisterCode">获取验证码</button>
  81. </div>
  82. </div>
  83. <div class="form-group">
  84. <label for="registerPassword">密码</label>
  85. <input type="password" id="registerPassword" placeholder="请输入密码" />
  86. <div class="password-hint">
  87. <span class="hint-text">密码要求:8-20位,包含大小写字母和数字</span>
  88. </div>
  89. </div>
  90. <div class="form-group">
  91. <label for="registerPasswordConfirm">确认密码</label>
  92. <input type="password" id="registerPasswordConfirm" placeholder="请再次输入密码" />
  93. </div>
  94. <div class="error-message" id="registerError"></div>
  95. <button class="submit-btn" id="registerSubmit">注册</button>
  96. </div>
  97. </div>
  98. <script src="../../js/hint-view.js"></script>
  99. <script src="../../js/login/login.js"></script>
  100. </body>
  101. </html>