From 25487b41c8b44149ed47044d1dfefc88cb0baa1f Mon Sep 17 00:00:00 2001 From: yuyongdong Date: Sat, 20 Apr 2024 02:50:16 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=96=E6=B6=88=E7=A4=BE=E5=AA=92=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1Gas=E8=B4=B9=E3=80=81=E6=96=B0=E5=A2=9E=E5=BC=B9?= =?UTF-8?q?=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/checkBtn.vue | 61 ++++++++++---------- src/components/errorDialog/index.js | 12 +++- src/store/modules/user.js | 4 +- src/views/home/boxBtm.vue | 2 +- src/views/home/index.vue | 86 ++++++++++++++++++++--------- src/views/home/nftPartner.vue | 12 +++- 6 files changed, 115 insertions(+), 62 deletions(-) diff --git a/src/components/checkBtn.vue b/src/components/checkBtn.vue index 4ecbf53..3015c4e 100644 --- a/src/components/checkBtn.vue +++ b/src/components/checkBtn.vue @@ -1,45 +1,47 @@ diff --git a/src/components/errorDialog/index.js b/src/components/errorDialog/index.js index 011d819..0803425 100644 --- a/src/components/errorDialog/index.js +++ b/src/components/errorDialog/index.js @@ -52,9 +52,19 @@ let errmsg = err 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 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 { // 请重试 - errmsg = 'Please try again' + errmsg = 'Unknown on-chain interaction issue. Please try again' } const _confirm = new iErrorMessage({ diff --git a/src/store/modules/user.js b/src/store/modules/user.js index bead695..c89a4c2 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -40,7 +40,7 @@ const actions = { // mutations const mutations = { updateAddress(state, _address) { - console.info('update address: ', _address) + // console.info('update address: ', _address) state.address = _address }, updateChain(state, _chainId) { @@ -55,7 +55,7 @@ const mutations = { state.logined = _status }, updateUserData(state, _data) { - console.info(_data) + // console.info(_data) state.userData = { ...state.userData, ..._data } } } diff --git a/src/views/home/boxBtm.vue b/src/views/home/boxBtm.vue index db1469e..f74efb6 100644 --- a/src/views/home/boxBtm.vue +++ b/src/views/home/boxBtm.vue @@ -79,7 +79,7 @@ COMMON RARE MYTHICAL - LEGENDAR + LEGENDAY
diff --git a/src/views/home/index.vue b/src/views/home/index.vue index d1db712..60996c7 100644 --- a/src/views/home/index.vue +++ b/src/views/home/index.vue @@ -222,7 +222,7 @@ { + // let address = this.$store.state.user.address; + // if (!this.$store.state.wallet.connected || !address) { + // this.walletDialogVisible = true; + // return; + // } + // this.isLoading = true; + // let storeageKey; + // try { + // storeageKey = await sendToChain("task_claim", address, id); + // } catch (err) { + // this.isLoading = false; + // this.$showErr(err); + // return; + // } + // let serTimeId = setInterval(async () => { try { let { errcode, errmsg, data } = await apiTaskClaim(id); if (errcode) { @@ -978,30 +1011,29 @@ export default { this.isLoading = false // this.$message.error(errmsg) this.getActivitrStatue(id) - clearInterval(serTimeId) + // clearInterval(serTimeId) } else if (errcode !== 14) { // 状态不是等待链上确认的, 都提示错误 this.isLoading = false // this.$message.error(errmsg) - clearInterval(serTimeId) + // clearInterval(serTimeId) } } else { if (data?.status == 3) { - console.log(data ,'这里') // alert(`领取成功, 获得积分: ${data.score}`) this.isLoading = false; this.activityDialog(data); this.getActivitrStatue(id); this.getUserState(); - localStorage.removeItem(storeageKey); - clearInterval(serTimeId); + // localStorage.removeItem(storeageKey); + // clearInterval(serTimeId); } } } catch (err) { this.isLoading = false // this.$message.error(`claim task reward error: ${err}`) } - }, 3000); + // }, 3000); }, // 探索状态 diff --git a/src/views/home/nftPartner.vue b/src/views/home/nftPartner.vue index 7842b3d..43fd838 100644 --- a/src/views/home/nftPartner.vue +++ b/src/views/home/nftPartner.vue @@ -156,16 +156,26 @@ export default { if (!errcode) { this.getNftList() this.$emit('awardDialog',data) - } else if(errcode == 10 || errcode == 20) { + } else if(errcode == 10) { this.$showErr(errmsg) } else if(errcode == 13) { this.$showErr(`${errmsg}`) } 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) } 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 if(itemData.projectName == "Delabs Games") { + this.$showErr(`${itemData.projectName}`) } else { this.$showErr("You do not hold the required role in the 'Counter Fire' Discord server") this.$emit('toNavIndex')