|
@@ -16,68 +16,84 @@
|
|
|
@click="clickNFTImg"
|
|
|
/>
|
|
|
</div>
|
|
|
- <div v-for="(item, index) in listData" :key="index">
|
|
|
- <div class="desc item" v-if="item.filedName == 'Description'">
|
|
|
- <div class="title">{{item.filedName}}</div>
|
|
|
- <div class="desc-content" v-html="item.filedValue"></div>
|
|
|
- </div>
|
|
|
- <div class="prop item" v-if="item.filedName == 'Properties'">
|
|
|
- <div class="title">{{item.filedName}}</div>
|
|
|
- <div class="prop-content">
|
|
|
- <div
|
|
|
- class="prop-item"
|
|
|
- v-for="(filedValueItem, filedValueIndex) in item.filedValue"
|
|
|
- :key="filedValueIndex"
|
|
|
- >
|
|
|
- {{ filedValueItem.name }}
|
|
|
- <div class="prop-name">
|
|
|
- {{ filedValueItem.value }}
|
|
|
- </div>
|
|
|
- {{ filedValueItem.description }}
|
|
|
+ <div class="desc item" v-if="nftMetaData.description">
|
|
|
+ <div class="title">Description</div>
|
|
|
+ <div class="desc-content" v-html="nftMetaData.description"></div>
|
|
|
+ </div>
|
|
|
+ <div class="prop item" v-if="nftMetaData.properties && nftMetaData.properties.length">
|
|
|
+ <div class="title">Properties</div>
|
|
|
+ <div class="prop-content">
|
|
|
+ <div
|
|
|
+ class="prop-item"
|
|
|
+ v-for="(filedValueItem, filedValueIndex) in nftMetaData.properties"
|
|
|
+ :key="filedValueIndex"
|
|
|
+ >
|
|
|
+ {{ filedValueItem.name }}
|
|
|
+ <div class="prop-name">
|
|
|
+ {{ filedValueItem.value }}
|
|
|
</div>
|
|
|
+ {{ filedValueItem.description }}
|
|
|
</div>
|
|
|
</div>
|
|
|
+ </div>
|
|
|
|
|
|
- <div class="about item" v-if="item.filedName == 'About'">
|
|
|
- <div class="title">{{item.filedName}}</div>
|
|
|
- <div class="about-content" v-html="item.filedValue"></div>
|
|
|
- </div>
|
|
|
-
|
|
|
- <div class="detail item" v-if="item.filedName == 'Details'">
|
|
|
- <div class="title">{{item.filedName}}</div>
|
|
|
+ <div class="about item" v-if="nftMetaData.about">
|
|
|
+ <div class="title">About</div>
|
|
|
+ <div class="about-content" v-html="nftMetaData.about"></div>
|
|
|
+ </div>
|
|
|
+ <div class="detail item" v-if="nftDetailData.details">
|
|
|
+ <div class="title">Details</div>
|
|
|
<div class="detail-content">
|
|
|
- <div
|
|
|
- class="detail-item"
|
|
|
- v-for="(filedValueItem, filedValueIndex) in item.filedValue"
|
|
|
- :key="filedValueIndex"
|
|
|
- >
|
|
|
- <div class="left">{{ filedValueItem.name }}</div>
|
|
|
- <div class="right" :class="{'address': filedValueItem.name == 'Contract Address'}"
|
|
|
- v-if="filedValueItem.name != 'Token ID'"
|
|
|
- @click="clickAddress(filedValueItem)">
|
|
|
- <template v-if="filedValueItem.name != 'Contract Address'">
|
|
|
- {{ filedValueItem.value }}
|
|
|
- </template>
|
|
|
- <template v-else>
|
|
|
- <span>{{filedValueItem.value}}</span>
|
|
|
- <span>{{filedValueItem.value}}</span>
|
|
|
- </template>
|
|
|
+ <div class="detail-item">
|
|
|
+ <div class="left">Contract Address</div>
|
|
|
+ <div class="right address"
|
|
|
+ @click="clickAddress">
|
|
|
+ <span>{{nftDetailData.details.contractAddress}}</span>
|
|
|
+ <span>{{nftDetailData.details.contractAddress}}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="detail-item">
|
|
|
+ <div class="left">Token ID</div>
|
|
|
+ <div class="right token"
|
|
|
+ @click="clickToken">
|
|
|
+ {{nftDetailData.details.tokenId}}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="detail-item">
|
|
|
+ <div class="left">Token Standard</div>
|
|
|
+ <div class="right" >
|
|
|
+ {{nftDetailData.details.tokenStandard}}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="detail-item">
|
|
|
+ <div class="left">Blockchain</div>
|
|
|
+ <div class="right" >
|
|
|
+ {{nftDetailData.details.blockChain}}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="detail-item">
|
|
|
+ <div class="left">Creator Fees</div>
|
|
|
+ <div class="right" >
|
|
|
+ {{nftDetailData.details.creatorFees}}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="detail-item">
|
|
|
+ <div class="left">Transaction Royalties</div>
|
|
|
+ <div class="right" >
|
|
|
+ {{nftDetailData.details.transactionRoyalties}}
|
|
|
</div>
|
|
|
- <div v-else v-html='filedValueItem.value'></div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
-
|
|
|
- <div class="date item" v-if="item.filedName == 'Date of possession'">
|
|
|
- <div class="title">{{item.filedName}}</div>
|
|
|
- <div class="date-content">{{item.filedValue}}</div>
|
|
|
+ <div class="date item" v-if="nftDetailData.dateOfPossession">
|
|
|
+ <div class="title">Date of possession</div>
|
|
|
+ <div class="date-content">{{nftDetailData.dateOfPossession}}</div>
|
|
|
</div>
|
|
|
|
|
|
- <div class="price item" v-if="item.filedName == 'Purchase price'">
|
|
|
- <div class="title">{{item.filedName}}</div>
|
|
|
- <div class="price-content">{{item.filedValue}}</div>
|
|
|
+ <div class="price item" v-if="nftDetailData.purchasePrice">
|
|
|
+ <div class="title">Purchase price</div>
|
|
|
+ <div class="price-content">{{nftDetailData.purchasePrice}}</div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
</div>
|
|
|
<div class="bottom-bar">
|
|
|
<div class="default">NFT Sale function, coming soon</div>
|
|
@@ -107,7 +123,8 @@ import router from "@/router/popup.js";
|
|
|
|
|
|
import {getNFTDetail} from "@/http/nft.js";
|
|
|
|
|
|
-let listData = ref([{"filedName":"Description","filedValue":"Created by <font color=\"#1D9BF0\">Azuki<font>"},{"filedName":"Properties","filedValue":[{"description":"5% have this trait","name":"BACKGROUND","value":"Cool Blue"},{"description":"1% have this trait","name":"CLOTHING","value":"Hoodie"},{"description":"16% have this trait","name":"EAR","value":"Pearl"},{"description":"0.35% have this trait","name":"EYES","value":"Closed"},{"description":"4% have this trait","name":"MOUTH","value":"Lipstick"},{"description":"90% have this trait","name":"TYPE","value":"Human"}]},{"filedName":"About","filedValue":"<div class=\"section\" style=\"margin-bottom: 20px\">Take the red bean to join the garden. View the collection at <a style=\"text-decoration:none;color: #1D9BF0;\" href=\"https://azuki.com/gallery\" target=\"_blank\">azuki.com/gallery</a></div><div class=\"section\" style=\"margin-bottom: 20px\">Azuki starts with a collection of 10,000 avatars that give you membership access to The Garden: a corner of the internet where artists, builders, and web3 enthusiasts meet to create a decentralized future. Azuki holders receive access to exclusive drops, experiences, and more. Visit <a style=\"text-decoration:none;color: #1D9BF0;\" href=\"https://www.azuki.com\" target=\"_blank\">azuki.com</a> for more details.</div><div class=\"section\" style=\"margin-bottom: 20px\">We rise together. We build together. We grow together. </div>"},{"filedName":"Details","filedValue":[{"name":"Contract Address","url":"https://bscscan.com/token/0x2Fb9376cFf6fb7f5fe99665aE1Ec2FdDD5099134","value":"0xECa41281c24451168a37211F0bc2b8645AF45092"},{"name":"Token ID","value":"2752"},{"name":"Token Standard","value":"Ethereum"},{"name":"Blockchain","value":"Ethereum"},{"name":"Creator Fees","value":"4%"},{"name":"Transaction Royalties","value":"9%"}]},{"filedName":"Date of possession","filedValue":"2022-05-27"},{"filedName":"Purchase price","filedValue":"100 USDT"}]);
|
|
|
+let nftMetaData = ref({});
|
|
|
+let nftDetailData = ref({});
|
|
|
|
|
|
let NFTInfo = ref({
|
|
|
imagePath: '',
|
|
@@ -118,8 +135,18 @@ const back = () => {
|
|
|
router.back();
|
|
|
};
|
|
|
|
|
|
-const clickAddress = (params) => {
|
|
|
- window.open(params.url);
|
|
|
+const clickAddress = () => {
|
|
|
+ let {contractAddressUrl = ''} = nftDetailData.value.details;
|
|
|
+ if(contractAddressUrl) {
|
|
|
+ window.open(contractAddressUrl);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+const clickToken = () => {
|
|
|
+ let {tokenIdUrl = ''} = nftDetailData.value.details;
|
|
|
+ if(tokenIdUrl) {
|
|
|
+ window.open(tokenIdUrl);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
const clickNFTImg = () => {
|
|
@@ -133,7 +160,10 @@ const getDetail = () => {
|
|
|
}
|
|
|
}).then(res => {
|
|
|
if(res.code == 0) {
|
|
|
-
|
|
|
+ console.log(res)
|
|
|
+ let { metadata = '{}'} = res.data || {};
|
|
|
+ nftDetailData.value = res.data;
|
|
|
+ nftMetaData.value = JSON.parse(metadata);
|
|
|
}
|
|
|
}).catch((err)=>{
|
|
|
|
|
@@ -282,6 +312,11 @@ onMounted(() => {
|
|
|
color: #929292;
|
|
|
}
|
|
|
|
|
|
+ .token {
|
|
|
+ color: #1d9bf0 !important;
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
+
|
|
|
.address {
|
|
|
width: 100px;
|
|
|
white-space: nowrap;
|