mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-13 09:28:14 +08:00
🐛 修复类型获取错误
This commit is contained in:
@@ -66,9 +66,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
// vue
|
|
||||||
import { onMounted, ref, watch } from "vue";
|
import { onMounted, ref, watch } from "vue";
|
||||||
|
|
||||||
|
import TSUserGacha from "../../plugins/Sqlite/modules/userGacha.js";
|
||||||
|
|
||||||
interface GachaDataViewProps {
|
interface GachaDataViewProps {
|
||||||
dataType: "new" | "avatar" | "weapon" | "normal" | "mix";
|
dataType: "new" | "avatar" | "weapon" | "normal" | "mix";
|
||||||
dataVal: TGApp.Sqlite.GachaRecords.SingleTable[];
|
dataVal: TGApp.Sqlite.GachaRecords.SingleTable[];
|
||||||
@@ -179,8 +180,9 @@ function getStar5Avg(): string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 获取物品图标
|
// 获取物品图标
|
||||||
function getIcon(itemId: string, type: string): string {
|
function getIcon(itemId: string): string {
|
||||||
if (type === "角色") {
|
const type = TSUserGacha.getGachaItemType(itemId);
|
||||||
|
if (type[0] === "角色") {
|
||||||
return "/WIKI/character/" + itemId + ".webp";
|
return "/WIKI/character/" + itemId + ".webp";
|
||||||
} else {
|
} else {
|
||||||
return "/WIKI/weapon/" + itemId + ".webp";
|
return "/WIKI/weapon/" + itemId + ".webp";
|
||||||
|
|||||||
@@ -20,9 +20,9 @@ type gachaItemTypeRes =
|
|||||||
* @return {gachaItemTypeRes}
|
* @return {gachaItemTypeRes}
|
||||||
*/
|
*/
|
||||||
function getGachaItemType(item_id: string): gachaItemTypeRes {
|
function getGachaItemType(item_id: string): gachaItemTypeRes {
|
||||||
const findAvatar = AppCharacterData.find((i) => i.id === item_id);
|
const findAvatar = AppCharacterData.find((i) => i.id.toString() === item_id);
|
||||||
if (findAvatar !== undefined) return ["角色", findAvatar];
|
if (findAvatar !== undefined) return ["角色", findAvatar];
|
||||||
const findWeapon = AppWeaponData.find((i) => i.id === item_id);
|
const findWeapon = AppWeaponData.find((i) => i.id.toString() === item_id);
|
||||||
if (findWeapon !== undefined) return ["武器", findWeapon];
|
if (findWeapon !== undefined) return ["武器", findWeapon];
|
||||||
return ["未知", "未知"];
|
return ["未知", "未知"];
|
||||||
}
|
}
|
||||||
@@ -139,6 +139,7 @@ const TSUserGacha = {
|
|||||||
getUidList,
|
getUidList,
|
||||||
getGachaCheck,
|
getGachaCheck,
|
||||||
getGachaRecords,
|
getGachaRecords,
|
||||||
|
getGachaItemType,
|
||||||
deleteGachaRecords,
|
deleteGachaRecords,
|
||||||
mergeUIGF,
|
mergeUIGF,
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user