From 6b94ece116272829c044e85d6982ea2acd2c2b1e Mon Sep 17 00:00:00 2001 From: daihh Date: Thu, 27 Oct 2022 10:25:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E7=95=99=E8=A8=80=E7=89=88?= =?UTF-8?q?=E7=82=B9=E5=85=B3=E6=B3=A8=E8=B7=B3=E8=BD=AC=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/homepage/Index.vue | 14 +++++++++++++- src/views/homepage/page.vue | 11 ++++++++++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/src/views/homepage/Index.vue b/src/views/homepage/Index.vue index bd4d3571..91332645 100644 --- a/src/views/homepage/Index.vue +++ b/src/views/homepage/Index.vue @@ -78,6 +78,7 @@ }, created() { this.pageId = this.$xpage.getHomeId(this.$route); + if(!this.pageId){ this.$router.push({path:'/404'}) }else{ @@ -99,7 +100,18 @@ }, jumpAttention(num) {// 点击事件跳转关注 // this.$store.dispatch("setAttention", true); - this.$bus.$emit('followIndex',num) + let path=this.$route.path; + //console.log(path,'this.$router.path'); + let idx=path.lastIndexOf('leaving'); + if(idx>0){ + //console.log(path.substring(0,idx-1),'this.$router.path'); + //this.$router.push(path.substring(0,idx-1)+'?gz=7'+num) + location.href=path.substring(0,idx-1)+'?gz=7'+num; + }else{ + this.$bus.$emit('followIndex',num) + } + + }, init(){ this.getMedal(); diff --git a/src/views/homepage/page.vue b/src/views/homepage/page.vue index 4bdc2df6..84afb0f9 100644 --- a/src/views/homepage/page.vue +++ b/src/views/homepage/page.vue @@ -97,6 +97,7 @@ }, data(){ return{ + intTabIndex:-1,//初始化显示哪个tab,71我关注的人,72关注我的人 page:{ pageIndex:1, pageSize:10, @@ -130,6 +131,7 @@ }, watch:{ '$route' (to, from) { //监听路由是否变化 + if(to.params.id != from.params.id){ this.pageId = to.params.id; let urlPre=window.location.protocol+'//'+window.location.host; @@ -146,12 +148,19 @@ }, methods:{ init(){ - this.getList(); if(this.pageId == this.userInfo.aid) { this.personal = true; } this.loadMajorType(); this.loadOrgDomain(); + // + this.intTabIndex=this.$route.query.gz; + if(this.intTabIndex){ + this.activeName='7'; + //是 + }else{ + this.getList(); + } }, dynamicHide(id){ apiStat.dynamicHide(id).then(res=>{