Kaynağa Gözat

登录的背景图片

lmc 2 yıl önce
ebeveyn
işleme
4511bc6e54
4 değiştirilmiş dosya ile 121 ekleme ve 98 silme
  1. 6 6
      src/App.vue
  2. BIN
      src/assets/login-bg.png
  3. 18 9
      src/views/home.vue
  4. 97 83
      src/views/login.vue

+ 6 - 6
src/App.vue

@@ -1,7 +1,5 @@
 <template>
-  <div class="main">
-    <router-view> </router-view>
-  </div>
+  <router-view> </router-view>
   <!-- 开启底部安全区适配 -->
   <van-number-keyboard safe-area-inset-bottom />
 </template>
@@ -20,11 +18,12 @@
 
 .van-cell {
   .van-cell__title {
+    color: #666666;
     text-align: left;
   }
-  --van-cell-text-color: #666666;
 }
 .van-button {
+  letter-spacing: 2px;
   font-weight: 600;
 }
 .save_btn {
@@ -40,11 +39,12 @@
 }
 :root {
   --van-gray-3: unset;
+  --van-gray-5: #999999;
   --van-gray-6: #999999;
   --van-gray-7: #666666;
-  --van-gray-8: #333333;
+  --van-gray-8: #0c1935;
   --van-font-weight-bold: 600;
-  --van-text-color: #333333;
+  --van-text-color: #0c1935;
   --van-font-size-md: 16px;
   --van-font-size-lg: 16px;
   --van-border-radius-sm: 4px;

BIN
src/assets/login-bg.png


+ 18 - 9
src/views/home.vue

@@ -1,7 +1,13 @@
 <template>
+  <!-- 开启顶部安全区适配 -->
+  <van-nav-bar
+    :border="false"
+    safe-area-inset-top
+    style="background-color: #5c8fff"
+  />
   <div class="page_info">
     <div class="info_bg">
-      <van-row align="center" class="bg_title">
+      <van-row align="center" class="title">
         <van-col>
           <van-image
             :src="require('@/assets/position.svg')"
@@ -9,7 +15,7 @@
             height="16"
             fit="contain"
           />
-          <span>{{ name }}</span>
+          <van-col>{{ name }}</van-col>
           <van-image
             :src="require('@/assets/arrow-right.svg')"
             width="24"
@@ -38,7 +44,7 @@
         >
           <template v-if="item.role.includes(role)">
             <van-image :src="item.src" width="36" height="36" fit="contain" />
-            <span>{{ item.label }}</span>
+            <van-col>{{ item.label }}</van-col>
           </template>
         </div>
       </div>
@@ -183,7 +189,7 @@
   <van-tabbar
     v-model="activeTabBar"
     active-color="#2E69EB"
-    inactive-color="#333333"
+    inactive-color="#0c1935"
     safe-area-inset-bottom
   >
     <van-tabbar-item
@@ -350,7 +356,7 @@ export default {
 .page_info {
   position: relative;
   height: calc(
-    100% - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 50px
+    100% - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 50px -46px
   );
   .info_bg {
     width: 100%;
@@ -359,7 +365,8 @@ export default {
     border-radius: 0px 0px 16px 16px;
     padding-top: 12px;
     margin-bottom: 42px;
-    .bg_title {
+    box-sizing: border-box;
+    .title {
       display: flex;
       align-items: center;
       justify-content: space-between;
@@ -370,9 +377,11 @@ export default {
         font-weight: 600;
         color: #ffffff;
         line-height: 24px;
+        text-indent: 4px;
         text-shadow: 0px 2px 4px rgba(0, 0, 0, 0.04);
         display: flex;
         align-items: center;
+        letter-spacing: 2px;
       }
     }
   }
@@ -393,18 +402,18 @@ export default {
       flex-direction: column;
       align-items: center;
       justify-content: center;
-      span {
+      .van-col {
         height: 20px;
         font-size: 14px;
         font-weight: 400;
-        color: #697081;
+        color: #666666;
         line-height: 20px;
         margin-top: 4px;
       }
     }
   }
   .info_list {
-    max-height: calc(100% - 114px - 42px - 20px);
+    max-height: calc(100% - 102px - 42px - 20px);
     padding: 0 16px;
     overflow-y: auto;
     .sub_title {

+ 97 - 83
src/views/login.vue

@@ -7,59 +7,66 @@
     safe-area-inset-top
     style="background-color: #5c8fff"
   />
-  <div class="page_login">
-    <div class="login_bg">
-      <div class="bg_title">
-        <van-image
-          :src="require('@/assets/logo.svg')"
-          width="32"
-          height="32"
-          fit="contain"
-        />
-        <span>双碳感知资产运营管理平台</span>
-      </div>
+  <div class="page_info">
+    <div class="info_bg">
+      <van-image
+        :src="require('@/assets/login-bg.png')"
+        width="272"
+        height="157"
+        fit="contain"
+        class="img"
+      />
+      <van-row align="center" justify="center">
+        <van-col class="title">
+          <van-image
+            :src="require('@/assets/logo.svg')"
+            width="32"
+            height="32"
+            fit="contain"
+          />
+          <van-col>双碳感知资产运营管理平台</van-col>
+        </van-col>
+      </van-row>
     </div>
-    <div class="login_info">
-      <div class="info_content">
-        <div class="title">
-          <span>登录</span>
+    <div class="info_list">
+      <van-row align="center" justify="center" class="title">
+        <van-col>登录</van-col>
+      </van-row>
+      <van-form @submit="onSubmit">
+        <van-cell-group>
+          <van-field
+            v-model="tel"
+            name="手机号"
+            :left-icon="require('@/assets/phone.svg')"
+            placeholder="请输入手机号码"
+            :clearable="true"
+            :rules="[{ required: true, message: '请输入手机号码' }]"
+            style="margin-bottom: 20px"
+          />
+          <van-field
+            v-model="password"
+            type="password"
+            name="密码"
+            :left-icon="require('@/assets/password.svg')"
+            placeholder="请输入密码"
+            :clearable="true"
+            :rules="[{ required: true, message: '请输入密码' }]"
+          />
+        </van-cell-group>
+        <div style="margin-top: 50px">
+          <van-button
+            round
+            block
+            type="primary"
+            color="#5C8FFF"
+            :loading="loading"
+            loading-text="登陆中。。。"
+            native-type="submit"
+          >
+            登录
+          </van-button>
         </div>
-        <van-form @submit="onSubmit">
-          <van-cell-group>
-            <van-field
-              v-model="tel"
-              name="手机号"
-              :left-icon="require('@/assets/phone.svg')"
-              placeholder="请输入手机号码"
-              :clearable="true"
-              :rules="[{ required: true, message: '请输入手机号码' }]"
-              style="margin-bottom: 20px"
-            />
-            <van-field
-              v-model="password"
-              type="password"
-              name="密码"
-              :left-icon="require('@/assets/password.svg')"
-              placeholder="请输入密码"
-              :clearable="true"
-              :rules="[{ required: true, message: '请输入密码' }]"
-            />
-          </van-cell-group>
-          <div style="margin-top: 50px">
-            <van-button
-              round
-              block
-              type="primary"
-              color="#2E69EB"
-              :loading="loading"
-              loading-text="登陆中。。。"
-              native-type="submit"
-            >
-              登录
-            </van-button>
-          </div>
-        </van-form>
-      </div>
+      </van-form>
     </div>
   </div>
 </template>
@@ -117,53 +124,60 @@ export default {
 </script>
 
 <style lang="scss" scoped>
-.page_login {
+.page_info {
   position: relative;
-  .login_bg {
+  .info_bg {
     width: 100%;
-    height: 245px;
+    height: 200px;
     background: #5c8fff;
     border-radius: 0px 0px 16px 16px;
-    padding-top: 16px;
-    .bg_title {
-      display: flex;
-      align-items: center;
-      justify-content: center;
-      span {
-        height: 24px;
-        font-size: 18px;
-        font-weight: 600;
-        color: #ffffff;
-        line-height: 24px;
-        text-align: center;
-      }
+    position: relative;
+    .img {
+      position: absolute;
+      left: -6px;
+      top: -12px;
     }
-  }
-  .login_info {
-    position: absolute;
-    top: 142px;
-    width: calc(100% - 32px);
-    padding: 0 16px;
-    .info_content {
-      background: #ffffff;
-      box-shadow: 0px 0px 8px 0px rgba(51, 51, 51, 0.08);
-      border-radius: 16px;
-      padding: 30px 20px 50px 20px;
+    .van-row {
+      position: absolute;
+      width: 100%;
       .title {
         display: flex;
         align-items: center;
-        justify-content: center;
-        margin-bottom: 30px;
-        span {
+        .van-col {
           height: 24px;
-          font-size: 20px;
+          font-size: 18px;
           font-weight: 600;
-          color: #0c1935;
+          color: #ffffff;
           line-height: 24px;
+          text-align: center;
+          text-indent: 4px;
+          letter-spacing: 2px;
         }
       }
     }
   }
+  .info_list {
+    position: absolute;
+    top: 142px;
+    width: calc(100% - 32px);
+    padding: 0 16px;
+    background: #ffffff;
+    box-shadow: 0px 0px 8px 0px rgba(51, 51, 51, 0.08);
+    border-radius: 16px;
+    padding: 30px 20px 50px 20px;
+    margin: 0 16px;
+    box-sizing: border-box;
+    .title {
+      margin-bottom: 40px;
+      letter-spacing: 2px;
+      .van-col {
+        height: 24px;
+        font-size: 20px;
+        font-weight: 500;
+        line-height: 24px;
+      }
+    }
+  }
   /deep/ {
     --van-cell-vertical-padding: 8px;
     .van-icon__image {