@@ -52,6 +46,7 @@ import LazyLoadImg from "@/components/lazyloadimg"
import placeholderImg from '@/assets/img/marketplace/GenesisHeroes_NFT.png'
import {createModal} from "@/utils/model.util";
import ConfirmDialog from "@/components/Dialogs/confirmDialog.vue"
+import { useMarketplaceStore } from "@/store/marketplace"
import { timeFormat } from "@/configs/priceCalculate"
const emit = defineEmits(['renewMyNft'])
import {formatPrice} from "@/components/chain/utils"
@@ -66,6 +61,7 @@ const props = defineProps({
required: true,
},
});
+const marketplaceStore = useMarketplaceStore()
// 获取地板价
const floorPrice = ref('0')
@@ -154,15 +150,19 @@ const lockToGame = async(type) => {
}
// mint一个英雄
const mintHero = async () => {
- // const confirmResult = await createModal(ConfirmDialog, {
- // title: '',
- // message: 'After converting, you will be able to use the hero in the game. At the end of Season 1, the hero will automatically be returned to your wallet or Immutable Passport. Do you want to proceed?'
- // }).show()
- // if (confirmResult.errcode == 0) {
- // loadingDialogVisible.value = true
+ try {
const res = await new BlockChain().locker.mintNft([toRaw(props.nftData).uniid])
- console.log(res)
- // }
+ message.success('Mint success.')
+ emit('renewMyNft')
+ } catch (e) {
+ if(e.message.indexOf('rejected') > -1) {
+ message.error('User rejected the request')
+ } else if (e.message.indexOf('select wallet') > -1) {
+ message.error('user cancel select wallet')
+ } else {
+ message.error('Mint Failed.')
+ }
+ }
}
const lockToGameConfirm = async () => {
try {
@@ -187,21 +187,12 @@ const lockToGameConfirm = async () => {
// 获取出售中价格价格
const nftPrice = ref('-')
const icon = ref('')
-const cardPrice = async (val) => {
- let nftData = await getNftData(toRaw(val))
- // console.log(nftData)
- if (nftData?.event?.data) {
- const data = formatPrice(nftData?.event?.data)
- icon.value = data.icon
- nftPrice.value = data.tokenAmount
- }
-
-}
// 去详情页面
const toDetail = () => {
- router.push(`/detail/${props.nftData.contract_address}/${props.nftData.token_id}`)
+ marketplaceStore.detailData = {nft: props.nftData}
+ router.push('/detail')
}
// 关闭弹窗
diff --git a/src/components/assets/centralization.vue b/src/components/assets/centralization.vue
index dd69d23..6665ea0 100644
--- a/src/components/assets/centralization.vue
+++ b/src/components/assets/centralization.vue
@@ -103,14 +103,14 @@ const getMyAssets = async () => {
// console.log(res,'----------------------')
// return
nftList.value = [...nftList.value, ...res.rows]
- nftListBox = nftList.value.reduce((acc, obj) => {
- const existingObj = acc.find(item => item.token_id == obj.token_id)
- if(!existingObj) {
- acc.push(obj)
- }
- return acc
- },[])
- nftList.value = nftListBox
+ // nftListBox = nftList.value.reduce((acc, obj) => {
+ // const existingObj = acc.find(item => item.uniid == obj.uniid)
+ // if(!existingObj) {
+ // acc.push(obj)
+ // }
+ // return acc
+ // },[])
+ // nftList.value = nftListBox
// marketplaceStore.cursorObj = res.page
// next_cursor.value = res.page.next_cursor
} catch(e) {
diff --git a/src/components/assets/imgs.vue b/src/components/assets/imgs.vue
index ff81219..fdc8e8c 100644
--- a/src/components/assets/imgs.vue
+++ b/src/components/assets/imgs.vue
@@ -1,10 +1,10 @@
-
![]()
+
-
![]()
+
{{ nftData.detail.max_mining_days }}
@@ -20,7 +20,7 @@
-
![]()
+
{{ nftData.name }}
@@ -30,32 +30,13 @@
diff --git a/src/components/assets/myCard.vue b/src/components/assets/myCard.vue
index 4a34929..33327f3 100644
--- a/src/components/assets/myCard.vue
+++ b/src/components/assets/myCard.vue
@@ -23,16 +23,20 @@
+
+
22
+

+