phone-login.vue 2.5 KB

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