Commit ccbde076 authored by Facius's avatar Facius

Merge branch 'dev-v1.0.0' of https://git.banshouhui.com/wuzhenzhe/study into dev-v1.0.0

parents d9171718 ff297b1f
<script> <script>
import "./../.env.js" import './../.env.js'
import { AnalysysAgent } from '@/common/analysys_paas.js'
export default { export default {
globalData: { globalData: {
// 开发环境 // 开发环境
uniEnv: process.uniEnv, uniEnv: process.uniEnv,
questionList: [] questionList: [],
}, },
onLaunch: function(options) { onLaunch: function(options) {
AnalysysAgent.registerSuperProperty('platform', 'study')
// 版本更新 // 版本更新
this.updateApp() this.updateApp()
}, },
onShow: function(options) { onShow: function(options) {
console.log("options", options) console.log('options', options)
this.updateOrgId(options) this.updateOrgId(options)
}, },
onHide: function() { onHide: function() {
...@@ -78,14 +80,36 @@ export default { ...@@ -78,14 +80,36 @@ export default {
}, },
// 更新机构ID // 更新机构ID
updateOrgId(options) { updateOrgId(options) {
const orgId = options?.query?.orgId const orgId = options?.query?.orgId
// 需要更新机构ID的场景,详细可参考 https://developers.weixin.qq.com/miniprogram/dev/reference/scene-list.html // 需要更新机构ID的场景,详细可参考 https://developers.weixin.qq.com/miniprogram/dev/reference/scene-list.html
const scene = [1005, 1006, 1011, 1012, 1013, 1026, 1035, 1047, 1048, 1049, 1053, 1058, 1067, 1091, 1145, 1135, 1183, 1017] const scene = [
if (!this.orgId) { // 没有机构ID,更新 1005,
1006,
1011,
1012,
1013,
1026,
1035,
1047,
1048,
1049,
1053,
1058,
1067,
1091,
1145,
1135,
1183,
1017,
]
if (!this.orgId) {
// 没有机构ID,更新
this.$u.vuex('orgId', orgId || -1) this.$u.vuex('orgId', orgId || -1)
} else { } else {
if (scene.includes(options.scene)) { // 如果需要更新机构ID if (scene.includes(options.scene)) {
if (!orgId && options.path === 'pages/index/index') { // 针对重新载入小程序 安卓的query参数会清空 // 如果需要更新机构ID
if (!orgId && options.path === 'pages/index/index') {
// 针对重新载入小程序 安卓的query参数会清空
// 如果没有参数,需要重置为平台的场景 // 如果没有参数,需要重置为平台的场景
const platformScene = [1005, 1006, 1026, 1053, 1145, 1183, 1017] const platformScene = [1005, 1006, 1026, 1053, 1145, 1183, 1017]
if (platformScene.includes(options.scene)) { if (platformScene.includes(options.scene)) {
...@@ -108,7 +132,66 @@ export default { ...@@ -108,7 +132,66 @@ export default {
this.$u.vuex('questionList', {}) this.$u.vuex('questionList', {})
this.$u.vuex('lastIndex', {}) this.$u.vuex('lastIndex', {})
this.$u.vuex('answerCount', {}) this.$u.vuex('answerCount', {})
} },
/* ------------------------- 数据埋点begin ------------------------------ */
track(event, properties) {
if (AnalysysAgent) {
// 易观添加事件
let AnalysysAgent = wx.AnalysysAgent
AnalysysAgent.track('study_' + event, properties)
}
},
profileSet(vm) {
// 设备身份标识
if (AnalysysAgent) {
let profile = vm.$u.deepClone(vm.userInfo)
profile.token = vm.vuex_token
profile.openid = vm.openId
profile.orgid = vm.orgId
AnalysysAgent.profileSet(profile)
}
},
profileAppend(vm) {
if (AnalysysAgent) {
let user = vm.$u.deepClone(vm.userInfo)
user.token = vm.vuex_token
user.openid = vm.openId
// 用户id设置
AnalysysAgent.alias(user.openid + '')
// 用户附加属性
let profile = {
userfrom: '模考大师',
openid: user.openid,
nickName: user.nickName
}
Object.keys(profile).map((key) => {
if (key && profile[key]) {
AnalysysAgent.profileAppend(key, profile[key])
}
})
}
},
share(toShareProperties, trackProperties) {
if (AnalysysAgent) {
AnalysysAgent.share(toShareProperties, trackProperties)
}
},
trackPage(pageName, properties) {
if (AnalysysAgent) {
AnalysysAgent.pageView(pageName, properties)
}
},
initShare(option) {
option = option || {}
if (AnalysysAgent && option.user_id) {
let shareUserInfo = {
share_from_id: option.user_id || '',
share_from_nickname: option.user_name || '',
}
AnalysysAgent.registerSuperProperties(shareUserInfo)
}
},
/* ------------------------- 数据埋点end ------------------------------ */
}, },
} }
</script> </script>
......
import AnalysysAgent from '@/libs/AnalysysAgent_WX_SDK.custom.min.js'
/**
* 易观方舟
* @param appkey 易观平台应用key
* @param debugMode 读取evn文件配置
* 0 关闭调试模式(默认)。类型:Number。
* 1 开启调试模式,数据不入库。类型:Number。
* 2 开启调试模式,数据入库。类型:Number。
* @param autoTrack 自动跟踪
* @param uploadURL 跟踪地址
*
*/
const argo = {
appkey: '5f2ac5996f36c714',
debugMode: process.uniEnv.argoDebugMode,
autoTrack: true,
uploadURL: 'https://argo.banshouhui.com/',
}
if (AnalysysAgent) {
AnalysysAgent.identify(AnalysysAgent.getDistinctId())
AnalysysAgent.appkey = argo.appkey //设置您的APPKEY
AnalysysAgent.debugMode = argo.debugMode
AnalysysAgent.uploadURL = argo.uploadURL
// AnalysysAgent.autoShare = true
AnalysysAgent.allowTimeCheck = true
AnalysysAgent.autoTrack = true
AnalysysAgent.registerSuperProperty('platform', 'study')
}
export { AnalysysAgent }
This diff is collapsed.
This diff is collapsed.
...@@ -59,6 +59,7 @@ export default { ...@@ -59,6 +59,7 @@ export default {
} }
}, },
onLoad: function() { onLoad: function() {
getApp().trackPage('证书详情')
this.formatDataByType() this.formatDataByType()
}, },
computed: { computed: {
......
...@@ -88,6 +88,7 @@ export default { ...@@ -88,6 +88,7 @@ export default {
} }
}, },
onLoad(){ onLoad(){
getApp().trackPage('我的证书详情')
}, },
onShow: function() { onShow: function() {
this.formatDataByType() this.formatDataByType()
......
...@@ -173,6 +173,7 @@ export default { ...@@ -173,6 +173,7 @@ export default {
} }
}, },
onLoad() { onLoad() {
getApp().trackPage('证书查询')
this.checkType = '特种作业操作证查询' this.checkType = '特种作业操作证查询'
}, },
onShow: function(param) { onShow: function(param) {
......
...@@ -262,6 +262,7 @@ export default { ...@@ -262,6 +262,7 @@ export default {
// }, // },
// }, // },
onLoad() { onLoad() {
getApp().trackPage('首页')
if (this.vuex_token) { if (this.vuex_token) {
this.loading = true this.loading = true
// this.getProvinceList() // this.getProvinceList()
......
...@@ -156,6 +156,9 @@ export default { ...@@ -156,6 +156,9 @@ export default {
return { 'font-size': '32rpx', coloe: '#191C27', 'margin-left': '26rpx' } return { 'font-size': '32rpx', coloe: '#191C27', 'margin-left': '26rpx' }
}, },
}, },
onLoad() {
getApp().trackPage('我的')
},
onShow() { onShow() {
if (this.userInfo.nickName) { if (this.userInfo.nickName) {
this.$u.api.getUserInfo().then((res) => { this.$u.api.getUserInfo().then((res) => {
......
...@@ -72,6 +72,7 @@ export default { ...@@ -72,6 +72,7 @@ export default {
}, },
}, },
onLoad(e) { onLoad(e) {
getApp().trackPage('选择题库')
this.getPageInfo() this.getPageInfo()
}, },
methods: { methods: {
......
...@@ -288,6 +288,7 @@ export default { ...@@ -288,6 +288,7 @@ export default {
this.title = '错题记录' this.title = '错题记录'
} }
getApp().trackPage(this.title)
this.init() this.init()
}, },
methods: { methods: {
......
This diff is collapsed.
...@@ -79,6 +79,7 @@ export default { ...@@ -79,6 +79,7 @@ export default {
}, },
}, },
onLoad() { onLoad() {
getApp().trackPage('模拟考试开始')
this.init() this.init()
}, },
methods: { methods: {
......
...@@ -88,6 +88,7 @@ export default { ...@@ -88,6 +88,7 @@ export default {
// if (e && e.relationId) { // if (e && e.relationId) {
// this.relationId = e.relationId // this.relationId = e.relationId
// } // }
getApp().trackPage('绑定题库')
if (e && e.realPrice) { if (e && e.realPrice) {
this.realPrice = e.realPrice this.realPrice = e.realPrice
} }
......
...@@ -63,6 +63,7 @@ export default { ...@@ -63,6 +63,7 @@ export default {
}, },
}, },
onLoad(e) { onLoad(e) {
getApp().trackPage('绑定试题')
if (e && e.code) { if (e && e.code) {
var code = e.code var code = e.code
this.param.cardNumber = code.slice(0, 14) this.param.cardNumber = code.slice(0, 14)
......
...@@ -171,7 +171,7 @@ export default { ...@@ -171,7 +171,7 @@ export default {
// if (e && e.relationId) { // if (e && e.relationId) {
// this.relationId = e.relationId // this.relationId = e.relationId
// } // }
getApp().trackPage('题库详情')
if ((e && e.id) || this.questionWarehouseId) { if ((e && e.id) || this.questionWarehouseId) {
this.queryQuestionWarehouseById((e && e.id) || this.questionWarehouseId) this.queryQuestionWarehouseById((e && e.id) || this.questionWarehouseId)
} }
......
...@@ -172,6 +172,7 @@ export default { ...@@ -172,6 +172,7 @@ export default {
}, },
}, },
onLoad(e) { onLoad(e) {
getApp().trackPage('科目设置')
this.getPageInfo() this.getPageInfo()
this.getLocation() this.getLocation()
this.getProvinceList(this.category.id) this.getProvinceList(this.category.id)
......
...@@ -110,6 +110,7 @@ export default { ...@@ -110,6 +110,7 @@ export default {
}, },
}, },
onLoad(e) { onLoad(e) {
getApp().trackPage('手动绑定')
// if (e && e.relationId) { // if (e && e.relationId) {
// this.relationId = e.relationId // this.relationId = e.relationId
// } // }
......
...@@ -209,6 +209,7 @@ export default { ...@@ -209,6 +209,7 @@ export default {
}, },
}, },
onLoad(e) { onLoad(e) {
getApp().trackPage('每日一练')
if (e && e.key) { if (e && e.key) {
this.$nextTick(() => { this.$nextTick(() => {
// setTimeout(() => { // setTimeout(() => {
......
...@@ -191,6 +191,7 @@ export default { ...@@ -191,6 +191,7 @@ export default {
} }
}, },
onLoad(options) { onLoad(options) {
getApp().trackPage('考试成绩')
if (options) { if (options) {
this.id = options.id this.id = options.id
} else { } else {
......
...@@ -94,6 +94,7 @@ export default { ...@@ -94,6 +94,7 @@ export default {
}, },
}, },
onLoad(e) { onLoad(e) {
getApp().trackPage('题库选择')
this.loadLabel() // 获取标签 this.loadLabel() // 获取标签
}, },
methods: { methods: {
......
...@@ -78,6 +78,7 @@ export default { ...@@ -78,6 +78,7 @@ export default {
}, },
}, },
onLoad(e) { onLoad(e) {
getApp().trackPage('已选题库列表')
this.getPageInfo() this.getPageInfo()
}, },
methods: { methods: {
......
...@@ -68,6 +68,7 @@ export default { ...@@ -68,6 +68,7 @@ export default {
}, },
}, },
onLoad(e) { onLoad(e) {
getApp().trackPage('已选题库')
this.loadList() // 获取已选题库列表 this.loadList() // 获取已选题库列表
}, },
methods: { methods: {
......
...@@ -59,6 +59,7 @@ export default { ...@@ -59,6 +59,7 @@ export default {
}, },
}, },
onLoad(e) { onLoad(e) {
getApp().trackPage('绑定试题')
if (e & e.result) { if (e & e.result) {
this.computed = e.result this.computed = e.result
} }
......
...@@ -44,6 +44,7 @@ export default { ...@@ -44,6 +44,7 @@ export default {
}, },
}, },
onLoad(params) { onLoad(params) {
getApp().trackPage('登录')
if (params && params.path) { if (params && params.path) {
this.returnUrl = decodeURIComponent(params.path) this.returnUrl = decodeURIComponent(params.path)
} }
......
...@@ -44,6 +44,7 @@ export default { ...@@ -44,6 +44,7 @@ export default {
} }
}, },
onLoad() { onLoad() {
getApp().trackPage('我的题库')
this.getUserQuestionWareHouseList() this.getUserQuestionWareHouseList()
}, },
methods: { methods: {
......
...@@ -118,6 +118,7 @@ export default { ...@@ -118,6 +118,7 @@ export default {
}, },
}, },
onLoad() { onLoad() {
getApp().trackPage('实名认证')
this.student = getApp().globalData.student this.student = getApp().globalData.student
this.qiToken = getApp().globalData.qiNiuToken this.qiToken = getApp().globalData.qiNiuToken
}, },
......
...@@ -36,6 +36,7 @@ export default { ...@@ -36,6 +36,7 @@ export default {
}, },
computed: {}, computed: {},
onLoad() { onLoad() {
getApp().trackPage('工作单位')
this.student = getApp().globalData.student this.student = getApp().globalData.student
if (this.student.workUnit == '' || !this.student.workUnit) { if (this.student.workUnit == '' || !this.student.workUnit) {
this.isNotSet = true this.isNotSet = true
......
...@@ -32,6 +32,9 @@ export default { ...@@ -32,6 +32,9 @@ export default {
erweima: process.uniEnv.qn_base_url + 'kefuerweima@2x.png', erweima: process.uniEnv.qn_base_url + 'kefuerweima@2x.png',
} }
}, },
onLoad() {
getApp().trackPage('联系客服')
}
} }
</script> </script>
......
...@@ -43,10 +43,10 @@ ...@@ -43,10 +43,10 @@
style=" style="
background: none; background: none;
font-size: 26rpx; font-size: 26rpx;
padding-right: 0; padding-left: 0;
padding-right: 0; padding-right: 0;
text-align: right; text-align: right;
width: 300rpx; width: 550rpx;
height: 150rpx;" height: 150rpx;"
> >
<text v-if="getMobile" class="fill-value">{{ getMobile }}</text> <text v-if="getMobile" class="fill-value">{{ getMobile }}</text>
...@@ -117,6 +117,7 @@ export default { ...@@ -117,6 +117,7 @@ export default {
}, },
}, },
onLoad() { onLoad() {
getApp().trackPage('我的信息')
this.refleshCode() this.refleshCode()
this.$u.api.getQiNiuToken({ bucketName: 'wsy-exam' }).then((res) => { this.$u.api.getQiNiuToken({ bucketName: 'wsy-exam' }).then((res) => {
this.qiToken = res this.qiToken = res
......
...@@ -21,7 +21,9 @@ export default { ...@@ -21,7 +21,9 @@ export default {
} }
}, },
computed: {}, computed: {},
onLoad() {}, onLoad() {
getApp().trackPage('设置')
},
methods: { methods: {
upgrade: function() { upgrade: function() {
let that = this let that = this
......
...@@ -74,6 +74,7 @@ export default { ...@@ -74,6 +74,7 @@ export default {
} }
}, },
onLoad(e) { onLoad(e) {
getApp().trackPage('搜索结果')
this.keyword = e ? decodeURIComponent(e.keyword) : '' this.keyword = e ? decodeURIComponent(e.keyword) : ''
setList([]) setList([])
this.lists = getList() this.lists = getList()
......
...@@ -59,6 +59,9 @@ export default { ...@@ -59,6 +59,9 @@ export default {
return this.searchHistory return this.searchHistory
} }
}, },
onLoad() {
getApp().trackPage('搜索')
},
methods: { methods: {
search(val) { search(val) {
if (val){ if (val){
......
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