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 9078994e
authored
Sep 04, 2025
by
李伟康
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
feat(Track): 优化轨迹记录功能
- 添加重新打开定时埋点逻辑 - 增加无数据时暂停定时埋点的功能
1 parent
c7d75452
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
utils/Track.js
utils/Track.js
View file @
9078994
...
@@ -37,6 +37,10 @@ class Track {
...
@@ -37,6 +37,10 @@ class Track {
if
(
data
.
businessId
)
item
.
businessId
=
data
.
businessId
if
(
data
.
businessId
)
item
.
businessId
=
data
.
businessId
trackList
.
push
(
item
)
trackList
.
push
(
item
)
uni
.
setStorageSync
(
'TRACK_LIST'
,
trackList
)
uni
.
setStorageSync
(
'TRACK_LIST'
,
trackList
)
if
(
!
TRACK_TIME
)
{
console
.
log
(
'---------------- 重新打开定时埋点 ----------------'
)
this
.
sendTrack
()
//开启定时埋点
}
if
(
trackList
.
length
>
9
)
this
.
sendTrackData
()
if
(
trackList
.
length
>
9
)
this
.
sendTrackData
()
}
}
...
@@ -52,8 +56,11 @@ class Track {
...
@@ -52,8 +56,11 @@ class Track {
const
recordList
=
uni
.
getStorageSync
(
'TRACK_LIST'
)
||
[]
const
recordList
=
uni
.
getStorageSync
(
'TRACK_LIST'
)
||
[]
if
(
recordList
.
length
)
{
if
(
recordList
.
length
)
{
const
res
=
await
uni
.
$api
.
commonApi
.
recordInsert
({
recordList
})
const
res
=
await
uni
.
$api
.
commonApi
.
recordInsert
({
recordList
})
if
(
res
)
if
(
res
)
uni
.
setStorageSync
(
'TRACK_LIST'
,
[])
uni
.
setStorageSync
(
'TRACK_LIST'
,
[])
}
else
{
clearInterval
(
TRACK_TIME
)
TRACK_TIME
=
null
console
.
log
(
'---------------- 暂停定时埋点 ----------------'
)
}
}
}
}
}
}
...
...
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