From 2b259dafb9c5126da579fb7a97ba8be23db2a12d Mon Sep 17 00:00:00 2001 From: yuyongdong Date: Tue, 16 Apr 2024 17:54:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=88=86=E4=BA=AB=E9=93=BE?= =?UTF-8?q?=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/home/helpDialog.vue | 36 +++++++---------------------------- src/views/home/index.vue | 8 ++++---- 2 files changed, 11 insertions(+), 33 deletions(-) diff --git a/src/views/home/helpDialog.vue b/src/views/home/helpDialog.vue index 6455d4c..2a48901 100644 --- a/src/views/home/helpDialog.vue +++ b/src/views/home/helpDialog.vue @@ -97,7 +97,6 @@ export default { boxData: {}, token: null, helpLogList: [], - boxId: '', boxCode: '', boxState: {}, isNewUser: 0, @@ -108,14 +107,12 @@ export default { mounted() { this.token = getToken() if(this.$route.params.name) { - if(this.$route.params.boxId.split("id=")[1] != 'undefined') { - this.boxId = this.$route.params.boxId.split("id=")[1]; + if(this.$route.params.code.split("id=")[1] != 'undefined') { this.boxCode = this.$route.params.box.split("box=")[1]; this.getBoxData() if(this.token) { this.getHelpBoxLog() - // this.helpConfirm() - this.initBoxState(this.boxCode,this.boxId) + this.initBoxState(this.boxCode) } // } else { // this.$emit('handleClose') @@ -126,7 +123,7 @@ export default { methods: { // 宝箱信息接口 async getBoxData() { - let res = await this.$axios.post(process.env.VUE_APP_API_URL+'/api/chest/enhance/state', {chestId: this.boxId},{}) + let res = await this.$axios.post(process.env.VUE_APP_API_URL+'/api/chest/enhance/state', {chestId: this.boxCode},{}) if(res.data.errcode == 0) { this.boxData = res.data.data } else if(res.data.errcode == 14) { @@ -136,11 +133,11 @@ export default { // 获取帮助的宝箱助力记录 async getHelpBoxLog() { - if (this.$route.params.boxId != undefined) { + if (this.$route.params.code != undefined) { let rtoken = await checkReCaptcha("chest_share"); let res = await this.$axios.post( process.env.VUE_APP_API_URL+"/api/chest/enhance/list", - { chestid: this.boxId, rtoken: rtoken }, + { chestid: this.boxCode, rtoken: rtoken }, { headers: { Authorization: `Bearer ${this.token}` } } @@ -151,25 +148,6 @@ export default { } }, - // 领取助力奖励 || 判断是否是新用户 - async helpConfirm() { - if(this.$route.params.name != undefined) { - let newInvite = this.$route.params.name.split("new=")[1]; - // let rtoken = await checkReCaptcha("invite_user"); - // let res = await this.$axios.get(process.env.VUE_APP_API_URL+"/api/activity/upload_invite_code", { - // params: { code: newInvite, rtoken: rtoken }, - // headers: { Authorization: `Bearer ${this.token}` } - // }); - let res = await apiUploadInviteCode(newInvite) - return - if (res.data.errcode == 0) { - this.isNewUser = 0 - } else { - this.isNewUser = 1 - } - } - }, - // 宝箱助力 async helpBtn() { let address = localStorage.getItem("myAddress") @@ -246,8 +224,8 @@ export default { }, // 助力状态查询 - async initBoxState(code,chestId) { - let res = await this.$axios.post(process.env.VUE_APP_API_URL+'/api/chest/enhance/state',{code: code, chestId: chestId, },{headers: { Authorization: `Bearer ${this.token}` }}) + async initBoxState(boxCode) { + let res = await this.$axios.post(process.env.VUE_APP_API_URL+'/api/chest/enhance/state',{chestId: boxCode, },{headers: { Authorization: `Bearer ${this.token}` }}) this.boxState = res.data.data }, diff --git a/src/views/home/index.vue b/src/views/home/index.vue index c1df518..45ebe1b 100644 --- a/src/views/home/index.vue +++ b/src/views/home/index.vue @@ -830,8 +830,8 @@ export default { mounted() { this.initData(); this.$nextTick(() => { - if (this.$route.params.name) { - if (this.$route.params.boxId.split("box=")[1] != "undefined") { + if (this.$route.params.code) { + if (this.$route.params.code.split("box=")[1] != "undefined") { this.helpDialogVisible = true; } } @@ -852,8 +852,8 @@ export default { this.myInviteCount = this.userData.inviteCount; this.myEnhanceCount = this.userData.enhanceCount; this.inWhiteList = this.userData.inWhiteList; - if (this.$route.params.name) { - if (this.$route.params.boxId.split("new=")[1] != "undefined") { + if (this.$route.params.code) { + if (this.$route.params.code.split("new=")[1] != "undefined") { this.helpConfirm() } }