Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
study
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Damon
study
Commits
2eaee313
Commit
2eaee313
authored
Aug 06, 2021
by
Damon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 答题、搜索事件埋点
parent
7072e3ea
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
0 deletions
+17
-0
answer.vue
src/pages/learn/answer.vue
+12
-0
detail.vue
src/pages/search/detail.vue
+5
-0
No files found.
src/pages/learn/answer.vue
View file @
2eaee313
...
@@ -300,6 +300,8 @@ export default {
...
@@ -300,6 +300,8 @@ export default {
source
:
this
.
source
,
source
:
this
.
source
,
}
}
getApp
().
track
(
"answer"
,
params
)
this
.
$u
.
api
.
getQuestionTotal
(
params
).
then
((
res
)
=>
{
this
.
$u
.
api
.
getQuestionTotal
(
params
).
then
((
res
)
=>
{
// 列表总长度,一定要在第一次请求列表数据前明确该值
// 列表总长度,一定要在第一次请求列表数据前明确该值
// 否则无法知道下一页是否还有数据
// 否则无法知道下一页是否还有数据
...
@@ -354,6 +356,7 @@ export default {
...
@@ -354,6 +356,7 @@ export default {
},
},
// 返回
// 返回
customBack
()
{
customBack
()
{
getApp
().
track
(
"back"
)
if
(
this
.
source
===
3
)
{
if
(
this
.
source
===
3
)
{
// 如果已答题,点击返回提示交卷
// 如果已答题,点击返回提示交卷
const
count
=
this
.
list
.
reduce
((
accumulator
,
currentValue
)
=>
{
const
count
=
this
.
list
.
reduce
((
accumulator
,
currentValue
)
=>
{
...
@@ -544,6 +547,7 @@ export default {
...
@@ -544,6 +547,7 @@ export default {
recordId
:
this
.
recordId
,
recordId
:
this
.
recordId
,
source
:
this
.
source
,
source
:
this
.
source
,
}
}
getApp
().
track
(
"submitAnswers"
,
params
)
this
.
$u
.
api
.
answer
([
params
]).
then
((
res
)
=>
{
this
.
$u
.
api
.
answer
([
params
]).
then
((
res
)
=>
{
if
(
this
.
source
===
2
)
{
if
(
this
.
source
===
2
)
{
// 每日一练
// 每日一练
...
@@ -576,6 +580,7 @@ export default {
...
@@ -576,6 +580,7 @@ export default {
uni
.
showLoading
({
uni
.
showLoading
({
title
:
'正在计算考试成绩'
,
title
:
'正在计算考试成绩'
,
})
})
getApp
().
track
(
"handPaper"
,
data
)
this
.
$u
.
api
.
submitExamRecord
(
data
).
then
((
res
)
=>
{
this
.
$u
.
api
.
submitExamRecord
(
data
).
then
((
res
)
=>
{
uni
.
hideLoading
()
uni
.
hideLoading
()
if
(
res
)
{
if
(
res
)
{
...
@@ -624,6 +629,10 @@ export default {
...
@@ -624,6 +629,10 @@ export default {
const
info
=
this
.
list
.
find
((
v
)
=>
v
.
index
===
this
.
currentIndex
)
const
info
=
this
.
list
.
find
((
v
)
=>
v
.
index
===
this
.
currentIndex
)
const
status
=
info
?
info
.
collectionFlag
:
false
const
status
=
info
?
info
.
collectionFlag
:
false
const
action
=
status
?
'removeCollection'
:
'joinCollection'
const
action
=
status
?
'removeCollection'
:
'joinCollection'
getApp
().
track
(
"collect"
,
{
action
:
action
,
questionId
:
info
.
id
})
this
.
$u
.
api
[
action
]({
questionId
:
info
.
id
}).
then
((
res
)
=>
{
this
.
$u
.
api
[
action
]({
questionId
:
info
.
id
}).
then
((
res
)
=>
{
if
(
res
)
{
if
(
res
)
{
const
msg
=
status
?
'取消收藏成功'
:
'收藏成功'
const
msg
=
status
?
'取消收藏成功'
:
'收藏成功'
...
@@ -651,6 +660,9 @@ export default {
...
@@ -651,6 +660,9 @@ export default {
// 移除
// 移除
remove
()
{
remove
()
{
const
info
=
this
.
list
.
find
((
v
)
=>
v
.
index
===
this
.
currentIndex
)
const
info
=
this
.
list
.
find
((
v
)
=>
v
.
index
===
this
.
currentIndex
)
getApp
().
track
(
"removeError"
,
{
questionId
:
info
.
id
})
this
.
$u
.
api
.
removeError
({
questionId
:
info
.
id
}).
then
((
res
)
=>
{
this
.
$u
.
api
.
removeError
({
questionId
:
info
.
id
}).
then
((
res
)
=>
{
if
(
res
)
this
.
init
(
this
.
currentIndex
)
if
(
res
)
this
.
init
(
this
.
currentIndex
)
})
})
...
...
src/pages/search/detail.vue
View file @
2eaee313
...
@@ -97,6 +97,11 @@ export default {
...
@@ -97,6 +97,11 @@ export default {
size
:
this
.
pageSize
,
size
:
this
.
pageSize
,
}
}
getApp
().
track
(
"search"
,
{
questionWarehouseId
:
this
.
questionWarehouseId
,
keyword
:
this
.
keyword
,
})
this
.
loadStatus
=
'loading'
this
.
loadStatus
=
'loading'
this
.
$u
.
api
.
searchQuestion
(
data
).
then
((
res
)
=>
{
this
.
$u
.
api
.
searchQuestion
(
data
).
then
((
res
)
=>
{
this
.
total
=
res
.
total
this
.
total
=
res
.
total
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment