diff --git a/src/components/inputSearch.vue b/src/components/inputSearch.vue index c2d9a93..8526f80 100644 --- a/src/components/inputSearch.vue +++ b/src/components/inputSearch.vue @@ -30,9 +30,9 @@ export default { if (res.code == 4) { this.$router.push({ path: "/null", query: { id: value } }); this.$emit("SearchValue", value); - } else if (res.msg == "txs") { + } else if (res.msg == "tx") { this.$router.push({ path: "/transaction", query: { id: value } }); - } else if (res.msg == "") { + } else if (res.msg == "block") { this.$emit("SearchValue", value); this.$router.push({ path: "/blockDetails", query: { id: value } }); } else if (res.code == 1) { diff --git a/src/views/BlockDetails.vue b/src/views/BlockDetails.vue index 7cf5f46..21480cc 100644 --- a/src/views/BlockDetails.vue +++ b/src/views/BlockDetails.vue @@ -208,12 +208,11 @@ export default { //搜索 async getSearchList(data) { let res = await getSearch(data); - this.ResultsOf = res.data.data[0]; - let txs = res.data.data[0].txs.split(","); - txs.map(async (item) => { + this.ResultsOf = res.data; + res.data.txs.map(async (item) => { //获取交易列表 let res = await getTransActions(item); - this.TransactionList = res.txs; + this.TransactionList.push(...res.txs); this.total = this.TransactionList.length; }); }, diff --git a/src/views/Transaction.vue b/src/views/Transaction.vue index 52cd923..566c7b8 100644 --- a/src/views/Transaction.vue +++ b/src/views/Transaction.vue @@ -138,7 +138,7 @@ export default { async getSearchList(data) { let res = await getSearch(data); this.jsonData = res; - this.ResultsOf = res.data[0]; + this.ResultsOf = res.data; }, }, mounted() {