<template>
  <div class="row">
    <div class="col window-height column">
      <div class="col q-pa-lg flex justify-center items-center">
        <div>
          <img src="../../assets/images/big-logo.png" style="height: 60px" class="q-mb-lg" alt="" />
          <div class="text-h5 pfb q-mb-md">欢迎回来，亲爱的用户</div>
          <div class="pfb text-grey-5 text-subtitle">通过配置您的推广渠道，实现对线索和客户的快速获取<br />并且及时的跟进</div>
        </div>
      </div>
      <div class="col q-mb-lg login-bg"></div>
    </div>
    <div class="col q-pa-xl column">
      <div class="col">
        <q-card class="w-450 q-ma-xl q-pa-xl">
          <div class="text-h5 pfb q-mb-md text-center">登录大水豚</div>
          <div class="text-center q-mb-lg">
            <span class="text-grey-5 pfb text-subtitle">新用户？</span>
            <router-link :to="{ path: '/auth/regist' }" class="text-primary pfb text-subtitle">1分钟创建新账户</router-link>
          </div>
          <div class="text-body pfb">账户：</div>
          <div class="q-mt-xs">
            <q-input standout v-model="userModel.username" dense ref="usernameRef" :rules="userValidateRule.usernameRule" />
          </div>
          <div class="row q-mt-lg">
            <div class="col text-body pfb">密码：</div>
            <div class="col text-right">
              <router-link :to="{ path: '/auth/forget' }" class="text-primary pfb text-body no-underline">忘记密码</router-link>
            </div>
          </div>
          <div class="q-mt-xs">
            <q-input standout v-model="userModel.password" dense ref="passwordRef" :rules="userValidateRule.userpasswordRule" />
          </div>
          <div class="q-mt-md">
            <q-checkbox dense v-model="userModel.remeber" label="30天免登录" color="accent" />
          </div>
          <div class="q-mt-lg text-center">
            <q-btn class="pfb" color="primary" unelevated label="登 录" style="width: 10rem" @click="loginSubmit"></q-btn>
          </div>
        </q-card>
      </div>
      <div class="q-my-lg q-mx-xl text-center w-450-only">
        <router-link :to="{ path: '/auth/forget' }" class="pfb text-body no-underline change-a-primary q-mr-md">关于大水豚</router-link>
        <router-link :to="{ path: '/auth/forget' }" class="pfb text-body no-underline change-a-primary q-mr-md">联系我们</router-link>
        <router-link :to="{ path: '/auth/forget' }" class="pfb text-body no-underline change-a-primary q-mr-md">技术支持</router-link>
      </div>
    </div>
  </div>
</template>

<script>
import { defineComponent, ref } from 'vue'
import useLgoinModule from '@/module/user/loginModule'

export default defineComponent({
  setup() {
    let { userModel, usernameRef, passwordRef, userValidateRule, loginSubmit } = useLgoinModule()

    return { userModel, usernameRef, passwordRef, userValidateRule, loginSubmit }
  }
})
</script>

<style>
.login-bg {
  background-image: url(../../assets/images/8.png);
  background-position-x: center;
  background-position-y: bottom;
  background-repeat: no-repeat;
  background-size: contain;
}
.w-450 {
  width: 450px;
  box-shadow: 0 0.5rem 1.5rem 0.5rem rgba(0, 0, 0, 0.075) !important;
  border-radius: 0.475rem !important;
}
.w-450-only{
  width: 450px;
}
</style>
