金币卡下链完成、修改文案

This commit is contained in:
yuyongdong 2024-07-05 13:06:38 +08:00
parent 8206fd760a
commit ca67d99e8f
11 changed files with 61 additions and 101 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

View File

@ -17,7 +17,6 @@
<div class="content-nfts">
<div class="content-nfts-top">
<div class="content-nfts-top-left">
<!-- <img :src="props.sellDataArr.image" alt /> -->
<ImgCard :nftData="props.sellDataArr" />
</div>
<div class="content-nfts-top-right">
@ -25,14 +24,12 @@
<div class="content-nfts-top-right-price">
<li>
<div class="price-top-input">
<!-- <a-input v-model:value="priceValue" placeholder="Enter Listing Price" :parser="value =>value.replace(/^\D*(\d*(?:\.\d{0,5})?).*$/g,'$1')" @pressEnter="sellConfirm">
</a-input>-->
<input
type="text"
maxlength="7"
v-model="priceValue"
placeholder="Enter Listing Price"
onkeyup="value=value.replace(/[^0-9.]/g,'').replace(/\.{5,}/g,'.').replace(/^(\-)*(\d+)\.(\d\d\d\d\d).*$/,'$1$2.$3')"
onafterpaste="value=value.replace(/[^0-9.]/g,'').replace(/\.{5,}/g,'.').replace(/^(\-)*(\d+)\.(\d\d\d\d\d).*$/,'$1$2.$3')"
@input="handleInput"
/>
</div>
<div class="net-price">
@ -175,10 +172,16 @@ const optionDayValue = ref("86400000");
const priceValue = ref();
const isPriceListShow = ref(false);
const handleInput = (event) => {
// 使7
const value = event.target.value;
priceValue.value = value.replace(/[^\d]/g, '').slice(0, 7)
};
//
const currency = import.meta.env.VUE_APP_MARKET_CURRENCY;
const sellConfirm = async () => {
if (priceValue.value) {
if (priceValue.value && Number(priceValue.value) > 0) {
let curDate = new Date();
let orderData = new Date(curDate.getTime() + Number(optionDayValue.value));
const data = {

View File

@ -88,6 +88,10 @@ const logos = ref([
imgeSrc: new URL("@/assets/img/home/investor_GSR.png", import.meta.url)
.href,
},
{
imgeSrc: new URL("@/assets/img/home/investor_lmmutable.png", import.meta.url)
.href,
},
]);
const emit = defineEmits(["goToSlide"]);

View File

@ -40,6 +40,7 @@ const nftList = ref([])
const navTable = (i) => {
navIndex.value = i
window.scrollTo(0, 0)
}
const filterList = ref([])

View File

@ -101,7 +101,6 @@ const getMyAssets = async () => {
}
const handleScroll = () => {
const myADdress = localWalletStore.address
var scrollTop =
document.documentElement.scrollTop || document.body.scrollTop; //windowHeight
var windowHeight =
@ -110,19 +109,11 @@ const handleScroll = () => {
document.documentElement.scrollHeight || document.body.scrollHeight;
if (scrollTop + windowHeight == scrollHeight) {
//
// this.seeMoreSchoolList();
// console.log('scrollTop + windowHeight == scrollHeight',toRaw(marketplaceStore.cursorObj), scrollTop, windowHeight, scrollHeight)
// if(myADdress) {
if(toRaw(marketplaceStore.cursorObj).remaining != 0) {
// getMyAssets()
// } else {
console.log('请求coll')
} else {
console.log('不用请求coll')
// return false;
getMyAssets()
}
return false;
// }
}
}

View File

@ -6,7 +6,7 @@
<div class="content-right">
<div class="content-right-content">
<div class="pages-horizontal">
<Card :nftData="nftList" />
<Card :nftData="nftList" @renewMyNft="renewMyNft" />
</div>
</div>
</div>
@ -71,25 +71,23 @@ const getHistoryList = async () => {
}
};
// const handleScrollListing = () => {
// var scrollTop = document.documentElement.scrollTop || document.body.scrollTop; //windowHeight
// var windowHeight = document.documentElement.clientHeight || document.body.clientHeight; //scrollHeight
// var scrollHeight = document.documentElement.scrollHeight || document.body.scrollHeight;
// console.log("next_cursor.value",scrollTop, windowHeight, scrollHeight);
// return;
// if (scrollTop + windowHeight == scrollHeight) {
//
const renewMyNft = () => {
getHistoryList()
}
const handleScrollListing = () => {
var scrollTop = document.documentElement.scrollTop || document.body.scrollTop; //windowHeight
var windowHeight = document.documentElement.clientHeight || document.body.clientHeight; //scrollHeight
var scrollHeight = document.documentElement.scrollHeight || document.body.scrollHeight;
if (scrollTop + windowHeight == scrollHeight) {
// // //
// // // this.seeMoreSchoolList();
// // // console.log('scrollTop + windowHeight == scrollHeight',toRaw(marketplaceStore.cursorObj), scrollTop, windowHeight, scrollHeight)
// console.log("next_cursor.value", next_cursor.value);
// if (next_cursor.value.remaining != 0) {
// // getHistoryList()
// console.log("list");
// } else {
// console.log("list");
// }
// }
// };
if (next_cursor.value.remaining != 0) {
getHistoryList()
}
return false;
}
};
watch(localWalletStore, () => {
if (!localWalletStore.token) {
@ -101,11 +99,11 @@ watch(localWalletStore, () => {
onMounted(() => {
getHistoryList();
// window.removeEventListener("scroll", handleScrollListing);
window.addEventListener("scroll", handleScrollListing);
});
onUnmounted(() => {
// window.removeEventListener("scroll", handleScrollListing);
window.removeEventListener("scroll", handleScrollListing);
});
</script>

View File

@ -125,12 +125,10 @@ const cancelNft = async (val) => {
// 使
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 corresponding gold coins in the game. Do you wish to continue with this?'
message: `Redeem ${props.nftData.detail.gold_coins} Gold to your game account. Do you wish to proceed?`
}).show()
if (confirmResult.errcode == 0) {
lockToGameConfirm()
@ -138,24 +136,23 @@ const lockToGame = async(type) => {
} else if(type == 'convert') {
const confirmResult = await createModal(ConfirmDialog, {
title: '',
message: 'After the hero links, you can use in the game, and can auto re-link after the game test ending, whether to continue the next link?'
message: 'After converting, you will be able to use the hero in the game. At the end of Season 1, the hero will automatically be returned to your wallet or Immutable Passport. Do you want to proceed?'
}).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)
message.success('lockToGame success')
router.go(-1)
// router.go(-1)
emit('renewMyNft')
// router.push('/assets')
} catch (e) {
// console.log('lockToGame fail', e.message)
message.error('lockToGame fail.')
}
}

View File

@ -93,10 +93,7 @@ const handleScrollTrad = () => {
// this.seeMoreSchoolList();
// console.log('scrollTop + windowHeight == scrollHeight',toRaw(marketplaceStore.cursorObj), scrollTop, windowHeight, scrollHeight)
if(next_cursor.value.remaining != 0) {
// getHistoryList()
console.log('请求trad')
} else {
console.log('不用请求trad')
getHistoryList()
}
return false;
}

View File

@ -12,8 +12,8 @@
</li>
<li v-else>
<div class="gold-img">
<img v-if="props.nftData.detail.gold_coins == 1000" src="@/assets/img/marketplace/Coin_icon_1000.png" alt="">
<img v-if="props.nftData.detail.gold_coins == 10000" src="@/assets/img/marketplace/Coin_icon_10000.png" alt="">
<img v-if="props.nftData.item_id == 10017" src="@/assets/img/marketplace/Coin_icon_1000.png" alt="">
<img v-if="props.nftData.item_id == 10000" src="@/assets/img/marketplace/Coin_icon_10000.png" alt="">
</div>
</li>
</div>

View File

@ -136,6 +136,10 @@ const logos = ref([
imgeSrc: new URL("@/assets/img/home/investor_GSR.png", import.meta.url)
.href,
},
{
imgeSrc: new URL("@/assets/img/home/investor_lmmutable.png", import.meta.url)
.href,
},
]);
let timer = null;

View File

@ -6,9 +6,7 @@
<div class="content">
<div class="top-left">
<div class="top-left-img">
<!-- <LazyLoadImg :src="detailData.nft.image" :src-placeholder="placeholderImg" alt="" /> -->
<ImgCard :nftData="detailData.nft" />
<!-- <img src="" alt=""> -->
</div>
</div>
<div class="top-right">
@ -40,7 +38,6 @@
3购买
4
-->
<div v-if="myAddress != detailData.nft.owner_address">
<div v-if="detailData.event != null" class="buy" @click="localWalletStore.token == '' ? cardLogin() : buyNow()">Buy Now</div>
<div class="add" v-if="detailData.event != null && detailData.in_shopcart == 0" @click="localWalletStore.token == '' ? cardLogin() : addCart()">
@ -140,15 +137,15 @@
<h2>Property</h2>
<div class="gold-content">
<div class="left">
<h4>Gold coins</h4>
<p>1000</p>
<h4>Gold Amount</h4>
<p>{{ detailData.nft.detail.gold_coins }}</p>
</div>
<div class="right">
<div class="right-img">
<img src="@/assets/img/marketplace/Icon_!.png" alt="">
</div>
<div class="right-tips">
It can be enabled on your home page and you will receive 100,000 gold coins in counter Fire.
A Gold Card is equivalent to 100,000 Gold. Once redeemed, 100,000 Gold will be credited to your Counter Fire game account.
</div>
</div>
</div>
@ -201,28 +198,15 @@ const cardLogin = async () => {
//
const buyDataArr = ref([])
const buyNow = async () => {
// console.log(toRaw(detailData.value))
// return
// debugger
buyDataArr.value = []
buyDataArr.value.push(detailData.value)
const buyResult = await createModal(BuyDialog, {
buyDataArr: buyDataArr.value,
}).show()
if(buyResult.errcode) {
console.log('buy fail')
message.success('buy fail')
return
}
return
// ------------------------
let tokenIds = [detailData.value.event.data.id]
try {
await new BlockChain().market.batchBuy(tokenIds)
console.log('buy success')
} catch (e) {
console.log('buy fail', e.message)
}
}
//
@ -238,7 +222,7 @@ const addCart = async () => {
}
try {
const { errcode, errmsg } = await marketplaceList.addCartListState(data)
console.log(errcode, errmsg)
// console.log(errcode, errmsg)
if(errcode == 0) {
message.success('success! Add from cart')
marketplaceList.getCartList = await marketplaceList.getCartListState()
@ -269,15 +253,16 @@ const clearCart = async () => {
getDetail()
}
} catch (e) {
console.log(e)
// console.log(e)
}
}
// 使
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 corresponding gold coins in the game. Do you wish to continue with this?'
message: `Redeem ${detailData.value.nft.detail.gold_coins} Gold to your game account. Do you wish to proceed?`
}).show()
if (confirmResult.errcode == 0) {
lockToGameConfirm()
@ -285,24 +270,20 @@ const lockToGame = async(type) => {
} else if(type == 'convert') {
const confirmResult = await createModal(ConfirmDialog, {
title: '',
message: 'After the hero links, you can use in the game, and can auto re-link after the game test ending, whether to continue the next link?'
message: 'After converting, you will be able to use the hero in the game. At the end of Season 1, the hero will automatically be returned to your wallet or Immutable Passport. Do you want to proceed?'
}).show()
console.log('confirmResult',confirmResult)
// 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')
message.success('lockToGame success')
router.go(-1)
} catch (e) {
// console.log('lockToGame fail', e.message)
message.error('lockToGame fail.')
}
}
@ -315,28 +296,12 @@ const beginSell = async() => {
if (detailData.value.event) return
floorPrice.value = await getFloorPrice()
sellDialogVisible.value = true
return
try {
//TODO::
const sellData = {
contractAddress: detailData.contract_address,
tokenId: detailData.token_id,
currencyAddress: import.meta.env.VUE_APP_MARKET_CURRENCY,
currencyAmount: '1000000000000000000',
orderExpiry: null
}
await new BlockChain().market.beginSellERC721(sellData)
console.log('beginSell success')
} catch (e) {
console.log('beginSell fail', e.message)
}
}
//
const cancelSell = async() => {
console.log('cancelSell', detailData.value.event)
// console.log('cancelSell', detailData.value.event)
if (!detailData.value.event) return
try {
@ -347,7 +312,7 @@ const cancelSell = async() => {
clearTimeout(timer)
}, 2000);
}
console.log('cancelSell success')
// console.log('cancelSell success')
} catch (e) {
try {
let res = await new BlockChain().market.cancelOrdersOnChain([detailData.value.event.data.id])
@ -358,9 +323,9 @@ const cancelSell = async() => {
}, 2000);
}
} catch (e2) {
console.log('cancelSell fail', e.message)
// console.log('cancelSell fail', e.message)
}
console.log('cancelSell fail', e.message)
// console.log('cancelSell fail', e.message)
}
}
@ -407,7 +372,7 @@ const getDetail = async () => {
let { errcode, errmsg, data} = await nftDetail(props.address, props.tokenid)
contractBlankUrl.value = `${import.meta.env.VUE_APP_EXPLORER_URL}${data.nft.contract_address}`
if (errcode) {
console.log(errmsg)
// console.log(errmsg)
//TODO::
return
}
@ -422,7 +387,7 @@ const getDetail = async () => {
price.value = _data.tokenAmount
}
console.log(data,contractBlankUrl.value,import.meta.env.VUE_APP_NET_ID,import.meta.env.VUE_APP_GPAL_API,`${import.meta.env.VUE_APP_EXPLORER_URL}${data.nft.contract_address}`,'----')
// console.log(data,contractBlankUrl.value,import.meta.env.VUE_APP_NET_ID,import.meta.env.VUE_APP_GPAL_API,`${import.meta.env.VUE_APP_EXPLORER_URL}${data.nft.contract_address}`,'----')
}
onMounted(() => {