Skip to content

Commit

Permalink
修复nft详情bug
Browse files Browse the repository at this point in the history
  • Loading branch information
tongjie committed Feb 7, 2021
1 parent 9d4b617 commit 065b9bf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 25 deletions.
4 changes: 2 additions & 2 deletions src/components/NftInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
param: {},
fee: {},
nftinfo: {},
type: process.env.nftContract
type: ''
};
},
computed: {
Expand Down Expand Up @@ -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];
},
Expand Down
24 changes: 2 additions & 22 deletions src/components/WalletIndex.vue
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@
</gxb-tab-container-item>
</gxb-tab-container>
</div>

</div>
</div>
<left-panel ref="panel"></left-panel>
Expand All @@ -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';
Expand Down Expand Up @@ -233,7 +233,6 @@
currentWalletIndex () {
this.loadBalances(this.currentWallet);
this.getStakingAmount();
this.getNFTList();
}
},
Expand All @@ -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({
Expand All @@ -283,7 +264,6 @@
this.loadBalances(wallet);
});
this.getStakingAmount();
this.getNFTList();
}
setTimeout(() => {
$.pullToRefreshDone($(this.$el).find('.pull-to-refresh-content'));
Expand Down
5 changes: 4 additions & 1 deletion src/components/sub/TransferNftConfirm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
},
contract: {
type: String,
default: process.env.nftContract
default: ''
}
},
methods: {
Expand Down Expand Up @@ -123,6 +123,9 @@
});
}
},
mounted () {
this.contract = this.$route.query.type;
},
components: {
AccountImage
}
Expand Down

0 comments on commit 065b9bf

Please sign in to comment.