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.

948 lines
20 KiB

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