From 065b9bf274a651e17705310a71a36ded23340d0c Mon Sep 17 00:00:00 2001 From: tongjie Date: Sun, 7 Feb 2021 19:08:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dnft=E8=AF=A6=E6=83=85bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/NftInfo.vue | 4 ++-- src/components/WalletIndex.vue | 24 ++--------------------- src/components/sub/TransferNftConfirm.vue | 5 ++++- 3 files changed, 8 insertions(+), 25 deletions(-) diff --git a/src/components/NftInfo.vue b/src/components/NftInfo.vue index 339e2c0..81a16bd 100644 --- a/src/components/NftInfo.vue +++ b/src/components/NftInfo.vue @@ -83,7 +83,7 @@ param: {}, fee: {}, nftinfo: {}, - type: process.env.nftContract + type: '' }; }, computed: { @@ -118,7 +118,7 @@ } }, async getNFTInfo () { - let _id = this.$route.params.id; + let _id = parseInt(this.$route.params.id); let _token = await get_contract_table(this.type, 'token', _id, _id + 1); this.nftinfo = _token.rows[0]; }, diff --git a/src/components/WalletIndex.vue b/src/components/WalletIndex.vue index 7c9c504..3df860e 100644 --- a/src/components/WalletIndex.vue +++ b/src/components/WalletIndex.vue @@ -165,7 +165,7 @@ - + @@ -182,7 +182,7 @@ import { fetch_account_balances, fetch_account, get_staking_object, fetch_reference_accounts, get_assets_by_ids, get_wallet_index, get_wallets, - set_wallet_index, get_contract_table + set_wallet_index } from '@/services/WalletService'; import {get_market_asset_price} from '@/services/MarketService'; import filters from '@/filters'; @@ -233,7 +233,6 @@ currentWalletIndex () { this.loadBalances(this.currentWallet); this.getStakingAmount(); - this.getNFTList(); } }, @@ -255,24 +254,6 @@ path: this.link(`/nftGroup/${item}`) }); }, - async getNFTList () { - this.accountNFT = []; - let currentAccountId = await fetch_account(this.currentWallet.account); - let _walletId = String(currentAccountId.id).split('.')[2]; - let _walletId_up = Number(_walletId) + 1; - let _accountInfo = await get_contract_table(process.env.nftContract, 'account', _walletId, _walletId_up); - let NFTAccountIds = _accountInfo && _accountInfo.rows[0] && _accountInfo.rows[0].ids; - if (NFTAccountIds && NFTAccountIds.length > 0) { - let NFTAccountIdsMap = NFTAccountIds.map(item => get_contract_table(process.env.nftContract, 'token', item, item + 1)); - Promise.all(NFTAccountIdsMap).then((res) => { - this.accountNFT = res.map(item => item.rows[0]); - this.setAccountNft({accountNFT: this.accountNFT}); - }).catch(ex => { - console.error(ex); - $.toast(ex.message); - }); - } - }, loadWallets () { if (this.wallets.length == 0) { this.$router.replace({ @@ -283,7 +264,6 @@ this.loadBalances(wallet); }); this.getStakingAmount(); - this.getNFTList(); } setTimeout(() => { $.pullToRefreshDone($(this.$el).find('.pull-to-refresh-content')); diff --git a/src/components/sub/TransferNftConfirm.vue b/src/components/sub/TransferNftConfirm.vue index 0e8ec80..b29350f 100644 --- a/src/components/sub/TransferNftConfirm.vue +++ b/src/components/sub/TransferNftConfirm.vue @@ -88,7 +88,7 @@ }, contract: { type: String, - default: process.env.nftContract + default: '' } }, methods: { @@ -123,6 +123,9 @@ }); } }, + mounted () { + this.contract = this.$route.query.type; + }, components: { AccountImage }