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
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
114 additions
and
104 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
...
...
@@ -22,17 +22,7 @@
<view
class=
"service-item"
v-for=
"(item, index) in list"
:key=
"index"
@
click=
"handleDetail(item)"
>
<view
class=
"service-item-title"
>
<view
class=
"service-item-title-left"
>
<view
class=
"dot-value"
v-if=
"(
(moduleType == 0 && !item.readFlag) ||
(moduleType == 1 && item.status == 0) ||
(moduleType == 2 && item.status == 0) ||
(moduleType == 3 && item.status == 0) ||
(moduleType == 4 && item.status == 0) ||
(moduleType == 5 && item.status == 0)
)"
></view>
<view
class=
"dot-value"
v-if=
"(moduleType == 0 && !item.readFlag) || (moduleType == 1 && item.status == 0) || (moduleType == 2 && item.status == 0) || (moduleType == 3 && item.status == 0) || (moduleType == 4 && item.status == 0) || (moduleType == 5 && item.status == 0)"
></view>
<template
v-if=
"moduleType == 3 || moduleType == 4"
>
{{
item
.
title
}}
</
template
>
...
...
@@ -48,11 +38,11 @@
<
template
v-if=
"moduleType == 3 || moduleType == 4"
>
<template
v-if=
"item.taskType == 1"
>
<view
class=
"service-item-text"
>
学习任务名称:
{{
item
.
taskName
}}
</view>
<view
class=
"service-item-text"
>
任务完成时间:小伙伴,请于
{{
formatTime
(
item
.
finishTime
,
'YYYY-MM-DD HH:mm'
)
}}
完成哦~
</view>
<!--
<view
class=
"service-item-text"
>
提醒内容:
{{
item
.
title
}}
</view>
-->
<view
class=
"service-item-text"
>
任务完成时间:小伙伴,请于
{{
formatTime
(
item
.
finishTime
,
'YYYY-MM-DD HH:mm'
)
}}
完成哦~
</view>
<!--
<view
class=
"service-item-text"
>
提醒内容:
{{
item
.
title
}}
</view>
-->
</
template
>
<
template
v-else-if=
"item.taskType == 2"
>
<view
class=
"service-item-text"
>
提醒内容:您有未完成的学习任务即将到期:
{{
formatTime
(
item
.
finishTime
,
'YYYY-MM-DD HH:mm'
)
}}
,抓紧时间完成哦!
</view>
<view
class=
"service-item-text"
>
提醒内容:您有未完成的学习任务即将到期:
{{
formatTime
(
item
.
finishTime
,
'YYYY-MM-DD HH:mm'
)
}}
,抓紧时间完成哦!
</view>
<!--
<view
class=
"service-item-text"
>
学习任务名称:
{{
item
.
taskName
}}
</view>
-->
</
template
>
</template>
...
...
@@ -74,7 +64,7 @@
</view>
</view>
<uni-transition
:show=
"noticeTips"
mode=
"slide-top"
>
<view
class=
"notice-tips"
>
<view
class=
"notice-tips"
>
<!-- <view class="sprite-icon icon-notice-success"></view> -->
<view>
{{ topList.includes(Number(moduleType)) ? '置顶成功' : '取消置顶' }}
</view>
</view>
...
...
@@ -87,8 +77,8 @@ const PAGE_NUM = 1
let
timer
=
null
import
dayjs
from
'dayjs'
import
{
moduleTypeEnum
,
moduleContentEnum
}
from
'./components/contant'
import
ServiceList
from
'./components/ServiceList.vue'
;
import
{
getMessageSummary
}
from
'../../../api/module/common'
import
ServiceList
from
'./components/ServiceList.vue'
import
{
getMessageSummary
}
from
'../../../api/module/common'
export
default
{
name
:
'ServiceDetail'
,
components
:
{
...
...
@@ -142,7 +132,7 @@ export default {
moduleType
:
{
handler
(
newVal
)
{
this
.
getRightList
(
newVal
)
}
,
}
}
},
onLoad
(
options
)
{
...
...
@@ -160,12 +150,12 @@ export default {
},
methods
:
{
formatTime
(
time
,
formatStr
)
{
return
dayjs
(
time
).
format
(
formatStr
)
;
return
dayjs
(
time
).
format
(
formatStr
)
},
// 获取服务中心列表
async
getMessageSummary
(
sceneType
)
{
// const userInfo = uni.$storage.get('userInfo')
const
res
=
await
getMessageSummary
({
businessType
:
sceneType
})
const
res
=
await
getMessageSummary
({
businessType
:
sceneType
})
this
.
messageList
=
res
},
getRightList
(
val
)
{
...
...
@@ -192,7 +182,7 @@ export default {
},
// 获取缓存中置顶的列表
getTopInfo
()
{
const
{
phone
,
shopMerchantId
,
sceneType
}
=
this
.
userInfo
const
{
phone
,
shopMerchantId
,
sceneType
}
=
this
.
userInfo
this
.
getMessageSummary
(
sceneType
)
const
_topInfo
=
uni
.
$storage
.
get
(
'noticeTopInfo'
)
||
{}
const
key
=
`
${
phone
}
-
${
shopMerchantId
}
-
${
sceneType
}
`
...
...
@@ -200,11 +190,11 @@ export default {
},
backPage
()
{
uni
.
navigateBack
({
success
:
(
res
)
=>
{
success
:
res
=>
{
this
.
getMessageSummary
(
this
.
userInfo
.
sceneType
)
uni
.
$emit
(
'messageBackHome'
,
this
.
topList
)
}
})
;
})
},
handleClick
(
item
)
{
// 如果点击的是同一个模块类型,则不进行操作
...
...
@@ -218,9 +208,8 @@ export default {
this
.
nothing
=
false
setTimeout
(()
=>
{
this
.
scrollTop
=
0
},
100
);
},
},
100
)
},
// 企业通知列表
async
getSystemPage
()
{
try
{
...
...
@@ -229,11 +218,13 @@ export default {
})
const
{
pageNum
,
pageSize
}
=
this
const
res
=
await
uni
.
$api
.
commonApi
.
getTaskInfo
({
pageNum
,
pageSize
})
res
.
list
?.
length
&&
res
.
list
.
map
(
e
=>
{
e
.
time
=
e
.
actualSendTimeStr
pageNum
,
pageSize
})
res
.
list
?.
length
&&
res
.
list
.
map
(
e
=>
{
e
.
time
=
e
.
actualSendTimeStr
})
if
(
pageNum
==
1
)
{
this
.
systemList
=
res
.
list
}
else
{
...
...
@@ -245,8 +236,8 @@ export default {
}
catch
(
error
)
{
uni
.
showToast
({
title
:
error
,
icon
:
"none"
,
})
;
icon
:
'none'
})
}
},
// 优秀话术列表
...
...
@@ -255,7 +246,7 @@ export default {
uni
.
showLoading
({
mask
:
true
})
const
{
sceneType
,
uuid
}
=
uni
.
$storage
.
get
(
"userInfo"
)
const
{
sceneType
,
uuid
}
=
uni
.
$storage
.
get
(
'userInfo'
)
const
{
pageNum
,
pageSize
}
=
this
let
businessTypeList
=
[]
if
(
sceneType
==
0
)
{
...
...
@@ -271,9 +262,10 @@ export default {
pageSize
}
const
res
=
await
uni
.
$api
.
commonApi
.
getPageRecord
(
params
)
res
.
list
?.
length
&&
res
.
list
.
map
(
e
=>
{
e
.
time
=
dayjs
(
new
Date
(
e
.
pushTime
)).
format
(
"YYYY-MM-DD HH:mm:ss"
)
})
res
.
list
?.
length
&&
res
.
list
.
map
(
e
=>
{
e
.
time
=
dayjs
(
new
Date
(
e
.
pushTime
)).
format
(
'YYYY-MM-DD HH:mm:ss'
)
})
if
(
pageNum
==
1
)
{
this
.
scriptList
=
res
.
list
}
else
{
...
...
@@ -285,8 +277,8 @@ export default {
}
catch
(
error
)
{
uni
.
showToast
({
title
:
error
,
icon
:
"none"
,
})
;
icon
:
'none'
})
}
},
// 违规话术列表
...
...
@@ -301,9 +293,10 @@ export default {
pageSize
}
const
res
=
await
uni
.
$api
.
commonApi
.
getWarningPage
(
params
)
res
.
list
?.
length
&&
res
.
list
.
map
(
e
=>
{
e
.
time
=
dayjs
(
new
Date
(
e
.
warningTime
)).
format
(
"YYYY-MM-DD HH:mm:ss"
)
})
res
.
list
?.
length
&&
res
.
list
.
map
(
e
=>
{
e
.
time
=
dayjs
(
new
Date
(
e
.
warningTime
)).
format
(
'YYYY-MM-DD HH:mm:ss'
)
})
if
(
pageNum
==
1
)
{
this
.
earlyWarnList
=
res
.
list
console
.
log
(
this
.
earlyWarnList
,
'==='
)
...
...
@@ -316,8 +309,8 @@ export default {
}
catch
(
error
)
{
uni
.
showToast
({
title
:
error
,
icon
:
"none"
,
})
;
icon
:
'none'
})
}
},
/**
...
...
@@ -326,67 +319,67 @@ export default {
* 如果没有更多数据,则标记为没有更多数据状态
*/
pageonReachBottom
()
{
console
.
log
(
'到底了'
)
;
console
.
log
(
'到底了'
)
// 解构赋值,设置 nothing 的默认值
let
{
pageNum
,
total
,
nothing
=
'nothing'
,
pageSize
}
=
this
;
let
{
pageNum
,
total
,
nothing
=
'nothing'
,
pageSize
}
=
this
if
(
Math
.
ceil
(
total
/
pageSize
)
>
pageNum
)
{
this
.
pageNum
+=
1
;
this
.
pageNum
+=
1
// 根据 firstIndex 的值调用不同的方法
switch
(
this
.
moduleType
)
{
case
1
:
try
{
this
.
getMessagePage
()
;
this
.
getMessagePage
()
}
catch
(
error
)
{
console
.
error
(
'调用 getMessagePage 方法时出错:'
,
error
)
;
console
.
error
(
'调用 getMessagePage 方法时出错:'
,
error
)
}
break
;
break
case
0
:
try
{
this
.
getSystemPage
()
;
this
.
getSystemPage
()
}
catch
(
error
)
{
console
.
error
(
'调用 getSystemPage 方法时出错:'
,
error
)
;
console
.
error
(
'调用 getSystemPage 方法时出错:'
,
error
)
}
break
;
break
case
2
:
try
{
this
.
getWarningPage
()
;
this
.
getWarningPage
()
}
catch
(
error
)
{
console
.
error
(
'调用 getWarningPage 方法时出错:'
,
error
)
;
console
.
error
(
'调用 getWarningPage 方法时出错:'
,
error
)
}
break
;
break
case
3
:
try
{
this
.
getCourseList
(
3
)
;
this
.
getCourseList
(
3
)
}
catch
(
error
)
{
console
.
error
(
'调用 getCourseList 方法时出错:'
,
error
)
;
console
.
error
(
'调用 getCourseList 方法时出错:'
,
error
)
}
break
;
break
case
4
:
try
{
this
.
getCourseList
(
4
)
;
this
.
getCourseList
(
4
)
}
catch
(
error
)
{
console
.
error
(
'调用 getCourseList 方法时出错:'
,
error
)
;
console
.
error
(
'调用 getCourseList 方法时出错:'
,
error
)
}
break
;
break
case
5
:
try
{
this
.
getActivityList
()
;
this
.
getActivityList
()
}
catch
(
error
)
{
console
.
error
(
'调用 getActivityList 方法时出错:'
,
error
)
;
console
.
error
(
'调用 getActivityList 方法时出错:'
,
error
)
}
break
;
break
default
:
break
;
break
}
}
else
{
this
.
nothing
=
true
;
this
.
nothing
=
true
}
},
// 查看详情
async
handleDetail
(
item
)
{
console
.
log
(
item
,
this
.
moduleType
)
const
{
moduleType
}
=
this
const
{
moduleType
}
=
this
switch
(
moduleType
)
{
case
0
:
console
.
log
(
'企业消息跳转'
)
...
...
@@ -418,42 +411,42 @@ export default {
console
.
log
(
'优秀话术跳转'
)
uni
.
navigateTo
({
url
:
`/pages/common/messageDetail?row=
${
encodeURIComponent
(
JSON
.
stringify
(
item
))}
&type=service`
,
fail
:
(
err
)
=>
{
console
.
error
(
'页面跳转失败:'
,
err
)
;
fail
:
err
=>
{
console
.
error
(
'页面跳转失败:'
,
err
)
}
})
;
})
break
case
2
:
console
.
log
(
'违规话术跳转'
)
uni
.
navigateTo
({
url
:
`/pages/common/earlyWarnDetail?row=
${
encodeURIComponent
(
JSON
.
stringify
(
item
))}
`
,
fail
:
(
err
)
=>
{
console
.
error
(
'页面跳转失败:'
,
err
)
;
fail
:
err
=>
{
console
.
error
(
'页面跳转失败:'
,
err
)
}
})
;
})
break
case
3
:
console
.
log
(
'短课程学习跳转'
)
uni
.
$track
.
add
({
eventCode
:
'app_short_course'
,
businessId
:
item
.
detailId
,
pagePath
:
'/pages/common/serviceDetail/index'
})
uni
.
$track
.
add
({
eventCode
:
'app_short_course'
,
businessId
:
item
.
detailId
,
pagePath
:
'/pages/common/serviceDetail/index'
})
// const row = {
// ...item,
// }
// row.id = item.detailId
uni
.
navigateTo
({
url
:
`/pages/common/studyDetail/shortCourse?row=
${
encodeURIComponent
(
JSON
.
stringify
(
item
))}
&completeStatus=
${
item
.
completeStatus
}
&from=service`
,
fail
:
(
err
)
=>
{
console
.
error
(
'页面跳转失败:'
,
err
)
;
fail
:
err
=>
{
console
.
error
(
'页面跳转失败:'
,
err
)
}
})
;
})
break
case
4
:
console
.
log
(
'长课程学习跳转'
)
uni
.
navigateTo
({
url
:
`/pages/common/studyDetail/longCourse?row=
${
encodeURIComponent
(
JSON
.
stringify
(
item
))}
&completeStatus=
${
item
.
completeStatus
}
&from=service`
,
fail
:
(
err
)
=>
{
console
.
error
(
'页面跳转失败:'
,
err
)
;
fail
:
err
=>
{
console
.
error
(
'页面跳转失败:'
,
err
)
}
})
;
})
break
case
5
:
console
.
log
(
'活动消息跳转'
)
...
...
@@ -465,7 +458,7 @@ export default {
uni
.
navigateBack
({
delta
:
1
})
uni
.
$emit
(
"ActivityCenter"
)
uni
.
$emit
(
'ActivityCenter'
)
break
default
:
break
...
...
@@ -479,11 +472,14 @@ export default {
})
const
{
pageNum
,
pageSize
}
=
this
const
res
=
await
uni
.
$api
.
commonApi
.
getCourseList
({
pageNum
,
pageSize
,
moduleType
})
res
.
list
?.
length
&&
res
.
list
.
map
(
e
=>
{
e
.
time
=
e
.
actualSendTimeStr
pageNum
,
pageSize
,
moduleType
})
res
.
list
?.
length
&&
res
.
list
.
map
(
e
=>
{
e
.
time
=
e
.
actualSendTimeStr
})
if
(
pageNum
==
1
)
{
moduleType
==
3
?
(
this
.
shortCourseList
=
res
.
list
)
:
(
this
.
longCourseList
=
res
.
list
)
}
else
{
...
...
@@ -495,8 +491,8 @@ export default {
}
catch
(
error
)
{
uni
.
showToast
({
title
:
error
,
icon
:
"none"
,
})
;
icon
:
'none'
})
}
},
// 活动消息列表
...
...
@@ -505,14 +501,17 @@ export default {
uni
.
showLoading
({
mask
:
true
})
const
{
sceneType
}
=
uni
.
$storage
.
get
(
"userInfo"
)
const
{
sceneType
}
=
uni
.
$storage
.
get
(
'userInfo'
)
const
{
pageNum
,
pageSize
}
=
this
const
res
=
await
uni
.
$api
.
commonApi
.
getActivityMessageList
({
pageNum
,
pageSize
,
businessType
:
sceneType
})
res
.
list
?.
length
&&
res
.
list
.
map
(
e
=>
{
e
.
time
=
e
.
createTime
pageNum
,
pageSize
,
businessType
:
sceneType
})
res
.
list
?.
length
&&
res
.
list
.
map
(
e
=>
{
e
.
time
=
e
.
createTime
})
if
(
pageNum
==
1
)
{
this
.
activityList
=
res
.
list
||
[]
}
else
{
...
...
@@ -524,8 +523,8 @@ export default {
}
catch
(
error
)
{
uni
.
showToast
({
title
:
error
,
icon
:
"none"
,
})
;
icon
:
'none'
})
}
},
// 置顶,取消置顶
...
...
@@ -659,7 +658,7 @@ export default {
width
:
toRpx
(
12
);
height
:
toRpx
(
12
);
border-radius
:
50%
;
background
:
#
F
24724
;
background
:
#
f
24724
;
margin-right
:
toRpx
(
24
);
}
}
...
...
@@ -707,11 +706,11 @@ export default {
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
color
:
#
FFFFFF
;
color
:
#
ffffff
;
font-size
:
toRpx
(
28
);
padding
:
toRpx
(
16
)
toRpx
(
24
);
border-radius
:
toRpx
(
8
);
z-index
:
1
;
background-color
:
#000000
cc
;
}
</
style
>
\ No newline at end of file
</
style
>
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