
@@ -38,6 +39,7 @@ import NftId from "@/configs/item.json"
import { apiAssetsState } from "@/utils/marketplace"
import {useMarketplaceStore} from "@/store/marketplace";
import {walletStore} from "@/store/wallet";
+import { BlockChain } from "@/components/chain/BlockChain"
const marketplaceStore = useMarketplaceStore()
const localWalletStore = walletStore()
const nftList = ref([])
@@ -82,10 +84,12 @@ const getMyAssets = async () => {
cursor: next_cursor.value,
search_name: overviewValue.value
}
- if(myADdress) {
+ const bc = new BlockChain()
+ if(bc.passportLogined) {
try {
let nftListBox
- let res = await apiAssetsState(myADdress, data)
+ const ptoken = await bc.passportToken()
+ let res = await apiAssetsState(myADdress, data, ptoken)
nftList.value = [...nftList.value, ...res.rows]
nftListBox = nftList.value.reduce((acc, obj) => {
const existingObj = acc.find(item => item.token_id == obj.token_id)
@@ -120,6 +124,11 @@ const handleScroll = () => {
}
}
+const passportLogin = async () => {
+ await new BlockChain().appendPassport()
+ getMyAssets()
+}
+
watch(localWalletStore,() => {
// console.log('localWalletStore.token',localWalletStore.address,localWalletStore.token)
if(!localWalletStore.token) {
@@ -210,6 +219,16 @@ onUnmounted(() => {
color: #fff;
margin-bottom: 20px;
font-size: 28px;
+ z-index: 99;
+ div {
+ width: 120px;
+ height: 50px;
+ border-radius: 30px;
+ margin: 0 auto;
+ margin-top: 10px;
+ border: 2px solid #A767FF;
+ cursor: pointer;
+ }
}
.no-data-img {
position: absolute;
diff --git a/src/router/index.js b/src/router/index.js
index 9d0be8f..04d6ed4 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -39,7 +39,6 @@ const routes = [
path: "/detail",
name: "CDetail",
component: Detail,
- props: true,
meta: {
title: "Counter Fire-Detail",
canonical: "https://.counterfire.games",
diff --git a/src/utils/marketplace.js b/src/utils/marketplace.js
index 7c872e8..71413f8 100644
--- a/src/utils/marketplace.js
+++ b/src/utils/marketplace.js
@@ -55,9 +55,9 @@ export const apiGetPrice = async (data) => {
}
// 获取我拥有得资产
-export const apiAssetsState = async (account_address, data) => {
+export const apiAssetsState = async (account_address, data, token) => {
const url = `${API_BASE}/api/asset/${net_id}/${account_address}`
- return httpGet(url, data)
+ return httpGet(url, data, token)
}
// 获取上架出售得NFTS
@@ -73,9 +73,9 @@ export const apiHistoryState = async (account_address,data) => {
}
// 账号游戏内资产
-export const apiLockState = async (account_address,data) => {
+export const apiLockState = async (account_address,data, token) => {
const url = `${API_BASE}/api/market/product/lock/${net_id}/${account_address}`
- return httpPost(url, data)
+ return httpPost(url, data, token)
}
// 详情
@@ -120,9 +120,9 @@ export const apiCecInfo = async(address) => {
}
// 获取游戏内资产
-export const apiHeroList = async(data) => {
+export const apiHeroList = async(data, token) => {
const url = `${API_BASE}/api/ingame/asset/hero/list`
- return httpPost(url, data)
+ return httpPost(url, data, token)
}
export const apiUnlockOrMint = async (data, token) => {