Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx
/
gl_tape
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
3
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 8f50eb08
authored
Nov 11, 2025
by
cen
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix: 销毁左边菜单活动中心监听
1 parent
bb8b93c6
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
7 deletions
components/HomeFrame/components/Activity/card.vue
components/HomeFrame/components/LeftSide.vue
pages/common/serviceDetail/index.vue
components/HomeFrame/components/Activity/card.vue
View file @
8f50eb0
...
...
@@ -2,7 +2,7 @@
<view
class=
"card"
@
click=
"handleAvtivityItemClick()"
>
<view
v-if=
"tabIndex === 1"
class=
"time-limit-countdown"
>
<template
v-if=
"countdownObj._timeout"
>
<view
class=
"countdown-label timeout-label"
>
已超时
</view>
<view
class=
"countdown-label timeout-label"
>
活动开始
</view>
</
template
>
<
template
v-else-if=
"countdownObj._remainSeconds < 3600"
>
<!-- 小于1小时,显示分钟/秒 -->
...
...
components/HomeFrame/components/LeftSide.vue
View file @
8f50eb0
...
...
@@ -174,17 +174,19 @@ export default {
}
},
created
()
{
// 监听自定义事件
uni
.
$on
(
'pageBack'
,
()
=>
{
console
.
log
(
'pageBack'
)
this
.
getMessageInfo
();
});
uni
.
$on
(
'ActivityCenter'
,
()
=>
{
console
.
log
(
'ActivityCenter'
)
let
{
tabs
}
=
this
,
index
=
tabs
.
findIndex
(
e
=>
e
.
name
==
'ActivityCenter'
)
this
.
changeIndex
(
index
,
this
.
tabs
[
index
])
})
uni
.
$on
(
'ActivityCenter'
,
this
.
handleActivityCenter
);
// uni.$on('ActivityCenter', () => {
// console.log('ActivityCenter')
// let { tabs } = this,
// index = tabs.findIndex(e => e.name == 'ActivityCenter')
// this.changeIndex(index, this.tabs[index])
// })
// uni.$on('studyCenter', () => {
// let { tabs } = this,
// index = tabs.findIndex(e => e.name == 'StudyCenter')
...
...
@@ -252,6 +254,14 @@ export default {
})
})
},
handleActivityCenter
()
{
console
.
log
(
'ActivityCenter triggered'
);
// 添加日志查看触发次数
let
{
tabs
}
=
this
;
let
index
=
tabs
.
findIndex
(
e
=>
e
.
name
==
'ActivityCenter'
);
if
(
index
!==
-
1
)
{
this
.
changeIndex
(
index
,
this
.
tabs
[
index
]);
}
},
async
changeIndex
(
index
,
item
)
{
if
(
item
.
eventCode
)
uni
.
$track
.
add
({
eventCode
:
item
.
eventCode
...
...
@@ -435,6 +445,7 @@ export default {
// this.trackInterval = null
},
beforeDestroy
()
{
uni
.
$off
(
'ActivityCenter'
,
this
.
handleActivityCenter
);
// clearInterval(this.trackInterval)
// this.trackInterval = null
},
...
...
pages/common/serviceDetail/index.vue
View file @
8f50eb0
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment