From 8ffb95ed907390423afe1f549a5543d24df2e387 Mon Sep 17 00:00:00 2001 From: BTMuli Date: Sat, 1 Apr 2023 18:51:32 +0800 Subject: [PATCH] =?UTF-8?q?fix(style):=20=E6=A0=B7=E5=BC=8F=E7=BE=8E?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/css/mys-parser.css | 1 + src/assets/icons/arrow-left.svg | 6 +- src/assets/icons/arrow-right.svg | 4 +- src/assets/index.css | 6 +- src/components/t-loading.vue | 2 +- src/components/t-pool.vue | 2 +- src/components/t-position.vue | 2 +- src/components/t-sidebar.vue | 2 +- src/pages/Achievements.vue | 2 +- src/pages/Config.vue | 2 +- src/pages/News.vue | 136 +++++++++++++++---------------- 11 files changed, 79 insertions(+), 86 deletions(-) diff --git a/src/assets/css/mys-parser.css b/src/assets/css/mys-parser.css index 749ad59c..8bce341a 100644 --- a/src/assets/css/mys-parser.css +++ b/src/assets/css/mys-parser.css @@ -51,6 +51,7 @@ .mys-post-vod { width: 800px; height: 450px; + border-radius: 10px; } .mys-post-iframe { diff --git a/src/assets/icons/arrow-left.svg b/src/assets/icons/arrow-left.svg index eb562576..6e041f1b 100644 --- a/src/assets/icons/arrow-left.svg +++ b/src/assets/icons/arrow-left.svg @@ -1,13 +1,13 @@ - + Created with Pixso. - + - + diff --git a/src/assets/icons/arrow-right.svg b/src/assets/icons/arrow-right.svg index ef6ac832..1be6f2f0 100644 --- a/src/assets/icons/arrow-right.svg +++ b/src/assets/icons/arrow-right.svg @@ -1,7 +1,7 @@ - + Created with Pixso. - + diff --git a/src/assets/index.css b/src/assets/index.css index 31d68479..41f000cb 100644 --- a/src/assets/index.css +++ b/src/assets/index.css @@ -26,11 +26,7 @@ color: #faf7e8 !important; } -.card-btn svg { +.card-btn img { width: 18px; height: 18px; } - -.card-btn svg path { - fill: #faf7e8; -} diff --git a/src/components/t-loading.vue b/src/components/t-loading.vue index d33daaea..5c9a3c73 100644 --- a/src/components/t-loading.vue +++ b/src/components/t-loading.vue @@ -38,7 +38,7 @@ const props = defineProps({ }, }); -
- +
+ cover +
{{ item.title }} - + 查看 id:{{ item.post_id }} - + JSON @@ -43,9 +45,9 @@
- + 已加载:{{ noticeData.last_id }},加载更多 @@ -54,20 +56,21 @@
- +
+ cover +
{{ item.title }} {{ item.subtitle }} - + 查看 id:{{ item.post_id }}
+ JSON @@ -85,9 +88,9 @@
- + 已加载:{{ activityData.last_id }},加载更多 @@ -96,19 +99,21 @@
- +
+ cover +
{{ item.title }} - + 查看 id:{{ item.post_id }} - + JSON @@ -116,9 +121,9 @@
- + 已加载:{{ newsData.last_id }},加载更多 @@ -136,9 +141,6 @@ import TLoading from "../components/t-loading.vue"; import { dialog } from "@tauri-apps/api"; // store import useAppStore from "../store/modules/app"; -// tools -// @ts-ignore -import "../tools/svg-inject.js"; // plugin import MysOper from "../plugins/Mys"; // utils @@ -153,6 +155,7 @@ const appStore = useAppStore(); // loading const loading = ref(true); const loadingTitle = ref("正在加载"); +const loadingSub = ref(false); // 路由 const router = useRouter(); // search @@ -188,55 +191,46 @@ onMounted(async () => { // 加载更多 async function loadMore(data: string) { - let check = true; + loadingSub.value = true; switch (data) { case "notice": if (noticeData.value.is_last) { await dialog.message("已经是最后一页了"); + loadingSub.value = false; return; } - if (noticeData.value.last_id === 50) { - check = await dialog.confirm("由于API限制,获取到的数据数量可能变更为20,是否继续?"); - if (!check) return; - } - loading.value = true; - loadingTitle.value = "正在获取公告数据..."; - noticeData.value = await MysOper.News.get.notice(noticeData.value.last_id + 10); - loadingTitle.value = "正在渲染数据..."; + const getNotice = await MysOper.News.get.notice(20, noticeData.value.last_id); + noticeData.value.last_id = getNotice.last_id; + noticeData.value.is_last = getNotice.is_last; + noticeData.value.list = noticeData.value.list.concat(getNotice.list); postData.value.notice = MysOper.News.card.notice(noticeData.value); - loading.value = false; + loadingSub.value = false; break; case "activity": if (activityData.value.is_last) { await dialog.message("已经是最后一页了"); + loadingSub.value = false; return; } - if (activityData.value.last_id === 50) { - check = await dialog.confirm("由于API限制,获取到的数据数量可能变更为20,是否继续?"); - if (!check) return; - } - loading.value = true; - loadingTitle.value = "正在获取活动数据..."; - activityData.value = await MysOper.News.get.activity(activityData.value.last_id + 10); - loadingTitle.value = "正在渲染数据..."; + const getActivity = await MysOper.News.get.activity(20, activityData.value.last_id); + activityData.value.last_id = getActivity.last_id; + activityData.value.is_last = getActivity.is_last; + activityData.value.list = activityData.value.list.concat(getActivity.list); postData.value.activity = MysOper.News.card.activity(activityData.value); - loading.value = false; + loadingSub.value = false; break; case "news": if (newsData.value.is_last) { await dialog.message("已经是最后一页了"); + loadingSub.value = false; return; } - if (newsData.value.last_id === 50) { - check = await dialog.confirm("由于API限制,获取到的数据数量可能变更为20,是否继续?"); - if (!check) return; - } - loading.value = true; - loadingTitle.value = "正在获取新闻数据..."; - newsData.value = await MysOper.News.get.news(newsData.value.last_id + 10); - loadingTitle.value = "正在渲染数据..."; + const getNews = await MysOper.News.get.news(20, newsData.value.last_id); + newsData.value.last_id = getNews.last_id; + newsData.value.is_last = getNews.is_last; + newsData.value.list = newsData.value.list.concat(getNews.list); postData.value.news = MysOper.News.card.news(newsData.value); - loading.value = false; + loadingSub.value = false; break; } } @@ -297,7 +291,7 @@ async function searchPost() { } -