diff --git a/src/App.vue b/src/App.vue index 9baabdb..b6c17ed 100644 --- a/src/App.vue +++ b/src/App.vue @@ -54,4 +54,25 @@ a { text-decoration: none; color: #2055ca; } + +// 记录列表的样式 +.records { + margin-top: 30px; + border: 1px solid #ebeff1; + + .head { + display: flex; + justify-content: space-between; + align-items: center; + height: 80px; + padding: 0 32px; + border-bottom: 1px solid #ececec; + background: #FFFFFF; + + h2 { + font-size: 16px; + font-weight: 500; + } + } +} diff --git a/src/components/Banner.vue b/src/components/Banner.vue index b104e08..9f402b1 100644 --- a/src/components/Banner.vue +++ b/src/components/Banner.vue @@ -1,15 +1,5 @@ @@ -55,7 +34,7 @@ const onSearch = () => { if (searchKey.value === '') { return ElMessage.warning({ - message:'请输入 地址/哈希/区块高度', + message: '请输入 地址/哈希/区块高度', offset: 300 }) } diff --git a/src/components/Pagination.vue b/src/components/Pagination.vue new file mode 100644 index 0000000..e035723 --- /dev/null +++ b/src/components/Pagination.vue @@ -0,0 +1,39 @@ + + + + + diff --git a/src/components/index.ts b/src/components/index.ts index ae2cdc2..8284f74 100644 --- a/src/components/index.ts +++ b/src/components/index.ts @@ -3,11 +3,13 @@ import Breadcrumb from './Breadcrumb.vue' import Footer from './Footer.vue' import Header from './Header.vue' import Nav from './Nav.vue' +import Pagination from './Pagination.vue' -export default { +export { Banner, Breadcrumb, Footer, Header, - Nav + Nav, + Pagination } diff --git a/src/types/block.d.ts b/src/types/block.d.ts new file mode 100644 index 0000000..66431f1 --- /dev/null +++ b/src/types/block.d.ts @@ -0,0 +1,5 @@ +export declare type AssetType = { + amount: number + exec: string + symbol: string +} diff --git a/src/utils/filters.ts b/src/utils/filters.ts index 48373d2..5748ac8 100644 --- a/src/utils/filters.ts +++ b/src/utils/filters.ts @@ -1,8 +1,15 @@ -export const filterHash = (str: string, num?: number) => { +import { AssetType } from '@/types/block' + +export const filterHash = (str: string, num?: number): string => { const length = num || 16 return str.substr(0, length) + '...' + str.substr(-4) } -export default { - filterHash +// 解析资产符号 +export const parseSymbol = (assets?: AssetType[]): string => { + if (assets) { + return assets[0].symbol + } else { + return '' + } } diff --git a/src/utils/request.ts b/src/utils/request.ts index ab6149a..89a1a7d 100644 --- a/src/utils/request.ts +++ b/src/utils/request.ts @@ -1,6 +1,6 @@ import vuex from '@/store' import axios, { AxiosRequestConfig } from 'axios' -import router from '../router' +import router from '@/router' const request = axios.create({ baseURL: process.env.VUE_APP_API_URL, diff --git a/src/views/Address/index.vue b/src/views/Address/index.vue index be162ac..f2d228e 100644 --- a/src/views/Address/index.vue +++ b/src/views/Address/index.vue @@ -1,23 +1,83 @@ diff --git a/src/views/Block/index.vue b/src/views/Block/index.vue index f58da4e..ee561a3 100644 --- a/src/views/Block/index.vue +++ b/src/views/Block/index.vue @@ -62,7 +62,7 @@ interval.value = setInterval(() => { if (maxHeight.value < res.result.height) { store.dispatch('setMaxHeight', res.result.height) } else { - console.log('列表',maxHeight.value, res.result.height) + console.log('列表', maxHeight.value, res.result.height) } }) }, 5000) @@ -78,7 +78,7 @@ block.getHeaders(start, maxHeight.value, false).then(res => { const currentPage = ref(1) const pageSize = ref(20) -const handleCurrentChange = (e: number) => { +const handleCurrentChange = () => { console.log(currentPage.value) } diff --git a/src/views/Home/index.vue b/src/views/Home/index.vue index 7ba0a1a..2903dad 100644 --- a/src/views/Home/index.vue +++ b/src/views/Home/index.vue @@ -48,7 +48,7 @@