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.

967 lines
20 KiB

  1. <template>
  2. <view class="login-registration-container">
  3. <!-- 自定义导航栏 -->
  4. <view
  5. class="custom-navbar"
  6. :style="{ paddingTop: safeAreaInsets?.top + 'px' }"
  7. >
  8. <view class="nav-left">
  9. <image
  10. class="icons"
  11. @click="goToBack"
  12. src="../../../static/icons/back.png"
  13. alt="返回首页"
  14. />
  15. </view>
  16. <view class="nav-right">
  17. <image
  18. class="icons"
  19. src="../../../static/icons/Headset.png"
  20. alt="联系客服"
  21. />
  22. </view>
  23. </view>
  24. <!-- Logo -->
  25. <!-- <image class="logo" src="/static/logo.png" mode="aspectFit"></image> -->
  26. <!-- 欢迎语 -->
  27. <text class="welcome-text">找回密码</text>
  28. <!-- 邮箱/手机号切换 -->
  29. <view v-if="!isRecovering" class="switch-container">
  30. <text
  31. class="switch-item"
  32. :class="{ active: switchType === 'Email' }"
  33. @click="switchEmail"
  34. >邮箱</text
  35. >
  36. <text
  37. class="switch-item"
  38. :class="{ active: switchType === 'Phone' }"
  39. @click="switchPhone"
  40. >手机号</text
  41. >
  42. </view>
  43. <view v-else class="switch-container-occupy"> </view>
  44. <!-- 输入框 -->
  45. <view v-if="isRecovering" class="input-container">
  46. <view v-if="switchType === 'Email'">
  47. <!-- 修改邮箱输入框容器将图标包含在内 -->
  48. <view class="input-with-icon">
  49. <image
  50. class="input-icon"
  51. src="../../../static/icons/Unlock.png"
  52. alt=""
  53. />
  54. <input
  55. class="input-field"
  56. type="text"
  57. placeholder="输入新密码"
  58. v-model="newPassword"
  59. />
  60. </view>
  61. <view class="input-with-icon">
  62. <image
  63. class="input-icon"
  64. src="../../../static/icons/Unlock.png"
  65. alt=""
  66. />
  67. <input
  68. class="input-field"
  69. type="text"
  70. placeholder="再次确认"
  71. v-model="password"
  72. />
  73. </view>
  74. </view>
  75. </view>
  76. <view v-else class="input-container">
  77. <view v-if="switchType === 'Email'">
  78. <!-- 修改邮箱输入框容器将图标包含在内 -->
  79. <view class="input-with-icon">
  80. <image
  81. class="input-icon"
  82. src="../../../static/icons/Mail.png"
  83. alt=""
  84. />
  85. <input
  86. class="input-field"
  87. type="text"
  88. placeholder="请输入邮箱"
  89. v-model="email"
  90. />
  91. <view>
  92. <button
  93. class="send-code-btn-email"
  94. :disabled="isCodeBtnDisabled"
  95. :class="{ 'send-code-btn-disabled': isCodeBtnDisabled }"
  96. @click="sendCode"
  97. >
  98. <text
  99. class="send-code-text"
  100. :class="{ 'send-code-btn-disabled-text': isCodeBtnDisabled }"
  101. >{{ codeBtnText }}</text
  102. >
  103. </button>
  104. </view>
  105. </view>
  106. <view class="input-with-icon">
  107. <image
  108. class="input-icon"
  109. src="../../../static/icons/Text-recognition.png"
  110. alt=""
  111. />
  112. <input
  113. class="input-field"
  114. type="text"
  115. placeholder="请输入验证码"
  116. v-model="password"
  117. />
  118. </view>
  119. </view>
  120. <view v-if="switchType === 'Phone'" class="phone-input-container">
  121. <view class="country-code-selector" @click="showCountryPicker">
  122. <image
  123. class="country-flag-img"
  124. src="../../../static/icons/Iphone.png"
  125. mode="aspectFit"
  126. ></image>
  127. <text class="country-code">{{ selectedCountry.code }}</text>
  128. <!-- <text class="arrow-down"></text> -->
  129. </view>
  130. <input
  131. class="input-field phone-input"
  132. type="number"
  133. placeholder="输入手机号"
  134. v-model="phone"
  135. @input="onPhoneInput"
  136. />
  137. <view>
  138. <button
  139. class="send-code-btn"
  140. :disabled="isCodeBtnDisabled"
  141. :class="{ 'send-code-btn-disabled': isCodeBtnDisabled }"
  142. @click="sendCode"
  143. >
  144. <text
  145. class="send-code-text"
  146. :class="{ 'send-code-btn-disabled-text': isCodeBtnDisabled }"
  147. >{{ codeBtnText }}</text
  148. >
  149. </button>
  150. </view>
  151. </view>
  152. <view v-if="switchType === 'Phone'" class="input-with-icon">
  153. <image
  154. class="input-icon"
  155. src="../../../static/icons/Text-recognition.png"
  156. alt=""
  157. />
  158. <input
  159. class="input-field"
  160. type="text"
  161. placeholder="请输入验证码"
  162. v-model="password"
  163. />
  164. </view>
  165. </view>
  166. <!-- 用户协议 -->
  167. <view @click="changeCheckbox" class="agreement-container-one">
  168. <text
  169. class="agreement-text-one"
  170. :style="!isRecovering ? 'visibility: hidden' : 'visibility: visible'"
  171. >
  172. 密码最少8位数
  173. </text>
  174. </view>
  175. <!-- 注册按钮 -->
  176. <button class="register-btn" @click="register">
  177. {{ isRecovering ? "确认" : "下一步" }}
  178. </button>
  179. <!-- 或者 -->
  180. <text class="or-text-one" @click="goToRegistration"
  181. >如果您还没有账号点击注册
  182. <image class="to-icon" src="../../../static/icons/To.png"></image>
  183. </text>
  184. <!-- 或者 -->
  185. <text class="or-text" @click="goToLogin">已有账号登录 </text>
  186. <!-- 同意弹窗 -->
  187. <uniPopup ref="agreementPopup" type="dialog">
  188. <view class="popup-content">
  189. <text class="popup-title">同意并继续</text>
  190. <text class="popup-message">请阅读并同意服务协议和隐私权限</text>
  191. <button class="agree-button" @click="handleAgree">
  192. <text class="agree-text">同意</text>
  193. </button>
  194. </view>
  195. </uniPopup>
  196. <footerBar class="static-footer" :type="type"></footerBar>
  197. </view>
  198. </template>
  199. <script setup>
  200. import { ref } from "vue";
  201. // 导入完整的国家列表
  202. import countryList from "../login/list";
  203. import footerBar from "../../../components/footerBar-cn.vue";
  204. import uniPopup from "../../../uni_modules/uni-popup/components/uni-popup/uni-popup.vue";
  205. import { verificationPhone, verificationEmail } from "../login/verification";
  206. const type = ref("member");
  207. const email = ref("");
  208. const password = ref("");
  209. const newPassword = ref("");
  210. const phone = ref("");
  211. const country = ref("+86");
  212. const agreed = ref(false);
  213. const switchType = ref("Phone"); // 默认是邮箱注册
  214. const { safeAreaInsets } = uni.getSystemInfoSync();
  215. const codeBtnText = ref("获取验证码");
  216. const isCodeBtnDisabled = ref(false); // 添加验证码按钮禁用状态
  217. const checkboxUrl = ref("../../../static/icons/Check-one-false.png");
  218. const isRecovering = ref(false);
  219. // 使用从list.js导入的完整国家列表数据
  220. const countries = ref(
  221. countryList.list.map((item) => ({
  222. name: item.name,
  223. code: `+${item.tel}`,
  224. flag: item.flag,
  225. short: item.short,
  226. en: item.en,
  227. }))
  228. );
  229. // 默认选中的国家(中国)
  230. const selectedCountry = ref(
  231. countries.value.find((country) => country.short === "CN") ||
  232. countries.value[0]
  233. );
  234. // 显示国家选择器
  235. function showCountryPicker() {
  236. uni.showActionSheet({
  237. itemList: countries.value.map(
  238. (country) => `${country.name} ${country.code}`
  239. ),
  240. success: function (res) {
  241. selectedCountry.value = countries.value[res.tapIndex];
  242. },
  243. });
  244. }
  245. function goToBack() {
  246. // 返回上一页
  247. uni.navigateBack(-1);
  248. }
  249. function switchEmail() {
  250. // 切换到邮箱注册
  251. switchType.value = "Email";
  252. }
  253. function switchPhone() {
  254. // 切换到手机注册
  255. switchType.value = "Phone";
  256. }
  257. // function register() {
  258. // if (switchType.value === "Email") {
  259. // // 登录逻辑
  260. // if (!email.value) {
  261. // uni.showToast({
  262. // title: "请输入邮箱地址",
  263. // icon: "none",
  264. // });
  265. // return;
  266. // }
  267. // // 发送登录请求
  268. // console.log("登录:", email.value);
  269. // }
  270. // if (switchType.value === "Phone") {
  271. // // 登录逻辑
  272. // if (!phone.value) {
  273. // uni.showToast({
  274. // title: "请输入手机号码",
  275. // icon: "none",
  276. // });
  277. // return;
  278. // }
  279. // // 发送登录请求
  280. // console.log("登录:", phone.value);
  281. // }
  282. // }
  283. function register() {
  284. if (switchType.value === "Phone") {
  285. // 登录逻辑
  286. if (!phone.value) {
  287. uni.showToast({
  288. title: "请输入手机号码",
  289. icon: "none",
  290. });
  291. return;
  292. }
  293. if (!password.value) {
  294. uni.showToast({
  295. title: "请输入验证码",
  296. icon: "none",
  297. });
  298. return;
  299. }
  300. const phoneAll = `${country.value}${phone.value}`;
  301. console.log("完整手机号" + phoneAll);
  302. if (validatePhoneNumber(country.value, phone.value)) {
  303. console.log("登录成功:", phoneAll);
  304. }
  305. // 发送登录请求
  306. // console.log("登录:", phone.value);
  307. }
  308. if (switchType.value === "Email") {
  309. // 登录逻辑
  310. if (!email.value) {
  311. uni.showToast({
  312. title: "请输入邮箱地址",
  313. icon: "none",
  314. });
  315. return;
  316. }
  317. if (!password.value) {
  318. uni.showToast({
  319. title: "请输入验证码",
  320. icon: "none",
  321. });
  322. return;
  323. }
  324. const bool = verificationEmail(email.value);
  325. console.log("验证是否成功", bool);
  326. // 检查格式是否正确
  327. if (!bool) {
  328. uni.showToast({
  329. title: "邮箱格式不正确",
  330. icon: "none",
  331. });
  332. return;
  333. }
  334. // 发送登录请求
  335. console.log("登录:", email.value);
  336. }
  337. // if (!agreed.value) {
  338. // // 显示同意弹窗
  339. // agreementPopup.value.open();
  340. // return;
  341. // }
  342. isRecovering.value = !isRecovering.value;
  343. // 如果已经同意,则继续登录流程
  344. // uni.showToast({
  345. // title: "登录成功",
  346. // icon: "success",
  347. // });
  348. }
  349. function goToLogin() {
  350. // 跳转到登录页
  351. uni.navigateTo({
  352. url: "/pages/start/login/login",
  353. });
  354. }
  355. function onPhoneInput(e) {
  356. // 确保只允许输入数字
  357. const value = e.detail.value;
  358. // 使用 isNaN 检查是否为有效数字
  359. if (isNaN(value)) {
  360. phone.value = "";
  361. } else {
  362. phone.value = value;
  363. }
  364. }
  365. // function sendCode() {
  366. // // 如果按钮已禁用,则不执行后续逻辑
  367. // if (isCodeBtnDisabled.value) return;
  368. // // 设置按钮为禁用状态
  369. // isCodeBtnDisabled.value = true;
  370. // codeBtnText.value = "重新发送";
  371. // let time = 6;
  372. // const timer = setInterval(() => {
  373. // time--;
  374. // codeBtnText.value = "重新发送 " + time + "S";
  375. // if (time <= 0) {
  376. // clearInterval(timer);
  377. // codeBtnText.value = "重新发送";
  378. // // 倒计时结束后启用按钮
  379. // isCodeBtnDisabled.value = false;
  380. // }
  381. // }, 1000);
  382. // return;
  383. // }
  384. function sendCode() {
  385. if (switchType.value === "Phone") {
  386. if (!phone.value) {
  387. uni.showToast({
  388. title: "请输入手机号",
  389. icon: "none",
  390. });
  391. return;
  392. }
  393. const bool = verificationPhone(country.value, phone.value);
  394. console.log("验证是否成功", bool);
  395. // 检查格式是否正确
  396. if (!bool) {
  397. uni.showToast({
  398. title: "手机号格式不正确",
  399. icon: "none",
  400. });
  401. return;
  402. }
  403. }
  404. if (switchType.value === "Email") {
  405. if (!email.value) {
  406. uni.showToast({
  407. title: "请输入邮箱地址",
  408. icon: "none",
  409. });
  410. return;
  411. }
  412. const bool = verificationEmail(email.value);
  413. console.log("验证是否成功", bool);
  414. // 检查格式是否正确
  415. if (!bool) {
  416. uni.showToast({
  417. title: "邮箱格式不正确",
  418. icon: "none",
  419. });
  420. return;
  421. }
  422. }
  423. // 如果按钮已禁用,则不执行后续逻辑
  424. if (isCodeBtnDisabled.value) return;
  425. // 设置按钮为禁用状态
  426. isCodeBtnDisabled.value = true;
  427. codeBtnText.value = "重新发送";
  428. let time = 6;
  429. const timer = setInterval(() => {
  430. time--;
  431. codeBtnText.value = "重新发送 " + time + "s";
  432. if (time <= 0) {
  433. clearInterval(timer);
  434. codeBtnText.value = "重新发送";
  435. // 倒计时结束后启用按钮
  436. isCodeBtnDisabled.value = false;
  437. }
  438. }, 1000);
  439. return;
  440. }
  441. function openAgreement() {
  442. // 打开用户协议
  443. console.log("打开用户协议");
  444. uni.navigateTo({
  445. url: "/pages/start/agreement/agreement",
  446. });
  447. }
  448. function openPrivacy() {
  449. // 打开隐私政策
  450. console.log("打开隐私政策");
  451. uni.navigateTo({
  452. url: "/pages/start/privacy/privacy",
  453. });
  454. }
  455. function changeCheckbox() {
  456. agreed.value = !agreed.value;
  457. checkboxUrl.value = agreed.value
  458. ? "../../../static/icons/Check-one-true.png"
  459. : "../../../static/icons/Check-one-false.png";
  460. }
  461. // 验证手机号是否正确
  462. function validatePhoneNumber(countryCode, phoneNumber) {
  463. // 检查是否为空
  464. if (!phoneNumber || phoneNumber.trim() === "") {
  465. uni.showToast({
  466. title: "手机号不能为空",
  467. icon: "none",
  468. });
  469. return false;
  470. }
  471. const bool = verificationPhone(countryCode, phoneNumber);
  472. console.log("验证是否成功", bool);
  473. // 检查格式是否正确
  474. if (!bool) {
  475. uni.showToast({
  476. title: "手机号格式不正确",
  477. icon: "none",
  478. });
  479. return false;
  480. }
  481. // 去掉+号后检查长度(手机号通常在7到15位之间)
  482. const cleanNumber = phoneNumber.replace(/^\+/, "");
  483. if (cleanNumber.length < 7 || cleanNumber.length > 15) {
  484. uni.showToast({
  485. title: "手机号长度不正确",
  486. icon: "none",
  487. });
  488. return false;
  489. }
  490. return true;
  491. }
  492. // 添加弹窗引用
  493. const agreementPopup = ref(null);
  494. // 处理同意按钮点击
  495. function handleAgree() {
  496. // 关闭弹窗
  497. agreementPopup.value.close();
  498. // 设置为已同意
  499. agreed.value = true;
  500. checkboxUrl.value = "../../../static/icons/Check-one-true.png";
  501. // 继续登录流程
  502. }
  503. </script>
  504. <style scoped>
  505. .login-registration-container {
  506. display: flex;
  507. flex-direction: column;
  508. align-items: center;
  509. justify-content: center;
  510. padding: 0 70rpx;
  511. height: 100vh;
  512. background-color: #ffffff;
  513. }
  514. /* 自定义导航栏样式 */
  515. .custom-navbar {
  516. position: absolute;
  517. top: 0;
  518. left: 0;
  519. /* z-index: 999; */
  520. width: 90%;
  521. height: 80rpx;
  522. display: flex;
  523. justify-content: space-between;
  524. align-items: center;
  525. padding: 10rpx 40rpx;
  526. margin-bottom: 20rpx;
  527. }
  528. .nav-left,
  529. .nav-right {
  530. flex: 1;
  531. }
  532. .nav-right {
  533. display: flex;
  534. justify-content: flex-end;
  535. }
  536. .nav-left {
  537. display: flex;
  538. justify-content: flex-start;
  539. }
  540. .icons {
  541. margin: 20rpx;
  542. width: 40rpx;
  543. height: 40rpx;
  544. /* margin-right: 10rpx; */
  545. }
  546. .back-btn,
  547. .headphone-btn {
  548. font-size: 36rpx;
  549. font-weight: bold;
  550. color: #333333;
  551. padding: 10rpx;
  552. }
  553. .logo {
  554. width: 120rpx;
  555. height: 120rpx;
  556. margin-bottom: 60rpx;
  557. border-radius: 20%;
  558. }
  559. .welcome-text {
  560. font-size: 48rpx;
  561. font-weight: bold;
  562. color: #333333;
  563. margin-bottom: 60rpx;
  564. /* text-align: left; */
  565. /* align-self: flex-start; */
  566. }
  567. .switch-container {
  568. display: flex;
  569. margin-bottom: 40rpx;
  570. align-self: flex-start;
  571. }
  572. .switch-item {
  573. font-size: 28rpx;
  574. color: #999999;
  575. padding: 10rpx 20rpx;
  576. position: relative;
  577. }
  578. .switch-item::after {
  579. content: "";
  580. position: absolute;
  581. bottom: 0;
  582. left: 50%;
  583. transform: translateX(-50%);
  584. width: 60%;
  585. /* 控制边框宽度 */
  586. height: 2rpx;
  587. background-color: transparent;
  588. }
  589. .switch-item.active {
  590. color: #333333;
  591. font-weight: 700;
  592. }
  593. .switch-item.active::after {
  594. content: "";
  595. position: absolute;
  596. top: 60rpx;
  597. bottom: 0;
  598. left: 50%;
  599. transform: translateX(-50%);
  600. width: 30%;
  601. /* 控制边框宽度 */
  602. height: 7rpx;
  603. background-color: #333333;
  604. }
  605. .input-container {
  606. width: 100%;
  607. }
  608. /* 添加图标输入框样式 */
  609. .input-with-icon {
  610. display: flex;
  611. align-items: center;
  612. width: 100%;
  613. height: 80rpx;
  614. border-bottom: 2rpx solid #e5e5e5;
  615. margin-bottom: 20rpx;
  616. }
  617. .input-icon {
  618. width: 40rpx;
  619. height: 40rpx;
  620. margin: 0 20rpx;
  621. }
  622. .input-field {
  623. flex: 1;
  624. height: 80rpx;
  625. padding: 15rpx 0;
  626. font-size: 28rpx;
  627. color: #333333;
  628. border: none;
  629. background-color: transparent;
  630. }
  631. .phone-input-container {
  632. display: flex;
  633. align-items: center;
  634. width: 95.8%;
  635. height: 80rpx;
  636. /* border-radius: 20rpx; */
  637. /* border: 2rpx solid #e5e5e5; */
  638. /* background-color: #f5f5f5; */
  639. padding: 0 10rpx;
  640. border-bottom: 2rpx solid #e5e5e5;
  641. margin-bottom: 20rpx;
  642. }
  643. .country-code-selector {
  644. display: flex;
  645. align-items: center;
  646. padding: 0 10rpx;
  647. padding-bottom: 1rpx;
  648. height: 100%;
  649. /* border-right: 2rpx solid #e5e5e5; */
  650. /* background-color: #f5f5f5; */
  651. border-radius: 20rpx 0 0 20rpx;
  652. }
  653. .country-code {
  654. font-size: 28rpx;
  655. color: #333333;
  656. margin-right: 10rpx;
  657. }
  658. .country-flag-img {
  659. width: 40rpx;
  660. height: 40rpx;
  661. margin-right: 10rpx;
  662. }
  663. .arrow-down {
  664. font-size: 20rpx;
  665. color: #999999;
  666. }
  667. .phone-input {
  668. flex: 1;
  669. width: auto;
  670. height: 100%;
  671. border: none;
  672. background-color: transparent;
  673. padding: 0 0rpx;
  674. }
  675. .send-code-btn {
  676. width: 200rpx;
  677. height: 60rpx;
  678. display: inline-flex;
  679. padding: 0rpx 10rpx;
  680. justify-content: center;
  681. align-items: center;
  682. gap: 10px;
  683. border-radius: 4px;
  684. background: #000;
  685. }
  686. .send-code-btn-email {
  687. width: 200rpx;
  688. height: 60rpx;
  689. display: inline-flex;
  690. padding: 0rpx 10rpx;
  691. justify-content: center;
  692. align-items: center;
  693. gap: 10px;
  694. border-radius: 4px;
  695. background: #000;
  696. margin-right: 15rpx;
  697. }
  698. .send-code-btn-disabled {
  699. background: #e6e6e6;
  700. /* 禁用状态下的灰色背景 */
  701. }
  702. .send-code-btn-disabled-text {
  703. color: #999999 !important;
  704. }
  705. .send-code-text {
  706. color: #fff;
  707. font-size: 28rpx;
  708. }
  709. .agreement-container-one {
  710. display: flex;
  711. align-items: center;
  712. align-self: flex-start;
  713. margin-bottom: 80rpx;
  714. }
  715. .agreement-container {
  716. display: flex;
  717. align-items: center;
  718. margin-bottom: 40rpx;
  719. margin-top: -75.5rpx;
  720. align-self: flex-start;
  721. }
  722. .checkbox {
  723. width: 30rpx;
  724. height: 30rpx;
  725. margin-left: 20rpx;
  726. /* flex: content; */
  727. }
  728. .agreement-text-one {
  729. font-size: 22rpx;
  730. color: #666666;
  731. text-align: center;
  732. margin-left: 10rpx;
  733. }
  734. .agreement-text {
  735. margin-left: 20rpx;
  736. font-size: 24rpx;
  737. color: #666666;
  738. }
  739. .link {
  740. color: #333333;
  741. font-weight: bold;
  742. text-decoration: underline;
  743. }
  744. .register-btn {
  745. width: 100%;
  746. height: 80rpx;
  747. background-color: #000000;
  748. color: white;
  749. font-size: 32rpx;
  750. font-weight: bold;
  751. border-radius: 40rpx;
  752. margin-bottom: 40rpx;
  753. }
  754. .or-text {
  755. flex-direction: column;
  756. font-size: 24rpx;
  757. color: #999999;
  758. margin-top: 294rpx;
  759. margin-bottom: -22rpx;
  760. }
  761. .to-icon {
  762. width: 10rpx;
  763. height: 16rpx;
  764. }
  765. .or-text-one {
  766. flex-direction: column;
  767. font-size: 24rpx;
  768. color: #999999;
  769. }
  770. .third-party-login {
  771. width: 100%;
  772. margin-bottom: 60rpx;
  773. }
  774. .third-party-text {
  775. color: #ffffff;
  776. font-weight: bold;
  777. white-space: pre;
  778. }
  779. .third-party-btn {
  780. width: 100%;
  781. height: 80rpx;
  782. background-color: rgb(0, 0, 0);
  783. border: 2rpx solid #e5e5e5;
  784. border-radius: 40rpx;
  785. display: flex;
  786. align-items: center;
  787. justify-content: center;
  788. margin-bottom: 20rpx;
  789. font-size: 28rpx;
  790. color: #333333;
  791. }
  792. .google-icon,
  793. .apple-icon {
  794. width: 60rpx;
  795. height: 60rpx;
  796. margin-right: 20rpx;
  797. }
  798. .existing-account {
  799. display: flex;
  800. align-items: center;
  801. }
  802. .account-text {
  803. font-size: 24rpx;
  804. color: #666666;
  805. }
  806. .login-link {
  807. font-size: 24rpx;
  808. font-weight: bold;
  809. color: #333333;
  810. margin-left: 10rpx;
  811. text-decoration: underline;
  812. }
  813. .static-footer {
  814. position: fixed;
  815. bottom: 0;
  816. }
  817. /* 弹窗样式 */
  818. .popup-content {
  819. background-color: #ffffff;
  820. padding: 40rpx;
  821. text-align: center;
  822. border-radius: 10rpx;
  823. width: 550rpx;
  824. }
  825. .popup-title {
  826. font-size: 36rpx;
  827. font-weight: bold;
  828. color: #333;
  829. margin-bottom: 80rpx;
  830. text-align: center; /* 水平居中 */
  831. display: flex; /* 使用flex布局 */
  832. justify-content: center; /* 水平居中 */
  833. align-items: center; /* 垂直居中 */
  834. }
  835. .popup-message {
  836. font-size: 28rpx;
  837. color: #000000;
  838. margin-bottom: 80rpx;
  839. text-align: center; /* 水平居中 */
  840. display: flex; /* 使用flex布局 */
  841. justify-content: center; /* 水平居中 */
  842. align-items: center; /* 垂直居中 */
  843. }
  844. .agree-button {
  845. width: 300rpx;
  846. height: 80rpx;
  847. background-color: #000000;
  848. border-radius: 40rpx;
  849. display: flex; /* 添加flex布局 */
  850. align-items: center; /* 垂直居中 */
  851. justify-content: center; /* 水平居中 */
  852. }
  853. .agree-text {
  854. color: #ffffff;
  855. font-size: 34rpx;
  856. /* 添加垂直居中相关样式 */
  857. display: flex;
  858. align-items: center;
  859. justify-content: center;
  860. line-height: 1; /* 确保文字垂直居中 */
  861. }
  862. .switch-container-occupy {
  863. margin-top: 100rpx;
  864. }
  865. </style>