mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-25 17:42:25 +01:00
加入教程数据统计
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
import i18n from '../i18n'
|
||||
import store from '../store'
|
||||
import stats from './stats'
|
||||
|
||||
export default {
|
||||
isFinishedTour: (tourName) => {
|
||||
@@ -26,6 +28,29 @@ export default {
|
||||
}
|
||||
data[tourName] = 1
|
||||
localStorage.setItem('tour', JSON.stringify(data))
|
||||
|
||||
// 发送统计数据
|
||||
const finalStep = store.state.tour.tourFinishSteps[tourName]
|
||||
const currentStep = store.state.tour.tourSteps[tourName]
|
||||
if (currentStep === finalStep) {
|
||||
stats.sendEv('教程', '完成', tourName)
|
||||
} else {
|
||||
stats.sendEv('教程', '跳过', tourName)
|
||||
}
|
||||
},
|
||||
nextStep: (tourName, currentStep) => {
|
||||
store.commit('tour/SET_TOUR_STEP', {
|
||||
tourName,
|
||||
step: currentStep + 1
|
||||
})
|
||||
stats.sendEv('教程', '下一步', tourName)
|
||||
},
|
||||
prevStep: (tourName, currentStep) => {
|
||||
store.commit('tour/SET_TOUR_STEP', {
|
||||
tourName,
|
||||
step: currentStep - 1
|
||||
})
|
||||
stats.sendEv('教程', '上一步', tourName)
|
||||
},
|
||||
getOptions: (isShowHighlight) => {
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user