<template>
  <van-dialog
    style="border-radius: 20px"
    v-model:show="visible"
    width="295"
    show-confirm-cutton
    confirmButtonText=" "
    confirmButtonDisabled
    :show-cancel-button="false"
  >
    <div class="relative flex w-full flex-col items-center space-y-10 rounded-[20px] py-25">
      <img src="~/assets/img/note-create/note_create_success.png" class="w-110" />
      <div class="text-3xl font-semibold text-primary">提交成功</div>
      <div class="text-base text-black-6">
        审核中，可在
        <NuxtLink to="/profile/notes" class="text-primary underline">我的游记</NuxtLink>
        中查看审核结果
      </div>
      <div class="absolute w-32 h-32 top-0 right-10">
        <img
          @click="visible = false"
          class="w-full h-full"
          src="~/assets/img/note-create/close.svg"
          alt=""
        />
      </div>
    </div>
    <template #footer>
      <div class="flex items-center justify-center space-x-20 pt-20 pb-30">
        <van-button round plain color="#FF9300" type="primary" @click="handleCheck">
          去查看
        </van-button>
        <van-button round type="primary" color="#FF9300" @click="handleNextNote">
          继续发布
        </van-button>
      </div>
    </template>
  </van-dialog>
</template>

<script setup>
const visible = defineModel('visible', false)

const emit = defineEmits(['submitOk'])

function handleNextNote() {
  visible.value = false
  navigateTo('/note-create', {
    replace: true
  })
}

function handleCheck() {
  navigateTo('/profile/notes?tab=auditing', {
    replace: true,
    query: {
      tab: 'auditing'
    }
  })
}
</script>

<style lang="scss" scoped></style>
