修改文案

This commit is contained in:
yuyongdong 2024-07-03 21:45:19 +08:00
parent bf1be4dfe0
commit 2d9c8ba3af
13 changed files with 133 additions and 28 deletions

View File

@ -110,7 +110,9 @@ function hideModal(result = null) {
}
}
.cf-content-text {
width: 80%;
width: 75%;
margin: 0 auto;
margin-top: 10px;
text-align: left;
.cf-text {
font-family: 'Poppins';

View File

@ -186,8 +186,10 @@ const sellConfirm = async () => {
currencyAmount: ethers.utils.parseEther(totalPrice(priceValue.value)).toString(),
orderExpiry: orderData,
};
const bc = new BlockChain();
console.log(data)
// return
try {
const bc = new BlockChain();
let res = await bc.market.beginSellERC721(data);
if (res.result) {
let timer = setTimeout(() => {
@ -197,7 +199,7 @@ const sellConfirm = async () => {
}, 2000);
}
} catch (e) {
console.log(e.message)
console.log(e)
message.error("Your product failed to be listed");
}
} else {

View File

@ -26,13 +26,13 @@ const marketplaceList = useMarketplaceStore()
const navList = ref([
{
name: "Collectibles"
name: "NFTs"
},
{
name: "Hanging list"
name: "Listings"
},
{
name: "Trading history"
name: "Trading History"
},
])
const navIndex = ref(0)

View File

@ -31,7 +31,7 @@
<script setup>
import { ref, onMounted, toRaw, onUnmounted, watch } from "vue";
import OverView from "@/components/common/searchView/Overview.vue";
import Status from "@/components/common/searchView/statusRadio.vue";
import Status from "@/components/common/searchView/nftStatusRadio.vue";
import Card from "./myCard.vue";
import NftId from "@/configs/item.json"
import { apiAssetsState } from "@/utils/marketplace"

View File

@ -21,10 +21,10 @@
<img src="@/assets/img/marketplace/ETHicon.png" alt="图片">
</div>
</div>
<div v-if="nftData.type == 0 && nftData.on_sale == 0" class="enabled" @click="lockToGame">
Enabled
<div v-if="nftData.type == 0 && nftData.on_sale == 0" class="enabled" @click="lockToGame('redeem')">
Redeem
</div>
<div v-if="nftData.type == 1 && nftData.on_sale == 0" class="link-below" @click="lockToGame">
<div v-if="nftData.type == 1 && nftData.on_sale == 0" class="link-below" @click="lockToGame('convert')">
Convert
</div>
<!-- <div>{{ nftData.owner_address.substr(0,6) }}...{{ nftData.owner_address.substr(-6) }}</div> -->
@ -47,6 +47,8 @@ import ImgCard from "@/components/common/imgCard.vue"
import { priceCalculated } from "@/configs/priceCalculate"
import LazyLoadImg from "@/components/lazyloadimg"
import placeholderImg from '@/assets/img/marketplace/GenesisHeroes_NFT.png'
import {createModal} from "@/utils/model.util";
import ConfirmDialog from "@/components/Dialogs/confirmDialog.vue"
import { timeFormat } from "@/configs/priceCalculate"
const emit = defineEmits(['renewMyNft'])
@ -119,20 +121,40 @@ const cancelNft = async (val) => {
}
// 使
const lockToGame = async() => {
const lockToGame = async(type) => {
// console.log('lockToGame',toRaw(props.nftData).contract_address, [toRaw(props.nftData).token_id])
// return
if(type == 'redeem') {
const confirmResult = await createModal(ConfirmDialog, {
title: '',
message: 'Once enabled, the gold coin card will be consumed, and you will receive 100,000 gold coins in the game. Do you wish to continue with this?'
}).show()
if (confirmResult.errcode == 0) {
lockToGameConfirm()
}
} else if(type == 'convert') {
const confirmResult = await createModal(ConfirmDialog, {
title: '',
message: ' After the hero links, you can use in the game, and can re-link in the game, whether to continue the next link?'
}).show()
console.log('confirmResult',confirmResult)
if (confirmResult.errcode == 0) {
lockToGameConfirm()
}
}
}
const lockToGameConfirm = async () => {
try {
const bc = new BlockChain()
let res = await bc.locker.lock(toRaw(props.nftData).contract_address, [toRaw(props.nftData).token_id])
console.log('lockToGame success', res)
// console.log('lockToGame success', res)
message.success('lockToGame success')
router.go(-1)
} catch (e) {
console.log('lockToGame fail', e.message)
// message.error('lockToGame fail.')
message.error('lockToGame fail.')
}
}

View File

@ -29,14 +29,14 @@
</div>
</template>
</a-table-column>
<a-table-column title="Create time" data-index="event">
<a-table-column title="Listing Time" data-index="event">
<template #default="{ text: event }">
<div>
{{ showTime(event.data.created_at) }}
</div>
</template>
</a-table-column>
<a-table-column title="Expiry date" data-index="event">
<a-table-column title="Expiration Time" data-index="event">
<template #default="{ text: event }">
<div>
{{ showTime(event.data.end_at) }}

View File

@ -1,7 +1,7 @@
<template>
<div>
<h2>Search</h2>
<a-input :value="overviewValue" @pressEnter="overviewData" placeholder="Basic usage">
<a-input :value="overviewValue" @pressEnter="overviewData" placeholder="Search">
<template #prefix>
<search-outlined style="color: #9588ac;" />
</template>

View File

@ -0,0 +1,54 @@
<template>
<div class="hero-check">
<h2>Status</h2>
<a-radio-group v-model:value="props.statusValue" @change="onChangeValue">
<a-radio value="0">All</a-radio>
<a-radio value="1">Listed</a-radio>
<a-radio value="2">Unlisted</a-radio>
</a-radio-group>
</div>
</template>
<script setup>
import { ref, reactive } from "vue";
import { useMarketplaceStore } from "@/store/marketplace"
const marketplaceList = useMarketplaceStore()
const props = defineProps({
statusValue: {
type: Number,
required: true,
},
});
const emit = defineEmits(['clickStatusChild'])
// const
const onChangeValue = (e) => {
emit('clickStatusChild',e.target.value)
};
</script>
<style lang="scss" scoped>
.hero-check {
h2 {
font-family: "Poppins";
font-weight: bold;
font-size: 20px;
color: #bb7fff;
margin-bottom: 10px;
}
:deep(.ant-radio-group) {
display: block;
.ant-radio-wrapper {
display: block !important;
span {
color: #BB7FFF;
}
}
.ant-checkbox-group-item {
display: flex !important;
background: #16141b;
span {
color: #BB7FFF !important;
}
}
}
}
</style>

View File

@ -3,8 +3,8 @@
<h2>Status</h2>
<a-radio-group v-model:value="props.statusValue" @change="onChangeValue">
<a-radio value="0">All</a-radio>
<a-radio value="1">Listed</a-radio>
<a-radio value="2">Unlisted</a-radio>
<a-radio value="1">Sale</a-radio>
<a-radio value="2">Purchase</a-radio>
</a-radio-group>
</div>
</template>

View File

@ -41,7 +41,7 @@
</div>
</template>
</a-table-column>
<a-table-column title="Sender" data-index="event" :width="400">
<a-table-column title="From" data-index="event" :width="400">
<template #default="{ text: event }">
<div class="sender">
<div class="nft-sender">{{ sliceAddress(event.data.details.from) }}</div>
@ -56,7 +56,7 @@
</div>
</template>
</a-table-column>
<a-table-column title="recipient" data-index="event" :width="400">
<a-table-column title="To" data-index="event" :width="400">
<template #default="{ text: event }">
<div class="recipient">
<div class="nft-recipient">{{ sliceAddress(event.data.details.to) }}</div>

View File

@ -57,7 +57,7 @@ export const CURRENCYS = {
id_query: 'ethereum'
},
},
13471: {
13371: {
'NATIVE': {
name: 'tIMX',
decimals: 18,

View File

@ -60,8 +60,8 @@
<div v-else>
<div class="sell" @click="beginSell" v-if="detailData.nft.on_sale == 0">List</div>
<div class="cancel" @click="cancelSell" v-if="detailData.nft.on_sale == 1">Cancel listing</div>
<div class="redeem" @click="lockToGame" v-if="detailData.nft.on_sale == 0 && detailData.nft.type == 1">Convert</div>
<div class="redeem" @click="lockToGame" v-if="detailData.nft.on_sale == 0 && detailData.nft.type == 0">Redeem</div>
<div class="redeem" @click="lockToGame('convert')" v-if="detailData.nft.on_sale == 0 && detailData.nft.type == 1">Convert</div>
<div class="redeem" @click="lockToGame('redeem')" v-if="detailData.nft.on_sale == 0 && detailData.nft.type == 0">Redeem</div>
</div>
</div>
<div class="info">
@ -165,6 +165,7 @@ import { ref, toRaw, onMounted , inject} from "vue"
const message = inject('$message')
import { useRouter } from "vue-router";
import BuyDialog from "@/components/Dialogs/buyDialog.vue"
import ConfirmDialog from "@/components/Dialogs/confirmDialog.vue"
import ImgCard from "@/components/common/imgCard.vue"
import StarTimer from "@/components/common/starTimer.vue"
import SellDialog from "@/components/Dialogs/sellDialog.vue"
@ -272,15 +273,38 @@ const clearCart = async () => {
}
}
const lockToGame = async() => {
const lockToGame = async(type) => {
if(type == 'redeem') {
const confirmResult = await createModal(ConfirmDialog, {
title: '',
message: 'Once enabled, the gold coin card will be consumed, and you will receive 100,000 gold coins in the game. Do you wish to continue with this?'
}).show()
if (confirmResult.errcode == 0) {
lockToGameConfirm()
}
} else if(type == 'convert') {
const confirmResult = await createModal(ConfirmDialog, {
title: '',
message: ' After the hero links, you can use in the game, and can re-link in the game, whether to continue the next link?'
}).show()
console.log('confirmResult',confirmResult)
if (confirmResult.errcode == 0) {
lockToGameConfirm()
}
}
}
const lockToGameConfirm = async () => {
try {
await new BlockChain().locker.lock(detailData.value.nft.contract_address, [detailData.value.nft.token_id])
console.log('lockToGame success')
// console.log('lockToGame success')
message.success('lockToGame success')
router.go(-1)
} catch (e) {
console.log('lockToGame fail', e.message)
// console.log('lockToGame fail', e.message)
message.error('lockToGame fail.')
}
}

View File

@ -28,6 +28,7 @@ export default defineConfig({
'@' : resolve(__dirname, 'src'),
process: "process/browser",
stream: "stream-browserify",
crypto: "crypto-browserify",
// zlib: "browserify-zlib",
util: 'util',
web3: resolve(__dirname, 'node_modules/web3/dist/web3.min.js')