login.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. <template>
  2. <view class="section">
  3. <view class="text-area content">
  4. <text class="title">智慧用电</text>
  5. </view>
  6. <form class="padding-lg flex flex-direction">
  7. <view class="login-box shadow ">
  8. <view class="phone-box">
  9. <input type="text" placeholder="13636363636" onfocus="this.placeholder=''">
  10. <span class="icon iconfont left-icon">&#xe64f;</span>
  11. <span class="icon iconfont right-icon">&#xe610;</span>
  12. </view>
  13. <view class="password-box">
  14. <input type="text" placeholder="请输入验证码">
  15. <text class="icon iconfont left-icon">&#xe86a;</text>
  16. <view class="right-icon verify">获取验证码</view>
  17. </view>
  18. <button class="submit">提 交 </button>
  19. </view>
  20. </form>
  21. <view class="box ">
  22. <view class="cu-bar tabbar bg-white">
  23. <view class="action" @click="NavChange" data-cur="login">
  24. <view class="cuIcon-cu-image">
  25. <span class="icon iconfont">&#xe64e;</span>
  26. </view>
  27. <view class="text-green">主页</view>
  28. </view>
  29. <view class="action">
  30. <view class="cuIcon-cu-image">
  31. <span class="icon iconfont">&#xe606;</span>
  32. </view>
  33. <view class="text-gray">消息</view>
  34. </view>
  35. <view class="action">
  36. <view class="cuIcon-cu-image">
  37. <span class="icon iconfont">&#xe858;</span>
  38. <view class="cu-tag badge">99</view>
  39. </view>
  40. <view class="text-gray">分析</view>
  41. </view>
  42. <view class="action">
  43. <view class="cuIcon-cu-image">
  44. <span class="icon iconfont">&#xe606;</span>
  45. <view class="cu-tag badge"></view>
  46. </view>
  47. <view class="text-gray">设置</view>
  48. </view>
  49. </view>
  50. </view>
  51. </view>
  52. </template>
  53. <script>
  54. export default {
  55. data() {
  56. return {
  57. title: 'Hello222',
  58. InputBottom: 0
  59. }
  60. },
  61. onLoad() {
  62. uni.setNavigationBarColor({
  63. frontColor: "#ffffff", //文字颜色
  64. backgroundColor: "#4866DF", //底部背景色
  65. })
  66. uni.setNavigationBarTitle({
  67. title: '登录'
  68. });
  69. },
  70. methods: {
  71. NavChange: function(e) {
  72. this.PageCur = e.currentTarget.dataset.cur
  73. },
  74. InputFocus(e) {
  75. this.InputBottom = e.detail.height
  76. },
  77. InputBlur(e) {
  78. this.InputBottom = 0
  79. }
  80. }
  81. }
  82. </script>
  83. <style>
  84. .section {
  85. height: calc(100vh - 90rpx);
  86. background-image: url(/static/login-bg.png);
  87. background-size: contain;
  88. background-repeat: no-repeat;
  89. }
  90. .content {
  91. height: 434rpx;
  92. text-align: center;
  93. position: relative;
  94. }
  95. .login-box {
  96. height: 600rpx;
  97. position: relative;
  98. top: -150rpx;
  99. background: #fff;
  100. border-radius: 30rpx;
  101. padding: 100rpx 20rpx;
  102. }
  103. .shadow {
  104. box-shadow: 1px 1px 4px rgb(26 26 26 / 10%);
  105. }
  106. .title {
  107. position: absolute;
  108. color: #fff;
  109. font-size: 60rpx;
  110. bottom: 180rpx;
  111. display: block;
  112. width: 100%;
  113. }
  114. input,
  115. button {
  116. width: 100%;
  117. height: 100rpx;
  118. line-height: 100rpx;
  119. opacity: 1;
  120. border: 1px solid #dbdbdb;
  121. border-radius: 100rpx;
  122. background: #fff;
  123. coloe: #333;
  124. margin: 40rpx 0;
  125. font-size: 34rpx;
  126. }
  127. input {
  128. text-indent: 100rpx;
  129. }
  130. .submit {
  131. background: #4074E7;
  132. color: #fff
  133. }
  134. .phone-box,
  135. .password-box {
  136. position: relative;
  137. }
  138. .phone-box text,
  139. .password-box text {
  140. font-size: 38rpx;
  141. color: #999999
  142. }
  143. .left-icon {
  144. position: absolute;
  145. left: 48rpx;
  146. top: 50%;
  147. margin-top: -20rpx;
  148. line-height: 100%
  149. }
  150. .right-icon {
  151. position: absolute;
  152. right: 48rpx;
  153. top: 50%;
  154. margin-top: -20rpx;
  155. line-height: 100%
  156. }
  157. .right-icon.verify {
  158. margin-top: -10rpx;
  159. color: #4074E7
  160. }
  161. .iconfont{
  162. color:#999
  163. }
  164. /* 底部 */
  165. .box{
  166. position: fixed;
  167. bottom: 0;
  168. width: 100%;
  169. border-top:1px solid pink
  170. }
  171. .cuIcon-cu-image .iconfont{
  172. width: 38rpx;
  173. height: 38rpx;
  174. display: inline-block;
  175. margin-bottom:10rpx;
  176. }
  177. .text-gray{
  178. font-size:26rpx;
  179. }
  180. </style>