dev
This commit is contained in:
@@ -20,6 +20,19 @@
|
||||
<EquipmentIcon :equipment="stones(detail[part].fusion)" />
|
||||
</div>
|
||||
</template>
|
||||
<div
|
||||
v-if="props.withSubWeapon"
|
||||
class="pos-absolute text-white/50 w-26px h-26px border-1px border-solid border-#7a7a7a/50 flex items-center justify-center"
|
||||
style="left:150px;top:5px;z-index:8;"
|
||||
@click="choosePart('副武器')"
|
||||
>
|
||||
<template v-if="detail?.['副武器']?.id">
|
||||
<EquipmentIcon :equipment="equ(detail['副武器'].id)" />
|
||||
</template>
|
||||
<template v-else>
|
||||
副武
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -45,6 +58,10 @@ const props = defineProps({
|
||||
detail: {
|
||||
type: Object as PropType<Record<string, IConfigEquip>>,
|
||||
},
|
||||
withSubWeapon:{
|
||||
type: Boolean,
|
||||
default: false,
|
||||
}
|
||||
})
|
||||
const partModelValue = useVModel(props, 'part')
|
||||
const infoStore = useInfoStore()
|
||||
|
||||
@@ -4,9 +4,11 @@
|
||||
<calc-tabs v-model="anotherTab" class="!mb-2">
|
||||
<calc-tab :value="0">武器</calc-tab>
|
||||
<calc-tab :value="1">称号/宠物/秘宝</calc-tab>
|
||||
<calc-tab :value="2" v-if="infoStore.infos?.alter.includes('vegabond')">副武器</calc-tab>
|
||||
</calc-tabs>
|
||||
<Weapon v-show="anotherTab === 0"></Weapon>
|
||||
<Else v-show="anotherTab === 1"></Else>
|
||||
<SubWeapon v-show="anotherTab === 2"></SubWeapon>
|
||||
</calc-collapse>
|
||||
<calc-collapse title="套装/通宝">
|
||||
<calc-tabs v-model="equTab" class="!mb-2">
|
||||
@@ -37,7 +39,10 @@ import Universal from './components/Universal.vue'
|
||||
import StoneUniversal from './components/StoneUniversal.vue'
|
||||
import StoneOld from './components/StoneOld.vue'
|
||||
import Else from './components/Else.vue'
|
||||
import { useInfoStore } from '@/stores'
|
||||
import SubWeapon from './components/SubWeapon.vue'
|
||||
|
||||
const infoStore = useInfoStore()
|
||||
const equTab = ref(0)
|
||||
const stoneTab = ref(0)
|
||||
const anotherTab = ref(0)
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
<!-- 每排总计6+4+4,共计14个排列 -->
|
||||
|
||||
<template>
|
||||
<div class="flex flex-wrap gap-4px content-start" :style="{ width: `${rowCount * 32}px` }">
|
||||
<template v-for="(weapon, _) in weapons" :key="_">
|
||||
<EquipmentIcon :equipment="weapon" :inactive="configStore.config.equips['副武器']?.id != weapon?.id" @click="configStore.chooseEqu(weapon,false,true)"/>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import type { IEquipment } from '@/api/info/type'
|
||||
import { useConfigStore, useInfoStore } from '@/stores'
|
||||
import { getImageURL } from '@/utils/images'
|
||||
import EquipmentIcon from '@/components/dnf/Equipment/Icon/index.vue'
|
||||
|
||||
const props = defineProps<{
|
||||
rowCount?: number
|
||||
}>()
|
||||
|
||||
const rowCount = Math.max(props.rowCount ?? 0, 14)
|
||||
const infoStore = useInfoStore()
|
||||
const configStore = useConfigStore()
|
||||
|
||||
const weapons = computed(() => {
|
||||
const items = infoStore.equips.filter(
|
||||
(equip) => equip.itemType === '武器' && equip.itemDetailType == '光剑',
|
||||
)
|
||||
console.log(items)
|
||||
const res: (IEquipment | undefined)[] = []
|
||||
Array.from(new Set(items.map((item) => item.itemDetailType))).forEach((type) => {
|
||||
const weapon = items.filter((item) => item.itemDetailType === type)
|
||||
res.push(
|
||||
...weapon.filter((item) => item.categorize === '制式武器'),
|
||||
undefined,
|
||||
...weapon.filter((item) => item.categorize === '传世武器'),
|
||||
)
|
||||
const remind = rowCount - (res.length % rowCount)
|
||||
res.push(...Array(remind).fill(undefined))
|
||||
})
|
||||
return res
|
||||
})
|
||||
|
||||
</script>
|
||||
@@ -136,7 +136,7 @@ export default defineComponent({
|
||||
return (
|
||||
<>
|
||||
<div class="h-150px flex justify-center items-center">
|
||||
<EquList v-model:part={part.value} withBg={false} withPet={false}/></div>
|
||||
<EquList v-model:part={part.value} withBg={false} withPet={false} with-sub-weapon={useInfoStore().infos?.alter.includes('vegabond')}/></div>
|
||||
|
||||
<div class="flex flex-wrap equ-profile">
|
||||
<div class="equ-profile-item">
|
||||
@@ -152,6 +152,15 @@ export default defineComponent({
|
||||
<div></div>
|
||||
)}
|
||||
</div>
|
||||
{part.value == '副武器' ? (<>
|
||||
<div class="equ-profile-item">
|
||||
<div class="row-name">强化</div>
|
||||
<calc-select v-model={reinforce.value} class="flex-1 !h-20px">
|
||||
{renderList(31, (i) => (
|
||||
<calc-option value={i - 1}>{i - 1}</calc-option>
|
||||
))}
|
||||
</calc-select>
|
||||
</div></>):(<>
|
||||
{can_upgrade.value ? (
|
||||
<div class="equ-profile-item">
|
||||
<div class="row-name">增幅</div>
|
||||
@@ -251,6 +260,7 @@ export default defineComponent({
|
||||
</div>
|
||||
</>) : <div></div>
|
||||
}
|
||||
</>)}
|
||||
</div>
|
||||
</>
|
||||
)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="bg-#000000bf w-264px">
|
||||
<div class="h-177px">
|
||||
<EquList :detail="props.equs"></EquList>
|
||||
<EquList :detail="props.equs" :with-sub-weapon="infoStore.infos?.alter.includes('vegabond')"></EquList>
|
||||
</div>
|
||||
<div class="flex flex-wrap border-y-1px my-1px border-y-solid border-#FFFF/10">
|
||||
<template v-for="info in props.info" :key="info.id">
|
||||
|
||||
@@ -109,7 +109,7 @@ export const useConfigStore = defineStore('configStore', () => {
|
||||
if (!config.value?.avatar) config.value.avatar = {}
|
||||
if (!config.value?.sundry)config.value.sundry = {}
|
||||
|
||||
const part = [...infoStore.parts, '宠物'].filter((a) => !config.value?.equips.hasOwnProperty(a))
|
||||
const part = [...infoStore.parts, '宠物','副武器'].filter((a) => !config.value?.equips.hasOwnProperty(a))
|
||||
const avatarPart = infoStore.avatarParts
|
||||
.filter((a) => a != '宠物')
|
||||
.filter((a) => !config.value?.avatar.hasOwnProperty(a))
|
||||
@@ -155,9 +155,9 @@ export const useConfigStore = defineStore('configStore', () => {
|
||||
return await api.calc(config.value)
|
||||
}
|
||||
|
||||
const chooseEqu = async (equip: IEquipment | undefined, isFusion: boolean = false) => {
|
||||
const chooseEqu = async (equip: IEquipment | undefined, isFusion: boolean = false,isSubWeapon:boolean=false) => {
|
||||
if (!equip) return
|
||||
const part = equip?.itemType == '武器' ? '武器' : equip?.itemDetailType
|
||||
const part = isSubWeapon ? '副武器' :(equip?.itemType == '武器' ? '武器' : equip?.itemDetailType)
|
||||
if (equip && config.value.equips[part]) {
|
||||
const key = isFusion ? 'fusion' : 'id'
|
||||
if (config.value.equips[part][key] == equip.id) {
|
||||
|
||||
Reference in New Issue
Block a user