From 3fc63deb316930f55ca99bb1a8300b9b3c19cf1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A5=BF=E7=93=9C=C2=B0?= Date: Sun, 15 Jun 2025 20:47:27 +0800 Subject: [PATCH] dev --- backend/api/routes/openapi.py | 17 ++++++ .../dnf/Equipment/RaritySelect/index.vue | 8 +-- frontend/src/pages/Character/Index.vue | 2 +- .../Skill/components/SkillDetail/index.tsx | 58 +++++++++++-------- frontend/src/pages/Character/Skill/index.vue | 2 +- frontend/src/style/app.scss | 10 ++-- 6 files changed, 61 insertions(+), 36 deletions(-) diff --git a/backend/api/routes/openapi.py b/backend/api/routes/openapi.py index e429a8b7..a75eee52 100644 --- a/backend/api/routes/openapi.py +++ b/backend/api/routes/openapi.py @@ -47,6 +47,23 @@ async def get_skills_list(redis: RedisDep, skillName: Annotated[str, Param(..., return response(data=data) +@router.get('/{jobId}/{jobGrowId}/skills/', operation_id='skillsByJob') +async def get_cn_skills_by_job(redis: RedisDep, jobId: Annotated[str, Path(..., description='职业')], jobGrowId: Annotated[str, Path(..., description='转职')]) -> SkillsListResponse: + """ + 获取职业技能列表 + """ + key = f'openapi:{jobId}:{jobGrowId}:skills' + + def get_skills_by_job(): + # This function should retrieve the skills by job and jobGrow + # For now, we return a placeholder list + with open(f'./openapi/data/{jobId}/{jobGrowId}/cn/skill_tree.json', encoding='utf-8') as f: + skills_data = json.load(f) + return skills_data + + skills_list = get_redis_info(redis, key, get_skills_by_job) + return response(data=skills_list) + @router.get('/{jobId}/{jobGrowId}/{skillId}/', operation_id='skillDetail') async def get_cn_skill_info(redis: RedisDep, jobId: Annotated[str, Path(..., description='职业')], jobGrowId: Annotated[str, Path(..., description='转职')], skillId: Annotated[str, Path(..., description='技能')], level: Annotated[int, Param(..., description='技能等级')] = None) -> SkillDetailResponse: """ diff --git a/frontend/src/components/dnf/Equipment/RaritySelect/index.vue b/frontend/src/components/dnf/Equipment/RaritySelect/index.vue index 23f7e44b..6bfd488b 100644 --- a/frontend/src/components/dnf/Equipment/RaritySelect/index.vue +++ b/frontend/src/components/dnf/Equipment/RaritySelect/index.vue @@ -20,11 +20,11 @@ const value = defineModel() const rarities = [ { value: '稀有', - background: '#d06eff', + background: '#9879da', }, { value: '神器', - background: '#fe11ff', + background: '#ef28c1', }, { value: '传说', @@ -32,11 +32,11 @@ const rarities = [ }, { value: '史诗', - background: '#feca11', + background: '#fcb600', }, { value: '太初', - background: 'linear-gradient(180deg, #70faa7 0%, #7bfefe 100%)', + background: 'linear-gradient(to bottom, #58fa84 20%, #58decc 40%, #58c6ff 60%)', }, ] diff --git a/frontend/src/pages/Character/Index.vue b/frontend/src/pages/Character/Index.vue index 72d6e5d8..4658cce9 100644 --- a/frontend/src/pages/Character/Index.vue +++ b/frontend/src/pages/Character/Index.vue @@ -14,7 +14,7 @@ > -
+
diff --git a/frontend/src/pages/Character/Skill/components/SkillDetail/index.tsx b/frontend/src/pages/Character/Skill/components/SkillDetail/index.tsx index 814085c8..86804c50 100644 --- a/frontend/src/pages/Character/Skill/components/SkillDetail/index.tsx +++ b/frontend/src/pages/Character/Skill/components/SkillDetail/index.tsx @@ -60,10 +60,11 @@ export default defineComponent({ const desc = computed(() => skillInfo.value?.descDetail.split('\n')) const detail = computed(() => { - const items = skillInfo.value?.attribute.optionDesc?.split('\n').filter((item) => !!item) ?? [] + const items = + skillInfo.value?.attribute.optionDesc?.split('\n').filter((item) => !!item) ?? [] const details = items?.map((a) => { const beforeReplace = a.match(/^(.+?\s*:\s*[^\{]+)(\{value\d+\}.*)$/) - if(beforeReplace) { + if (beforeReplace) { a = `${beforeReplace[1]}${beforeReplace[2]}` } const matches = a.match(/{([^}]+)}/g) @@ -74,10 +75,7 @@ export default defineComponent({ if (/^value.+/.test(key)) { const value = skillInfo.value?.attribute.optionValue[key as `value${string}`] ?? '-' if (value) { - a = a.replace( - match, - `${value}`, - ) + a = a.replace(match, `${value}`) } } }) @@ -104,19 +102,29 @@ export default defineComponent({
技能描述
- {desc.value?.map((item) => item.startsWith("[") ? (
{item}
) :( -
{item}
- ))} -
-
-
技能属性
-
-
- {detail.value?.map((item) => ( -
- ))} + {desc.value?.map((item) => + item.startsWith('[') ? ( +
{item}
+ ) : ( +
+ {item} +
+ ), + )}
+ {(detail.value.length > 0 ) && ( + <> +
技能属性
+
+
+ {detail.value.map((item) => ( +
+ ))} +
+
+ + )} ) @@ -126,15 +134,15 @@ export default defineComponent({
{skillInfo.value?.evolution?.map((item) => ( <> -
-
{item.name}
-
技能描述
-
-
- {item.descDetail} +
+
{item.name}
+
技能描述
+
+
+ {item.descDetail} +
-
))}
@@ -144,7 +152,7 @@ export default defineComponent({ onMounted(() => { watchEffect(() => { - (skillInfo.value?.evolution?.length ?? 0) == 0 && (curTab.value = 0) + ;(skillInfo.value?.evolution?.length ?? 0) == 0 && (curTab.value = 0) }) }) diff --git a/frontend/src/pages/Character/Skill/index.vue b/frontend/src/pages/Character/Skill/index.vue index 1aa134e5..45014351 100644 --- a/frontend/src/pages/Character/Skill/index.vue +++ b/frontend/src/pages/Character/Skill/index.vue @@ -50,7 +50,7 @@
diff --git a/frontend/src/style/app.scss b/frontend/src/style/app.scss index 254cbd00..9c0922c5 100644 --- a/frontend/src/style/app.scss +++ b/frontend/src/style/app.scss @@ -282,16 +282,16 @@ body, color: #68d5ed; } .rare { - color: #b36bff; + color: #9879da; } .artifact { - color: #ff00ff; + color: #ef28c1; } .legend { - color: #e96e00; + color: #ff7700; } .epic { - color: #ffb400; + color: #fcb600; } .chronicle { color: #ff6666; @@ -314,7 +314,7 @@ body, } .primeval { - background-image: -webkit-linear-gradient(top, #28d931, #33acea); + background-image: linear-gradient(to bottom, #5aff62, #58c6ff); color: transparent; background-clip: text; text-shadow: none;