![]()
@@ -126,6 +126,7 @@ type PhSignItemProps = {
account: TGApp.Sqlite.Account.Game;
info?: TGApp.BBS.Sign.HomeRes;
stat?: TGApp.BBS.Sign.InfoRes;
+ cur?: boolean;
};
type PhSignItemEmits = {
(e: "delete", account: TGApp.Sqlite.Account.Game): void;
@@ -540,6 +541,12 @@ async function shareItem(): Promise
{
border-radius: 4px;
background: var(--box-bg-1);
row-gap: 8px;
+ transition: border-color 0.3s ease;
+
+ &.ph-si-current {
+ border-width: 2px;
+ border-color: var(--common-shadow-2);
+ }
}
.ph-si-top {
diff --git a/src/pages/common/PageHome.vue b/src/pages/common/PageHome.vue
index 44e3f667..aa644d76 100644
--- a/src/pages/common/PageHome.vue
+++ b/src/pages/common/PageHome.vue
@@ -54,7 +54,7 @@
density="compact"
label="首页组件显示"
variant="outlined"
- width="440px"
+ width="360px"
/>
确定
@@ -72,10 +72,9 @@ import showDialog from "@comp/func/dialog.js";
import showLoading from "@comp/func/loading.js";
import showSnackbar from "@comp/func/snackbar.js";
import PhCompCalendar from "@comp/pageHome/ph-comp-calendar.vue";
-import PhCompDailyNote from "@comp/pageHome/ph-comp-daily-note.vue";
+import PhCompGameStatus from "@comp/pageHome/ph-comp-game-status.vue";
import PhCompPool from "@comp/pageHome/ph-comp-pool.vue";
import PhCompPosition from "@comp/pageHome/ph-comp-position.vue";
-import PhCompSign from "@comp/pageHome/ph-comp-sign.vue";
import TSUserAccount from "@Sqlm/userAccount.js";
import useAppStore from "@store/app.js";
import useBBSStore from "@store/bbs.js";
@@ -116,7 +115,7 @@ const games = shallowRef>();
const loadItems = shallowRef>([]);
const components = shallowRef>([]);
const showItems = shallowRef>([]);
-const showItemsAll = shallowRef>(["素材日历", "限时祈愿", "近期活动"]);
+const showItemsAll = shallowRef>(["素材日历", "限时祈愿", "近期活动", "便笺签到"]);
const oldItems = shallowRef>([]);
onMounted(async () => {
@@ -130,9 +129,9 @@ onMounted(async () => {
await showLoading.start("正在加载首页小部件");
games.value = gameList.value.map((i) => ({ icon: i.app_icon, title: i.name, gid: i.id }));
showItems.value = homeStore.getShowItems();
- showItemsAll.value = ["游戏签到", "实时便笺", "素材日历", "限时祈愿", "近期活动"];
+ showItemsAll.value = ["便笺签到", "素材日历", "限时祈愿", "近期活动"];
} else {
- showItems.value = homeStore.getShowItems().filter((i) => i !== "游戏签到");
+ showItems.value = homeStore.getShowItems().filter((i) => i !== "便笺签到");
showItemsAll.value = ["素材日历", "限时祈愿", "近期活动"];
}
oldItems.value = showItems.value;
@@ -152,18 +151,11 @@ async function loadComp(): Promise {
const temp: Array = [];
for (const item of showItems.value) {
switch (item) {
- case "游戏签到":
+ case "便笺签到":
if (isLogin.value) {
- temp.push(PhCompSign);
+ temp.push(PhCompGameStatus);
} else {
- showSnackbar.warn("未登录不可设置游戏签到组件");
- }
- break;
- case "实时便笺":
- if (isLogin.value) {
- temp.push(PhCompDailyNote);
- } else {
- showSnackbar.warn("未登录不可设置实时便笺组件");
+ showSnackbar.warn("未登录不可设置便笺签到组件");
}
break;
case "限时祈愿":
@@ -198,10 +190,8 @@ async function submitHome(): Promise {
function getName(name: string): string | undefined {
switch (name) {
- case "ph-comp-sign":
- return "游戏签到";
- case "ph-comp-daily-note":
- return "实时便笺";
+ case "ph-comp-game-status":
+ return "便笺签到";
case "ph-comp-pool":
return "限时祈愿";
case "ph-comp-position":
diff --git a/src/store/modules/home.ts b/src/store/modules/home.ts
index b5ace510..f26e1311 100644
--- a/src/store/modules/home.ts
+++ b/src/store/modules/home.ts
@@ -1,6 +1,6 @@
/**
* 首页组件状态
- * @since Beta v0.10.0
+ * @since Beta v0.10.1
*/
import { defineStore } from "pinia";
@@ -13,8 +13,7 @@ const defaultHomeShow: Array = [
{ show: true, order: 1, label: "限时祈愿" },
{ show: true, order: 2, label: "近期活动" },
{ show: true, order: 3, label: "素材日历" },
- { show: false, order: 4, label: "游戏签到" },
- { show: false, order: 5, label: "实时便笺" },
+ { show: false, order: 4, label: "便笺签到" },
];
const useHomeStore = defineStore("home", () => {
@@ -29,25 +28,20 @@ const useHomeStore = defineStore("home", () => {
try {
const storedItems: Array = JSON.parse(homeShowLocal);
if (!Array.isArray(storedItems)) {
- // Invalid data, reset to default
localStorage.setItem("homeShow", JSON.stringify(homeShow.value));
} else {
- // Merge with default items to add new items
const storedLabels = storedItems.map((i) => i.label);
- // Add new items from default that don't exist in stored
for (const defaultItem of homeShow.value) {
if (!storedLabels.includes(defaultItem.label)) {
- storedItems.push({ ...defaultItem });
+ if (defaultHomeShow.includes(defaultItem)) storedItems.push({ ...defaultItem });
}
}
- // Remove items that no longer exist in default
const defaultLabels = homeShow.value.map((i) => i.label);
homeShow.value = storedItems.filter((item) => defaultLabels.includes(item.label));
localStorage.setItem("homeShow", JSON.stringify(homeShow.value));
}
} catch (e) {
console.error(e);
- // Invalid JSON, reset to default
localStorage.setItem("homeShow", JSON.stringify(homeShow.value));
}
}