<route lang="json">
{
  "style": {
    "navigationBarTitleText": "详情",
    "navigationBarBackgroundColor": "#fff"
  }
}
</route>
<script setup lang="ts">
import { logo } from '../../../core/libs/svgs'
import Article from '../../home/components/article.vue'
import { Content } from '@/core/libs/models'
import { fuckYou, fuckYouMom } from '@/core/libs/requests'

const id = ref()
const type = ref()
const request = ref<() => Promise<IResData<Partial<Content>>>>()

const { data, run: setData } = useRequest(() => fuckYouMom({ id: id.value }))
onLoad(async (query?: { id: string; type?: 'banner' }) => {
  if (query.id) {
    id.value = query.id
  }
  await setData()
  await fuckYou({ id: Number(id.value) })
})
</script>
<template>
  <div class="flex-grow bg-white">
    <Article
      :title="data?.title"
      :author="{ name: '筑巢荟' }"
      :content="data?.detailBody"
      :createAt="data?.createTime"
      :viewNum="data?.viewCount || 0"
    >
      <template #avatar><wd-img width="28" height="28" :src="logo"></wd-img></template>
    </Article>
  </div>
</template>
