活动结束弹窗提示

This commit is contained in:
yuyongdong 2024-05-27 16:39:19 +08:00
parent 91e59bff21
commit 7268190873
13 changed files with 418 additions and 328 deletions

View File

@ -13,7 +13,8 @@ export default {
props: { props: {
title: String, title: String,
time: String, time: String,
itemData: Object itemData: Object,
activityData: Object,
}, },
data() { data() {
return { return {
@ -24,6 +25,8 @@ export default {
}, },
methods: { methods: {
async beginAction() { async beginAction() {
console.log(this.activityData,'----')
return
try { try {
let { errcode, errmsg, data } = await apiCheckActivity( let { errcode, errmsg, data } = await apiCheckActivity(
this.itemData.id this.itemData.id

View File

@ -13,7 +13,7 @@
</div> </div>
</div> </div>
<div class="confirm-box"> <div class="confirm-box">
<div class="confirm-context">{{message}}</div> <div class="confirm-context" v-html="message">{{}}</div>
</div> </div>
<div class="btn" @click="handleClose">Confirm</div> <div class="btn" @click="handleClose">Confirm</div>
<!-- <div slot="footer" class="dialog-footer"> <!-- <div slot="footer" class="dialog-footer">

View File

@ -90,6 +90,9 @@ let errmsg = err
errmsg = `Your verification code has expired. Please request a new code.` errmsg = `Your verification code has expired. Please request a new code.`
} else if(errmsg.indexOf('code error') > -1) { } else if(errmsg.indexOf('code error') > -1) {
errmsg = `Verification code is incorrect. Please verify and try again.` errmsg = `Verification code is incorrect. Please verify and try again.`
} else if(errmsg.indexOf('activity is end') > -1) {
errmsg = `This event has now concluded. Thank you for participating!</br>
Thank you for joining us! This event has officially ended.`
} else if(errmsg.indexOf('You have already boosted the chest') > -1 } else if(errmsg.indexOf('You have already boosted the chest') > -1
|| errmsg.indexOf('The chests boost count has reached the upper limit') > -1 || errmsg.indexOf('The chests boost count has reached the upper limit') > -1
|| errmsg.indexOf('Todays boost count has been exhausted') > -1) { || errmsg.indexOf('Todays boost count has been exhausted') > -1) {

View File

@ -340,3 +340,13 @@ export const apiVerifyClient = async (code) => {
const url = `${API_BASE}/api/user/verify_client`; const url = `${API_BASE}/api/user/verify_client`;
return httpPost(url, {code}) return httpPost(url, {code})
} }
// 活动时间结束
export const endActivity = async (time) => {
var now = new Date().getTime();
if(time <= now) {
return false
} else {
return true
}
}

View File

@ -283,7 +283,7 @@
import { getToken } from "./../../utils/cookies.js"; import { getToken } from "./../../utils/cookies.js";
import Pagination from "./../../components/pagination.vue"; import Pagination from "./../../components/pagination.vue";
import { sendOpenChest, sendToChain } from "./../../utils/chainapi.js"; import { sendOpenChest, sendToChain } from "./../../utils/chainapi.js";
import { apiBoxOpen } from "@/utils/webapi.js"; import { apiBoxOpen, endActivity } from "@/utils/webapi.js";
import PaginationDialog from "@/components/paginationDialog.vue"; import PaginationDialog from "@/components/paginationDialog.vue";
import Loading from "@/components/loading.vue"; import Loading from "@/components/loading.vue";
import UserImg from "@/components/userImg.vue"; import UserImg from "@/components/userImg.vue";
@ -296,6 +296,9 @@ export default {
Loading, Loading,
UserImg UserImg
}, },
props: {
activityData: Object,
},
data() { data() {
return { return {
token: null, token: null,
@ -434,6 +437,9 @@ export default {
// //
async openBoxToChain(id) { async openBoxToChain(id) {
if(endActivity(this.activityData.endTime)) {
this.$showErr('activity is end')
} else {
let address = this.$store.state.user.address; let address = this.$store.state.user.address;
if (!this.$store.state.wallet.connected || !address) { if (!this.$store.state.wallet.connected || !address) {
throw new Error("wallet not connected"); throw new Error("wallet not connected");
@ -478,6 +484,7 @@ export default {
// this.$message.error(`claim task reward error: ${err}`) // this.$message.error(`claim task reward error: ${err}`)
} }
}, 3000); }, 3000);
}
}, },
// //
@ -532,6 +539,9 @@ export default {
// //
copyLink(data) { copyLink(data) {
if(endActivity(this.activityData.endTime)) {
this.$showErr('activity is end')
} else {
this.userData = JSON.parse(localStorage.getItem("userData")); this.userData = JSON.parse(localStorage.getItem("userData"));
let url = `${location.protocol}//${location.host}/home/box=${data.shareCode}`; let url = `${location.protocol}//${location.host}/home/box=${data.shareCode}`;
let oInput = document.createElement("input"); let oInput = document.createElement("input");
@ -546,6 +556,7 @@ export default {
this.$gtag.event("invite_new", { this.$gtag.event("invite_new", {
address_type: address_type address_type: address_type
}); });
}
}, },
antiShake: throttle(function(data) { antiShake: throttle(function(data) {
@ -562,7 +573,7 @@ export default {
// //
toExplore() { toExplore() {
this.$emit("toExplore", 1); this.$emit("toExplore", 2);
} }
} }
}; };

View File

@ -22,7 +22,7 @@
<script> <script>
import { getToken } from '@/utils/cookies.js' import { getToken } from '@/utils/cookies.js'
import { apiCheckin, apiCheckinClaimLeak } from '@/utils/webapi.js' import { apiCheckin, apiCheckinClaimLeak, endActivity } from '@/utils/webapi.js'
import { formatDate, getDayBegin } from '@/utils/utcdate.util.js' import { formatDate, getDayBegin } from '@/utils/utcdate.util.js'
const ONE_DAY = 24 * 60 * 60 * 1000; const ONE_DAY = 24 * 60 * 60 * 1000;
@ -97,10 +97,14 @@ export default {
// //
async getCheckinClaimLeak(days) { async getCheckinClaimLeak(days) {
if(endActivity(this.activityData.endTime)) {
this.$showErr('activity is end');
} else {
let res = await apiCheckinClaimLeak(days) let res = await apiCheckinClaimLeak(days)
// let { errcode,errmsg} = res // let { errcode,errmsg} = res
this.getCheckInit() this.getCheckInit()
this.$emit('getCheckinLeak') this.$emit('getCheckinLeak')
}
}, },
// //

View File

@ -16,13 +16,14 @@
</template> </template>
<script> <script>
import { apiGameClaim } from '@/utils/webapi.js' import { apiGameClaim, endActivity } from '@/utils/webapi.js'
export default { export default {
props: { props: {
title: String, title: String,
time: String, time: String,
itemData: Object, itemData: Object,
clickAmount: Number clickAmount: Number,
activityData: Object,
}, },
data() { data() {
return { return {
@ -51,6 +52,9 @@ bonusCount: 2, // 已助力次数
methods: { methods: {
async checkBtn(){ async checkBtn(){
if(endActivity(this.activityData.endTime)) {
this.$showErr('activity is end')
} else {
this.isShow = false this.isShow = false
let usesEmailId = this.$store.state.user.userData?.gameId || undefined let usesEmailId = this.$store.state.user.userData?.gameId || undefined
if(usesEmailId) { if(usesEmailId) {
@ -75,6 +79,7 @@ bonusCount: 2, // 已助力次数
this.isShow = true this.isShow = true
this.$showErr('need connect game account first') this.$showErr('need connect game account first')
} }
}
}, },
beginCountdown() { beginCountdown() {
this.timeLeft = parseInt(this.time); this.timeLeft = parseInt(this.time);

View File

@ -60,8 +60,8 @@
<span>Verify</span> <span>Verify</span>
</div> </div>
<div v-else> <div v-else>
<GameCheckBtn v-if="item.status == 0 || item.status == 1" title="Verify" time="5" :itemData="item" @checkNft="chickGameClaim" /> <GameCheckBtn v-if="item.status == 0 || item.status == 1" title="Verify" time="5" :activityData="activityData" :itemData="item" @checkNft="chickGameClaim" />
<GameCheckBtn class="" v-else-if="item.status == 2" title="Claim" time="5" :itemData="item" @checkNft="chickGameClaim" /> <GameCheckBtn class="" v-else-if="item.status == 2" title="Claim" time="5" :activityData="activityData" :itemData="item" @checkNft="chickGameClaim" />
<div v-if="item.status == 3" class="check-yes"> <div v-if="item.status == 3" class="check-yes">
+{{ item.score }} +{{ item.score }}
<img src="./../../assets/common/Checkmark (1).png" alt /> <img src="./../../assets/common/Checkmark (1).png" alt />
@ -131,8 +131,8 @@
<span>Verify</span> <span>Verify</span>
</div> </div>
<div v-else> <div v-else>
<GameCheckBtn v-if="item.status == 0 || item.status == 1" title="Verify" time="5" :itemData="item" @checkNft="chickGameClaim" /> <GameCheckBtn v-if="item.status == 0 || item.status == 1" title="Verify" time="5" :activityData="activityData" :itemData="item" @checkNft="chickGameClaim" />
<GameCheckBtn class="" v-else-if="item.status == 2" title="Claim" time="5" :itemData="item" @checkNft="chickGameClaim" /> <GameCheckBtn class="" v-else-if="item.status == 2" title="Claim" time="5" :activityData="activityData" :itemData="item" @checkNft="chickGameClaim" />
<!-- <div class="check-claim" v-if="item.status == 2">Claim</div> --> <!-- <div class="check-claim" v-if="item.status == 2">Claim</div> -->
<div v-if="item.status == 3" class="check-yes"> <div v-if="item.status == 3" class="check-yes">
+{{ item.score }} +{{ item.score }}
@ -153,7 +153,7 @@
<script> <script>
import GameCheckBtn from './gameCheckBtn.vue' import GameCheckBtn from './gameCheckBtn.vue'
import { getToken } from "@/utils/cookies.js"; import { getToken } from "@/utils/cookies.js";
import { apiGameTasks, apiGameClaim } from "@/utils/webapi.js" import { apiGameTasks, apiGameClaim, endActivity } from "@/utils/webapi.js"
export default { export default {
props: { props: {
@ -189,6 +189,7 @@ export default {
}, },
}, },
mounted() { mounted() {
console.log(this.activityData)
this.token = getToken(); this.token = getToken();
this.getGameList() this.getGameList()
}, },
@ -215,7 +216,11 @@ export default {
this.$emit('awardDialog', data) this.$emit('awardDialog', data)
}, },
toBindGoogle() { toBindGoogle() {
if(endActivity(this.activityData.endTime)) {
this.$showErr('activity is end')
} else {
this.$showErr('need connect game account first') this.$showErr('need connect game account first')
}
}, },
// //

View File

@ -118,7 +118,8 @@ import { sendToChain } from './../../utils/chainapi.js'
import { import {
checkReCaptcha, checkReCaptcha,
apiUploadInviteCode, apiUploadInviteCode,
apiEnhanceBox apiEnhanceBox,
endActivity
} from "./../../utils/webapi.js"; } from "./../../utils/webapi.js";
export default { export default {
@ -133,6 +134,7 @@ export default {
level3: Array, level3: Array,
level4: Array, level4: Array,
dialogTitle: String, dialogTitle: String,
activityData: Object,
}, },
data() { data() {
return { return {
@ -208,6 +210,9 @@ export default {
// //
async helpBtn() { async helpBtn() {
// debugger // debugger
if(endActivity(this.activityData.endTime)) {
this.$showErr('activity is end')
} else {
if(this.boxState.isopened){ if(this.boxState.isopened){
//todo: //todo:
this.$showErr('chest already opened') this.$showErr('chest already opened')
@ -231,9 +236,7 @@ export default {
} else { } else {
this.$showErr('You have already boosted the chest.') this.$showErr('You have already boosted the chest.')
} }
}
}, },
// //

View File

@ -357,6 +357,7 @@
v-if="item.status == 1" v-if="item.status == 1"
@stateupdate="toCheck" @stateupdate="toCheck"
@reconnection="toReconnection" @reconnection="toReconnection"
:activityData="activityData"
:itemData="item" :itemData="item"
time="5" time="5"
title="Verify" title="Verify"
@ -620,6 +621,8 @@
@awardDialog="exploreAwardDialog" @awardDialog="exploreAwardDialog"
@toNavIndex="nftToNav" @toNavIndex="nftToNav"
@onWalletLogin="onWalletLogin" @onWalletLogin="onWalletLogin"
v-show="activityData"
:activityData="activityData"
/> />
</div> </div>
</div> </div>
@ -761,7 +764,7 @@
</div> </div>
</div> </div>
<div class="box-btm"> <div class="box-btm">
<BoxBtm ref="boxList" @toExplore="toExplore" @awardDialog="boxAwardDialog" /> <BoxBtm ref="boxList" @toExplore="toExplore" :activityData="activityData" @awardDialog="boxAwardDialog" />
</div> </div>
</div> </div>
</div> </div>
@ -921,6 +924,7 @@
<HelpDialog <HelpDialog
class="help-dialog" class="help-dialog"
:helpDialogVisible="helpDialogVisible" :helpDialogVisible="helpDialogVisible"
:activityData="activityData"
@onWalletLogin="onWalletLogin" @onWalletLogin="onWalletLogin"
@handleClose="helpHandleClose" @handleClose="helpHandleClose"
@awardDialog="helpAwardDialog" @awardDialog="helpAwardDialog"
@ -1005,7 +1009,8 @@ import {
apiMyNftList, apiMyNftList,
apiClaimNft, apiClaimNft,
apiVerifyGoogle, apiVerifyGoogle,
apiDrawHistory apiDrawHistory,
endActivity
} from "./../../utils/webapi.js"; } from "./../../utils/webapi.js";
import { sendToChain, sendHelp } from "./../../utils/chainapi.js"; import { sendToChain, sendHelp } from "./../../utils/chainapi.js";
import { Wallet } from "@/wallet/index.js"; import { Wallet } from "@/wallet/index.js";
@ -1344,6 +1349,9 @@ export default {
// //
async toPost(data, onlyaction) { async toPost(data, onlyaction) {
if(this.token) { if(this.token) {
if(endActivity(this.activityData.endTime)) {
this.$showErr('activity is end')
} else {
// debugger // debugger
let begintask = data.status == 0 && !onlyaction; let begintask = data.status == 0 && !onlyaction;
if (begintask) { if (begintask) {
@ -1430,6 +1438,7 @@ export default {
this.$showErr(`Unknown error[${res.errcode}]`); this.$showErr(`Unknown error[${res.errcode}]`);
} }
} }
}
} else { } else {
this.walletDialogVisible = true this.walletDialogVisible = true
} }
@ -1707,6 +1716,9 @@ export default {
// //
async walletCheck() { async walletCheck() {
if(endActivity(this.activityData.endTime)) {
this.$showErr('activity is end');
} else {
let address = this.$store.state.user.address; let address = this.$store.state.user.address;
if (!this.$store.state.wallet.connected || !address) { if (!this.$store.state.wallet.connected || !address) {
this.walletDialogVisible = true; this.walletDialogVisible = true;
@ -1751,6 +1763,7 @@ export default {
// this.$message.error(`claim task reward error: ${err}`) // this.$message.error(`claim task reward error: ${err}`)
} }
}, 3000); }, 3000);
}
}, },
// //
getCheckinLeak() { getCheckinLeak() {
@ -1759,18 +1772,26 @@ export default {
// //
async claimSeqStat(day) { async claimSeqStat(day) {
if(endActivity(this.activityData.endTime)) {
this.$showErr('activity is end');
} else {
let res = await apiCheckinClaimSeq(day); let res = await apiCheckinClaimSeq(day);
console.info(res); console.info(res);
this.getGameStat(); this.getGameStat();
}
}, },
// //
async getCheckClaim(days) { async getCheckClaim(days) {
if(endActivity(this.activityData.endTime)) {
this.$showErr('activity is end');
} else {
let res = await apiCheckinClaim(days); let res = await apiCheckinClaim(days);
console.info(res); console.info(res);
this.getGameStat(); this.getGameStat();
// this.$message.success('Received successfully') // this.$message.success('Received successfully')
// } // }
}
}, },
// //
@ -1833,6 +1854,9 @@ export default {
// //
copyLinkCode() { copyLinkCode() {
if (this.token) { if (this.token) {
if(endActivity(this.activityData.endTime)) {
this.$showErr('activity is end')
} else {
let text = this.userData.code; let text = this.userData.code;
let url = `${location.protocol}//${location.host}/home/new=${text}`; let url = `${location.protocol}//${location.host}/home/new=${text}`;
let oInput = document.createElement("input"); let oInput = document.createElement("input");
@ -1847,6 +1871,7 @@ export default {
this.$gtag.event("invite_new", { this.$gtag.event("invite_new", {
address_type: address_type address_type: address_type
}); });
}
} else { } else {
this.walletDialogVisible = true; this.walletDialogVisible = true;
} }

View File

@ -7,13 +7,14 @@
</template> </template>
<script> <script>
import { apiClaimNft } from '@/utils/webapi.js' import { apiClaimNft, endActivity } from '@/utils/webapi.js'
export default { export default {
props: { props: {
title: String, title: String,
time: String, time: String,
itemData: Object, itemData: Object,
clickAmount: Number clickAmount: Number,
activityData: Object,
}, },
data() { data() {
return { return {
@ -41,6 +42,9 @@ bonusCount: 2, // 已助力次数
methods: { methods: {
async checkBtn(){ async checkBtn(){
if(endActivity(this.activityData.endTime)) {
this.$showErr('activity is end')
} else {
let discordId = this.$store.state.user.userData?.discordId || undefined let discordId = this.$store.state.user.userData?.discordId || undefined
if(discordId) { if(discordId) {
try { try {
@ -86,6 +90,7 @@ bonusCount: 2, // 已助力次数
this.$emit('toNavIndex') this.$emit('toNavIndex')
this.$showErr('need connect discord first') this.$showErr('need connect discord first')
} }
}
}, },
beginCountdown() { beginCountdown() {
this.timeLeft = parseInt(this.time); this.timeLeft = parseInt(this.time);

View File

@ -60,7 +60,7 @@
<span>Verify</span> <span>Verify</span>
</div> </div>
<div v-else> <div v-else>
<NftCheckBtn v-if="item.status == 0" title="Verify" time="5" :itemData="item" :clickAmount="clickAmount" @checkNft="chickNftClaim" @toNavIndex="toNavIndex">Verify</NftCheckBtn> <NftCheckBtn v-if="item.status == 0" title="Verify" time="5" :itemData="item" :clickAmount="clickAmount" @checkNft="chickNftClaim" :activityData="activityData" @toNavIndex="toNavIndex">Verify</NftCheckBtn>
<div v-if="item.status == 1" class="check-yes"> <div v-if="item.status == 1" class="check-yes">
<img src="@/assets/home/check-yes.png" alt /> <img src="@/assets/home/check-yes.png" alt />
</div> </div>
@ -81,7 +81,7 @@
<script> <script>
import { getToken } from "@/utils/cookies.js"; import { getToken } from "@/utils/cookies.js";
import { apiNftList, apiVoucherClaim, apiClaimNft } from '@/utils/webapi.js' import { apiNftList, apiVoucherClaim, apiClaimNft, endActivity } from '@/utils/webapi.js'
import NftCheckBtn from './nftCheckBtn.vue' import NftCheckBtn from './nftCheckBtn.vue'
const BASE52_ALPHABET = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' const BASE52_ALPHABET = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
const isValidVoucherCode = (str) => { const isValidVoucherCode = (str) => {
@ -92,6 +92,9 @@ export default {
components: { components: {
NftCheckBtn, NftCheckBtn,
}, },
props: {
activityData: Object,
},
data() { data() {
return { return {
checkCodeInput: '', checkCodeInput: '',
@ -167,6 +170,9 @@ export default {
// nft // nft
async submitCode() { async submitCode() {
if (this.token) { if (this.token) {
if(endActivity(this.activityData.endTime)) {
this.$showErr('activity is end')
} else {
if (this.checkCodeInput) { if (this.checkCodeInput) {
if(!isValidVoucherCode(this.checkCodeInput)) { if(!isValidVoucherCode(this.checkCodeInput)) {
this.$showErr('Invalid Voucher Code') this.$showErr('Invalid Voucher Code')
@ -182,6 +188,7 @@ export default {
} else { } else {
this.$showErr(`Can not be empty`) this.$showErr(`Can not be empty`)
} }
}
} else { } else {
this.onWalletLogin() this.onWalletLogin()
} }
@ -196,6 +203,9 @@ export default {
this.$emit('toNavIndex') this.$emit('toNavIndex')
}, },
chickNftClaimAmount() { chickNftClaimAmount() {
if(endActivity(this.activityData.endTime)) {
return
} else {
this.clickAmount++ this.clickAmount++
if(this.clickAmount >= 4) { if(this.clickAmount >= 4) {
this.$refs.demo.style.display = 'block' this.$refs.demo.style.display = 'block'
@ -204,6 +214,7 @@ export default {
} else { } else {
this.$refs.demo.style.display = 'none' this.$refs.demo.style.display = 'none'
} }
}
}, },
handleLoadGoogleCaptcha() { handleLoadGoogleCaptcha() {
if(this.recaptchaId) { if(this.recaptchaId) {

View File

@ -200,7 +200,12 @@ export default {
// //
handleClick(ticket){ handleClick(ticket){
var now = new Date().getTime();
if(this.activityData.endTime <= now) {
this.$showErr('activity is end')
} else {
this.toTurntable(ticket) this.toTurntable(ticket)
}
}, },
// //
onWalletLogin() { onWalletLogin() {