diff --git a/backend/.tmp/data.db b/backend/.tmp/data.db index 55a672b..694e88d 100644 Binary files a/backend/.tmp/data.db and b/backend/.tmp/data.db differ diff --git a/frontend/components/ArticlesList/Item.vue b/frontend/components/ArticlesList/Item.vue deleted file mode 100644 index cae6ae8..0000000 --- a/frontend/components/ArticlesList/Item.vue +++ /dev/null @@ -1,69 +0,0 @@ - - - - - diff --git a/frontend/components/ArticlesList/Items/Bottombar.vue b/frontend/components/ArticlesList/Items/Bottombar.vue new file mode 100644 index 0000000..22cb132 --- /dev/null +++ b/frontend/components/ArticlesList/Items/Bottombar.vue @@ -0,0 +1,29 @@ + + + + + diff --git a/frontend/components/ArticlesList/Items/Link.vue b/frontend/components/ArticlesList/Items/Link.vue new file mode 100644 index 0000000..367b40b --- /dev/null +++ b/frontend/components/ArticlesList/Items/Link.vue @@ -0,0 +1,15 @@ + + + diff --git a/frontend/components/ArticlesList/Items/Mainbar.vue b/frontend/components/ArticlesList/Items/Mainbar.vue new file mode 100644 index 0000000..70ce97f --- /dev/null +++ b/frontend/components/ArticlesList/Items/Mainbar.vue @@ -0,0 +1,17 @@ + + + diff --git a/frontend/components/ArticlesList/Items/Topbar.vue b/frontend/components/ArticlesList/Items/Topbar.vue new file mode 100644 index 0000000..eca1946 --- /dev/null +++ b/frontend/components/ArticlesList/Items/Topbar.vue @@ -0,0 +1,24 @@ + + + diff --git a/frontend/components/ArticlesList/Items/index.vue b/frontend/components/ArticlesList/Items/index.vue new file mode 100644 index 0000000..d51fb04 --- /dev/null +++ b/frontend/components/ArticlesList/Items/index.vue @@ -0,0 +1,67 @@ + + + + + diff --git a/frontend/components/ArticlesList/index.vue b/frontend/components/ArticlesList/index.vue index b244fc9..5e33bfd 100644 --- a/frontend/components/ArticlesList/index.vue +++ b/frontend/components/ArticlesList/index.vue @@ -4,6 +4,7 @@ let pagenum = 1 const isLoading = useState('isLoading', () => false) const isEmpty = useState('isEmpty', () => false) const artlistData = useArtlist([]) +const artlistAd = await useFetchArtlistAd() const addArtListItem = () => { if (useScrollBottom()) { pagenum++ @@ -42,7 +43,7 @@ onUnmounted(() => {
diff --git a/frontend/composables/Articlelist/useArtlistFn.ts b/frontend/composables/Articlelist/useArtlistFn.ts index 4bde075..177b9a1 100644 --- a/frontend/composables/Articlelist/useArtlistFn.ts +++ b/frontend/composables/Articlelist/useArtlistFn.ts @@ -1,4 +1,4 @@ -import type { IArticleItem } from '~~/types/IArticleItem' +import type { IArticleAd, IArticleItem } from '~~/types/IArticleItem' export const formatTime = (createdAt: string): string => { const created = new Date(createdAt) const now = new Date() @@ -22,6 +22,10 @@ export const useArtlistPath = (path?: string | undefined) => useState('artlistPa return '' return path }) +export const useFetchArtlistAd = async (): Promise => { + const { data } = await useFetch('/api/global') + return data.value +} export const useFetchPostData = async ( type?: string, sort: any = 'recommended', diff --git a/frontend/types/IArticleItem.ts b/frontend/types/IArticleItem.ts index 34ad405..9df1b72 100644 --- a/frontend/types/IArticleItem.ts +++ b/frontend/types/IArticleItem.ts @@ -1,11 +1,9 @@ interface IAuthor { name: string } - interface ITagItem { tag: string } - interface IArticleItem { id: string title: string @@ -17,8 +15,16 @@ interface IArticleItem { createdAt: string authorId: IAuthor tagIds: { data: ITagItem[] } - error?: boolean +} +interface IArticleAd { + title: string + author: string + summary: string + cover: string + url: string } export { IArticleItem, + IArticleAd, + ITagItem, }