login.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. <template>
  2. <view>
  3. <view class="main">
  4. <view class="logo">
  5. <img src="../../assets/img/logo.png" alt="">
  6. </view>
  7. <view class="name">
  8. 食堂管理系统
  9. </view>
  10. <view class="login">
  11. <view class="login-box">
  12. <view :class="['tel',telHighlight==true?'highlight':'']" >
  13. <view class="icon" >
  14. <u-icon name="account-fill" size="40" ></u-icon>
  15. </view>
  16. <view class="line">
  17. </view>
  18. <view class="tips">
  19. <u-input v-model="phone" @focus="handleTelFocus" @blur="handleTelBlur" class="telInput" type="number" placeholder="请输入手机号" />
  20. <!-- <view class="clear" v-if="this.telHighlight==true">
  21. <img src="../../assets/img/riFill-close-circle-fill@1x.png" alt="">
  22. </view> -->
  23. </view>
  24. </view>
  25. <view :class="['pwd',pwdHighlight==true?'highlight':'']" >
  26. <view class="icon">
  27. <u-icon name="chat-fill" size="40"></u-icon>
  28. </view>
  29. <view class="line">
  30. </view>
  31. <view class="tips">
  32. <view class="input">
  33. <u-input :type="type" :password-icon="passwordIcon" @focus="handlePwdFocus" @blur="handlePwdBlur" placeholder="请输入密码" />
  34. </view>
  35. </view>
  36. </view>
  37. </view>
  38. </view>
  39. <view class="btn">
  40. <button>登录</button>
  41. </view>
  42. </view>
  43. </view>
  44. </template>
  45. <script>
  46. export default {
  47. data() {
  48. return {
  49. show:true,
  50. telHighlight:false,
  51. pwdHighlight:false,
  52. type: 'password',
  53. passwordIcon: true,
  54. phone:'',
  55. }
  56. },
  57. methods: {
  58. // 帐号框聚焦失焦
  59. handleTelFocus(){
  60. this.telHighlight=true
  61. },
  62. handleTelBlur(){
  63. this.telHighlight=false
  64. },
  65. // 密码框聚焦失焦
  66. handlePwdFocus(){
  67. this.pwdHighlight=true
  68. },
  69. handlePwdBlur(){
  70. this.pwdHighlight=false
  71. }
  72. }
  73. }
  74. </script>
  75. <style lang="scss" scoped>
  76. page {
  77. background: url("../../assets/img/bgc.png");
  78. }
  79. .main {
  80. width: 100%;
  81. padding-top:240rpx;
  82. position: relative;
  83. .close{
  84. position: absolute;
  85. top: 24rpx;
  86. left: 24rpx;
  87. }
  88. .logo {
  89. display: flex;
  90. justify-content: center;
  91. }
  92. .name {
  93. color: rgba(16, 16, 16, 1);
  94. font-size: 40rpx;
  95. text-align: center;
  96. font-weight: bold;
  97. margin-top: 8rpx;
  98. font-family: 'SemiBold';
  99. }
  100. }
  101. .login-box {
  102. margin-top: 160rpx;
  103. .tel {
  104. /deep/.u-input {
  105. width: 450rpx;
  106. }
  107. }
  108. .pwd{
  109. /deep/.u-input {
  110. width: 450rpx;
  111. }
  112. }
  113. .clear{
  114. img{
  115. vertical-align: middle;
  116. }
  117. }
  118. .line{
  119. width: 2rpx;
  120. height: 40rpx;
  121. background-color: #C1CCDF;
  122. position: absolute;
  123. top: 20rpx;
  124. left: 70rpx;
  125. }
  126. .tel,
  127. .pwd {
  128. position: relative;
  129. display: flex;
  130. width: 74.4%;
  131. height: 80rpx;
  132. line-height: 80rpx;
  133. color: rgba(183, 172, 172, 1);
  134. margin: auto;
  135. margin-bottom: 36rpx;
  136. border: 1px solid rgba(193, 204, 223, 1);
  137. border-radius: 8px;
  138. /deep/.u-input__input{
  139. font-size: 32rpx;
  140. }
  141. .icon {
  142. width: 14%;
  143. text-align: center;
  144. color: #B0B8C8;
  145. img {
  146. vertical-align: middle;
  147. }
  148. }
  149. .tips {
  150. text-indent: 16rpx;
  151. padding-right: 16rpx;
  152. display: flex;
  153. justify-content: space-between;
  154. /deep/uni-input {
  155. height: 80rpx !important;
  156. line-height: 80rpx !important;
  157. }
  158. .input {
  159. width: 60%;
  160. }
  161. }
  162. /deep/.uicon-eye-fill,/deep/.uicon-eye{
  163. color: rgba(0, 90, 217, 1) !important;
  164. }
  165. }
  166. // 高亮
  167. .highlight {
  168. border: 1px solid rgba(31, 74, 153, 1);
  169. box-shadow: 0px 0px 8rpx 0px rgba(0, 90, 217, 50);
  170. /deep/.u-input__input{
  171. color: rgba(0, 90, 217, 1);
  172. }
  173. .icon{
  174. color: #1F4A99;
  175. }
  176. .line{
  177. background-color: #005AD9;
  178. }
  179. }
  180. }
  181. .btn{
  182. width: 100%;
  183. margin-top: 120rpx;
  184. uni-button{
  185. margin:0 96rpx;
  186. height: 80rpx;
  187. border-radius: 8px;
  188. background-color: rgba(31, 74, 153, 1);
  189. color: rgba(255, 255, 255, 1);
  190. font-size: 16px;
  191. }
  192. }
  193. </style>