Login.vue 2.4 KB
<script setup>
import { ref } from 'vue'

const username = ref('')
const password = ref('')
const onSubmit = (values) => {
  console.log('submit', values)
}
</script>
<template>
  <div class="counter">
    <div style="height: 7%"></div>
    <div class="ban">
      <div class="left">
        <h2>用户登录</h2>
        <div class="login">
          <van-form @submit="onSubmit">
            <van-cell-group inset>
              <van-field
                v-model="username"
                name="用户名"
                label="用户名"
                placeholder="用户名"
                :rules="[{ required: true, message: '请填写用户名' }]"
              />
              <van-field
                v-model="password"
                type="password"
                name="密码"
                label="密码"
                placeholder="密码"
                :rules="[{ required: true, message: '请填写密码' }]"
              />
            </van-cell-group>
            <div style="margin: 16px">
              <van-button round block type="primary" native-type="submit"> 登录 </van-button>
            </div>
          </van-form>
        </div>
        <div class="msg">
          <div class="left">其他登录方式 ></div>
          <div class="right">手机验证码</div>
        </div>
        <div class="footer">
          登录即表示同意平台 <span>《隐私政策》</span>和 <span>《用户协议》</span>
        </div>
      </div>
      <div class="right">

      </div>
    </div>
  </div>
</template>

<style lang="scss">
.counter {
  width: 100%;
  height: 100vh;
  background-color: #f2f2f2;
  .ban {
    position: relative;
    margin: 7% auto;
    width: 800px;
    height: 500px;
    background-color: #fff;
    border-radius: 50px;
    h2 {
      padding: 60px 0 0 40px;
    }
    .login {
      margin-top: 60px;
      width: 55%;
      padding-left: 20px;
      .van-field__left-icon {
        padding-right: 20px;
      }
    }
    .msg {
      padding-left: 45px;
      display: flex;
      width: 50%;
      justify-content: space-between;
      align-items: center;
      .left {
        color: #bbc5d2;
      }
      .right {
        color: #7888ff;
      }
    }
    .footer {
      position: fixed;
      bottom: 85px;
      left: 30%;
      text-align: center;
      font-size: 12px;
      span {
        color: #7888ff;
      }
    }
  }
  .right {
    width: 40%;
  }
}
</style>