diff --git a/components.d.ts b/components.d.ts index 1a91b26..4c63999 100644 --- a/components.d.ts +++ b/components.d.ts @@ -16,6 +16,7 @@ declare module 'vue' { ACollapsePanel: typeof import('ant-design-vue/es')['CollapsePanel'] AInput: typeof import('ant-design-vue/es')['Input'] AInputSearch: typeof import('ant-design-vue/es')['InputSearch'] + AModal: typeof import('ant-design-vue/es')['Modal'] ASelect: typeof import('ant-design-vue/es')['Select'] ASelectOption: typeof import('ant-design-vue/es')['SelectOption'] ASpace: typeof import('ant-design-vue/es')['Space'] @@ -25,6 +26,7 @@ declare module 'vue' { ATableColumn: typeof import('ant-design-vue/es')['TableColumn'] ATooltip: typeof import('ant-design-vue/es')['Tooltip'] Banner: typeof import('./src/components/home/banner.vue')['default'] + BuyDialog: typeof import('./src/components/Dialogs/buyDialog.vue')['default'] Card: typeof import('./src/components/common/card.vue')['default'] Cart: typeof import('./src/components/cart/index.vue')['default'] ChainModel: typeof import('./src/components/home/ChainModel.vue')['default'] @@ -59,6 +61,7 @@ declare module 'vue' { RouterLink: typeof import('vue-router')['RouterLink'] RouterView: typeof import('vue-router')['RouterView'] Sort: typeof import('./src/components/common/searchView/Sort.vue')['default'] + StarTimer: typeof import('./src/components/common/starTimer.vue')['default'] Status: typeof import('./src/components/common/searchView/status.vue')['default'] Stotus: typeof import('./src/components/common/searchView/stotus.vue')['default'] TeamMember: typeof import('./src/components/about/TeamMember.vue')['default'] diff --git a/src/assets/img/marketplace/Add shopping cart.png b/src/assets/img/marketplace/Add shopping cart.png new file mode 100644 index 0000000..afd227e Binary files /dev/null and b/src/assets/img/marketplace/Add shopping cart.png differ diff --git a/src/assets/img/marketplace/BG01.jpg b/src/assets/img/marketplace/BG01.jpg new file mode 100644 index 0000000..0c3722b Binary files /dev/null and b/src/assets/img/marketplace/BG01.jpg differ diff --git a/src/assets/img/marketplace/Close counter.png b/src/assets/img/marketplace/Close counter.png new file mode 100644 index 0000000..6157f04 Binary files /dev/null and b/src/assets/img/marketplace/Close counter.png differ diff --git a/src/assets/img/marketplace/Move out.png b/src/assets/img/marketplace/Move out.png new file mode 100644 index 0000000..b59095f Binary files /dev/null and b/src/assets/img/marketplace/Move out.png differ diff --git a/src/components/Dialogs/buyDialog.vue b/src/components/Dialogs/buyDialog.vue new file mode 100644 index 0000000..ef6f733 --- /dev/null +++ b/src/components/Dialogs/buyDialog.vue @@ -0,0 +1,251 @@ + + + + \ No newline at end of file diff --git a/src/components/cart/index.vue b/src/components/cart/index.vue index c8299b2..9e466c1 100644 --- a/src/components/cart/index.vue +++ b/src/components/cart/index.vue @@ -32,7 +32,8 @@ import { ref, defineEmits, onMounted } from "vue" import { useRouter, useRoute } from "vue-router"; import { useImmutableStore } from "@/store/immutable" import { - apiGetCartList + apiGetCartList, + apiClearCartList, } from "@/utils/marketplace" const router = useRouter(); // console.log(marketplaceStore.cartList,'Cart-------') @@ -49,8 +50,14 @@ const toMarketplace = () => { router.push('/marketplace'); } -const clearCart = () => { +const clearCart = async () => { console.log('清楚购物车') + try { + let res = await apiClearCartList() + console.log(res) + } catch (e) { + console.log(e) + } } const getCartList = async () => { @@ -66,7 +73,7 @@ const getCartList = async () => { } onMounted(()=> { - // getCartList() + getCartList() }) diff --git a/src/components/common/card.vue b/src/components/common/card.vue index 94421e5..44d362e 100644 --- a/src/components/common/card.vue +++ b/src/components/common/card.vue @@ -1,6 +1,6 @@ \ No newline at end of file diff --git a/src/components/layout/NavBar.vue b/src/components/layout/NavBar.vue index 5d47272..e9a21c6 100644 --- a/src/components/layout/NavBar.vue +++ b/src/components/layout/NavBar.vue @@ -159,7 +159,7 @@ const formatAddress = computed(() => { const accountId = localStorage.getItem('assessAddress'); if (!accountId) return "-"; if (accountId.length >= 10) { - return `${accountId.substring(0, 6)}......${accountId.slice(-4)}`; + return `${accountId.substring(0, 6)}......${accountId.slice(-6)}`; } return accountId; }); @@ -254,6 +254,10 @@ const immuTableLogin = async () => { const immuTableLogout = async () => { try { + localStorage.removeItem('assessToken') + localStorage.removeItem('assessAddress') + immutableStore.accessToken = '' + immutableStore.accounts = '' await new PassportWallet().logout() } catch (e) { console.log(e) @@ -271,7 +275,7 @@ const myCart = async () => { } watch(() => route.path,(newPath, oldPath) => { - if(newPath == '/marketplace' || newPath == '/assets') { + if(newPath == '/marketplace' || newPath == '/assets' || newPath == '/detail') { isCart.value = true } else { isCart.value = false @@ -482,6 +486,7 @@ watch(() => route.path,(newPath, oldPath) => { justify-content: center; align-items: center; // right: 11px; + margin-right: 50px; .metaMask-logo { width: 60px; @@ -643,7 +648,7 @@ watch(() => route.path,(newPath, oldPath) => { } } .cart-con { - position: absolute; + position: fixed; right: 0; top: 84px; background: #1e1b23; diff --git a/src/utils/marketplace.js b/src/utils/marketplace.js index 3953bfd..5997d1d 100644 --- a/src/utils/marketplace.js +++ b/src/utils/marketplace.js @@ -65,7 +65,7 @@ export const apiMarketplaceState = async () => { // 详情 export const apiDetail = async (account_address) => { const url = `/api/market/transaction/history/${net_id}/${account_address}` - return httpGet(url, {data}) + return httpGet(url, {}) } // 获取购物车列表 diff --git a/src/views/DetailView.vue b/src/views/DetailView.vue index ed6af74..f70cea5 100644 --- a/src/views/DetailView.vue +++ b/src/views/DetailView.vue @@ -19,14 +19,14 @@
Price
图片 - Time remaining: 6d:10h:22m +
Time remaining:  
  • - 0.01 + {{ priceWei(detailData.nftData.event.data.buy[0].amount) }}  ICON - ($ 37.64) + ( $ 37.64 )
  • @@ -37,24 +37,34 @@ 3、购买 4、 --> - {{ detailData.nftData.nft }} -
    -
    Add to cart
    -
    Remove from cart
    +
    +
    Buy Now
    +
    + Add to cart +
    + +
    +
    +
    + Remove from cart +
    + +
    +
    -
    +
    上架
    下架
    使用
    -

    Info

    +

    Info

  • Contract address
    {{ sliceAddress(detailData.nftData.nft.contract_address) }}
    @@ -79,18 +89,77 @@
  • +
    +

    Property

    +
    +
  • +
    +
    Tier
    +

    {{ item }}

    +
    +
    +
    Active Days
    +

    {{ item }}

    +
    +
    +
    Wealth Value
    +

    {{ parseInt(item) }}

    +
    +
    +
    Luck Value
    +

    {{ parseInt(item) }}

    +
    +
    +
    HP
    +

    {{ parseInt(item) }}

    +
    +
    +
    Attack
    +

    {{ parseInt(item) }}

    +
    +
    +
    Defense
    +

    {{ Number(item).toFixed(2) }}%

    +
    +
    +
    Block Rate
    +

    {{ Number(item).toFixed(2) }}%

    +
    +
    +
    Crit Rate
    +

    {{ Number(item).toFixed(2) }}%

    +
    +
  • +
    +