-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #121 from MarleneJiang/issue-54-新增文章列表
Issue 54 新增文章列表
- Loading branch information
Showing
19 changed files
with
179 additions
and
94 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<script setup lang="ts"> | ||
defineProps({ | ||
viewed: Number, | ||
liked: Number, | ||
commented: Number, | ||
}) | ||
const format = (num: number) => { | ||
return num > 10000 ? `${(num / 10000).toFixed(1)}w` : num | ||
} | ||
</script> | ||
|
||
<template> | ||
<div class="flex all-flex all-items-center all-text-jj_sec_app all-text-[13px]"> | ||
<div> | ||
<div class="i-carbon-view" /> | ||
<span class="pl-2">{{ viewed ? format(viewed) : '观看' }}</span> | ||
</div> | ||
<div class="mx-7"> | ||
<div class="i-carbon-thumbs-up" /> | ||
<span class="pl-2">{{ liked ? format(liked) : '点赞' }}</span> | ||
</div> | ||
<div> | ||
<div class="i-carbon-chat" /> | ||
<span class="pl-2">{{ commented ? format(commented) : '评论' }}</span> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<style scoped></style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<script setup lang="ts"> | ||
defineProps({ | ||
cover: String, | ||
summary: String, | ||
}) | ||
</script> | ||
|
||
<template> | ||
<div class="px-[1.67rem]"> | ||
<nuxt-img | ||
v-if="cover" | ||
:src="cover" | ||
:alt="summary" | ||
width="120" | ||
height="80" | ||
loading="lazy" | ||
fit="cover" | ||
quality="80" | ||
format="webp" | ||
/> | ||
</div> | ||
</template> | ||
|
||
<style scoped></style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<script lang="ts" setup> | ||
defineProps({ | ||
id: String, | ||
url: String, | ||
}) | ||
</script> | ||
|
||
<template> | ||
<NuxtLink v-if="id" class="flex-1 pl-[1.67rem] truncate" :to="`/article/${id}`"> | ||
<slot /> | ||
</NuxtLink> | ||
<NuxtLink v-if="url" class="flex-1 pl-[1.67rem] truncate" :to="`/article/${url}`"> | ||
<slot /> | ||
</NuxtLink> | ||
</template> | ||
|
||
<style scoped> | ||
a:visited { | ||
color: #909090; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<script setup lang="ts"> | ||
defineProps({ | ||
title: String, | ||
summary: String, | ||
}) | ||
</script> | ||
|
||
<template> | ||
<div class="py-4"> | ||
<div class="truncate text-jj_sec-app text-[16px] title font-semibold tracking-wide"> | ||
{{ title }} | ||
</div> | ||
<div class="truncate pt-4 text-jj_thirdly text-[13px]"> | ||
{{ summary }} | ||
</div> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<script setup lang="ts"> | ||
import type { ITagItem } from '~~/types/IArticleItem' | ||
defineProps({ | ||
name: String, | ||
duration: String, | ||
tags: { | ||
type: Array<ITagItem>, | ||
required: true, | ||
}, | ||
}) | ||
</script> | ||
|
||
<template> | ||
<div class="flex items-center pr-4 text-[13px]"> | ||
<span class="text-jj_sec-app px-3 border-r-1 pl-0">{{ name }}</span> | ||
<span class="text-jj_thirdly px-3 border-r-1">{{ duration }}</span> | ||
<div class="flex px-3"> | ||
<div v-for="(item, index) of tags" :key="item.tag" class="items-center flex"> | ||
<span class="px-0 text-jj_thirdly">{{ item.tag }}</span> | ||
<div v-if="index !== tags.length - 1" class="i-carbon-circle-solid px-2 text-[0.15rem]" /> | ||
</div> | ||
</div> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<script setup lang="ts"> | ||
import type { IArticleItem } from '~~/types/IArticleItem' | ||
defineProps({ | ||
artlistItem: { | ||
type: Array<IArticleItem>, | ||
}, | ||
}) | ||
</script> | ||
|
||
<template> | ||
<li | ||
v-for="artItem in artlistItem" | ||
:key="artItem.id" | ||
class="f-c-c py-4 transition-all hover:bg-[#FAFAFA] b-b b-grey all-cursor-pointer" | ||
> | ||
<ArticlesListItemsLink :id="artItem.id"> | ||
<ArticlesListItemsTopbar | ||
:name="artItem.authorId.name" | ||
:duration="formatTime(artItem.createdAt)" | ||
:tags="artItem.tagIds.data" | ||
/> | ||
<ArticlesListItemsMainbar | ||
:title="artItem.title" | ||
:summary="artItem.summary" | ||
/> | ||
<ArticlesListItemsBottombar | ||
:viewed="artItem.viewed" | ||
:liked="artItem.liked" | ||
:commented="artItem.commented" | ||
/> | ||
</ArticlesListItemsLink> | ||
<ArticlesListItemsImg | ||
:cover="artItem.cover" | ||
:summary="artItem.summary" | ||
/> | ||
</li> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
63e5867
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
byte-dream-jue-jin – ./
byte-dream-jue-jin-byte-dream.vercel.app
byte-dream-jue-jin.vercel.app
vercel.bytedream.top
byte-dream-jue-jin-git-main-byte-dream.vercel.app