diff --git a/src/views/screenAdaptation/pages/homePages/menuTop/time.vue b/src/views/screenAdaptation/pages/homePages/menuTop/time.vue index aa38f08..e484fcc 100644 --- a/src/views/screenAdaptation/pages/homePages/menuTop/time.vue +++ b/src/views/screenAdaptation/pages/homePages/menuTop/time.vue @@ -33,6 +33,8 @@ this.isPartyCenter = false } }, + deep: true, + immediate: true }, }, created(){ @@ -40,14 +42,14 @@ }, mounted(){ this.timeFn(); -// this.getHref(); + //this.getHref(); }, methods: { timeFn() { this.timing = setInterval(() => { this.dateDay = formatTime(new Date(), 'HH: mm') this.dateYear = formatTime(new Date(), 'yyyy-MM-dd') -// this.dateWeek = this.weekday[new Date().getDay()] + //this.dateWeek = this.weekday[new Date().getDay()] }, 100) }, getHref(){ diff --git a/src/views/screenAdaptation/pages/secondPages/top.vue b/src/views/screenAdaptation/pages/secondPages/top.vue index a795dbe..0e3b886 100644 --- a/src/views/screenAdaptation/pages/secondPages/top.vue +++ b/src/views/screenAdaptation/pages/secondPages/top.vue @@ -87,6 +87,7 @@ layoutData: {}, showWorkBenchButton: true,//是否展示工作台顶部操作按钮 isPartyCenter: false, + href: '', } }, computed: { @@ -106,11 +107,13 @@ this.topImgUrl = topImgPartyBuild this.isPartyCenter = true } else { + this.topImgUrl = topImg01 this.isPartyCenter = false } }, // 深度观察监听 - deep: true + deep: true, + immediate: true, } }, beforeMount(){ @@ -133,12 +136,12 @@ }, methods: { getHref(){ - let href = window.location.href - href = window.location.href.slice(window.location.href.indexOf('#') + 1) - if (href === '/partyCenter/party') { + this.href = window.location.hash + if (this.href === '#/partyCenter/party') { this.topImgUrl = topImgPartyBuild this.isPartyCenter = true } else { + this.topImgUrl = topImg01 this.isPartyCenter = false } }, @@ -205,6 +208,9 @@ this.topImgUrl = topImg02; this.showWorkBenchButton = true; } + } else if (this.href === '#/partyCenter/party') { + this.topImgUrl = topImgPartyBuild + this.isPartyCenter = true } else { this.rightWidth = 30; this.topImgUrl = topImg01;