You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
190 lines
5.3 KiB
190 lines
5.3 KiB
2 months ago
|
<template>
|
||
3 weeks ago
|
<div class="equip-dialog" v-if="target && source">
|
||
2 months ago
|
<div class="coins">
|
||
1 month ago
|
{{ t('coins.0') }}:{{ userCoins }}
|
||
2 months ago
|
</div>
|
||
|
<div class="message">
|
||
|
<p>{{ t('inherited.1') + needCoins }}</p>
|
||
|
<div class="tips">
|
||
|
<p>- {{ t('inherited.2') }}</p>
|
||
|
<p>- {{ t('inherited.3') }}</p>
|
||
|
<p>- {{ t('inherited.4') }}</p>
|
||
|
</div>
|
||
|
<div class='btn-div'>
|
||
|
<button class="button" @click="inherited">{{ t('inheritedConfirm.0') }}</button>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="equip">
|
||
|
<EquipIcon :equip="target" />
|
||
1 month ago
|
<div class='name' :class="target.quality.quality">
|
||
2 months ago
|
{{ t(target.type + '.' + target.base.name + '.0') }}
|
||
|
{{ '(+' + target.strengthenLv + ')' }}
|
||
|
<span>➡</span>
|
||
|
{{ '(+' + source.strengthenLv + ')' }}
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="entry">
|
||
|
<div>
|
||
|
<div v-for="v in target.base.entry" :key="v.id">
|
||
|
{{ t(v.type + '.0') }} : + {{ strengthenValue(v.value, target.strengthenLv) }}
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="arror">➡</div>
|
||
|
<div>
|
||
|
<div v-for="v in target.base.entry" :key="v.id">
|
||
|
<span>{{ strengthenValue(v.value, source.strengthenLv) }}</span>
|
||
|
<span class="set">
|
||
|
⬆({{ strengthenValue(v.value, source.strengthenLv) -
|
||
|
strengthenValue(v.value, target.strengthenLv) }})
|
||
|
</span>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="equip">
|
||
|
<EquipIcon :equip="source" />
|
||
1 month ago
|
<div class='name' :class="source.quality.quality">
|
||
2 months ago
|
{{ t(source.type + '.' + source.base.name + '.0') }}
|
||
|
{{ '(+' + source.strengthenLv + ')' }}
|
||
|
<span>➡</span>
|
||
|
{{ '(+0)' }}
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="entry">
|
||
|
<div>
|
||
|
<div v-for="v in source.base.entry" :key="v.id">
|
||
|
{{ t(v.type + '.0') }} : + {{ strengthenValue(v.value, source.strengthenLv) }}
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="arror">➡</div>
|
||
|
<div>
|
||
|
<div v-for="v in source.base.entry" :key="v.id">
|
||
|
<span>{{ strengthenValue(v.value, 0) }}</span>
|
||
|
<span class="down">
|
||
|
⬇({{ strengthenValue(v.value, source.strengthenLv) - strengthenValue(v.value, 0) }})
|
||
|
</span>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
<Confirm ref="confirm" width="8rem" :tip="t('inheritedConfirm.1')" :confirm="t('inheritedConfirm.2')"
|
||
|
:cancel="t('inheritedConfirm.3')" @confirm="confirmInherited" />
|
||
|
</template>
|
||
|
|
||
|
<script lang="ts" setup>
|
||
|
import { useStore } from "vuex";
|
||
|
import { computed, onMounted, ref } from "vue";
|
||
|
import { useI18n } from "vue3-i18n";
|
||
|
import { strengthenAvgCoins, strengthenValue } from "@/tool";
|
||
|
import { EquipIcon, Confirm } from "@/components";
|
||
1 month ago
|
import { qualitys } from "@/config";
|
||
2 months ago
|
|
||
|
|
||
|
const { t } = useI18n();
|
||
|
const { state, commit, dispatch } = useStore();
|
||
1 month ago
|
const userCoins = computed(() => {
|
||
2 months ago
|
return state.playerAttribute.coins;
|
||
|
})
|
||
|
const needCoins = computed(() => {
|
||
1 month ago
|
const need = strengthenAvgCoins(prop.target.lv, prop.source.strengthenLv, prop.target.quality.quality)
|
||
|
const used = strengthenAvgCoins(prop.source.lv, prop.source.strengthenLv, prop.source.quality.quality)
|
||
2 months ago
|
return need > used ? need - used : 0;
|
||
|
})
|
||
|
const confirm = ref();
|
||
|
const emit = defineEmits(['close'])
|
||
|
|
||
|
const prop = defineProps({
|
||
|
target: {
|
||
|
type: Object,
|
||
|
default: null
|
||
|
},
|
||
|
source: {
|
||
|
type: Object,
|
||
|
default: null
|
||
|
}
|
||
|
});
|
||
|
|
||
|
const inherited = (e) => {
|
||
|
confirm.value.open(0, e)
|
||
|
}
|
||
|
|
||
|
const confirmInherited = () => {
|
||
1 month ago
|
if (userCoins.value < needCoins.value) {
|
||
2 months ago
|
commit("set_sys_info", { msg: t('stNoCoins'), type: "warning", });
|
||
|
return
|
||
|
}
|
||
1 month ago
|
commit("add_player_coins", -1 * needCoins.value);
|
||
2 months ago
|
prop.target.strengthenLv = prop.source.strengthenLv;
|
||
|
prop.source.strengthenLv = 0;
|
||
|
commit("set_sys_info", { msg: t('inheritedConfirm.4'), type: "win", });
|
||
|
emit('close');
|
||
|
}
|
||
|
|
||
4 weeks ago
|
onMounted(() => { });
|
||
2 months ago
|
</script>
|
||
|
<style lang="scss" scoped>
|
||
|
.coins {
|
||
|
display: flex;
|
||
|
align-items: center !important;
|
||
|
justify-content: center;
|
||
|
font-size: 1.1rem;
|
||
|
color: #2fe20f;
|
||
|
}
|
||
|
|
||
|
.message {
|
||
|
display: flex;
|
||
|
flex-direction: column;
|
||
|
border-bottom: 1px solid #ccc;
|
||
|
padding-bottom: 0.8rem;
|
||
|
|
||
|
p {
|
||
|
margin: 0.7rem;
|
||
|
}
|
||
|
|
||
|
.tips {
|
||
|
padding-left: 1.3rem;
|
||
|
|
||
|
p {
|
||
|
color: #999;
|
||
|
font-size: 0.8rem;
|
||
|
margin: 0rem;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
.btn-div {
|
||
|
padding: 0.1rem;
|
||
|
display: flex;
|
||
|
justify-content: flex-end;
|
||
|
padding-right: 2rem;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
.entry {
|
||
|
width: 100%;
|
||
|
padding: 1rem;
|
||
|
display: flex;
|
||
|
justify-content: space-around;
|
||
|
font-size: 1.2rem;
|
||
|
align-items: center;
|
||
|
|
||
|
div {
|
||
|
text-align: left;
|
||
|
|
||
|
&>div {
|
||
|
height: 2rem;
|
||
|
}
|
||
|
|
||
|
.set {
|
||
|
color: #2fe20f;
|
||
|
margin-left: 0.7rem;
|
||
|
}
|
||
|
|
||
|
.down {
|
||
|
color: #f70d05;
|
||
|
margin-left: 0.7rem;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
</style>
|