nft 合作完成、新增X、DC重复链接提示

This commit is contained in:
yuyongdong 2024-04-19 11:52:52 +08:00
parent e8f42fb4ae
commit 0524ae5df5
30 changed files with 110 additions and 72 deletions

View File

@ -1,6 +1,6 @@
# API
# VUE_APP_API_URL = 'https://oauth-svr.cebggame.com/task'
VUE_APP_API_URL = 'http://192.168.100.22:3006'
VUE_APP_API_URL = 'https://oauth-svr.cebggame.com/task'
# VUE_APP_API_URL = 'http://192.168.100.22:3006'
# VUE_APP_API_URL = 'http://127.0.0.1:3006/api'
VUE_APP_WL_URL = 'https://nftwl.counterfire.games/wl_test'
VUE_APP_CONFIG_URL = 'https://sepolia.infura.io/v3/b6bf7d3508c941499b10025c0776eaf8'

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

BIN
src/assets/username/PG.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 624 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

View File

@ -20,9 +20,16 @@ export default {
methods: {
async beginAction() {
try {
let { errcode, data } = await apiCheckActivity(this.dataid);
let { errcode, errmsg, data } = await apiCheckActivity(this.dataid);
if (errcode !== 0) {
if(errmsg == 'twitter already binded') {
this.$showErr('twitter already binded')
} else if(errmsg == 'discord already binded to another account') {
this.$showErr('discord already binded to another account')
} else {
this.beginCountdown();
this.$showErr('Please try again')
}
return;
}
if (data.status === 2) {

View File

@ -21,7 +21,7 @@ let errmsg = err
} else if(errmsg.indexOf('Hash: not available') > -1) {
errmsg = `Operation timed out. Please retry.`
} else if(errmsg.indexOf('chest already opened') > -1) {
errmsg = 'chest already opened'
errmsg = 'This chest has been opened already'
} else if(errmsg.indexOf('check error: not found guild') > -1) {
errmsg = 'Transaction failed please try again'
} else if(errmsg.indexOf('execution reverted: TreasureHunt: paused') > -1) {
@ -29,19 +29,32 @@ let errmsg = err
} else if(errmsg.indexOf('waiting for chain confirm') > -1) {
errmsg = 'waiting for chain confirm'
} else if(errmsg.indexOf('voucher not found') > -1) {
errmsg = 'Code invalid or already redeemed'
errmsg = 'Invalid Redemption Code'
} else if(errmsg.indexOf('Can not be empty') > -1) {
errmsg = 'Redemption Code is required'
} else if(errmsg.indexOf('need connect discord first') > -1) {
errmsg = `Discord account unlinked. Please ensure the 'Connect Your Discord' quest is complete.`
} else if(errmsg.indexOf("You do not hold the required role in the 'Ink' Discord server") > -1) {
errmsg = `You do not hold the required role in the 'Ink' Discord server`
} else if(errmsg.indexOf("You do not hold the required role in the 'Counter Fire' Discord server") > -1) {
errmsg = `"You do not hold the required role in the 'Counter Fire' Discord server"`
} else if(errmsg.indexOf('Invalid Voucher Code') > -1) {
errmsg = 'Invalid Redemption Code'
} else if(errmsg.indexOf('voucher already used') > -1) {
errmsg = 'Redemption Code has already been used'
} else if(errmsg.indexOf('already claimed') > -1) {
errmsg = 'This reward chest has been claimed already'
} else if(errmsg.indexOf('had no role') > -1) {
errmsg = 'You do not hold the required role in the "Counter Fire" Discord server'
} else if(errmsg.indexOf('have not join guild') > -1) {
errmsg = 'You do not hold the required role in the "Counter Fire" Discord server'
} else if(errmsg.indexOf('twitter already binded') > -1) {
errmsg = 'This X account has already been linked'
} else if(errmsg.indexOf('discord already binded to another account') > -1) {
errmsg = 'This Discord account has already been linked'
} else {
// 请重试
errmsg = 'Please try again'
}
const _confirm = new iErrorMessage({

View File

@ -42,7 +42,7 @@
<div class="icon">
<img src="./../../assets/box/Icon_history.png" alt="">
</div>
<div>History Records</div>
<div>Historical Records</div>
</div>
<div class="btn" @click="boostingDialogVisible = true">
<div class="icon">
@ -216,7 +216,7 @@
>
<div class="touxiang">
<UserImg class="userImg" :imgSrc="scope.row.avatar" />
{{ scope.row.nickname }}
<span>{{ scope.row.nickname }}</span>
</div>
</template>
</el-table-column>
@ -340,7 +340,7 @@ export default {
})
this.boxList = res.data.data
this.boxData = res.data.data[0]
if(this.boxList == undefined || this.boxList.length <= 0) {
if(this.boxList !== undefined && this.boxList.length > 0) {
await this.getHistorical(this.boxData.id)
}
},
@ -1038,7 +1038,12 @@ export default {
align-items: center;
justify-content: center;
.userImg {
margin-right: 10px;
margin-right: 20px;
}
span {
display: inline-block;
width: 136px;
text-align: left;
}
}
}

View File

@ -60,12 +60,15 @@
</div>
</div>
<div class="left-title">
<div class="left-title-left" v-if="navIndex == 0 || navIndex == 3">
<div class="left-title-left" v-if="navIndex == 0">
<div>Complete <img src="./../../assets/home/Icon_star.png" alt="">Social Quests</div>
</div>
<div class="left-title-left1" v-if="navIndex == 1">
<div>Check In&nbsp; <img src="./../../assets/home/Icon_star.png" alt=""> & Explore</div>
</div>
<div class="left-title-left1" v-if="navIndex == 3">
<div>Claim&nbsp; <img src="./../../assets/home/Icon_star.png" alt=""> Chests</div>
</div>
<div class="left-title-right">
<div class="text">
<!-- <p></p> -->
@ -86,7 +89,7 @@
@awardDialog="exploreAwardDialog"
/>
</div>
<div class="explore-desc" v-if="navIndex == 0">
<div class="explore-desc" v-if="navIndex == 0 || navIndex == 3">
<!-- <div class="explore-desc-logo" @click="openLink">
<img src="./../../assets/home/Icon_smile.png" alt="">
</div> -->
@ -95,7 +98,7 @@
class="desc"
>Complete Social Quests, Embark on Explorations, Open/Boost Chests to earn Airdrop Points, which will eventually be converted to $CEC.<br /><p @click="openLink">Read here for more details.</p></div>
</div>
<div class="explore-desc-map" v-if="navIndex == 1 || navIndex == 3">
<div class="explore-desc-map" v-if="navIndex == 1">
<li>
<h2>EXPLORE</h2>
<div class="logo">
@ -166,9 +169,9 @@
<div class="right-title" v-if="navIndex == 0">
<h3>Complete Social Quests to earn Airdrop Points and unlock exclusive perks!</h3>
</div>
<div class="right-title" v-if="navIndex == 2">
<div class="right-title1" v-if="navIndex == 3">
<p></p>
<h3>Embark on a collaborative journey with us and our partners to achieve your objectives</h3>
<h3>Claim bonus chests with your NFT from our curated collections or using a redemption code</h3>
</div>
<div class="content-right" v-if="navIndex == 0">
<div class="title">
@ -220,7 +223,7 @@
v-if="item.status == 1"
@stateupdate="toCheck"
:dataid="item.id"
time="10"
time="5"
title="Verify"
class="started"
>Verify</CheckBtn>
@ -1771,6 +1774,15 @@ export default {
font-family: 'Anton-Regular';
}
}
.right-title1 {
color: #fff;
line-height: 1.4;
margin-bottom: 20px;
h3 {
font-size: 22px;
font-family: 'Anton-Regular';
}
}
.content-right {
width: 100%;
z-index: 999;

View File

@ -21,7 +21,7 @@
<template slot-scope="scope">
<div class="touxiang">
<UserImg :imgSrc="scope.row.avatar" />
{{ scope.row.nickname }}
<span>{{ scope.row.nickname }}</span>
</div>
</template>
</el-table-column>
@ -196,6 +196,11 @@ div {
display: flex;
align-items: center;
justify-content: space-evenly;
span {
display: inline-block;
width: 134px;
text-align: left;
}
}
}
}

View File

@ -2,7 +2,8 @@
<div class="content-right">
<div class="title">
<div class="title-left">
<div>Partner</div>
<div>Collection</div>
<!-- <el-button @click="generate">激活码</el-button> -->
</div>
</div>
<div class="check-code">
@ -20,7 +21,7 @@
<div class="partner-list">
<div class="partner">
<div>Partner</div>
<div>Chain</div>
<!-- <div>Chain</div> -->
<div>Rewards</div>
</div>
<div class="nft-list">
@ -29,26 +30,28 @@
<div class="content-rewards-left">
<div class="img-logo">
<a v-if="item.link != ''" :href="item.link" target="_blank">
<img src="./../../assets/home/twitter.png" alt />
<img :src="require(`@/assets/username/${item.projectName}.jpg`)" alt />
</a>
</div>
<div class="desc">
<el-tooltip placement="top" :content="item.collection">
<h3>{{ item.collection }}</h3>
</el-tooltip>
<p>{{ item.projectName }}</p>
</div>
</div>
<div class="chain">
<!-- <div class="chain">
<a v-if="item.contract.slice(0,2) == '0x'" :href="`https://etherscan.io/address/${item.contract.replace(/_\d$/, '')}`" target="_blank">
<img src="@/assets/common/logo-etherscan.png" alt="">
</a>
</div>
</div> -->
<div class="Rewards">
<div class="box-img">
<img :src="require(`@/assets/box/box0${item.tier}.png`)" alt />
</div>
<div v-if="token != null" class="btn">
<div class="is-btn">
<div v-if="item.status == 0" class="check-no" @click.stop="chickNftClaim(item.contract)">
<div v-if="item.status == 0" class="check-no" @click.stop="chickNftClaim(item)">
<span>Verify</span>
</div>
<div v-if="item.status == 1" class="check-yes">
@ -84,6 +87,8 @@ export default {
timeLeft: 0,
}
},
computed: {
},
created() {
this.token = getToken();
this.getNftList()
@ -112,40 +117,9 @@ export default {
async generate() {
let res = await this.$axios.post(process.env.VUE_APP_API_URL + "/api/voucher/generate",
{num: 10},
{num: 20},
{ headers: { Authorization: `Bearer ${this.token}` } })
console.log(res.data.data)
},
// 0
// :
// "testT9uo9gbl"
// 1
// :
// "testOPXqIEx2"
// 2
// :
// "testf29qGaFy"
// 3
// :
// "testUG6ZQoTD"
// 4
// :
// "testeralYA9o"
// 5
// :
// "test4WjfY8lB"
// 6
// :
// "testkfhwdWVc"
// 7
// :
// "testrpQlku6M"
// 8
// :
// "testIySydB0z"
// 9
// :
// "testR2JBM2T9"
// nft
async submitCode() {
@ -159,6 +133,8 @@ export default {
this.$emit('awardDialog',data)
} else if(errcode == 11) {
this.$showErr(errmsg)
} else if(errmsg == 'voucher already used') {
this.$showErr('voucher already used')
}
} else {
this.$showErr(`Can not be empty`)
@ -169,30 +145,39 @@ export default {
},
// NFT holder
async chickNftClaim(contract) {
let discordId = JSON.parse(localStorage.getItem("userData")).discordId
async chickNftClaim(itemData) {
let discordId = this.$store.state.user.userData?.discordId || undefined
const nextAction = function(){
this.$emit('toNavIndex')
}
if(discordId) {
console.log('zheli')
try {
let { errcode, errmsg, data } = await apiClaimNft(contract);
let { errcode, errmsg, data } = await apiClaimNft(itemData.contract);
if (!errcode) {
this.nftsList = []
this.getNftList()
this.$emit('awardDialog',data)
} else if(errcode == 10 || errcode == 20) {
this.$showErr(errmsg)
} else if(errcode == 13) {
this.$showErr(`${errmsg}`)
} else if(errcode == 21 || errcode == 14) {
// this.$showErr(errmsg, nextAction)
} else if(errcode == 14) {
this.$showErr(errmsg)
} else if(errcode == 21) {
// this.$showErr(errmsg, nextAction)
if(itemData.contract == 'INK') {
this.$showErr("You do not hold the required role in the 'Ink' Discord server")
} else {
this.$showErr("You do not hold the required role in the 'Counter Fire' Discord server")
this.$emit('toNavIndex')
}
}
} catch (err) {
console.log(err)
// this.$message.error(`claim partner reward error: ${err}`);
}
} else {
this.$emit('toNavIndex')
this.$showErr('need connect discord first')
}
},
@ -296,12 +281,12 @@ export default {
// justify-content: space-between;
padding: 0 10px;
div {
width: 160px;
width: 240px;
height: 100%;
line-height: 30px;
}
div:nth-child(2) {
width: 60px;
width: 160px;
}
}
.nft-list {
@ -319,7 +304,7 @@ export default {
color: #fff;
.content-rewards-left {
display: flex;
width: 160px;
width: 240px;
.img-logo {
width: 40px;
height: 40px;
@ -331,13 +316,23 @@ export default {
}
}
.desc {
max-width: 240px;
width: 140px;
position: relative;
h3 {
width: 160px;
overflow:hidden; //
text-overflow:ellipsis;
white-space:nowrap;
text-align: left;
font-size: 14px;
font-family: "Poppins-SemiBold";
cursor: pointer;
}
p {
width: 100px;
overflow:hidden; //
text-overflow:ellipsis;
white-space:nowrap;
font-family: "Poppins-Light";
font-size: 12px;
text-align: left;
@ -362,7 +357,7 @@ export default {
}
.Rewards {
width: 160px;
padding: 0 10px;
// padding: 0 10px;
box-sizing: border-box;
display: flex;
justify-content: space-between;
@ -432,6 +427,7 @@ export default {
font-size: 12px;
padding: 5px 4px;
border-radius: 15px;
margin-left: 10px;
}
}
</style>>

View File

@ -320,13 +320,13 @@ export default {
return type = `Exploration`
} else if(type.includes('open_chest')) {
//
return type = `Open the Treasure`
return type = `Chest Opened`
} else if(type.includes('enhance_chest_gift')) {
//
return type = `Boosting`
return type = `Boost`
} else if(type.includes('invite_rebate')) {
//
return type = `Invitation Earning`
return type = `Invitation Earned`
} else if(type.includes('')) {
//
return type = `Task`