Commit 0ec66805 authored by 高铭波's avatar 高铭波

Merge branch 'master' of git.banshouhui.com:wuzhenzhe/study

parents 83b5dff9 af75a3fb
;(function() { ;(function() {
let NODE_ENV = 'prod' // dev:开发环境 | test:测试环境 | prod:生产环境 let NODE_ENV = 'prod' // dev:开发环境 | test:测试环境 | prod:生产环境
let ENV_VAR = null let ENV_VAR = null
let VERSION = 'v1.2.0' let VERSION = 'v1.3.5'
if (process.env.NODE_ENV === 'development') { if (process.env.NODE_ENV === 'development') {
if (NODE_ENV === 'dev') { if (NODE_ENV === 'dev') {
ENV_VAR = require('./.env.dev.js') ENV_VAR = require('./.env.dev.js')
......
<script> <script>
import './../.env.js' import './../.env.js'
import { AnalysysAgent } from '@/common/analysys_paas.js' // import { AnalysysAgent } from '@/common/analysys_paas.js'
export default { export default {
globalData: { globalData: {
// 开发环境 // 开发环境
...@@ -8,7 +8,7 @@ export default { ...@@ -8,7 +8,7 @@ export default {
questionList: [], questionList: [],
}, },
onLaunch: function(options) { onLaunch: function(options) {
AnalysysAgent.registerSuperProperty('platform', 'study') // AnalysysAgent.registerSuperProperty('platform', 'study')
// 版本更新 // 版本更新
this.updateApp() this.updateApp()
}, },
...@@ -134,53 +134,53 @@ export default { ...@@ -134,53 +134,53 @@ export default {
this.$u.vuex('answerCount', {}) this.$u.vuex('answerCount', {})
}, },
/* ------------------------- 数据埋点begin ------------------------------ */ /* ------------------------- 数据埋点begin ------------------------------ */
track(event, properties) { // track(event, properties) {
if (AnalysysAgent) { // if (AnalysysAgent) {
// 易观添加事件 // // 易观添加事件
let AnalysysAgent = wx.AnalysysAgent // let AnalysysAgent = wx.AnalysysAgent
AnalysysAgent.track('study_' + event, properties) // AnalysysAgent.track('study_' + event, properties)
} // }
}, // },
profileSet(vm) { // profileSet(vm) {
// 设备身份标识 // // 设备身份标识
if (AnalysysAgent) { // if (AnalysysAgent) {
let profile = vm.$u.deepClone(vm.userInfo) // let profile = vm.$u.deepClone(vm.userInfo)
profile.token = vm.vuex_token // profile.token = vm.vuex_token
profile.openId = vm.openId // profile.openId = vm.openId
profile.orgId = vm.orgId // profile.orgId = vm.orgId
AnalysysAgent.profileSet(profile) // AnalysysAgent.profileSet(profile)
} // }
}, // },
profileAppend(vm) { // profileAppend(vm) {
if (AnalysysAgent) { // if (AnalysysAgent) {
let user = vm.$u.deepClone(vm.userInfo) // let user = vm.$u.deepClone(vm.userInfo)
user.token = vm.vuex_token // user.token = vm.vuex_token
user.openId = vm.openId // user.openId = vm.openId
// 用户id设置 // // 用户id设置
AnalysysAgent.alias(user.openid + '') // AnalysysAgent.alias(user.openid + '')
// 用户附加属性 // // 用户附加属性
let profile = { // let profile = {
userfrom: '模考大师', // userfrom: '模考大师',
openId: user.openid, // openId: user.openid,
nickName: user.nickName // nickName: user.nickName
} // }
Object.keys(profile).map((key) => { // Object.keys(profile).map((key) => {
if (key && profile[key]) { // if (key && profile[key]) {
AnalysysAgent.profileAppend(key, profile[key]) // AnalysysAgent.profileAppend(key, profile[key])
} // }
}) // })
} // }
}, // },
share(toShareProperties, trackProperties) { // share(toShareProperties, trackProperties) {
if (AnalysysAgent) { // if (AnalysysAgent) {
AnalysysAgent.share(toShareProperties, trackProperties) // AnalysysAgent.share(toShareProperties, trackProperties)
} // }
}, // },
trackPage(pageName, properties) { // trackPage(pageName, properties) {
if (AnalysysAgent) { // if (AnalysysAgent) {
AnalysysAgent.pageView(pageName, properties) // AnalysysAgent.pageView(pageName, properties)
} // }
} // }
/* ------------------------- 数据埋点end ------------------------------ */ /* ------------------------- 数据埋点end ------------------------------ */
}, },
} }
......
...@@ -3,13 +3,13 @@ let learnApiFun = function(vm) { ...@@ -3,13 +3,13 @@ let learnApiFun = function(vm) {
let ucenterApiUrl = globalUrl.uUrl let ucenterApiUrl = globalUrl.uUrl
let getQuestion = async (params = {}) => let getQuestion = async (params = {}) =>
await vm.$u.post('/rest/question/query/getQuestion', params) await vm.$u.post('/rest/V2/question/query/getQuestion', params)
let getQuestionTotal = async (params = {}) => let getQuestionTotal = async (params = {}) =>
await vm.$u.post('/rest/question/query/getQuestionTotal', params) await vm.$u.post('/rest/V2/question/query/getQuestionTotal', params)
let answer = async (params = {}) => let answer = async (params = {}) =>
await vm.$u.post('/rest/question/save/answer', params) await vm.$u.post('/rest/V2/question/save/answer', params)
// 获取科目 // 获取科目
let subjectList = async (params = {}) => let subjectList = async (params = {}) =>
await vm.$u.get('/rest/question/query/subjectList', params) await vm.$u.get('/rest/question/query/subjectList', params)
...@@ -62,7 +62,7 @@ let learnApiFun = function(vm) { ...@@ -62,7 +62,7 @@ let learnApiFun = function(vm) {
let applyExam = async (params = {}) => let applyExam = async (params = {}) =>
await vm.$u.get( await vm.$u.get(
`/rest/question/applyExam/${params.questionWarehouseId}/${params.paperId}`, `/rest/V2/question/applyExam/${params.questionWarehouseId}/${params.paperId}`,
params params
) )
...@@ -104,6 +104,36 @@ let learnApiFun = function(vm) { ...@@ -104,6 +104,36 @@ let learnApiFun = function(vm) {
'/rest/question/query/studyRecord/' + questionWarehouseId, '/rest/question/query/studyRecord/' + questionWarehouseId,
params params
) )
// 获取进行中的考试记录
let inProgress = async (params = {}) =>
await vm.$u.get(
'/rest/question/exam/inProgress/' + params.questionWarehouseId
)
// 考试暂存
let examSuspend = async (params = {}) =>
await vm.$u.post(`/rest/question/exam/suspend/${params.id}`, params)
// 重新考试,即取消本次记录
let examCancel = async (params = {}) =>
await vm.$u.post(`/rest/question/exam/cancel/${params.id}`, params)
// 提交问卷
let submitSurvey = async (params = {}) =>
await vm.$u.post('/rest/survey/submit/survey', params)
// 领取奖励
let receiveAward = async (params = {}) =>
await vm.$u.post('/rest/reward/receive/award', params)
// 获取问卷回答状态
// let answerStatus = async (params = {}) =>
// await vm.$u.get('/rest/survey/answer/status', params)
//
let getAdvertisementList = async (params = {}) =>
await vm.$u.get('/rest/ad/config/1', params)
const learnApi = { const learnApi = {
getQuestion, getQuestion,
getQuestionTotal, getQuestionTotal,
...@@ -128,6 +158,13 @@ let learnApiFun = function(vm) { ...@@ -128,6 +158,13 @@ let learnApiFun = function(vm) {
checkGetQuestion, checkGetQuestion,
everyTaskList, everyTaskList,
studyRecord, studyRecord,
inProgress,
examSuspend,
examCancel,
submitSurvey,
receiveAward,
// answerStatus
getAdvertisementList
} }
return learnApi return learnApi
} }
......
<template>
<view class="wrap">
<u-swiper :list="list" name="subjectUrl" @click="handleClick" height="180" border-radius="16" :mode="mode"></u-swiper>
</view>
</template>
<script>
export default {
props: {
list: {
type: Array,
default() {
return []
},
},
},
data() {
return {
}
},
created() {
this.loadList()
},
computed: {
mode() {
return this.list.length > 1 ? 'round' : 'none'
}
},
methods: {
loadList() {
// this.$u.api
// .queryQuestionWarehouseById()
// .then((res) => {
// this.list = res.data
// })
// .catch((err) => {
// console.log(err)
// })
},
handleClick(index) {
console.log(index)
this.$emit('click', this.list[index])
}
}
}
</script>
<style lang="scss" scoped>
.wrap {
}
</style>
\ No newline at end of file
...@@ -11,11 +11,11 @@ ...@@ -11,11 +11,11 @@
</view> </view>
<view <view
v-else v-else
:class="[rightKey.includes(item.sort) ? 'success' : 'error']" :class="[data.rightKey.includes(item.sort) ? 'success' : 'error']"
></view> ></view>
<view class="text">{{ item.text }}</view> <view class="text">{{ item.text }}</view>
</view> </view>
<view class="btn" v-if="rightKey.length > 1 && btnStatus"> <view class="btn" v-if="data.rightKey.length > 1 && btnStatus">
<view <view
:class="['confirm', { active: getCheckedNum }]" :class="['confirm', { active: getCheckedNum }]"
@click="confirmMultiple" @click="confirmMultiple"
...@@ -43,22 +43,28 @@ const equar = (a, b) => { ...@@ -43,22 +43,28 @@ const equar = (a, b) => {
export default { export default {
name: 'answerSheet', name: 'answerSheet',
props: { props: {
answerList: { data: {
type: Array, type: Object,
default: [], default() {
}, return {}
multiple: { }
type: Boolean,
default: false,
},
rightKey: {
type: Array,
default: [],
},
submitStatus: {
type: Boolean,
default: false,
}, },
// answerList: {
// type: Array,
// default: [],
// },
// multiple: {
// type: Boolean,
// default: false,
// },
// rightKey: {
// type: Array,
// default: [],
// },
// submitStatus: {
// type: Boolean,
// default: false,
// },
btnStatus: { btnStatus: {
type: Boolean, type: Boolean,
default: true, default: true,
...@@ -73,7 +79,7 @@ export default { ...@@ -73,7 +79,7 @@ export default {
} }
}, },
watch: { watch: {
answerList: { 'data.answerList': {
handler: function(newValue, oldValue) { handler: function(newValue, oldValue) {
if (newValue.length > 0) { if (newValue.length > 0) {
this.lists = newValue this.lists = newValue
...@@ -86,18 +92,21 @@ export default { ...@@ -86,18 +92,21 @@ export default {
getCheckedNum() { getCheckedNum() {
const num = this.lists.filter((v) => v.checked) const num = this.lists.filter((v) => v.checked)
return num.length > 1 ? true : false return num.length > 1 ? true : false
} },
multiple() {
return this.data.type == 3
},
}, },
methods: { methods: {
select(index) { select(index) {
// 已选定 // 已选定
if (this.submitStatus) return if (this.data.submitStatus) return
if (!this.multiple) { if (!this.multiple) {
// 非多选处理 // 非多选处理
this.lists.forEach((v) => { this.lists.forEach((v) => {
v.checked = false // 勾选 v.checked = false // 勾选
v.confirm = false // 确认答案 v.confirm = false // 确认答案
if (this.rightKey.includes(v.sort)) { if (this.data.rightKey.includes(v.sort)) {
this.$set(v, 'checked', true) this.$set(v, 'checked', true)
this.$set(v, 'confirm', true) this.$set(v, 'confirm', true)
} }
...@@ -106,7 +115,7 @@ export default { ...@@ -106,7 +115,7 @@ export default {
// 用户选的答案 // 用户选的答案
this.userAnswer = this.lists[index].sort this.userAnswer = this.lists[index].sort
// 判断所选答案是否正确 // 判断所选答案是否正确
this.answer = this.rightKey.includes(this.lists[index].sort) this.answer = this.data.rightKey.includes(this.lists[index].sort)
? 'pass' ? 'pass'
: 'fail' : 'fail'
} }
...@@ -117,6 +126,7 @@ export default { ...@@ -117,6 +126,7 @@ export default {
}, },
// 多选提交答案 // 多选提交答案
confirmMultiple() { confirmMultiple() {
if (this.data.submitStatus) return
const num = this.lists.filter((v) => v.checked) const num = this.lists.filter((v) => v.checked)
if (num.length > 1) { if (num.length > 1) {
// 判断所选答案是否正确 // 判断所选答案是否正确
...@@ -124,11 +134,11 @@ export default { ...@@ -124,11 +134,11 @@ export default {
// 用户选的答案 // 用户选的答案
this.userAnswer = checkedList.join(',') this.userAnswer = checkedList.join(',')
// 判断所选答案是否正确 // 判断所选答案是否正确
this.answer = equar(checkedList, this.rightKey) ? 'pass' : 'fail' this.answer = equar(checkedList, this.data.rightKey) ? 'pass' : 'fail'
// 处理显示逻辑 // 处理显示逻辑
this.lists.forEach((v) => { this.lists.forEach((v) => {
if (v.checked) this.$set(v, 'confirm', true) if (v.checked) this.$set(v, 'confirm', true)
if (this.rightKey.includes(v.sort)) this.$set(v, 'checked', true) if (this.data.rightKey.includes(v.sort)) this.$set(v, 'checked', true)
}) })
this.submitAnswer() this.submitAnswer()
} }
......
...@@ -43,7 +43,6 @@ export default { ...@@ -43,7 +43,6 @@ export default {
}, },
methods: { methods: {
handleClick() { handleClick() {
console.log('--------------')
this.$emit('update:show', false) this.$emit('update:show', false)
this.$emit('click') this.$emit('click')
}, },
......
<template> <template>
<view class="question-bank-cell"> <view class="question-cell">
<view class="label-normal"> <image
<view class="title-view">{{ info.label || info.title }}</view> v-if="beSelected"
<view class="type-view" v-if="!isAdd">{{ class="selected-image"
provinceName + '-' + examTypeText :src="yixuanzetikuleImage"
}}</view> ></image>
<view class="label-text"> <view
共 :class="[
<text class="label-blue">{{ info.number || 0 }}</text 'question-bank-cell',
>道精编试题,通过率 { 'selet-type': isSelect },
<text class="label-blue">{{ info.version || info.key }}</text> { selected: beSelected },
]"
@click="handleClickCell"
>
<view class="label-normal">
<view class="title-view">{{
questionData.label || questionData.title
}}</view>
<view class="type-view" v-if="!isAdd"
><text>{{ provinceName + '-' + examTypeText }}</text
><text :style="statusData.statusStyle">{{
'(' + statusData.status + ')'
}}</text></view
>
<view class="label-text">
共
<text class="label-blue">{{
questionData.number || questionData.questionCount || 0
}}</text
>道精编试题,通过率
<text class="label-blue">{{
questionData.version || questionData.key
}}</text>
</view>
</view> </view>
<u-button
v-if="!isNone"
:customStyle="buttonStyle"
@click.stop="handleClick(index)"
type="primary"
>
<u-icon v-if="isAdd" class="button-icon" name="plus"></u-icon
>{{ buttonText }}
</u-button>
</view> </view>
<u-button
v-if="!isNone"
:customStyle="buttonStyle"
@click="handleClick(index)"
type="primary"
>
<u-icon v-if="isAdd" class="button-icon" name="plus"></u-icon
>{{ buttonText }}
</u-button>
</view> </view>
</template> </template>
...@@ -38,27 +61,41 @@ export default { ...@@ -38,27 +61,41 @@ export default {
return {} return {}
}, },
}, },
beSelected: {
type: Boolean,
default: false,
},
}, },
data() { data() {
return {} return {}
}, },
computed: { computed: {
questionData() {
return (this.isAdd ? this.info : this.info && this.info.echoMap && this.info.echoMap.questionWarehouseId) || {}
},
examTypeText() { examTypeText() {
var str = this.info.echoMap && this.info.echoMap.type var str = this.questionData.echoMap && this.questionData.echoMap.type
return str || '' return str || ''
}, },
provinceName() { provinceName() {
var str = var str =
this.info.echoMap && this.questionData.echoMap &&
this.info.echoMap.provinceId && this.questionData.echoMap.provinceId &&
this.info.echoMap.provinceId.fullName this.questionData.echoMap.provinceId.fullName
return str || '' return str || ''
}, },
isAdd() { isAdd() {
return this.type == 'add' return this.type == 'add'
}, },
isSelect() {
return this.type == 'select'
},
isNone() { isNone() {
return this.type == 'none' || this.questionWarehouseId == this.info.id return (
this.type == 'none' ||
this.isSelect ||
this.questionWarehouseId == this.questionData.id
)
}, },
buttonText() { buttonText() {
var text = '' var text = ''
...@@ -85,52 +122,141 @@ export default { ...@@ -85,52 +122,141 @@ export default {
borderRadius: '12rpx', borderRadius: '12rpx',
} }
}, },
statusData() {
var data = { status: '', statusStyle: '', subtitle: '' }
if (
!this.info.echoMap ||
!this.info.echoMap.questionWarehouseId ||
!this.info.echoMap.cardId
) {
data.status = '未激活' // 未绑卡
data.statusStyle = 'color: #9EA5BB'
return data
}
switch (this.info.echoMap.cardId.cardStatus) {
case 0:
break
case 5:
data.status = '已激活' // 绑卡未激活
data.statusStyle = 'color: #2953FF'
break
case 10:
data.statusStyle = 'color: #2953FF'
let leaveDay = 0
if (
this.info.echoMap.cardId &&
this.info.echoMap.cardId.activationTime
) {
let diff = this.datedifference(
this.info.echoMap.cardId.activationTime.split(' ')[0],
this.getTodayDate()
)
leaveDay = this.info.echoMap.cardId.effectiveDay - diff
leaveDay = leaveDay > 0 ? leaveDay : 0
}
data.status = leaveDay + '天后到期'
break
case 15:
data.status = '已失效'
data.statusStyle = 'color: #9EA5BB'
break
default:
break
}
return data
},
yixuanzetikuleImage() {
return process.uniEnv.qn_base_url + 'yixuanzetikule.png'
},
}, },
methods: { methods: {
handleClick() { handleClick() {
this.$emit('action', this.info, this.type) this.$emit('action', this.questionData, this.type)
},
handleClickCell() {
this.$emit('click', this.questionData, this.info.echoMap && this.info.echoMap.cardId, this.info.echoMap && this.info.echoMap.institutionId)
},
getTodayDate() {
let day = new Date()
day.setTime(day.getTime())
let m = day.getMonth() + 1
let d = day.getDate()
return (
day.getFullYear() +
'-' +
(String(m).length < 2 ? '0' + m : m) +
'-' +
(String(d).length < 2 ? '0' + d : d)
)
},
datedifference(sDate1, sDate2) {
//2021-01-01,2020-02-01,31
var dateSpan, tempDate, iDays
sDate1 = Date.parse(sDate1)
sDate2 = Date.parse(sDate2)
dateSpan = sDate2 - sDate1
dateSpan = Math.abs(dateSpan)
iDays = Math.floor(dateSpan / (24 * 3600 * 1000))
return iDays
}, },
}, },
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.question-bank-cell { .question-cell {
padding: 40rpx 24rpx 40rpx 30rpx; position: relative;
background-color: #ffffff; .selected-image {
border-radius: 12rpx; position: absolute;
display: flex; width: 54rpx;
justify-content: space-between; height: 62rpx;
align-items: center; bottom: 0;
.label-normal { right: 0;
width: 470rpx; }
word-break: break-all; .question-bank-cell {
.title-view { padding: 30rpx 24rpx 32rpx 30rpx;
font-size: 36rpx; background-color: #ffffff;
color: #191c27; border-radius: 12rpx;
font-weight: bold; display: flex;
margin-bottom: 12rpx; justify-content: space-between;
align-items: center;
&.selet-type {
background-color: #f7f9fc;
border: 1px solid #f7f9fc;
} }
.type-view { &.selected {
font-size: 28rpx; border: 1px solid #2953ff;
color: #5a6073;
font-weight: bold;
} }
.label-text { .label-normal {
margin-top: 12rpx; width: 470rpx;
font-size: 26rpx; word-break: break-all;
color: #5a6073; .title-view {
.label-blue { font-size: 36rpx;
color: #2953ff; color: #191c27;
padding-left: 6rpx; font-weight: bold;
padding-right: 6rpx; margin-bottom: 14rpx;
}
.type-view {
font-size: 28rpx;
color: #5a6073;
font-weight: bold;
}
.label-text {
margin-top: 14rpx;
font-size: 26rpx;
color: #5a6073;
.label-blue {
color: #2953ff;
padding-left: 6rpx;
padding-right: 6rpx;
}
} }
} }
} .button-icon {
.button-icon { margin-right: 4rpx;
margin-right: 4rpx; font-size: 28rpx;
font-size: 28rpx; font-weight: bold;
font-weight: bold; }
} }
} }
</style> </style>
...@@ -14,10 +14,7 @@ ...@@ -14,10 +14,7 @@
<view class="content"> <view class="content">
<answer-sheet <answer-sheet
ref="answerSheet" ref="answerSheet"
:answerList="item.answerList" :data="item"
:rightKey="item.rightKey"
:multiple="item.type === 3"
:submitStatus="item.submitStatus"
:btnStatus="false" :btnStatus="false"
@change="answerChange" @change="answerChange"
></answer-sheet> ></answer-sheet>
......
...@@ -13,10 +13,7 @@ ...@@ -13,10 +13,7 @@
<view class="content" v-if="item.answerList"> <view class="content" v-if="item.answerList">
<answer-sheet <answer-sheet
ref="answerSheet" ref="answerSheet"
:answerList="item.answerList" :data="item"
:rightKey="item.rightKey"
:multiple="item.type === 3"
:submitStatus="item.submitStatus"
@change="answerChange" @change="answerChange"
></answer-sheet> ></answer-sheet>
</view> </view>
...@@ -219,7 +216,7 @@ export default { ...@@ -219,7 +216,7 @@ export default {
let realIndex = list.findIndex(item => item.index == defaultIndex) let realIndex = list.findIndex(item => item.index == defaultIndex)
let currentItem = list[realIndex] let currentItem = list[realIndex]
let swiperList = [] let swiperList = []
swiperList[current] = currentItem swiperList[current] = this.initItem(currentItem)
swiperList[this.getLastSwiperChangeIndex(current)] = this.getLastSwiperNeedItem(currentItem, list) swiperList[this.getLastSwiperChangeIndex(current)] = this.getLastSwiperNeedItem(currentItem, list)
swiperList[this.getNextSwiperChangeIndex(current)] = this.getNextSwiperNeedItem(currentItem, list) swiperList[this.getNextSwiperChangeIndex(current)] = this.getNextSwiperNeedItem(currentItem, list)
console.log("swiperList", swiperList) console.log("swiperList", swiperList)
...@@ -246,7 +243,7 @@ export default { ...@@ -246,7 +243,7 @@ export default {
let realIndex = list.findIndex(item => item.index == listNeedIndex) let realIndex = list.findIndex(item => item.index == listNeedIndex)
if (realIndex == -1) return null if (realIndex == -1) return null
let item = listNeedIndex == -1 ? null : list[realIndex] let item = listNeedIndex == -1 ? null : list[realIndex]
return item return this.initItem(item)
}, },
/** /**
* 获取下一个要替换的list中的item * 获取下一个要替换的list中的item
...@@ -258,7 +255,24 @@ export default { ...@@ -258,7 +255,24 @@ export default {
if (realIndex == -1) return null if (realIndex == -1) return null
let total = this.total != 0 ? this.total : list.length let total = this.total != 0 ? this.total : list.length
let item = listNeedIndex == total ? null : list[realIndex] let item = listNeedIndex == total ? null : list[realIndex]
return item
return this.initItem(item)
},
initItem(data) {
if (this.type === 2 && data.userAnswer && !data.submitStatus) {
data.submitStatus = true,
data.result = data.userAnswer == data.answer ? 'pass' : 'fail'
data.errShow = true
let userAnswers = data.userAnswer.split(',')
let answers = data.answer.split(',')
for (var item of data.answerList) {
if (userAnswers.indexOf(item.sort) != -1 || answers.indexOf(item.sort) != -1) {
item.checked = true
item.confirm = true
}
}
}
return data
} }
}, },
} }
......
...@@ -13,17 +13,20 @@ ...@@ -13,17 +13,20 @@
mode="widthFix" mode="widthFix"
></image> ></image>
<view class="toast-pop"> <view class="toast-pop">
<u-icon class="close-icon" name="close" @click="handleClose"></u-icon>
<view class="pop-title"> <view class="pop-title">
<text>{{ title }}</text> <text>{{ title }}</text>
</view> </view>
<view class="pop-message"> <view class="pop-message">
<text>{{ message }}</text> <text>{{ messages[0] }}</text>
<text v-if="isPause" class="message-count">{{data.answered}}</text>
<text v-if="messages[1]">{{ messages[1] }}</text>
</view> </view>
<view class="pop-btn-view"> <view class="pop-btn-view">
<view class="line-view"> </view> <view class="line-view"> </view>
<view class="content-view"> <view class="content-view">
<view class="cancel-button" @click="handleClickCancel"> <view class="cancel-button" @click="handleClickCancel">
取消 {{ cancelText }}
</view> </view>
<view class="line-view-v" /> <view class="line-view-v" />
<view class="sure-button" @click="$u.throttle(handleClickSure, 500)"> <view class="sure-button" @click="$u.throttle(handleClickSure, 500)">
...@@ -51,6 +54,10 @@ export default { ...@@ -51,6 +54,10 @@ export default {
type: String, type: String,
default: 'select', default: 'select',
}, },
data: {
noStart: 0,
answered: 0
}
}, },
data() { data() {
return {} return {}
...@@ -59,20 +66,36 @@ export default { ...@@ -59,20 +66,36 @@ export default {
tanchuangdingbuImage() { tanchuangdingbuImage() {
return process.uniEnv.qn_base_url + 'tanchuangdingbu.png' return process.uniEnv.qn_base_url + 'tanchuangdingbu.png'
}, },
message() { messages() {
switch (this.type) { switch (this.type) {
case 'select': case 'select':
return '为了您能更好的使用“模考大师”小程序请先选择题库' return ['为了您能更好的使用“模考大师”小程序请先选择题库']
case 'bound': case 'bound':
return '为了您能更好的使用“模考大师”小程序请去绑定用户卡' return ['为了您能更好的使用“模考大师”小程序请去绑定用户卡']
case 'pause':
return ['您已回答 ', ' 题,剩余 ' + this.data.noStart + ' 题']
} }
}, },
isPause() {
return this.type == 'pause'
},
buttonText() { buttonText() {
switch (this.type) { switch (this.type) {
case 'select': case 'select':
return '去选择' return '去选择'
case 'bound': case 'bound':
return '去绑定' return '去绑定'
case 'pause':
return '保存并退出'
}
},
cancelText() {
switch (this.type) {
case 'select':
case 'bound':
return '取消'
case 'pause':
return '重新开始'
} }
}, },
customStyleCancel() { customStyleCancel() {
...@@ -107,6 +130,9 @@ export default { ...@@ -107,6 +130,9 @@ export default {
this.changeVisibleValue(false) this.changeVisibleValue(false)
this.$emit('click', this.type) this.$emit('click', this.type)
}, },
handleClose() {
this.changeVisibleValue(false)
}
}, },
} }
</script> </script>
...@@ -120,11 +146,18 @@ export default { ...@@ -120,11 +146,18 @@ export default {
} }
.toast-pop { .toast-pop {
min-height: 480rpx; min-height: 480rpx;
overflow: hidden;
position: relative; position: relative;
// background-image: linear-gradient(to top, #ffffff 0%, #e9f3ff 50%); // background-image: linear-gradient(to top, #ffffff 0%, #e9f3ff 50%);
// background-size: 100% 240rpx; // background-size: 100% 240rpx;
// background-repeat: no-repeat; // background-repeat: no-repeat;
text-align: center; text-align: center;
.close-icon {
top: 30rpx;
right: 30rpx;
position: absolute;
font-size: 32rpx;
}
.pop-title { .pop-title {
font-size: 40rpx; font-size: 40rpx;
text-align: center; text-align: center;
...@@ -138,6 +171,9 @@ export default { ...@@ -138,6 +171,9 @@ export default {
color: #191c27; color: #191c27;
font-weight: bold; font-weight: bold;
padding: 90rpx 30rpx 80rpx 30rpx; padding: 90rpx 30rpx 80rpx 30rpx;
.message-count {
color: #2953FF;
}
} }
.pop-btn-view { .pop-btn-view {
......
...@@ -70,6 +70,43 @@ ...@@ -70,6 +70,43 @@
} }
] ]
}, },
{
"root": "pages/advertisement",
"pages": [
{
"path": "questionnaire",
"name": "questionnaire",
"style": {
"navigationBarTitleText": "调查问卷",
"navigationStyle": "custom",
"disableScroll": true
}
},
{
"path": "results",
"name": "results",
"style": {
"navigationBarTitleText": "领取奖励",
"navigationStyle": "custom",
"disableScroll": true
}
}
]
},
{
"root": "pages/web",
"pages": [
{
"path": "index",
"name": "webview",
"style": {
"navigationBarTitleText": "网页",
"navigationStyle": "custom",
"disableScroll": true
}
}
]
},
{ {
"root": "pages/learn", "root": "pages/learn",
"pages": [ "pages": [
......
<template>
<view class="questionnaire">
<u-navbar
back-icon-color="#FFFFFF"
background="transparent"
title=" "
titleColor="#FFFFFF"
:border-bottom="false"
title-bold
></u-navbar>
<image class="background-image" :src="wenjuandatiImage" mode="widthFix"></image>
<!-- 问卷题目 -->
<view class="body-view">
<view v-for="(item, index) in list" :key="index">
<!-- 选有计划才展示第三个选项 -->
<template v-if="index != 2 || bePlanning">
<view class="question-title">{{ item.title }}</view>
<view class="question-content">
<view
v-for="(answer, i) in item.answerList"
:key="i"
:class="['item-view', { active: answer.checked }]"
>
<u-checkbox
icon-size="24"
label-size="28"
size="36"
v-model="answer.checked"
@change="handleChange($event, index, i)"
shape="circle"
>
{{ answer.text }}</u-checkbox
>
</view>
</view>
</template>
</view>
</view>
<!-- 底部按钮 -->
<view class="bottom-view">
<u-button
:customStyle="buttonStyle"
:loading="loading"
@click="handleClick"
type="primary"
shape="circle"
>
提交
</u-button>
</view>
</view>
</template>
<script>
export default {
data() {
return {
loading: false,
surveyId: 1, // 问卷id
list: [
{
title: '您通过什么渠道了解到模考大师?',
answerList: [
{ text: '抖音/快手', checked: false },
{ text: '培训机构', checked: false },
{ text: '他人推荐', checked: false },
{ text: '其他', checked: false },
],
},
{
title: '您是否需要考取相关证书?',
answerList: [
{ text: '有计划', checked: false },
{ text: '正在考', checked: false },
],
},
{
title: '您是否需要为您推荐培训机构?',
answerList: [
{ text: '需要', checked: false },
{ text: '不需要', checked: false },
],
},
],
}
},
computed: {
wenjuandatiImage() {
return process.uniEnv.qn_base_url + 'wenjuanzhutu.jpg'
},
checked() {
var count = 0
var bePlanning = !this.bePlanning
var i = 0
for (var item of this.list) {
var j = 0
for (var question of item.answerList) {
if (question.checked == true) {
count++
}
j++
}
i ++
if (i == 2 && bePlanning) {
count++
break
}
}
return count >= this.list.length
},
// 选中了有计划
bePlanning() {
return this.list[1].answerList[0].checked
},
buttonStyle() {
return this.checked ? {
height: '104rpx',
backgroundColor: '#2953FF',
color: '#FFFFFF',
fontSize: '32rpx',
fontWeight: 'bold',
} : {
height: '104rpx',
backgroundColor: '#D4D7DF',
color: '#FFFFFF',
fontSize: '32rpx',
fontWeight: 'bold',
}
},
},
onLoad(e) {
// getApp().trackPage('问卷调查')
if (e && e.surveyId) {
this.surveyId = e.surveyId
}
},
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) => {
this.list = res.data
})
.catch((err) => {
console.log(err)
})
},*/
handleChange(event, index, i) {
for (var question of this.list[index].answerList) {
question.checked = false
}
// 没有选中有计划就重置第三项
if (!this.bePlanning) {
for (var question of this.list[2].answerList) {
question.checked = false
}
}
this.list[index].answerList[i].checked = event.value
},
handleClick() {
if (!this.checked) return
this.loading = true
var options = []
var i = 0
for (var item of this.list) {
var data = {questionId: i + 1, questionName: item.title}
for (var question of item.answerList) {
if (question.checked == true) {
data.answer = question.text
}
}
i ++
options.push(data)
}
let params = {
options: options,
surveyId: this.surveyId, // 问卷id
surveyName: "调查小问卷"
}
// let trackParams = {
// openId: this.openId,
// nickname: this.userInfo.nickName,
// ...options
// }
// getApp().track("submitSurvey", trackParams)
this.$u.api
.submitSurvey(params)
.then((res) => {
// this.loading = false
this.$u.route({
url: 'pages/advertisement/results',
type: 'redirectTo',
params: {
surveyId: this.surveyId,
},
})
})
.catch((err) => {
// this.loading = false
console.log(err)
})
},
},
}
</script>
<style lang="scss" scoped>
/deep/ .u-checkbox__label {
width: 300rpx;
padding-left: 80rpx;
height: 104rpx;
display: flex;
align-items: center;
margin-left: -60rpx !important;
}
::-webkit-scrollbar {
width: 0;
height: 0;
color: transparent;
display: none;
}
.questionnaire {
display: flex;
flex-direction: column;
height: 100vh;
position: relative;
background-color: #F7F9FC;
.background-image {
position: absolute;
width: 100%;
}
.body-view {
border-radius: 12rpx;
background-color: #ffffff;
height: 100%;
overflow: auto;
margin: 176rpx 24rpx 30rpx 24rpx;
padding: 30rpx 24rpx;
z-index: 1;
.question-title {
color: #191c27;
font-weight: bold;
font-size: 32rpx;
}
.question-content {
display: flex;
justify-content: space-between;
align-items: center;
flex-wrap: wrap;
margin-bottom: 60rpx;
.item-view {
background-color: #f7f9fc;
border-radius: 12rpx;
color: #5a6073;
width: 316rpx;
height: 104rpx;
border: 1px solid #f7f9fc;
display: flex;
align-items: center;
padding: 24rpx;
margin-top: 32rpx;
&.active {
border: 1px solid #2953ff;
color: #2953ff;
background-color: white;
}
}
}
}
.bottom-view {
padding: 36rpx 24rpx 44rpx 24rpx;
}
}
</style>
<template>
<view class="results-list">
<u-navbar
back-icon-color="#FFFFFF"
background="transparent"
title=" "
titleColor="#FFFFFF"
:border-bottom="false"
title-bold
></u-navbar>
<image
class="background-image"
:src="lingqujiangliImage"
mode="widthFix"
></image>
<view class="results-list-content">
<view v-for="(label, index) in list" :key="index" class="label-item">
<QuestionBankCell
:info="label"
:beSelected="
selectedData.id && (label.echoMap && label.echoMap.questionWarehouseId.id == selectedData.id)
"
type="select"
@click="handleClickCell"
></QuestionBankCell>
</view>
</view>
<view class="bottom-view">
<u-button
:customStyle="buttonStyle"
@click="handleClick"
:loading="loading"
type="primary"
shape="circle"
>
领取10天体验卡
</u-button>
</view>
<view>
<u-toast ref="uToast" />
</view>
</view>
</template>
<script>
import QuestionBankCell from '@/components/question-bank-cell'
export default {
components: {
QuestionBankCell,
},
data() {
return {
list: [], // 已选题库列表
loading: false,
selectedData: {},
cardData: {},
institutionData: {},
surveyId: 1, // 问卷id
}
},
computed: {
lingqujiangliImage() {
return process.uniEnv.qn_base_url + 'lignqufuli.jpg'
},
buttonStyle() {
return this.selected
? {
height: '104rpx',
backgroundColor: '#2953FF',
color: '#FFFFFF',
fontSize: '32rpx',
fontWeight: 'bold',
}
: {
height: '104rpx',
backgroundColor: '#D4D7DF',
color: '#FFFFFF',
fontSize: '32rpx',
fontWeight: 'bold',
}
},
selected() {
return this.selectedData.id > 0
},
type() {
return this.list.length > 1 ? 'change' : 'none'
},
},
onLoad(e) {
// getApp().trackPage('问卷结束-领取奖励')
if (e && e.surveyId) {
this.surveyId = e.surveyId
}
this.loadList() // 获取已选题库列表
},
methods: {
handleClickCell(questionData, cardData, institutionData) {
this.selectedData = questionData
this.cardData = cardData || {}
this.institutionData = institutionData || {}
},
handleClick() {
if (!this.selected) return
this.loading = true
let params = {
questionWarehouseId: this.selectedData.id,
cardId: this.cardData.id,
sourse: 'SURVEY', // 问卷调查
bizId: this.surveyId, // 问卷id
institutionId: this.institutionData.id // 机构id
}
// let trackParams = {
// openId: this.openId,
// nickname: this.userInfo.nickName,
// ...params
// }
// getApp().track("receiveAward", trackParams)
this.$u.api
.receiveAward(params)
.then((res) => {
// this.loading = false
// 切换题库
this.$refs.uToast.show({
title: '您已领取奖励,获得题库10天体验卡',
type: 'success',
duration: 1500,
callback: () => {
this.setPageInfo(this.selectedData)
this.$u.vuex('searchHistory', [])
this.$u.route({
type: 'back',
})
},
})
})
.catch((err) => {
// this.loading = false
console.log(err)
})
},
// 获取题库列表
loadList() {
this.$u.api
.getUserQuestionWareHouse()
.then((res) => {
this.list = res
if (this.list.length == 1) {
this.selectedData = this.list[0].echoMap.questionWarehouseId
this.cardData = this.list[0].echoMap.cardId || {}
this.institutionData = this.list[0].echoMap.institutionData || {}
}
})
.catch((err) => {
console.log(err)
})
},
setPageInfo(info) {
var pages = getCurrentPages()
if (pages.length >= 2) {
var page = pages[pages.length - 2]
page.info = info
}
},
},
}
</script>
<style lang="scss" scoped>
::-webkit-scrollbar {
width: 0;
height: 0;
color: transparent;
display: none;
}
.results-list {
display: flex;
flex-direction: column;
height: 100vh;
position: relative;
background-color: #f7f9fc;
.background-image {
position: absolute;
width: 100%;
}
.results-list-content {
border-radius: 12rpx;
background-color: #ffffff;
height: 100%;
overflow: auto;
margin: 176rpx 24rpx 30rpx 24rpx;
padding: 30rpx 24rpx;
z-index: 1;
.label-item {
margin-bottom: 24rpx;
}
}
.bottom-view {
margin: 0 24rpx 44rpx 24rpx;
.button-icon {
margin-right: 10rpx;
font-size: 46rpx;
font-weight: bold;
}
}
}
</style>
...@@ -59,7 +59,7 @@ export default { ...@@ -59,7 +59,7 @@ export default {
} }
}, },
onLoad: function() { onLoad: function() {
getApp().trackPage('证书详情') // getApp().trackPage('证书详情')
this.formatDataByType() this.formatDataByType()
}, },
computed: { computed: {
......
...@@ -88,7 +88,7 @@ export default { ...@@ -88,7 +88,7 @@ export default {
} }
}, },
onLoad(){ onLoad(){
getApp().trackPage('我的证书详情') // getApp().trackPage('我的证书详情')
}, },
onShow: function() { onShow: function() {
this.formatDataByType() this.formatDataByType()
......
...@@ -173,7 +173,7 @@ export default { ...@@ -173,7 +173,7 @@ export default {
} }
}, },
onLoad() { onLoad() {
getApp().trackPage('证书查询') // getApp().trackPage('证书查询')
this.checkType = '特种作业操作证查询' this.checkType = '特种作业操作证查询'
}, },
onShow: function(param) { onShow: function(param) {
...@@ -223,12 +223,12 @@ export default { ...@@ -223,12 +223,12 @@ export default {
uni.showLoading({ uni.showLoading({
title: '查询中,请稍后', title: '查询中,请稍后',
}) })
let trackParams = { // let trackParams = {
openId: this.openId, // openId: this.openId,
nickname: this.userInfo.nickName, // nickname: this.userInfo.nickName,
...params, // ...params,
} // }
getApp().track('selectCertByIdAndName', trackParams) // getApp().track('selectCertByIdAndName', trackParams)
this.$u.api.getCertFromOut(params).then((res) => { this.$u.api.getCertFromOut(params).then((res) => {
uni.hideLoading() uni.hideLoading()
if(!res){ if(!res){
......
...@@ -25,17 +25,14 @@ ...@@ -25,17 +25,14 @@
</view> </view>
<view v-if="showOrgId">{{ orgIdText }}</view> <view v-if="showOrgId">{{ orgIdText }}</view>
<view v-if="noExam" class="tip-view"> <view v-if="noExam" class="tip-view">
<text>您还未选择题库,请先选择题库</text> <text>您还未选择题库,请点击选择</text>
</view> </view>
<view <view
v-else-if="!info.cardId" v-else-if="!info.cardId"
class="card-tip-view" class="card-tip-view"
@click="$u.throttle(handleSelectTip, 500)" @click="$u.throttle(handleSelectTip, 500)"
> >
题库未激活,请通过<text class="blue-text">“绑卡”</text>或<text 题库未激活,<text class="blue-text">激活</text>后可刷题模考
class="blue-text"
>“购买”</text
>激活
</view> </view>
<view v-else class="detail-view"> <view v-else class="detail-view">
<view <view
...@@ -71,7 +68,7 @@ ...@@ -71,7 +68,7 @@
><text class="left-label" v-if="info.cardId">{{ ><text class="left-label" v-if="info.cardId">{{
item.leftLabel item.leftLabel
}}</text }}</text
><text>{{ item.label }}</text></view ><text :style="item.labelStyle">{{ item.label }}</text></view
> >
</view> </view>
</view> </view>
...@@ -90,7 +87,8 @@ ...@@ -90,7 +87,8 @@
<view>{{ item.title }}</view> <view>{{ item.title }}</view>
</view> </view>
</view> </view>
<view class="bottom-view"> <AdvertisementSwiper v-if="showAdvertisement" :list="advertisementList" @click="handleClickAdvertisement"/>
<view :class="['bottom-view', {'showAdvertisement': showAdvertisement}]">
<image <image
class="bottom-image" class="bottom-image"
:src="slognImage" :src="slognImage"
...@@ -108,12 +106,12 @@ ...@@ -108,12 +106,12 @@
</view> </view>
<MaskTip <MaskTip
:show.sync="showMask" :show.sync="showMask"
imageName="mengceng1.png" imageName="dianjitishi1.png"
:imageStyle="imageStyle0" :imageStyle="imageStyle0"
/> />
<MaskTip <MaskTip
:show.sync="showCountTip" :show.sync="showCountTip"
imageName="mengceng2.png" imageName="dianjitishi4.png"
:imageStyle="imageStyle" :imageStyle="imageStyle"
/> />
</view> </view>
...@@ -124,9 +122,10 @@ import SubjectStatistics from '@/components/subject-statistics' ...@@ -124,9 +122,10 @@ import SubjectStatistics from '@/components/subject-statistics'
import ExperiencePop from '@/components/experience-pop' import ExperiencePop from '@/components/experience-pop'
import ToastPop from '@/components/toast-pop' import ToastPop from '@/components/toast-pop'
import MaskTip from '@/components/mask-tip' import MaskTip from '@/components/mask-tip'
import AdvertisementSwiper from '@/components/advertisement-swiper'
export default { export default {
components: { SubjectStatistics, ExperiencePop, ToastPop, MaskTip }, components: { SubjectStatistics, ExperiencePop, ToastPop, MaskTip, AdvertisementSwiper },
data() { data() {
return { return {
visible: false, // 免费体验弹窗 visible: false, // 免费体验弹窗
...@@ -147,7 +146,9 @@ export default { ...@@ -147,7 +146,9 @@ export default {
tapCount: 0, // 点击底部logo五次,显示机构id tapCount: 0, // 点击底部logo五次,显示机构id
showOrgId: false, // 显示机构id showOrgId: false, // 显示机构id
tipTop: 410, tipTop: 410,
tipTop0: 50, tipTop0: 128,
havingExamination: false, // 有进行中的考试
advertisementList: [], // 广告位
} }
}, },
computed: { computed: {
...@@ -155,7 +156,7 @@ export default { ...@@ -155,7 +156,7 @@ export default {
return this.orgId return this.orgId
}, },
title() { title() {
return this.selected.title || '请选择题库' return this.selected.title || '点击选择题库'
}, },
imageUrl() { imageUrl() {
return '/static/logo.png' return '/static/logo.png'
...@@ -181,8 +182,9 @@ export default { ...@@ -181,8 +182,9 @@ export default {
image: process.uniEnv.qn_base_url + 'quanbushiti.png', image: process.uniEnv.qn_base_url + 'quanbushiti.png',
}, },
{ {
name: '模拟考试', name: this.havingExamination ? '继续考试' : '模拟考试',
label: '真题模拟强化', label: this.havingExamination ? '有考试未完成' : '真题模拟强化',
labelStyle: this.havingExamination ? 'color: #FA5A49' : '',
image: process.uniEnv.qn_base_url + 'monishiti.png', image: process.uniEnv.qn_base_url + 'monishiti.png',
}, },
] ]
...@@ -274,9 +276,11 @@ export default { ...@@ -274,9 +276,11 @@ export default {
return `width:640rpx;margin-top:${this.tipTop}rpx;margin-left:56rpx;` return `width:640rpx;margin-top:${this.tipTop}rpx;margin-left:56rpx;`
}, },
imageStyle0() { imageStyle0() {
return `width:502rpx;margin-top:${this.tipTop0}rpx` return `width:570rpx;margin-top:${this.tipTop0}rpx`
}, },
}, showAdvertisement() {
return this.selected.id > 0 && this.advertisementList.length > 0
}, },
watch: { watch: {
'detail.totalCount'(val) { 'detail.totalCount'(val) {
// 上次答题总数为0,这次答题总数大于0,弹出提示 // 上次答题总数为0,这次答题总数大于0,弹出提示
...@@ -287,7 +291,7 @@ export default { ...@@ -287,7 +291,7 @@ export default {
query query
.select('.subject-statistics') .select('.subject-statistics')
.boundingClientRect((data) => { .boundingClientRect((data) => {
this.tipTop = data?.top * 2 + 100 this.tipTop = data?.top * 2 + 72
this.showCountTip = true this.showCountTip = true
}) })
.exec() .exec()
...@@ -297,7 +301,7 @@ export default { ...@@ -297,7 +301,7 @@ export default {
}, },
}, },
onLoad() { onLoad() {
getApp().trackPage('首页') // getApp().trackPage('首页')
if (this.vuex_token) { if (this.vuex_token) {
this.loading = true this.loading = true
// this.getProvinceList() // this.getProvinceList()
...@@ -346,7 +350,13 @@ export default { ...@@ -346,7 +350,13 @@ export default {
.then((res) => { .then((res) => {
this.loading = false this.loading = false
this.data = res || { questionWarehouse: {} } this.data = res || { questionWarehouse: {} }
if (!this.data.questionWarehouse) this.data.questionWarehouse = {}
this.selected = this.data.questionWarehouse this.selected = this.data.questionWarehouse
// 是否有继续答题
this.getInProgress()
// 是否显示广告:调查问卷
this.getAdvertisementList()
}) })
.catch((err) => { .catch((err) => {
this.loading = false this.loading = false
...@@ -512,10 +522,15 @@ export default { ...@@ -512,10 +522,15 @@ export default {
}, },
}) })
} else { } else {
// 模拟考试 if (this.havingExamination) {
this.$u.route({ // 继续考试
url: 'pages/learn/beginAnswer', this.handleContinue()
}) } else {
// 模拟考试
this.$u.route({
url: 'pages/learn/beginAnswer',
})
}
} }
} else if (this.info.id) { } else if (this.info.id) {
// 已选题库 // 已选题库
...@@ -525,6 +540,16 @@ export default { ...@@ -525,6 +540,16 @@ export default {
this.show = true this.show = true
} }
}, },
// 继续考试
handleContinue() {
this.$u.route({
url: '/pages/learn/answer',
params: {
recordId: this.havingExamination,
source: 3,
},
})
},
handleClick(path, params) { handleClick(path, params) {
if (!this.checkToken()) { if (!this.checkToken()) {
return return
...@@ -589,7 +614,7 @@ export default { ...@@ -589,7 +614,7 @@ export default {
}, },
checkToken() { checkToken() {
if (this.vuex_token) { if (this.vuex_token) {
return true return !this.loading
} else { } else {
this.$u.route({ this.$u.route({
url: 'pages/login/index', url: 'pages/login/index',
...@@ -605,14 +630,13 @@ export default { ...@@ -605,14 +630,13 @@ export default {
if (this.firstLauch) { if (this.firstLauch) {
this.$u.vuex('firstLauch', false) this.$u.vuex('firstLauch', false)
setTimeout(() => { setTimeout(() => {
console.log(uni.getSystemInfoSync().statusBarHeight)
uni.getSystemInfo({ uni.getSystemInfo({
success: (res) => { success: (res) => {
this.tipTop0 = res.statusBarHeight * 2 + 15 this.tipTop0 = res.statusBarHeight * 2 + 88
this.showMask = true this.showMask = true
}, },
}) })
}, 2000) },1500)
} }
}) })
}, },
...@@ -632,6 +656,46 @@ export default { ...@@ -632,6 +656,46 @@ export default {
}, },
}) })
}, },
handleClickAdvertisement(item) {
var path = 'questionnaire'
// 0-未参与问卷, 1-已参与未领取奖品, 2-已参与已领取奖品, 10-已参与无奖品问卷
if (item.status== 0){
path = 'questionnaire'
} else if (item.status== 1) {
path = 'results'
}
this.$u.route({
url: 'pages/advertisement/' + path,
params: {
surveyId: item.businessId,
},
})
},
getInProgress() {
if (!this.selected || !this.selected.id) return
this.$u.api
.inProgress({questionWarehouseId: this.selected.id})
.then((res) => {
let data = res && res.pop() || {}
this.havingExamination = data.id || false
})
.catch((err) => {
console.log(err)
})
},
getAdvertisementList() {
// surveyId 问卷id,暂时写死
this.$u.api
.getAdvertisementList()
.then((res) => {
this.advertisementList = res.filter((item) => {
return item.status == 0 || item.status == 1
}) || []
})
.catch((err) => {
console.log(err)
})
}
}, },
} }
</script> </script>
...@@ -748,7 +812,7 @@ export default { ...@@ -748,7 +812,7 @@ export default {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
margin: 30rpx 0 140rpx 0; margin: 30rpx 0 30rpx 0;
.sub-content-item { .sub-content-item {
color: #5a6073; color: #5a6073;
font-size: 26rpx; font-size: 26rpx;
...@@ -812,6 +876,10 @@ export default { ...@@ -812,6 +876,10 @@ export default {
justify-content: center; justify-content: center;
font-size: 26rpx; font-size: 26rpx;
color: #adbdd4; color: #adbdd4;
margin-top: 112rpx;
&.showAdvertisement {
margin-top: 32rpx;
}
.bottom-image { .bottom-image {
width: 520rpx; width: 520rpx;
height: 28rpx; height: 28rpx;
......
...@@ -157,7 +157,7 @@ export default { ...@@ -157,7 +157,7 @@ export default {
}, },
}, },
onLoad() { onLoad() {
getApp().trackPage('我的') // getApp().trackPage('我的')
}, },
onShow() { onShow() {
if (this.userInfo.nickName) { if (this.userInfo.nickName) {
......
...@@ -72,7 +72,7 @@ export default { ...@@ -72,7 +72,7 @@ export default {
}, },
}, },
onLoad(e) { onLoad(e) {
getApp().trackPage('选择题库') // getApp().trackPage('选择题库')
this.getPageInfo() this.getPageInfo()
}, },
methods: { methods: {
......
This diff is collapsed.
...@@ -81,7 +81,7 @@ export default { ...@@ -81,7 +81,7 @@ export default {
}, },
}, },
onLoad() { onLoad() {
getApp().trackPage('模拟考试开始') // getApp().trackPage('模拟考试开始')
this.init() this.init()
}, },
methods: { methods: {
...@@ -90,12 +90,12 @@ export default { ...@@ -90,12 +90,12 @@ export default {
title: '加载中', title: '加载中',
}) })
// 埋点-模拟考试页面获取信息 // 埋点-模拟考试页面获取信息
let trackParams = { // let trackParams = {
openId: this.openId, // openId: this.openId,
nickname: this.userInfo.nickName, // nickname: this.userInfo.nickName,
questionWarehouseId: this.questionWarehouseId, // questionWarehouseId: this.questionWarehouseId,
} // }
getApp().track('getExamPaper-beginAnswerPage', trackParams) // getApp().track('getExamPaper-beginAnswerPage', trackParams)
this.$u.api this.$u.api
.getExamPaper({ questionWarehouseId: this.questionWarehouseId }) .getExamPaper({ questionWarehouseId: this.questionWarehouseId })
...@@ -123,18 +123,19 @@ export default { ...@@ -123,18 +123,19 @@ export default {
title: '载入试题中', title: '载入试题中',
}) })
// 埋点-去模拟考试 // 埋点-去模拟考试
let trackParams = { // let trackParams = {
openId: this.openId, // openId: this.openId,
nickname: this.userInfo.nickName, // nickname: this.userInfo.nickName,
...params, // ...params,
} // }
getApp().track('applyExam-beginAnswerPage', trackParams) // getApp().track('applyExam-beginAnswerPage', trackParams)
this.$u.api.applyExam(params).then((res) => { this.$u.api.applyExam(params).then((res) => {
uni.hideLoading() uni.hideLoading()
if (res) { if (res) {
this.$u.route({ this.$u.route({
url: '/pages/learn/answer', url: '/pages/learn/answer',
type: 'redirectTo',
params: { params: {
recordId: res.id, recordId: res.id,
source: 3, source: 3,
......
...@@ -87,7 +87,7 @@ export default { ...@@ -87,7 +87,7 @@ export default {
// if (e && e.relationId) { // if (e && e.relationId) {
// this.relationId = e.relationId // this.relationId = e.relationId
// } // }
getApp().trackPage('绑定题库') // getApp().trackPage('绑定题库')
if (e && e.realPrice) { if (e && e.realPrice) {
this.realPrice = e.realPrice this.realPrice = e.realPrice
} }
...@@ -95,11 +95,11 @@ export default { ...@@ -95,11 +95,11 @@ export default {
methods: { methods: {
handleClick() { handleClick() {
// 埋点-扫码 // 埋点-扫码
let trackParams = { // let trackParams = {
openId: this.openId, // openId: this.openId,
nickname: this.userInfo.nickName, // nickname: this.userInfo.nickName,
} // }
getApp().track('scanCode-boundQuestionsPage', trackParams) // getApp().track('scanCode-boundQuestionsPage', trackParams)
wx.scanCode({ wx.scanCode({
success: (res) => { success: (res) => {
...@@ -148,12 +148,12 @@ export default { ...@@ -148,12 +148,12 @@ export default {
title: '加载中', title: '加载中',
}) })
// 埋点-购买 // 埋点-购买
let trackParams = { // let trackParams = {
openId: this.openId, // openId: this.openId,
nickname: this.userInfo.nickName, // nickname: this.userInfo.nickName,
...data, // ...data,
} // }
getApp().track('payOrder-boundQuestionsPage', trackParams) // getApp().track('payOrder-boundQuestionsPage', trackParams)
this.$u.api.payOrder(data).then((res) => { this.$u.api.payOrder(data).then((res) => {
uni.hideLoading() uni.hideLoading()
......
...@@ -63,7 +63,7 @@ export default { ...@@ -63,7 +63,7 @@ export default {
}, },
}, },
onLoad(e) { onLoad(e) {
getApp().trackPage('绑定试题') // 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)
...@@ -75,11 +75,11 @@ export default { ...@@ -75,11 +75,11 @@ export default {
handleClick() { handleClick() {
this.loading = true this.loading = true
// 埋点-绑卡 // 埋点-绑卡
let trackParams = { // let trackParams = {
openId: this.openId, // openId: this.openId,
nickname: this.userInfo.nickName, // nickname: this.userInfo.nickName,
} // }
getApp().track('bindCard-boundTestPage', trackParams) // getApp().track('bindCard-boundTestPage', trackParams)
this.$u.api this.$u.api
.bindCard(this.param) .bindCard(this.param)
......
This diff is collapsed.
...@@ -172,7 +172,7 @@ export default { ...@@ -172,7 +172,7 @@ export default {
}, },
}, },
onLoad(e) { onLoad(e) {
getApp().trackPage('科目设置') // getApp().trackPage('科目设置')
this.getPageInfo() this.getPageInfo()
this.getLocation() this.getLocation()
this.getProvinceList(this.category.id) this.getProvinceList(this.category.id)
...@@ -211,12 +211,12 @@ export default { ...@@ -211,12 +211,12 @@ export default {
// 获取省份列表 // 获取省份列表
async getProvinceList(id) { async getProvinceList(id) {
// 埋点-获取省份 // 埋点-获取省份
let trackParams = { // let trackParams = {
openId: this.openId, // openId: this.openId,
nickname: this.userInfo.nickName, // nickname: this.userInfo.nickName,
id: id, // id: id,
} // }
getApp().track('getProvinceList-examSettingPage', trackParams) // getApp().track('getProvinceList-examSettingPage', trackParams)
let res = await this.$u.api.getProvinceList(id) let res = await this.$u.api.getProvinceList(id)
console.log(res) console.log(res)
...@@ -244,12 +244,12 @@ export default { ...@@ -244,12 +244,12 @@ export default {
type: this.selectedTypeId, type: this.selectedTypeId,
} }
// 埋点-获取题库信息 // 埋点-获取题库信息
let trackParams = { // let trackParams = {
openId: this.openId, // openId: this.openId,
nickname: this.userInfo.nickName, // nickname: this.userInfo.nickName,
...param, // ...param,
} // }
getApp().track('getQuestionWarehouse-examSettingPage', trackParams) // getApp().track('getQuestionWarehouse-examSettingPage', trackParams)
// 获取科目对应的题库 // 获取科目对应的题库
this.$u.api this.$u.api
...@@ -259,12 +259,12 @@ export default { ...@@ -259,12 +259,12 @@ export default {
let data = res[0] let data = res[0]
// 埋点-添加题库 // 埋点-添加题库
let trackParams = { // let trackParams = {
openId: this.openId, // openId: this.openId,
nickname: this.userInfo.nickName, // nickname: this.userInfo.nickName,
questionWarehouseId: data.id, // questionWarehouseId: data.id,
} // }
getApp().track('addQuestionWarehouse-examSettingPage', trackParams) // getApp().track('addQuestionWarehouse-examSettingPage', trackParams)
// 学员增加自己的题库 // 学员增加自己的题库
this.$u.api this.$u.api
......
...@@ -110,7 +110,7 @@ export default { ...@@ -110,7 +110,7 @@ export default {
}, },
}, },
onLoad(e) { onLoad(e) {
getApp().trackPage('手动绑定') // getApp().trackPage('手动绑定')
// if (e && e.relationId) { // if (e && e.relationId) {
// this.relationId = e.relationId // this.relationId = e.relationId
// } // }
...@@ -131,14 +131,14 @@ export default { ...@@ -131,14 +131,14 @@ export default {
this.loading = true this.loading = true
// 埋点-手动绑卡 // 埋点-手动绑卡
let trackParams = { // let trackParams = {
openId: this.openId, // openId: this.openId,
nickname: this.userInfo.nickName, // nickname: this.userInfo.nickName,
cardNumber: this.code, // cardNumber: this.code,
cardSecret: this.password, // cardSecret: this.password,
questionWarehouseId: this.relationId, // questionWarehouseId: this.relationId,
} // }
getApp().track('bindCard-manualBindingPage', trackParams) // getApp().track('bindCard-manualBindingPage', trackParams)
this.$u.api this.$u.api
.bindCard({ .bindCard({
......
...@@ -209,7 +209,7 @@ export default { ...@@ -209,7 +209,7 @@ export default {
}, },
}, },
onLoad(e) { onLoad(e) {
getApp().trackPage('每日一练') // getApp().trackPage('每日一练')
if (e && e.key) { if (e && e.key) {
this.$nextTick(() => { this.$nextTick(() => {
// setTimeout(() => { // setTimeout(() => {
...@@ -238,13 +238,13 @@ export default { ...@@ -238,13 +238,13 @@ export default {
} }
// 埋点-每日一练统计 // 埋点-每日一练统计
let trackParams = { // let trackParams = {
openId: this.openId, // openId: this.openId,
nickname: this.userInfo.nickName, // nickname: this.userInfo.nickName,
id: this.questionWarehouseId, // id: this.questionWarehouseId,
...params, // ...params,
} // }
getApp().track('everyTaskList-recordPage', trackParams) // getApp().track('everyTaskList-recordPage', trackParams)
this.$u.api this.$u.api
.everyTaskList(this.questionWarehouseId, params) .everyTaskList(this.questionWarehouseId, params)
...@@ -263,12 +263,12 @@ export default { ...@@ -263,12 +263,12 @@ export default {
// 练习分析 // 练习分析
studyRecord(params) { studyRecord(params) {
// 埋点-练习分析 // 埋点-练习分析
let trackParams = { // let trackParams = {
openId: this.openId, // openId: this.openId,
nickname: this.userInfo.nickName, // nickname: this.userInfo.nickName,
...params, // ...params,
} // }
getApp().track('studyRecord-recordPage', trackParams) // getApp().track('studyRecord-recordPage', trackParams)
this.$u.api this.$u.api
.studyRecord(this.questionWarehouseId, params) .studyRecord(this.questionWarehouseId, params)
...@@ -301,12 +301,12 @@ export default { ...@@ -301,12 +301,12 @@ export default {
} }
// 埋点-模考记录 // 埋点-模考记录
let trackParams = { // let trackParams = {
openId: this.openId, // openId: this.openId,
nickname: this.userInfo.nickName, // nickname: this.userInfo.nickName,
...this.recordParams, // ...this.recordParams,
} // }
getApp().track('queryExamRecord-recordPage', trackParams) // getApp().track('queryExamRecord-recordPage', trackParams)
this.$u.api this.$u.api
.queryExamRecord(this.recordParams) .queryExamRecord(this.recordParams)
......
...@@ -161,8 +161,19 @@ export default { ...@@ -161,8 +161,19 @@ export default {
// 模考成绩大于80分小于90分则百分数在86%—93% 区间内取随机值; // 模考成绩大于80分小于90分则百分数在86%—93% 区间内取随机值;
// 模考成绩大于90分小于100分则百分数在94%—99% 区间内取随机值) // 模考成绩大于90分小于100分则百分数在94%—99% 区间内取随机值)
falsePercent() { falsePercent() {
if (this.info.score == 0) return 6
var random = [94, 99] var random = [94, 99]
if (this.info.score < 60) { if (this.info.score < this.info.pageTotalPoint * 0.1) {
random = [6, 14]
} else if (
this.info.score < this.info.pageTotalPoint * 0.3 &&
this.info.score >= this.info.pageTotalPoint * 0.1
) {
random = [14, 55]
} else if (
this.info.score < this.info.pageTotalPoint * 0.6 &&
this.info.score >= this.info.pageTotalPoint * 0.3
) {
random = [55, 65] random = [55, 65]
} else if ( } else if (
this.info.score >= this.info.pageTotalPoint * 0.6 && this.info.score >= this.info.pageTotalPoint * 0.6 &&
...@@ -186,15 +197,15 @@ export default { ...@@ -186,15 +197,15 @@ export default {
title: '模考大师', title: '模考大师',
path: `/pages/learn/score?id=${this.id}`, path: `/pages/learn/score?id=${this.id}`,
} }
let trackProperties = { // let trackProperties = {
openId: this.openId, // openId: this.openId,
nickname: this.userInfo.nickName, // nickname: this.userInfo.nickName,
} // }
getApp().share(toShareProperties, trackProperties) // getApp().share(toShareProperties, trackProperties)
return toShareProperties return toShareProperties
}, },
onLoad(options) { onLoad(options) {
getApp().trackPage('考试成绩') // getApp().trackPage('考试成绩')
if (options) { if (options) {
this.id = options.id this.id = options.id
} else { } else {
......
...@@ -94,7 +94,7 @@ export default { ...@@ -94,7 +94,7 @@ export default {
}, },
}, },
onLoad(e) { onLoad(e) {
getApp().trackPage('题库选择') // getApp().trackPage('题库选择')
this.loadLabel() // 获取标签 this.loadLabel() // 获取标签
}, },
methods: { methods: {
...@@ -152,11 +152,11 @@ export default { ...@@ -152,11 +152,11 @@ export default {
let param = {} let param = {}
// 埋点-获取科目列表 // 埋点-获取科目列表
let trackParams = { // let trackParams = {
openId: this.openId, // openId: this.openId,
nickname: this.userInfo.nickName, // nickname: this.userInfo.nickName,
} // }
getApp().track('subjectList-selectCategoryPage', trackParams) // getApp().track('subjectList-selectCategoryPage', trackParams)
let res = await this.$u.api.subjectList(param) let res = await this.$u.api.subjectList(param)
this.tapLoading = false this.tapLoading = false
......
...@@ -78,7 +78,7 @@ export default { ...@@ -78,7 +78,7 @@ export default {
}, },
}, },
onLoad(e) { onLoad(e) {
getApp().trackPage('已选题库列表') // getApp().trackPage('已选题库列表')
this.getPageInfo() this.getPageInfo()
}, },
methods: { methods: {
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<view class="label-content"> <view class="label-content">
<view v-for="(label, index) in list" :key="index" class="label-item"> <view v-for="(label, index) in list" :key="index" class="label-item">
<QuestionBankCell <QuestionBankCell
:info="label && label.echoMap && label.echoMap.questionWarehouseId" :info="label"
:type="type" :type="type"
@action="handleAction" @action="handleAction"
></QuestionBankCell> ></QuestionBankCell>
...@@ -68,7 +68,7 @@ export default { ...@@ -68,7 +68,7 @@ export default {
}, },
}, },
onLoad(e) { onLoad(e) {
getApp().trackPage('已选题库') // getApp().trackPage('已选题库')
this.loadList() // 获取已选题库列表 this.loadList() // 获取已选题库列表
}, },
methods: { methods: {
...@@ -91,11 +91,11 @@ export default { ...@@ -91,11 +91,11 @@ export default {
let param = {} let param = {}
// 埋点-获取已选题库列表 // 埋点-获取已选题库列表
let trackParams = { // let trackParams = {
openId: this.openId, // openId: this.openId,
nickname: this.userInfo.nickName, // nickname: this.userInfo.nickName,
} // }
getApp().track('getMyQuestionWarehouseList-selectedList', trackParams) // getApp().track('getMyQuestionWarehouseList-selectedList', trackParams)
this.$u.api this.$u.api
.getMyQuestionWarehouseList(param) .getMyQuestionWarehouseList(param)
...@@ -145,7 +145,7 @@ export default { ...@@ -145,7 +145,7 @@ export default {
.selected-list-content { .selected-list-content {
height: 100%; height: 100%;
overflow: auto; overflow: auto;
margin-top: 24rpx; padding-top: 24rpx;
.label-content { .label-content {
margin-bottom: 44rpx; margin-bottom: 44rpx;
.label-item { .label-item {
......
...@@ -59,7 +59,7 @@ export default { ...@@ -59,7 +59,7 @@ export default {
}, },
}, },
onLoad(e) { onLoad(e) {
getApp().trackPage('绑定试题') // getApp().trackPage('绑定试题')
if (e & e.result) { if (e & e.result) {
this.computed = e.result this.computed = e.result
} }
......
...@@ -62,7 +62,8 @@ function request({ currentPage, size, onSuccess, onFailed }, vm) { ...@@ -62,7 +62,8 @@ function request({ currentPage, size, onSuccess, onFailed }, vm) {
rightKey: info.answer.split(','), rightKey: info.answer.split(','),
explain: info.analysis, explain: info.analysis,
type: type, type: type,
collectionFlag: info.collectionFlag collectionFlag: info.collectionFlag,
userAnswer: info.userAnswer,
} }
// 回显已答题目 // 回显已答题目
if (vm.source === 1) { // 练习模式回显 if (vm.source === 1) { // 练习模式回显
......
...@@ -60,7 +60,7 @@ export default { ...@@ -60,7 +60,7 @@ export default {
}, },
}, },
onLoad(params) { onLoad(params) {
getApp().trackPage('登录') // getApp().trackPage('登录')
if (params && params.path) { if (params && params.path) {
this.returnUrl = decodeURIComponent(params.path) this.returnUrl = decodeURIComponent(params.path)
} }
......
...@@ -44,7 +44,7 @@ export default { ...@@ -44,7 +44,7 @@ export default {
} }
}, },
onLoad() { onLoad() {
getApp().trackPage('我的题库') // getApp().trackPage('我的题库')
this.getUserQuestionWareHouseList() this.getUserQuestionWareHouseList()
}, },
methods: { methods: {
......
...@@ -118,7 +118,7 @@ export default { ...@@ -118,7 +118,7 @@ export default {
}, },
}, },
onLoad() { onLoad() {
getApp().trackPage('实名认证') // getApp().trackPage('实名认证')
this.student = getApp().globalData.student this.student = getApp().globalData.student
this.qiToken = getApp().globalData.qiNiuToken this.qiToken = getApp().globalData.qiNiuToken
}, },
...@@ -144,12 +144,12 @@ export default { ...@@ -144,12 +144,12 @@ export default {
certificateValidityDate: this.student.certificateValidityDate, certificateValidityDate: this.student.certificateValidityDate,
name: this.student.name, name: this.student.name,
} }
let trackParams = { // let trackParams = {
openId: this.openId, // openId: this.openId,
nickname: this.userInfo.nickName, // nickname: this.userInfo.nickName,
...params, // ...params,
} // }
getApp().track('vertifyIdCard', trackParams) // getApp().track('vertifyIdCard', trackParams)
this.$u.api.updateUserInfo(params).then((res) => { this.$u.api.updateUserInfo(params).then((res) => {
this.$refs.uToast.show({ this.$refs.uToast.show({
title: '认证成功', title: '认证成功',
...@@ -175,12 +175,12 @@ export default { ...@@ -175,12 +175,12 @@ export default {
let params = { let params = {
url: process.uniEnv.qn_asset_url + res.key, url: process.uniEnv.qn_asset_url + res.key,
} }
let trackParams = { // let trackParams = {
openId: this.openId, // openId: this.openId,
nickname: this.userInfo.nickName, // nickname: this.userInfo.nickName,
...params, // ...params,
} // }
getApp().track('certFrontUpload', trackParams) // getApp().track('certFrontUpload', trackParams)
this.$u.api this.$u.api
.getCertifyInfoByType('front', params) .getCertifyInfoByType('front', params)
.then((res) => { .then((res) => {
...@@ -210,12 +210,12 @@ export default { ...@@ -210,12 +210,12 @@ export default {
let params = { let params = {
url: process.uniEnv.qn_asset_url + res.key, url: process.uniEnv.qn_asset_url + res.key,
} }
let trackParams = { // let trackParams = {
openId: this.openId, // openId: this.openId,
nickname: this.userInfo.nickName, // nickname: this.userInfo.nickName,
...params, // ...params,
} // }
getApp().track('certFrontUpload', trackParams) // getApp().track('certFrontUpload', trackParams)
this.$u.api this.$u.api
.getCertifyInfoByType('back', params) .getCertifyInfoByType('back', params)
.then((res) => { .then((res) => {
......
...@@ -36,7 +36,7 @@ export default { ...@@ -36,7 +36,7 @@ export default {
}, },
computed: {}, computed: {},
onLoad() { onLoad() {
getApp().trackPage('工作单位') // 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
...@@ -52,12 +52,12 @@ export default { ...@@ -52,12 +52,12 @@ export default {
let params = { let params = {
workUnit: this.student.workUnit, workUnit: this.student.workUnit,
} }
let trackParams = { // let trackParams = {
openId: this.openId, // openId: this.openId,
nickname: this.userInfo.nickName, // nickname: this.userInfo.nickName,
...params, // ...params,
} // }
getApp().track('changeCompany', trackParams) // getApp().track('changeCompany', trackParams)
this.$u.api.updateUserInfo(params).then((res) => { this.$u.api.updateUserInfo(params).then((res) => {
this.isNotSet = false this.isNotSet = false
this.$refs.uToast.show({ this.$refs.uToast.show({
......
...@@ -33,7 +33,7 @@ export default { ...@@ -33,7 +33,7 @@ export default {
} }
}, },
onLoad() { onLoad() {
getApp().trackPage('联系客服') // getApp().trackPage('联系客服')
} }
} }
</script> </script>
......
...@@ -120,7 +120,7 @@ export default { ...@@ -120,7 +120,7 @@ export default {
uni.showLoading({ uni.showLoading({
title: '加载中', title: '加载中',
}) })
getApp().trackPage('我的信息') // getApp().trackPage('我的信息')
this.$u.api.getQiNiuToken({ bucketName: 'wsy-exam' }).then((res) => { this.$u.api.getQiNiuToken({ bucketName: 'wsy-exam' }).then((res) => {
this.qiToken = res this.qiToken = res
getApp().globalData.qiNiuToken = res getApp().globalData.qiNiuToken = res
...@@ -185,12 +185,12 @@ export default { ...@@ -185,12 +185,12 @@ export default {
}) })
return return
} }
let trackParams = { // let trackParams = {
openId: this.openId, // openId: this.openId,
nickname: this.userInfo.nickName, // nickname: this.userInfo.nickName,
...params, // ...params,
} // }
getApp().track('getPhonenumber', trackParams) // getApp().track('getPhonenumber', trackParams)
this.syncUserinfo(params) this.syncUserinfo(params)
}, },
syncUserinfo(params) { syncUserinfo(params) {
...@@ -265,12 +265,12 @@ export default { ...@@ -265,12 +265,12 @@ export default {
let params = { let params = {
avatarPath: this.student.avatarPath, avatarPath: this.student.avatarPath,
} }
let trackParams = { // let trackParams = {
openId: this.openId, // openId: this.openId,
nickname: this.userInfo.nickName, // nickname: this.userInfo.nickName,
...params, // ...params,
} // }
getApp().track('changeAvatar', trackParams) // getApp().track('changeAvatar', trackParams)
this.inUpload() this.inUpload()
this.$u.api.updateUserInfo(params).then(() => { this.$u.api.updateUserInfo(params).then(() => {
uni.hideLoading() uni.hideLoading()
...@@ -285,12 +285,12 @@ export default { ...@@ -285,12 +285,12 @@ export default {
let params = { let params = {
certificatePhotoPath: this.student.certificatePhotoPath, certificatePhotoPath: this.student.certificatePhotoPath,
} }
let trackParams = { // let trackParams = {
openId: this.openId, // openId: this.openId,
nickname: this.userInfo.nickName, // nickname: this.userInfo.nickName,
...params, // ...params,
} // }
getApp().track('changeCertPhoto', trackParams) // getApp().track('changeCertPhoto', trackParams)
this.inUpload() this.inUpload()
this.$u.api.updateUserInfo(params).then(() => { this.$u.api.updateUserInfo(params).then(() => {
uni.hideLoading() uni.hideLoading()
......
...@@ -22,16 +22,16 @@ export default { ...@@ -22,16 +22,16 @@ export default {
}, },
computed: {}, computed: {},
onLoad() { onLoad() {
getApp().trackPage('设置') // getApp().trackPage('设置')
}, },
methods: { methods: {
upgrade: function() { upgrade: function() {
let that = this let that = this
let trackParams = { // let trackParams = {
openId: that.openId, // openId: that.openId,
nickname: that.userInfo.nickName, // nickname: that.userInfo.nickName,
} // }
getApp().track('upgradeVersion', trackParams) // getApp().track('upgradeVersion', trackParams)
uni.showLoading({ uni.showLoading({
title: '正在更新版本...', title: '正在更新版本...',
}) })
...@@ -61,11 +61,11 @@ export default { ...@@ -61,11 +61,11 @@ export default {
content: '确认退出当前账号', content: '确认退出当前账号',
success: function(res) { success: function(res) {
if (res.confirm) { if (res.confirm) {
let trackParams = { // let trackParams = {
openId: that.openId, // openId: that.openId,
nickname: that.userInfo.nickName, // nickname: that.userInfo.nickName,
} // }
getApp().track('logout', trackParams) // getApp().track('logout', trackParams)
that.$u.vuex('vuex_token', '') that.$u.vuex('vuex_token', '')
that.$u.vuex('openId', '') that.$u.vuex('openId', '')
that.$u.vuex('userInfo', {}) that.$u.vuex('userInfo', {})
......
...@@ -74,7 +74,7 @@ export default { ...@@ -74,7 +74,7 @@ export default {
} }
}, },
onLoad(e) { onLoad(e) {
getApp().trackPage('搜索结果') // getApp().trackPage('搜索结果')
this.keyword = e ? decodeURIComponent(e.keyword) : '' this.keyword = e ? decodeURIComponent(e.keyword) : ''
setList([]) setList([])
this.lists = getList() this.lists = getList()
...@@ -97,12 +97,12 @@ export default { ...@@ -97,12 +97,12 @@ export default {
size: this.pageSize, size: this.pageSize,
} }
getApp().track("search", { // getApp().track("search", {
questionWarehouseId: this.questionWarehouseId, // questionWarehouseId: this.questionWarehouseId,
keyword: this.keyword, // keyword: this.keyword,
openId: this.openId, // openId: this.openId,
nickname: this.userInfo.nickName // nickname: this.userInfo.nickName
}) // })
this.loadStatus = 'loading' this.loadStatus = 'loading'
this.$u.api.searchQuestion(data).then((res) => { this.$u.api.searchQuestion(data).then((res) => {
......
...@@ -60,7 +60,7 @@ export default { ...@@ -60,7 +60,7 @@ export default {
} }
}, },
onLoad() { onLoad() {
getApp().trackPage('搜索') // getApp().trackPage('搜索')
}, },
methods: { methods: {
search(val) { search(val) {
......
<template>
<view>
<!-- <web-view ref="webview" :webview-styles="webviewStyles" src="https://uniapp.dcloud.io/static/web-view.html"></web-view> -->
<web-view ref="webview" :webview-styles="webviewStyles" class="webview" @onPostMessage="handlePostMessage" :src="url"></web-view>
<!-- <button ref="uToast" class="button" @click="evalJs">evalJs(改变webview背景颜色)</button> -->
<!-- <view> -->
<!-- <u-toast ref="uToast" />
<u-button ref="aBc" /> -->
<!-- </view> -->
</view>
</template>
<script>
import uButton from '../../uview-ui/components/u-button/u-button.vue'
export default {
components: { uButton },
data() {
return {
url: '',
webviewStyles: {
progress: {
color: '#FFFF00'
}
}
}
},
onLoad(e) {
console.log('---------------')
if (e && decodeURIComponent(e.url)) {
this.url = decodeURIComponent(e.url)
console.log('bbbb:', this.url, decodeURIComponent(e.url))
}
if (e && decodeURIComponent(e.title)) {
uni.setNavigationBarTitle({
title: decodeURIComponent(e.title)
});
}
console.log('aaaaa:', this.url)
setTimeout(() => {
this.evalJs()
}, 3000);
},
onShareAppMessage(options) {
console.log(options.webViewUrl)
},
methods: {
// webview向外部发送消息
handlePostMessage: function(data) {
console.log("接收到消息:" + JSON.stringify(data.detail));
},
// 调用 webview 内部逻辑
evalJs() {
console.log('abc:', this.$refs.aBc)
// this.$refs.webview.evalJs("document.body.style.background ='#FFFF00'");
}
}
}
</script>
\ No newline at end of file
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