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

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

parents 83b5dff9 af75a3fb
;(function() {
let NODE_ENV = 'prod' // dev:开发环境 | test:测试环境 | prod:生产环境
let ENV_VAR = null
let VERSION = 'v1.2.0'
let VERSION = 'v1.3.5'
if (process.env.NODE_ENV === 'development') {
if (NODE_ENV === 'dev') {
ENV_VAR = require('./.env.dev.js')
......
<script>
import './../.env.js'
import { AnalysysAgent } from '@/common/analysys_paas.js'
// import { AnalysysAgent } from '@/common/analysys_paas.js'
export default {
globalData: {
// 开发环境
......@@ -8,7 +8,7 @@ export default {
questionList: [],
},
onLaunch: function(options) {
AnalysysAgent.registerSuperProperty('platform', 'study')
// AnalysysAgent.registerSuperProperty('platform', 'study')
// 版本更新
this.updateApp()
},
......@@ -134,53 +134,53 @@ export default {
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)
}
}
// 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)
// }
// }
/* ------------------------- 数据埋点end ------------------------------ */
},
}
......
......@@ -3,13 +3,13 @@ let learnApiFun = function(vm) {
let ucenterApiUrl = globalUrl.uUrl
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 = {}) =>
await vm.$u.post('/rest/question/query/getQuestionTotal', params)
await vm.$u.post('/rest/V2/question/query/getQuestionTotal', 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 = {}) =>
await vm.$u.get('/rest/question/query/subjectList', params)
......@@ -62,7 +62,7 @@ let learnApiFun = function(vm) {
let applyExam = async (params = {}) =>
await vm.$u.get(
`/rest/question/applyExam/${params.questionWarehouseId}/${params.paperId}`,
`/rest/V2/question/applyExam/${params.questionWarehouseId}/${params.paperId}`,
params
)
......@@ -104,6 +104,36 @@ let learnApiFun = function(vm) {
'/rest/question/query/studyRecord/' + questionWarehouseId,
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 = {
getQuestion,
getQuestionTotal,
......@@ -128,6 +158,13 @@ let learnApiFun = function(vm) {
checkGetQuestion,
everyTaskList,
studyRecord,
inProgress,
examSuspend,
examCancel,
submitSurvey,
receiveAward,
// answerStatus
getAdvertisementList
}
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 @@
</view>
<view
v-else
:class="[rightKey.includes(item.sort) ? 'success' : 'error']"
:class="[data.rightKey.includes(item.sort) ? 'success' : 'error']"
></view>
<view class="text">{{ item.text }}</view>
</view>
<view class="btn" v-if="rightKey.length > 1 && btnStatus">
<view class="btn" v-if="data.rightKey.length > 1 && btnStatus">
<view
:class="['confirm', { active: getCheckedNum }]"
@click="confirmMultiple"
......@@ -43,22 +43,28 @@ const equar = (a, b) => {
export default {
name: 'answerSheet',
props: {
answerList: {
type: Array,
default: [],
},
multiple: {
type: Boolean,
default: false,
},
rightKey: {
type: Array,
default: [],
},
submitStatus: {
type: Boolean,
default: false,
data: {
type: Object,
default() {
return {}
}
},
// answerList: {
// type: Array,
// default: [],
// },
// multiple: {
// type: Boolean,
// default: false,
// },
// rightKey: {
// type: Array,
// default: [],
// },
// submitStatus: {
// type: Boolean,
// default: false,
// },
btnStatus: {
type: Boolean,
default: true,
......@@ -73,7 +79,7 @@ export default {
}
},
watch: {
answerList: {
'data.answerList': {
handler: function(newValue, oldValue) {
if (newValue.length > 0) {
this.lists = newValue
......@@ -86,18 +92,21 @@ export default {
getCheckedNum() {
const num = this.lists.filter((v) => v.checked)
return num.length > 1 ? true : false
}
},
multiple() {
return this.data.type == 3
},
},
methods: {
select(index) {
// 已选定
if (this.submitStatus) return
if (this.data.submitStatus) return
if (!this.multiple) {
// 非多选处理
this.lists.forEach((v) => {
v.checked = 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, 'confirm', true)
}
......@@ -106,7 +115,7 @@ export default {
// 用户选的答案
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'
: 'fail'
}
......@@ -117,6 +126,7 @@ export default {
},
// 多选提交答案
confirmMultiple() {
if (this.data.submitStatus) return
const num = this.lists.filter((v) => v.checked)
if (num.length > 1) {
// 判断所选答案是否正确
......@@ -124,11 +134,11 @@ export default {
// 用户选的答案
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) => {
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()
}
......
......@@ -43,7 +43,6 @@ export default {
},
methods: {
handleClick() {
console.log('--------------')
this.$emit('update:show', false)
this.$emit('click')
},
......
<template>
<view class="question-bank-cell">
<view class="label-normal">
<view class="title-view">{{ info.label || info.title }}</view>
<view class="type-view" v-if="!isAdd">{{
provinceName + '-' + examTypeText
}}</view>
<view class="label-text">
共
<text class="label-blue">{{ info.number || 0 }}</text
>道精编试题,通过率
<text class="label-blue">{{ info.version || info.key }}</text>
<view class="question-cell">
<image
v-if="beSelected"
class="selected-image"
:src="yixuanzetikuleImage"
></image>
<view
:class="[
'question-bank-cell',
{ 'selet-type': isSelect },
{ 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>
<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>
<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>
</template>
......@@ -38,27 +61,41 @@ export default {
return {}
},
},
beSelected: {
type: Boolean,
default: false,
},
},
data() {
return {}
},
computed: {
questionData() {
return (this.isAdd ? this.info : this.info && this.info.echoMap && this.info.echoMap.questionWarehouseId) || {}
},
examTypeText() {
var str = this.info.echoMap && this.info.echoMap.type
var str = this.questionData.echoMap && this.questionData.echoMap.type
return str || ''
},
provinceName() {
var str =
this.info.echoMap &&
this.info.echoMap.provinceId &&
this.info.echoMap.provinceId.fullName
this.questionData.echoMap &&
this.questionData.echoMap.provinceId &&
this.questionData.echoMap.provinceId.fullName
return str || ''
},
isAdd() {
return this.type == 'add'
},
isSelect() {
return this.type == 'select'
},
isNone() {
return this.type == 'none' || this.questionWarehouseId == this.info.id
return (
this.type == 'none' ||
this.isSelect ||
this.questionWarehouseId == this.questionData.id
)
},
buttonText() {
var text = ''
......@@ -85,52 +122,141 @@ export default {
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: {
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>
<style lang="scss" scoped>
.question-bank-cell {
padding: 40rpx 24rpx 40rpx 30rpx;
background-color: #ffffff;
border-radius: 12rpx;
display: flex;
justify-content: space-between;
align-items: center;
.label-normal {
width: 470rpx;
word-break: break-all;
.title-view {
font-size: 36rpx;
color: #191c27;
font-weight: bold;
margin-bottom: 12rpx;
.question-cell {
position: relative;
.selected-image {
position: absolute;
width: 54rpx;
height: 62rpx;
bottom: 0;
right: 0;
}
.question-bank-cell {
padding: 30rpx 24rpx 32rpx 30rpx;
background-color: #ffffff;
border-radius: 12rpx;
display: flex;
justify-content: space-between;
align-items: center;
&.selet-type {
background-color: #f7f9fc;
border: 1px solid #f7f9fc;
}
.type-view {
font-size: 28rpx;
color: #5a6073;
font-weight: bold;
&.selected {
border: 1px solid #2953ff;
}
.label-text {
margin-top: 12rpx;
font-size: 26rpx;
color: #5a6073;
.label-blue {
color: #2953ff;
padding-left: 6rpx;
padding-right: 6rpx;
.label-normal {
width: 470rpx;
word-break: break-all;
.title-view {
font-size: 36rpx;
color: #191c27;
font-weight: bold;
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 {
margin-right: 4rpx;
font-size: 28rpx;
font-weight: bold;
.button-icon {
margin-right: 4rpx;
font-size: 28rpx;
font-weight: bold;
}
}
}
</style>
......@@ -14,10 +14,7 @@
<view class="content">
<answer-sheet
ref="answerSheet"
:answerList="item.answerList"
:rightKey="item.rightKey"
:multiple="item.type === 3"
:submitStatus="item.submitStatus"
:data="item"
:btnStatus="false"
@change="answerChange"
></answer-sheet>
......
......@@ -13,10 +13,7 @@
<view class="content" v-if="item.answerList">
<answer-sheet
ref="answerSheet"
:answerList="item.answerList"
:rightKey="item.rightKey"
:multiple="item.type === 3"
:submitStatus="item.submitStatus"
:data="item"
@change="answerChange"
></answer-sheet>
</view>
......@@ -219,7 +216,7 @@ export default {
let realIndex = list.findIndex(item => item.index == defaultIndex)
let currentItem = list[realIndex]
let swiperList = []
swiperList[current] = currentItem
swiperList[current] = this.initItem(currentItem)
swiperList[this.getLastSwiperChangeIndex(current)] = this.getLastSwiperNeedItem(currentItem, list)
swiperList[this.getNextSwiperChangeIndex(current)] = this.getNextSwiperNeedItem(currentItem, list)
console.log("swiperList", swiperList)
......@@ -246,7 +243,7 @@ export default {
let realIndex = list.findIndex(item => item.index == listNeedIndex)
if (realIndex == -1) return null
let item = listNeedIndex == -1 ? null : list[realIndex]
return item
return this.initItem(item)
},
/**
* 获取下一个要替换的list中的item
......@@ -258,7 +255,24 @@ export default {
if (realIndex == -1) return null
let total = this.total != 0 ? this.total : list.length
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 @@
mode="widthFix"
></image>
<view class="toast-pop">
<u-icon class="close-icon" name="close" @click="handleClose"></u-icon>
<view class="pop-title">
<text>{{ title }}</text>
</view>
<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 class="pop-btn-view">
<view class="line-view"> </view>
<view class="content-view">
<view class="cancel-button" @click="handleClickCancel">
取消
{{ cancelText }}
</view>
<view class="line-view-v" />
<view class="sure-button" @click="$u.throttle(handleClickSure, 500)">
......@@ -51,6 +54,10 @@ export default {
type: String,
default: 'select',
},
data: {
noStart: 0,
answered: 0
}
},
data() {
return {}
......@@ -59,20 +66,36 @@ export default {
tanchuangdingbuImage() {
return process.uniEnv.qn_base_url + 'tanchuangdingbu.png'
},
message() {
messages() {
switch (this.type) {
case 'select':
return '为了您能更好的使用“模考大师”小程序请先选择题库'
return ['为了您能更好的使用“模考大师”小程序请先选择题库']
case 'bound':
return '为了您能更好的使用“模考大师”小程序请去绑定用户卡'
return ['为了您能更好的使用“模考大师”小程序请去绑定用户卡']
case 'pause':
return ['您已回答 ', ' 题,剩余 ' + this.data.noStart + ' 题']
}
},
isPause() {
return this.type == 'pause'
},
buttonText() {
switch (this.type) {
case 'select':
return '去选择'
case 'bound':
return '去绑定'
case 'pause':
return '保存并退出'
}
},
cancelText() {
switch (this.type) {
case 'select':
case 'bound':
return '取消'
case 'pause':
return '重新开始'
}
},
customStyleCancel() {
......@@ -107,6 +130,9 @@ export default {
this.changeVisibleValue(false)
this.$emit('click', this.type)
},
handleClose() {
this.changeVisibleValue(false)
}
},
}
</script>
......@@ -120,11 +146,18 @@ export default {
}
.toast-pop {
min-height: 480rpx;
overflow: hidden;
position: relative;
// background-image: linear-gradient(to top, #ffffff 0%, #e9f3ff 50%);
// background-size: 100% 240rpx;
// background-repeat: no-repeat;
text-align: center;
.close-icon {
top: 30rpx;
right: 30rpx;
position: absolute;
font-size: 32rpx;
}
.pop-title {
font-size: 40rpx;
text-align: center;
......@@ -138,6 +171,9 @@ export default {
color: #191c27;
font-weight: bold;
padding: 90rpx 30rpx 80rpx 30rpx;
.message-count {
color: #2953FF;
}
}
.pop-btn-view {
......
......@@ -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",
"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 {
}
},
onLoad: function() {
getApp().trackPage('证书详情')
// getApp().trackPage('证书详情')
this.formatDataByType()
},
computed: {
......
......@@ -88,7 +88,7 @@ export default {
}
},
onLoad(){
getApp().trackPage('我的证书详情')
// getApp().trackPage('我的证书详情')
},
onShow: function() {
this.formatDataByType()
......
......@@ -173,7 +173,7 @@ export default {
}
},
onLoad() {
getApp().trackPage('证书查询')
// getApp().trackPage('证书查询')
this.checkType = '特种作业操作证查询'
},
onShow: function(param) {
......@@ -223,12 +223,12 @@ export default {
uni.showLoading({
title: '查询中,请稍后',
})
let trackParams = {
openId: this.openId,
nickname: this.userInfo.nickName,
...params,
}
getApp().track('selectCertByIdAndName', trackParams)
// let trackParams = {
// openId: this.openId,
// nickname: this.userInfo.nickName,
// ...params,
// }
// getApp().track('selectCertByIdAndName', trackParams)
this.$u.api.getCertFromOut(params).then((res) => {
uni.hideLoading()
if(!res){
......
......@@ -25,17 +25,14 @@
</view>
<view v-if="showOrgId">{{ orgIdText }}</view>
<view v-if="noExam" class="tip-view">
<text>您还未选择题库,请先选择题库</text>
<text>您还未选择题库,请点击选择</text>
</view>
<view
v-else-if="!info.cardId"
class="card-tip-view"
@click="$u.throttle(handleSelectTip, 500)"
>
题库未激活,请通过<text class="blue-text">“绑卡”</text>或<text
class="blue-text"
>“购买”</text
>激活
题库未激活,<text class="blue-text">激活</text>后可刷题模考
</view>
<view v-else class="detail-view">
<view
......@@ -71,7 +68,7 @@
><text class="left-label" v-if="info.cardId">{{
item.leftLabel
}}</text
><text>{{ item.label }}</text></view
><text :style="item.labelStyle">{{ item.label }}</text></view
>
</view>
</view>
......@@ -90,7 +87,8 @@
<view>{{ item.title }}</view>
</view>
</view>
<view class="bottom-view">
<AdvertisementSwiper v-if="showAdvertisement" :list="advertisementList" @click="handleClickAdvertisement"/>
<view :class="['bottom-view', {'showAdvertisement': showAdvertisement}]">
<image
class="bottom-image"
:src="slognImage"
......@@ -108,12 +106,12 @@
</view>
<MaskTip
:show.sync="showMask"
imageName="mengceng1.png"
imageName="dianjitishi1.png"
:imageStyle="imageStyle0"
/>
<MaskTip
:show.sync="showCountTip"
imageName="mengceng2.png"
imageName="dianjitishi4.png"
:imageStyle="imageStyle"
/>
</view>
......@@ -124,9 +122,10 @@ import SubjectStatistics from '@/components/subject-statistics'
import ExperiencePop from '@/components/experience-pop'
import ToastPop from '@/components/toast-pop'
import MaskTip from '@/components/mask-tip'
import AdvertisementSwiper from '@/components/advertisement-swiper'
export default {
components: { SubjectStatistics, ExperiencePop, ToastPop, MaskTip },
components: { SubjectStatistics, ExperiencePop, ToastPop, MaskTip, AdvertisementSwiper },
data() {
return {
visible: false, // 免费体验弹窗
......@@ -147,7 +146,9 @@ export default {
tapCount: 0, // 点击底部logo五次,显示机构id
showOrgId: false, // 显示机构id
tipTop: 410,
tipTop0: 50,
tipTop0: 128,
havingExamination: false, // 有进行中的考试
advertisementList: [], // 广告位
}
},
computed: {
......@@ -155,7 +156,7 @@ export default {
return this.orgId
},
title() {
return this.selected.title || '请选择题库'
return this.selected.title || '点击选择题库'
},
imageUrl() {
return '/static/logo.png'
......@@ -181,8 +182,9 @@ export default {
image: process.uniEnv.qn_base_url + 'quanbushiti.png',
},
{
name: '模拟考试',
label: '真题模拟强化',
name: this.havingExamination ? '继续考试' : '模拟考试',
label: this.havingExamination ? '有考试未完成' : '真题模拟强化',
labelStyle: this.havingExamination ? 'color: #FA5A49' : '',
image: process.uniEnv.qn_base_url + 'monishiti.png',
},
]
......@@ -274,9 +276,11 @@ export default {
return `width:640rpx;margin-top:${this.tipTop}rpx;margin-left:56rpx;`
},
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: {
'detail.totalCount'(val) {
// 上次答题总数为0,这次答题总数大于0,弹出提示
......@@ -287,7 +291,7 @@ export default {
query
.select('.subject-statistics')
.boundingClientRect((data) => {
this.tipTop = data?.top * 2 + 100
this.tipTop = data?.top * 2 + 72
this.showCountTip = true
})
.exec()
......@@ -297,7 +301,7 @@ export default {
},
},
onLoad() {
getApp().trackPage('首页')
// getApp().trackPage('首页')
if (this.vuex_token) {
this.loading = true
// this.getProvinceList()
......@@ -346,7 +350,13 @@ export default {
.then((res) => {
this.loading = false
this.data = res || { questionWarehouse: {} }
if (!this.data.questionWarehouse) this.data.questionWarehouse = {}
this.selected = this.data.questionWarehouse
// 是否有继续答题
this.getInProgress()
// 是否显示广告:调查问卷
this.getAdvertisementList()
})
.catch((err) => {
this.loading = false
......@@ -512,10 +522,15 @@ export default {
},
})
} else {
// 模拟考试
this.$u.route({
url: 'pages/learn/beginAnswer',
})
if (this.havingExamination) {
// 继续考试
this.handleContinue()
} else {
// 模拟考试
this.$u.route({
url: 'pages/learn/beginAnswer',
})
}
}
} else if (this.info.id) {
// 已选题库
......@@ -525,6 +540,16 @@ export default {
this.show = true
}
},
// 继续考试
handleContinue() {
this.$u.route({
url: '/pages/learn/answer',
params: {
recordId: this.havingExamination,
source: 3,
},
})
},
handleClick(path, params) {
if (!this.checkToken()) {
return
......@@ -589,7 +614,7 @@ export default {
},
checkToken() {
if (this.vuex_token) {
return true
return !this.loading
} else {
this.$u.route({
url: 'pages/login/index',
......@@ -605,14 +630,13 @@ export default {
if (this.firstLauch) {
this.$u.vuex('firstLauch', false)
setTimeout(() => {
console.log(uni.getSystemInfoSync().statusBarHeight)
uni.getSystemInfo({
success: (res) => {
this.tipTop0 = res.statusBarHeight * 2 + 15
this.tipTop0 = res.statusBarHeight * 2 + 88
this.showMask = true
},
})
}, 2000)
},1500)
}
})
},
......@@ -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>
......@@ -748,7 +812,7 @@ export default {
display: flex;
justify-content: space-between;
align-items: center;
margin: 30rpx 0 140rpx 0;
margin: 30rpx 0 30rpx 0;
.sub-content-item {
color: #5a6073;
font-size: 26rpx;
......@@ -812,6 +876,10 @@ export default {
justify-content: center;
font-size: 26rpx;
color: #adbdd4;
margin-top: 112rpx;
&.showAdvertisement {
margin-top: 32rpx;
}
.bottom-image {
width: 520rpx;
height: 28rpx;
......
......@@ -157,7 +157,7 @@ export default {
},
},
onLoad() {
getApp().trackPage('我的')
// getApp().trackPage('我的')
},
onShow() {
if (this.userInfo.nickName) {
......
......@@ -72,7 +72,7 @@ export default {
},
},
onLoad(e) {
getApp().trackPage('选择题库')
// getApp().trackPage('选择题库')
this.getPageInfo()
},
methods: {
......
This diff is collapsed.
......@@ -81,7 +81,7 @@ export default {
},
},
onLoad() {
getApp().trackPage('模拟考试开始')
// getApp().trackPage('模拟考试开始')
this.init()
},
methods: {
......@@ -90,12 +90,12 @@ export default {
title: '加载中',
})
// 埋点-模拟考试页面获取信息
let trackParams = {
openId: this.openId,
nickname: this.userInfo.nickName,
questionWarehouseId: this.questionWarehouseId,
}
getApp().track('getExamPaper-beginAnswerPage', trackParams)
// let trackParams = {
// openId: this.openId,
// nickname: this.userInfo.nickName,
// questionWarehouseId: this.questionWarehouseId,
// }
// getApp().track('getExamPaper-beginAnswerPage', trackParams)
this.$u.api
.getExamPaper({ questionWarehouseId: this.questionWarehouseId })
......@@ -123,18 +123,19 @@ export default {
title: '载入试题中',
})
// 埋点-去模拟考试
let trackParams = {
openId: this.openId,
nickname: this.userInfo.nickName,
...params,
}
getApp().track('applyExam-beginAnswerPage', trackParams)
// 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({
url: '/pages/learn/answer',
type: 'redirectTo',
params: {
recordId: res.id,
source: 3,
......
......@@ -87,7 +87,7 @@ export default {
// if (e && e.relationId) {
// this.relationId = e.relationId
// }
getApp().trackPage('绑定题库')
// getApp().trackPage('绑定题库')
if (e && e.realPrice) {
this.realPrice = e.realPrice
}
......@@ -95,11 +95,11 @@ export default {
methods: {
handleClick() {
// 埋点-扫码
let trackParams = {
openId: this.openId,
nickname: this.userInfo.nickName,
}
getApp().track('scanCode-boundQuestionsPage', trackParams)
// let trackParams = {
// openId: this.openId,
// nickname: this.userInfo.nickName,
// }
// getApp().track('scanCode-boundQuestionsPage', trackParams)
wx.scanCode({
success: (res) => {
......@@ -148,12 +148,12 @@ export default {
title: '加载中',
})
// 埋点-购买
let trackParams = {
openId: this.openId,
nickname: this.userInfo.nickName,
...data,
}
getApp().track('payOrder-boundQuestionsPage', trackParams)
// let trackParams = {
// openId: this.openId,
// nickname: this.userInfo.nickName,
// ...data,
// }
// getApp().track('payOrder-boundQuestionsPage', trackParams)
this.$u.api.payOrder(data).then((res) => {
uni.hideLoading()
......
......@@ -63,7 +63,7 @@ export default {
},
},
onLoad(e) {
getApp().trackPage('绑定试题')
// getApp().trackPage('绑定试题')
if (e && e.code) {
var code = e.code
this.param.cardNumber = code.slice(0, 14)
......@@ -75,11 +75,11 @@ export default {
handleClick() {
this.loading = true
// 埋点-绑卡
let trackParams = {
openId: this.openId,
nickname: this.userInfo.nickName,
}
getApp().track('bindCard-boundTestPage', trackParams)
// let trackParams = {
// openId: this.openId,
// nickname: this.userInfo.nickName,
// }
// getApp().track('bindCard-boundTestPage', trackParams)
this.$u.api
.bindCard(this.param)
......
This diff is collapsed.
......@@ -172,7 +172,7 @@ export default {
},
},
onLoad(e) {
getApp().trackPage('科目设置')
// getApp().trackPage('科目设置')
this.getPageInfo()
this.getLocation()
this.getProvinceList(this.category.id)
......@@ -211,12 +211,12 @@ export default {
// 获取省份列表
async getProvinceList(id) {
// 埋点-获取省份
let trackParams = {
openId: this.openId,
nickname: this.userInfo.nickName,
id: id,
}
getApp().track('getProvinceList-examSettingPage', trackParams)
// 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)
......@@ -244,12 +244,12 @@ export default {
type: this.selectedTypeId,
}
// 埋点-获取题库信息
let trackParams = {
openId: this.openId,
nickname: this.userInfo.nickName,
...param,
}
getApp().track('getQuestionWarehouse-examSettingPage', trackParams)
// let trackParams = {
// openId: this.openId,
// nickname: this.userInfo.nickName,
// ...param,
// }
// getApp().track('getQuestionWarehouse-examSettingPage', trackParams)
// 获取科目对应的题库
this.$u.api
......@@ -259,12 +259,12 @@ export default {
let data = res[0]
// 埋点-添加题库
let trackParams = {
openId: this.openId,
nickname: this.userInfo.nickName,
questionWarehouseId: data.id,
}
getApp().track('addQuestionWarehouse-examSettingPage', trackParams)
// let trackParams = {
// openId: this.openId,
// nickname: this.userInfo.nickName,
// questionWarehouseId: data.id,
// }
// getApp().track('addQuestionWarehouse-examSettingPage', trackParams)
// 学员增加自己的题库
this.$u.api
......
......@@ -110,7 +110,7 @@ export default {
},
},
onLoad(e) {
getApp().trackPage('手动绑定')
// getApp().trackPage('手动绑定')
// if (e && e.relationId) {
// this.relationId = e.relationId
// }
......@@ -131,14 +131,14 @@ 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)
// 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({
......
......@@ -209,7 +209,7 @@ export default {
},
},
onLoad(e) {
getApp().trackPage('每日一练')
// getApp().trackPage('每日一练')
if (e && e.key) {
this.$nextTick(() => {
// setTimeout(() => {
......@@ -238,13 +238,13 @@ export default {
}
// 埋点-每日一练统计
let trackParams = {
openId: this.openId,
nickname: this.userInfo.nickName,
id: this.questionWarehouseId,
...params,
}
getApp().track('everyTaskList-recordPage', trackParams)
// 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)
......@@ -263,12 +263,12 @@ export default {
// 练习分析
studyRecord(params) {
// 埋点-练习分析
let trackParams = {
openId: this.openId,
nickname: this.userInfo.nickName,
...params,
}
getApp().track('studyRecord-recordPage', trackParams)
// let trackParams = {
// openId: this.openId,
// nickname: this.userInfo.nickName,
// ...params,
// }
// getApp().track('studyRecord-recordPage', trackParams)
this.$u.api
.studyRecord(this.questionWarehouseId, params)
......@@ -301,12 +301,12 @@ export default {
}
// 埋点-模考记录
let trackParams = {
openId: this.openId,
nickname: this.userInfo.nickName,
...this.recordParams,
}
getApp().track('queryExamRecord-recordPage', trackParams)
// let trackParams = {
// openId: this.openId,
// nickname: this.userInfo.nickName,
// ...this.recordParams,
// }
// getApp().track('queryExamRecord-recordPage', trackParams)
this.$u.api
.queryExamRecord(this.recordParams)
......
......@@ -161,8 +161,19 @@ export default {
// 模考成绩大于80分小于90分则百分数在86%—93% 区间内取随机值;
// 模考成绩大于90分小于100分则百分数在94%—99% 区间内取随机值)
falsePercent() {
if (this.info.score == 0) return 6
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]
} else if (
this.info.score >= this.info.pageTotalPoint * 0.6 &&
......@@ -186,15 +197,15 @@ export default {
title: '模考大师',
path: `/pages/learn/score?id=${this.id}`,
}
let trackProperties = {
openId: this.openId,
nickname: this.userInfo.nickName,
}
getApp().share(toShareProperties, trackProperties)
// let trackProperties = {
// openId: this.openId,
// nickname: this.userInfo.nickName,
// }
// getApp().share(toShareProperties, trackProperties)
return toShareProperties
},
onLoad(options) {
getApp().trackPage('考试成绩')
// getApp().trackPage('考试成绩')
if (options) {
this.id = options.id
} else {
......
......@@ -94,7 +94,7 @@ export default {
},
},
onLoad(e) {
getApp().trackPage('题库选择')
// getApp().trackPage('题库选择')
this.loadLabel() // 获取标签
},
methods: {
......@@ -152,11 +152,11 @@ export default {
let param = {}
// 埋点-获取科目列表
let trackParams = {
openId: this.openId,
nickname: this.userInfo.nickName,
}
getApp().track('subjectList-selectCategoryPage', trackParams)
// 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
......
......@@ -78,7 +78,7 @@ export default {
},
},
onLoad(e) {
getApp().trackPage('已选题库列表')
// getApp().trackPage('已选题库列表')
this.getPageInfo()
},
methods: {
......
......@@ -12,7 +12,7 @@
<view class="label-content">
<view v-for="(label, index) in list" :key="index" class="label-item">
<QuestionBankCell
:info="label && label.echoMap && label.echoMap.questionWarehouseId"
:info="label"
:type="type"
@action="handleAction"
></QuestionBankCell>
......@@ -68,7 +68,7 @@ export default {
},
},
onLoad(e) {
getApp().trackPage('已选题库')
// getApp().trackPage('已选题库')
this.loadList() // 获取已选题库列表
},
methods: {
......@@ -91,11 +91,11 @@ export default {
let param = {}
// 埋点-获取已选题库列表
let trackParams = {
openId: this.openId,
nickname: this.userInfo.nickName,
}
getApp().track('getMyQuestionWarehouseList-selectedList', trackParams)
// let trackParams = {
// openId: this.openId,
// nickname: this.userInfo.nickName,
// }
// getApp().track('getMyQuestionWarehouseList-selectedList', trackParams)
this.$u.api
.getMyQuestionWarehouseList(param)
......@@ -145,7 +145,7 @@ export default {
.selected-list-content {
height: 100%;
overflow: auto;
margin-top: 24rpx;
padding-top: 24rpx;
.label-content {
margin-bottom: 44rpx;
.label-item {
......
......@@ -59,7 +59,7 @@ export default {
},
},
onLoad(e) {
getApp().trackPage('绑定试题')
// getApp().trackPage('绑定试题')
if (e & e.result) {
this.computed = e.result
}
......
......@@ -62,7 +62,8 @@ function request({ currentPage, size, onSuccess, onFailed }, vm) {
rightKey: info.answer.split(','),
explain: info.analysis,
type: type,
collectionFlag: info.collectionFlag
collectionFlag: info.collectionFlag,
userAnswer: info.userAnswer,
}
// 回显已答题目
if (vm.source === 1) { // 练习模式回显
......
......@@ -60,7 +60,7 @@ export default {
},
},
onLoad(params) {
getApp().trackPage('登录')
// getApp().trackPage('登录')
if (params && params.path) {
this.returnUrl = decodeURIComponent(params.path)
}
......
......@@ -44,7 +44,7 @@ export default {
}
},
onLoad() {
getApp().trackPage('我的题库')
// getApp().trackPage('我的题库')
this.getUserQuestionWareHouseList()
},
methods: {
......
......@@ -118,7 +118,7 @@ export default {
},
},
onLoad() {
getApp().trackPage('实名认证')
// getApp().trackPage('实名认证')
this.student = getApp().globalData.student
this.qiToken = getApp().globalData.qiNiuToken
},
......@@ -144,12 +144,12 @@ export default {
certificateValidityDate: this.student.certificateValidityDate,
name: this.student.name,
}
let trackParams = {
openId: this.openId,
nickname: this.userInfo.nickName,
...params,
}
getApp().track('vertifyIdCard', trackParams)
// let trackParams = {
// openId: this.openId,
// nickname: this.userInfo.nickName,
// ...params,
// }
// getApp().track('vertifyIdCard', trackParams)
this.$u.api.updateUserInfo(params).then((res) => {
this.$refs.uToast.show({
title: '认证成功',
......@@ -175,12 +175,12 @@ export default {
let params = {
url: process.uniEnv.qn_asset_url + res.key,
}
let trackParams = {
openId: this.openId,
nickname: this.userInfo.nickName,
...params,
}
getApp().track('certFrontUpload', trackParams)
// let trackParams = {
// openId: this.openId,
// nickname: this.userInfo.nickName,
// ...params,
// }
// getApp().track('certFrontUpload', trackParams)
this.$u.api
.getCertifyInfoByType('front', params)
.then((res) => {
......@@ -210,12 +210,12 @@ export default {
let params = {
url: process.uniEnv.qn_asset_url + res.key,
}
let trackParams = {
openId: this.openId,
nickname: this.userInfo.nickName,
...params,
}
getApp().track('certFrontUpload', trackParams)
// let trackParams = {
// openId: this.openId,
// nickname: this.userInfo.nickName,
// ...params,
// }
// getApp().track('certFrontUpload', trackParams)
this.$u.api
.getCertifyInfoByType('back', params)
.then((res) => {
......
......@@ -36,7 +36,7 @@ export default {
},
computed: {},
onLoad() {
getApp().trackPage('工作单位')
// getApp().trackPage('工作单位')
this.student = getApp().globalData.student
if (this.student.workUnit == '' || !this.student.workUnit) {
this.isNotSet = true
......@@ -52,12 +52,12 @@ export default {
let params = {
workUnit: this.student.workUnit,
}
let trackParams = {
openId: this.openId,
nickname: this.userInfo.nickName,
...params,
}
getApp().track('changeCompany', trackParams)
// let trackParams = {
// openId: this.openId,
// nickname: this.userInfo.nickName,
// ...params,
// }
// getApp().track('changeCompany', trackParams)
this.$u.api.updateUserInfo(params).then((res) => {
this.isNotSet = false
this.$refs.uToast.show({
......
......@@ -33,7 +33,7 @@ export default {
}
},
onLoad() {
getApp().trackPage('联系客服')
// getApp().trackPage('联系客服')
}
}
</script>
......
......@@ -120,7 +120,7 @@ export default {
uni.showLoading({
title: '加载中',
})
getApp().trackPage('我的信息')
// getApp().trackPage('我的信息')
this.$u.api.getQiNiuToken({ bucketName: 'wsy-exam' }).then((res) => {
this.qiToken = res
getApp().globalData.qiNiuToken = res
......@@ -185,12 +185,12 @@ export default {
})
return
}
let trackParams = {
openId: this.openId,
nickname: this.userInfo.nickName,
...params,
}
getApp().track('getPhonenumber', trackParams)
// let trackParams = {
// openId: this.openId,
// nickname: this.userInfo.nickName,
// ...params,
// }
// getApp().track('getPhonenumber', trackParams)
this.syncUserinfo(params)
},
syncUserinfo(params) {
......@@ -265,12 +265,12 @@ export default {
let params = {
avatarPath: this.student.avatarPath,
}
let trackParams = {
openId: this.openId,
nickname: this.userInfo.nickName,
...params,
}
getApp().track('changeAvatar', trackParams)
// let trackParams = {
// openId: this.openId,
// nickname: this.userInfo.nickName,
// ...params,
// }
// getApp().track('changeAvatar', trackParams)
this.inUpload()
this.$u.api.updateUserInfo(params).then(() => {
uni.hideLoading()
......@@ -285,12 +285,12 @@ export default {
let params = {
certificatePhotoPath: this.student.certificatePhotoPath,
}
let trackParams = {
openId: this.openId,
nickname: this.userInfo.nickName,
...params,
}
getApp().track('changeCertPhoto', trackParams)
// let trackParams = {
// openId: this.openId,
// nickname: this.userInfo.nickName,
// ...params,
// }
// getApp().track('changeCertPhoto', trackParams)
this.inUpload()
this.$u.api.updateUserInfo(params).then(() => {
uni.hideLoading()
......
......@@ -22,16 +22,16 @@ export default {
},
computed: {},
onLoad() {
getApp().trackPage('设置')
// getApp().trackPage('设置')
},
methods: {
upgrade: function() {
let that = this
let trackParams = {
openId: that.openId,
nickname: that.userInfo.nickName,
}
getApp().track('upgradeVersion', trackParams)
// let trackParams = {
// openId: that.openId,
// nickname: that.userInfo.nickName,
// }
// getApp().track('upgradeVersion', trackParams)
uni.showLoading({
title: '正在更新版本...',
})
......@@ -61,11 +61,11 @@ export default {
content: '确认退出当前账号',
success: function(res) {
if (res.confirm) {
let trackParams = {
openId: that.openId,
nickname: that.userInfo.nickName,
}
getApp().track('logout', trackParams)
// let trackParams = {
// openId: that.openId,
// nickname: that.userInfo.nickName,
// }
// getApp().track('logout', trackParams)
that.$u.vuex('vuex_token', '')
that.$u.vuex('openId', '')
that.$u.vuex('userInfo', {})
......
......@@ -74,7 +74,7 @@ export default {
}
},
onLoad(e) {
getApp().trackPage('搜索结果')
// getApp().trackPage('搜索结果')
this.keyword = e ? decodeURIComponent(e.keyword) : ''
setList([])
this.lists = getList()
......@@ -97,12 +97,12 @@ export default {
size: this.pageSize,
}
getApp().track("search", {
questionWarehouseId: this.questionWarehouseId,
keyword: this.keyword,
openId: this.openId,
nickname: this.userInfo.nickName
})
// getApp().track("search", {
// questionWarehouseId: this.questionWarehouseId,
// keyword: this.keyword,
// openId: this.openId,
// nickname: this.userInfo.nickName
// })
this.loadStatus = 'loading'
this.$u.api.searchQuestion(data).then((res) => {
......
......@@ -60,7 +60,7 @@ export default {
}
},
onLoad() {
getApp().trackPage('搜索')
// getApp().trackPage('搜索')
},
methods: {
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