This commit is contained in:
huangjinming 2023-01-18 17:30:01 +08:00
parent f538b44478
commit 67aab37d63
6 changed files with 83 additions and 107 deletions

View File

@ -135,22 +135,7 @@ export default {
return { return {
chainManager: new ChainManager(), chainManager: new ChainManager(),
loadingInstance:null, loadingInstance:null,
visible:this.dialogVisible, 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",
},
}; };
}, },
watch: { watch: {

View File

@ -12,8 +12,8 @@
</div> </div>
<div class="userinfo"> <div class="userinfo">
<div>History:</div> <!-- <div>History:</div>
<div>#3006...0103 (NFTLink)</div> <div>#3006...0103 (NFTLink)</div> -->
</div> </div>
</div> </div>
</div> </div>

View File

@ -35,7 +35,9 @@
<div class="level"> <div class="level">
<div> <div>
<span class="level-name">Lv</span> <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>
<div class="lucky-value"> <div class="lucky-value">
<div class="lucky-img"> <div class="lucky-img">
@ -66,27 +68,31 @@
</div> </div>
</div> </div>
</div> </div>
<div class="def-content" v-if="chip.detail"> <div class="def-content" v-if="chip.detail">
<div <div
class="def-item" class="def-item"
v-for="(item, i) in chip.detail.rand_attr" v-for="(item, i) in chip.detail.rand_attr"
:key="i" :key="i"
> >
<div>{{ chipArrid[item.attr_id] }}</div> <div>{{ chipArridName(item.attr_id)}}</div>
<div>{{ parseFloat(item.val * 100).toFixed(2) }}%</div> <div>{{ parseFloat(item.val * 100).toFixed(2) }}%</div>
</div> </div>
<div class="def-item">LUCKY Lv.{{ chip.detail.chip_grade }}</div> <div class="def-item">LUCKY Lv.{{ chip.detail.chip_grade }}</div>
</div> </div>
</div> </div>
<div class="mynft-sell" v-if="isType == 'mynft'"> <div class="mynft-sell" v-if="isType == 'mynft'">
<div class="for-rent-btn" v-if="chip.o_link > 0"> <div class="for-rent-btn" v-if="chip.o_link > 0">
<div class="adjust" @click="handPutShow"></div> <div class="adjust" @click="handPutShow"></div>
<div class="remove" @click="handRemove"></div> <div class="remove" @click="handRemove"></div>
</div> </div>
<div class="sell" @click="handPutShow" v-else>Sell</div> <div class="sell" @click="handPutShow" v-else>Sell</div>
</div> </div>
<div class="buy-price" v-else> <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"> <div class="buy-img" @click="handBuyShow">
<img src="../../../assets/market/hero/buy.png" alt="aoi-hero" /> <img src="../../../assets/market/hero/buy.png" alt="aoi-hero" />
</div> </div>
@ -101,10 +107,11 @@
<script> <script>
import { formatSelect } from "@/utils/UTCTime"; import { formatSelect } from "@/utils/UTCTime";
import { formatPrice } from "@/utils/chain.util"; import { formatPrice } from "@/utils/chain.util";
import { formatAddress } from "@/utils/formatAddress"; import { formatAddress, getChipArrid } from "@/utils/formatAddress";
import { AppModule } from "@/store/modules/app"; import { AppModule } from "@/store/modules/app";
import { CONTRACT_ADDRESS } from "@/configs/config_chain"; import { CONTRACT_ADDRESS } from "@/configs/config_chain";
import ChainManager from "@/chain/ChainManager"; import ChainManager from "@/chain/ChainManager";
export default { export default {
props: ["isType"], props: ["isType"],
name: "HeroModal", name: "HeroModal",
@ -112,23 +119,8 @@ export default {
return { return {
detailVisible: false, detailVisible: false,
chip: "", chip: "",
loadingInstance:null, loadingInstance: null,
chainManager: new ChainManager(), 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",
},
}; };
}, },
created() { created() {
@ -139,20 +131,22 @@ export default {
return formatSelect(this.chip?.modifytime); return formatSelect(this.chip?.modifytime);
}, },
owner() { owner() {
if(this.chip?.owner_address){ if (this.chip?.owner_address) {
return formatAddress(this.chip?.owner_address); return formatAddress(this.chip?.owner_address);
}else return false } else return false;
}, },
}, },
methods: { methods: {
closeTip() { closeTip() {
// (: closeTip)
this.$emit("closeTip"); this.$emit("closeTip");
}, },
formatPriceShow(price, decimals, fixed = 2) { formatPriceShow(price, decimals, fixed = 2) {
return formatPrice(price, decimals, fixed); return formatPrice(price, decimals, fixed);
}, },
chipArridName(nameId) {
return getChipArrid(nameId);
},
init(data) { init(data) {
this.detailVisible = true; this.detailVisible = true;
this.chip = data; this.chip = data;
@ -165,17 +159,16 @@ export default {
this.$emit("handBuyShow", this.chip); this.$emit("handBuyShow", this.chip);
}, },
async handRemove() { async handRemove() {
try { try {
this.showLoading() this.showLoading();
const nftres = await this.chainManager.bc.beginCancelOrder( const nftres = await this.chainManager.bc.beginCancelOrder(
this.chip.o_link, this.chip.o_link,
CONTRACT_ADDRESS[AppModule.chainId].marketAddress CONTRACT_ADDRESS[AppModule.chainId].marketAddress
); );
if (nftres.status == true) { if (nftres.status == true) {
this.$emit("handMessage", 1); this.$emit("handMessage", 1);
this.hideLoading(); this.hideLoading();
setTimeout(() => { setTimeout(() => {
this.$emit("handMessageHide"); this.$emit("handMessageHide");
this.$emit("on-close"); this.$emit("on-close");
setTimeout(() => { setTimeout(() => {
@ -186,7 +179,7 @@ export default {
} catch (err) { } catch (err) {
console.log("query order status error", err); console.log("query order status error", err);
this.hideLoading(); this.hideLoading();
this.$emit("handMessage", 1); this.$emit("handMessage", 1);
} }
}, },
showLoading() { showLoading() {
@ -210,8 +203,9 @@ export default {
left: 0; left: 0;
width: 100%; width: 100%;
background-color: rgba(20, 28, 34, 0.6); background-color: rgba(20, 28, 34, 0.6);
z-index: 2000; 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 { .content {
position: relative; position: relative;
.close { .close {
@ -454,7 +448,7 @@ export default {
background: url("../../../assets/market/hero/sell-mb-btn.png") no-repeat; background: url("../../../assets/market/hero/sell-mb-btn.png") no-repeat;
background-size: 100% 100%; background-size: 100% 100%;
} }
.for-rent-btn { .for-rent-btn {
display: flex; display: flex;
.adjust { .adjust {
width: 344px; width: 344px;

View File

@ -35,7 +35,7 @@
/> />
</div> </div>
<div class="service-usdt"> <div class="service-usdt">
<span class="usdt-number"> 10.8</span> USDT <span class="usdt-number"> 0</span> USDT
</div> </div>
</div> </div>
<div class="piece-bottom"> <div class="piece-bottom">
@ -71,7 +71,7 @@
<div class="piece-bottom-center"> <div class="piece-bottom-center">
<div class="minimum"> <div class="minimum">
<div>The minimum price setting is</div> <div>The minimum price setting is</div>
<div>1.01 USDT</div> <div>0.01 USDT</div>
</div> </div>
<div class="minimum"> <div class="minimum">
<div>The maximum price setting is</div> <div>The maximum price setting is</div>

View File

@ -96,7 +96,6 @@ export default {
handMessage() { handMessage() {
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.message.open(1); this.$refs.message.open(1);
console.log("chegn");
}); });
}, },
handPutHide() { handPutHide() {

View File

@ -60,14 +60,15 @@
</div> </div>
</div> </div>
<LevelStar v-if="weapon.detail" :level="weapon.detail.quality"> </LevelStar> <LevelStar v-if="weapon.detail" :level="weapon.detail.quality">
</LevelStar>
<LevelValue <LevelValue
v-if="weapon.detail" v-if="weapon.detail"
:level="weapon.detail.gun_lv" :level="weapon.detail.gun_lv"
:lucky="weapon.detail.lucky" :lucky="weapon.detail.lucky"
></LevelValue> ></LevelValue>
<ProgressCard <ProgressCard
v-if="weapon.detail" v-if="weapon.detail"
color="rgba(184, 77, 204, 0.7)" color="rgba(184, 77, 204, 0.7)"
progressImg="aggressivity" progressImg="aggressivity"
definecolor="#ca61dc" definecolor="#ca61dc"
@ -75,7 +76,7 @@
:max="weapon.detail.pvp_ceg_uplimit" :max="weapon.detail.pvp_ceg_uplimit"
></ProgressCard> ></ProgressCard>
<ProgressCard <ProgressCard
v-if="weapon.detail" v-if="weapon.detail"
color="rgba(193, 168, 93, 0.7)" color="rgba(193, 168, 93, 0.7)"
progressImg="defense" progressImg="defense"
definecolor="#d0bd7a" definecolor="#d0bd7a"
@ -84,7 +85,7 @@
></ProgressCard> ></ProgressCard>
<ProgressCard <ProgressCard
v-if="weapon.detail" v-if="weapon.detail"
color="rgba(81, 194, 224, 0.7)" color="rgba(81, 194, 224, 0.7)"
progressImg="lightning" progressImg="lightning"
definecolor="#7dd6ff" definecolor="#7dd6ff"
@ -102,8 +103,7 @@
</div> </div>
<div>ATTACK</div> <div>ATTACK</div>
</div> </div>
<div <div v-if="weapon.detail">
v-if="weapon.detail">
{{ {{
weapon.detail.rand_attr[0].val >= 100 weapon.detail.rand_attr[0].val >= 100
? parseInt(weapon.detail.rand_attr[0].val * 1) ? parseInt(weapon.detail.rand_attr[0].val * 1)
@ -118,8 +118,7 @@
</div> </div>
<div>RANGE</div> <div>RANGE</div>
</div> </div>
<div <div v-if="weapon.detail">
v-if="weapon.detail">
{{ {{
weapon.detail.rand_attr[6].val >= 100 weapon.detail.rand_attr[6].val >= 100
? parseInt(weapon.detail.rand_attr[6].val * 1) ? parseInt(weapon.detail.rand_attr[6].val * 1)
@ -135,8 +134,7 @@
</div> </div>
<div>REAT</div> <div>REAT</div>
</div> </div>
<div <div v-if="weapon.detail">
v-if="weapon.detail">
{{ {{
weapon.detail.rand_attr[3].val >= 100 weapon.detail.rand_attr[3].val >= 100
? parseInt(weapon.detail.rand_attr[3].val * 1) ? parseInt(weapon.detail.rand_attr[3].val * 1)
@ -221,7 +219,9 @@
</div> </div>
<div>BULLET SPEED</div> <div>BULLET SPEED</div>
</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>
</div> </div>
<AccountCard <AccountCard
@ -233,14 +233,18 @@
</div> </div>
<MosaicChip v-if="isTabs" :data="weapon"></MosaicChip> <MosaicChip v-if="isTabs" :data="weapon"></MosaicChip>
<div class="mynft-sell" v-if="isType == 'mynft'"> <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="adjust" @click="handPutShow"></div>
<div class="remove" @click="handRemove"></div> <div class="remove" @click="handRemove"></div>
</div> </div>
<div class="sell" @click="handPutShow" v-else>Sell</div> <div class="sell" @click="handPutShow" v-else>Sell</div>
</div> </div>
<div class="buy-price" v-else> <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"> <div class="buy-img" @click="handBuyShow">
<img src="../../../assets/market/hero/buy.png" alt="aoi-hero" /> <img src="../../../assets/market/hero/buy.png" alt="aoi-hero" />
</div> </div>
@ -272,15 +276,12 @@ export default {
chainManager: new ChainManager(), chainManager: new ChainManager(),
weapon: "", weapon: "",
isTabs: false, isTabs: false,
loadingInstance:null loadingInstance: null,
}; };
}, },
// created() {
// console.log(this.hero, "hero");
// },
methods: { methods: {
closeTip() { closeTip() {
// (: closeTip)
this.$emit("closeTip"); this.$emit("closeTip");
}, },
formatPriceShow(price, decimals, fixed = 2) { formatPriceShow(price, decimals, fixed = 2) {
@ -295,7 +296,6 @@ export default {
}, },
handChipTab() { handChipTab() {
// this.$emit("showTip", true);
this.isTabs = true; this.isTabs = true;
}, },
handPutShow() { handPutShow() {
@ -304,19 +304,17 @@ export default {
handBuyShow() { handBuyShow() {
this.$emit("handBuyShow", this.weapon); this.$emit("handBuyShow", this.weapon);
}, },
async handRemove() { async handRemove() {
try { try {
this.showLoading() this.showLoading();
const nftres = await this.chainManager.bc.beginCancelOrder( const nftres = await this.chainManager.bc.beginCancelOrder(
this.weapon.o_link, this.weapon.o_link,
CONTRACT_ADDRESS[AppModule.chainId].marketAddress CONTRACT_ADDRESS[AppModule.chainId].marketAddress
); );
console.log(nftres, "beginSell");
if (nftres.status == true) { if (nftres.status == true) {
this.$emit("handMessage", 1); this.$emit("handMessage", 1);
this.hideLoading(); this.hideLoading();
setTimeout(() => { setTimeout(() => {
this.$emit("handMessageHide"); this.$emit("handMessageHide");
this.$emit("on-close"); this.$emit("on-close");
setTimeout(() => { setTimeout(() => {
@ -335,7 +333,6 @@ export default {
background: "rgba(0, 0, 0, 0.8)", background: "rgba(0, 0, 0, 0.8)",
}); });
}, },
hideLoading() { hideLoading() {
this.loadingInstance?.close(); this.loadingInstance?.close();
}, },
@ -352,7 +349,8 @@ export default {
width: 100%; width: 100%;
background-color: rgba(20, 28, 34, 0.6); background-color: rgba(20, 28, 34, 0.6);
z-index: 2000; 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 { .content {
position: relative; position: relative;
.close { .close {
@ -760,24 +758,24 @@ export default {
background: url("../../../assets/market/hero/sell-mb-btn.png") no-repeat; background: url("../../../assets/market/hero/sell-mb-btn.png") no-repeat;
background-size: 100% 100%; background-size: 100% 100%;
} }
.for-rent-btn { .for-rent-btn {
display: flex; display: flex;
.adjust { .adjust {
width: 384px; width: 384px;
height: 89px; height: 89px;
cursor: pointer; cursor: pointer;
background: url("../../../assets/market/hero/adjust.png") no-repeat; background: url("../../../assets/market/hero/adjust.png") no-repeat;
background-size: 100% 100%; 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 { .buy-price {
position: absolute; position: absolute;