From 34697d25c8c85de1227697c266d50fff69daf417 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A5=BF=E7=93=9C=C2=B0?= Date: Mon, 20 Apr 2026 02:00:30 +0800 Subject: [PATCH] dev --- backend/api/routes/info.py | 18 ++++ backend/core/basic/character/info.py | 23 ++++ backend/core/basic/equipment.py | 6 +- frontend/src/api/info/type.ts | 14 ++- .../src/components/dnf/Avatar/List/index.vue | 5 +- .../dnf/Emblem/Images/emblem/none.png | Bin 0 -> 172 bytes .../dnf/Emblem/Images/emblem/华丽.png | Bin 0 -> 108 bytes .../dnf/Emblem/Images/emblem/灿烂.png | Bin 0 -> 119 bytes .../dnf/Emblem/Images/emblem/白金.png | Bin 0 -> 132 bytes .../dnf/Emblem/Images/emblem/神圣.png | Bin 0 -> 118 bytes .../dnf/Emblem/Images/emblem/闪耀.png | Bin 0 -> 130 bytes .../src/components/dnf/Emblem/Images/head.png | Bin 0 -> 85563 bytes .../components/dnf/Emblem/Images/rarity/0.png | Bin 0 -> 1716 bytes .../components/dnf/Emblem/Images/rarity/1.png | Bin 0 -> 1800 bytes .../components/dnf/Emblem/Images/rarity/2.png | Bin 0 -> 1685 bytes .../components/dnf/Emblem/Images/rarity/3.png | Bin 0 -> 1857 bytes .../src/components/dnf/Emblem/List/index.vue | 21 ++++ .../components/dnf/Equipment/Oath/info.vue | 0 .../Character/EquipmentDictionary/Index.vue | 100 +++++++++++++++++- .../Character/Forge/components/Emblems.vue | 8 +- frontend/src/pages/Character/Forge/index.vue | 2 +- frontend/src/stores/info.ts | 24 +++++ images | 2 +- 23 files changed, 207 insertions(+), 16 deletions(-) create mode 100644 frontend/src/components/dnf/Emblem/Images/emblem/none.png create mode 100644 frontend/src/components/dnf/Emblem/Images/emblem/华丽.png create mode 100644 frontend/src/components/dnf/Emblem/Images/emblem/灿烂.png create mode 100644 frontend/src/components/dnf/Emblem/Images/emblem/白金.png create mode 100644 frontend/src/components/dnf/Emblem/Images/emblem/神圣.png create mode 100644 frontend/src/components/dnf/Emblem/Images/emblem/闪耀.png create mode 100644 frontend/src/components/dnf/Emblem/Images/head.png create mode 100644 frontend/src/components/dnf/Emblem/Images/rarity/0.png create mode 100644 frontend/src/components/dnf/Emblem/Images/rarity/1.png create mode 100644 frontend/src/components/dnf/Emblem/Images/rarity/2.png create mode 100644 frontend/src/components/dnf/Emblem/Images/rarity/3.png create mode 100644 frontend/src/components/dnf/Emblem/List/index.vue create mode 100644 frontend/src/components/dnf/Equipment/Oath/info.vue diff --git a/backend/api/routes/info.py b/backend/api/routes/info.py index 9a7d83f5..6a2aa48d 100644 --- a/backend/api/routes/info.py +++ b/backend/api/routes/info.py @@ -7,6 +7,7 @@ from typing import Annotated from api.core.Response import Return, response from api.core.Redis import get_redis_info from api.dp import RedisDep, AltersDep +from core.basic.equipment import get_equipment from core.character.adventure import get_adv_list from core.basic.character import createCharacter from core.open.helper import get_user_info_by_id @@ -56,6 +57,23 @@ async def get_character_info(request: Request, state: AltersDep, redis: RedisDep return response(data=info) +@router.get('/info/oath/{suitId}/{skillId}') +async def get_oath_info(state: AltersDep, suitId: str, skillId: str, rarity: str, redis: RedisDep): + def get_info(): + skill = None + version = state.equVersion + equ = get_equipment(version) + oath = next((x for x in equ.oath_suits if x.suitId == suitId and x.rarity == rarity), None) + if oath is not None: + oathSkill = next((x for x in oath.skills if x.skillId == skillId), None) + if oathSkill is not None: + skill = oathSkill.__dict__ + return skill + + info = get_redis_info(redis, f'dcalc:oath:{rarity}:{skillId}', get_info) + return response(data=info) + + @router.get('/skill/{skillId}/{level}') async def get_skill_info(state: AltersDep, skillId: str, level: int, redis: RedisDep): """ diff --git a/backend/core/basic/character/info.py b/backend/core/basic/character/info.py index ca8583cc..1ead3c67 100644 --- a/backend/core/basic/character/info.py +++ b/backend/core/basic/character/info.py @@ -52,6 +52,7 @@ class CharacterInfoMixin(CharacterBase): equs = [] suits = [] oaths = [] + oaths_skills = {} # stones = [] for i in equInfos.equs: if i.itemType == '武器' and i.itemDetailType not in self.武器选项: @@ -61,11 +62,33 @@ class CharacterInfoMixin(CharacterBase): suits.append(i.__dict__) for i in equInfos.oaths: oaths.append(i.__dict__) + for i in equInfos.oath_suits: + if i.suitId not in oaths_skills: + oaths_skills[i.suitId] = {'suitInfo': [], 'skills': []} + oaths_skills[i.suitId]['suitInfo'].append( + { + 'name': i.name, + 'rarity': i.rarity, + 'SkillAttack': i.SkillAttack, + 'Buffer': i.Buffer, + 'Attack': i.Attack, + } + ) + if len(oaths_skills[i.suitId]['skills']) == 0: + for skill in i.skills: + oaths_skills[i.suitId]['skills'].append( + { + 'skillId': skill.skillId, + 'name': skill.name, + 'icon': skill.imageUrl, + } + ) # for i in equInfos.stones: # stones.append(i.__dict__) info['oaths'] = oaths info['equips'] = equs info['suits'] = suits + info['oaths_skills'] = oaths_skills # info['stones'] = stones key = '辅助' if self.buffer else '输出' info['enchants'] = list(filter(lambda x: key in x['categorize'], equInfos.enchants)) diff --git a/backend/core/basic/equipment.py b/backend/core/basic/equipment.py index 052b3fcd..2fcf5f6a 100644 --- a/backend/core/basic/equipment.py +++ b/backend/core/basic/equipment.py @@ -243,11 +243,11 @@ class Equipments: skills = [x for x in db_skills_list if x.suitId == suit['suitId'] and x.key == suit['key']] suit['level'] = i skillAttaks = parse_to_number_list(suit['SkillAttack'], [0]) - suit['SkillAttack'] = 0 if i - 1 >= len(skillAttaks) else skillAttaks[i - 1] + suit['SkillAttack'] = (0 if len(skillAttaks) == 0 else skillAttaks[0]) if i - 1 >= len(skillAttaks) else skillAttaks[i - 1] attacks = parse_to_number_list(suit['Attack'], [0]) - suit['Attack'] = 0 if i - 1 >= len(attacks) else attacks[i - 1] + suit['Attack'] = (0 if len(attacks) == 0 else attacks[0]) if i - 1 >= len(attacks) else attacks[i - 1] buffers = parse_to_number_list(suit['Buffer'], [0]) - suit['Buffer'] = 0 if i - 1 >= len(buffers) else buffers[i - 1] + suit['Buffer'] = (0 if len(buffers) == 0 else buffers[0]) if i - 1 >= len(buffers) else buffers[i - 1] suit['skills'] = [OathSuitSkill(**{k: v for k, v in skill.__dict__.items() if not k.startswith('_')}) for skill in skills] oath_suit = OathSuit(**suit) self.oath_suits.append(oath_suit) diff --git a/frontend/src/api/info/type.ts b/frontend/src/api/info/type.ts index aae83455..6db332da 100644 --- a/frontend/src/api/info/type.ts +++ b/frontend/src/api/info/type.ts @@ -40,6 +40,19 @@ export interface ICharacterInfo { jades: IJade[] sundry: Record options: { id: number; name: string; options: string[] }[] + oaths_skills: Record< + string, + { + suitInfo: { + name: string + rarity: string + SkillAttack: number + Buffer: number + Attack: number + }[] + skills: { skillId: string; name: string; icon: string }[] + } + > } export interface ISundry { @@ -78,7 +91,6 @@ export interface IEquipment { displayUrl?: string } - export interface ISkill { icon: string name: string diff --git a/frontend/src/components/dnf/Avatar/List/index.vue b/frontend/src/components/dnf/Avatar/List/index.vue index 489998e6..f90e74ec 100644 --- a/frontend/src/components/dnf/Avatar/List/index.vue +++ b/frontend/src/components/dnf/Avatar/List/index.vue @@ -13,9 +13,8 @@ + + diff --git a/frontend/src/components/dnf/Equipment/Oath/info.vue b/frontend/src/components/dnf/Equipment/Oath/info.vue new file mode 100644 index 00000000..e69de29b diff --git a/frontend/src/pages/Character/EquipmentDictionary/Index.vue b/frontend/src/pages/Character/EquipmentDictionary/Index.vue index 6eade263..386da5fb 100644 --- a/frontend/src/pages/Character/EquipmentDictionary/Index.vue +++ b/frontend/src/pages/Character/EquipmentDictionary/Index.vue @@ -71,14 +71,75 @@
-
-
基础信息
-
+ +
+
+ 基础信息{{ hideBase ? ' (点击显示)' : '(点击隐藏)' }} +
+
-
-
套装信息
+ +
+
+ 套装信息{{ hideSuit ? ' (点击显示)' : '(点击隐藏)' }} +
+
+
+ + +
+ {{ curSuitLv.rarity }} + {{ formatLv(curSuitLv.lv, curSuitLv.rarity) }} +
+ + +
+
+
+ +
+
+
+
+
誓约信息
+
+ + +
+ +
@@ -148,6 +223,10 @@ const curSuitLv = ref({ }) const triggerVisible = ref(false) +const hideBase = ref(false) +const hideSuit = ref(false) +const oathSkillId = ref('1') + const raritiyList = ['稀有', '神器', '传说', '史诗', '太初'] const formatLv = (number: number, raritiy?: string) => { @@ -213,6 +292,13 @@ const curSuitInfo = computed(() => { ) }) +const curOathInfo = computed(() => { + if (curEquInfo.value?.suit.length != 1 || curEquInfo.value?.oathPos == undefined) { + return undefined + } + return infoStore.oathSkills?.[curEquInfo.value?.suit[0]] +}) + const chooseCategory = (cat: string) => { type.value = cat if (type.value == 'oath' && curSuit.value == -1) { @@ -326,4 +412,8 @@ const chooseEqu = (item?: IEquipment) => { border-bottom: 1px solid #211d15; text-align: center; } + +.unActive { + filter: grayscale(100%); +} diff --git a/frontend/src/pages/Character/Forge/components/Emblems.vue b/frontend/src/pages/Character/Forge/components/Emblems.vue index b19a7ca3..cc427145 100644 --- a/frontend/src/pages/Character/Forge/components/Emblems.vue +++ b/frontend/src/pages/Character/Forge/components/Emblems.vue @@ -1,5 +1,9 @@ - + diff --git a/frontend/src/pages/Character/Forge/index.vue b/frontend/src/pages/Character/Forge/index.vue index 64e33f4c..7408d8d3 100644 --- a/frontend/src/pages/Character/Forge/index.vue +++ b/frontend/src/pages/Character/Forge/index.vue @@ -1,6 +1,6 @@