This commit is contained in:
2025-04-05 13:00:16 +08:00
parent e2099aa047
commit da8e163322
20 changed files with 1843 additions and 15196 deletions
@@ -30,9 +30,6 @@ const infoStyle = (part: string) => {
let x = 15
let y = 5
let index = infoStore.avatarParts.findIndex((p) => p == part)
if (index > 7) {
index += 1
}
// if (index == 13) {
// index -= 7
// } else if (index >= 5 && index <= 12) {
@@ -45,7 +42,7 @@ const infoStyle = (part: string) => {
}
else if (part.includes('宠物装备')) {
x += 6 * 39
y += (index - infoStore.avatarParts.findIndex((p) => p == '宠物装备-红') - 1) * 40
y += (index - infoStore.avatarParts.findIndex((p) => p == '宠物装备-红')) * 40
} else {
x += (index % 4) * 39
y += Math.floor(index / 4) * 40
@@ -66,6 +63,7 @@ const choosePart = (part: string) => {
const partName = (part: string) => {
if (part == '武器装扮') return '武器'
if(part == '快捷栏装备') return '快捷'
return part.replace('宠物装备-', '')
}
</script>
@@ -20,7 +20,7 @@ export default defineComponent({
)
})
const enchanting_list = computed<IEnchantingInfo[] | undefined>(() => {
const enchant_list = computed<IEnchantingInfo[] | undefined>(() => {
return basicInfoStore.enchants
?.filter((item) => item.position.includes(part.value))
.sort((a, b) => (b.fame ?? 0) - (a.fame ?? 0))
@@ -55,7 +55,7 @@ export default defineComponent({
}
// 附魔
const enchanting = currentInfo<string | number>('enchanting')
const enchant = currentInfo<string | number>('enchant')
// 镶嵌栏1
const emblem_0 = currentInfo<string | number>('emblem_0', 0)
@@ -92,9 +92,9 @@ export default defineComponent({
{has_enchant.value ? (
<div class="equ-profile-item">
<div class="row-name">{part.value == '宠物' ? '附魔' : '属性'}</div>
<calc-select v-model={enchanting.value} class="flex-1 !h-20px">
<calc-select v-model={enchant.value} class="flex-1 !h-20px">
<calc-option value={0}>无</calc-option>
{renderList(enchanting_list.value ?? [], (item) => (
{renderList(enchant_list.value ?? [], (item) => (
<calc-option value={item.id}>{item.detail}</calc-option>
))}
</calc-select>
@@ -24,7 +24,7 @@ export default defineComponent({
)
const basicInfoStore = useInfoStore()
const enchanting_list = computed<IEnchantingInfo[] | undefined>(() => {
const enchant_list = computed<IEnchantingInfo[] | undefined>(() => {
return basicInfoStore.enchants
?.filter(
(item) =>
@@ -62,7 +62,7 @@ export default defineComponent({
let parts: string[] = []
if (global_change.value) {
if (name === 'enchanting') {
if (name === 'enchant') {
const enchant = basicInfoStore?.enchants?.find((item) => item.id == val) as
| IEnchantingInfo
| undefined
@@ -96,7 +96,7 @@ export default defineComponent({
}
// 附魔
const enchanting = currentInfo<string | number>('enchanting')
const enchant = currentInfo<string | number>('enchant')
// 镶嵌栏1
const emblem_0 = currentInfo<string | number>('emblem_0', 0)
@@ -171,9 +171,9 @@ export default defineComponent({
)}
<div class="equ-profile-item">
<div class="row-name">附魔</div>
<calc-select v-model={enchanting.value} class="flex-1 !h-20px">
<calc-select v-model={enchant.value} class="flex-1 !h-20px">
<calc-option value={""}>无</calc-option>
{renderList(enchanting_list.value ?? [], (item) => (
{renderList(enchant_list.value ?? [], (item) => (
<calc-option value={item.id}>{item.detail}</calc-option>
))}
</calc-select>
@@ -0,0 +1,55 @@
<template>
<div>
<template v-for="key in ['0','1','2','3']" :key="key">
<div class="flex gap-2 mt-5px">
<calc-select class="flex-1 !h-20px" v-model="configStore.config.jades[key].id">
<calc-option v-for="(item, index) in ['0','1']" :key="index" :value="item">
{{item}}
</calc-option>
</calc-select>
<calc-select class="flex-1 !h-20px" v-model="configStore.config.jades[key].value"></calc-select>
</div>
</template>
</div>
</template>
<script setup lang="ts">
import { useConfigStore } from '@/stores'
import { useInfoStore } from '@/stores'
const configStore = useConfigStore()
const infoStore = useInfoStore()
// const valueList = computed(() => {
// return function (id: number = -1) {
// if (id == -1) {
// return undefined
// } else {
// const res = []
// const cur = infoStore.jade?.find(e => e.id == id) as IJadeInfo
// if (cur) {
// const { max, min, unit, pre } = cur
// //
// if (pre == 0) {
// res.push({
// id: 1,
// value: unit
// })
// } else {
// for (let i = Number(max) as number; i >= Number(min);) {
// if (i != 0) {
// res.push({
// id: getFloat(i, 1),
// value: (i > 0 ? "+" : "") + getFloat(i, 1) + unit
// })
// }
// i = Number((i - Number(pre)).toFixed(1))
// }
// }
// return res
// }
// }
// }
// }
// })
</script>
+5 -1
View File
@@ -1,5 +1,5 @@
<template>
<div class="w-400px">
<div class="w-420px">
<calc-collapse class="w-100%" title="装备/时装打造(点击部位切换)">
<calc-tabs v-model="partTab" class="!mb-2">
<calc-tab :value="0">装备栏</calc-tab>
@@ -8,11 +8,15 @@
<equipment v-if="partTab === 0"></equipment>
<clothes v-if="partTab === 1"></clothes>
</calc-collapse>
<calc-collapse class="w-100%" title="辟邪玉">
<jade></jade>
</calc-collapse>
</div>
</template>
<script setup lang="ts">
import equipment from './components/equipment.vue'
import clothes from './components/avatar.vue';
import jade from './components/jade.vue';
const partTab = ref(0)
</script>
+1 -2
View File
@@ -8,7 +8,7 @@
</calc-tabs>
</div>
<div class="content flex">
<div class="flex flex-1">
<div class="flex flex-1" v-if="!!infoStore.infos?.alter">
<RouterView></RouterView>
</div>
@@ -40,7 +40,6 @@ const stopWatch = watch<any>(
onMounted(async () => {
await infoStore.createCharacter(props.alter, '0')
configStore.loadConfig()
window.addEventListener('beforeunload', () => {
configStore.saveConfig()
})
+13 -2
View File
@@ -31,7 +31,10 @@ export interface IConfig {
fusion: string
}
>
jades: Record<string, number>
jades: Record<string, {
id:string
value: number
}>
avatar: Record<
string,
{
@@ -117,7 +120,15 @@ export const useConfigStore = defineStore('configStore', () => {
(config.value.skills[id] = {
lv: infoStore.skills.find((skill) => skill.id.toString() === id)?.maxLearnLv ?? 0,
})
})
});
(["0", "1", "2", "3"].filter((key) => !Object.keys(config.value.jades).includes(key)) ?? []).forEach((key) => {
config.value.jades[key] = {
id: '',
value: 0,
}
}
)
}
const saveConfig = () => {
+5
View File
@@ -1,6 +1,7 @@
import api from '@/api'
import type { ICharacterInfo } from '@/api/info/type'
import { defineStore } from 'pinia'
import { useConfigStore } from './config'
export const useInfoStore = defineStore('infoStore', () => {
const alter_token = ref<string>('')
@@ -20,6 +21,8 @@ export const useInfoStore = defineStore('infoStore', () => {
const avatars = computed(() => infos.value?.avatar ?? {})
// const jades = computed(() => infos.value?.jades ?? [])
const parts = [
'头肩',
'上衣',
@@ -45,6 +48,7 @@ export const useInfoStore = defineStore('infoStore', () => {
'胸部',
'上衣',
'皮肤',
'快捷栏装备',
'腰带',
'下装',
'鞋',
@@ -58,6 +62,7 @@ export const useInfoStore = defineStore('infoStore', () => {
const time = new Date().getTime()
alter_token.value = btoa(JSON.stringify({ alter, equVersion, time }))
infos.value = await api.characterInfo()
useConfigStore().loadConfig()
}
return {