From b4d4eb288239145b6c4832cc1d8877927f6b319b Mon Sep 17 00:00:00 2001 From: CounterFire2023 <136581895+CounterFire2023@users.noreply.github.com> Date: Wed, 3 Jul 2024 16:41:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E5=87=BA=E5=94=AE=E6=97=B6,?= =?UTF-8?q?=20=E4=BB=B7=E6=A0=BC=E8=AE=BE=E7=BD=AE=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Dialogs/sellDialog.vue | 4 +++- src/configs/priceCalculate.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/Dialogs/sellDialog.vue b/src/components/Dialogs/sellDialog.vue index 5b371c6..3b0420d 100644 --- a/src/components/Dialogs/sellDialog.vue +++ b/src/components/Dialogs/sellDialog.vue @@ -132,6 +132,7 @@ const message = inject("$message"); import {DownOutlined, UpOutlined} from "@ant-design/icons-vue"; import {priceCalculated, timeFormat, royaltiesPrice, feePrice, totalPrice} from "@/configs/priceCalculate.js"; import {BlockChain} from "@/components/chain/BlockChain"; +import { ethers } from "ethers" const props = defineProps({ sellDialogVisible: { type: Boolean, @@ -179,7 +180,7 @@ const sellConfirm = async () => { contractAddress: props.sellDataArr.contract_address, tokenId: props.sellDataArr.token_id, currencyAddress: currency, - currencyAmount: BigInt(totalPrice(priceValue.value) * 1e18), + currencyAmount: ethers.utils.parseEther(totalPrice(priceValue.value)).toString(), orderExpiry: orderData, }; const bc = new BlockChain(); @@ -193,6 +194,7 @@ const sellConfirm = async () => { }, 2000); } } catch (e) { + console.log(e.message) message.error("Your product failed to be listed"); } } else { diff --git a/src/configs/priceCalculate.js b/src/configs/priceCalculate.js index b96f667..74e8c72 100644 --- a/src/configs/priceCalculate.js +++ b/src/configs/priceCalculate.js @@ -44,7 +44,7 @@ export const feePrice = (price) => { } export const totalPrice = (price) => { - return Number(Number(price) + Number(price) * 0.02).toFixed(5) + return Number(Number(price) + Number(price) * 0.04).toFixed(5) } // 处理时间回显