login.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <template>
  2. <div class="login">
  3. <img class="head" src="@/assets/images/head.png" alt="" />
  4. <div class="login-info flex-row-between">
  5. <div></div>
  6. <div class="login-bos">
  7. <div class="login-type flex-row-between">
  8. <div :class="type == 1 ? 'hig' : ''" @click="onType(1)">密码登录</div>
  9. <div class="border"></div>
  10. <div :class="type == 2 ? 'hig' : ''" @click="onType(2)">短信登录</div>
  11. </div>
  12. <template v-if="type == 1">
  13. <el-input class="login-input" v-model="loginForm.username" placeholder="账号名" />
  14. <el-input style="margin-top: 18px" type="password" class="login-input" v-model="loginForm.password" placeholder="请输入登录密码" />
  15. </template>
  16. <template v-else>
  17. <el-input :maxlength="11" class="login-input" v-model="loginForm.mobile" placeholder="手机号" />
  18. <el-input style="margin-top: 18px" :maxlength="6" class="login-input" v-model="loginForm.mobile" placeholder="手机号">
  19. <template #suffix>
  20. <span class="code">发送验证码</span>
  21. </template>
  22. </el-input>
  23. </template>
  24. <el-button class="login-btn" type="primary">登录</el-button>
  25. <div class="login-text flex-row-between">
  26. <div>忘记密码</div>
  27. <div class="border"></div>
  28. <div>免费注册</div>
  29. </div>
  30. </div>
  31. </div>
  32. </div>
  33. </template>
  34. <script setup lang="ts">
  35. const type = ref<any>(1);
  36. const loginForm = ref<any>({
  37. username: 'admin',
  38. password: 'admin123',
  39. mobile: ''
  40. });
  41. const onType = (res: any) => {
  42. type.value = res;
  43. };
  44. </script>
  45. <style lang="scss" scoped>
  46. .login {
  47. height: 100%;
  48. width: 100%;
  49. background-image: url('@/assets/images/login/login1.png');
  50. overflow: auto;
  51. background-position: center center;
  52. background-repeat: no-repeat;
  53. background-size: cover;
  54. .head {
  55. width: 185px;
  56. height: 90px;
  57. margin-top: 53px;
  58. margin-left: 84px;
  59. }
  60. .login-info {
  61. width: 100%;
  62. height: 660px;
  63. background-image: url('@/assets/images/login/login2.png');
  64. overflow: hidden;
  65. background-position: center center;
  66. background-repeat: no-repeat;
  67. background-size: cover;
  68. margin-top: 68px;
  69. min-width: 1200px;
  70. padding: 0 5%;
  71. .login-bos {
  72. width: 520px;
  73. height: 510px;
  74. background: #ffffff;
  75. border-radius: 30px 30px 30px 30px;
  76. padding: 90px 85px 0 85px;
  77. .login-type {
  78. font-weight: 600;
  79. font-size: 22px;
  80. color: #101828;
  81. padding: 0 67px;
  82. margin-bottom: 40px;
  83. div {
  84. cursor: pointer;
  85. }
  86. .hig {
  87. color: #e7000b;
  88. }
  89. .border {
  90. width: 1px;
  91. height: 16px;
  92. background: #e6e8ec;
  93. }
  94. }
  95. .login-input {
  96. width: 350px;
  97. height: 50px;
  98. font-size: 16px;
  99. .code {
  100. font-size: 14px;
  101. color: #e7000b;
  102. cursor: pointer;
  103. }
  104. }
  105. :deep(.el-input__wrapper) {
  106. border: none;
  107. /* 可选:去除聚焦时的高亮 */
  108. box-shadow: none;
  109. outline: none;
  110. background: #f4f6f8;
  111. }
  112. .login-btn {
  113. width: 350px;
  114. height: 50px;
  115. margin-top: 60px;
  116. font-size: 16px;
  117. }
  118. .login-text {
  119. font-size: 14px;
  120. color: #6a7282;
  121. padding: 0 107px;
  122. margin-top: 14px;
  123. div {
  124. cursor: pointer;
  125. }
  126. .border {
  127. width: 1px;
  128. height: 12px;
  129. background: #e6e8ec;
  130. }
  131. }
  132. }
  133. }
  134. }
  135. </style>