diff --git a/src/assets/img/marketplace/Delete icon.png b/src/assets/img/marketplace/Delete icon.png
new file mode 100644
index 0000000..3015959
Binary files /dev/null and b/src/assets/img/marketplace/Delete icon.png differ
diff --git a/src/components/assets/card.vue b/src/components/assets/card.vue
index 4bef8c3..7f3cb8b 100644
--- a/src/components/assets/card.vue
+++ b/src/components/assets/card.vue
@@ -69,17 +69,19 @@ const sellDataArr = ref([])
const currency = import.meta.env.VUE_APP_MARKET_CURRENCY
// 出售NFT
const sellNft = async (val) => {
- getPrice()
- console.log(toRaw(val))
+ // getPrice()
+ // console.log(toRaw(val))
// sellDialogVisible.value = true
// sellDataArr.value = val
- return
+ // return
+ let orderData = new Date()
const data = {
// import.meta.env.VUE_APP_PASSPORT_MARKET_ADDRESS
contractAddress: val.contract_address,
tokenId: val.token_id,
currencyAddress: currency,
- currencyAmount: '1000000000000000000'
+ currencyAmount: '1000000000000000000',
+ orderExpiry: orderData,
}
// sellDataArr.value.push(val)
// buyDialogVisible.value = true
diff --git a/src/components/assets/trading.vue b/src/components/assets/trading.vue
index e4685fb..775282a 100644
--- a/src/components/assets/trading.vue
+++ b/src/components/assets/trading.vue
@@ -34,9 +34,9 @@
-->
@@ -47,7 +47,7 @@
import { ref, onMounted } from "vue";
import OverView from "@/components/common/searchView/Overview.vue";
import Status from "@/components/common/searchView/status.vue";
-import Card from "@/components/common/card.vue";
+import Card from "@/components/common/tradingCard.vue";
import { apiHistoryState } from "@/utils/marketplace"
import { useTradingStore } from "@/store/trading"
import {walletStore} from "@/store/wallet";
@@ -84,6 +84,8 @@ const getHistoryList = async () => {
cursor: '',
}
let res = await apiHistoryState(myAddress,data)
+ nftList.value = res.rows
+ console.log(res)
}
onMounted(() => {
diff --git a/src/components/cart/index.vue b/src/components/cart/index.vue
index f24fabb..a50bf71 100644
--- a/src/components/cart/index.vue
+++ b/src/components/cart/index.vue
@@ -16,7 +16,15 @@
{{ item.nft.name }}
-
+
+
{{ priceCalculated(item.event.data.buy[0].amount) }}
+
+

+
+
+
+

+
@@ -42,8 +50,10 @@ import { ref, defineEmits, onMounted } from "vue"
import { useRouter, useRoute } from "vue-router";
import { useImmutableStore } from "@/store/immutable"
import { useMarketplaceStore } from "@/store/marketplace"
+import {priceCalculated} from "@/configs/priceCalculate.js"
+const marketplaceList = useMarketplaceStore()
import {
- apiGetCartList,
+ apiDelCartList,
apiClearCartList,
} from "@/utils/marketplace"
const router = useRouter();
@@ -62,26 +72,49 @@ const toMarketplace = () => {
router.push('/marketplace');
}
-const clearCart = async () => {
- console.log('清楚购物车')
+
+
+
+// 获取购物车列表
+const getCartList = async () => {
+ // let token = localStorage.getItem('assessToken')
+ // if(token) {
+ try {
+ let res = await marketplaceList.getCartListState()
+ cartList.value = res.data
+ } catch (e) {
+ console.log(e)
+ }
+ // }
+}
+
+// 删除nft
+const deleteNft = async (val) => {
+ const data = {
+ net_id: import.meta.env.VUE_APP_NET_ID,
+ tokens: [
+ {
+ token_id: val.nft.token_id,
+ contract_address: val.nft.contract_address,
+ }
+ ]
+ }
try {
- let res = await apiClearCartList()
+ const res = await marketplaceList.delCartListState(data)
console.log(res)
} catch (e) {
console.log(e)
}
}
-const getCartList = async () => {
- // let token = localStorage.getItem('assessToken')
- // if(token) {
- try {
- let res = await useMarketplaceStore().cartList
- cartList.value = res.data
- } catch (e) {
- console.log(e)
- }
- // }
+// 清空购物车
+const clearCart = async () => {
+ try {
+ let res = await apiClearCartList()
+ console.log(res)
+ } catch (e) {
+ console.log(e)
+ }
}
onMounted(()=> {
@@ -124,7 +157,7 @@ onMounted(()=> {
}
}
.cart-content {
- padding: 30px;
+ padding: 0 30px;
.cart-not {
text-align: center;
margin-bottom: 30px;
@@ -133,6 +166,9 @@ onMounted(()=> {
}
.cart-list {
.cart-item {
+ display: flex;
+ justify-content: space-between;
+ margin: 15px auto;
.cart-item-left {
display: flex;
.cart-item-left-img {
@@ -147,7 +183,48 @@ onMounted(()=> {
margin-left: 29px;
}
}
- .cart-item-right {}
+ .cart-item-right {
+ height: 40px;
+ .cart-item-right-price {
+ display: flex;
+ align-items: center;
+ div {
+ height: 27px;
+ line-height: 27px;
+ font-family: 'Poppins';
+ font-weight: bold;
+ font-size: 24px;
+ color: #984FFB;
+ }
+ .cart-item-right-price-img {
+ width: 27px;
+ height: 27px;
+ margin-left: 10px;
+ img {
+ width: 100%;
+ height: 100%;
+ }
+ }
+ }
+ .cart-item-right-clear {
+ display: none;
+ width: 39px;
+ height: 40px;
+ cursor: pointer;
+ img {
+ width: 100%;
+ height: 100%;
+ }
+ }
+ &:hover {
+ .cart-item-right-price {
+ display: none;
+ }
+ .cart-item-right-clear {
+ display: block;
+ }
+ }
+ }
}
}
.cart-btn {
diff --git a/src/components/chain/Market.js b/src/components/chain/Market.js
index 65c6c3c..cc77a1e 100644
--- a/src/components/chain/Market.js
+++ b/src/components/chain/Market.js
@@ -70,7 +70,7 @@ export class ImtblMarket {
// This signature is stored off-chain and is later provided to any user wishing to fulfil the open order.
// The signature only allows the order to be fulfilled if it meets the conditions specified by the user that created the listing.
if (action.type === orderbook.ActionType.SIGNABLE) {
- orderSignature = await signer._signTypedData(
+ orderSignature = await this.signer._signTypedData(
action.message.domain,
action.message.types,
action.message.value,
diff --git a/src/components/common/tradingCard.vue b/src/components/common/tradingCard.vue
index 07db6ab..35ea79c 100644
--- a/src/components/common/tradingCard.vue
+++ b/src/components/common/tradingCard.vue
@@ -1,13 +1,256 @@
-
+
+
+
+
+
![]()
+
+
+
+
+
\ No newline at end of file
diff --git a/src/components/layout/NavBar.vue b/src/components/layout/NavBar.vue
index e7431ab..1a83f46 100644
--- a/src/components/layout/NavBar.vue
+++ b/src/components/layout/NavBar.vue
@@ -40,7 +40,10 @@
- 7
+
+ {{ marketplaceStore.cartList.data.length }}
+ 0
+
Login