活动结束弹窗提示

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

View File

@ -13,7 +13,7 @@
</div>
</div>
<div class="confirm-box">
<div class="confirm-context">{{message}}</div>
<div class="confirm-context" v-html="message">{{}}</div>
</div>
<div class="btn" @click="handleClose">Confirm</div>
<!-- <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.`
} else if(errmsg.indexOf('code error') > -1) {
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
|| errmsg.indexOf('The chests boost count has reached the upper limit') > -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`;
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 Pagination from "./../../components/pagination.vue";
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 Loading from "@/components/loading.vue";
import UserImg from "@/components/userImg.vue";
@ -296,6 +296,9 @@ export default {
Loading,
UserImg
},
props: {
activityData: Object,
},
data() {
return {
token: null,
@ -434,6 +437,9 @@ export default {
//
async openBoxToChain(id) {
if(endActivity(this.activityData.endTime)) {
this.$showErr('activity is end')
} else {
let address = this.$store.state.user.address;
if (!this.$store.state.wallet.connected || !address) {
throw new Error("wallet not connected");
@ -478,6 +484,7 @@ export default {
// this.$message.error(`claim task reward error: ${err}`)
}
}, 3000);
}
},
//
@ -532,6 +539,9 @@ export default {
//
copyLink(data) {
if(endActivity(this.activityData.endTime)) {
this.$showErr('activity is end')
} else {
this.userData = JSON.parse(localStorage.getItem("userData"));
let url = `${location.protocol}//${location.host}/home/box=${data.shareCode}`;
let oInput = document.createElement("input");
@ -546,6 +556,7 @@ export default {
this.$gtag.event("invite_new", {
address_type: address_type
});
}
},
antiShake: throttle(function(data) {
@ -562,7 +573,7 @@ export default {
//
toExplore() {
this.$emit("toExplore", 1);
this.$emit("toExplore", 2);
}
}
};

View File

@ -22,7 +22,7 @@
<script>
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'
const ONE_DAY = 24 * 60 * 60 * 1000;
@ -97,10 +97,14 @@ export default {
//
async getCheckinClaimLeak(days) {
if(endActivity(this.activityData.endTime)) {
this.$showErr('activity is end');
} else {
let res = await apiCheckinClaimLeak(days)
// let { errcode,errmsg} = res
this.getCheckInit()
this.$emit('getCheckinLeak')
}
},
//

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -60,7 +60,7 @@
<span>Verify</span>
</div>
<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">
<img src="@/assets/home/check-yes.png" alt />
</div>
@ -81,7 +81,7 @@
<script>
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'
const BASE52_ALPHABET = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
const isValidVoucherCode = (str) => {
@ -92,6 +92,9 @@ export default {
components: {
NftCheckBtn,
},
props: {
activityData: Object,
},
data() {
return {
checkCodeInput: '',
@ -167,6 +170,9 @@ export default {
// nft
async submitCode() {
if (this.token) {
if(endActivity(this.activityData.endTime)) {
this.$showErr('activity is end')
} else {
if (this.checkCodeInput) {
if(!isValidVoucherCode(this.checkCodeInput)) {
this.$showErr('Invalid Voucher Code')
@ -182,6 +188,7 @@ export default {
} else {
this.$showErr(`Can not be empty`)
}
}
} else {
this.onWalletLogin()
}
@ -196,6 +203,9 @@ export default {
this.$emit('toNavIndex')
},
chickNftClaimAmount() {
if(endActivity(this.activityData.endTime)) {
return
} else {
this.clickAmount++
if(this.clickAmount >= 4) {
this.$refs.demo.style.display = 'block'
@ -204,6 +214,7 @@ export default {
} else {
this.$refs.demo.style.display = 'none'
}
}
},
handleLoadGoogleCaptcha() {
if(this.recaptchaId) {

View File

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