login.html 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949
  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, user-scalable=no">
  6. <title>登录</title>
  7. <!-- 引入基础依赖 -->
  8. <script src="/js/mp_base/base.js"></script>
  9. </head>
  10. <body>
  11. <!-- 页面加载状态 -->
  12. <div id="page-loading" class="page-loading">
  13. <div class="loading-content">
  14. <div class="loading-spinner"></div>
  15. <div class="loading-text">加载中...</div>
  16. </div>
  17. </div>
  18. <div id="app" v-cloak>
  19. <div class="login-popup show">
  20. <div class="mask" ></div>
  21. <div class="popup-content">
  22. <!-- <div class="popup-header">
  23. <span class="title">登录</span>
  24. </div> -->
  25. <!-- 用户协议 -->
  26. <div class="agreement">
  27. <input
  28. type="checkbox"
  29. v-model="agreed"
  30. id="agreement-checkbox"
  31. class="agreement-checkbox"
  32. />
  33. <label for="agreement-checkbox" class="agreement-text">
  34. 我已阅读并同意
  35. <span class="link" @click="openAgreement('user')">《用户协议》</span>与<span class="link" @click="openAgreement('privacy')">《隐私协议》</span>
  36. </label>
  37. </div>
  38. <!-- 账号密码登录 -->
  39. <div class="account-login">
  40. <div class="input-item">
  41. <Icon name="icon-renyuan" size="32" color="#575d6d" class="input-icon"></Icon>
  42. <input
  43. type="text"
  44. v-model="form.username"
  45. placeholder="请输入您的账号"
  46. class="login-input"
  47. />
  48. </div>
  49. <div class="input-item">
  50. <Icon name="icon-kaisuo" size="32" color="#575d6d" class="input-icon"></Icon>
  51. <input
  52. :type="showPassword ? 'text' : 'password'"
  53. v-model="form.password"
  54. placeholder="请输入您的密码"
  55. class="login-input"
  56. />
  57. <div class="eye-icon" @click="showPassword = !showPassword">
  58. <Icon :name="showPassword ? 'icon-yanjing-kai' : 'icon-yanjing-bi'" size="32" color="#575d6d"></Icon>
  59. </div>
  60. </div>
  61. <button
  62. class="account-btn"
  63. :class="{ 'disabled': isLogging }"
  64. :disabled="isLogging"
  65. @click="handleAccountLogin"
  66. >
  67. <Icon name="icon-tuichu" size="32" color="#fff" class="btn-icon"></Icon>
  68. <span>{{ isLogging ? '登录中...' : '登录' }}</span>
  69. </button>
  70. </div>
  71. </div>
  72. </div>
  73. <!-- Loading 遮罩 -->
  74. <div v-if="showLoading" class="loading-mask">
  75. <div class="loading-content">
  76. <div class="loading-spinner"></div>
  77. <div class="loading-text">{{ loadingText }}</div>
  78. </div>
  79. </div>
  80. <!-- Toast 提示 -->
  81. <div v-if="toast.show" class="toast" :class="toast.type">
  82. {{ toast.message }}
  83. </div>
  84. <!-- 自定义确认弹窗 -->
  85. <div v-if="confirmDialog.show" class="confirm-dialog-mask">
  86. <div class="confirm-dialog">
  87. <div class="confirm-content">
  88. <div class="confirm-message">{{ confirmDialog.message }}</div>
  89. <div class="confirm-buttons">
  90. <button class="confirm-btn cancel-btn" @click="handleConfirmCancel">取消</button>
  91. <button class="confirm-btn confirm-btn-primary" @click="handleConfirmOk">确认</button>
  92. </div>
  93. </div>
  94. </div>
  95. </div>
  96. <!-- 底部抽屉:显示协议内容 -->
  97. <div v-if="agreementDrawer.show" class="drawer-mask" @click="closeAgreementDrawer">
  98. <div class="drawer-content" @click.stop>
  99. <div class="drawer-header">
  100. <div class="drawer-title">{{ agreementDrawer.title }}</div>
  101. <div class="drawer-close" @click="closeAgreementDrawer">
  102. <Icon name="icon-X-xi" size="32" color="#666"></Icon>
  103. </div>
  104. </div>
  105. <div class="drawer-body">
  106. <div v-html="agreementDrawer.content"></div>
  107. </div>
  108. </div>
  109. </div>
  110. </div>
  111. <script>
  112. // 等待SS框架加载完成
  113. window.SS.ready(function () {
  114. // 使用SS框架的方式创建Vue实例
  115. window.SS.dom.initializeFormApp({
  116. el: '#app',
  117. data() {
  118. return {
  119. form: {
  120. username: '',
  121. password: ''
  122. },
  123. showPassword: false,
  124. agreed: false,
  125. isLogging: false,
  126. showLoading: false,
  127. loadingText: '',
  128. toast: {
  129. show: false,
  130. message: '',
  131. type: 'info'
  132. },
  133. confirmDialog: {
  134. show: false,
  135. message: '',
  136. resolve: null
  137. },
  138. agreementDrawer: {
  139. show: false,
  140. title: '',
  141. content: ''
  142. }
  143. }
  144. },
  145. mounted() {
  146. // 隐藏页面加载状态
  147. const pageLoading = document.getElementById('page-loading')
  148. if (pageLoading) {
  149. pageLoading.style.display = 'none'
  150. }
  151. // 初始化页面,使用自定义结果处理
  152. if (typeof initPage === 'function') {
  153. initPage('login', this.handleResult)
  154. }
  155. // 获取URL参数,用于调试
  156. const urlParams = this.getUrlParams()
  157. console.log('🔗 H5登录页面参数:', urlParams)
  158. },
  159. methods: {
  160. // 获取URL参数
  161. getUrlParams() {
  162. const params = {}
  163. const urlSearchParams = new URLSearchParams(window.location.search)
  164. for (const [key, value] of urlSearchParams) {
  165. params[key] = decodeURIComponent(value)
  166. }
  167. return params
  168. },
  169. // 处理操作结果(来自小程序的回调)
  170. handleResult(data) {
  171. console.log('🎯 收到小程序回调:', data)
  172. // 这里可以处理来自小程序的各种回调
  173. },
  174. // 显示Loading
  175. showLoadingMask(text = '加载中...') {
  176. this.showLoading = true
  177. this.loadingText = text
  178. },
  179. // 隐藏Loading
  180. hideLoadingMask() {
  181. this.showLoading = false
  182. this.loadingText = ''
  183. },
  184. // 显示Toast
  185. showToast(message, type = 'info', duration = 3000) {
  186. this.toast = {
  187. show: true,
  188. message,
  189. type
  190. }
  191. setTimeout(() => {
  192. this.toast.show = false
  193. }, duration)
  194. },
  195. // 自定义确认对话框
  196. showConfirm(message) {
  197. return new Promise((resolve) => {
  198. this.confirmDialog = {
  199. show: true,
  200. message: message,
  201. resolve: resolve
  202. }
  203. })
  204. },
  205. // 处理确认对话框 - 取消
  206. handleConfirmCancel() {
  207. this.confirmDialog.show = false
  208. if (this.confirmDialog.resolve) {
  209. this.confirmDialog.resolve(false)
  210. }
  211. this.confirmDialog.resolve = null
  212. },
  213. // 处理确认对话框 - 确认
  214. handleConfirmOk() {
  215. this.confirmDialog.show = false
  216. if (this.confirmDialog.resolve) {
  217. this.confirmDialog.resolve(true)
  218. }
  219. this.confirmDialog.resolve = null
  220. },
  221. // 账号密码登录
  222. async handleAccountLogin() {
  223. if (this.isLogging) {
  224. console.log('正在登录中,请勿重复点击')
  225. return
  226. }
  227. if (!this.agreed) {
  228. // 使用自定义确认对话框替换原生confirm
  229. const userConfirmed = await this.showConfirm('是否同意用户协议和隐私协议?');
  230. if (userConfirmed) {
  231. this.agreed = true; // 用户点击了“确定”,视为同意
  232. // 继续执行后续逻辑
  233. } else {
  234. return; // 用户点击了“取消”,中断操作
  235. }
  236. }
  237. if (!this.form.username || !this.form.password) {
  238. this.showToast('请输入用户名和密码', 'warning')
  239. return
  240. }
  241. try {
  242. this.isLogging = true
  243. this.showLoadingMask('登录中...')
  244. // 获取URL参数中的wechatCode
  245. const urlParams = this.getUrlParams()
  246. const wechatCode = urlParams.wechatCode || ''
  247. console.log('🔗 使用wechatCode:', wechatCode)
  248. // 使用真实的API进行登录
  249. const response = await h5UserApi.accountLogin({
  250. yhm: this.form.username,
  251. mm: this.form.password,
  252. wdConfirmationCaptchaService: "0",
  253. wechatCode: wechatCode // 传递wechatCode
  254. })
  255. // 检查是否有错误信息
  256. if (response && response.data && response.data.msg) {
  257. // 登录失败,显示错误信息
  258. console.error('❌ 登录失败:', response.data.msg)
  259. this.showToast(response.data.msg, 'error')
  260. return
  261. }
  262. console.log("response:",response)
  263. // 检查登录是否成功
  264. if (response && response.data ) {
  265. if (typeof response.data === 'string' && response.data.includes('页面执行时错误')) {
  266. throw new Error('服务器处理错误')
  267. return
  268. }
  269. const userData = {
  270. devId:response.data.devId,
  271. sbmc:response.data.sbmc,
  272. sessId:response.data.sessId,
  273. xm:response.data.xm,
  274. yhsbToken:response.data.yhsbToken,
  275. onlineToken:response.data.onlineToken,
  276. syList:response.data.sylist,
  277. yhid:response.data.yhid,
  278. yhm:response.data.yhm
  279. }
  280. // 保存用户信息到H5本地存储
  281. h5UserApi.saveUserInfo(userData)
  282. // 准备返回数据给小程序
  283. const loginResult = {
  284. success: true,
  285. userInfo: userData,
  286. }
  287. console.log('✅ 登录成功,准备返回数据:', loginResult)
  288. // this.showToast('登录成功!', 'success')
  289. // 延迟一下让用户看到成功提示
  290. setTimeout(() => {
  291. // 通过h5-bridge返回登录结果给小程序
  292. this.returnLoginResult(loginResult)
  293. }, 1000)
  294. } else {
  295. throw new Error('登录响应数据无效')
  296. }
  297. } catch (error) {
  298. console.error('❌ 登录失败:', error)
  299. this.showToast('登录失败: ' + error.message, 'error')
  300. } finally {
  301. this.isLogging = false
  302. this.hideLoadingMask()
  303. }
  304. },
  305. // 返回登录结果给小程序
  306. returnLoginResult(result) {
  307. // console.log('🔄 返回登录结果给小程序:', result)
  308. // 使用h5-bridge的数据传递功能
  309. // 这里需要跳转到h5-controller中转页来传递数据
  310. callNative('loginSuccess', '登录成功', result)
  311. },
  312. // 打开协议页面
  313. openAgreement(type) {
  314. const agreementData = {
  315. user: {
  316. title: '用户协议',
  317. content: `
  318. <h3>用户协议</h3>
  319. <p>欢迎使用本平台服务。在使用本平台服务前,请您仔细阅读并充分理解本协议内容。</p>
  320. <h4>1. 服务条款的接受</h4>
  321. <p>您使用本平台服务即视为您已阅读并同意接受本协议的全部条款。</p>
  322. <h4>2. 账号注册和使用</h4>
  323. <p>用户在注册账号时,应提供真实、准确、完整的个人信息。</p>
  324. <h4>3. 用户权利和义务</h4>
  325. <p>用户有权使用本平台提供的各项服务,但应遵守相关法律法规。</p>
  326. <h4>4. 隐私保护</h4>
  327. <p>我们承诺保护用户的个人信息安全,不会泄露用户隐私。</p>
  328. <p style="margin-top: 20px; color: #999;">本协议最终解释权归本平台所有。</p>
  329. `
  330. },
  331. privacy: {
  332. title: '隐私协议',
  333. content: `
  334. <h3>隐私协议</h3>
  335. <p>本指引是海丰县德成中英文学校小程序开发者 海丰县德成中英文学校(以下简称"开发者")为处理你的个人信息而制定。</p>
  336. <h4>开发者处理的信息</h4>
  337. <p>根据法律规定,开发者仅处理实现小程序功能所必要的信息。</p>
  338. <p>开发者收集你的设备信息,用于识别你的账号登录设备。</p>
  339. <p>开发者将在获取你的明示同意后,收集你的微信昵称、头像,用途是【更新OA系统中你的头像信息】</p>
  340. <h4>你的权益</h4>
  341. <p>关于你的个人信息,你可以通过以下方式与开发者联系,行使查阅、复制、更正、删除等法定权利。</p>
  342. <p>若你在小程序中注,不会对外公开披露你的信息,如必须公开披露时,开发者应当向你告知公开披露的目的、披露信息的类型及可能涉及的信息,并征得你的单独同意。</p>
  343. <p>你认为开发者未遵守上述约定,或有其他的投诉建议、或未成年人个人信息保护相关问题,可通过以下方式与开发者联系;或者向微信进行投诉。</p>
  344. <p><strong>邮箱:</strong> DC1612356478@163.com</p>
  345. <p style="margin-top: 20px; color: #999;">更新日期:2025-10-11</p>
  346. `
  347. }
  348. };
  349. const agreement = agreementData[type];
  350. if (agreement) {
  351. this.agreementDrawer = {
  352. show: true,
  353. title: agreement.title,
  354. content: agreement.content
  355. };
  356. }
  357. },
  358. // 关闭协议抽屉
  359. closeAgreementDrawer() {
  360. this.agreementDrawer.show = false;
  361. }
  362. }
  363. })
  364. console.log('✅ 登录页面初始化完成')
  365. })
  366. </script>
  367. <style>
  368. /* 防止Vue模板闪烁 */
  369. [v-cloak] {
  370. display: none !important;
  371. }
  372. /* 页面加载状态 */
  373. .page-loading {
  374. position: fixed;
  375. top: 0;
  376. left: 0;
  377. right: 0;
  378. bottom: 0;
  379. background: #f5f5f5;
  380. display: flex;
  381. align-items: center;
  382. justify-content: center;
  383. z-index: 9999;
  384. }
  385. .page-loading .loading-content {
  386. text-align: center;
  387. }
  388. .page-loading .loading-spinner {
  389. width: 40px;
  390. height: 40px;
  391. border: 4px solid #f3f3f3;
  392. border-top: 4px solid #40ac6d;
  393. border-radius: 50%;
  394. animation: page-spin 1s linear infinite;
  395. margin: 0 auto 15px;
  396. }
  397. @keyframes page-spin {
  398. 0% { transform: rotate(0deg); }
  399. 100% { transform: rotate(360deg); }
  400. }
  401. .page-loading .loading-text {
  402. color: #666;
  403. font-size: 14px;
  404. }
  405. * {
  406. margin: 0;
  407. padding: 0;
  408. box-sizing: border-box;
  409. }
  410. body {
  411. font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  412. background: #f5f5f5;
  413. overflow: hidden;
  414. }
  415. .login-popup {
  416. position: fixed;
  417. left: 0;
  418. right: 0;
  419. top: 0;
  420. bottom: 0;
  421. z-index: 9999;
  422. visibility: hidden;
  423. }
  424. .login-popup.show {
  425. visibility: visible;
  426. }
  427. .mask {
  428. position: absolute;
  429. left: 0;
  430. right: 0;
  431. top: 0;
  432. bottom: 0;
  433. background: rgba(0, 0, 0, 0.6);
  434. }
  435. .popup-content {
  436. width: calc(100% - 20px);
  437. position: absolute;
  438. left: 50%;
  439. top: 50%;
  440. background: #fff;
  441. border-radius: 4px;
  442. padding: 30px 20px;
  443. transform: translate(-50%, -50%);
  444. transition: transform 0.3s ease-out;
  445. border: 1px solid #d3d4d5;
  446. max-height: 80vh;
  447. overflow-y: auto;
  448. }
  449. .popup-header {
  450. display: flex;
  451. justify-content: space-between;
  452. align-items: center;
  453. margin-bottom: 20px;
  454. }
  455. .title {
  456. font-size: 18px;
  457. font-weight: bold;
  458. color: #333;
  459. }
  460. .close-btn {
  461. font-size: 24px;
  462. color: #999;
  463. padding: 10px;
  464. margin: -10px;
  465. cursor: pointer;
  466. user-select: none;
  467. }
  468. .close-btn:hover {
  469. color: #666;
  470. }
  471. .input-item {
  472. position: relative;
  473. margin-bottom: 15px;
  474. display: flex;
  475. }
  476. .input-icon {
  477. position: absolute;
  478. left: 18px;
  479. top: 50%;
  480. transform: translateY(-50%);
  481. z-index: 1;
  482. }
  483. .login-input {
  484. width: 100%;
  485. height: 44px;
  486. /* background: #f5f5f5; */
  487. border-radius: 4px;
  488. padding: 0 40px 0 50px;
  489. font-size: 16px;
  490. border: none;
  491. outline: none;
  492. border: 1px solid #d5d8dc;
  493. }
  494. .login-input:focus {
  495. /* background: #f0f0f0; */
  496. border: 1px solid #d0d2d6;
  497. }
  498. .eye-icon {
  499. position: absolute;
  500. right: 10px;
  501. top: 50%;
  502. transform: translateY(-50%);
  503. padding: 10px;
  504. display: flex;
  505. align-items: center;
  506. justify-content: center;
  507. cursor: pointer;
  508. z-index: 1000;
  509. }
  510. .account-btn {
  511. width: 100%;
  512. height: 44px;
  513. line-height: 44px;
  514. background: #575d6d;
  515. color: #fff;
  516. border-radius: 4px;
  517. font-size: 16px;
  518. border: none;
  519. margin-top: 35px;
  520. transition: all 0.3s ease;
  521. cursor: pointer;
  522. display: flex;
  523. align-items: center;
  524. justify-content: center;
  525. gap: 8px;
  526. }
  527. .btn-icon {
  528. display: inline-block;
  529. }
  530. .account-btn span {
  531. line-height: 1;
  532. }
  533. .account-btn:hover {
  534. background: #555;
  535. }
  536. .account-btn.disabled {
  537. background: #cccccc !important;
  538. color: #999999 !important;
  539. opacity: 0.6;
  540. cursor: not-allowed;
  541. }
  542. /* 用户协议 */
  543. .agreement {
  544. display: flex;
  545. align-items: center;
  546. justify-content: center;
  547. margin-bottom: 25px;
  548. }
  549. /* 自定义checkbox样式 */
  550. .agreement-checkbox {
  551. position: relative;
  552. margin-right: 8px;
  553. width: 20px;
  554. height: 20px;
  555. appearance: none;
  556. -webkit-appearance: none;
  557. border: 2px solid #d5d8dc;
  558. border-radius: 4px;
  559. outline: none;
  560. cursor: pointer;
  561. transition: all 0.2s;
  562. }
  563. .agreement-checkbox:hover {
  564. border-color: #575d6d;
  565. }
  566. .agreement-checkbox:checked {
  567. background-color: #575d6d;
  568. border-color: #575d6d;
  569. }
  570. .agreement-checkbox:checked::after {
  571. content: '';
  572. position: absolute;
  573. left: 5px;
  574. top: 0;
  575. width: 5px;
  576. height: 10px;
  577. border: solid white;
  578. border-width: 0 2px 2px 0;
  579. transform: rotate(45deg);
  580. }
  581. .agreement-text {
  582. font-size: 0.372rem;
  583. font-weight: 500;
  584. color: #999;
  585. cursor: pointer;
  586. }
  587. .link {
  588. /* color: #40ac6d; */
  589. cursor: pointer;
  590. }
  591. .link:hover {
  592. text-decoration: underline;
  593. }
  594. /* Loading 遮罩 */
  595. .loading-mask {
  596. position: fixed;
  597. top: 0;
  598. left: 0;
  599. right: 0;
  600. bottom: 0;
  601. background: rgba(0, 0, 0, 0.5);
  602. display: flex;
  603. align-items: center;
  604. justify-content: center;
  605. z-index: 10000;
  606. }
  607. .loading-content {
  608. background: white;
  609. padding: 20px;
  610. border-radius: 4px;
  611. text-align: center;
  612. min-width: 120px;
  613. }
  614. .loading-spinner {
  615. width: 30px;
  616. height: 30px;
  617. border: 3px solid #f3f3f3;
  618. border-top: 3px solid #40ac6d;
  619. border-radius: 50%;
  620. animation: spin 1s linear infinite;
  621. margin: 0 auto 10px;
  622. }
  623. @keyframes spin {
  624. 0% { transform: rotate(0deg); }
  625. 100% { transform: rotate(360deg); }
  626. }
  627. .loading-text {
  628. color: #333;
  629. font-size: 14px;
  630. }
  631. /* Toast 提示 */
  632. .toast {
  633. position: fixed;
  634. top: 50%;
  635. left: 50%;
  636. transform: translate(-50%, -50%);
  637. background: rgba(0, 0, 0, 0.8);
  638. color: white;
  639. padding: 12px 20px;
  640. border-radius: 4px;
  641. font-size: 14px;
  642. z-index: 10001;
  643. max-width: 80%;
  644. text-align: center;
  645. }
  646. .toast.success {
  647. background: rgba(40, 167, 69, 0.9);
  648. }
  649. .toast.warning {
  650. background: rgba(255, 193, 7, 0.9);
  651. color: #212529;
  652. }
  653. .toast.error {
  654. background: rgba(220, 53, 69, 0.9);
  655. }
  656. /* 自定义确认对话框 - 优化样式 */
  657. .confirm-dialog-mask {
  658. position: fixed;
  659. top: 0;
  660. left: 0;
  661. right: 0;
  662. bottom: 0;
  663. background: rgba(0, 0, 0, 0.6);
  664. display: flex;
  665. align-items: center;
  666. justify-content: center;
  667. z-index: 10002;
  668. }
  669. .confirm-dialog {
  670. background: white;
  671. border-radius: 4px;
  672. min-width: 280px;
  673. max-width: 90%;
  674. box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  675. overflow: hidden;
  676. animation: confirmFadeIn 0.3s ease-out;
  677. }
  678. @keyframes confirmFadeIn {
  679. from {
  680. opacity: 0;
  681. transform: scale(0.95) translateY(-20px);
  682. }
  683. to {
  684. opacity: 1;
  685. transform: scale(1) translateY(0);
  686. }
  687. }
  688. .confirm-content {
  689. padding: 24px 20px 20px;
  690. }
  691. .confirm-message {
  692. font-size: 16px;
  693. color: #333;
  694. text-align: center;
  695. margin-bottom: 24px;
  696. line-height: 1.6;
  697. }
  698. .confirm-buttons {
  699. display: flex;
  700. gap: 10px;
  701. }
  702. .confirm-btn {
  703. flex: 1;
  704. height: 40px;
  705. border: none;
  706. border-radius: 4px;
  707. font-size: 15px;
  708. cursor: pointer;
  709. transition: all 0.2s ease;
  710. font-weight: 500;
  711. }
  712. .cancel-btn {
  713. background: #f5f5f5;
  714. color: #666;
  715. border: 1px solid #e5e5e5;
  716. }
  717. .cancel-btn:hover {
  718. background: #eeeeee;
  719. border-color: #d5d5d5;
  720. }
  721. .confirm-btn-primary {
  722. background: #575d6d;
  723. color: white;
  724. }
  725. .confirm-btn-primary:hover {
  726. background: #494e5b;
  727. }
  728. .confirm-btn:active {
  729. transform: scale(0.98);
  730. }
  731. /* 底部抽屉样式 */
  732. .drawer-mask {
  733. position: fixed;
  734. top: 0;
  735. left: 0;
  736. right: 0;
  737. bottom: 0;
  738. background: rgba(0, 0, 0, 0.6);
  739. z-index: 10003;
  740. animation: drawerMaskFadeIn 0.3s ease-out;
  741. }
  742. @keyframes drawerMaskFadeIn {
  743. from { opacity: 0; }
  744. to { opacity: 1; }
  745. }
  746. .drawer-content {
  747. position: absolute;
  748. left: 0;
  749. right: 0;
  750. bottom: 0;
  751. max-height: 80vh;
  752. background: white;
  753. border-radius: 4px 4px 0 0;
  754. animation: drawerSlideUp 0.3s ease-out;
  755. display: flex;
  756. flex-direction: column;
  757. }
  758. @keyframes drawerSlideUp {
  759. from {
  760. transform: translateY(100%);
  761. }
  762. to {
  763. transform: translateY(0);
  764. }
  765. }
  766. .drawer-header {
  767. display: flex;
  768. align-items: center;
  769. justify-content: space-between;
  770. padding: 16px 20px;
  771. border-bottom: 1px solid #f0f0f0;
  772. flex-shrink: 0;
  773. }
  774. .drawer-title {
  775. font-size: 18px;
  776. font-weight: 600;
  777. color: #333;
  778. }
  779. .drawer-close {
  780. width: 32px;
  781. height: 32px;
  782. display: flex;
  783. align-items: center;
  784. justify-content: center;
  785. cursor: pointer;
  786. border-radius: 4px;
  787. transition: background 0.2s;
  788. }
  789. .drawer-close:hover {
  790. background: #f5f5f5;
  791. }
  792. .drawer-body {
  793. flex: 1;
  794. overflow-y: auto;
  795. padding: 20px;
  796. -webkit-overflow-scrolling: touch;
  797. }
  798. .drawer-body h3 {
  799. font-size: 18px;
  800. color: #333;
  801. margin-bottom: 16px;
  802. }
  803. .drawer-body h4 {
  804. font-size: 16px;
  805. color: #555;
  806. margin-top: 20px;
  807. margin-bottom: 12px;
  808. }
  809. .drawer-body p {
  810. font-size: 14px;
  811. color: #666;
  812. line-height: 1.8;
  813. margin-bottom: 12px;
  814. }
  815. /* 响应式设计 */
  816. /* @media (max-width: 480px) {
  817. .popup-content {
  818. padding: 15px 10px;
  819. }
  820. .login-input {
  821. height: 40px;
  822. font-size: 13px;
  823. }
  824. .account-btn {
  825. height: 40px;
  826. line-height: 40px;
  827. font-size: 14px;
  828. }
  829. } */
  830. </style>
  831. </body>
  832. </html>