Commit 1e1d1681 authored by Facius's avatar Facius

feat: 用户操作触发调用接口埋点

parent abf8ed2f
......@@ -25,7 +25,9 @@
</view>
<view class="line-view"></view>
<view class="tip-view"
>温馨提示:模拟考试中不能修改答案,每做错1道题扣1分,合格标准为{{ info.passPoint }}分。</view
>温馨提示:模拟考试中不能修改答案,每做错1道题扣1分,合格标准为{{
info.passPoint
}}分。</view
>
<view class="bottom-view">
<u-button
......@@ -85,32 +87,50 @@ export default {
methods: {
init() {
uni.showLoading({
title: '加载中'
})
this.$u.api.getExamPaper({questionWarehouseId: this.questionWarehouseId}).then(res => {
uni.hideLoading()
this.info = {
id: res.id,
kemu: res.echoMap?.questionWarehouseId?.title,
tishu: `${res.totalPoint}题`,
totalPoint: res.totalPoint,
biaozhun: `${res.passPoint}分`,
passPoint: res.passPoint,
duration: `${res.duration}分钟`,
durationNumber: res.duration,
guize: '根据国家规定比例随机抽取'
}
title: '加载中',
})
// 埋点-模拟考试页面获取信息
let trackParams = {
openId: this.openId,
nickname: this.userInfo.nickName,
questionWarehouseId: this.questionWarehouseId,
}
getApp().track('getExamPaper-beginAnswerPage', trackParams)
this.$u.api
.getExamPaper({ questionWarehouseId: this.questionWarehouseId })
.then((res) => {
uni.hideLoading()
this.info = {
id: res.id,
kemu: res.echoMap?.questionWarehouseId?.title,
tishu: `${res.totalPoint}题`,
totalPoint: res.totalPoint,
biaozhun: `${res.passPoint}分`,
passPoint: res.passPoint,
duration: `${res.duration}分钟`,
durationNumber: res.duration,
guize: '根据国家规定比例随机抽取',
}
})
},
handleClick() {
const params = {
questionWarehouseId: this.questionWarehouseId,
paperId: this.info.id
paperId: this.info.id,
}
uni.showLoading({
title: '载入试题中'
title: '载入试题中',
})
this.$u.api.applyExam(params).then(res => {
// 埋点-去模拟考试
let trackParams = {
openId: this.openId,
nickname: this.userInfo.nickName,
...params,
}
getApp().track('applyExam-beginAnswerPage', trackParams)
this.$u.api.applyExam(params).then((res) => {
uni.hideLoading()
if (res) {
this.$u.route({
......@@ -120,8 +140,8 @@ export default {
source: 3,
passPoint: this.info.passPoint,
totalPoint: this.info.totalPoint,
duration: this.info.durationNumber
}
duration: this.info.durationNumber,
},
})
}
})
......
......@@ -95,6 +95,13 @@ export default {
},
methods: {
handleClick() {
// 埋点-扫码
let trackParams = {
openId: this.openId,
nickname: this.userInfo.nickName,
}
getApp().track('scanCode-boundQuestionsPage', trackParams)
wx.scanCode({
onlyFromCamera: true,
success: (res) => {
......@@ -142,6 +149,14 @@ export default {
uni.showLoading({
title: '加载中',
})
// 埋点-购买
let trackParams = {
openId: this.openId,
nickname: this.userInfo.nickName,
...data,
}
getApp().track('payOrder-boundQuestionsPage', trackParams)
this.$u.api.payOrder(data).then((res) => {
uni.hideLoading()
this.pay(res)
......
......@@ -74,6 +74,13 @@ export default {
methods: {
handleClick() {
this.loading = true
// 埋点-绑卡
let trackParams = {
openId: this.openId,
nickname: this.userInfo.nickName,
}
getApp().track('bindCard-boundTestPage', trackParams)
this.$u.api
.bindCard(this.param)
.then((res) => {
......
......@@ -178,6 +178,14 @@ export default {
},
methods: {
queryQuestionWarehouseById(id) {
// 埋点-获取题库信息
let trackParams = {
openId: this.openId,
nickname: this.userInfo.nickName,
id: id,
}
getApp().track('queryQuestionWarehouseById-DetailPage', trackParams)
this.$u.api
.queryQuestionWarehouseById(id)
.then((res) => {
......@@ -213,6 +221,14 @@ export default {
uni.showLoading({
title: '加载中',
})
// 埋点-购买
let trackParams = {
openId: this.openId,
nickname: this.userInfo.nickName,
...data,
}
getApp().track('payOrder-DetailPage', trackParams)
this.$u.api.payOrder(data).then((res) => {
uni.hideLoading()
this.pay(res)
......
......@@ -210,6 +210,14 @@ export default {
},
// 获取省份列表
async getProvinceList(id) {
// 埋点-获取省份
let trackParams = {
openId: this.openId,
nickname: this.userInfo.nickName,
id: id,
}
getApp().track('getProvinceList-examSettingPage', trackParams)
let res = await this.$u.api.getProvinceList(id)
console.log(res)
this.range = res || []
......@@ -235,6 +243,14 @@ export default {
provinceId: this.range[this.index].id,
type: this.selectedTypeId,
}
// 埋点-获取题库信息
let trackParams = {
openId: this.openId,
nickname: this.userInfo.nickName,
...param,
}
getApp().track('getQuestionWarehouse-examSettingPage', trackParams)
// 获取科目对应的题库
this.$u.api
.getQuestionWarehouse(this.category.id, param)
......@@ -242,6 +258,14 @@ export default {
if (res && res.length > 0) {
let data = res[0]
// 埋点-添加题库
let trackParams = {
openId: this.openId,
nickname: this.userInfo.nickName,
questionWarehouseId: data.id,
}
getApp().track('addQuestionWarehouse-examSettingPage', trackParams)
// 学员增加自己的题库
this.$u.api
.addQuestionWarehouse({
......
......@@ -130,6 +130,16 @@ export default {
}
this.loading = true
// 埋点-手动绑卡
let trackParams = {
openId: this.openId,
nickname: this.userInfo.nickName,
cardNumber: this.code,
cardSecret: this.password,
questionWarehouseId: this.relationId,
}
getApp().track('bindCard-manualBindingPage', trackParams)
this.$u.api
.bindCard({
cardNumber: this.code,
......
......@@ -236,6 +236,16 @@ export default {
'yyyy-mm-dd'
),
}
// 埋点-每日一练统计
let trackParams = {
openId: this.openId,
nickname: this.userInfo.nickName,
id: this.questionWarehouseId,
...params,
}
getApp().track('everyTaskList-recordPage', trackParams)
this.$u.api
.everyTaskList(this.questionWarehouseId, params)
.then((res) => {
......@@ -252,6 +262,14 @@ export default {
},
// 练习分析
studyRecord(params) {
// 埋点-练习分析
let trackParams = {
openId: this.openId,
nickname: this.userInfo.nickName,
...params,
}
getApp().track('studyRecord-recordPage', trackParams)
this.$u.api
.studyRecord(this.questionWarehouseId, params)
.then((res) => {
......@@ -278,31 +296,40 @@ export default {
// 模考记录
queryExamRecord() {
this.recordParams.current += 1
;(this.recordParams.model = {
this.recordParams.model = {
questionWarehouseId: this.questionWarehouseId,
}),
this.$u.api
.queryExamRecord(this.recordParams)
.then((res) => {
this.loaded = true
if (this.recordParams.current == 1) {
this.lists = []
}
}
if ((res.records || []).length > 0) {
this.lists.push(...res.records)
}
// 埋点-模考记录
let trackParams = {
openId: this.openId,
nickname: this.userInfo.nickName,
...this.recordParams,
}
getApp().track('queryExamRecord-recordPage', trackParams)
this.currentLoadStatus =
res.total > this.lists.length &&
(res.records || []).length == this.recordParams.size
? 'loadmore'
: 'nomore'
})
.catch((err) => {
this.loaded = true
console.log(err)
})
this.$u.api
.queryExamRecord(this.recordParams)
.then((res) => {
this.loaded = true
if (this.recordParams.current == 1) {
this.lists = []
}
if ((res.records || []).length > 0) {
this.lists.push(...res.records)
}
this.currentLoadStatus =
res.total > this.lists.length &&
(res.records || []).length == this.recordParams.size
? 'loadmore'
: 'nomore'
})
.catch((err) => {
this.loaded = true
console.log(err)
})
},
handleChangeMonth(e) {
this.everyTaskList(e.year, e.month)
......
......@@ -150,6 +150,14 @@ export default {
async loadLabel() {
this.tapLoading = true
let param = {}
// 埋点-获取科目列表
let trackParams = {
openId: this.openId,
nickname: this.userInfo.nickName,
}
getApp().track('subjectList-selectCategoryPage', trackParams)
let res = await this.$u.api.subjectList(param)
this.tapLoading = false
this.result = res
......
......@@ -89,6 +89,14 @@ export default {
loadList() {
this.loading = true
let param = {}
// 埋点-获取已选题库列表
let trackParams = {
openId: this.openId,
nickname: this.userInfo.nickName,
}
getApp().track('getMyQuestionWarehouseList-selectedList', trackParams)
this.$u.api
.getMyQuestionWarehouseList(param)
.then((res) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment