fix
This commit is contained in:
parent
f538b44478
commit
67aab37d63
@ -135,22 +135,7 @@ export default {
|
||||
return {
|
||||
chainManager: new ChainManager(),
|
||||
loadingInstance:null,
|
||||
visible:this.dialogVisible,
|
||||
chipArrid: {
|
||||
39: "Hp Pct",
|
||||
40: "Atk Pct",
|
||||
41: "Def Pct",
|
||||
42: "Critical",
|
||||
43: "Cri Damage",
|
||||
44: "Dodge",
|
||||
45: "Dodge Reduce",
|
||||
46: "Hp Recover Pct",
|
||||
47: "Brain Life Pct",
|
||||
48: "Reload Time Pct",
|
||||
49: "Bullet Speed",
|
||||
50: "Bullet Speed Pct",
|
||||
51: "Cool Down Pct",
|
||||
},
|
||||
visible:this.dialogVisible
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
|
@ -12,8 +12,8 @@
|
||||
</div>
|
||||
|
||||
<div class="userinfo">
|
||||
<div>History:</div>
|
||||
<div>#3006...0103 (NFTLink)</div>
|
||||
<!-- <div>History:</div>
|
||||
<div>#3006...0103 (NFTLink)</div> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -35,7 +35,9 @@
|
||||
<div class="level">
|
||||
<div>
|
||||
<span class="level-name">Lv</span>
|
||||
<span class="level-number" v-if="chip.detail">{{ chip.detail.chip_grade }}</span>
|
||||
<span class="level-number" v-if="chip.detail">{{
|
||||
chip.detail.chip_grade
|
||||
}}</span>
|
||||
</div>
|
||||
<div class="lucky-value">
|
||||
<div class="lucky-img">
|
||||
@ -66,27 +68,31 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="def-content" v-if="chip.detail">
|
||||
<div class="def-content" v-if="chip.detail">
|
||||
<div
|
||||
class="def-item"
|
||||
v-for="(item, i) in chip.detail.rand_attr"
|
||||
:key="i"
|
||||
>
|
||||
<div>{{ chipArrid[item.attr_id] }}</div>
|
||||
<div>{{ chipArridName(item.attr_id)}}</div>
|
||||
<div>{{ parseFloat(item.val * 100).toFixed(2) }}%</div>
|
||||
</div>
|
||||
<div class="def-item">LUCKY Lv.{{ chip.detail.chip_grade }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mynft-sell" v-if="isType == 'mynft'">
|
||||
<div class="for-rent-btn" v-if="chip.o_link > 0">
|
||||
<div class="adjust" @click="handPutShow"></div>
|
||||
<div class="remove" @click="handRemove"></div>
|
||||
</div>
|
||||
<div class="for-rent-btn" v-if="chip.o_link > 0">
|
||||
<div class="adjust" @click="handPutShow"></div>
|
||||
<div class="remove" @click="handRemove"></div>
|
||||
</div>
|
||||
<div class="sell" @click="handPutShow" v-else>Sell</div>
|
||||
</div>
|
||||
<div class="buy-price" v-else>
|
||||
<div class="price"><span class="price-number">{{formatPriceShow(chip.s_price,18)}}</span></div>
|
||||
<div class="price">
|
||||
<span class="price-number">{{
|
||||
formatPriceShow(chip.s_price, 18)
|
||||
}}</span>
|
||||
</div>
|
||||
<div class="buy-img" @click="handBuyShow">
|
||||
<img src="../../../assets/market/hero/buy.png" alt="aoi-hero" />
|
||||
</div>
|
||||
@ -101,10 +107,11 @@
|
||||
<script>
|
||||
import { formatSelect } from "@/utils/UTCTime";
|
||||
import { formatPrice } from "@/utils/chain.util";
|
||||
import { formatAddress } from "@/utils/formatAddress";
|
||||
import { formatAddress, getChipArrid } from "@/utils/formatAddress";
|
||||
import { AppModule } from "@/store/modules/app";
|
||||
import { CONTRACT_ADDRESS } from "@/configs/config_chain";
|
||||
import ChainManager from "@/chain/ChainManager";
|
||||
|
||||
export default {
|
||||
props: ["isType"],
|
||||
name: "HeroModal",
|
||||
@ -112,23 +119,8 @@ export default {
|
||||
return {
|
||||
detailVisible: false,
|
||||
chip: "",
|
||||
loadingInstance:null,
|
||||
chainManager: new ChainManager(),
|
||||
chipArrid: {
|
||||
39: "Hp Pct",
|
||||
40: "Atk Pct",
|
||||
41: "Def Pct",
|
||||
42: "Critical",
|
||||
43: "Cri Damage",
|
||||
44: "Dodge",
|
||||
45: "Dodge Reduce",
|
||||
46: "Hp Recover Pct",
|
||||
47: "Brain Life Pct",
|
||||
48: "Reload Time Pct",
|
||||
49: "Bullet Speed",
|
||||
50: "Bullet Speed Pct",
|
||||
51: "Cool Down Pct",
|
||||
},
|
||||
loadingInstance: null,
|
||||
chainManager: new ChainManager()
|
||||
};
|
||||
},
|
||||
created() {
|
||||
@ -139,20 +131,22 @@ export default {
|
||||
return formatSelect(this.chip?.modifytime);
|
||||
},
|
||||
owner() {
|
||||
if(this.chip?.owner_address){
|
||||
return formatAddress(this.chip?.owner_address);
|
||||
}else return false
|
||||
|
||||
if (this.chip?.owner_address) {
|
||||
return formatAddress(this.chip?.owner_address);
|
||||
} else return false;
|
||||
},
|
||||
|
||||
},
|
||||
methods: {
|
||||
closeTip() {
|
||||
// 分发自定义事件(事件名: closeTip)
|
||||
this.$emit("closeTip");
|
||||
},
|
||||
formatPriceShow(price, decimals, fixed = 2) {
|
||||
formatPriceShow(price, decimals, fixed = 2) {
|
||||
return formatPrice(price, decimals, fixed);
|
||||
},
|
||||
chipArridName(nameId) {
|
||||
return getChipArrid(nameId);
|
||||
},
|
||||
init(data) {
|
||||
this.detailVisible = true;
|
||||
this.chip = data;
|
||||
@ -165,17 +159,16 @@ export default {
|
||||
this.$emit("handBuyShow", this.chip);
|
||||
},
|
||||
async handRemove() {
|
||||
|
||||
try {
|
||||
this.showLoading()
|
||||
this.showLoading();
|
||||
const nftres = await this.chainManager.bc.beginCancelOrder(
|
||||
this.chip.o_link,
|
||||
CONTRACT_ADDRESS[AppModule.chainId].marketAddress
|
||||
);
|
||||
if (nftres.status == true) {
|
||||
this.$emit("handMessage", 1);
|
||||
if (nftres.status == true) {
|
||||
this.$emit("handMessage", 1);
|
||||
this.hideLoading();
|
||||
setTimeout(() => {
|
||||
setTimeout(() => {
|
||||
this.$emit("handMessageHide");
|
||||
this.$emit("on-close");
|
||||
setTimeout(() => {
|
||||
@ -186,7 +179,7 @@ export default {
|
||||
} catch (err) {
|
||||
console.log("query order status error", err);
|
||||
this.hideLoading();
|
||||
this.$emit("handMessage", 1);
|
||||
this.$emit("handMessage", 1);
|
||||
}
|
||||
},
|
||||
showLoading() {
|
||||
@ -210,8 +203,9 @@ export default {
|
||||
left: 0;
|
||||
width: 100%;
|
||||
background-color: rgba(20, 28, 34, 0.6);
|
||||
z-index: 2000;
|
||||
transition: opacity 0.2s cubic-bezier(0.6, 0, 0.4, 1) 0s, transform 0.2s ease-in-out 0s;
|
||||
z-index: 2000;
|
||||
transition: opacity 0.2s cubic-bezier(0.6, 0, 0.4, 1) 0s,
|
||||
transform 0.2s ease-in-out 0s;
|
||||
.content {
|
||||
position: relative;
|
||||
.close {
|
||||
@ -454,7 +448,7 @@ export default {
|
||||
background: url("../../../assets/market/hero/sell-mb-btn.png") no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
.for-rent-btn {
|
||||
.for-rent-btn {
|
||||
display: flex;
|
||||
.adjust {
|
||||
width: 344px;
|
||||
|
@ -35,7 +35,7 @@
|
||||
/>
|
||||
</div>
|
||||
<div class="service-usdt">
|
||||
<span class="usdt-number"> 10.8</span> USDT
|
||||
<span class="usdt-number"> 0</span> USDT
|
||||
</div>
|
||||
</div>
|
||||
<div class="piece-bottom">
|
||||
@ -71,7 +71,7 @@
|
||||
<div class="piece-bottom-center">
|
||||
<div class="minimum">
|
||||
<div>The minimum price setting is</div>
|
||||
<div>1.01 USDT</div>
|
||||
<div>0.01 USDT</div>
|
||||
</div>
|
||||
<div class="minimum">
|
||||
<div>The maximum price setting is</div>
|
||||
|
@ -96,7 +96,6 @@ export default {
|
||||
handMessage() {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.message.open(1);
|
||||
console.log("chegn");
|
||||
});
|
||||
},
|
||||
handPutHide() {
|
||||
|
@ -60,14 +60,15 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<LevelStar v-if="weapon.detail" :level="weapon.detail.quality"> </LevelStar>
|
||||
<LevelStar v-if="weapon.detail" :level="weapon.detail.quality">
|
||||
</LevelStar>
|
||||
<LevelValue
|
||||
v-if="weapon.detail"
|
||||
v-if="weapon.detail"
|
||||
:level="weapon.detail.gun_lv"
|
||||
:lucky="weapon.detail.lucky"
|
||||
></LevelValue>
|
||||
<ProgressCard
|
||||
v-if="weapon.detail"
|
||||
v-if="weapon.detail"
|
||||
color="rgba(184, 77, 204, 0.7)"
|
||||
progressImg="aggressivity"
|
||||
definecolor="#ca61dc"
|
||||
@ -75,7 +76,7 @@
|
||||
:max="weapon.detail.pvp_ceg_uplimit"
|
||||
></ProgressCard>
|
||||
<ProgressCard
|
||||
v-if="weapon.detail"
|
||||
v-if="weapon.detail"
|
||||
color="rgba(193, 168, 93, 0.7)"
|
||||
progressImg="defense"
|
||||
definecolor="#d0bd7a"
|
||||
@ -84,7 +85,7 @@
|
||||
></ProgressCard>
|
||||
|
||||
<ProgressCard
|
||||
v-if="weapon.detail"
|
||||
v-if="weapon.detail"
|
||||
color="rgba(81, 194, 224, 0.7)"
|
||||
progressImg="lightning"
|
||||
definecolor="#7dd6ff"
|
||||
@ -102,8 +103,7 @@
|
||||
</div>
|
||||
<div>ATTACK</div>
|
||||
</div>
|
||||
<div
|
||||
v-if="weapon.detail">
|
||||
<div v-if="weapon.detail">
|
||||
{{
|
||||
weapon.detail.rand_attr[0].val >= 100
|
||||
? parseInt(weapon.detail.rand_attr[0].val * 1)
|
||||
@ -118,8 +118,7 @@
|
||||
</div>
|
||||
<div>RANGE</div>
|
||||
</div>
|
||||
<div
|
||||
v-if="weapon.detail">
|
||||
<div v-if="weapon.detail">
|
||||
{{
|
||||
weapon.detail.rand_attr[6].val >= 100
|
||||
? parseInt(weapon.detail.rand_attr[6].val * 1)
|
||||
@ -135,8 +134,7 @@
|
||||
</div>
|
||||
<div>REAT</div>
|
||||
</div>
|
||||
<div
|
||||
v-if="weapon.detail">
|
||||
<div v-if="weapon.detail">
|
||||
{{
|
||||
weapon.detail.rand_attr[3].val >= 100
|
||||
? parseInt(weapon.detail.rand_attr[3].val * 1)
|
||||
@ -221,7 +219,9 @@
|
||||
</div>
|
||||
<div>BULLET SPEED</div>
|
||||
</div>
|
||||
<div v-if="weapon.detail">{{ weapon.detail.rand_attr[8].val }}</div>
|
||||
<div v-if="weapon.detail">
|
||||
{{ weapon.detail.rand_attr[8].val }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<AccountCard
|
||||
@ -233,14 +233,18 @@
|
||||
</div>
|
||||
<MosaicChip v-if="isTabs" :data="weapon"></MosaicChip>
|
||||
<div class="mynft-sell" v-if="isType == 'mynft'">
|
||||
<div class="for-rent-btn" v-if="weapon.o_link > 0">
|
||||
<div class="for-rent-btn" v-if="weapon.o_link > 0">
|
||||
<div class="adjust" @click="handPutShow"></div>
|
||||
<div class="remove" @click="handRemove"></div>
|
||||
</div>
|
||||
<div class="sell" @click="handPutShow" v-else>Sell</div>
|
||||
</div>
|
||||
<div class="buy-price" v-else>
|
||||
<div class="price"><span class="price-number">{{formatPriceShow(weapon.s_price,18)}}</span></div>
|
||||
<div class="price">
|
||||
<span class="price-number">{{
|
||||
formatPriceShow(weapon.s_price, 18)
|
||||
}}</span>
|
||||
</div>
|
||||
<div class="buy-img" @click="handBuyShow">
|
||||
<img src="../../../assets/market/hero/buy.png" alt="aoi-hero" />
|
||||
</div>
|
||||
@ -272,15 +276,12 @@ export default {
|
||||
chainManager: new ChainManager(),
|
||||
weapon: "",
|
||||
isTabs: false,
|
||||
loadingInstance:null
|
||||
loadingInstance: null,
|
||||
};
|
||||
},
|
||||
// created() {
|
||||
// console.log(this.hero, "hero");
|
||||
// },
|
||||
|
||||
methods: {
|
||||
closeTip() {
|
||||
// 分发自定义事件(事件名: closeTip)
|
||||
this.$emit("closeTip");
|
||||
},
|
||||
formatPriceShow(price, decimals, fixed = 2) {
|
||||
@ -295,7 +296,6 @@ export default {
|
||||
},
|
||||
|
||||
handChipTab() {
|
||||
// this.$emit("showTip", true);
|
||||
this.isTabs = true;
|
||||
},
|
||||
handPutShow() {
|
||||
@ -304,19 +304,17 @@ export default {
|
||||
handBuyShow() {
|
||||
this.$emit("handBuyShow", this.weapon);
|
||||
},
|
||||
async handRemove() {
|
||||
async handRemove() {
|
||||
try {
|
||||
this.showLoading()
|
||||
this.showLoading();
|
||||
const nftres = await this.chainManager.bc.beginCancelOrder(
|
||||
this.weapon.o_link,
|
||||
CONTRACT_ADDRESS[AppModule.chainId].marketAddress
|
||||
);
|
||||
console.log(nftres, "beginSell");
|
||||
if (nftres.status == true) {
|
||||
|
||||
this.$emit("handMessage", 1);
|
||||
this.hideLoading();
|
||||
setTimeout(() => {
|
||||
this.hideLoading();
|
||||
setTimeout(() => {
|
||||
this.$emit("handMessageHide");
|
||||
this.$emit("on-close");
|
||||
setTimeout(() => {
|
||||
@ -335,7 +333,6 @@ export default {
|
||||
background: "rgba(0, 0, 0, 0.8)",
|
||||
});
|
||||
},
|
||||
|
||||
hideLoading() {
|
||||
this.loadingInstance?.close();
|
||||
},
|
||||
@ -352,7 +349,8 @@ export default {
|
||||
width: 100%;
|
||||
background-color: rgba(20, 28, 34, 0.6);
|
||||
z-index: 2000;
|
||||
transition: opacity 0.2s cubic-bezier(0.6, 0, 0.4, 1) 0s, transform 0.2s ease-in-out 0s;
|
||||
transition: opacity 0.2s cubic-bezier(0.6, 0, 0.4, 1) 0s,
|
||||
transform 0.2s ease-in-out 0s;
|
||||
.content {
|
||||
position: relative;
|
||||
.close {
|
||||
@ -760,24 +758,24 @@ export default {
|
||||
background: url("../../../assets/market/hero/sell-mb-btn.png") no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
.for-rent-btn {
|
||||
display: flex;
|
||||
.adjust {
|
||||
width: 384px;
|
||||
height: 89px;
|
||||
cursor: pointer;
|
||||
background: url("../../../assets/market/hero/adjust.png") no-repeat;
|
||||
background-size: 100% 100%;
|
||||
.for-rent-btn {
|
||||
display: flex;
|
||||
.adjust {
|
||||
width: 384px;
|
||||
height: 89px;
|
||||
cursor: pointer;
|
||||
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%;
|
||||
}
|
||||
}
|
||||
.remove {
|
||||
width: 384px;
|
||||
height: 89px;
|
||||
cursor: pointer;
|
||||
margin-left: 14px;
|
||||
background: url("../../../assets/market/hero/remove.png") no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
.buy-price {
|
||||
position: absolute;
|
||||
|
Loading…
x
Reference in New Issue
Block a user