From da65418be27a73efd4ae09304d57dcb0fc145d9c Mon Sep 17 00:00:00 2001 From: yuyongdong Date: Wed, 7 Aug 2024 19:43:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E5=85=85=E5=80=BC=E6=B5=81?= =?UTF-8?q?=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/assets/assetsHeader copy.vue | 2024 +++++++++++++++++++ src/components/assets/assetsHeader.vue | 41 +- src/components/chain/wallet/BitgetWallet.js | 2 +- src/components/layout/NavBar.vue | 5 +- 4 files changed, 2046 insertions(+), 26 deletions(-) create mode 100644 src/components/assets/assetsHeader copy.vue diff --git a/src/components/assets/assetsHeader copy.vue b/src/components/assets/assetsHeader copy.vue new file mode 100644 index 0000000..3bbb20f --- /dev/null +++ b/src/components/assets/assetsHeader copy.vue @@ -0,0 +1,2024 @@ + + + + + \ No newline at end of file diff --git a/src/components/assets/assetsHeader.vue b/src/components/assets/assetsHeader.vue index a9def4f..d2226c8 100644 --- a/src/components/assets/assetsHeader.vue +++ b/src/components/assets/assetsHeader.vue @@ -351,7 +351,7 @@
- 499950 + {{ brickworkAmount * 50 }}
@@ -365,8 +365,7 @@
- {{ priceAmount ? confirmRecharge.price : 0 }} - {{ confirmRecharge?.price }} + {{ brickworkAmount }}
@@ -566,7 +565,7 @@ const activeIndex = ref(0) const rechargeList = ref() const rechargeHistoryList = ref() const confirmRecharge = ref() -const brickworkAmount = ref(0) +const brickworkAmount = ref(1) const priceAmount = ref(0) // 打开充值弹窗 @@ -589,15 +588,14 @@ const getRechargeGoods = async () => { } const handleInput = (e) => { - // console.log(brickworkAmount.value, e) if(Number(brickworkAmount.value) >9999) { brickworkAmount.value = 9999 toRaw(confirmRecharge.value).price = 9999 - toRaw(confirmRecharge.value).diamond = brickworkAmount.value + toRaw(confirmRecharge.value).diamond = brickworkAmount.value*50 } else { toRaw(confirmRecharge.value).price = brickworkAmount.value - toRaw(confirmRecharge.value).diamond = brickworkAmount.value - priceAmount.value = brickworkAmount.value + toRaw(confirmRecharge.value).diamond = brickworkAmount.value*50 + // priceAmount.value = brickworkAmount.value } } @@ -605,24 +603,25 @@ const handleInput = (e) => { const rechargeDecrease = async () => { if(brickworkAmount.value == 0) return false brickworkAmount.value-- - priceAmount.value-- - if(confirmRecharge.value.goods_id == 1006) { - toRaw(confirmRecharge.value).price = priceAmount.value - toRaw(confirmRecharge.value).diamond = brickworkAmount.value + // priceAmount.value-- + if(confirmRecharge.value.goods_id == 1001) { + toRaw(confirmRecharge.value).price = brickworkAmount.value + toRaw(confirmRecharge.value).diamond = brickworkAmount.value*50 } } const rechargeIncrease = async () => { brickworkAmount.value++ - priceAmount.value++ - if(confirmRecharge.value.goods_id == 1006) { - toRaw(confirmRecharge.value).price = priceAmount.value - toRaw(confirmRecharge.value).diamond = brickworkAmount.value + // priceAmount.value++ + if(confirmRecharge.value.goods_id == 1001) { + toRaw(confirmRecharge.value).price = brickworkAmount.value + toRaw(confirmRecharge.value).diamond = brickworkAmount.value*50 } } // 充值 const conformBtn = async () => { - return + console.log(toRaw(confirmRecharge.value)) + // return // if(localWalletStore.walletType == 3) { let address = localWalletStore.address if(toRaw(confirmRecharge.value).price == 0) { @@ -633,12 +632,11 @@ const conformBtn = async () => { // return try { const bc = new BlockChain() - let res = await bc.mall.execBuyItem(Number(toRaw(confirmRecharge.value).goods_id), Number(toRaw(confirmRecharge.value).goods_id) == 1006 ? brickworkAmount.value : 0) + let res = await bc.mall.execBuyItem(Number(toRaw(confirmRecharge.value).goods_id), Number(toRaw(confirmRecharge.value).diamond)) // console.log(res) if(res) { - activeIndex.value = 0 - brickworkAmount.value = 0 - priceAmount.value = 0 + brickworkAmount.value = 1 + // priceAmount.value = 0 await dataInfo() loadingDialogVisible.value = false message.success('Top-Up Successful') @@ -716,7 +714,6 @@ const dataInfo = async () => { watch(localWalletStore,() => { // console.log('localWalletStore.token',localWalletStore.address,localWalletStore.token) if(!localWalletStore.token) { - nftList.value = [] cecInfo.value = { total: 0, available: '', diff --git a/src/components/chain/wallet/BitgetWallet.js b/src/components/chain/wallet/BitgetWallet.js index af43fdf..ace7efd 100644 --- a/src/components/chain/wallet/BitgetWallet.js +++ b/src/components/chain/wallet/BitgetWallet.js @@ -26,7 +26,7 @@ export class BitgetWallet{ } get installed() { - console.log('bitget install: ', window.bitkeep, window.bitkeep.ethereum) + // console.log('bitget install: ', window.bitkeep, window.bitkeep.ethereum) return !!window.bitkeep && !!window.bitkeep.ethereum; } diff --git a/src/components/layout/NavBar.vue b/src/components/layout/NavBar.vue index 99c4062..0d10208 100644 --- a/src/components/layout/NavBar.vue +++ b/src/components/layout/NavBar.vue @@ -320,9 +320,8 @@ const closeCartBox = () => { watch(() => route.path,(newPath, oldPath) => { let routerPath = newPath.split('/') - if(routerPath[1] == 'marketplace' || routerPath[1] == 'detail') { - // if(routerPath[1] == 'marketplace') { - console.log(toRaw(marketplaceStore.detailData)) + // if(routerPath[1] == 'marketplace' || routerPath[1] == 'detail') { + if(routerPath[1] == 'marketplace') { isCart.value = true } else { isCart.value = false