login.html 30 KB

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