diff --git a/.env.dev b/.env.dev index d1b41db..afca40a 100644 --- a/.env.dev +++ b/.env.dev @@ -15,6 +15,7 @@ VUE_APP_NET_ID='13473' VUE_APP_MARKET_CURRENCY='0xFd42bfb03212dA7e1A4608a44d7658641D99CF34' VUE_APP_MAKEFEE_ADDRESS='0x50A8e60041A206AcaA5F844a1104896224be6F39' VUE_APP_LOCKER_ADDRESS='0xC8607507451059CfAe6Ca4D07EC6f631ce8ef9f9' +VUE_APP_FOUNDER_ADDRESS='0x7f2b4db626d878778e178b4f0c7ba3a2870c6dd0' VUE_APP_EXPLORER_URL='https://explorer.testnet.immutable.com' VUE_APP_PRODUCTION=sandbox diff --git a/.env.development b/.env.development index e8663ff..230bb17 100644 --- a/.env.development +++ b/.env.development @@ -15,6 +15,7 @@ VUE_APP_NET_ID='13473' VUE_APP_MARKET_CURRENCY='0xFd42bfb03212dA7e1A4608a44d7658641D99CF34' VUE_APP_MAKEFEE_ADDRESS='0x50A8e60041A206AcaA5F844a1104896224be6F39' VUE_APP_LOCKER_ADDRESS='0xC8607507451059CfAe6Ca4D07EC6f631ce8ef9f9' +VUE_APP_FOUNDER_ADDRESS='0x7f2b4db626d878778e178b4f0c7ba3a2870c6dd0' VUE_APP_EXPLORER_URL='https://explorer.testnet.immutable.com' VUE_APP_PRODUCTION=sandbox diff --git a/.env.production b/.env.production index 6ef6460..6dee05c 100644 --- a/.env.production +++ b/.env.production @@ -15,6 +15,7 @@ VUE_APP_NET_ID='13371' VUE_APP_MARKET_CURRENCY='0x52A6c53869Ce09a731CD772f245b97A4401d3348' VUE_APP_MAKEFEE_ADDRESS='0x50A8e60041A206AcaA5F844a1104896224be6F39' VUE_APP_LOCKER_ADDRESS='0x2034e51e1a24f8b488610aBBDCc74F3e0cA833df' +VUE_APP_FOUNDER_ADDRESS='0x7f2b4db626d878778e178b4f0c7ba3a2870c6dd0' VUE_APP_EXPLORER_URL='https://explorer.immutable.com' VUE_APP_PRODUCTION=production diff --git a/.env.test b/.env.test index 9b0b122..f145dcd 100644 --- a/.env.test +++ b/.env.test @@ -15,5 +15,6 @@ VUE_APP_NET_ID='13371' VUE_APP_MARKET_CURRENCY='0x52A6c53869Ce09a731CD772f245b97A4401d3348' VUE_APP_MAKEFEE_ADDRESS='0x50A8e60041A206AcaA5F844a1104896224be6F39' VUE_APP_LOCKER_ADDRESS='0x2034e51e1a24f8b488610aBBDCc74F3e0cA833df' +VUE_APP_FOUNDER_ADDRESS='0x7f2b4db626d878778e178b4f0c7ba3a2870c6dd0' VUE_APP_EXPLORER_URL='https://explorer.immutable.com' VUE_APP_PRODUCTION=production \ No newline at end of file diff --git a/src/assets/img/marketplace/hero/Golden_GIF.gif b/src/assets/img/marketplace/hero/Golden_GIF.gif new file mode 100644 index 0000000..b00ca60 Binary files /dev/null and b/src/assets/img/marketplace/hero/Golden_GIF.gif differ diff --git a/src/assets/img/marketplace/hero/Normal_GIF.gif b/src/assets/img/marketplace/hero/Normal_GIF.gif new file mode 100644 index 0000000..5c79f09 Binary files /dev/null and b/src/assets/img/marketplace/hero/Normal_GIF.gif differ diff --git a/src/assets/img/marketplace/hero/Purple_GIF.gif b/src/assets/img/marketplace/hero/Purple_GIF.gif new file mode 100644 index 0000000..fd9de83 Binary files /dev/null and b/src/assets/img/marketplace/hero/Purple_GIF.gif differ diff --git a/src/components/assets/assetsHeader.vue b/src/components/assets/assetsHeader.vue index 4ed568d..ddcda82 100644 --- a/src/components/assets/assetsHeader.vue +++ b/src/components/assets/assetsHeader.vue @@ -8,8 +8,8 @@
{{ localWalletStore.showAddress ? localWalletStore.showAddress : 'User Address' }}
-

