取消社媒任务Gas费、新增弹窗
This commit is contained in:
parent
89b1af7926
commit
25487b41c8
@ -1,45 +1,47 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-button class="mybtn" :loading="timeLeft > 0" @click.stop="beginAction">{{ timeLeft > 0 ? timeLeft + 's' : title }}</el-button>
|
<el-button
|
||||||
|
class="mybtn"
|
||||||
|
:loading="timeLeft > 0"
|
||||||
|
@click.stop="beginAction"
|
||||||
|
>{{ timeLeft > 0 ? timeLeft + 's' : title }}</el-button>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {
|
import { apiCheckActivity } from "@/utils/webapi.js";
|
||||||
apiCheckActivity,
|
|
||||||
} from "@/utils/webapi.js";
|
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
title: String,
|
title: String,
|
||||||
time: String,
|
time: String,
|
||||||
dataid: String
|
itemData: Object
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
timeLeft: 0,
|
timeLeft: 0
|
||||||
}
|
};
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async beginAction() {
|
async beginAction() {
|
||||||
try {
|
try {
|
||||||
let { errcode, errmsg, data } = await apiCheckActivity(this.dataid);
|
let { errcode, errmsg, data } = await apiCheckActivity(
|
||||||
|
this.itemData.id
|
||||||
|
);
|
||||||
if (errcode !== 0) {
|
if (errcode !== 0) {
|
||||||
if(errmsg == 'twitter already binded') {
|
if (errmsg == "twitter already binded") {
|
||||||
this.$showErr('twitter already binded')
|
this.$showErr("twitter already binded");
|
||||||
} else if(errmsg == 'discord already binded to another account') {
|
} else if (errmsg == "discord already binded to another account") {
|
||||||
this.$showErr('discord already binded to another account')
|
this.$showErr("discord already binded to another account");
|
||||||
} else {
|
} else {
|
||||||
this.beginCountdown();
|
this.beginCountdown();
|
||||||
this.$showErr('Please try again')
|
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (data.status === 2) {
|
if (data.status === 2) {
|
||||||
this.$emit('stateupdate', data.status);
|
this.$emit("stateupdate", data.status);
|
||||||
return;
|
return;
|
||||||
// } else if(data.status === 1) {
|
|
||||||
// this.$showErr('Please try again')
|
|
||||||
}
|
}
|
||||||
this.beginCountdown();
|
this.beginCountdown();
|
||||||
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
this.beginCountdown();
|
this.beginCountdown();
|
||||||
}
|
}
|
||||||
@ -49,42 +51,41 @@ export default {
|
|||||||
let timer = setInterval(() => {
|
let timer = setInterval(() => {
|
||||||
this.timeLeft--;
|
this.timeLeft--;
|
||||||
if (this.timeLeft <= 0) {
|
if (this.timeLeft <= 0) {
|
||||||
this.$showErr('Please try again')
|
this.$showErr("Please try again");
|
||||||
clearInterval(timer);
|
clearInterval(timer);
|
||||||
}
|
}
|
||||||
}, 1000);
|
}, 1000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.mybtn{
|
.mybtn {
|
||||||
width: 90px;
|
width: 90px;
|
||||||
height: 30px;
|
height: 30px;
|
||||||
line-height: 0!important;
|
line-height: 0 !important;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 50%;
|
top: 50%;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
transform: translate(-50% , -50%);
|
transform: translate(-50%, -50%);
|
||||||
background: #fec25d;
|
background: #fec25d;
|
||||||
background: url('@/assets/home/ButtonFollow.png') no-repeat;
|
background: url("@/assets/home/ButtonFollow.png") no-repeat;
|
||||||
background-size: 100% 100%;
|
background-size: 100% 100%;
|
||||||
color: unset;
|
color: unset;
|
||||||
border: none;
|
border: none;
|
||||||
}
|
}
|
||||||
.mybtn:disabled{
|
.mybtn:disabled {
|
||||||
color:unset;
|
color: unset;
|
||||||
border: none;
|
border: none;
|
||||||
line-height: 0!important;
|
line-height: 0 !important;
|
||||||
}
|
}
|
||||||
.mybtn.is-loading:before{
|
.mybtn.is-loading:before {
|
||||||
background-color: unset;
|
background-color: unset;
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.mybtn .el-icon-loading{
|
.mybtn .el-icon-loading {
|
||||||
line-height: 0!important;
|
line-height: 0 !important;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -52,9 +52,19 @@ let errmsg = err
|
|||||||
errmsg = 'This X account has already been linked'
|
errmsg = 'This X account has already been linked'
|
||||||
} else if(errmsg.indexOf('discord already binded to another account') > -1) {
|
} else if(errmsg.indexOf('discord already binded to another account') > -1) {
|
||||||
errmsg = 'This Discord account has already been linked'
|
errmsg = 'This Discord account has already been linked'
|
||||||
|
} else if(errmsg.indexOf("Please complete the 'Connect Your X' quest first") > -1) {
|
||||||
|
errmsg = "Please complete the 'Connect Your X' quest first"
|
||||||
|
} else if(errmsg.indexOf("Please complete the 'Connect Your Discord' quest first") > -1) {
|
||||||
|
errmsg = "Please complete the 'Connect Your Discord' quest first"
|
||||||
|
} else if(errmsg.indexOf("maintance now, please try later") > -1) {
|
||||||
|
errmsg = "maintance now, please try later"
|
||||||
|
} else if(errmsg.indexOf("Delabs Game") > -1) {
|
||||||
|
errmsg = "You do not hold the required role in the 'Delabs Game' Discord server"
|
||||||
|
} else if(errmsg.indexOf('Please try again') > -1) {
|
||||||
|
errmsg = "Verification failed due to high traffic. Please click 'Connect' to try verifying again, or attempt later"
|
||||||
} else {
|
} else {
|
||||||
// 请重试
|
// 请重试
|
||||||
errmsg = 'Please try again'
|
errmsg = 'Unknown on-chain interaction issue. Please try again'
|
||||||
}
|
}
|
||||||
|
|
||||||
const _confirm = new iErrorMessage({
|
const _confirm = new iErrorMessage({
|
||||||
|
@ -40,7 +40,7 @@ const actions = {
|
|||||||
// mutations
|
// mutations
|
||||||
const mutations = {
|
const mutations = {
|
||||||
updateAddress(state, _address) {
|
updateAddress(state, _address) {
|
||||||
console.info('update address: ', _address)
|
// console.info('update address: ', _address)
|
||||||
state.address = _address
|
state.address = _address
|
||||||
},
|
},
|
||||||
updateChain(state, _chainId) {
|
updateChain(state, _chainId) {
|
||||||
@ -55,7 +55,7 @@ const mutations = {
|
|||||||
state.logined = _status
|
state.logined = _status
|
||||||
},
|
},
|
||||||
updateUserData(state, _data) {
|
updateUserData(state, _data) {
|
||||||
console.info(_data)
|
// console.info(_data)
|
||||||
state.userData = { ...state.userData, ..._data }
|
state.userData = { ...state.userData, ..._data }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -79,7 +79,7 @@
|
|||||||
<span v-if="boxData.level == 1">COMMON</span>
|
<span v-if="boxData.level == 1">COMMON</span>
|
||||||
<span v-else-if="boxData.level == 2">RARE</span>
|
<span v-else-if="boxData.level == 2">RARE</span>
|
||||||
<span v-else-if="boxData.level == 3">MYTHICAL</span>
|
<span v-else-if="boxData.level == 3">MYTHICAL</span>
|
||||||
<span v-else-if="boxData.level == 4">LEGENDAR</span>
|
<span v-else-if="boxData.level == 4">LEGENDAY</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="box-btm-con-img">
|
<div class="box-btm-con-img">
|
||||||
|
@ -222,7 +222,7 @@
|
|||||||
<CheckBtn
|
<CheckBtn
|
||||||
v-if="item.status == 1"
|
v-if="item.status == 1"
|
||||||
@stateupdate="toCheck"
|
@stateupdate="toCheck"
|
||||||
:dataid="item.id"
|
:itemData="item"
|
||||||
time="5"
|
time="5"
|
||||||
title="Verify"
|
title="Verify"
|
||||||
class="started"
|
class="started"
|
||||||
@ -795,6 +795,12 @@ export default {
|
|||||||
usesInviteCount() {
|
usesInviteCount() {
|
||||||
return this.$store.state.user.userData?.inviteCount || 0
|
return this.$store.state.user.userData?.inviteCount || 0
|
||||||
},
|
},
|
||||||
|
usesDiscordId() {
|
||||||
|
return this.$store.state.user.userData?.discordId || undefined;
|
||||||
|
},
|
||||||
|
usesTwitterId() {
|
||||||
|
return this.$store.state.user.userData?.twitterId || undefined;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.userData = JSON.parse(localStorage.getItem("userData"));
|
this.userData = JSON.parse(localStorage.getItem("userData"));
|
||||||
@ -892,15 +898,42 @@ export default {
|
|||||||
if (data.task == "TwitterConnect") {
|
if (data.task == "TwitterConnect") {
|
||||||
await this.loginTwitter(data.id);
|
await this.loginTwitter(data.id);
|
||||||
} else if(data.task == "TwitterFollow") {
|
} else if(data.task == "TwitterFollow") {
|
||||||
followTwitter(data.cfg.account)
|
//todo: panduan twitter id
|
||||||
|
if (!this.usesTwitterId) {
|
||||||
|
this.$showErr("Please complete the 'Connect Your X' quest first");
|
||||||
|
} else {
|
||||||
|
followTwitter(data.cfg.account)
|
||||||
|
}
|
||||||
} else if(data.task == "TwitterLike") {
|
} else if(data.task == "TwitterLike") {
|
||||||
window.open(`https://twitter.com/intent/like?tweet_id=${data.cfg.content}`, '_blank');
|
//todo: panduan twitter id
|
||||||
|
if (!this.usesTwitterId) {
|
||||||
|
this.$showErr("Please complete the 'Connect Your X' quest first");
|
||||||
|
} else {
|
||||||
|
window.open(`https://twitter.com/intent/like?tweet_id=${data.cfg.content}`, '_blank');
|
||||||
|
}
|
||||||
} else if(data.task == "TwitterTweet") {
|
} else if(data.task == "TwitterTweet") {
|
||||||
followTwitter(data.cfg.content)
|
//todo: panduan twitter id
|
||||||
|
if (!this.usesTwitterId) {
|
||||||
|
this.$showErr("Please complete the 'Connect Your X' quest first");
|
||||||
|
} else {
|
||||||
|
followTwitter(data.cfg.content)
|
||||||
|
}
|
||||||
} else if(data.task == "TwitterRetweet") {
|
} else if(data.task == "TwitterRetweet") {
|
||||||
window.open(`https://twitter.com/intent/retweet?tweet_id=${data.cfg.content}`, '_blank');
|
//todo: panduan twitter id
|
||||||
|
if (!this.usesTwitterId) {
|
||||||
|
this.$showErr("Please complete the 'Connect Your X' quest first");
|
||||||
|
} else {
|
||||||
|
window.open(`https://twitter.com/intent/retweet?tweet_id=${data.cfg.content}`, '_blank');
|
||||||
|
}
|
||||||
} else if(data.task == "DiscordJoin") {
|
} else if(data.task == "DiscordJoin") {
|
||||||
joinDiscord(data.cfg.account)
|
//todo: panduan dc id
|
||||||
|
if (!this.usesDiscordId) {
|
||||||
|
this.$showErr(
|
||||||
|
"Please complete the 'Connect Your Discord' quest first"
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
joinDiscord(data.cfg.account)
|
||||||
|
}
|
||||||
} else if (data.task == "DiscordConnect") {
|
} else if (data.task == "DiscordConnect") {
|
||||||
this.loginDiscord()
|
this.loginDiscord()
|
||||||
}
|
}
|
||||||
@ -955,21 +988,21 @@ export default {
|
|||||||
},
|
},
|
||||||
// 领取任务奖励
|
// 领取任务奖励
|
||||||
async getTaskClaim(id) {
|
async getTaskClaim(id) {
|
||||||
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;
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
this.isLoading = true;
|
// this.isLoading = true;
|
||||||
let storeageKey;
|
// let storeageKey;
|
||||||
try {
|
// try {
|
||||||
storeageKey = await sendToChain("task_claim", address, id);
|
// storeageKey = await sendToChain("task_claim", address, id);
|
||||||
} catch (err) {
|
// } catch (err) {
|
||||||
this.isLoading = false;
|
// this.isLoading = false;
|
||||||
this.$showErr(err);
|
// this.$showErr(err);
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
let serTimeId = setInterval(async () => {
|
// let serTimeId = setInterval(async () => {
|
||||||
try {
|
try {
|
||||||
let { errcode, errmsg, data } = await apiTaskClaim(id);
|
let { errcode, errmsg, data } = await apiTaskClaim(id);
|
||||||
if (errcode) {
|
if (errcode) {
|
||||||
@ -978,30 +1011,29 @@ export default {
|
|||||||
this.isLoading = false
|
this.isLoading = false
|
||||||
// this.$message.error(errmsg)
|
// this.$message.error(errmsg)
|
||||||
this.getActivitrStatue(id)
|
this.getActivitrStatue(id)
|
||||||
clearInterval(serTimeId)
|
// clearInterval(serTimeId)
|
||||||
} else if (errcode !== 14) {
|
} else if (errcode !== 14) {
|
||||||
// 状态不是等待链上确认的, 都提示错误
|
// 状态不是等待链上确认的, 都提示错误
|
||||||
this.isLoading = false
|
this.isLoading = false
|
||||||
// this.$message.error(errmsg)
|
// this.$message.error(errmsg)
|
||||||
clearInterval(serTimeId)
|
// clearInterval(serTimeId)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (data?.status == 3) {
|
if (data?.status == 3) {
|
||||||
console.log(data ,'这里')
|
|
||||||
// alert(`领取成功, 获得积分: ${data.score}`)
|
// alert(`领取成功, 获得积分: ${data.score}`)
|
||||||
this.isLoading = false;
|
this.isLoading = false;
|
||||||
this.activityDialog(data);
|
this.activityDialog(data);
|
||||||
this.getActivitrStatue(id);
|
this.getActivitrStatue(id);
|
||||||
this.getUserState();
|
this.getUserState();
|
||||||
localStorage.removeItem(storeageKey);
|
// localStorage.removeItem(storeageKey);
|
||||||
clearInterval(serTimeId);
|
// clearInterval(serTimeId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
this.isLoading = false
|
this.isLoading = false
|
||||||
// this.$message.error(`claim task reward error: ${err}`)
|
// this.$message.error(`claim task reward error: ${err}`)
|
||||||
}
|
}
|
||||||
}, 3000);
|
// }, 3000);
|
||||||
},
|
},
|
||||||
|
|
||||||
// 探索状态
|
// 探索状态
|
||||||
|
@ -156,16 +156,26 @@ export default {
|
|||||||
if (!errcode) {
|
if (!errcode) {
|
||||||
this.getNftList()
|
this.getNftList()
|
||||||
this.$emit('awardDialog',data)
|
this.$emit('awardDialog',data)
|
||||||
} else if(errcode == 10 || errcode == 20) {
|
} else if(errcode == 10) {
|
||||||
this.$showErr(errmsg)
|
this.$showErr(errmsg)
|
||||||
} else if(errcode == 13) {
|
} else if(errcode == 13) {
|
||||||
this.$showErr(`${errmsg}`)
|
this.$showErr(`${errmsg}`)
|
||||||
} else if(errcode == 14) {
|
} else if(errcode == 14) {
|
||||||
|
if(itemData.contract == 'INK') {
|
||||||
|
this.$showErr("You do not hold the required role in the 'Ink' Discord server")
|
||||||
|
} else if(itemData.projectName == "Delabs Games") {
|
||||||
|
this.$showErr(`${itemData.projectName}`)
|
||||||
|
} else {
|
||||||
|
this.$showErr("had no role")
|
||||||
|
}
|
||||||
|
} else if(errcode == 20) {
|
||||||
this.$showErr(errmsg)
|
this.$showErr(errmsg)
|
||||||
} else if(errcode == 21) {
|
} else if(errcode == 21) {
|
||||||
// this.$showErr(errmsg, nextAction)
|
// this.$showErr(errmsg, nextAction)
|
||||||
if(itemData.contract == 'INK') {
|
if(itemData.contract == 'INK') {
|
||||||
this.$showErr("You do not hold the required role in the 'Ink' Discord server")
|
this.$showErr("You do not hold the required role in the 'Ink' Discord server")
|
||||||
|
} else if(itemData.projectName == "Delabs Games") {
|
||||||
|
this.$showErr(`${itemData.projectName}`)
|
||||||
} else {
|
} else {
|
||||||
this.$showErr("You do not hold the required role in the 'Counter Fire' Discord server")
|
this.$showErr("You do not hold the required role in the 'Counter Fire' Discord server")
|
||||||
this.$emit('toNavIndex')
|
this.$emit('toNavIndex')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user