|
@@ -8,7 +8,7 @@
|
|
|
</route>
|
|
|
<script setup lang="ts">
|
|
|
import { logo } from '../../../core/libs/svgs'
|
|
|
-import { getBanner, getContent } from '../../../core/libs/requests'
|
|
|
+import { getBanner, getContent, getHomeBanner } from '../../../core/libs/requests'
|
|
|
import Article from '../components/article.vue'
|
|
|
import { Content } from '../../../core/libs/models'
|
|
|
|
|
@@ -42,13 +42,17 @@ const detailArticle = computed(() => {
|
|
|
...data.value,
|
|
|
}
|
|
|
} else if (type.value === 'home-banner') {
|
|
|
- return {
|
|
|
- isBanner: true,
|
|
|
- title: bannerHome.value.name,
|
|
|
- contentDetail: bannerHome.value.details,
|
|
|
- createTime: bannerHome.value.createTime.toString(),
|
|
|
- viewsCount: bannerHome.value.playCount,
|
|
|
- }
|
|
|
+ return {
|
|
|
+ isBanner: true,
|
|
|
+ ...data.value,
|
|
|
+ }
|
|
|
+ // return {
|
|
|
+ // isBanner: true,
|
|
|
+ // title: bannerHome.value.name,
|
|
|
+ // contentDetail: bannerHome.value.details,
|
|
|
+ // createTime: bannerHome.value.createTime.toString(),
|
|
|
+ // viewsCount: bannerHome.value.playCount,
|
|
|
+ // }
|
|
|
} else {
|
|
|
return {
|
|
|
isBanner: false,
|
|
@@ -89,11 +93,25 @@ onLoad(async (query: { id: string; type?: 'banner'; data?: string }) => {
|
|
|
})
|
|
|
} else if (type.value === 'home-banner') {
|
|
|
// console.log('home-banner', query.data)
|
|
|
- bannerHome.value = JSON.parse(decodeURIComponent(query.data))
|
|
|
- console.log('home-banner', bannerHome.value)
|
|
|
- uni.setNavigationBarTitle({
|
|
|
- title: bannerHome.value.name,
|
|
|
- })
|
|
|
+ // bannerHome.value = JSON.parse(decodeURIComponent(query.data))
|
|
|
+ // console.log('home-banner', bannerHome.value)
|
|
|
+ // uni.setNavigationBarTitle({
|
|
|
+ // title: bannerHome.value.name,
|
|
|
+ // })
|
|
|
+ request.value = () => getHomeBanner(id.value).then((res) => {
|
|
|
+ uni.setNavigationBarTitle({
|
|
|
+ title: res.data?.name,
|
|
|
+ })
|
|
|
+ return {
|
|
|
+ ...res,
|
|
|
+ data: {
|
|
|
+ isBanner: true,
|
|
|
+ title: res.data?.name,
|
|
|
+ contentDetail: res.data?.details,
|
|
|
+ createTime: res.data?.createTime.toString()
|
|
|
+ },
|
|
|
+ }
|
|
|
+ })
|
|
|
} else {
|
|
|
request.value = () => getContent({ id: id.value })
|
|
|
}
|