mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2026-03-19 04:29:45 +08:00
45 lines
1.2 KiB
Vue
45 lines
1.2 KiB
Vue
<template>
|
|
<THomeCard :append="false">
|
|
<template #title>限时祈愿</template>
|
|
<template #default>
|
|
<div class="pool-grid">
|
|
<PhPoolCard v-for="(pool, idx) in pools" :key="idx" :pool="pool" />
|
|
</div>
|
|
</template>
|
|
</THomeCard>
|
|
</template>
|
|
<script lang="ts" setup>
|
|
import showSnackbar from "@comp/func/snackbar.js";
|
|
import PhPoolCard from "@comp/pageHome/ph-pool-card.vue";
|
|
import { onMounted, shallowRef } from "vue";
|
|
|
|
import THomeCard from "./ph-comp-card.vue";
|
|
|
|
import TGLogger from "@/utils/TGLogger.js";
|
|
import takumiReq from "@/web/request/takumiReq.js";
|
|
|
|
type TPoolEmits = (e: "success") => void;
|
|
|
|
const emits = defineEmits<TPoolEmits>();
|
|
const pools = shallowRef<Array<TGApp.BBS.Obc.GachaItem>>([]);
|
|
|
|
onMounted(async () => {
|
|
const resp = await takumiReq.obc.gacha();
|
|
if (Array.isArray(resp)) pools.value = resp;
|
|
else {
|
|
showSnackbar.error(`获取限时祈愿失败:[${resp.retcode}-${resp.message}`);
|
|
await TGLogger.Error(`获取限时祈愿失败:[${resp.retcode}-${resp.message}`);
|
|
}
|
|
emits("success");
|
|
});
|
|
</script>
|
|
<style lang="scss" scoped>
|
|
.pool-grid {
|
|
display: grid;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
gap: 8px;
|
|
grid-template-columns: repeat(2, 0.5fr);
|
|
}
|
|
</style>
|