bug fix: assets card price show error

This commit is contained in:
CounterFire2023 2024-07-04 05:44:26 +08:00
parent 1e88d573d3
commit 4b9a0e8acb

View File

@ -18,7 +18,7 @@
{{ nftPrice }} {{ nftPrice }}
<!-- {{cardPrice(nftData)}} --> <!-- {{cardPrice(nftData)}} -->
</span> </span>
<img src="@/assets/img/marketplace/ETHicon.png" alt="图片"> <img :src="icon" alt="">
</div> </div>
</div> </div>
<div v-if="nftData.type == 0 && nftData.on_sale == 0" class="enabled" @click="lockToGame('redeem')"> <div v-if="nftData.type == 0 && nftData.on_sale == 0" class="enabled" @click="lockToGame('redeem')">
@ -159,14 +159,16 @@ const lockToGameConfirm = async () => {
// //
const nftPrice = ref() const nftPrice = ref('-')
const icon = ref('')
const cardPrice = async (val) => { const cardPrice = async (val) => {
let nftData = await getNftData(toRaw(val)) let nftData = await getNftData(toRaw(val))
if(nftData.event) { if (nftData?.event?.data) {
nftPrice.value = priceCalculated(nftData.event.data.buy[0].amount) const data = formatPrice(nftData?.event?.data)
} else { icon.value = data.icon
return false nftPrice.value = data.tokenAmount
} }
} }