Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx
/
scrm-wx-merchant-activity
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 29067597
authored
Oct 11, 2022
by
李伟康
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
增加埋点需在登陆后触发
1 parent
add10f1d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
11 deletions
src/App.vue
src/api/bigdatautilApi.js
src/App.vue
View file @
2906759
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
import
{
bigdatautilApi
}
from
'@/api'
import
{
bigdatautilApi
}
from
'@/api'
export
default
{
export
default
{
name
:
'App'
,
name
:
'App'
,
data
()
{
data
()
{
return
{
return
{
timer
:
null
timer
:
null
}
}
...
@@ -25,18 +25,24 @@ export default {
...
@@ -25,18 +25,24 @@ export default {
watch
:
{
watch
:
{
watchFlag
:
{
watchFlag
:
{
immediate
:
true
,
immediate
:
true
,
handler
(
newval
)
{
handler
(
newval
)
{
this
.
showWindow
=
newval
this
.
showWindow
=
newval
this
.
hideLoading
()
this
.
hideLoading
()
this
.
init
()
}
}
}
}
},
},
computed
:
{
computed
:
{
watchFlag
()
{
watchFlag
()
{
return
this
.
$store
.
state
.
app
.
showWindow
return
this
.
$store
.
state
.
app
.
showWindow
}
}
},
},
mounted
()
{
mounted
()
{
},
methods
:
{
init
()
{
this
.
openListener
()
this
.
openListener
()
window
.
addEventListener
(
'pagehide'
,
()
=>
{
window
.
addEventListener
(
'pagehide'
,
()
=>
{
this
.
leave
()
this
.
leave
()
...
@@ -44,27 +50,25 @@ export default {
...
@@ -44,27 +50,25 @@ export default {
// console.log('页面要关闭了')
// console.log('页面要关闭了')
})
})
},
},
methods
:
{
// 心跳检测
// 心跳检测
openListener
()
{
openListener
()
{
this
.
timer
=
setInterval
(()
=>
{
this
.
timer
=
setInterval
(()
=>
{
this
.
heartbeat
()
this
.
heartbeat
()
},
60
*
1000
)
},
60
*
1000
)
},
},
closeListener
()
{
closeListener
()
{
clearInterval
(
this
.
timer
)
clearInterval
(
this
.
timer
)
},
},
// 心跳检测
// 心跳检测
heartbeat
()
{
heartbeat
()
{
this
.
trackFn
(
'heartbeat'
,
5
)
this
.
trackFn
(
'heartbeat'
,
5
)
},
},
//离开事件
//离开事件
leave
()
{
leave
()
{
// console.log('离开时间')
// console.log('离开时间')
this
.
trackFn
(
'leaveReportTrack'
,
5
)
this
.
trackFn
(
'leaveReportTrack'
,
5
)
},
},
trackFn
(
name
,
actionType
)
{
trackFn
(
name
,
actionType
)
{
const
{
id
}
=
this
.
getQuery
()
const
{
id
}
=
this
.
getQuery
()
bigdatautilApi
[
name
](
id
,
actionType
)
bigdatautilApi
[
name
](
id
,
actionType
)
}
}
...
...
src/api/bigdatautilApi.js
View file @
2906759
...
@@ -26,6 +26,7 @@ const reportTrack = (id, view = 1, share_channel = '', url = commonUrl, method =
...
@@ -26,6 +26,7 @@ const reportTrack = (id, view = 1, share_channel = '', url = commonUrl, method =
const
userInfo
=
util
.
getUserInfo
()
const
userInfo
=
util
.
getUserInfo
()
const
params
=
util
.
getLocalStorage
(
'wx_scrm_link_params'
)
||
{}
const
params
=
util
.
getLocalStorage
(
'wx_scrm_link_params'
)
||
{}
const
ISWXWORK
=
util
.
getLocalStorage
(
'is_wxwork'
)
const
ISWXWORK
=
util
.
getLocalStorage
(
'is_wxwork'
)
if
(
!
userInfo
)
return
if
(
ISWXWORK
)
{
if
(
ISWXWORK
)
{
if
(
userInfo
.
loginList
.
length
&&
userInfo
.
loginList
[
0
].
phone
)
userInfo
.
phone
=
userInfo
.
loginList
[
0
].
phone
if
(
userInfo
.
loginList
.
length
&&
userInfo
.
loginList
[
0
].
phone
)
userInfo
.
phone
=
userInfo
.
loginList
[
0
].
phone
}
}
...
...
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