添加提示语
This commit is contained in:
parent
3a60f9111b
commit
e584bbf712
2
components.d.ts
vendored
2
components.d.ts
vendored
@ -37,7 +37,6 @@ declare module 'vue' {
|
|||||||
Gold: typeof import('./src/components/common/searchView/gold.vue')['default']
|
Gold: typeof import('./src/components/common/searchView/gold.vue')['default']
|
||||||
Hanging: typeof import('./src/components/assets/hanging.vue')['default']
|
Hanging: typeof import('./src/components/assets/hanging.vue')['default']
|
||||||
HangingCard: typeof import('./src/components/common/hangingCard.vue')['default']
|
HangingCard: typeof import('./src/components/common/hangingCard.vue')['default']
|
||||||
'HangingCard copy': typeof import('./src/components/common/hangingCard copy.vue')['default']
|
|
||||||
Hero: typeof import('./src/components/common/searchView/hero.vue')['default']
|
Hero: typeof import('./src/components/common/searchView/hero.vue')['default']
|
||||||
HeroCard: typeof import('./src/components/home/HeroCard.vue')['default']
|
HeroCard: typeof import('./src/components/home/HeroCard.vue')['default']
|
||||||
HeroWeaponChipSelector: typeof import('./src/components/home/HeroWeaponChipSelector.vue')['default']
|
HeroWeaponChipSelector: typeof import('./src/components/home/HeroWeaponChipSelector.vue')['default']
|
||||||
@ -48,6 +47,7 @@ declare module 'vue' {
|
|||||||
LatestNew: typeof import('./src/components/about/LatestNew.vue')['default']
|
LatestNew: typeof import('./src/components/about/LatestNew.vue')['default']
|
||||||
Layout: typeof import('./src/components/layout/index.vue')['default']
|
Layout: typeof import('./src/components/layout/index.vue')['default']
|
||||||
LoadingDialog: typeof import('./src/components/Dialogs/loadingDialog.vue')['default']
|
LoadingDialog: typeof import('./src/components/Dialogs/loadingDialog.vue')['default']
|
||||||
|
MessageDialog: typeof import('./src/components/Dialogs/messageDialog.vue')['default']
|
||||||
MktContent: typeof import('./src/components/marketplace/mktContent.vue')['default']
|
MktContent: typeof import('./src/components/marketplace/mktContent.vue')['default']
|
||||||
MktHeader: typeof import('./src/components/marketplace/mktHeader.vue')['default']
|
MktHeader: typeof import('./src/components/marketplace/mktHeader.vue')['default']
|
||||||
NavBar: typeof import('./src/components/layout/NavBar.vue')['default']
|
NavBar: typeof import('./src/components/layout/NavBar.vue')['default']
|
||||||
|
@ -59,10 +59,11 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import {ref, toRaw, defineEmits, computed} from "vue";
|
import {ref, toRaw, defineEmits, computed, getCurrentInstance, inject } from "vue";
|
||||||
|
const message = inject('$message')
|
||||||
|
|
||||||
import { priceCalculated } from "@/configs/priceCalculate"
|
import { priceCalculated } from "@/configs/priceCalculate"
|
||||||
import { BlockChain } from "@/components/chain/BlockChain"
|
import { BlockChain } from "@/components/chain/BlockChain"
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
buyDataArr: {
|
buyDataArr: {
|
||||||
type: Array,
|
type: Array,
|
||||||
@ -91,16 +92,18 @@ const buyConfirm = async () => {
|
|||||||
const bc = new BlockChain()
|
const bc = new BlockChain()
|
||||||
try {
|
try {
|
||||||
let res = await bc.market.batchBuy(ids)
|
let res = await bc.market.batchBuy(ids)
|
||||||
|
if(res.result) {
|
||||||
console.log('buy success ',res,ids)
|
message.success('Success! Buy.')
|
||||||
hideModal({errcode: 0});
|
console.log('buy success ',res,ids)
|
||||||
|
hideModal({errcode: 0});
|
||||||
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log("buy fail", err.message);
|
console.log("buy fail", err.message);
|
||||||
|
message.error(err.message)
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const handleCancel = (e) => {
|
const handleCancel = (e) => {
|
||||||
hideModal({errcode: 1});
|
hideModal({errcode: 1});
|
||||||
};
|
};
|
||||||
|
@ -126,7 +126,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import {ref, toRaw, defineEmits, onMounted, watch} from "vue";
|
import {ref, toRaw, defineEmits, onMounted, inject} from "vue";
|
||||||
|
const message = inject('$message')
|
||||||
import {DownOutlined, UpOutlined} from "@ant-design/icons-vue";
|
import {DownOutlined, UpOutlined} from "@ant-design/icons-vue";
|
||||||
import {priceCalculated, timeFormat, royaltiesPrice, feePrice, totalPrice} from "@/configs/priceCalculate.js";
|
import {priceCalculated, timeFormat, royaltiesPrice, feePrice, totalPrice} from "@/configs/priceCalculate.js";
|
||||||
import { BlockChain } from "@/components/chain/BlockChain"
|
import { BlockChain } from "@/components/chain/BlockChain"
|
||||||
@ -185,12 +186,13 @@ const sellConfirm = async () => {
|
|||||||
let res = await bc.market.beginSellERC721(data)
|
let res = await bc.market.beginSellERC721(data)
|
||||||
if(res.result) {
|
if(res.result) {
|
||||||
let timer = setTimeout(() => {
|
let timer = setTimeout(() => {
|
||||||
|
message.success('Success! Your item has been listed for sale.')
|
||||||
emit("handleClose", true)
|
emit("handleClose", true)
|
||||||
clearTimeout(timer)
|
clearTimeout(timer)
|
||||||
}, 2000);
|
}, 2000);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e)
|
message.error('Your product failed to be listed')
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
alert("价格不能为空");
|
alert("价格不能为空");
|
||||||
|
@ -39,7 +39,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, toRaw, onMounted, getCurrentInstance, defineEmits } from "vue"
|
import { ref, toRaw, onMounted, getCurrentInstance, defineEmits,inject } from "vue"
|
||||||
|
const message = inject('$message')
|
||||||
import SellDialog from "@/components/Dialogs/sellDialog.vue"
|
import SellDialog from "@/components/Dialogs/sellDialog.vue"
|
||||||
import { useDetailStore } from "@/store/detail"
|
import { useDetailStore } from "@/store/detail"
|
||||||
import { apiGetPrice, nftDetail } from "@/utils/marketplace"
|
import { apiGetPrice, nftDetail } from "@/utils/marketplace"
|
||||||
@ -96,40 +97,11 @@ const getNftData = async (val) => {
|
|||||||
|
|
||||||
const sellDialogVisible = ref(false)
|
const sellDialogVisible = ref(false)
|
||||||
const sellDataArr = ref([])
|
const sellDataArr = ref([])
|
||||||
const currency = import.meta.env.VUE_APP_MARKET_CURRENCY
|
|
||||||
// 出售NFT
|
// 出售NFT
|
||||||
const sellNft = async (val) => {
|
const sellNft = async (val) => {
|
||||||
sellDataArr.value = val
|
sellDataArr.value = val
|
||||||
floorPrice.value = await getFloorPrice(val)
|
floorPrice.value = await getFloorPrice(val)
|
||||||
let curDate = new Date()
|
|
||||||
let orderData = new Date(curDate.getTime() + 24*60*60*1000)
|
|
||||||
sellDialogVisible.value = true
|
sellDialogVisible.value = true
|
||||||
console.log(floorPrice.value,await getFloorPrice(val))
|
|
||||||
return
|
|
||||||
const data = {
|
|
||||||
// import.meta.env.VUE_APP_PASSPORT_MARKET_ADDRESS
|
|
||||||
contractAddress: val.contract_address,
|
|
||||||
tokenId: val.token_id,
|
|
||||||
currencyAddress: currency,
|
|
||||||
currencyAmount: '1000000000000000000',
|
|
||||||
orderExpiry: orderData,
|
|
||||||
}
|
|
||||||
// sellDataArr.value.push(val)
|
|
||||||
// buyDialogVisible.value = true
|
|
||||||
const bc = new BlockChain()
|
|
||||||
try {
|
|
||||||
let res = await bc.market.beginSellERC721(data)
|
|
||||||
console.log('售NFT', res)
|
|
||||||
if(res.result) {
|
|
||||||
let timer = setTimeout(() => {
|
|
||||||
emit('renewMyNft')
|
|
||||||
clearTimeout(timer);
|
|
||||||
}, 2000);
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
console.log(e)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 取消出售
|
// 取消出售
|
||||||
@ -140,12 +112,13 @@ const cancelNft = async (val) => {
|
|||||||
let res = await bc.market.cancelOrder([orderIds.event.data.id])
|
let res = await bc.market.cancelOrder([orderIds.event.data.id])
|
||||||
if(res.result) {
|
if(res.result) {
|
||||||
let timer = setTimeout(() => {
|
let timer = setTimeout(() => {
|
||||||
|
message.success('Your item has been unlisted.')
|
||||||
emit('renewMyNft')
|
emit('renewMyNft')
|
||||||
clearTimeout(timer);
|
clearTimeout(timer);
|
||||||
}, 2000);
|
}, 2000);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// console.log(e)
|
message.error('Your item has failed to be unlisted.')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -164,11 +137,7 @@ const cardPrice = async (val) => {
|
|||||||
|
|
||||||
// 去详情页面
|
// 去详情页面
|
||||||
const toDetail = () => {
|
const toDetail = () => {
|
||||||
// detailData.nftData = toRaw(props.nftData)
|
|
||||||
// router.push('/detail');
|
|
||||||
router.push(`/detail/${props.nftData.contract_address}/${props.nftData.token_id}`)
|
router.push(`/detail/${props.nftData.contract_address}/${props.nftData.token_id}`)
|
||||||
// const nftData = toRaw(props.nftData)
|
|
||||||
// router.push({name: 'Detail', state: { nftData }});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 关闭弹窗
|
// 关闭弹窗
|
||||||
|
@ -53,7 +53,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, defineEmits, onMounted, watch } from "vue"
|
import { ref, defineEmits, onMounted, inject } from "vue"
|
||||||
|
const message = inject('$message')
|
||||||
import ImgCard from "@/components/common/imgCard.vue"
|
import ImgCard from "@/components/common/imgCard.vue"
|
||||||
import ConfirmDialog from "@/components/Dialogs/confirmDialog.vue";
|
import ConfirmDialog from "@/components/Dialogs/confirmDialog.vue";
|
||||||
import BuyDialog from "@/components/Dialogs/buyDialog.vue"
|
import BuyDialog from "@/components/Dialogs/buyDialog.vue"
|
||||||
@ -154,8 +155,8 @@ const deleteNft = async (val) => {
|
|||||||
try {
|
try {
|
||||||
const { errcode, errmsg } = await marketplaceList.delCartListState(data)
|
const { errcode, errmsg } = await marketplaceList.delCartListState(data)
|
||||||
if(errcode == 0) {
|
if(errcode == 0) {
|
||||||
|
message.success('success! Remove from cart')
|
||||||
getCartList()
|
getCartList()
|
||||||
alert('success')
|
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e)
|
console.log(e)
|
||||||
@ -180,6 +181,7 @@ const clearCart = async () => {
|
|||||||
if (res.errcode) {
|
if (res.errcode) {
|
||||||
throw new Error(res.errmsg)
|
throw new Error(res.errmsg)
|
||||||
}
|
}
|
||||||
|
message.success('success! Remove from cart')
|
||||||
await getCartList()
|
await getCartList()
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e)
|
console.log(e)
|
||||||
@ -191,16 +193,15 @@ const buyAll = async () => {
|
|||||||
const confirmResult = await createModal(BuyDialog, {
|
const confirmResult = await createModal(BuyDialog, {
|
||||||
buyDataArr: cartList.value,
|
buyDataArr: cartList.value,
|
||||||
}).show()
|
}).show()
|
||||||
|
|
||||||
if(confirmResult.errcode) {
|
if(confirmResult.errcode) {
|
||||||
console.log('buy fail')
|
console.log('buy fail')
|
||||||
|
message.error('buy fail')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
getCartList()
|
getCartList()
|
||||||
alert('success')
|
message.success('success! Buy')
|
||||||
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e)
|
message.error(e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -156,6 +156,7 @@ export class ImtblMarket {
|
|||||||
* @param { string[] } listingIds: listingId列表
|
* @param { string[] } listingIds: listingId列表
|
||||||
*/
|
*/
|
||||||
async batchBuy(listingIds) {
|
async batchBuy(listingIds) {
|
||||||
|
// debugger
|
||||||
await this.bc.checkAndChangeChain();
|
await this.bc.checkAndChangeChain();
|
||||||
const fulfiller = await this.signer.getAddress();
|
const fulfiller = await this.signer.getAddress();
|
||||||
// console.log(listingIds, marketAddress,'---')
|
// console.log(listingIds, marketAddress,'---')
|
||||||
@ -190,6 +191,8 @@ export class ImtblMarket {
|
|||||||
console.log(
|
console.log(
|
||||||
`Fulfilling listings ${fulfillableOrders}, transaction expiry ${expiration}`
|
`Fulfilling listings ${fulfillableOrders}, transaction expiry ${expiration}`
|
||||||
);
|
);
|
||||||
|
} else {
|
||||||
|
console.log('余额不足')
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(`Fulfill bulk orders request failed with ${e}`);
|
console.error(`Fulfill bulk orders request failed with ${e}`);
|
||||||
|
@ -34,7 +34,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, toRaw, onMounted, getCurrentInstance, defineEmits } from "vue"
|
import { ref, toRaw, onMounted, getCurrentInstance, defineEmits,inject } from "vue"
|
||||||
|
const message = inject('$message')
|
||||||
import BuyDialog from "@/components/Dialogs/buyDialog.vue"
|
import BuyDialog from "@/components/Dialogs/buyDialog.vue"
|
||||||
import ImgCard from "@/components/common/imgCard.vue"
|
import ImgCard from "@/components/common/imgCard.vue"
|
||||||
import {priceCalculated} from "@/configs/priceCalculate.js"
|
import {priceCalculated} from "@/configs/priceCalculate.js"
|
||||||
@ -72,6 +73,7 @@ const buyNft = async (val) => {
|
|||||||
}).show()
|
}).show()
|
||||||
if(buyResult.errcode) {
|
if(buyResult.errcode) {
|
||||||
console.log('buy fail')
|
console.log('buy fail')
|
||||||
|
message.success('buy fail')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -83,10 +85,12 @@ const cancelNft = async (val) => {
|
|||||||
let res = await bc.market.cancelOrder([val.event.data.id])
|
let res = await bc.market.cancelOrder([val.event.data.id])
|
||||||
console.log(res,[val.event.data.id])
|
console.log(res,[val.event.data.id])
|
||||||
if(res.result) {
|
if(res.result) {
|
||||||
|
message.success('Your item has been unlisted.')
|
||||||
emit('renewNft')
|
emit('renewNft')
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e)
|
console.log(e)
|
||||||
|
message.error('Your item has failed to be unlisted.')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -112,11 +116,11 @@ const addCart = async (val) => {
|
|||||||
const { errcode, errmsg } = await marketplaceList.addCartListState(data)
|
const { errcode, errmsg } = await marketplaceList.addCartListState(data)
|
||||||
console.log(errcode, errmsg)
|
console.log(errcode, errmsg)
|
||||||
if(errcode == 0) {
|
if(errcode == 0) {
|
||||||
alert('Added successfully')
|
message.success('success! Add from cart')
|
||||||
marketplaceList.getCartList = await marketplaceList.getCartListState()
|
marketplaceList.getCartList = await marketplaceList.getCartListState()
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e)
|
message.error('fail! Add from cart')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,9 +4,8 @@ import "./style/rest.css";
|
|||||||
import "normalize.css";
|
import "normalize.css";
|
||||||
import "@/assets/text/text.css";
|
import "@/assets/text/text.css";
|
||||||
import "./index.css"; // 导入 Tailwind CSS 样式
|
import "./index.css"; // 导入 Tailwind CSS 样式
|
||||||
import Antd from "ant-design-vue";
|
import Antd, {message} from "ant-design-vue";
|
||||||
// import "ant-design-vue/dist/antd.css";
|
// import "ant-design-vue/dist/antd.css";
|
||||||
// import pinia from "@/store";
|
|
||||||
import router from "./router/index";
|
import router from "./router/index";
|
||||||
import VueAnimXyz from "@animxyz/vue3";
|
import VueAnimXyz from "@animxyz/vue3";
|
||||||
import "@animxyz/core"; // Import css here if you haven't elsewhere
|
import "@animxyz/core"; // Import css here if you haven't elsewhere
|
||||||
@ -28,10 +27,10 @@ notification.config({
|
|||||||
});
|
});
|
||||||
const app = createApp(App);
|
const app = createApp(App);
|
||||||
app.config.globalProperties.$log = console.log.bind(console);
|
app.config.globalProperties.$log = console.log.bind(console);
|
||||||
|
app.provide('$message', message)
|
||||||
|
|
||||||
app
|
app
|
||||||
.use(pinia)
|
.use(pinia)
|
||||||
// .use(piniaL)
|
|
||||||
.use(VueClipboard)
|
.use(VueClipboard)
|
||||||
.use(VueAnimXyz)
|
.use(VueAnimXyz)
|
||||||
.use(vue3dLoader)
|
.use(vue3dLoader)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user