<template>
  <div class="main">
    <van-empty v-if="has_login" description="您的注册申请已提交，请耐心等待审核。" image="https://static.huiwings.cn/images/logo-icon.png"></van-empty>
    <van-empty v-else description="您尚未在本系统注册，请注册后使用" image="https://static.huiwings.cn/images/logo-icon.png">
      <van-button round type="primary" to="/guest/register" class="bottom-button">立刻注册</van-button>
    </van-empty>
    <div class="register-tip">
      如您已注册，请点击屏幕右上角•●•选择重新进入小程序
    </div>
  </div>
</template>

<script lang="ts">
import {computed, defineComponent} from 'vue'
import useUser from "~/store/user";
import {Button, Empty} from 'vant';

export default defineComponent({
  name: "guest-profile",
  components: {
    [Button.name!]: Button,
    [Empty.name!]: Empty,
  },
  setup(){
    const { store } = useUser();
    console.log(store.current);

    const has_login = computed(() => !!store.current.hty_id);

    return {
      has_login
    }
  }

})
</script>

<style scoped lang="less">
.main {
  padding: 1rem 0;
  .bottom-button {
    width: 160px;
    height: 40px;
  }

  .register-tip {
    text-align: center;
    color: rgb(13, 202, 240);
    margin-top: 1rem;
    font-size: 0.25rem;
  }
}
</style>
