🎨 代码格式化

This commit is contained in:
BTMuli
2023-06-25 16:15:15 +08:00
parent 7982649bbc
commit 7567bba147
174 changed files with 29970 additions and 29840 deletions

View File

@@ -2,13 +2,9 @@
<TSwitchTheme />
<TOLoading v-model="loading" :empty="loadingEmpty" :title="loadingTitle" />
<div class="anno-json">
<div class="anno-title">
活动列表 JSON
</div>
<div class="anno-title">活动列表 JSON</div>
<JsonViewer :value="jsonList" copyable boxed class="anno-data" />
<div class="anno-title">
活动内容 JSON
</div>
<div class="anno-title">活动内容 JSON</div>
<JsonViewer :value="jsonContent" copyable boxed class="anno-data" />
</div>
</template>

View File

@@ -10,7 +10,7 @@
<div class="anno-subtitle">
{{ annoData.subtitle }}
</div>
<img v-if="annoData.banner !== ''" :src="annoBanner" alt="cover" class="anno-img">
<img v-if="annoData.banner !== ''" :src="annoBanner" alt="cover" class="anno-img" />
<div class="anno-content" v-html="annoHtml" />
</div>
</template>

View File

@@ -4,7 +4,9 @@
<div v-if="!loading" class="lottery-box">
<div class="lottery-title">
抽奖详情
<span style="color:#E06C63">{{ timeStatus === "已开奖" ? timeStatus : `待开奖 ${timeStatus}` }}</span>
<span style="color: #e06c63">{{
timeStatus === "已开奖" ? timeStatus : `待开奖 ${timeStatus}`
}}</span>
</div>
<div class="lottery-list">
<v-list-item>
@@ -14,19 +16,13 @@
</v-avatar>
</template>
<template #append>
<v-btn variant="outlined" @click="backPost()">
返回
</v-btn>
<v-btn variant="outlined" @click="backPost()"> 返回 </v-btn>
</template>
{{ lotteryCard.creator.nickname }}
<v-list-item-subtitle>{{ lotteryCard.creator.introduce }}</v-list-item-subtitle>
</v-list-item>
<div class="reward-title">
参与方式{{ participationMethod }}
</div>
<div class="reward-title">
抽奖 ID{{ lotteryCard.id }}
</div>
<div class="reward-title">参与方式{{ participationMethod }}</div>
<div class="reward-title">抽奖 ID{{ lotteryCard.id }}</div>
<div class="reward-title">
奖品详情
<div v-for="reward in lotteryCard.rewards" :key="reward.rewardName" class="reward-subtitle">
@@ -36,9 +32,7 @@
</div>
</div>
<div v-if="timeStatus === '已开奖'" class="lottery-box">
<div class="lottery-title">
中奖详情
</div>
<div class="lottery-title">中奖详情</div>
<div v-for="reward in lotteryCard.rewards" :key="reward.rewardName" class="lottery-list">
<div class="reward-title">
{{ reward.rewardName }} {{ reward.scheduledWinnerNumber }}/{{ reward.winnerNumber }}
@@ -46,7 +40,7 @@
<div class="lottery-grid">
<div v-for="user in reward.users" :key="user.uid" class="lottery-sub-list">
<div class="lottery-user-avatar">
<img :src="user.avatar_url" alt="avatar">
<img :src="user.avatar_url" alt="avatar" />
</div>
<div class="lottery-user-nickname">
{{ user.nickname }}
@@ -88,7 +82,7 @@ const lotteryTimer = ref(null as any);
// 参与方式
const participationMethod = ref("未知" as string);
function flushTimeStatus () {
function flushTimeStatus() {
const timeNow = new Date().getTime();
const timeDiff = Number(jsonData.draw_time) * 1000 - timeNow;
if (timeDiff <= 0) {
@@ -109,7 +103,7 @@ const lotteryCard = ref({} as LotteryCard);
let jsonData = reactive({} as LotteryData);
const timeStatus = ref("未知" as string);
function backPost () {
function backPost() {
window.history.back();
}
@@ -146,7 +140,7 @@ onMounted(async () => {
});
// 获取参与方式
function getParticipationMethod (participantWay: string) {
function getParticipationMethod(participantWay: string) {
switch (participantWay) {
case "Forward":
return "转发";
@@ -161,7 +155,6 @@ onUpdated(() => {
clearInterval(lotteryTimer);
}
});
</script>
<style lang="css">
.lottery-box {

View File

@@ -1,15 +1,9 @@
<template>
<TOLoading v-model="loading" :title="loadingTitle" />
<v-tabs v-model="tab" align-tabs="start" class="news-tab">
<v-tab value="notice">
公告
</v-tab>
<v-tab value="activity" @click="firstLoad('activity')">
活动
</v-tab>
<v-tab v-if="showNews" value="news" @click="firstLoad('news')">
新闻
</v-tab>
<v-tab value="notice"> 公告 </v-tab>
<v-tab value="activity" @click="firstLoad('activity')"> 活动 </v-tab>
<v-tab v-if="showNews" value="news" @click="firstLoad('news')"> 新闻 </v-tab>
<v-spacer />
<v-btn class="switch-btn" @click="switchAnno">
<template #prepend>
@@ -17,7 +11,7 @@
</template>
切换游戏内公告
</v-btn>
<v-btn class="switch-chan" @click="showList=true">
<v-btn class="switch-chan" @click="showList = true">
<v-icon>mdi-view-list</v-icon>
</v-btn>
<v-text-field
@@ -36,19 +30,19 @@
<div class="news-grid">
<v-card v-for="item in postData.notice" :key="item.post_id" class="news-card" width="340">
<div class="news-cover" @click="toPost(item)">
<img :src="item.cover" alt="cover">
<img :src="item.cover" alt="cover" />
</div>
<v-card-title>{{ item.title }}</v-card-title>
<v-card-actions>
<v-btn class="card-btn" @click="toPost(item)">
<template #prepend>
<img src="../assets/icons/circle-check.svg" alt="check">查看
<img src="../assets/icons/circle-check.svg" alt="check" />查看
</template>
</v-btn>
<v-card-subtitle>id:{{ item.post_id }}</v-card-subtitle>
<v-btn v-show="appStore.devMode" class="card-dev-btn" @click="toJson(item)">
<template #prepend>
<img src="../assets/icons/arrow-right.svg" alt="right">
<img src="../assets/icons/arrow-right.svg" alt="right" />
</template>
JSON
</v-btn>
@@ -58,7 +52,7 @@
<div class="load-news">
<v-btn :loading="loadingSub" @click="loadMore('notice')">
<template #append>
<img src="../assets/icons/arrow-left.svg" alt="right">
<img src="../assets/icons/arrow-left.svg" alt="right" />
</template>
已加载{{ rawData.notice.lastId }}加载更多
</v-btn>
@@ -68,14 +62,14 @@
<div class="news-grid">
<v-card v-for="item in postData.activity" :key="item.post_id" class="news-card" width="340">
<div class="news-cover" @click="toPost(item)">
<img :src="item.cover" alt="cover">
<img :src="item.cover" alt="cover" />
</div>
<v-card-title>{{ item.title }}</v-card-title>
<v-card-subtitle>{{ item.subtitle }}</v-card-subtitle>
<v-card-actions>
<v-btn class="card-btn" @click="toPost(item)">
<template #prepend>
<img src="../assets/icons/circle-check.svg" alt="check">查看
<img src="../assets/icons/circle-check.svg" alt="check" />查看
</template>
</v-btn>
<v-card-subtitle>id:{{ item.post_id }}</v-card-subtitle>
@@ -91,7 +85,7 @@
</div>
<v-btn v-show="appStore.devMode" class="card-dev-btn" @click="toJson(item)">
<template #prepend>
<img src="../assets/icons/arrow-right.svg" alt="right">
<img src="../assets/icons/arrow-right.svg" alt="right" />
</template>
JSON
</v-btn>
@@ -101,7 +95,7 @@
<div class="load-news">
<v-btn :loading="loadingSub" @click="loadMore('activity')">
<template #append>
<img src="../assets/icons/arrow-left.svg" alt="right">
<img src="../assets/icons/arrow-left.svg" alt="right" />
</template>
已加载:{{ rawData.activity.lastId }}加载更多
</v-btn>
@@ -111,19 +105,19 @@
<div class="news-grid">
<v-card v-for="item in postData.news" :key="item.post_id" class="news-card" width="340">
<div class="news-cover" @click="toPost(item)">
<img :src="item.cover" alt="cover">
<img :src="item.cover" alt="cover" />
</div>
<v-card-title>{{ item.title }}</v-card-title>
<v-card-actions>
<v-btn class="card-btn" @click="toPost(item)">
<template #prepend>
<img src="../assets/icons/circle-check.svg" alt="check">查看
<img src="../assets/icons/circle-check.svg" alt="check" />查看
</template>
</v-btn>
<v-card-subtitle>id:{{ item.post_id }}</v-card-subtitle>
<v-btn v-show="appStore.devMode" class="card-dev-btn" @click="toJson(item)">
<template #prepend>
<img src="../assets/icons/arrow-right.svg" alt="right">
<img src="../assets/icons/arrow-right.svg" alt="right" />
</template>
JSON
</v-btn>
@@ -133,7 +127,7 @@
<div class="load-news">
<v-btn :loading="loadingSub" @click="loadMore('news')">
<template #append>
<img src="../assets/icons/arrow-left.svg" alt="right">
<img src="../assets/icons/arrow-left.svg" alt="right" />
</template>
已加载{{ rawData.news.lastId }}加载更多
</v-btn>
@@ -219,7 +213,7 @@ onMounted(async () => {
}, 1500);
});
async function firstLoad (data: string) {
async function firstLoad(data: string) {
if (rawData.value.activity.lastId !== 0 && rawData.value.news.lastId !== 0) {
return;
}
@@ -244,12 +238,12 @@ async function firstLoad (data: string) {
}, 1500);
}
async function switchAnno () {
async function switchAnno() {
await router.push("/announcements");
}
// 加载更多
async function loadMore (data: string) {
async function loadMore(data: string) {
loadingSub.value = true;
if (rawData.value[data].isLast) {
snackbarText.value = "已经是最后一页了";
@@ -279,7 +273,7 @@ async function loadMore (data: string) {
}, 1500);
}
async function toPost (item: NewsCard | string) {
async function toPost(item: NewsCard | string) {
if (typeof item === "string") {
const path = router.resolve({
name: "帖子详情",
@@ -301,7 +295,7 @@ async function toPost (item: NewsCard | string) {
}
}
async function toJson (item: NewsCard | string) {
async function toJson(item: NewsCard | string) {
if (typeof item === "string") {
const path = router.resolve({
name: "帖子详情JSON",
@@ -323,7 +317,7 @@ async function toJson (item: NewsCard | string) {
}
}
async function searchPost () {
async function searchPost() {
if (search.value === "") {
snackbarText.value = "请输入搜索内容";
snackbarColor.value = "error";

View File

@@ -2,9 +2,7 @@
<TSwitchTheme />
<TOLoading v-model="loading" :empty="loadingEmpty" :title="loadingTitle" />
<div class="post-json">
<div class="post-title">
帖子返回内容 JSON
</div>
<div class="post-title">帖子返回内容 JSON</div>
<JsonViewer :value="jsonData" copyable boxed />
</div>
</template>