From 74d07939c06e23263e4021a80c2e0c4c19efaa2f Mon Sep 17 00:00:00 2001 From: yuyongdong Date: Thu, 4 Jul 2024 16:12:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=A4=96=E9=93=BE=E8=B7=B3?= =?UTF-8?q?=E8=BD=AC=E9=93=BE=E6=8E=A5=E3=80=81=E6=9B=BF=E6=8D=A2=E4=B8=AA?= =?UTF-8?q?=E4=BA=BA=E8=B5=84=E4=BA=A7=E5=BC=BA=E5=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/assets/collectibles.vue | 20 +++++++++++++++++--- src/components/home/HomeFooter.vue | 4 ++-- src/components/layout/NavBar.vue | 6 +++--- 3 files changed, 22 insertions(+), 8 deletions(-) diff --git a/src/components/assets/collectibles.vue b/src/components/assets/collectibles.vue index cb0a46b..b7e2e1b 100644 --- a/src/components/assets/collectibles.vue +++ b/src/components/assets/collectibles.vue @@ -63,8 +63,8 @@ const statusChild = (val) => { // 更新数据 const renewMyNft = async() => { let timer = setTimeout(() => { - // getMyAssets() - location.reload() + getMyAssets() + // location.reload() clearTimeout(timer); }, 2000); } @@ -81,8 +81,22 @@ const getMyAssets = async () => { } if(myADdress) { try { + let nftListBox let res = await apiAssetsState(myADdress, data) - nftList.value = Array.from(new Set([...res.rows, ...nftList.value].map(JSON.stringify))).map(JSON.parse); + // nftList.value = Array.from(new Set([...res.rows, ...nftList.value].map(JSON.stringify))).map(JSON.parse); + nftList.value = [...res.rows, ...nftList.value] + // console.log(toRaw(nftList.value)) + // debugger + nftListBox = nftList.value.reduce((acc, obj) => { + // console.log(acc,obj) + const existingObj = acc.find(item => item.token_id == obj.token_id) + if(!existingObj) { + acc.push(obj) + } + return acc + },[]) + nftList.value = nftListBox + // console.log(nftListBox) marketplaceStore.cursorObj = res.page next_cursor.value = res.page.next_cursor } catch(e) { diff --git a/src/components/home/HomeFooter.vue b/src/components/home/HomeFooter.vue index c1464cf..d812d2b 100644 --- a/src/components/home/HomeFooter.vue +++ b/src/components/home/HomeFooter.vue @@ -17,7 +17,7 @@