<script setup lang="ts">
const route = useRoute();
const showHeader = computed(() => route.path !== "/home/user");
// const showFooter = computed(
//   () => route.path === "/home/user" || route.path === "/"
// );
const isLogin: any = useCookie("tokenKey");
const user = useUserStore();
const isClose: any = useCookie("isClose", {
  maxAge: 60 * 60 * 24,
});
let open = ref({
  regOpen: false,
});
onMounted(() => {
  if (!isLogin.value && !isClose.value) {
    // 公告弹出了才能弹注册
    if (getLocalStorageWithExpiry("clubDialogFalg")) {
      setTimeout(() => {
        user.value.regOpen = true;
      }, 3000);
    }
  }
});
function dialogClose() {
  isClose.value = true;
}
function done() {
  user.value.regOpen = false;
}
</script> 
<template>
  <div class="common-layout">
    <h-Header v-if="showHeader" />
    <slot />
    <h-Footer />
    <!-- <h-Footer v-if="showFooter" /> -->
  </div>
</template>
<style scoped lang="scss">
.el-container {
  flex-direction: column;
}
</style>
