Login.vue 3.0 KB
<script setup>

import { dengluAPI } from '@/aip/login';
import { ref } from 'vue'


const username = ref('')
const password = ref('')
const onSubmit = async(values) => {
  console.log(values)
  const res = await dengluAPI(values)
  console.log(res)
}
</script>
<template>
  <div class="counter">
    <div style="height: 6%"></div>
    <div class="ban">
      <div class="left1">
        <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 color="#6170c3" native-type="submit"> 登录 </van-button>
            </div>
          </van-form>
        </div>
        <div class="msg">
          <div class="left">手机验证码登录</div>
          <div class="right">忘记密码</div>
        </div>
        <!-- <div class="bit">其他方式登录 ></div> -->
        <div class="footer">
          登录即表示同意平台 <span>《隐私政策》</span>和 <span>《用户协议》</span>
        </div>
      </div>
      <div class="right1">
        <div class="waiter">客服</div>
        <img src="@/static/erweima.png" alt="">
        <div class="bit2">使用小程序扫码登录</div>
      </div>
    </div>
  </div>
</template>

<style lang="scss" scoped>
.counter {
  width: 100%;
  height: 100%;
  .left1{
    width: 60%;
  }
  .ban {
    position: relative;
    margin: 6% auto;
    width: 800px;
    height: 500px;
    background-color: #fff;
    border-radius: 20px;
    display: flex;
    .van-button--block {
    display: block;
    width: 130%;
}
    h2 {
      padding: 60px 0 0 40px;
    }

    .login {
      margin-top: 60px;
      width: 55%;
      padding-left: 20px;

      .van-field__left-icon {
        padding-right: 10px;
      }
    }

    .msg {
      padding-left: 45px;
      display: flex;
      width: 58%;
      justify-content: space-between;
      align-items: center;
      color: #7888ff;
      .right {
        color: darkgray;
      }
    }
    .footer {
      position: absolute;
      bottom: 40px;
      left: 7%;
      text-align: center;
      font-size: 12px;

      span {
        color: #7888ff;
      }
    }
  }

  .right1 {
    width: 34%;
    margin-left: 20px;
    .waiter {
      color: darkgray;
      font-size: 14px;
      text-align: end;
      margin-top: 20px;
      padding-right: 5px;
    }
    img{
      height: 290px;
      width: 270px;
      margin-top: 40px;
      padding-left: -20px;
    }
    .bit2{
      color: darkgray;
      text-align: center;
      position: absolute;
      bottom: 100px;
      left:70% ;
      font-size: 16px;
    }
  }
}
</style>