phone-login.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. <template>
  2. <!-- 手机登录 -->
  3. <view class="page-container">
  4. <!-- 顶部标题区域 -->
  5. <image class="bg-image " src="@/static/images/bg.png" mode="aspectFill"></image>
  6. <!-- 登录表单区域 -->
  7. <view class="login-form">
  8. <!-- 账号输入框 -->
  9. <view class="input-group">
  10. <text class="input-label">账号</text>
  11. <u-input v-model="account" placeholder="请输入手机号码" :border="false" class="input-field" type="number"
  12. maxlength="11"></u-input>
  13. </view>
  14. <!-- 密码输入框 -->
  15. <view class="input-group">
  16. <text class="input-label">密码</text>
  17. <u-input v-model="password" placeholder="请输入密码" :border="false" class="input-field" type="password"
  18. :password-icon="true"></u-input>
  19. </view>
  20. <!-- 登录按钮 -->
  21. <button class="login-btn" @tap="handleLogin">
  22. <text>确定</text>
  23. </button>
  24. </view>
  25. </view>
  26. </template>
  27. <script>
  28. import {
  29. wxLogin,
  30. } from '@/config/api.js';
  31. export default {
  32. data() {
  33. return {
  34. account: '',
  35. password: ''
  36. }
  37. },
  38. methods: {
  39. // 处理登录
  40. handleLogin() {
  41. if (!this.account) {
  42. uni.showToast({
  43. title: '请输入账号',
  44. icon: 'none'
  45. });
  46. return;
  47. }
  48. if (!this.password) {
  49. uni.showToast({
  50. title: '请输入密码',
  51. icon: 'none'
  52. });
  53. return;
  54. }
  55. // TODO: 实现登录逻辑
  56. console.log('登录信息:', {
  57. account: this.account,
  58. password: this.password
  59. });
  60. }
  61. }
  62. }
  63. </script>
  64. <style>
  65. .page-container {
  66. min-height: 100vh;
  67. background: #F5F5F5;
  68. }
  69. /* 背景图片 */
  70. .bg-image {
  71. top: 0;
  72. left: 0;
  73. width: 100%;
  74. height: 300rpx;
  75. z-index: 0;
  76. }
  77. .login-form {
  78. background: #FFFFFF;
  79. border-radius: 24rpx;
  80. padding: 32rpx;
  81. margin: 32rpx;
  82. box-shadow: 0 4rpx 16rpx rgba(41, 44, 53, 0.1);
  83. .input-group {
  84. margin-bottom: 32rpx;
  85. .input-label {
  86. display: block;
  87. font-size: 28rpx;
  88. color: #292C35;
  89. margin-bottom: 16rpx;
  90. }
  91. .input-field {
  92. background: #F5F5F5;
  93. border-radius: 12rpx;
  94. height: 88rpx;
  95. padding: 0 24rpx;
  96. font-size: 28rpx;
  97. }
  98. }
  99. .login-btn {
  100. width: 100%;
  101. height: 88rpx;
  102. background: linear-gradient(135deg, #FF5B05 0%, #FF8E3C 100%);
  103. border-radius: 44rpx;
  104. color: #FFFFFF;
  105. font-size: 32rpx;
  106. font-weight: 500;
  107. display: flex;
  108. align-items: center;
  109. justify-content: center;
  110. margin-top: 48rpx;
  111. border: none;
  112. box-shadow: 0 4rpx 16rpx rgba(255, 91, 5, 0.3);
  113. &:active {
  114. transform: translateY(2rpx);
  115. box-shadow: 0 2rpx 8rpx rgba(255, 91, 5, 0.4);
  116. }
  117. }
  118. }
  119. </style>