优化流程

This commit is contained in:
CounterFire2023 2024-06-26 17:43:28 +08:00
parent 4b256a30a1
commit c5cefb2b10
5 changed files with 13 additions and 9 deletions

View File

@ -9,7 +9,7 @@ VUE_APP_PASSPORT_LOGOUT_URI=https://tTB5eEedqDOHPHMI41sRDGmqAQwus9oE/
VUE_APP_PASSPORT_CLIENT_ID=tTB5eEedqDOHPHMI41sRDGmqAQwus9oE
VUE_APP_PASSPORT_MARKET_ADDRESS=0x7d117aA8BD6D31c4fa91722f246388f38ab1942c
VUE_APP_MKT_API='https://market-test.kingsome.cn'
VUE_APP_NET_ID='13473'
VUE_APP_NET_ID='13471'
VUE_APP_MARKET_CURRENCY='0xFd42bfb03212dA7e1A4608a44d7658641D99CF34'
VUE_APP_MAKEFEE_ADDRESS='0x50A8e60041A206AcaA5F844a1104896224be6F39'
VUE_APP_LOCKER_ADDRESS='0x59e751c2037B710090035B6ea928e0cce80aC03f'

View File

@ -47,8 +47,7 @@
<li>Total&nbsp;:&nbsp;</li>
<li>
<div>
<span>{{ priceCalculated(buyDataArr[0].event.data.buy[0].amount) }}</span>
<!-- <span>0.08</span> -->
<span>{{ totalPrice }}</span>
<img src="@/assets/img/marketplace/ETHicon.png" alt />
</div>
<!-- <div class="money">$ 400</div> -->
@ -63,7 +62,7 @@
import {ref, toRaw, defineEmits, computed} from "vue";
import { priceCalculated } from "@/configs/priceCalculate"
import { BlockChain } from "@/components/chain/BlockChain"
// const passProd = ref(new PassportWallet())
const props = defineProps({
buyDataArr: {
type: Array,
@ -75,6 +74,13 @@ const props = defineProps({
console.log(props.buyDataArr);
const totalPrice = computed(() => {
let total = 0n;
props.buyDataArr.forEach((item) => {
total += BigInt(item.event.data.buy[0].amount);
});
return priceCalculated(total);
});
const emit = defineEmits(["handleClose"]);
const handleOk = (e) => {

View File

@ -32,7 +32,6 @@
<script setup>
import { ref, toRaw, onMounted, getCurrentInstance } from "vue"
import SellDialog from "@/components/Dialogs/sellDialog.vue"
import {PassportWallet} from "@/wallet/passPort.js"
import { useDetailStore } from "@/store/detail"
import { apiGetPrice } from "@/utils/marketplace"
import LazyLoadImg from "@/components/lazyloadimg"

View File

@ -24,7 +24,7 @@ export class BlockChain {
this.store = walletStore();
this.store.$hydrate({runHooks: false});
this.initWallet();
this.market = new ImtblMarket()
this.market = new ImtblMarket(this)
this.locker = new Locker(this)
BlockChain.instance = this;

View File

@ -1,7 +1,6 @@
import { baseConfig } from './wallet/PassportWallet';
import { orderbook } from '@imtbl/sdk';
const marketAddress = import.meta.env.VUE_APP_PASSPORT_MARKET_ADDRESS
const makeFeeAddress = import.meta.env.VUE_APP_MAKEFEE_ADDRESS
const NATIVE = 'NATIVE'
const ERC20 = 'ERC20'
@ -100,7 +99,7 @@ export class ImtblMarket {
// Optional maker marketplace fee
makerFees: [{
amount,
recipientAddress: marketAddress, // Replace address with your own marketplace address
recipientAddress: makeFeeAddress, // Replace address with your own marketplace address
}],
});
console.log('order:', order);