-
+
+
@@ -11,7 +12,7 @@
- 0.085
+ 0.085 {{ nftData.item_id }}
@@ -24,13 +25,13 @@
-
+
+
+
diff --git a/src/store/collectibles.js b/src/store/collectibles.js
index 321e5ca..35bf8db 100644
--- a/src/store/collectibles.js
+++ b/src/store/collectibles.js
@@ -22,7 +22,7 @@ export const useCollectiblesStore = defineStore('collectibles', () => {
status, updateStatusStatus,
}
},
-{
- persist: true,
-}
+ {
+ persist: true,
+ }
)
diff --git a/src/store/detail.js b/src/store/detail.js
index 16bd55b..d733b7b 100644
--- a/src/store/detail.js
+++ b/src/store/detail.js
@@ -17,7 +17,7 @@ export const useDetailStore = defineStore('detail', () => {
nftData, updateDetailStatus,
}
},
-{
- persist: true,
-}
+ {
+ persist: true,
+ }
)
diff --git a/src/store/hanging.js b/src/store/hanging.js
index dfa0be5..91852fb 100644
--- a/src/store/hanging.js
+++ b/src/store/hanging.js
@@ -22,7 +22,7 @@ export const useHangingStore = defineStore('hanging', () => {
status, updateStatusStatus,
}
},
-{
- persist: true,
-}
+ {
+ persist: true,
+ }
)
diff --git a/src/store/immutable.js b/src/store/immutable.js
index e7b5e44..1292af5 100644
--- a/src/store/immutable.js
+++ b/src/store/immutable.js
@@ -16,7 +16,7 @@ export const useImmutableStore = defineStore('immutable', () => {
access, updateAccessStatus,
}
},
-{
- persist: true,
-}
+ {
+ persist: true,
+ }
)
\ No newline at end of file
diff --git a/src/store/marketplace.js b/src/store/marketplace.js
index b462a33..e10ebbb 100644
--- a/src/store/marketplace.js
+++ b/src/store/marketplace.js
@@ -1,6 +1,6 @@
import { defineStore } from 'pinia';
import { ref } from 'vue';
-// import { apiMarketplaceState } from "@/utils/marketplace"
+import { apiGetCartList } from "@/utils/marketplace"
export const useMarketplaceStore = defineStore('marketplace', () => {
const overview = ref('')
@@ -47,8 +47,11 @@ export const useMarketplaceStore = defineStore('marketplace', () => {
// return '可以'
// }
// }
- const getCartList = async () => {
- cartList.value = '可以'
+ async function getCartList() {
+ // cartList.value = '可以'
+ let res = await apiGetCartList()
+ console.log(res)
+ return res
}
return {
diff --git a/src/store/trading.js b/src/store/trading.js
index 65ff55f..5c72f01 100644
--- a/src/store/trading.js
+++ b/src/store/trading.js
@@ -22,7 +22,7 @@ export const useTradingStore = defineStore('trading', () => {
status, updateStatusStatus,
}
},
-{
- persist: true,
-}
+ {
+ persist: true,
+ }
)
diff --git a/src/utils/marketplace.js b/src/utils/marketplace.js
index 2e7ace5..63cd547 100644
--- a/src/utils/marketplace.js
+++ b/src/utils/marketplace.js
@@ -43,25 +43,25 @@ export const apiMarketplaceState = async (data) => {
// 获取我拥有得资产
export const apiAssetsState = async (account_address, data) => {
- const url = `/api/asset/${net_id}/${account_address}`
- return httpGet(url, {data})
+ const url = `${API_BASE}/api/asset/${net_id}/${account_address}?type=${data.type}?ge_size=${data.page_size}?cursor=${data.cursor}?search_name=${data.search_name}`
+ return httpGet(url, {})
}
// 获取上架出售得NFTS
export const apiHangingState = async (account_address, data) => {
- const url = `/api/asset/${net_id}/${account_address}`
+ const url = `${API_BASE}/api/asset/${net_id}/${account_address}`
return httpGet(url, {data})
}
// 账号交易历史
-export const apiHistoryState = async (account_address) => {
- const url = `/api/market/transaction/history/${net_id}/${account_address}`
+export const apiHistoryState = async (account_address,data) => {
+ const url = `${API_BASE}/api/market/transaction/history/${net_id}/${account_address}?type=${data.type}?ge_size=${data.page_size}?cursor=${data.cursor}`
return httpGet(url, {})
}
// 详情
export const apiDetail = async (account_address) => {
- const url = `/api/market/transaction/history/${net_id}/${account_address}`
+ const url = `${API_BASE}/api/market/transaction/history/${net_id}/${account_address}`
return httpGet(url, {})
}
@@ -73,16 +73,16 @@ export const apiGetCartList = async () => {
// 添加购物车
export const apiAddCartList = async (data) => {
- const url = `/api/shopcart/add`
+ const url = `${API_BASE}/api/shopcart/add`
return httpPost(url, {data})
}
// 删除购物车
export const apiDelCartList = async () => {
- const url = `/api/shopcart/del`
+ const url = `${API_BASE}/api/shopcart/del`
}
// 清空购物车
export const apiClearCartList = async () => {
- const url = `/api/shopcart/clear`
+ const url = `${API_BASE}/api/shopcart/clear`
}
diff --git a/src/views/DetailView.vue b/src/views/DetailView.vue
index f70cea5..4c0c387 100644
--- a/src/views/DetailView.vue
+++ b/src/views/DetailView.vue
@@ -141,7 +141,9 @@
import { ref, toRaw, onMounted } from "vue"
import StarTimer from "@/components/common/starTimer.vue"
import { apiDetail } from "@/utils/marketplace"
+import {priceCalculated} from "@/configs/priceCalculate.js"
import { useDetailStore } from "@/store/detail"
+
const detailData = useDetailStore()
console.log(toRaw(detailData.nftData))
import { PassportWallet } from "@/wallet/passPort"
@@ -198,29 +200,18 @@ const sliceAddress = (address) => {
// 处理货币
const priceWei = (price) => {
- let toPrice = parseInt(BigInt(price))/1e18
- return priceFixed(toPrice)
-}
-const priceFixed = (num) => {
- if(isNaN(num)){return num};
- //处理不需要转换的数字
- var str = ''+num;
- if(!/e/i.test(str)){return num;};
- //先获取到精确的小数位
- var fixed = (''+num).match(/\d+$/)[0];
- //拿到保留指定的小数
- return new Number(num).toFixed(fixed);
+ return priceCalculated(price)
}
const getDetail = async () => {
- let address = localStorage.getItem('address')
+ let address = localStorage.getItem('assessAddress')
let res = await apiDetail(address)
console.log('getDetail',toRaw(res))
nftData.value = res.rows
}
onMounted(() => {
- // getDetail()
+ getDetail()
})