<route lang="json5" type="page">
{
  style: {
    navigationStyle: 'custom',
  },
}
</route>

<template>
  <view class="h-screen flex flex-col">
    <Navbar
      safeAreaInsetTop
      :bordered="false"
      :fixed="true"
      :placeholder="true"
      left-arrow
      bgColor="transparent"
      @click-left="handleClickLeft"
    >
      <template #title>
        <text class="text-[#1F2329] text-[36rpx] font-medium">新高考选科</text>
      </template>
    </Navbar>
    <view class="flex flex-col justify-center items-center flex-1 pb-safe mt-[-100px]">
      <image
        class="w-[424rpx] h-[424rpx]"
        src="https://api.static.ycymedu.com/images/logo.png"
        mode="aspectFit"
      ></image>
      <view
        class="px-[32rpx] py-[16rpx] bg-[#3370FF] rounded-[40rpx] text-white text-[32rpx] font-medium flex items-center justify-center"
        @click="handleLogin"
      >
        立即登录
      </view>
    </view>
    <LoginMask v-model:show="show" @auth-ready="handleAuthReady" />
  </view>
</template>

<script setup lang="ts">
import LoginMask from './components/LoginMask.vue'
import Navbar from './components/navbar/Navbar.vue'

const show = ref(false)

const handleLogin = () => {
  show.value = true
}

// 授权完成之后返回到上一个目录去
const handleAuthReady = () => {
  uni.navigateBack()
}

const handleClickLeft = () => {
  uni.navigateBack()
}
</script>
