bemarket/src/components/market/Dundialog.vue
huangjinming 30d7e42eae fix
2022-12-27 16:52:23 +08:00

668 lines
17 KiB
Vue

<template>
<el-dialog :show-close="false" :visible.sync="dialogVisible">
<Transition v-if="!isTabs">
<div class="contaier">
<div class="hero-left-info">
<div class="hero-left-info-img">
<img
v-if="data.item_id"
:src="require('@/assets/market/weapon/' + data.item_id + '.png')"
alt="aoi-hero"
/>
<img
v-if="data.c_id"
:src="require('@/assets/market/weapon/' + data.c_id + '.png')"
alt="aoi-hero"
/>
</div>
</div>
<div class="chip-right-content">
<div class="hero-right-token">
<div class="token-name">TOKEN ID</div>
<div class="token-id">#{{ data.token_id }}</div>
<div class="hill">
<div class="hill-content">
<div class="hill-name">
{{ data.c_name ? data.c_name : data.detail.gun_name }}<span class="name">Name</span>
</div>
<div>
<img
width="34px"
src="../../assets/market/hero/hill-icon.png"
alt=""
/>
</div>
</div>
<LeveStars :quality="data.detail.quality"> </LeveStars>
<LuckyValue
:level="data.detail.gun_lv"
:lucky="data.detail.lucky"
></LuckyValue>
<ProgressCard
color="rgba(184, 77, 204, 0.7)"
progressImg="aggressivity"
definecolor="#ca61dc"
:min="data.detail.pvp_ceg_uplimit"
:max="data.detail.pvp_ceg_uplimit"
></ProgressCard>
<ProgressCard
color="rgba(193, 168, 93, 0.7)"
progressImg="defense"
definecolor="#d0bd7a"
:min="data.detail.pve_ceg_uplimit"
:max="data.detail.pve_ceg_uplimit"
></ProgressCard>
<ProgressCard
color="rgba(81, 194, 224, 0.7)"
progressImg="lightning"
definecolor="#7dd6ff"
:min="data.detail.durability"
:max="data.detail.durability_max"
></ProgressCard>
</div>
</div>
<div class="hero-right-hp">
<div class="hero-hp">
<div class="hero-item hero-item-hp">
<div class="item">
<div class="item-img">
<img
width="28px"
src="../../assets/market/hero/attack.png"
alt=""
/>
</div>
<div>ATTACK</div>
</div>
<div>
{{
data.detail.rand_attr[0].val >= 100
? parseInt(data.detail.rand_attr[0].val * 1)
: (data.detail.rand_attr[0].val * 1).toFixed(2)
}}
</div>
</div>
<div class="hero-item hero-item-attack">
<div class="item">
<div class="item-img">
<img
width="35px"
src="../../assets/market/weapon/range.png"
alt=""
/>
</div>
<div>RANGE</div>
</div>
<div>
{{
data.detail.rand_attr[6].val >= 100
? parseInt(data.detail.rand_attr[6].val * 1)
: (data.detail.rand_attr[6].val * 1).toFixed(2)
}}
</div>
</div>
<div class="hero-item hero-item-def">
<div class="item">
<div class="item-img">
<img
width="36px"
src="../../assets/market/weapon/rate.png"
alt=""
/>
</div>
<div>RATE</div>
</div>
<div>
{{
data.detail.rand_attr[3].val >= 100
? parseInt(data.detail.rand_attr[3].val * 1)
: (data.detail.rand_attr[3].val * 1).toFixed(2)
}}
</div>
</div>
<div class="hero-item hero-item-cri">
<div class="item">
<div class="item-img">
<img
width="32px"
src="../../assets/market/weapon/clip.png"
alt=""
/>
</div>
<div>CLIP</div>
</div>
<div>
{{
data.detail.rand_attr[4].val >= 100
? parseInt(data.detail.rand_attr[4].val * 1)
: (data.detail.rand_attr[4].val * 1).toFixed(2)
}}
</div>
</div>
<div class="hero-item hero-item-criDam">
<div class="item">
<div class="item-img">
<img
width="32px"
src="../../assets/market/weapon/reload.png"
alt=""
/>
</div>
<div>RELOAD</div>
</div>
<div>
{{
data.detail.rand_attr[5].val >= 100
? parseInt(data.detail.rand_attr[5].val * 1)
: (data.detail.rand_attr[5].val * 1).toFixed(2)
}}
</div>
</div>
<div class="hero-item hero-item-dodge">
<div class="item">
<div class="item-img">
<img
width="33px"
src="../../assets/market/hero/cri.png"
alt=""
/>
</div>
<div>CRITICAL</div>
</div>
<div>
{{ (data.detail.rand_attr[1].val * 1 * 100).toFixed(2) }}%
</div>
</div>
<div class="hero-item hero-item-reduces">
<div class="item">
<div class="item-img">
<img
width="33px"
src="../../assets/market/hero/criDam.png"
alt=""
/>
</div>
<div>BRAIN LIFE PCT CLI DAMAGE</div>
</div>
<div>
{{ (data.detail.rand_attr[2].val * 1 * 100).toFixed(2) }}%
</div>
</div>
<div class="hero-item hero-item-speed">
<div class="item">
<div class="item-img">
<img
width="29px"
src="../../assets/market/weapon/brain.png"
alt=""
/>
</div>
<div>BRAIN LIFE PCT</div>
</div>
<div>
{{ (data.detail.rand_attr[7].val * 1 * 100).toFixed(2) }}%
</div>
</div>
<div class="hero-item hero-item-speed">
<div class="item">
<div class="item-img">
<img
width="31px"
src="../../assets/market/weapon/bulletSpeed.png"
alt=""
/>
</div>
<div>BULLET SPEED</div>
</div>
<div>{{ data.detail.rand_attr[8].val }}</div>
</div>
</div>
<AccountCard :owner="data.owner_address" :time="data.modifytime">
</AccountCard>
</div>
</div>
</div>
</Transition>
<Transition v-else>
<div>
<WeaponMosaicChip :data="data" /></div
></Transition>
<div class="buy-price">
<div class="mynft" v-if="isType === 'mynft'">
<!-- <div class="for-rent-btn" v-if="orderId">
<div class="adjust" @click="handPutShow"></div>
<div class="remove"></div>
</div> -->
<div class="rent"></div>
<div class="sell" @click="handPutShow">Sell</div>
</div>
<div class="maeket" v-else>
<div class="price">
<span class="price-number">{{
data.s_price ? data.s_price : " "
}}</span>
</div>
<div>
<a href="javascript:void(0)">
<img
@click="handBuyShow"
width="469px"
src="../../assets/market/hero/buy.png"
alt="aoi-hero"
/></a>
</div>
</div>
</div>
<div class="tabs">
<div :class="isTabs ? 'chip-tab' : 'hero-tab'" @click="handHeroTab">
WEAPON
</div>
<div>
<div
v-if="data.detail.chips_info.length > 0 && data.detail.chips_info"
:class="isTabs ? 'hero-tab' : 'chip-tab'"
@click="handChipTab"
>
CHIP
</div>
<div v-else :class="isTabs ? 'hero-tab' : 'chip-tab'">
<img width="33px" src="../../assets/market/lock.png" alt="aoi-hero" />
</div>
</div>
</div>
<Close @closeMyself="closeMyself" />
</el-dialog>
</template>
<script>
import LeveStars from "./LeveStars.vue";
import Close from "./Close.vue";
import WeaponMosaicChip from "./WeaponMosaicChip.vue";
import AccountCard from "./AccountCard.vue";
import ProgressCard from "./ProgressCard.vue";
import LuckyValue from "./LuckyValue.vue";
export default {
components: {
LeveStars,
Close,
AccountCard,
ProgressCard,
WeaponMosaicChip,
LuckyValue,
},
props: ["dialogVisible", "data", "isType"],
data() {
return {
isTabs: false,
};
},
created() {
// console.log(((data.detail.rand_attr[7].val *1)*100).toFixed(2),'opoppo');
},
methods: {
closeMyself(hide) {
this.$emit("on-close", hide);
//如果需要传参的话,可以在"on-close"后面再加参数,然后在父组件的函数里接收就可以了。
},
open() {
this.$emit("on-open");
//如果需要传参的话,可以在"on-close"后面再加参数,然后在父组件的函数里接收就可以了。
},
handHeroTab() {
this.$emit("closeTip", false);
this.isTabs = false;
},
handChipTab() {
this.$emit("showTip", true);
this.isTabs = true;
},
handPutShow() {
this.$emit("handPutShow");
console.log("ppwowerw");
},
handBuyShow() {
this.$emit("handBuyShow");
console.log("handBuyShow");
},
},
};
</script>
<style lang="scss" scoped>
::v-deep .el-dialog,
.el-pager li {
position: relative;
width: 1727px !important;
height: 775px !important;
background: url("../../assets/market/hero/dialog-bg.png") no-repeat;
background-size: 100% 100%;
box-shadow: none;
}
::v-deep .el-dialog__body {
padding: 0px 0px !important;
}
::v-deep .el-dialog__header {
padding: 0px 0px 0px;
}
.contaier {
display: flex;
width: 1727px !important;
height: 775px !important;
position: relative;
justify-content: space-between;
.chip-right-content {
display: flex;
margin-right: 38px;
}
}
.hero-left {
width: 863px;
height: 651px;
position: absolute;
top: -41px;
left: -40px;
// opacity: 0;
img {
width: 100%;
// opacity: 0;
}
}
.hero-left-info {
width: 702px;
height: 702px;
margin-top: 32px;
margin-left: 38px;
margin-right: 40px;
display: flex;
justify-content: center;
align-items: center;
background: url("../../assets/market/weapon/elliptical-bg.png") no-repeat;
background-size: cover;
.hero-left-info-img {
width: 668px;
height: 274px;
display: flex;
justify-content: center;
align-items: center;
img {
width: 100%;
// opacity: 0;
}
}
}
.hill {
width: 100%;
height: 509px;
margin-top: 31px;
background: url("../../assets/market/hero/hill-bg.png") no-repeat;
background-size: contain;
.hill-content {
display: flex;
justify-content: space-between;
align-items: center;
padding-top: 15px;
margin-left: 32px;
margin-right: 24px;
// margin-top: 30px
margin-bottom: 26px;
}
.hill-name {
font-size: 38px;
font-family: "SairaStencilOne";
// font-weight: 400;
position: relative;
color: #ffffff;
}
.name {
font-size: 17px;
position: absolute;
left: -27px;
bottom: -11px;
font-family: "OPPOSans";
font-weight: normal;
color: #ffffff;
margin-left: 33px;
}
}
.hero-right-token {
// position: absolute;
width: 353px;
color: #ffffff;
right: 0px;
// padding-left: 30px;
.token-name {
text-align: center;
margin-top: 51px;
font-size: 34px;
margin-bottom: 11px;
font-weight: bold;
font-weight: bold;
color: #ffffff;
}
.token-id {
width: 345px;
height: 41px;
font-size: 30px;
line-height: 49px;
text-align: center;
margin-bottom: 32px;
background: #28c1ed;
border: 4px solid rgba(91, 211, 246, 0.4);
border-radius: 24px;
}
}
.hero-right-hp {
width: 33%;
// position: absolute;
margin-left: 25px;
margin-top: 36px;
color: #ffffff;
right: 0px;
.hero-hp {
width: 409px;
height: 466px;
background: rgba(5, 57, 68, 0.3);
padding-top: 25px;
padding-left: 35px;
padding-right: 31px;
border-radius: 20px;
}
}
.progress {
width: 217px;
margin-top: 17px;
margin-left: 15px;
}
.progress-number {
font-size: 18px;
font-family: "MEurostile";
margin-top: 6px;
font-weight: 400;
font-style: italic;
text-align: right;
color: #ffffff;
}
::v-deep .el-progress-bar__outer {
background-color: #c1c1c1;
}
.hero-item {
display: flex;
justify-content: space-between;
align-items: center;
font-size: 24px;
font-family: "Bahnschrift";
font-weight: bold;
color: #ffffff;
.item {
display: flex;
font-size: 24px;
font-family: "Bahnschrift";
font-weight: bold;
color: #ffffff;
.item-img {
margin-right: 26px;
}
}
}
.hero-item-hp {
margin-bottom: 13px;
}
.hero-item-attack {
margin-bottom: 13px;
}
.hero-item-def {
margin-bottom: 13px;
}
.hero-item-cri {
margin-bottom: 13px;
}
.hero-item-criDam {
margin-bottom: 13px;
}
.hero-item-dodge {
margin-bottom: 13px;
}
.hero-item-reduces {
margin-bottom: 13px;
}
.hero-item-speed {
margin-bottom: 13px;
}
.hp-bottom {
width: 435px;
height: 126px;
font-size: 22px;
font-family: "Bahnschrift";
font-weight: bold;
color: #ffffff;
margin-top: 13px;
padding-right: 20px;
padding-left: 20px;
padding-top: 28px;
background: rgba(5, 57, 68, 0.3);
border-radius: 20px;
.userinfo {
display: flex;
margin-bottom: 12px;
justify-content: space-between;
}
}
.buy-price {
position: absolute;
right: 82px;
bottom: -46px;
display: flex;
.maeket {
display: flex;
}
.price {
width: 281px;
height: 89px;
font-size: 43px;
position: relative;
font-family: "Arciform";
font-weight: 400;
color: #ffffff;
background: url("../../assets/market/hero/price.png") no-repeat;
background-size: contain;
.price-number {
line-height: 89px;
margin-left: 90px;
}
}
.mynft {
display: flex;
}
.sell {
width: 395px;
height: 100px;
cursor: pointer;
font-size: 63px;
text-align: center;
font-size: 44px;
line-height: 100px;
color: #ffffff;
background: url("../../assets/market/chip/sell-btn.png") no-repeat;
background-size: 100% 100%;
}
.rent {
width: 395px;
height: 100px;
margin-right: 30px;
}
.for-rent-btn {
display: flex;
// margin-top: 170px;
.adjust {
width: 384px;
height: 89px;
cursor: pointer;
// margin-left: 14px;
background: url("../../assets/market/hero/adjust.png") no-repeat;
background-size: 100% 100%;
}
.remove {
width: 384px;
height: 89px;
cursor: pointer;
margin-left: 14px;
background: url("../../assets/market/hero/remove.png") no-repeat;
background-size: 100% 100%;
}
}
}
.tabs {
position: absolute;
left: 734px;
top: -70px;
display: flex;
.hero-tab {
width: 306px;
height: 80px;
font-size: 46px;
font-family: "SairaStencilOne";
font-weight: 400;
color: #ffffff;
line-height: 80px;
text-align: center;
margin-right: 10px;
background: url("../../assets/market/tabhshow.png") no-repeat;
background-size: contain;
}
.chip-tab {
width: 290px;
height: 70px;
font-size: 46px;
line-height: 70px;
margin-right: 10px;
text-align: center;
font-family: "SairaStencilOne";
font-weight: 400;
color: #5e82d7;
background: url("../../assets/market/tabhied.png") no-repeat;
background-size: 100% 100%;
}
}
.v-enter-from,
.v-leave-to {
opacity: 0;
}
.v-enter-active,
.v-leave-active {
transition: opacity 0.5s ease;
}
.v-enter-to,
.v-leave-from {
opacity: 1;
}
</style>