Skip to content

Commit

Permalink
fix: memory medal
Browse files Browse the repository at this point in the history
  • Loading branch information
StarHeartHunt committed Mar 13, 2024
1 parent bba07a4 commit 3c9a86a
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/widgets/MemoryList/Memory.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { getImagePath } from "@/utils/utils";
import { CharMemory, Memory } from "./types";
const getSrcMedal = (mmr: Memory) =>
`https://torappu.prts.wiki/assets/medal_icon/${mmr.medal.id}`;
`https://torappu.prts.wiki/assets/medal_icon/${mmr.medal.id}.png`;
const getSrcElite = (elite: string) =>
`/images/${getImagePath(`图标_升级_精英化${elite || "0"}.png`)}`;
Expand Down
5 changes: 3 additions & 2 deletions src/widgets/MemoryList/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ import { getNaiveUILocale } from "@/utils/i18n";
import { useTheme } from "@/utils/theme";
import Memory from "./Memory.vue";
import { rarityMap, filterRarity } from "./consts";
import { filterRarity, rarityMap } from "./consts";
import { CharMemory, Medal } from "./types";
import { getOnlineDate, getTargetDate, getMemories } from "./util";
import { getMemories, getOnlineDate, getTargetDate } from "./utils";
export default defineComponent({
components: {
Expand Down Expand Up @@ -323,3 +323,4 @@ export default defineComponent({
</NLayout>
</NConfigProvider>
</template>
./utils
12 changes: 12 additions & 0 deletions src/widgets/MemoryList/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,15 @@ export interface Medal {
desc: string;
method: string;
}

export interface CargoMemory {
page: string;
elite: string;
level: string;
favor: string;
medal: string;
storySetName: string;
storyIntro: string;
storyTxt: string;
storyIndex: string;
}
15 changes: 2 additions & 13 deletions src/widgets/MemoryList/util.ts → src/widgets/MemoryList/utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Medal, Memory } from "./types";
import type { CargoMemory, Medal, Memory } from "./types";

export async function getOnlineDate() {
const resp = await fetch("/rest.php/v1/page/干员密录一览%2F密录上线时间");
Expand Down Expand Up @@ -53,18 +53,6 @@ function eq(
);
}

interface CargoMemory {
page: string;
elite: string;
level: string;
favor: string;
medal: string;
storySetName: string;
storyIntro: string;
storyTxt: string;
storyIndex: string;
}

function toMemories(
char: string,
medalData: Medal[],
Expand Down Expand Up @@ -96,6 +84,7 @@ function toMemories(
}
return result;
}

export async function getMemories(
medalData: Medal[],
): Promise<Record<string, Memory[]>> {
Expand Down

0 comments on commit 3c9a86a

Please sign in to comment.