mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-16 09:58:13 +08:00
🎨 代码格式化
This commit is contained in:
@@ -21,7 +21,7 @@ onMounted(async () => {
|
||||
overview.value = await HutaoRequest.Abyss.getOverview();
|
||||
});
|
||||
|
||||
function getUpdated () {
|
||||
function getUpdated() {
|
||||
return new Date(overview.value.timestamp)
|
||||
.toLocaleString("zh-CN", { hour12: false })
|
||||
.replace(/\//g, "-");
|
||||
|
||||
@@ -3,9 +3,7 @@
|
||||
<div v-for="item in cardsInfo" :key="item.id" class="card-box" @click="toOuter(item)">
|
||||
<TibWikiAvatar size="128px" :model-value="item" />
|
||||
</div>
|
||||
<v-snackbar v-model="snackbar" timeout="1500" color="error">
|
||||
该角色暂无详情
|
||||
</v-snackbar>
|
||||
<v-snackbar v-model="snackbar" timeout="1500" color="error"> 该角色暂无详情 </v-snackbar>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -23,7 +21,7 @@ const snackbar = ref(false);
|
||||
// data
|
||||
const cardsInfo = computed(() => AppCharacterData);
|
||||
|
||||
function toOuter (item: TGApp.App.Character.WikiBriefInfo) {
|
||||
function toOuter(item: TGApp.App.Character.WikiBriefInfo) {
|
||||
if (item.contentId === 0) {
|
||||
snackbar.value = true;
|
||||
return;
|
||||
@@ -31,7 +29,6 @@ function toOuter (item: TGApp.App.Character.WikiBriefInfo) {
|
||||
const url = OBC_CONTENT_API.replace("{content_id}", item.contentId.toString());
|
||||
createTGWindow(url, "角色详情", item.name, 1200, 800, true);
|
||||
}
|
||||
|
||||
</script>
|
||||
<style scoped>
|
||||
.cards-grid {
|
||||
|
||||
@@ -2,15 +2,9 @@
|
||||
<TOLoading v-model="loading" title="正在加载卡牌列表" />
|
||||
<v-tabs v-model="tab" align-tabs="start" class="cards-tab">
|
||||
<div v-show="!doSearch">
|
||||
<v-tab value="character">
|
||||
角色牌
|
||||
</v-tab>
|
||||
<v-tab value="action">
|
||||
行动牌
|
||||
</v-tab>
|
||||
<v-tab value="monster">
|
||||
魔物牌
|
||||
</v-tab>
|
||||
<v-tab value="character"> 角色牌 </v-tab>
|
||||
<v-tab value="action"> 行动牌 </v-tab>
|
||||
<v-tab value="monster"> 魔物牌 </v-tab>
|
||||
</div>
|
||||
<v-spacer />
|
||||
<v-text-field
|
||||
@@ -28,14 +22,16 @@
|
||||
<v-window-item value="character">
|
||||
<div class="cards-grid">
|
||||
<v-card
|
||||
v-for="item in CardsInfoC" :key="item.contentId" class="card-cls"
|
||||
v-for="item in CardsInfoC"
|
||||
:key="item.contentId"
|
||||
class="card-cls"
|
||||
@click="toOuter(item.name, item.contentId)"
|
||||
>
|
||||
<div class="card-border">
|
||||
<img src="/WIKI/GCG/bg/normal.webp" alt="border">
|
||||
<img src="/WIKI/GCG/bg/normal.webp" alt="border" />
|
||||
</div>
|
||||
<div class="card-cover">
|
||||
<img :src="item.icon" alt="cover">
|
||||
<img :src="item.icon" alt="cover" />
|
||||
</div>
|
||||
<div class="card-content">
|
||||
<span>{{ item.name }}</span>
|
||||
@@ -46,14 +42,16 @@
|
||||
<v-window-item value="action">
|
||||
<div class="cards-grid">
|
||||
<v-card
|
||||
v-for="item in CardsInfoA" :key="item.contentId" class="card-cls"
|
||||
v-for="item in CardsInfoA"
|
||||
:key="item.contentId"
|
||||
class="card-cls"
|
||||
@click="toOuter(item.name, item.contentId)"
|
||||
>
|
||||
<div class="card-border">
|
||||
<img src="/WIKI/GCG/bg/normal.webp" alt="border">
|
||||
<img src="/WIKI/GCG/bg/normal.webp" alt="border" />
|
||||
</div>
|
||||
<div class="card-cover">
|
||||
<img :src="item.icon" alt="cover">
|
||||
<img :src="item.icon" alt="cover" />
|
||||
</div>
|
||||
<div class="card-content">
|
||||
<span>{{ item.name }}</span>
|
||||
@@ -64,14 +62,16 @@
|
||||
<v-window-item value="monster">
|
||||
<div class="cards-grid">
|
||||
<v-card
|
||||
v-for="item in CardsInfoM" :key="item.contentId" class="card-cls"
|
||||
v-for="item in CardsInfoM"
|
||||
:key="item.contentId"
|
||||
class="card-cls"
|
||||
@click="toOuter(item.name, item.contentId)"
|
||||
>
|
||||
<div class="card-border">
|
||||
<img src="/WIKI/GCG/bg/normal.webp" alt="border">
|
||||
<img src="/WIKI/GCG/bg/normal.webp" alt="border" />
|
||||
</div>
|
||||
<div class="card-cover">
|
||||
<img :src="item.icon" alt="cover">
|
||||
<img :src="item.icon" alt="cover" />
|
||||
</div>
|
||||
<div class="card-content">
|
||||
<span>{{ item.name }}</span>
|
||||
@@ -84,14 +84,16 @@
|
||||
<div v-show="doSearch">
|
||||
<div class="cards-grid">
|
||||
<v-card
|
||||
v-for="item in CardsInfoS" :key="item.contentId" class="card-cls"
|
||||
v-for="item in CardsInfoS"
|
||||
:key="item.contentId"
|
||||
class="card-cls"
|
||||
@click="toOuter(item.name, item.contentId)"
|
||||
>
|
||||
<div class="card-border">
|
||||
<img src="/WIKI/GCG/bg/special.webp" alt="border">
|
||||
<img src="/WIKI/GCG/bg/special.webp" alt="border" />
|
||||
</div>
|
||||
<div class="card-cover">
|
||||
<img :src="item.icon" alt="cover">
|
||||
<img :src="item.icon" alt="cover" />
|
||||
</div>
|
||||
<div class="card-content">
|
||||
<span>{{ item.name }}</span>
|
||||
@@ -99,9 +101,7 @@
|
||||
</v-card>
|
||||
</div>
|
||||
</div>
|
||||
<v-snackbar v-model="snackbar" timeout="1500" color="error">
|
||||
未找到相关卡牌
|
||||
</v-snackbar>
|
||||
<v-snackbar v-model="snackbar" timeout="1500" color="error"> 未找到相关卡牌 </v-snackbar>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
// vue
|
||||
@@ -132,7 +132,7 @@ onMounted(async () => {
|
||||
await loadData();
|
||||
});
|
||||
|
||||
async function loadData () {
|
||||
async function loadData() {
|
||||
await Promise.allSettled(
|
||||
allCards.value.map(async (item) => {
|
||||
if (item.type === "角色牌") CardsInfoC.value.push(item);
|
||||
@@ -143,12 +143,12 @@ async function loadData () {
|
||||
loading.value = false;
|
||||
}
|
||||
|
||||
function toOuter (cardName: string, cardId: number) {
|
||||
function toOuter(cardName: string, cardId: number) {
|
||||
const url = OBC_CONTENT_API.replace("{content_id}", cardId.toString());
|
||||
createTGWindow(url, "GCG", cardName, 1200, 800, true);
|
||||
}
|
||||
|
||||
async function searchCard () {
|
||||
async function searchCard() {
|
||||
loading.value = true;
|
||||
if (search.value === "") {
|
||||
setTimeout(() => {
|
||||
@@ -159,7 +159,9 @@ async function searchCard () {
|
||||
}
|
||||
doSearch.value = true;
|
||||
const res: TGApp.App.GCG.WikiBriefInfo[] = [];
|
||||
await Promise.allSettled(allCards.value.map((item) => (item.name.includes(search.value) ? res.push(item) : null)));
|
||||
await Promise.allSettled(
|
||||
allCards.value.map((item) => (item.name.includes(search.value) ? res.push(item) : null)),
|
||||
);
|
||||
res.sort((a, b) => a.name.localeCompare(b.name));
|
||||
console.log(res);
|
||||
loading.value = false;
|
||||
|
||||
@@ -3,9 +3,7 @@
|
||||
<div v-for="item in cardsInfo" :key="item.id" class="card-box" @click="toOuter(item)">
|
||||
<TibWikiWeapon size="128px" :model-value="item" />
|
||||
</div>
|
||||
<v-snackbar v-model="snackbar" timeout="1500" color="error">
|
||||
该武器暂无详情
|
||||
</v-snackbar>
|
||||
<v-snackbar v-model="snackbar" timeout="1500" color="error"> 该武器暂无详情 </v-snackbar>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -23,7 +21,7 @@ const snackbar = ref(false);
|
||||
// data
|
||||
const cardsInfo = computed(() => AppWeaponData);
|
||||
|
||||
function toOuter (item: TGApp.App.Weapon.WikiBriefInfo) {
|
||||
function toOuter(item: TGApp.App.Weapon.WikiBriefInfo) {
|
||||
if (item.contentId === 0) {
|
||||
snackbar.value = true;
|
||||
return;
|
||||
@@ -31,7 +29,6 @@ function toOuter (item: TGApp.App.Weapon.WikiBriefInfo) {
|
||||
const url = OBC_CONTENT_API.replace("{content_id}", item.contentId.toString());
|
||||
createTGWindow(url, "武器详情", item.name, 1200, 800, true);
|
||||
}
|
||||
|
||||
</script>
|
||||
<style scoped>
|
||||
.cards-grid {
|
||||
|
||||
Reference in New Issue
Block a user