feat:modify statistics
This commit is contained in:
@@ -63,6 +63,7 @@ async function init() {
|
||||
runtimeStore.isNew = r ? (APP_VERSION.version > Number(r)) : true
|
||||
})
|
||||
}
|
||||
window.umami?.track('host', window.location.host)
|
||||
}
|
||||
|
||||
onMounted(init)
|
||||
|
||||
@@ -66,12 +66,6 @@ function startStudy() {
|
||||
if (!base.sbook.articles.length) {
|
||||
return Toast.warning('没有文章可学习!')
|
||||
}
|
||||
window.umami?.track('startStudyArticle', {
|
||||
name: base.sbook.name,
|
||||
index: base.sbook.lastLearnIndex,
|
||||
custom: base.sbook.custom,
|
||||
complete: base.sbook.complete,
|
||||
})
|
||||
nav('/practice-articles/' + store.sbook.id)
|
||||
} else {
|
||||
window.umami?.track('no-book')
|
||||
|
||||
@@ -216,6 +216,14 @@ function setArticle(val: Article) {
|
||||
})
|
||||
})
|
||||
_nextTick(typingArticleRef?.init)
|
||||
|
||||
window.umami?.track('startStudyArticle', {
|
||||
name: store.sbook.name,
|
||||
index: store.sbook.lastLearnIndex,
|
||||
custom: store.sbook.custom,
|
||||
complete: store.sbook.complete,
|
||||
title: articleData.article.title,
|
||||
})
|
||||
}
|
||||
|
||||
function complete() {
|
||||
@@ -234,18 +242,17 @@ function complete() {
|
||||
wrong: statStore.wrong,
|
||||
}
|
||||
let reportData = {
|
||||
...data,
|
||||
name: store.sbook.name,
|
||||
index: store.sbook.lastLearnIndex,
|
||||
custom: store.sbook.custom,
|
||||
complete: store.sbook.complete,
|
||||
title: articleData.article.title,
|
||||
spend: Number(statStore.spend / 1000 / 60).toFixed(1),
|
||||
custom: store.sdict.custom,
|
||||
complete: store.sdict.complete,
|
||||
index: store.sdict.lastLearnIndex,
|
||||
s: ''
|
||||
}
|
||||
reportData.s = `name:${store.sbook.name},title:${store.sbook.lastLearnIndex}.${data.title},spend:${Number(statStore.spend / 1000 / 60).toFixed(1)}`
|
||||
window.umami?.track('studyArticleEnd', reportData)
|
||||
window.umami?.track('endStudyArticle', reportData)
|
||||
store.sbook.statistics.push(data as any)
|
||||
console.log(data, reportData)
|
||||
|
||||
//重置
|
||||
statStore.wrong = 0
|
||||
|
||||
@@ -216,7 +216,7 @@ function startPractice() {
|
||||
if (!store.sdict.words.length) {
|
||||
return Toast.warning('没有单词可学习!')
|
||||
}
|
||||
window.umami?.track('startStudyDict', {
|
||||
window.umami?.track('startStudyWord', {
|
||||
name: store.sdict.name,
|
||||
index: store.sdict.lastLearnIndex,
|
||||
perDayStudyNumber: store.sdict.perDayStudyNumber,
|
||||
|
||||
@@ -57,7 +57,7 @@ watch(model, (newVal) => {
|
||||
new: statStore.newWordNumber,
|
||||
review: statStore.reviewWordNumber + statStore.writeWordNumber
|
||||
}
|
||||
window.umami?.track('studyWordEnd', {
|
||||
window.umami?.track('endStudyWord', {
|
||||
name: store.sdict.name,
|
||||
spend: Number(statStore.spend / 1000 / 60).toFixed(1),
|
||||
index: store.sdict.lastLearnIndex,
|
||||
|
||||
@@ -69,7 +69,7 @@ function startPractice() {
|
||||
if (!store.sdict.words.length) {
|
||||
return Toast.warning('没有单词可学习!')
|
||||
}
|
||||
window.umami?.track('startStudyDict', {
|
||||
window.umami?.track('startStudyWord', {
|
||||
name: store.sdict.name,
|
||||
index: store.sdict.lastLearnIndex,
|
||||
perDayStudyNumber: store.sdict.perDayStudyNumber,
|
||||
|
||||
Reference in New Issue
Block a user