|
@ -4,7 +4,7 @@ |
|
|
> |
|
|
> |
|
|
<Cards |
|
|
<Cards |
|
|
:title="cardOptions.title" |
|
|
:title="cardOptions.title" |
|
|
:value="value" |
|
|
:value="hashv" |
|
|
:options="cardOptions.options" |
|
|
:options="cardOptions.options" |
|
|
:totalSupply="cardOptions.totalSupply" |
|
|
:totalSupply="cardOptions.totalSupply" |
|
|
:qrcodeurl="'https://baidu.com'" |
|
|
:qrcodeurl="'https://baidu.com'" |
|
@ -70,14 +70,16 @@ import { |
|
|
getContractAddressInfoList, |
|
|
getContractAddressInfoList, |
|
|
getContractHoldingQuantity, |
|
|
getContractHoldingQuantity, |
|
|
} from '@src/api/AddressController' |
|
|
} from '@src/api/AddressController' |
|
|
import { onMounted, reactive, ref } from 'vue' |
|
|
import { onMounted, reactive, ref, watchEffect } from 'vue' |
|
|
import holdersRow from './holdersRow.vue' |
|
|
import holdersRow from './holdersRow.vue' |
|
|
import transfersRow from '../VNFT/transfersRow.vue' |
|
|
import transfersRow from '../VNFT/transfersRow.vue' |
|
|
import Cards from './cards.vue' |
|
|
import Cards from './cards.vue' |
|
|
import { getFindReceiptByAddressPage } from '@src/api/TransactionsController' |
|
|
import { getFindReceiptByAddressPage } from '@src/api/TransactionsController' |
|
|
|
|
|
import { useRoute } from 'vue-router' |
|
|
const active = ref('tokenTransfers') |
|
|
const active = ref('tokenTransfers') |
|
|
const value = '0x4f2c168174266781008ba5d722d1bdc9ee52a874' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const route = useRoute() |
|
|
|
|
|
const hashv = ref<string>() |
|
|
const cardOptions = reactive({ |
|
|
const cardOptions = reactive({ |
|
|
title: '', |
|
|
title: '', |
|
|
options: [ |
|
|
options: [ |
|
@ -99,24 +101,25 @@ const cardOptions = reactive({ |
|
|
const holdrersRows = ref<any>([]) |
|
|
const holdrersRows = ref<any>([]) |
|
|
const transfersRows = ref<any>([]) |
|
|
const transfersRows = ref<any>([]) |
|
|
// 请求代币信息 |
|
|
// 请求代币信息 |
|
|
const requestInfo = async () => { |
|
|
const requestInfo = async (address: string) => { |
|
|
const params = { |
|
|
const params = { |
|
|
contractAddress: value, |
|
|
contractAddress: address, |
|
|
} |
|
|
} |
|
|
const res = await getContractAddressInfoList(params) |
|
|
const res = await getContractAddressInfoList(params) |
|
|
const { data } = res |
|
|
const { data } = res |
|
|
cardOptions.title = data.name |
|
|
cardOptions.title = data.name |
|
|
|
|
|
hashv.value = data?.contractAddress |
|
|
cardOptions.totalSupply = `${data.totalSupply} ${data.name}` |
|
|
cardOptions.totalSupply = `${data.totalSupply} ${data.name}` |
|
|
cardOptions.options[0].key = data.tokenType |
|
|
cardOptions.options[0].key = data.tokenType |
|
|
cardOptions.options[1].value = data.addressesCount |
|
|
cardOptions.options[1].value = data.addressesCount |
|
|
cardOptions.options[2].value = data.transfers |
|
|
cardOptions.options[2].value = data.transfers |
|
|
} |
|
|
} |
|
|
// 请求Token Holders |
|
|
// 请求Token Holders |
|
|
const requestHolders = async () => { |
|
|
const requestHolders = async (address: string) => { |
|
|
const params = { |
|
|
const params = { |
|
|
pageNum: 1, |
|
|
pageNum: 1, |
|
|
pageSize: 10, |
|
|
pageSize: 10, |
|
|
contractAddress: value, |
|
|
contractAddress: address, |
|
|
} |
|
|
} |
|
|
const res = await getContractHoldingQuantity(params) |
|
|
const res = await getContractHoldingQuantity(params) |
|
|
holdrersRows.value = res.data.rows.map((item: any) => { |
|
|
holdrersRows.value = res.data.rows.map((item: any) => { |
|
@ -129,9 +132,9 @@ const requestHolders = async () => { |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
// 请求Token Transfers |
|
|
// 请求Token Transfers |
|
|
const requestTransfers = async () => { |
|
|
const requestTransfers = async (address: string) => { |
|
|
const params = { |
|
|
const params = { |
|
|
address: value, |
|
|
address: address, |
|
|
pageNum: 1, |
|
|
pageNum: 1, |
|
|
pageSize: 10, |
|
|
pageSize: 10, |
|
|
filterType: 'all', |
|
|
filterType: 'all', |
|
@ -148,10 +151,11 @@ const requestTransfers = async () => { |
|
|
}) |
|
|
}) |
|
|
console.log(res) |
|
|
console.log(res) |
|
|
} |
|
|
} |
|
|
onMounted(() => { |
|
|
watchEffect(() => { |
|
|
requestInfo() |
|
|
let address = route.path.split('/')?.[2] |
|
|
requestHolders() |
|
|
requestInfo(address) |
|
|
requestTransfers() |
|
|
requestHolders(address) |
|
|
|
|
|
requestTransfers(address) |
|
|
}) |
|
|
}) |
|
|
</script> |
|
|
</script> |
|
|
|
|
|
|
|
|