diff --git a/src/plugins/Mys/utils/getNewsCard.ts b/src/plugins/Mys/utils/getNewsCard.ts index 8378b800..f31847fc 100644 --- a/src/plugins/Mys/utils/getNewsCard.ts +++ b/src/plugins/Mys/utils/getNewsCard.ts @@ -117,7 +117,7 @@ export function getActivityCard( const startTime = new Date(Number(item.news_meta.start_at_sec) * 1000).toLocaleDateString(); const endTime = new Date(Number(item.news_meta.end_at_sec) * 1000).toLocaleDateString(); const statusInfo = getActivityStatus(item.news_meta.activity_status); - let commonCard = getCommonCard(item); + const commonCard = getCommonCard(item); commonCard.subtitle = `${startTime} - ${endTime}`; commonCard.status = statusInfo; return activityCard.push(commonCard); diff --git a/src/views/t-news.vue b/src/views/t-news.vue index bf6d19e9..c592192d 100644 --- a/src/views/t-news.vue +++ b/src/views/t-news.vue @@ -15,6 +15,7 @@ mdi-view-list {{ item.title }} - - - - 查看 + + + + + + + + + + + + {{ item.user.nickname }} + {{ item.user.label }} + + + 查看详情 + + + JSON - id:{{ item.postId }} - - - - - JSON - - + + + {{ item.forum.name }} + + + + + mdi-eye + {{ item.data.view }} + + + mdi-star + {{ item.data.mark }} + + + mdi-comment + {{ item.data.reply }} + + + mdi-heart + {{ item.data.like }} + + + mdi-share-variant + {{ item.data.forward }} + + + - - - 已加载:{{ rawData.notice.lastId }},加载更多 @@ -62,41 +95,64 @@ + + {{ item.status?.status }} + {{ item.title }} {{ item.subtitle }} - - - - - 查看 - - - id:{{ item.postId }} - - - {{ item.status?.status }} - + + + + + + + + + + + + {{ item.user.nickname }} + {{ item.user.label }} + - - - - - JSON + 查看详情 + + + JSON - + + + {{ item.forum.name }} + + + + + mdi-eye + {{ item.data.view }} + + + mdi-star + {{ item.data.mark }} + + + mdi-comment + {{ item.data.reply }} + + + mdi-heart + {{ item.data.like }} + + + mdi-share-variant + {{ item.data.forward }} + + + - - - 已加载:{{ rawData.activity.lastId }},加载更多 @@ -108,28 +164,58 @@ {{ item.title }} - - - - - 查看 - + + + + + + + + + + + + {{ item.user.nickname }} + {{ item.user.label }} + + + 查看详情 + + + JSON - id:{{ item.postId }} - - - - - JSON - - + + + {{ item.forum.name }} + + + + + mdi-eye + {{ item.data.view }} + + + mdi-star + {{ item.data.mark }} + + + mdi-comment + {{ item.data.reply }} + + + mdi-heart + {{ item.data.like }} + + + mdi-share-variant + {{ item.data.forward }} + + + - - - 已加载:{{ rawData.news.lastId }},加载更多 @@ -156,7 +242,7 @@ import { createTGWindow } from "../utils/TGWindow"; // 路由 const router = useRouter(); -const gid = useRoute().params.gid; +const gid = useRoute().params.gid; const showNews = ref(gid !== "5"); // Store @@ -275,24 +361,25 @@ async function loadMore(data: "notice" | "activity" | "news"): Promise { } async function toPost(item: TGApp.Plugins.Mys.News.RenderCard | string) { - if (typeof item === "string") { - const path = router.resolve({ - name: "帖子详情", - params: { - // eslint-disable-next-line camelcase - post_id: item, - }, - }).href; - createTGWindow(path, "帖子-Dev", item, 960, 720, false, false); - } else { - const path = router.resolve({ - name: "帖子详情", - params: { - post_id: item.postId.toString(), - }, - }).href; - createTGWindow(path, "帖子", item.title, 960, 720, false, false); - } + console.log(item); + // if (typeof item === "string") { + // const path = router.resolve({ + // name: "帖子详情", + // params: { + // // eslint-disable-next-line camelcase + // post_id: item, + // }, + // }).href; + // createTGWindow(path, "帖子-Dev", item, 960, 720, false, false); + // } else { + // const path = router.resolve({ + // name: "帖子详情", + // params: { + // post_id: item.postId.toString(), + // }, + // }).href; + // createTGWindow(path, "帖子", item.title, 960, 720, false, false); + // } } async function toJson(item: TGApp.Plugins.Mys.News.RenderCard | string) { @@ -349,6 +436,10 @@ async function searchPost() { font-family: var(--font-title); } +.news-search { + margin-left: 10px; +} + .news-grid { display: grid; padding: 5px; @@ -404,23 +495,167 @@ async function searchPost() { white-space: normal; } -.news-btn { +/* news item info */ +.news-card-info { + display: flex; + flex-wrap: wrap; + align-items: center; + justify-content: start; + margin: 0 10px 10px; + gap: 10px; +} + +.news-card-user { + display: flex; + max-width: 200px; + height: 50px; + align-items: center; +} + +.ncu-left { + position: relative; + width: 50px; + height: 50px; +} + +.ncu-icon { + position: absolute; + top: 5px; + left: 5px; + overflow: hidden; + width: 40px; + height: 40px; + border-radius: 50%; +} + +.ncu-icon img { + width: 100%; + height: 100%; + object-fit: cover; +} + +.ncu-pendant { + position: absolute; + top: 0; + left: 0; + overflow: hidden; + width: 50px; + height: 50px; + border-radius: 50%; +} + +.ncu-pendant img { + width: 100%; + height: 100%; + object-fit: cover; +} + +.ncu-right { + display: flex; + height: 50px; + flex-direction: column; + align-items: start; +} + +.ncu-right :nth-child(1) { display: flex; height: 30px; align-items: center; - justify-content: center; - border-radius: 5px; - background: var(--common-btn-bg-2); - color: var(--common-btn-bgt-2); + justify-content: start; + font-size: 16px; } -.news-btn img { +.ncu-right :nth-child(2) { + display: flex; + height: 20px; + align-items: center; + justify-content: start; + border-top: 2px solid var(--common-shadow-2); + font-size: 8px; + opacity: 0.7; +} + +.news-card-forum { + position: absolute; + top: 0; + right: 0; + display: flex; + align-items: center; + justify-content: flex-start; + padding: 5px; + backdrop-filter: blur(20px); + background: rgb(0 0 0/20%); + border-bottom-left-radius: 5px; + border-top-right-radius: 5px; + box-shadow: 0 0 10px rgb(0 0 0); + color: #faf7e8; +} + +.news-card-forum img { width: 20px; height: 20px; margin-right: 5px; +} + +.news-card-btn { + border-radius: 5px; + margin-left: auto; +} + +.news-dev-btn { + border-radius: 5px; + margin-left: auto; + background: var(--common-bg-1); + box-shadow: 0 0 10px var(--common-shadow-4); + color: var(--common-bgt-1); + font-family: var(--font-title); +} + +.news-dev-btn img { + width: 20px; + height: 20px; + padding: 5px; + border-radius: 50%; + margin-right: 5px; + background: var(--common-shadow-2); object-fit: cover; } +.news-card-data { + display: flex; + width: 100%; + height: 20px; + align-items: center; + justify-content: flex-start; + padding: 5px; + column-gap: 10px; +} + +.ncd-item { + display: flex; + align-items: center; + justify-content: flex-start; + color: var(--common-text-quote); + font-size: 12px; + gap: 5px; + opacity: 0.6; +} + +/* 活动页 */ +.news-act-process { + position: absolute; + bottom: 0; + left: 0; + display: flex; + align-items: center; + justify-content: center; + padding: 5px; + backdrop-filter: blur(20px); + background: rgb(0 0 0/20%); + border-top-right-radius: 5px; + box-shadow: 0 0 10px rgb(0 0 0); +} + /* load more */ .load-news { display: flex;