diff --git a/public/icon/star/Abyss.webp b/public/icon/star/Abyss.webp new file mode 100644 index 00000000..e8d0fdd2 Binary files /dev/null and b/public/icon/star/Abyss.webp differ diff --git a/src/components/itembox/tib-abyss-detail.vue b/src/components/itembox/tib-abyss-detail.vue new file mode 100644 index 00000000..9557c1d7 --- /dev/null +++ b/src/components/itembox/tib-abyss-detail.vue @@ -0,0 +1,30 @@ + + + + diff --git a/src/components/itembox/tib-abyss-overview.vue b/src/components/itembox/tib-abyss-overview.vue new file mode 100644 index 00000000..51e957dd --- /dev/null +++ b/src/components/itembox/tib-abyss-overview.vue @@ -0,0 +1,30 @@ + + + + diff --git a/src/components/main/t-itembox.vue b/src/components/main/t-itembox.vue index 8571de26..5e2f3ead 100644 --- a/src/components/main/t-itembox.vue +++ b/src/components/main/t-itembox.vue @@ -39,6 +39,9 @@ + diff --git a/src/components/userabyss/tua-detail-level.vue b/src/components/userabyss/tua-detail-level.vue new file mode 100644 index 00000000..91a904b1 --- /dev/null +++ b/src/components/userabyss/tua-detail-level.vue @@ -0,0 +1,25 @@ + + + + + + + + diff --git a/src/components/userabyss/tua-detail-title.vue b/src/components/userabyss/tua-detail-title.vue new file mode 100644 index 00000000..a08cfcb2 --- /dev/null +++ b/src/components/userabyss/tua-detail-title.vue @@ -0,0 +1,65 @@ + + + + + {{ props.name }} + + + + + + {{ props.val }} + + + + + + diff --git a/src/components/userabyss/tua-detail.vue b/src/components/userabyss/tua-detail.vue new file mode 100644 index 00000000..f7c61924 --- /dev/null +++ b/src/components/userabyss/tua-detail.vue @@ -0,0 +1,32 @@ + + + + + + + + + + diff --git a/src/components/userabyss/tua-overview.vue b/src/components/userabyss/tua-overview.vue new file mode 100644 index 00000000..98d364af --- /dev/null +++ b/src/components/userabyss/tua-overview.vue @@ -0,0 +1,73 @@ + + + + + {{ props.title }} + + + + + {{ props.valText }} + + + + + + + + + + + diff --git a/src/pages/User/Abyss.vue b/src/pages/User/Abyss.vue index ef22695b..4ee812b9 100644 --- a/src/pages/User/Abyss.vue +++ b/src/pages/User/Abyss.vue @@ -1,29 +1,70 @@ - - 深渊统计 - 深渊记录 + + 深渊统计 + + + + mdi-refresh + 刷新 + + + mdi-upload + 上传 + - - 胡桃深渊数据统计 - - 第 {{ item.id }} 期 + 第 {{ item.id }} 期 - - 第 {{ item.id }} 期 - {{ JSON.stringify(curAbyss) }} + + + 挑战回顾 + 更新于 {{ item.updated }} + + + + 统计周期 {{ item.startTime }} ~ {{ item.endTime }} + + + + + + + + + + + + + + + + + + + 详情 + + + + + + + 暂无数据,请尝试刷新 + + + + 胡桃深渊数据统计 @@ -31,6 +72,8 @@ // vue import { onMounted, ref } from "vue"; import ToLoading from "../../components/overlay/to-loading.vue"; +import TuaOverview from "../../components/userabyss/tua-overview.vue"; +import TuaDetail from "../../components/userabyss/tua-detail.vue"; // store import { useUserStore } from "../../store/modules/user"; // utils @@ -41,13 +84,11 @@ import TGSqlite from "../../plugins/Sqlite"; const userStore = useUserStore(); // loading const loading = ref(true); -const loadAbyss = ref(false); const loadingTitle = ref(""); // data -const abyssNow = ref(true); -const abyssTab = ref(""); -const userTab = ref(""); +const abyssTab = ref("user"); +const userTab = ref(0); const abyssCookie = ref({ cookie_token: "", account_id: "", @@ -72,21 +113,39 @@ onMounted(async () => { ltoken: userStore.getCookieItem("ltoken"), ltuid: userStore.getCookieItem("ltuid"), }; + await initAbyssData(); + loading.value = false; +}); + +async function initAbyssData () { localAbyss.value = await TGSqlite.getAbyss(); localAbyss.value.forEach((item) => { localAbyssID.value.push(item.id); }); curAbyss.value = localAbyss.value[0]; - loading.value = false; -}); + userTab.value = localAbyssID.value[0]; +} async function getAbyssData (): Promise { - loadAbyss.value = true; - const schedule = abyssNow.value ? "1" : "2"; - console.log(schedule); - const res = await TGRequest.User.byCookie.getAbyss(abyssCookie.value, schedule, user.value); - console.log(res); - loadAbyss.value = false; + loadingTitle.value = "正在获取深渊数据"; + loading.value = true; + if (localAbyssID.value.length < 2) { + loadingTitle.value = "正在获取上期深渊数据"; + const resP = await TGRequest.User.byCookie.getAbyss(abyssCookie.value, "2", user.value); + if (!resP.hasOwnProperty("retcode")) { + loadingTitle.value = "正在保存上期深渊数据"; + await TGSqlite.saveAbyss(resP as TGApp.Game.Abyss.FullData); + } + } + loadingTitle.value = "正在获取本期深渊数据"; + const res = await TGRequest.User.byCookie.getAbyss(abyssCookie.value, "1", user.value); + if (!res.hasOwnProperty("retcode")) { + loadingTitle.value = "正在保存本期深渊数据"; + await TGSqlite.saveAbyss(res as TGApp.Game.Abyss.FullData); + } + loadingTitle.value = "正在加载深渊数据"; + await initAbyssData(); + loading.value = false; } function toAbyss (id: number): void { @@ -100,6 +159,12 @@ function toAbyss (id: number): void { color: var(--content-text-3); } +.ua-btn { + margin-right: 5px; + background: #393b40; + color: #faf7e8; +} + .user-window { background: rgb(0 0 0 / 10%); display: flex; @@ -108,11 +173,20 @@ function toAbyss (id: number): void { height: calc(100vh - 100px); } -.ua-window { - padding: 10px; - width: calc(100% - 100px); - height: 100%; - overflow-y: auto; +.user-empty { + position: absolute; + top: calc(50vh - 200px); + left: calc(50vw - 400px); + background: rgb(0 0 0 / 30%); + border-radius: 5px; + width: 800px; + height: 400px; + display: flex; + flex-direction: column; + align-items: center; + font-size: 1.5rem; + color: #faf7e8; + font-family: Genshin, serif; } .ua-tab { @@ -121,4 +195,60 @@ function toAbyss (id: number): void { width: 100px; height: 100%; } + +.ua-window { + padding: 10px; + width: calc(100% - 100px); + height: 100%; +} + +.ua-window-item { + height: 100%; + padding: 10px; + overflow-y: auto; + border-radius: 5px; + box-shadow: 0 0 10px rgb(0 0 0 / 40%); +} + +.uaw-title { + display: flex; + align-items: center; + justify-content: space-between; + color: rgb(255 255 255 / 80%); + text-shadow: 0 0 10px rgb(0 0 0 / 80%); + font-size: 20px; + font-family: Genshin, serif; +} + +.uaw-sub-title { + background: rgb(0 0 0 / 20%); + display: flex; + align-items: center; + height: 30px; + padding: 0 10px; + margin: 5px 0; + border-radius: 5px; + font-family: Genshin-Light, serif; + color: rgb(255 255 255 / 80%); + text-shadow: 0 0 10px rgb(0 0 0 / 80%); +} + +.uaw-sub-title img { + width: 20px; + height: 20px; + margin-right: 5px; +} + +.uaw-o-box { + display: flex; + flex-wrap: wrap; + justify-content: space-between; +} + +.uaw-d-box { + width: 100%; + display: grid; + grid-template-columns: repeat(4, 1fr); + grid-gap: 10px; +}