Total Contribution Credits:  {{ contributionPointTotal }}

+

Daily Expected:   +{{ contributionPoint }}/d

@@ -72,6 +72,7 @@
  • Hill's Treasure Hunt Wheel of Fortune + P2E Season 1
  • {{ item.earnTime }} @@ -448,7 +449,7 @@ onMounted(() => { img { width: 27px; height: 23px; - margin-right: 10px; + margin-left: 10px; } } .day { diff --git a/src/components/assets/myCard.vue b/src/components/assets/myCard.vue index 227b56a..9125acc 100644 --- a/src/components/assets/myCard.vue +++ b/src/components/assets/myCard.vue @@ -25,21 +25,18 @@
  • -
    - +{{contribution(nftData.detail.quality)}}/d +
    + +{{contribution(nftData.quality, nftData.type)}}/d + +{{contribution(nftData.detail.quality, nftData.type)}}/d
    -
    @@ -47,8 +44,8 @@
    Cancel listing
    -
    Unstake
    -
    Stake
    +
    Unstake
    +
    Stake
    @@ -84,6 +81,7 @@ const props = defineProps({ }, }); const LOCKER_ADDRESS = ref(import.meta.env.VUE_APP_LOCKER_ADDRESS) +const FOUNDER_ADDRESS = ref(import.meta.env.VUE_APP_FOUNDER_ADDRESS) // 获取地板价 const floorPrice = ref('0') @@ -225,35 +223,64 @@ const cardPrice = async (val) => { // 赎回 const unStake = async (data) => { - console.log(marketplaceStore.userGold) if(marketplaceStore.userGold < 0) { const confirmResult = await createModal(ConfirmDialog, { title: '', message: 'Unstake Failed - Negative in-game gold balance. Please adjust your balance to continue.' }).show() } else { - try { - const bc = new BlockChain() - let res = await bc.locker.unlockOrMintGameNft(toRaw(data).contract_address,[toRaw(data).token_id]) - if(res) { - let timer = setTimeout(() => { - message.success('Unstake success.') - emit('renewMyNft') - clearTimeout(timer); - }, 2000); - } - } catch (e) { - console.log(e) - if(e.message.indexOf('rejected') > -1) { - message.error('User rejected the request') - } else if (e.message.indexOf('select wallet') > -1) { - message.error('user cancel select wallet') - } else { - message.error('Unstake fail') - } + if(toRaw(data).type == 13) { + founderLock(toRaw(data)) + } else if(toRaw(data).type == 1 || toRaw(data).type == 12) { + heroLock(data) } } } +const heroLock = async (data) => { + try { + const bc = new BlockChain() + let res = await bc.locker.unlockOrMintGameNft(toRaw(data).contract_address,[toRaw(data).token_id]) + if(res) { + let timer = setTimeout(() => { + message.success('Unstake success.') + emit('renewMyNft') + clearTimeout(timer); + }, 2000); + } + } catch (e) { + if(e.message.indexOf('rejected') > -1) { + message.error('User rejected the request') + } else if (e.message.indexOf('select wallet') > -1) { + message.error('user cancel select wallet') + } else { + message.error('Unstake fail') + } + } +} +const founderLock = async (data) => { + console.log(data) + try { + const bc = new BlockChain() + let res = await bc.locker.unlockMain(toRaw(data).contract_address,[toRaw(data).token_id]) + if(res) { + let timer = setTimeout(() => { + message.success('Unstake success.') + emit('renewMyNft') + clearTimeout(timer); + }, 2000); + } + } catch (e) { + console.log(e) + if(e.message.indexOf('rejected') > -1) { + message.error('User rejected the request') + } else if (e.message.indexOf('select wallet') > -1) { + message.error('user cancel select wallet') + } else { + message.error('Unstake fail') + } + } +} + // 去详情页面 const toDetail = () => { diff --git a/src/components/common/imgCard.vue b/src/components/common/imgCard.vue index ae5c0fb..b6d6a55 100644 --- a/src/components/common/imgCard.vue +++ b/src/components/common/imgCard.vue @@ -1,7 +1,9 @@ diff --git a/src/configs/priceCalculate.js b/src/configs/priceCalculate.js index 1850146..e931c3c 100644 --- a/src/configs/priceCalculate.js +++ b/src/configs/priceCalculate.js @@ -54,18 +54,28 @@ export const showTime = (time) => { } // 处理贡献值 -export const contribution = (quality) => { +export const contribution = (quality, type) => { let str - if(quality == 1) { - str = 10 - } else if(quality == 2) { - str = 20 - } else if(quality == 3) { - str = 30 - } else if(quality == 4) { - str = 40 - } else if(quality == 5) { - str = 160 + if(type == 13) { + if(quality == 1) { + str = 20 + } else if(quality == 2) { + str = 40 + } else if(quality == 3) { + str = 100 + } + } else { + if(quality == 1) { + str = 10 + } else if(quality == 2) { + str = 20 + } else if(quality == 3) { + str = 40 + } else if(quality == 4) { + str = 80 + } else if(quality == 5) { + str = 160 + } } return str } diff --git a/src/views/DetailView.vue b/src/views/DetailView.vue index 91c57de..99ee871 100644 --- a/src/views/DetailView.vue +++ b/src/views/DetailView.vue @@ -32,22 +32,23 @@ -
    +
    Time remaining :   - {{ timeStaking(detailData.nft.last_lock_time)[0] }}:d - {{ timeStaking(detailData.nft.last_lock_time)[1] }}:h - {{ timeStaking(detailData.nft.last_lock_time)[2] }}:m + {{ timeStaking(detailData.nft.last_lock_time)[0] }}d: + {{ timeStaking(detailData.nft.last_lock_time)[1] }}h: + {{ timeStaking(detailData.nft.last_lock_time)[2] }}m
    - +{{ contribution(detailData.nft.detail.quality) }}/d + +{{contribution(detailData.nft.detail.quality, detailData.nft.type)}}/d + +{{contribution(detailData.nft.quality, detailData.nft.type)}}/d
    -
    +
    Unstake
    @@ -225,7 +226,7 @@ const usd = ref('') const price = ref('') const loadingDialogVisible = ref(false) const LOCKER_ADDRESS = ref(import.meta.env.VUE_APP_LOCKER_ADDRESS) - +const FOUNDER_ADDRESS = ref(import.meta.env.VUE_APP_FOUNDER_ADDRESS) // 登录 const cardLogin = async () => { @@ -373,24 +374,53 @@ const backStaking = async () => { message: 'Unstake Failed - Negative in-game gold balance. Please adjust your balance to continue.' }).show() } else { - try { - const bc = new BlockChain() - let res = await bc.locker.unlockOrMintGameNft(detailData.value.nft.contract_address,[detailData.value.nft.token_id]) - if(res) { - let timer = setTimeout(() => { - message.success('Unstake success.') - router.go(-1) - clearTimeout(timer); - }, 2000); - } - } catch (e) { - if(e.message.indexOf('rejected') > -1) { - message.error('User rejected the request') - } else if (e.message.indexOf('select wallet') > -1) { - message.error('user cancel select wallet') - } else { - message.error('Unstake fail') - } + if(detailData.value.nft.type == 13) { + founderLock() + } else if(detailData.value.nft.type == 1 || detailData.value.nft.type == 12) { + heroLock() + } + } +} + +const heroLock = async () => { + try { + const bc = new BlockChain() + let res = await bc.locker.unlockOrMintGameNft(detailData.value.nft.contract_address,[detailData.value.nft.token_id]) + if(res) { + let timer = setTimeout(() => { + message.success('Unstake success.') + router.go(-1) + clearTimeout(timer); + }, 2000); + } + } catch (e) { + if(e.message.indexOf('rejected') > -1) { + message.error('User rejected the request') + } else if (e.message.indexOf('select wallet') > -1) { + message.error('user cancel select wallet') + } else { + message.error('Unstake fail') + } + } +} +const founderLock = async () => { + try { + const bc = new BlockChain() + let res = await bc.locker.unlockMain(detailData.value.nft.contract_address,[detailData.value.nft.token_id]) + if(res) { + let timer = setTimeout(() => { + message.success('Unstake success.') + router.go(-1) + clearTimeout(timer); + }, 2000); + } + } catch (e) { + if(e.message.indexOf('rejected') > -1) { + message.error('User rejected the request') + } else if (e.message.indexOf('select wallet') > -1) { + message.error('user cancel select wallet') + } else { + message.error('Unstake fail') } } } @@ -686,6 +716,7 @@ onMounted(() => { line-height: 40px; color: #9A50FF; } + &:nth-child(2) { margin-left: 20px; span { @@ -694,6 +725,9 @@ onMounted(() => { font-size: 20px; color: #F3F0FF; } + .expected { + color: #00DEFF; + } img { width: 25px; margin-left: 10px;