index.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801
  1. <template>
  2. <view class="login-page">
  3. <view class="brand-area">
  4. <image class="logo" src="/static/logo.png" mode="aspectFit" />
  5. <text class="brand-title">小鹅通</text>
  6. <view class="slogan-area">
  7. <text class="slogan">让知识创造价值</text>
  8. <view class="slogan-underline"></view>
  9. </view>
  10. </view>
  11. <view class="phone-area">
  12. <!-- <text class="phone">199****4261</text>
  13. <text class="carrier">号码认证由中国电信提供</text> -->
  14. </view>
  15. <!-- <button class="main-btn login-btn" :disabled="!agreed" @tap="handleLogin">一键登录</button> -->
  16. <button class="main-btn wechat-btn" :disabled="!agreed" @tap="socialLogin('wechat')">
  17. <image class="wechat-icon" src="/static/wechat.png" /> 微信登录
  18. </button>
  19. <view class="protocol-area">
  20. <checkbox :checked="agreed" @tap="agreed = !agreed" color="#2979ff" />
  21. <text class="protocol-text">
  22. 我已阅读并同意
  23. <text class="link" @tap="openProtocol('service')">《服务协议》</text>、
  24. <text class="link" @tap="openProtocol('privacy')">《隐私政策》</text>
  25. </text>
  26. </view>
  27. <view class="other-login">
  28. <text class="other-title">其他方式登录</text>
  29. <view class="other-icons">
  30. <view @tap="showLoginPopup = true">
  31. <image class="icon" src="/static/phone.png" />
  32. </view>
  33. <view >
  34. <image class="icon" src="/static/qq.png" />
  35. </view>
  36. </view>
  37. </view>
  38. <!-- 登录弹窗 -->
  39. <view v-if="showLoginPopup" class="popup-mask">
  40. <view class="popup-box">
  41. <text class="close-btn" @tap="showLoginPopup = false">×</text>
  42. <view class="popup-title">登录</view>
  43. <view class="popup-tabs">
  44. <text :class="{active: loginTab==='phone'}" @tap="loginTab='phone'">手机号登录</text>
  45. <text :class="{active: loginTab==='account'}" @tap="loginTab='account'">账号密码登录</text>
  46. </view>
  47. <view v-if="loginTab==='phone'">
  48. <view class="input-row">
  49. <input v-model="loginPhone" placeholder="请输入手机号" />
  50. </view>
  51. <view class="input-row code-row">
  52. <input v-model="loginCode" placeholder="请输入验证码" />
  53. <button class="code-btn" :disabled="loginCodeCountdown > 0" @tap="getLoginCode">
  54. {{ loginCodeCountdown > 0 ? loginCodeCountdown + 's' : '获取验证码' }}
  55. </button>
  56. </view>
  57. </view>
  58. <view v-else>
  59. <view class="input-row">
  60. <input v-model="loginAccount" placeholder="请输入账号" />
  61. </view>
  62. <view class="input-row">
  63. <input v-model="loginPassword" type="password" password placeholder="请输入密码" />
  64. </view>
  65. </view>
  66. <button class="main-btn popup-login-btn" @tap="handlePopupLogin">登录</button>
  67. <view class="popup-footer">
  68. <text @tap="openRegister">去注册</text>
  69. </view>
  70. </view>
  71. </view>
  72. <!-- 注册弹窗 -->
  73. <view v-if="showRegisterPopup" class="popup-mask">
  74. <view class="popup-box">
  75. <text class="close-btn" @tap="showRegisterPopup = false">×</text>
  76. <view class="popup-title">注册</view>
  77. <view class="input-row">
  78. <input v-model="regPhone" placeholder="请输入手机号" />
  79. </view>
  80. <view class="input-row code-row">
  81. <input v-model="regCode" placeholder="请输入验证码" />
  82. <button class="code-btn" @tap="getRegCode">
  83. {{ regCodeCountdown > 0 ? regCodeCountdown + 's' : '获取验证码' }}
  84. </button>
  85. </view>
  86. <view class="input-row">
  87. <input v-model="regAccount" placeholder="请输入账号" />
  88. </view>
  89. <view class="input-row">
  90. <input v-model="regPassword" type="password" placeholder="请输入密码" />
  91. </view>
  92. <button class="main-btn popup-login-btn" @tap="handleRegister">注册</button>
  93. </view>
  94. </view>
  95. </view>
  96. </template>
  97. <script setup>
  98. import { ref, onUnmounted } from 'vue'
  99. const agreed = ref(false)
  100. const showLoginPopup = ref(false)
  101. const showRegisterPopup = ref(false)
  102. const loginTab = ref('phone')
  103. const loginPhone = ref('')
  104. const loginCode = ref('')
  105. const loginAccount = ref('')
  106. const loginPassword = ref('')
  107. const regPhone = ref('')
  108. const regCode = ref('')
  109. const regAccount = ref('')
  110. const regPassword = ref('')
  111. const loginCodeCountdown = ref(0)
  112. const regCodeCountdown = ref(0)
  113. let loginCodeTimer = null
  114. let regCodeTimer = null
  115. function handleLogin() {
  116. if (!agreed.value) {
  117. uni.showToast({ title: '请先同意协议', icon: 'none' })
  118. return
  119. }
  120. // 登录逻辑
  121. }
  122. function openProtocol(type) {
  123. const urls = {
  124. service: '/pages/protocol/service',
  125. privacy: '/pages/protocol/privacy'
  126. }
  127. uni.navigateTo({ url: urls[type] })
  128. }
  129. function socialLogin(type) {
  130. if (!agreed.value) {
  131. uni.showToast({
  132. title: '请先同意服务协议和隐私政策',
  133. icon: 'none'
  134. });
  135. return;
  136. }
  137. if (type === 'wechat') {
  138. uni.login({
  139. provider: 'weixin',
  140. success: async (loginRes) => {
  141. console.log('uni.login result:', loginRes);
  142. if (loginRes.code) {
  143. try {
  144. const userInfoRes = await uni.getUserProfile({
  145. desc: '用于完善用户资料'
  146. }).catch(err => {
  147. console.error('getUserProfile error:', err);
  148. uni.showToast({
  149. title: '已取消授权',
  150. icon: 'none'
  151. });
  152. throw err;
  153. });
  154. console.log('userInfoRes:', userInfoRes);
  155. if (!userInfoRes || !userInfoRes.userInfo) {
  156. uni.showToast({
  157. title: '未获取到用户信息',
  158. icon: 'none'
  159. });
  160. return;
  161. }
  162. const wxLoginDto = {
  163. avatarUrl: userInfoRes.userInfo.avatarUrl,
  164. gender: userInfoRes.userInfo.gender,
  165. nickName: userInfoRes.userInfo.nickName
  166. };
  167. // 构造请求体,只传有值的字段
  168. const requestData = {
  169. code: loginRes.code,
  170. wxLoginDto
  171. };
  172. if (userInfoRes.encryptedData) requestData.encryptedData = userInfoRes.encryptedData;
  173. if (userInfoRes.iv) requestData.iv = userInfoRes.iv;
  174. console.log('requestData:', requestData);
  175. uni.request({
  176. url: 'http://localhost:9500/wechat/login',
  177. method: 'POST',
  178. data: requestData,
  179. success: (res) => {
  180. console.log('后端返回:', res);
  181. if (res.statusCode === 200 && res.data.code === 200) {
  182. if (res.data.token) {
  183. uni.setStorageSync('token', res.data.token);
  184. }
  185. uni.setStorageSync('isLoggedIn', true);
  186. uni.setStorageSync('userInfo', wxLoginDto);
  187. uni.showToast({
  188. title: '登录成功',
  189. icon: 'success',
  190. duration: 1500
  191. });
  192. uni.reLaunch({
  193. url: '/pages/index/index'
  194. });
  195. } else {
  196. uni.showToast({
  197. title: res.data.msg || '登录失败,请重试',
  198. icon: 'none'
  199. });
  200. }
  201. },
  202. fail: (err) => {
  203. console.error('uni.request error:', err);
  204. uni.showToast({
  205. title: '网络错误,请稍后重试',
  206. icon: 'none'
  207. });
  208. }
  209. });
  210. } catch (err) {
  211. // 这里已经有 toast,无需重复
  212. console.error('catch error:', err);
  213. }
  214. } else {
  215. uni.showToast({
  216. title: '微信登录失败',
  217. icon: 'none'
  218. });
  219. }
  220. },
  221. fail: (err) => {
  222. console.error('uni.login error:', err);
  223. uni.showToast({
  224. title: '微信登录失败,请重试',
  225. icon: 'none'
  226. });
  227. }
  228. });
  229. }
  230. }
  231. function openRegister() {
  232. showLoginPopup.value = false
  233. showRegisterPopup.value = true
  234. }
  235. function getLoginCode() {
  236. if (loginCodeCountdown.value > 0) return;
  237. if (!/^1[3-9]\d{9}$/.test(loginPhone.value)) {
  238. uni.showToast({ title: '请输入正确手机号', icon: 'none' });
  239. return;
  240. }
  241. // 先启动倒计时
  242. loginCodeCountdown.value = 60;
  243. loginCodeTimer = setInterval(() => {
  244. if (loginCodeCountdown.value > 0) {
  245. loginCodeCountdown.value--;
  246. } else {
  247. clearInterval(loginCodeTimer);
  248. loginCodeTimer = null;
  249. }
  250. }, 1000);
  251. console.log('开始获取验证码...');
  252. uni.request({
  253. url: 'http://localhost:9500/user/code',
  254. method: 'POST',
  255. data: { phone: loginPhone.value },
  256. success(res) {
  257. console.log('验证码响应:', res.data);
  258. if (res.statusCode === 200) {
  259. uni.showToast({ title: '验证码已发送', icon: 'none' });
  260. } else {
  261. uni.showToast({ title: res.data.msg || '发送失败', icon: 'none' });
  262. }
  263. },
  264. fail(err) {
  265. console.error('获取验证码失败:', err);
  266. uni.showToast({ title: '网络错误', icon: 'none' });
  267. }
  268. });
  269. }
  270. function getRegCode() {
  271. if (regCodeCountdown.value > 0) return;
  272. if (!/^1[3-9]\d{9}$/.test(regPhone.value)) {
  273. uni.showToast({ title: '请输入正确手机号', icon: 'none' });
  274. return;
  275. }
  276. // 先启动倒计时
  277. regCodeCountdown.value = 60;
  278. regCodeTimer = setInterval(() => {
  279. if (regCodeCountdown.value > 0) {
  280. regCodeCountdown.value--;
  281. } else {
  282. clearInterval(regCodeTimer);
  283. regCodeTimer = null;
  284. }
  285. }, 1000);
  286. console.log('开始获取注册验证码...');
  287. uni.request({
  288. url: 'http://localhost:9500/user/code',
  289. method: 'POST',
  290. data: { phone: regPhone.value },
  291. success(res) {
  292. console.log('验证码响应:', res.data);
  293. if (res.statusCode === 200) {
  294. uni.showToast({ title: '验证码已发送', icon: 'none' });
  295. } else {
  296. uni.showToast({ title: res.data.msg || '发送失败', icon: 'none' });
  297. }
  298. },
  299. fail(err) {
  300. console.error('获取验证码失败:', err);
  301. uni.showToast({ title: '网络错误', icon: 'none' });
  302. }
  303. });
  304. }
  305. function handlePopupLogin() {
  306. if (loginTab.value === 'phone') {
  307. if (!/^1[3-9]\d{9}$/.test(loginPhone.value)) {
  308. uni.showToast({ title: '请输入正确手机号', icon: 'none' });
  309. return;
  310. }
  311. if (!loginCode.value) {
  312. uni.showToast({ title: '请输入验证码', icon: 'none' });
  313. return;
  314. }
  315. console.log('开始登录请求...');
  316. uni.request({
  317. url: 'http://localhost:9500/user/login',
  318. method: 'POST',
  319. data: {
  320. phone: loginPhone.value,
  321. code: loginCode.value
  322. },
  323. success(res) {
  324. console.log('登录响应数据:', res.data);
  325. console.log('响应状态码:', res.statusCode);
  326. // 检查响应状态码和数据结构
  327. if (res.statusCode === 200) {
  328. // 存储登录信息
  329. uni.setStorageSync('userPhone', loginPhone.value);
  330. uni.setStorageSync('isLoggedIn', true);
  331. // 关闭弹窗
  332. showLoginPopup.value = false;
  333. // 显示成功提示
  334. uni.showToast({
  335. title: '登录成功',
  336. icon: 'success',
  337. duration: 1500
  338. });
  339. // 直接使用 reLaunch 跳转
  340. console.log('开始跳转到首页...');
  341. uni.reLaunch({
  342. url: '/pages/index/index',
  343. success: () => {
  344. console.log('跳转成功');
  345. },
  346. fail: (err) => {
  347. console.error('reLaunch 跳转失败:', err);
  348. // 如果 reLaunch 失败,尝试使用 switchTab
  349. console.log('尝试使用 switchTab 跳转...');
  350. uni.switchTab({
  351. url: '/pages/index/index',
  352. success: () => {
  353. console.log('switchTab 跳转成功');
  354. },
  355. fail: (err) => {
  356. console.error('switchTab 跳转失败:', err);
  357. uni.showToast({
  358. title: '页面跳转失败,请重试',
  359. icon: 'none'
  360. });
  361. }
  362. });
  363. }
  364. });
  365. } else {
  366. console.log('登录失败,状态码:', res.statusCode);
  367. uni.showToast({
  368. title: res.data.msg || '登录失败,请重试',
  369. icon: 'none'
  370. });
  371. }
  372. },
  373. fail(err) {
  374. console.error('登录请求失败:', err);
  375. uni.showToast({ title: '网络错误', icon: 'none' });
  376. }
  377. });
  378. } else {
  379. if (!loginAccount.value) {
  380. uni.showToast({ title: '请输入账号', icon: 'none' });
  381. return;
  382. }
  383. if (!loginPassword.value) {
  384. uni.showToast({ title: '请输入密码', icon: 'none' });
  385. return;
  386. }
  387. console.log('开始登录请求...');
  388. uni.request({
  389. url: 'http://localhost:9500/user/loginup',
  390. method: 'POST',
  391. data: {
  392. username: loginAccount.value,
  393. password: loginPassword.value
  394. },
  395. success(res) {
  396. console.log('登录响应数据:', res.data);
  397. console.log('响应状态码:', res.statusCode);
  398. // 检查响应状态码和数据结构
  399. if (res.statusCode === 200 && res.data.code === 200) {
  400. // 存储登录信息
  401. uni.setStorageSync('userPhone', loginAccount.value);
  402. uni.setStorageSync('isLoggedIn', true);
  403. // 关闭弹窗
  404. showLoginPopup.value = false;
  405. // 显示成功提示
  406. uni.showToast({
  407. title: '登录成功',
  408. icon: 'success',
  409. duration: 1500
  410. });
  411. // 直接使用 reLaunch 跳转
  412. console.log('开始跳转到首页...');
  413. uni.reLaunch({
  414. url: '/pages/index/index',
  415. success: () => {
  416. console.log('跳转成功');
  417. },
  418. fail: (err) => {
  419. console.error('reLaunch 跳转失败:', err);
  420. // 如果 reLaunch 失败,尝试使用 switchTab
  421. console.log('尝试使用 switchTab 跳转...');
  422. uni.switchTab({
  423. url: '/pages/index/index',
  424. success: () => {
  425. console.log('switchTab 跳转成功');
  426. },
  427. fail: (err) => {
  428. console.error('switchTab 跳转失败:', err);
  429. uni.showToast({
  430. title: '页面跳转失败,请重试',
  431. icon: 'none'
  432. });
  433. }
  434. });
  435. }
  436. });
  437. } else {
  438. console.log('登录失败,状态码:', res.statusCode);
  439. console.log('登录失败,错误信息:', res.data.msg);
  440. uni.showToast({
  441. title: res.data.msg || '账号或密码错误',
  442. icon: 'none',
  443. duration: 2000
  444. });
  445. }
  446. },
  447. fail(err) {
  448. console.error('登录请求失败:', err);
  449. uni.showToast({
  450. title: '网络错误,请稍后重试',
  451. icon: 'none',
  452. duration: 2000
  453. });
  454. }
  455. });
  456. }
  457. }
  458. function handleRegister() {
  459. if (!/^1[3-9]\d{9}$/.test(regPhone.value)) {
  460. uni.showToast({ title: '请输入正确手机号', icon: 'none' });
  461. return;
  462. }
  463. if (!regCode.value) {
  464. uni.showToast({ title: '请输入验证码', icon: 'none' });
  465. return;
  466. }
  467. if (!regAccount.value) {
  468. uni.showToast({ title: '请输入账号', icon: 'none' });
  469. return;
  470. }
  471. if (!regPassword.value) {
  472. uni.showToast({ title: '请输入密码', icon: 'none' });
  473. return;
  474. }
  475. console.log('开始注册请求...');
  476. uni.request({
  477. url: 'http://localhost:9500/user/register',
  478. method: 'POST',
  479. data: {
  480. phone: regPhone.value,
  481. code: regCode.value,
  482. username: regAccount.value,
  483. password: regPassword.value
  484. },
  485. success(res) {
  486. console.log('注册响应数据:', res.data);
  487. console.log('响应状态码:', res.statusCode);
  488. if (res.statusCode === 200) {
  489. // 显示成功提示
  490. uni.showToast({
  491. title: '注册成功',
  492. icon: 'success',
  493. duration: 1500
  494. });
  495. // 关闭注册弹窗
  496. showRegisterPopup.value = false;
  497. // 延迟后打开登录弹窗
  498. setTimeout(() => {
  499. showLoginPopup.value = true;
  500. loginTab.value = 'phone';
  501. // 自动填充手机号
  502. loginPhone.value = regPhone.value;
  503. }, 1500);
  504. } else {
  505. console.log('注册失败,状态码:', res.statusCode);
  506. uni.showToast({
  507. title: res.data.msg || '注册失败,请重试',
  508. icon: 'none'
  509. });
  510. }
  511. },
  512. fail(err) {
  513. console.error('注册请求失败:', err);
  514. uni.showToast({ title: '网络错误', icon: 'none' });
  515. }
  516. });
  517. }
  518. onUnmounted(() => {
  519. if (loginCodeTimer) clearInterval(loginCodeTimer)
  520. if (regCodeTimer) clearInterval(regCodeTimer)
  521. })
  522. </script>
  523. <style lang="scss" scoped>
  524. .login-page {
  525. min-height: 100vh;
  526. background: #fff;
  527. display: flex;
  528. flex-direction: column;
  529. align-items: center;
  530. justify-content: flex-start;
  531. padding: 0 40rpx;
  532. }
  533. .brand-area {
  534. margin-top: 100rpx;
  535. display: flex;
  536. flex-direction: column;
  537. align-items: center;
  538. .logo {
  539. width: 120rpx;
  540. height: 120rpx;
  541. margin-bottom: 20rpx;
  542. }
  543. .brand-title {
  544. font-size: 44rpx;
  545. font-weight: bold;
  546. color: #222;
  547. margin-bottom: 20rpx;
  548. }
  549. .slogan-area {
  550. display: flex;
  551. flex-direction: column;
  552. align-items: center;
  553. .slogan {
  554. font-size: 28rpx;
  555. color: #2979ff;
  556. margin-bottom: 8rpx;
  557. }
  558. .slogan-underline {
  559. width: 220rpx;
  560. height: 8rpx;
  561. background: #e3f0ff;
  562. border-radius: 4rpx;
  563. }
  564. }
  565. }
  566. .phone-area {
  567. margin: 500rpx 0 40rpx 0;
  568. display: flex;
  569. flex-direction: column;
  570. align-items: center;
  571. .phone {
  572. font-size: 36rpx;
  573. color: #222;
  574. font-weight: 500;
  575. margin-bottom: 10rpx;
  576. }
  577. .carrier {
  578. font-size: 24rpx;
  579. color: #aaa;
  580. }
  581. }
  582. .main-btn {
  583. width: 100%;
  584. height: 88rpx;
  585. border-radius: 44rpx;
  586. font-size: 32rpx;
  587. font-weight: 500;
  588. margin-bottom: 32rpx;
  589. }
  590. .login-btn {
  591. background: #1976ff;
  592. color: #fff;
  593. border: none;
  594. }
  595. .wechat-btn {
  596. background: #1aad19;
  597. color: #fff;
  598. border: none;
  599. display: flex;
  600. align-items: center;
  601. justify-content: center;
  602. .wechat-icon {
  603. width: 40rpx;
  604. height: 40rpx;
  605. margin-right: 16rpx;
  606. vertical-align: middle;
  607. }
  608. }
  609. .protocol-area {
  610. display: flex;
  611. align-items: center;
  612. margin: 30rpx 0 0 0;
  613. .protocol-text {
  614. font-size: 22rpx;
  615. color: #999;
  616. margin-left: 10rpx;
  617. .link {
  618. color: #1976ff;
  619. }
  620. }
  621. }
  622. .other-login {
  623. margin-top: 80rpx;
  624. display: flex;
  625. flex-direction: column;
  626. align-items: center;
  627. .other-title {
  628. font-size: 24rpx;
  629. color: #bbb;
  630. margin-bottom: 20rpx;
  631. }
  632. .other-icons {
  633. display: flex;
  634. gap: 60rpx;
  635. .icon {
  636. width: 60rpx;
  637. height: 60rpx;
  638. }
  639. }
  640. }
  641. .icon-circle {
  642. width: 80rpx;
  643. height: 80rpx;
  644. border: 1px solid #ccc;
  645. border-radius: 50%;
  646. display: flex;
  647. align-items: center;
  648. justify-content: center;
  649. margin: 0 20rpx;
  650. background: #fff;
  651. }
  652. .popup-mask {
  653. position: fixed;
  654. left: 0; top: 0; right: 0; bottom: 0;
  655. background: rgba(0,0,0,0.25);
  656. z-index: 999;
  657. display: flex;
  658. align-items: center;
  659. justify-content: center;
  660. }
  661. .popup-box {
  662. width: 90vw;
  663. max-width: 600rpx;
  664. background: #fff;
  665. border-radius: 24rpx;
  666. box-shadow: 0 8rpx 32rpx rgba(0,0,0,0.10);
  667. padding: 60rpx 40rpx 40rpx 40rpx;
  668. position: relative;
  669. display: flex;
  670. flex-direction: column;
  671. align-items: stretch;
  672. }
  673. .close-btn {
  674. position: absolute;
  675. right: 32rpx;
  676. top: 24rpx;
  677. font-size: 48rpx;
  678. color: #bbb;
  679. z-index: 2;
  680. font-weight: bold;
  681. }
  682. .popup-title {
  683. text-align: center;
  684. font-size: 36rpx;
  685. font-weight: bold;
  686. color: #222;
  687. margin-bottom: 32rpx;
  688. letter-spacing: 2rpx;
  689. }
  690. .popup-tabs {
  691. display: flex;
  692. justify-content: center;
  693. margin-bottom: 32rpx;
  694. text {
  695. font-size: 28rpx;
  696. margin: 0 36rpx;
  697. color: #888;
  698. padding-bottom: 8rpx;
  699. position: relative;
  700. &.active {
  701. color: #1976ff;
  702. font-weight: bold;
  703. }
  704. &.active::after {
  705. content: '';
  706. display: block;
  707. position: absolute;
  708. left: 0; right: 0; bottom: 0;
  709. height: 4rpx;
  710. background: #1976ff;
  711. border-radius: 2rpx;
  712. }
  713. }
  714. }
  715. .input-row {
  716. margin-bottom: 28rpx;
  717. display: flex;
  718. align-items: center;
  719. input {
  720. flex: 1;
  721. height: 80rpx;
  722. border-radius: 40rpx;
  723. background: #f7f8fa;
  724. border: 1px solid #eee;
  725. padding: 0 32rpx;
  726. font-size: 28rpx;
  727. color: #333;
  728. }
  729. }
  730. .code-row {
  731. input {
  732. flex: 1;
  733. margin-right: 16rpx;
  734. }
  735. .code-btn {
  736. width: 160rpx;
  737. height: 64rpx;
  738. border-radius: 32rpx;
  739. background: #1976ff;
  740. color: #fff;
  741. font-size: 24rpx;
  742. border: none;
  743. padding: 0;
  744. }
  745. }
  746. .popup-login-btn {
  747. margin-top: 12rpx;
  748. margin-bottom: 16rpx;
  749. width: 100%;
  750. height: 88rpx;
  751. border-radius: 44rpx;
  752. font-size: 32rpx;
  753. font-weight: 500;
  754. background: #1976ff;
  755. color: #fff;
  756. border: none;
  757. }
  758. .popup-footer {
  759. text-align: center;
  760. margin-top: 10rpx;
  761. color: #1976ff;
  762. font-size: 26rpx;
  763. font-weight: 500;
  764. letter-spacing: 1rpx;
  765. }
  766. </style>