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.

1211 lines
26 KiB

4 weeks ago
4 weeks 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. @click="goToService"
  14. class="icons"
  15. src="../../../static/icons/Headset.png"
  16. alt="联系客服"
  17. />
  18. <image
  19. class="icons"
  20. @click="goToIndex"
  21. src="../../../static/icons/Frame.png"
  22. alt="返回首页"
  23. />
  24. </view>
  25. </view>
  26. <!-- Logo -->
  27. <!-- <image class="logo" src="/static/logo.png" mode="aspectFit"></image> -->
  28. <!-- 欢迎语 -->
  29. <text class="welcome-text">登录DeepChart</text>
  30. <!-- 邮箱/手机号切换 -->
  31. <view class="switch-container">
  32. <text
  33. class="switch-item"
  34. :class="{ active: switchType === 'User' }"
  35. @click="switchUser"
  36. >用户名</text
  37. >
  38. <text
  39. class="switch-item"
  40. :class="{ active: switchType === 'Phone' }"
  41. @click="switchPhone"
  42. >手机号</text
  43. ><text
  44. class="switch-item"
  45. :class="{ active: switchType === 'Email' }"
  46. @click="switchEmail"
  47. >邮箱</text
  48. >
  49. </view>
  50. <!-- 输入框 -->
  51. <view class="input-container">
  52. <view v-if="switchType === 'User'">
  53. <!-- 修改邮箱输入框容器将图标包含在内 -->
  54. <view class="input-with-icon">
  55. <image
  56. class="input-icon"
  57. src="../../../static/icons/People-safe.png"
  58. alt=""
  59. />
  60. <input
  61. class="input-field"
  62. type="text"
  63. placeholder="请输入DeepChart ID"
  64. v-model="deepChartID"
  65. />
  66. </view>
  67. <view class="input-with-icon">
  68. <image
  69. class="input-icon"
  70. src="../../../static/icons/Unlock.png"
  71. alt=""
  72. />
  73. <input
  74. class="input-field"
  75. type="text"
  76. placeholder="请输入密码"
  77. v-model="password"
  78. />
  79. </view>
  80. </view>
  81. <view v-if="switchType === 'Email'">
  82. <!-- 修改邮箱输入框容器将图标包含在内 -->
  83. <view class="input-with-icon">
  84. <image
  85. class="input-icon"
  86. src="../../../static/icons/Mail.png"
  87. alt=""
  88. />
  89. <input
  90. class="input-field"
  91. type="text"
  92. placeholder="请输入邮箱"
  93. v-model="email"
  94. />
  95. <view>
  96. <button
  97. class="send-code-btn-email"
  98. :disabled="isCodeBtnDisabled"
  99. :class="{ 'send-code-btn-disabled': isCodeBtnDisabled }"
  100. @click="sendCode"
  101. >
  102. <text
  103. class="send-code-text"
  104. :class="{ 'send-code-btn-disabled-text': isCodeBtnDisabled }"
  105. >{{ codeBtnText }}</text
  106. >
  107. </button>
  108. </view>
  109. </view>
  110. <view class="input-with-icon">
  111. <image
  112. class="input-icon"
  113. src="../../../static/icons/Text-recognition.png"
  114. alt=""
  115. />
  116. <input
  117. class="input-field"
  118. type="text"
  119. placeholder="请输入验证码"
  120. v-model="verifyCode"
  121. />
  122. </view>
  123. </view>
  124. <view v-if="switchType === 'Phone'" class="phone-input-container">
  125. <view class="country-code-selector" @click="showCountryPicker">
  126. <image
  127. class="country-flag-img"
  128. src="../../../static/icons/Iphone.png"
  129. mode="aspectFit"
  130. ></image>
  131. <text class="country-code">{{ selectedCountry.code }}</text>
  132. <!-- <text class="arrow-down"></text> -->
  133. </view>
  134. <input
  135. class="input-field phone-input"
  136. type="number"
  137. placeholder="输入手机号"
  138. v-model="phone"
  139. @input="onPhoneInput"
  140. />
  141. <view>
  142. <button
  143. class="send-code-btn"
  144. :disabled="isCodeBtnDisabled"
  145. :class="{ 'send-code-btn-disabled': isCodeBtnDisabled }"
  146. @click="sendCode"
  147. >
  148. <text
  149. class="send-code-text"
  150. :class="{ 'send-code-btn-disabled-text': isCodeBtnDisabled }"
  151. >{{ codeBtnText }}</text
  152. >
  153. </button>
  154. </view>
  155. </view>
  156. <view v-if="switchType === 'Phone'" class="input-with-icon">
  157. <image
  158. class="input-icon"
  159. src="../../../static/icons/Text-recognition.png"
  160. alt=""
  161. />
  162. <input
  163. class="input-field"
  164. type="text"
  165. placeholder="请输入验证码"
  166. v-model="verifyCode"
  167. />
  168. </view>
  169. </view>
  170. <!-- 用户协议 -->
  171. <view @click="changeCheckbox" class="agreement-container-one">
  172. <image class="checkbox" :src="checkboxUrl"></image>
  173. <text class="agreement-text-one"
  174. >接受 <text class="link" @click="openAgreement">用户协议</text>
  175. <text class="link" @click="openPrivacy">隐私政策</text></text
  176. >
  177. </view>
  178. <view v-if="switchType === 'User'" class="agreement-container">
  179. <text class="agreement-text"
  180. ><text @click="recoverPassword">忘记ID/密码</text>
  181. </text>
  182. </view>
  183. <view v-else class="agreement-container">
  184. <text class="agreement-text">
  185. <!-- 添加占位元素防止页面变形 -->
  186. <text style="visibility: hidden">占位符</text>
  187. </text>
  188. </view>
  189. <!-- 注册按钮 -->
  190. <button class="register-btn" @click="Login">
  191. <text v-if="!isLoading">登录</text>
  192. <image
  193. v-else
  194. class="icons-rotation"
  195. src="../../../static/icons/loading.png"
  196. ></image>
  197. </button>
  198. <!-- 或者 -->
  199. <text class="or-text" @click="goToRegistration"
  200. >如果您还没有账号点击注册
  201. <image class="to-icon" src="../../../static/icons/To.png"></image>
  202. </text>
  203. <!-- 第三方登录 -->
  204. <view class="third-party-login">
  205. <view
  206. v-if="isAppleDevice"
  207. class="third-party-btn"
  208. @click="loginWithApple"
  209. >
  210. <image
  211. class="apple-icon"
  212. src="../../../static/icons/appleIcons.png"
  213. mode="aspectFit"
  214. ></image>
  215. <text class="third-party-text">通过 Apple 登录 </text>
  216. </view>
  217. <view class="third-party-btn" @click="loginWithGoogle">
  218. <image
  219. class="google-icon"
  220. src="../../../static/icons/GoogleIcons.png"
  221. mode="aspectFit"
  222. ></image>
  223. <text class="third-party-text">通过 Google 登录</text>
  224. </view>
  225. </view>
  226. <!-- 同意弹窗 -->
  227. <uniPopup ref="agreementPopup" type="dialog">
  228. <view class="popup-content">
  229. <text class="popup-message"
  230. >请阅读并同意<text @click="openAgreement" class="popup-message-link"
  231. >服务协议</text
  232. ><text @click="openPrivacy" class="popup-message-link"
  233. >隐私权限</text
  234. >
  235. </text>
  236. <view class="button-group">
  237. <button class="cancel-button" @click="handleCancel">
  238. <text class="cancel-text">取消</text>
  239. </button>
  240. <button class="agree-button" @click="handleAgree">
  241. <text class="agree-text">同意</text>
  242. </button>
  243. </view>
  244. </view>
  245. </uniPopup>
  246. <footerBar class="static-footer" :type="type"></footerBar>
  247. </view>
  248. </template>
  249. <script setup>
  250. import { computed, ref } from "vue";
  251. // 导入完整的国家列表
  252. import countryList from "./list.js";
  253. import footerBar from "../../../components/footerBar";
  254. import uniPopupDialogVue from "../../../uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog.vue";
  255. import uniPopup from "../../../uni_modules/uni-popup/components/uni-popup/uni-popup.vue";
  256. import { verificationPhone, verificationEmail } from "../login/verification";
  257. import {
  258. LoginApi,
  259. SendEmailCodeApi,
  260. SendPhoneCodeApi,
  261. } from "../../../api/start/login";
  262. import { useUserStore } from "../../../stores/modules/userInfo";
  263. import { useDeviceStore } from "../../../stores/modules/deviceInfo";
  264. const deepChartID = ref("");
  265. const type = ref("");
  266. const email = ref("");
  267. const password = ref("");
  268. const country = ref("+86");
  269. const phone = ref("");
  270. const agreed = ref(false);
  271. const switchType = ref("User"); // 默认是邮箱注册
  272. const { safeAreaInsets } = uni.getSystemInfoSync();
  273. const codeBtnText = ref("获取验证码");
  274. const isCodeBtnDisabled = ref(false); // 添加验证码按钮禁用状态
  275. const checkboxUrl = ref("../../../static/icons/Check-one-false.png");
  276. const verifyCode = ref("");
  277. const account = ref("");
  278. const isLoading = ref(false);
  279. const deviceStore = useDeviceStore();
  280. const isAppleDevice = computed(() => {
  281. if (deviceStore.deviceInfo.brand) {
  282. return deviceStore.deviceInfo.brand.toLowerCase() === "apple";
  283. }
  284. if (deviceStore.deviceInfo.system) {
  285. return deviceStore.deviceInfo.system.includes("ios");
  286. }
  287. return false;
  288. });
  289. // 使用从list.js导入的完整国家列表数据
  290. const countries = ref(
  291. countryList.list.map((item) => ({
  292. name: item.name,
  293. code: `+${item.tel}`,
  294. flag: item.flag,
  295. short: item.short,
  296. en: item.en,
  297. }))
  298. );
  299. // 默认选中的国家(中国)
  300. const selectedCountry = ref(
  301. countries.value.find((country) => country.short === "CN") ||
  302. countries.value[0]
  303. );
  304. // 显示国家选择器
  305. function showCountryPicker() {
  306. uni.showActionSheet({
  307. itemList: countries.value.map(
  308. (country) => `${country.name} ${country.code}`
  309. ),
  310. success: function (res) {
  311. selectedCountry.value = countries.value[res.tapIndex];
  312. country.value = selectedCountry.value.code;
  313. },
  314. });
  315. }
  316. function goToIndex() {
  317. // 返回上一页
  318. uni.navigateTo({
  319. url: "/pages/home/home",
  320. });
  321. }
  322. function goToService() {
  323. // 返回上一页
  324. uni.navigateTo({
  325. url: "/pages/customerServicePlatform/csPlatformIndex",
  326. });
  327. }
  328. function switchUser() {
  329. // 切换到手机注册
  330. switchType.value = "User";
  331. password.value = "";
  332. verifyCode.value = "";
  333. }
  334. function switchEmail() {
  335. // 切换到邮箱注册
  336. switchType.value = "Email";
  337. password.value = "";
  338. verifyCode.value = "";
  339. }
  340. function switchPhone() {
  341. // 切换到手机注册
  342. switchType.value = "Phone";
  343. password.value = "";
  344. verifyCode.value = "";
  345. }
  346. // 登录
  347. async function Login() {
  348. if (!basicVerification()) {
  349. return;
  350. }
  351. const account = changeAccount();
  352. const loginType = changeLoginType();
  353. isLoading.value = true;
  354. const res = await LoginApi({
  355. loginType: loginType,
  356. account: account,
  357. verifyCode: verifyCode.value,
  358. password: password.value,
  359. useCode: verifyCode.value ? true : false,
  360. idToken: "",
  361. deviceId: deviceStore.deviceInfo.deviceId,
  362. });
  363. isLoading.value = false;
  364. const message = res.message;
  365. if (res.code === 200) {
  366. // 登录成功
  367. uni.showToast({
  368. title: "登录成功",
  369. icon: "success",
  370. });
  371. const userStore = useUserStore();
  372. userStore.setUserInfo(res.data);
  373. console.log("userInfo为", userStore.userInfo);
  374. // 跳转到首页
  375. uni.redirectTo({
  376. url: "/pages/home/home",
  377. });
  378. } else {
  379. // 登录失败
  380. uni.showToast({
  381. title: message,
  382. icon: "none",
  383. });
  384. }
  385. }
  386. // 基础验证
  387. function basicVerification() {
  388. if (switchType.value === "User") {
  389. if (!deepChartID.value) {
  390. uni.showToast({
  391. title: "请输入用户名",
  392. icon: "none",
  393. });
  394. return false;
  395. }
  396. if (!password.value) {
  397. uni.showToast({
  398. title: "请输入密码",
  399. icon: "none",
  400. });
  401. return false;
  402. }
  403. }
  404. if (switchType.value === "Phone") {
  405. // 登录逻辑
  406. if (!phone.value) {
  407. uni.showToast({
  408. title: "请输入手机号码",
  409. icon: "none",
  410. });
  411. return false;
  412. }
  413. const phoneAll = `${country.value}${phone.value}`;
  414. console.log("完整手机号" + phoneAll);
  415. if (!validatePhoneNumber(country.value, phone.value)) {
  416. return false;
  417. }
  418. if (!verifyCode.value) {
  419. uni.showToast({
  420. title: "请输入验证码",
  421. icon: "none",
  422. });
  423. return false;
  424. }
  425. }
  426. if (switchType.value === "Email") {
  427. // 登录逻辑
  428. if (!email.value) {
  429. uni.showToast({
  430. title: "请输入邮箱地址",
  431. icon: "none",
  432. });
  433. return false;
  434. }
  435. const bool = verificationEmail(email.value);
  436. console.log("验证是否成功", bool);
  437. // 检查格式是否正确
  438. if (!bool) {
  439. uni.showToast({
  440. title: "邮箱格式不正确",
  441. icon: "none",
  442. });
  443. return false;
  444. }
  445. if (!verifyCode.value) {
  446. uni.showToast({
  447. title: "请输入验证码",
  448. icon: "none",
  449. });
  450. return false;
  451. }
  452. }
  453. if (!agreed.value) {
  454. // 显示同意弹窗
  455. agreementPopup.value.open();
  456. return;
  457. }
  458. return true;
  459. }
  460. // 注册码码验证
  461. function VerCodeVerfifcation() {
  462. if (switchType.value === "Phone") {
  463. if (!phone.value) {
  464. uni.showToast({
  465. title: "请输入手机号",
  466. icon: "none",
  467. });
  468. return false;
  469. }
  470. const bool = verificationPhone(country.value, phone.value);
  471. console.log("验证是否成功", bool);
  472. // 检查格式是否正确
  473. if (!bool) {
  474. uni.showToast({
  475. title: "手机号格式不正确",
  476. icon: "none",
  477. });
  478. return false;
  479. }
  480. }
  481. if (switchType.value === "Email") {
  482. if (!email.value) {
  483. uni.showToast({
  484. title: "请输入邮箱地址",
  485. icon: "none",
  486. });
  487. return false;
  488. }
  489. const bool = verificationEmail(email.value);
  490. console.log("验证是否成功", bool);
  491. // 检查格式是否正确
  492. if (!bool) {
  493. uni.showToast({
  494. title: "邮箱格式不正确",
  495. icon: "none",
  496. });
  497. return false;
  498. }
  499. }
  500. return true;
  501. }
  502. // 请求账户
  503. function changeAccount() {
  504. if (switchType.value === "User") {
  505. account.value = deepChartID.value;
  506. }
  507. if (switchType.value === "Phone") {
  508. account.value = `${country.value}-${phone.value}`;
  509. }
  510. if (switchType.value === "Email") {
  511. account.value = email.value;
  512. }
  513. return account.value;
  514. }
  515. // 改变请求时的type
  516. function changeLoginType() {
  517. if (switchType.value === "User") {
  518. return "DCCODE";
  519. }
  520. if (switchType.value === "Phone") {
  521. return "PHONE";
  522. }
  523. if (switchType.value === "Email") {
  524. return "EMAIL";
  525. }
  526. }
  527. // 添加弹窗引用
  528. const agreementPopup = ref(null);
  529. // 处理同意按钮点击
  530. function handleAgree() {
  531. // 关闭弹窗
  532. agreementPopup.value.close();
  533. // 设置为已同意
  534. agreed.value = true;
  535. checkboxUrl.value = "../../../static/icons/Check-one-true.png";
  536. // 继续登录流程
  537. }
  538. // 处理同意按钮点击
  539. function handleCancel() {
  540. // 关闭弹窗
  541. agreementPopup.value.close();
  542. }
  543. // 苹果登录
  544. function loginWithApple() {
  545. // Apple登录逻辑
  546. console.log("通过Apple登录");
  547. uni.login({
  548. provider: "apple",
  549. success: function (loginRes) {
  550. // 登录成功
  551. uni.getUserInfo({
  552. provider: "apple",
  553. success: function (info) {
  554. console.log(info);
  555. },
  556. });
  557. },
  558. fail: function (err) {
  559. // 登录授权失败
  560. // err.code错误码参考`授权失败错误码(code)说明`
  561. console.log(err);
  562. },
  563. });
  564. }
  565. // 谷歌登录
  566. function loginWithGoogle() {
  567. // Google登录逻辑
  568. console.log("通过Google登录");
  569. uni.login({
  570. provider: "google",
  571. success: function (loginRes) {
  572. // 登录成功
  573. uni.getUserInfo({
  574. provider: "google",
  575. success: function (info) {
  576. console.log(info);
  577. },
  578. });
  579. },
  580. fail: function (err) {
  581. // 登录授权失败
  582. // err.code是错误码
  583. console.log(err);
  584. },
  585. });
  586. }
  587. function goToRegistration() {
  588. // 跳转到登录页
  589. uni.navigateTo({
  590. url: "/pages/start/Registration/Registration",
  591. });
  592. }
  593. function onPhoneInput(e) {
  594. // 确保只允许输入数字
  595. const value = e.detail.value;
  596. // 使用 isNaN 检查是否为有效数字
  597. if (isNaN(value)) {
  598. phone.value = "";
  599. } else {
  600. phone.value = value;
  601. }
  602. }
  603. // 发送验证码
  604. async function sendCode() {
  605. if (!VerCodeVerfifcation()) {
  606. return;
  607. }
  608. // 如果按钮已禁用,则不执行后续逻辑
  609. if (isCodeBtnDisabled.value) return;
  610. if (switchType.value === "Phone") {
  611. // 发送验证码
  612. const phoneAll = `${country.value}-${phone.value}`;
  613. const res = await SendPhoneCodeApi({
  614. phone: phoneAll,
  615. });
  616. console.log("手机验证码:", res.message);
  617. if (!res) {
  618. uni.showToast({
  619. title: "请求失败",
  620. icon: "none",
  621. });
  622. }
  623. }
  624. if (switchType.value === "Email") {
  625. // 发送验证码
  626. const res = await SendEmailCodeApi({
  627. email: email.value,
  628. });
  629. console.log("邮箱验证码:", res.message);
  630. if (!res) {
  631. uni.showToast({
  632. title: "请求失败",
  633. icon: "none",
  634. });
  635. }
  636. }
  637. // 设置按钮为禁用状态
  638. isCodeBtnDisabled.value = true;
  639. codeBtnText.value = "重新发送";
  640. let time = 6;
  641. const timer = setInterval(() => {
  642. time--;
  643. codeBtnText.value = "重新发送 " + time + "s";
  644. if (time <= 0) {
  645. clearInterval(timer);
  646. codeBtnText.value = "重新发送";
  647. // 倒计时结束后启用按钮
  648. isCodeBtnDisabled.value = false;
  649. }
  650. }, 1000);
  651. return;
  652. }
  653. function openAgreement() {
  654. // 打开用户协议
  655. console.log("打开用户协议");
  656. uni.navigateTo({
  657. url: "/pages/start/agreement/agreement",
  658. });
  659. }
  660. function openPrivacy() {
  661. // 打开隐私政策
  662. console.log("打开隐私政策");
  663. uni.navigateTo({
  664. url: "/pages/start/privacy/privacy",
  665. });
  666. }
  667. function recoverPassword() {
  668. // 忘记密码
  669. // console.log("忘记密码");
  670. uni.navigateTo({
  671. url: "/pages/start/recoverPassword/recoverPassword",
  672. });
  673. }
  674. function changeCheckbox() {
  675. agreed.value = !agreed.value;
  676. checkboxUrl.value = agreed.value
  677. ? "../../../static/icons/Check-one-true.png"
  678. : "../../../static/icons/Check-one-false.png";
  679. }
  680. // 验证手机号是否正确
  681. function validatePhoneNumber(countryCode, phoneNumber) {
  682. // 检查是否为空
  683. if (!phoneNumber || phoneNumber.trim() === "") {
  684. uni.showToast({
  685. title: "手机号不能为空",
  686. icon: "none",
  687. });
  688. return false;
  689. }
  690. const bool = verificationPhone(countryCode, phoneNumber);
  691. console.log("验证是否成功", bool);
  692. // 检查格式是否正确
  693. if (!bool) {
  694. uni.showToast({
  695. title: "手机号格式不正确",
  696. icon: "none",
  697. });
  698. return false;
  699. }
  700. // 去掉+号后检查长度(手机号通常在7到15位之间)
  701. const cleanNumber = phoneNumber.replace(/^\+/, "");
  702. if (cleanNumber.length < 7 || cleanNumber.length > 15) {
  703. uni.showToast({
  704. title: "手机号长度不正确",
  705. icon: "none",
  706. });
  707. return false;
  708. }
  709. return true;
  710. }
  711. </script>
  712. <style scoped>
  713. .login-registration-container {
  714. display: flex;
  715. flex-direction: column;
  716. align-items: center;
  717. justify-content: center;
  718. padding: 0 70rpx;
  719. height: 100vh;
  720. background-color: #ffffff;
  721. }
  722. /* 自定义导航栏样式 */
  723. .custom-navbar {
  724. position: absolute;
  725. top: 0;
  726. left: 0;
  727. /* z-index: 999; */
  728. width: 90%;
  729. height: 80rpx;
  730. display: flex;
  731. justify-content: space-between;
  732. align-items: center;
  733. padding: 10rpx 40rpx;
  734. margin-bottom: 20rpx;
  735. }
  736. .nav-left,
  737. .nav-right {
  738. flex: 1;
  739. }
  740. .nav-right {
  741. display: flex;
  742. justify-content: flex-end;
  743. }
  744. .icons {
  745. margin: 20rpx;
  746. width: 40rpx;
  747. height: 40rpx;
  748. /* margin-right: 10rpx; */
  749. }
  750. .icons-rotation {
  751. margin: 20rpx;
  752. width: 40rpx;
  753. height: 40rpx;
  754. /* margin-right: 10rpx; */
  755. animation: rotation 2s linear infinite;
  756. }
  757. @keyframes rotation {
  758. from {
  759. transform: rotate(0deg);
  760. }
  761. to {
  762. transform: rotate(360deg);
  763. }
  764. }
  765. .back-btn,
  766. .headphone-btn {
  767. font-size: 36rpx;
  768. font-weight: bold;
  769. color: #333333;
  770. padding: 10rpx;
  771. }
  772. .logo {
  773. width: 120rpx;
  774. height: 120rpx;
  775. margin-bottom: 60rpx;
  776. border-radius: 20%;
  777. }
  778. .welcome-text {
  779. font-size: 48rpx;
  780. font-weight: bold;
  781. color: #333333;
  782. margin-bottom: 60rpx;
  783. /* text-align: left; */
  784. /* align-self: flex-start; */
  785. }
  786. .switch-container {
  787. display: flex;
  788. margin-bottom: 40rpx;
  789. align-self: flex-start;
  790. }
  791. .switch-item {
  792. font-size: 28rpx;
  793. color: #999999;
  794. padding: 10rpx 20rpx;
  795. position: relative;
  796. }
  797. .switch-item::after {
  798. content: "";
  799. position: absolute;
  800. bottom: 0;
  801. left: 50%;
  802. transform: translateX(-50%);
  803. width: 60%;
  804. /* 控制边框宽度 */
  805. height: 2rpx;
  806. background-color: transparent;
  807. }
  808. .switch-item.active {
  809. color: #333333;
  810. font-weight: 700;
  811. }
  812. .switch-item.active::after {
  813. content: "";
  814. position: absolute;
  815. top: 60rpx;
  816. bottom: 0;
  817. left: 50%;
  818. transform: translateX(-50%);
  819. width: 30%;
  820. /* 控制边框宽度 */
  821. height: 7rpx;
  822. background-color: #333333;
  823. }
  824. .input-container {
  825. width: 100%;
  826. }
  827. /* 添加图标输入框样式 */
  828. .input-with-icon {
  829. display: flex;
  830. align-items: center;
  831. width: 100%;
  832. height: 80rpx;
  833. border-bottom: 2rpx solid #e5e5e5;
  834. margin-bottom: 20rpx;
  835. }
  836. .input-icon {
  837. width: 40rpx;
  838. height: 40rpx;
  839. margin: 0 20rpx;
  840. }
  841. .input-field {
  842. flex: 1;
  843. height: 80rpx;
  844. padding: 15rpx 0;
  845. font-size: 28rpx;
  846. color: #333333;
  847. border: none;
  848. background-color: transparent;
  849. }
  850. .phone-input-container {
  851. display: flex;
  852. align-items: center;
  853. width: 95.8%;
  854. height: 80rpx;
  855. /* border-radius: 20rpx; */
  856. /* border: 2rpx solid #e5e5e5; */
  857. /* background-color: #f5f5f5; */
  858. padding: 0 10rpx;
  859. border-bottom: 2rpx solid #e5e5e5;
  860. margin-bottom: 20rpx;
  861. }
  862. .country-code-selector {
  863. display: flex;
  864. align-items: center;
  865. padding: 0 10rpx;
  866. padding-bottom: 1rpx;
  867. height: 100%;
  868. /* border-right: 2rpx solid #e5e5e5; */
  869. /* background-color: #f5f5f5; */
  870. border-radius: 20rpx 0 0 20rpx;
  871. }
  872. .country-code {
  873. font-size: 28rpx;
  874. color: #333333;
  875. margin-right: 10rpx;
  876. }
  877. .country-flag-img {
  878. width: 40rpx;
  879. height: 40rpx;
  880. margin-right: 10rpx;
  881. }
  882. .arrow-down {
  883. font-size: 20rpx;
  884. color: #999999;
  885. }
  886. .phone-input {
  887. flex: 1;
  888. width: auto;
  889. height: 100%;
  890. border: none;
  891. background-color: transparent;
  892. padding: 0 0rpx;
  893. }
  894. .send-code-btn {
  895. width: 200rpx;
  896. height: 60rpx;
  897. display: inline-flex;
  898. padding: 0rpx 10rpx;
  899. justify-content: center;
  900. align-items: center;
  901. gap: 10px;
  902. border-radius: 4px;
  903. background: #000;
  904. }
  905. .send-code-btn-email {
  906. width: 200rpx;
  907. height: 60rpx;
  908. display: inline-flex;
  909. padding: 0rpx 10rpx;
  910. justify-content: center;
  911. align-items: center;
  912. gap: 10px;
  913. border-radius: 4px;
  914. background: #000;
  915. margin-right: 15rpx;
  916. }
  917. .send-code-btn-disabled {
  918. background: #e6e6e6;
  919. /* 禁用状态下的灰色背景 */
  920. }
  921. .send-code-btn-disabled-text {
  922. color: #999999 !important;
  923. }
  924. .send-code-text {
  925. color: #fff;
  926. font-size: 28rpx;
  927. }
  928. .agreement-container-one {
  929. display: flex;
  930. align-items: center;
  931. align-self: flex-start;
  932. margin-bottom: 80rpx;
  933. }
  934. .agreement-container {
  935. display: flex;
  936. align-items: center;
  937. margin-bottom: 30rpx;
  938. margin-top: -60rpx;
  939. align-self: flex-start;
  940. }
  941. .checkbox {
  942. width: 30rpx;
  943. height: 30rpx;
  944. margin-left: 20rpx;
  945. /* flex: content; */
  946. }
  947. .agreement-text-one {
  948. font-size: 22rpx;
  949. color: #666666;
  950. text-align: center;
  951. margin-left: 10rpx;
  952. }
  953. .agreement-text {
  954. margin-left: 20rpx;
  955. font-size: 24rpx;
  956. color: #666666;
  957. white-space: nowrap;
  958. }
  959. .link {
  960. color: #333333;
  961. font-weight: bold;
  962. text-decoration: underline;
  963. }
  964. .register-btn {
  965. width: 100%;
  966. height: 80rpx;
  967. background-color: #000000;
  968. color: white;
  969. font-size: 32rpx;
  970. font-weight: bold;
  971. border-radius: 40rpx;
  972. margin-bottom: 40rpx;
  973. }
  974. .or-text {
  975. font-size: 24rpx;
  976. color: #999999;
  977. margin-bottom: 40rpx;
  978. }
  979. .to-icon {
  980. width: 10rpx;
  981. height: 16rpx;
  982. }
  983. .third-party-login {
  984. width: 100%;
  985. margin-bottom: 60rpx;
  986. }
  987. .third-party-text {
  988. color: #ffffff;
  989. font-weight: bold;
  990. white-space: pre;
  991. }
  992. .third-party-btn {
  993. width: 100%;
  994. height: 80rpx;
  995. background-color: rgb(0, 0, 0);
  996. border: 2rpx solid #e5e5e5;
  997. border-radius: 40rpx;
  998. display: flex;
  999. align-items: center;
  1000. justify-content: center;
  1001. margin-bottom: 20rpx;
  1002. font-size: 28rpx;
  1003. color: #333333;
  1004. }
  1005. .google-icon,
  1006. .apple-icon {
  1007. width: 60rpx;
  1008. height: 60rpx;
  1009. margin-right: 20rpx;
  1010. }
  1011. .existing-account {
  1012. display: flex;
  1013. align-items: center;
  1014. }
  1015. .account-text {
  1016. font-size: 24rpx;
  1017. color: #666666;
  1018. }
  1019. .login-link {
  1020. font-size: 24rpx;
  1021. font-weight: bold;
  1022. color: #333333;
  1023. margin-left: 10rpx;
  1024. text-decoration: underline;
  1025. }
  1026. .static-footer {
  1027. position: fixed;
  1028. bottom: 0;
  1029. }
  1030. /* 弹窗样式 */
  1031. .popup-content {
  1032. background-color: #ffffff;
  1033. padding: 40rpx;
  1034. text-align: center;
  1035. border-radius: 10rpx;
  1036. width: 550rpx;
  1037. }
  1038. .popup-message {
  1039. font-size: 28rpx;
  1040. color: #000000;
  1041. margin-bottom: 60rpx;
  1042. margin-top: 20rpx;
  1043. text-align: center; /* 水平居中 */
  1044. display: flex; /* 使用flex布局 */
  1045. justify-content: center; /* 水平居中 */
  1046. align-items: center; /* 垂直居中 */
  1047. font-weight: 300;
  1048. }
  1049. .popup-message-link {
  1050. font-weight: 700;
  1051. }
  1052. .button-group {
  1053. display: flex;
  1054. justify-content: space-around;
  1055. }
  1056. .agree-button {
  1057. width: 160rpx;
  1058. height: 56rpx;
  1059. background-color: #000000;
  1060. border-radius: 40rpx;
  1061. display: flex; /* 添加flex布局 */
  1062. align-items: center; /* 垂直居中 */
  1063. justify-content: center; /* 水平居中 */
  1064. }
  1065. .agree-text {
  1066. color: #ffffff;
  1067. font-size: 34rpx;
  1068. /* 添加垂直居中相关样式 */
  1069. display: flex;
  1070. align-items: center;
  1071. justify-content: center;
  1072. line-height: 1; /* 确保文字垂直居中 */
  1073. }
  1074. .cancel-button {
  1075. width: 160rpx;
  1076. height: 56rpx;
  1077. background-color: #e5e5e5;
  1078. border-radius: 40rpx;
  1079. display: flex; /* 添加flex布局 */
  1080. align-items: center; /* 垂直居中 */
  1081. justify-content: center; /* 水平居中 */
  1082. }
  1083. .cancel-text {
  1084. color: #333333;
  1085. font-size: 34rpx;
  1086. /* 添加垂直居中相关样式 */
  1087. display: flex;
  1088. align-items: center;
  1089. justify-content: center;
  1090. line-height: 1; /* 确保文字垂直居中 */
  1091. }
  1092. </style>