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 }}
<!-- {{cardPrice(nftData)}} -->
</span>
<img src="@/assets/img/marketplace/ETHicon.png" alt="图片">
<img :src="icon" alt="">
</div>
</div>
<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) => {
let nftData = await getNftData(toRaw(val))
if(nftData.event) {
nftPrice.value = priceCalculated(nftData.event.data.buy[0].amount)
} else {
return false
if (nftData?.event?.data) {
const data = formatPrice(nftData?.event?.data)
icon.value = data.icon
nftPrice.value = data.tokenAmount
}
}