|
@@ -10,30 +10,19 @@
|
|
import { logo } from '../../../core/libs/svgs'
|
|
import { logo } from '../../../core/libs/svgs'
|
|
import Article from '../../home/components/article.vue'
|
|
import Article from '../../home/components/article.vue'
|
|
import { Content } from '@/core/libs/models'
|
|
import { Content } from '@/core/libs/models'
|
|
|
|
+import { fuckYou, fuckYouMom } from '@/core/libs/requests'
|
|
|
|
|
|
const id = ref()
|
|
const id = ref()
|
|
const type = ref()
|
|
const type = ref()
|
|
const request = ref<() => Promise<IResData<Partial<Content>>>>()
|
|
const request = ref<() => Promise<IResData<Partial<Content>>>>()
|
|
-const data = ref()
|
|
|
|
|
|
+
|
|
|
|
+const { data, run: setData } = useRequest(() => fuckYouMom({ id: id.value }))
|
|
onLoad(async (query?: { id: string; type?: 'banner' }) => {
|
|
onLoad(async (query?: { id: string; type?: 'banner' }) => {
|
|
- data.value = query
|
|
|
|
- // id.value = query.id
|
|
|
|
- // type.value = query.type
|
|
|
|
- // if (type.value === 'banner') {
|
|
|
|
- // request.value = () =>
|
|
|
|
- // getBanner(id.value).then((res) => ({
|
|
|
|
- // ...res,
|
|
|
|
- // data: {
|
|
|
|
- // title: res.data?.name,
|
|
|
|
- // contentDetail: res.data?.bannerDetailsContent,
|
|
|
|
- // createTime: res.data?.createTime.toString(),
|
|
|
|
- // viewsCount: res.data?.viewCount,
|
|
|
|
- // },
|
|
|
|
- // }))
|
|
|
|
- // } else {
|
|
|
|
- // request.value = () => getContent({ id: id.value })
|
|
|
|
- // }
|
|
|
|
- // await run()
|
|
|
|
|
|
+ if (query.id) {
|
|
|
|
+ id.value = query.id
|
|
|
|
+ }
|
|
|
|
+ await setData()
|
|
|
|
+ await fuckYou({ id: Number(id.value) })
|
|
})
|
|
})
|
|
</script>
|
|
</script>
|
|
<template>
|
|
<template>
|
|
@@ -41,9 +30,9 @@ onLoad(async (query?: { id: string; type?: 'banner' }) => {
|
|
<Article
|
|
<Article
|
|
:title="data?.title"
|
|
:title="data?.title"
|
|
:author="{ name: '筑巢荟' }"
|
|
:author="{ name: '筑巢荟' }"
|
|
- :content="data?.contentDetail"
|
|
|
|
|
|
+ :content="data?.detailBody"
|
|
:createAt="data?.createTime"
|
|
:createAt="data?.createTime"
|
|
- :viewNum="data?.viewsCount || 0"
|
|
|
|
|
|
+ :viewNum="data?.viewCount || 0"
|
|
>
|
|
>
|
|
<template #avatar><wd-img width="28" height="28" :src="logo"></wd-img></template>
|
|
<template #avatar><wd-img width="28" height="28" :src="logo"></wd-img></template>
|
|
</Article>
|
|
</Article>
|