提交 7d3c9951 编写于 作者: xiaoping.di's avatar xiaoping.di

考试优化

上级 1d993e9a
/h5-submodules-master
/node_modules
/src
......@@ -16,7 +16,7 @@ export const getCoopExamQuest = async (param) => {
});
};
//教培中间模块
// 教培中间模块
export const getCoopExam = async (param) => {
return request({
url: 'app/projectExam/exam',
......
......@@ -7,7 +7,7 @@ export const getCoopTop = async (param) => {
params: param,
});
};
//教培底部模块
// 教培底部模块
export const getCoopBottom = async (param) => {
return request({
url: 'contents/projects/bottom',
......@@ -16,7 +16,7 @@ export const getCoopBottom = async (param) => {
});
};
//教培中间模块
// 教培中间模块
export const getCoopMiddle = async (param) => {
return request({
url: 'contents/projects/middle',
......@@ -25,7 +25,7 @@ export const getCoopMiddle = async (param) => {
});
};
//教培考试信息模块
// 教培考试信息模块
export const getCoopLiveExam = async (param) => {
return request({
url: `contents/projects/live/${param.id}`,
......
<template>
<div
class="nav-title"
:style="
'background:' +
bgColor +
';' +
'padding-top:' +
paddingTop
"
<div
class="nav-title"
:style="
'background:' +
bgColor +
';' +
'padding-top:' +
paddingTop
"
>
<span
class="nav-back"
@click="goBack"
>
<img
v-show="isBlack"
src="./images/left-array-black.png"
alt=""
>
<img
v-show="!isBlack"
src="./images/left-array-whiter.png"
alt=""
>
</span>
<span
v-show="bgColor !== 'none'"
class="nav-title-title"
>
{{ title }}</span>
<span
v-if="isShowRight"
class="nav-share"
@click="rightAction"
>
<span class="active-text">客服</span>
</span>
<span
v-if="!isShowRight"
class="nav-share"
@click="rightAction"
>
<span
class="nav-back"
@click="goBack"
class="active-text"
@click="share"
>
<img
v-show="isBlack"
src="./images/left-array-black.png"
v-if="isShowShare"
src="./images/share-icon-black.png"
alt=""
>
<img
v-show="!isBlack"
src="./images/left-array-whiter.png"
v-else-if="isShowShareWhite"
src="./images/share-icon-white.png"
alt=""
>
</span>
<span
v-show="bgColor !== 'none'"
class="nav-title-title"
>
{{ title }}</span>
<span
v-if="isShowRight"
class="nav-share"
@click="rightAction"
>
<span class="active-text">客服</span>
</span>
<span
v-if="!isShowRight"
class="nav-share"
@click="rightAction"
>
<span
class="active-text"
@click="share"
v-else-if="isCancel"
class="nav-share"
@click="cancelGoSearch"
>
<img
v-if="isShowShare"
src="./images/share-icon-black.png"
alt=""
>
<img
v-else-if="isShowShareWhite"
src="./images/share-icon-white.png"
alt=""
>
<span
v-else-if="isCancel"
class="nav-share"
@click="cancelGoSearch"
>
<span class="active-text">取消</span>
</span>
<span class="active-text">取消</span>
</span>
</span>
<slot name="externals" />
<!-- <span class="nav-share">
</span>
<slot name="externals" />
<!-- <span class="nav-share">
<slot></slot>
</span>-->
</div>
</div>
<!-- <section
v-if="!isWeb"
:class="isFixheader ? 'nav-top fixed' : 'nav-top'"
......@@ -188,17 +188,17 @@
};
try{
this.$rocNative.getAppVersionCode().then(res => {
if (res.versionCode < '3.7.8') {
console.log('低版本');
} else {
window.prompt(JSON.stringify({
functionName: 'getPhoneParameters',
paramJson: JSON.stringify({}),
callBackName: 'getPhoneParameters'
}));
}
if (res.versionCode < '3.7.8') {
console.log('低版本');
} else {
window.prompt(JSON.stringify({
functionName: 'getPhoneParameters',
paramJson: JSON.stringify({}),
callBackName: 'getPhoneParameters'
}));
}
});
}catch(error){
}catch(error) {
console.log(122);
}
},
......
......@@ -3,28 +3,41 @@
<!--A Cell -->
<template>
<div :class="['wxc-cell', hasTopBorder && 'cell-top-border', hasBottomBorder && 'cell-bottom-border', hasMargin && 'cell-margin', hasVerticalIndent && 'cell-indent', desc && 'has-desc']"
<div
:class="['wxc-cell', hasTopBorder && 'cell-top-border', hasBottomBorder && 'cell-bottom-border', hasMargin && 'cell-margin', hasVerticalIndent && 'cell-indent', desc && 'has-desc']"
:style="cellStyle"
:accessible="autoAccessible"
:aria-label="`${label},${title},${desc}`"
@click="cellClicked">
@click="cellClicked"
>
<slot name="label">
<div v-if="label">
<div class="cell-label-text">{{label}}</div>
<div class="cell-label-text">
{{ label }}
</div>
</div>
</slot>
<div class="cell-title">
<slot name="title">
<div class="cell-content">{{title}}</div>
<div class="cell-desc-text" v-if="desc">{{desc}}</div>
<div class="cell-content">
{{ title }}
</div>
<div
v-if="desc"
class="cell-desc-text"
>
{{ desc }}
</div>
</slot>
</div>
<slot name="value"></slot>
<slot></slot>
<img :src="arrowIcon"
class="cell-arrow-icon"
:aria-hidden="true"
v-if="hasArrow"/>
<slot name="value" />
<slot />
<img
v-if="hasArrow"
:src="arrowIcon"
class="cell-arrow-icon"
:aria-hidden="true"
>
</div>
</template>
......@@ -92,7 +105,7 @@
</style>
<script>
//import {Utils} from 'weex-ui';
// import {Utils} from 'weex-ui';
export default {
props: {
......@@ -149,7 +162,7 @@
cellClicked (e) {
const link = this.link;
this.$emit('wxcCellClicked', { e });
//link && Utils.goToH5Page(link, true);
// link && Utils.goToH5Page(link, true);
}
}
};
......
......@@ -4,11 +4,13 @@
<template>
<div>
<wxc-radio v-for="(item,i) in updateList"
:config="config"
v-bind="item"
@wxcRadioItemChecked="wxcRadioItemChecked(i,$event)"
:key="i"></wxc-radio>
<wxc-radio
v-for="(item,i) in updateList"
:key="i"
:config="config"
v-bind="item"
@wxcRadioItemChecked="wxcRadioItemChecked(i,$event)"
/>
</div>
</template>
......@@ -54,7 +56,7 @@
this.setListChecked(this.list);
},
methods: {
setListChecked(list){
setListChecked(list) {
if (list && list.length > 0) {
list.forEach((item, i) => {
item.checked && (this.checkedIndex = i);
......@@ -65,8 +67,8 @@
const oldIndex = this.checkedIndex;
const { value, title } = this.list[i];
this.checkedIndex = i;
this.$emit('wxcRadioListChecked', { value, title, oldIndex, index: i,item: this.list[i] })
this.$emit('wxcRadioListChecked', { value, title, oldIndex, index: i, item: this.list[i] });
}
}
}
};
</script>
......@@ -3,17 +3,26 @@
<template>
<div>
<div :has-bottom-border="false" class="radio-all"
@click="wxcCellClicked"
:accessible="true"
:aria-label="`${title},状态为${checked?'已选中':'未选中'},${disabled?'不可更改':''}`">
<img :src="radioIcon"
slot="label"
class="radio"/>
<div :style="{color:color}"
class="title-text"
slot="title">{{title}}</div>
<div
:has-bottom-border="false"
class="radio-all"
:accessible="true"
:aria-label="`${title},状态为${checked?'已选中':'未选中'},${disabled?'不可更改':''}`"
@click="wxcCellClicked"
>
<img
slot="label"
:src="radioIcon"
class="radio"
>
<div
slot="title"
:style="{color:color}"
class="title-text"
>
{{ title }}
</div>
</div>
</div>
</template>
......@@ -38,7 +47,7 @@
</style>
<script>
import WxcCell from './cell.vue'
import WxcCell from './cell.vue';
const CHECKED = 'https://pica-pro.oss-cn-shanghai.aliyuncs.com/eagle_plan/radio_checked.png';
const UNCHECKED = 'https://pica-pro.oss-cn-shanghai.aliyuncs.com/eagle_plan/radio_unchecked.png';
......@@ -80,7 +89,7 @@
const mergeIcon = icon;
config.checkedIcon && (mergeIcon[0] = config.checkedIcon);
config.disabledIcon && (mergeIcon[1] = config.disabledIcon);
return checked ? CHECKED : UNCHECKED;
return checked ? CHECKED : UNCHECKED;
},
backgroundColor () {
const { disabled } = this;
......@@ -97,9 +106,9 @@
wxcCellClicked () {
const { disabled, value } = this;
if (!disabled) {
this.$emit('wxcRadioItemChecked', { value, disabled })
this.$emit('wxcRadioItemChecked', { value, disabled });
}
}
}
}
};
</script>
......@@ -18,7 +18,7 @@
<img
class="see_more_img"
src="https://pica-pro.oss-cn-shanghai.aliyuncs.com/eagle_plan/arrow_right_gray%403x.png"
/>
>
</div>
</div>
<div
......@@ -42,7 +42,7 @@
<img
class="course_img"
:src="value.app_course_url"
/>
>
<div class="course_info">
{{ messages(value.course_name, 18) }}
</div>
......@@ -51,7 +51,7 @@
<img
class="play_img"
src="https://pica-pro.oss-cn-shanghai.aliyuncs.com/eagle_plan/play_gray%403x.png"
/>
>
<div class="play_count">
{{ value.join_num }}
</div>
......@@ -70,7 +70,7 @@
<script>
// text collapse
//const configurationModule = weex.requireModule('configurationModule');
// const configurationModule = weex.requireModule('configurationModule');
export default {
components: {},
......@@ -105,37 +105,37 @@
enterCourse(obj) {
this.intoCourse(obj);
},
intoCourseMore(obj){
let appModuleModel=[
{
intoCourseMore(obj) {
const appModuleModel = [
{
'key':'className',
'value':'value=com.picahealth.yunque.activitys.famousteacherschool.AllDiseaseActivity###MicroProfessionTableController'
},
{
key:'pointsId',
value:obj.points_id
}
];
this.$rocNative.dispatchEventByModuleCode({
modeCode: 'M200',
jsonString: appModuleModel,
});
},
{
key:'pointsId',
value:obj.points_id
}
];
this.$rocNative.dispatchEventByModuleCode({
modeCode: 'M200',
jsonString: appModuleModel,
});
},
intoCourse(obj){
let appModuleModel=[
{
intoCourse(obj) {
const appModuleModel = [
{
'key':'className',
'value':'value=com.picahealth.yunque.activitys.courseplaynew.CourseIntroduceActivity###WeexCourseIntroViewController'
},
{
key:'courseId',
value:obj.course_id
}
];
this.$rocNative.dispatchEventByModuleCode({
modeCode: 'M200',
jsonString: appModuleModel,
});
},
{
key:'courseId',
value:obj.course_id
}
];
this.$rocNative.dispatchEventByModuleCode({
modeCode: 'M200',
jsonString: appModuleModel,
});
}
},
......
......@@ -33,7 +33,7 @@
import textCollapse from './textCollapse';
import projectContent from './projectContent';
import aboutCourse from './aboutCourse';
//const globalEvent = weex.requireModule('globalEvent');
// const globalEvent = weex.requireModule('globalEvent');
export default {
components: {
headerSlider,
......
......@@ -34,7 +34,9 @@
:maxlength="number"
autofocus="true"
autocorrect="off"
autocomplete="off" autocapitalize="off" @keyup="handleInput($event)"
autocomplete="off"
autocapitalize="off"
@keyup="handleInput($event)"
>
<label for="code">
<div class="code-input-wrap">
......
......@@ -18,7 +18,7 @@
<img
class="history_title_img"
src="https://pica-pro.oss-cn-shanghai.aliyuncs.com/eagle_plan/arrow_right_gray%403x.png"
/>
>
</div>
</div>
<div
......@@ -34,12 +34,12 @@
v-if="value.passFlag == 5"
class="history_item_radio"
src="https://pica-pro.oss-cn-shanghai.aliyuncs.com/eagle_plan/eee%403x.png"
/>
>
<img
v-if="value.passFlag != 5"
class="history_item_radio"
src="https://pica-pro.oss-cn-shanghai.aliyuncs.com/eagle_plan/ee%403x.png"
/>
>
<div
v-if="key+1<historyList.length"
class="history_item_radio_bottom"
......@@ -82,7 +82,7 @@
v-if="value.wrongNo > 0"
class="history_item_right_img"
src="https://pica-pro.oss-cn-shanghai.aliyuncs.com/eagle_plan/arrow_right_gray%403x.png"
/>
>
</div>
</div>
</div>
......
......@@ -5,17 +5,17 @@
v-if="type == 0"
class="result_image"
src="https://pica-pro.oss-cn-shanghai.aliyuncs.com/eagle_plan/yh%403x.png"
/>
>
<img
v-if="type == 1"
class="result_image"
src="https://pica-pro.oss-cn-shanghai.aliyuncs.com/eagle_plan/tg%403x.png"
/>
>
<img
v-if="type == 2"
class="result_image"
src="https://pica-pro.oss-cn-shanghai.aliyuncs.com/eagle_plan/ks%403x.png"
/>
>
<div class="exam_name">
<div
v-if="type == 2"
......@@ -66,7 +66,7 @@
<img
class="exam_time_img"
src="https://pica-pro.oss-cn-shanghai.aliyuncs.com/eagle_plan/arrow_right_black%403x.png"
/>
>
</div>
</div>
<div
......@@ -113,11 +113,11 @@
<script>
// text collapse
//const modal = weex.requireModule('modal');
// const modal = weex.requireModule('modal');
// import {click_start_test, click_test_completed, click_retest, click_mid_wrong_collection} from '../../util/buryingPoint';
//import WxcDialog from '../../components/wxc-dialog';
// import WxcDialog from '../../components/wxc-dialog';
export default {
//components: {WxcDialog},
// components: {WxcDialog},
props:['type', 'exam', 'startNum', 'endNum', 'examType', 'options', 'hasWrong'],
data() {
return{
......@@ -163,13 +163,13 @@
const endDate = new Date(this.options.endDate);
const date = new Date();
if(date > endDate) {
this.showExamFinishedTip = true;
this.$dialog.alert({
title: '',
message: "考试已结束",
confirmButtonText:"我知道了"
})
return;
this.showExamFinishedTip = true;
this.$dialog.alert({
title: '',
message: '考试已结束',
confirmButtonText:'我知道了'
});
return;
}
}
// this.appBuryingPointEntrust({
......@@ -178,12 +178,12 @@
// });
const query = {
examId: obj.examId,
// examType: this.options.examType,
examType: this.$route.query.examType,
endDate: this.$route.query.endDate
};
if (this.startNum > 0) {
Vue.set(query, 'startNum', this.startNum);
query.startNum = this.startNum;
// Vue.set(query, 'startNum', this.startNum);
}
this.$router.push({
path: '/exam',
......@@ -198,7 +198,7 @@
this.$router.push({
path: '/stoke'
});
//weex.requireModule('CourseModule').goBack(2);
// weex.requireModule('CourseModule').goBack(2);
} else {
this.$router.push({
path: '/'
......@@ -206,16 +206,12 @@
}
}
},
goExamStart(obj) { // 我要重考
goExamStart() { // 我要重考
if (!this.endNum) {
this.$toast('您尚未完成相关培训课程的学习')
this.$toast('您尚未完成相关培训课程的学习');
}else {
this.$emit('reExamStart');
}
// this.appBuryingPointEntrust({
// ...click_retest,
// createdTime: new Date().getTime()
// });
},
},
......
......@@ -17,7 +17,7 @@
v-lazy="img.image_url"
class="image"
resize="stretch"
/>
>
</van-swipe-item>
</van-swipe>
</div>
......
......@@ -18,7 +18,7 @@
<img
class="history_title_img"
src="https://pica-pro.oss-cn-shanghai.aliyuncs.com/eagle_plan/arrow_right_gray%403x.png"
/>
>
</div>
</div>
......@@ -46,7 +46,7 @@
<img
class="item3_right_arrow"
src="https://pica-pro.oss-cn-shanghai.aliyuncs.com/eagle_plan/arrow_right_black%403x.png"
/>
>
</div>
<div
v-if="value.restTimes > 0 || value.restTimes == -1"
......@@ -65,7 +65,7 @@
<img
class="empty-img"
src="https://pica-pro.oss-cn-shanghai.aliyuncs.com/eagle_plan/wu%402x.png"
/>
>
<div class="empty-text">
暂无现场考试记录
</div>
......
......@@ -18,7 +18,7 @@
<img
class="history_title_img"
src="https://pica-pro.oss-cn-shanghai.aliyuncs.com/eagle_plan/arrow_right_gray%403x.png"
/>
>
</div>
</div>
......@@ -46,7 +46,7 @@
<img
class="item3_right_arrow"
src="https://pica-pro.oss-cn-shanghai.aliyuncs.com/eagle_plan/arrow_right_black%403x.png"
/>
>
</div>
<div
v-if="value.restTimes > 0 || value.restTimes == -1"
......@@ -65,7 +65,7 @@
<img
class="empty-img"
src="https://pica-pro.oss-cn-shanghai.aliyuncs.com/eagle_plan/wu%402x.png"
/>
>
<div class="empty-text">
暂无现场考试记录
</div>
......
......@@ -13,18 +13,19 @@
src="http://pica-pro.oss-cn-shanghai.aliyuncs.com/md_resources/back_gray.png"
style="width: 25px; height: 25px;"
@click="goBack"
/>
>
<div
v-if="!showHeader"
style="width:25px;height: 25px;"
>&nbsp;
>
&nbsp;
</div>
<img
v-if="type == 2"
src="https://pica-pro.oss-cn-shanghai.aliyuncs.com/eagle_plan/close%403x.png"
style="width: 35px; height: 35px;"
@click="goBack"
/>
>
<div class="title">
{{ title }}
</div>
......
......@@ -20,7 +20,7 @@
<img
class="advice_auth_img"
src="https://pica-pro.oss-cn-shanghai.aliyuncs.com/eagle_plan/cup%403x.png"
/>
>
<div class="advice_auth_text">
<div class="advice_auth_text_content">
{{ examContent.all_exam_writing }}
......@@ -37,7 +37,7 @@
v-if="examContent.exam_order == 5"
class="circle_gray"
:src="examContent.allowFlag==1 ? circleYellow: circleGray"
/>
>
<div
v-if="examContent.exam_order == 1"
class="order_number"
......@@ -125,34 +125,17 @@
<img
class="item3_right_arrow"
src="https://pica-pro.oss-cn-shanghai.aliyuncs.com/eagle_plan/arrow_right_black%403x.png"
/>
>
</div>
</div>
</div>
</div>
<!-- <wxc-dialog
title=""
:content="setContent"
:show="isQuery"
cancel-text="取消"
confirm-text="去考试"
main-btn-color="#35cbca"
@wxcDialogCancelBtnClicked="wxcDialogCancelBtnClicked"
@wxcDialogConfirmBtnClicked="wxcDialogConfirmBtnClicked"
/> 1111-->
</div>
</template>
<script>
// text collapse
import Vue from 'vue';
// const modal = weex.requireModule('modal');
// const configurationModule = weex.requireModule('configurationModule');
// import wxcDialog from '../wxc-dialog';
// const storage = weex.requireModule('storage');
import {getCoopRoleCode} from '@/api/content.js';
export default {
//components: {wxcDialog},
props:['examContent', 'hasAuth', 'keyIndex'],
data() {
return{
......@@ -240,45 +223,28 @@
roleCode: 'R001',
user_role_list: ''
};
getCoopRoleCode().catch(res=>{
getCoopRoleCode().catch(res => {
if(res.data && res.data.respCode == 200) {
sendObj.roleCode = res.data.roleCode;
const mess = obj.field_requirement ? obj.field_requirement : -1;
sendObj.field_requirement = mess;
sendObj.user_role_list = obj.user_role_list;
console.log(sendObj,"sendObjsendObj")
if(sendObj.user_role_list=="R004"){
console.log(sendObj, 'sendObjsendObj');
if(sendObj.user_role_list == 'R004') {
this.dataOkForExam();
}
//configurationModule.checkIDCardAndEducation(sendObj); 111
// configurationModule.checkIDCardAndEducation(sendObj); 111
}else {
this.$toast("网络异常,请稍后再试");
this.$toast('网络异常,请稍后再试');
}
});
// this.GET('contents/projects/guestRoleCode', {}, (res) => {
// // modal.alert({message:'goIDCardAndEdu ' + res})
// const configurationModule = weex.requireModule('configurationModule');
// if(res.data && res.data.respCode == 200) {
// sendObj.roleCode = res.data.roleCode;
// const mess = obj.field_requirement ? obj.field_requirement : -1;
// sendObj.field_requirement = mess;
// sendObj.user_role_list = obj.user_role_list;
// // modal.alert({message:'goIDCardAndEdu 200' + JSON.stringify(sendObj)})
// configurationModule.checkIDCardAndEducation(sendObj);
// }else {
// modal.toast({
// message: '网络异常,请稍后再试',
// duration: 1.0
// });
// }
// });
},
dataOkForExam() {
this.addLogicForExam();
this.addLogicForExam();
},
goExam(index, obj) {
this.$storejs.set('keyIndex',this.keyIndex)
//localStorage.setItem('keyIndex', this.keyIndex)
this.$storejs.set('keyIndex', this.keyIndex);
// localStorage.setItem('keyIndex', this.keyIndex)
if (this.examContent.allowFlag == 1) {// 加入项目(项目考试组件有权限)
this.currentIndex = index;
this.currentObj = obj;
......@@ -288,7 +254,7 @@
this.$toast(this.examNotStartLabl);
}
}else {// 未加入项目
this.$toast(this.examContent.show_text);
this.$toast(this.examContent.show_text);
}
},
......@@ -315,7 +281,6 @@
const isGoExam = this.getBoolForExam(obj);
if (isGoExam) {// 去重考
if ((index == 0 || index == 1) || (index > 0 && !this.examContent.allLists[index - 1].course_id)) {//
// modal.alert({message:'111'})
this.query = {
examId: obj.exam_id,
origin: 'start'
......@@ -345,11 +310,7 @@
this.isQuery = true;
this.diaLogConfirm();
}else{
this.$toast('您尚未完成“' + course_name + '”培训课程的学习。')
// modal.toast({
// message: ,
// duration: 1.0
// });
this.$toast('您尚未完成“' + course_name + '”培训课程的学习。');
}
}
}
......@@ -364,16 +325,13 @@
const lastItem = this.examContent.allLists[index - 1];
if (lastItem.progress < 100) {
this.beforeLearningExamNumber = obj.times == -1 ? 100 : (obj.times - obj.exam_num);
Vue.set(this.query, 'endNum', this.beforeLearningExamNumber);
this.$set(this.query, 'endNum', this.beforeLearningExamNumber);
// Vue.set(this.query, 'endNum', this.beforeLearningExamNumber);
}
}
this.currentIndex = index;
this.currentObj = obj;
this.goIDCardAndEdu(obj);
// this.$router.push({
// path:'/exam_result',
// query: this.query
// })
}
}else{// 没有考试
if (index > 0) {// 大于第一项
......@@ -388,12 +346,7 @@
this.currentIndex = index;
this.currentObj = obj;
this.goIDCardAndEdu(obj);
// this.$router.push({
// path:'/exam_result',
// query: this.query
// })
}else {
// modal.alert({message:'666'})
let flag = false;
if (this.examContent.exam_order == 1) {// 考试顺序--序贯
for (let i = 0; i < index; i++) {
......@@ -409,10 +362,6 @@
}
if (flag) {
this.$toast('请按顺序完成学习及考试');
// modal.toast({
// message: '请按顺序完成学习及考试',
// duration: 1.0
// });
}else {
const course_name = this.examContent.allLists[index - 1].course_name;
if (obj.times > 0 || obj.times == -1) {// 学习课程前的考试次数
......@@ -424,7 +373,7 @@
this.isQuery = true;
this.diaLogConfirm();
}else{
this.$toast('您尚未完成“' + course_name + '”培训课程的学习。')
this.$toast('您尚未完成“' + course_name + '”培训课程的学习。');
}
}
}
......@@ -440,10 +389,7 @@
this.currentObj = obj;
this.goIDCardAndEdu(obj);
}else {
// modal.toast({
// message: '请按顺序完成学习及考试',
// duration: 1.0
// });
this.$toast('请按顺序完成学习及考试');
}
}
}else { // 第一项
......@@ -457,54 +403,52 @@
}
}
}else {// 课程项
console.log(obj,"iiiiiiiiiii")
console.log(obj, 'iiiiiiiiiii');
if (this.examContent.exam_order == 5 || index == 0) { // 顺序并列, 或者顺序贯序但为第一项
// modal.alert({message:'999'})
//configurationModule.intoCourse(obj);
this.goStudyNative(obj)
this.goStudyNative(obj);
}else {
const lastItem = this.examContent.allLists[index - 1];
if ((lastItem.testNumFlag > 0 && lastItem.answerResultModel.pass_flag == 5) || lastItem.progress >= 0) {
//configurationModule.intoCourse(obj);
this.goStudyNative(obj)
// configurationModule.intoCourse(obj);
this.goStudyNative(obj);
}else {
this.$toast('请按顺序完成学习及考试')
this.$toast('请按顺序完成学习及考试');
}
}
}
},
goStudyNative(obj){
let appModuleModel=[
{
goStudyNative(obj) {
const appModuleModel = [
{
'key':'className',
'value':'value=com.picahealth.yunque.activitys.courseplaynew.CourseIntroduceActivity###WeexCourseIntroViewController'
},
{
key:'courseId',
value:obj.course_id
}
];
this.$rocNative.dispatchEventByModuleCode({
modeCode: 'M200',
jsonString: appModuleModel,
});
},
{
key:'courseId',
value:obj.course_id
}
];
this.$rocNative.dispatchEventByModuleCode({
modeCode: 'M200',
jsonString: appModuleModel,
});
},
diaLogConfirm(){
diaLogConfirm() {
this.$dialog
.confirm({
title: '提醒',
message: this.setContent,
cancelButtonText: '取消',
confirmButtonText: '去考试',
confirmButtonColor: '#94dcd2',
cancelButtonColor: '#666',
})
.then(() => {
this.wxcDialogConfirmBtnClicked();
})
.catch(() => {
this.wxcDialogCancelBtnClicked();
});
.confirm({
title: '提醒',
message: this.setContent,
cancelButtonText: '取消',
confirmButtonText: '去考试',
confirmButtonColor: '#94dcd2',
cancelButtonColor: '#666',
})
.then(() => {
this.wxcDialogConfirmBtnClicked();
})
.catch(() => {
this.wxcDialogCancelBtnClicked();
});
},
wxcDialogCancelBtnClicked () {
// 此处必须设置,组件为无状态组件,自己管理
......@@ -518,7 +462,8 @@
origin: 'start'
};
if (this.beforeLearningExamNumber > 0) {
Vue.set(this.query, 'startNum', this.beforeLearningExamNumber);
this.$set(this.query, 'startNum', this.beforeLearningExamNumber);
// Vue.set(this.query, 'startNum', this.beforeLearningExamNumber);
}
this.goIDCardAndEdu(this.currentObj);
}
......
......@@ -3,11 +3,19 @@
<div
ref="textRef"
>
<div class="ele-content" :class="{'ele-contentOther':status}">
<div
class="ele-content"
:class="{'ele-contentOther':status}"
>
<span>简介:</span>
{{ message }}
</div>
<div @click="seeMore" class="ele-content-btn"> {{ status ? '显示全部' : '收起' }}</div>
</div>
<div
class="ele-content-btn"
@click="seeMore"
>
{{ status ? '显示全部' : '收起' }}
</div>
</div>
<div
class="see_more"
......@@ -21,9 +29,6 @@
</template>
<script>
// text collapse
// const dom = weex.requireModule('dom');
export default {
components: {},
props:['infoMsg'],
......@@ -35,31 +40,19 @@
},
computed: {
message: function() {
return this.infoMsg.textModuleList[0].content
return this.infoMsg.textModuleList[0].content;
}
},
created () {
},
mounted() {
this.init();
},
methods: {
getShortBrief(str) {
},
init() {
console.log(this.infoMsg.textModuleList[0])
},
seeMore() {
this.status=!this.status;
this.status = !this.status;
}
},
};
</script>
<style scoped>
.message-backups {
position: fixed;
......
......@@ -35,7 +35,8 @@ import {
Sticky,
Collapse,
CollapseItem,
CountDown
CountDown,
PullRefresh
} from 'vant';
Vue.use(List)
......@@ -73,4 +74,5 @@ Vue.use(List)
.use(Sticky)
.use(Collapse)
.use(CollapseItem)
.use(CountDown);
.use(CountDown)
.use(PullRefresh);
......@@ -20,22 +20,22 @@ const routerConfig = [
},
{
path: '/exam-result',
name: 'exam-result',
name: 'examResult',
component: () => import('@/views/examResult/index.vue')
},
{
path: '/exam-wrong',
name: 'exam-wrong',
name: 'examWrong',
component: () => import('@/views/exam/exam_wrong.vue')
},
{
{
path: '/exam-history',
name: 'exam-history',
name: 'examHistory',
component: () => import('@/views/exam/exam_history.vue')
},
{
path: '/local-exam-history',
name: 'local-exam-history',
name: 'localExamHistory',
component: () => import('@/views/exam/local_exam_history')
},
{
......
......@@ -38,28 +38,28 @@
import { listRelatives, list } from '@/api/home';
export default {
name: 'Home',
data() {
return {
token:'F65FDAEE03F34EA78490050B8A83BF95'
};
},
computed: {
count () {
return this.$store.state.home.count;
}
},
data(){
return {
token:"F65FDAEE03F34EA78490050B8A83BF95"
}
},
mounted () {
getCoopTop({id:4,token:this.token}).then((res)=>{
console.log(res);
if(res && res.data){
this.infoLists = res.data.texts; // 简介(文案)组件
this.sliderLists = res.data.carousels; // 轮播图组件
this.projectName = res.data.projectName; // 项目名称
this.projectName = this.getLength(this.projectName, 8);
}else{
this.$toast(res.message);
}
});
getCoopTop({id:4, token:this.token}).then((res) => {
console.log(res);
if(res && res.data) {
this.infoLists = res.data.texts; // 简介(文案)组件
this.sliderLists = res.data.carousels; // 轮播图组件
this.projectName = res.data.projectName; // 项目名称
this.projectName = this.getLength(this.projectName, 8);
}else{
this.$toast(res.message);
}
});
console.log(this.$route.meta); // {requiresAuth: true}
},
methods: {
......
<template>
<scroller show-scrollbar="false" class="back-fff">
<div class="contenter">
<exam-history :showHeaderH="showHeaderH" :historyList="historyList" :examId="id" :examType="examType"></exam-history>
<pica-header title="考试记录" @goBack="goBack" showHeader="true"></pica-header>
<div class="history-nomore" v-if="historyList.length > 0">
<div class="nomore-text">没有更多记录了</div>
</div>
<template>
<scroller
show-scrollbar="false"
class="back-fff"
>
<div class="contenter">
<exam-history
:show-header-h="showHeaderH"
:history-list="historyList"
:exam-id="id"
:exam-type="examType"
/>
<pica-header
title="考试记录"
show-header="true"
@goBack="goBack"
/>
<div
v-if="historyList.length > 0"
class="history-nomore"
>
<div class="nomore-text">
没有更多记录了
</div>
</scroller>
</div>
</div>
</scroller>
</template>
<style scoped>
......@@ -22,43 +38,43 @@
</style>
<script>
import storejs from 'storejs';
import picaHeader from '@/components/stroke/picaHeader'
import examHistory from '@/components/stroke/examHistory'
import { getCoopExamResultNews ,getCoopResultNewsLocal} from '@/api/exam.js';
export default {
data: () => ({
id: '',
isPassExam: false,
showHeaderH:false,
historyList:[],
examType: '',
token:""
}),
computed: {
},
components:{picaHeader,examHistory},
created () {
// this.historyList = this.$route.query.historyList
this.id = this.$route.query.examId;
this.token=storejs.get('token');
this.init()
},
methods: {
init(){
let funCoop = getCoopExamResultNews
if(this.$route.query.examType == 'local'){
funCoop=getCoopResultNewsLocal
}
funCoop({examId:this.id,token:this.token}).catch(res=>{
this.historyList = res.data.examRecordList
this.historyList.map(res=>{
res.createdTime = res.createdTime.substring(0,10)
})
})
import storejs from 'storejs';
import picaHeader from '@/components/stroke/picaHeader';
import examHistory from '@/components/stroke/examHistory';
import { getCoopExamResultNews, getCoopResultNewsLocal} from '@/api/exam.js';
export default {
components:{picaHeader, examHistory},
data: () => ({
id: '',
isPassExam: false,
showHeaderH:false,
historyList:[],
examType: '',
token:''
}),
computed: {
},
created () {
// this.historyList = this.$route.query.historyList
this.id = this.$route.query.examId;
this.token = storejs.get('token');
this.init();
},
methods: {
init() {
let funCoop = getCoopExamResultNews;
if(this.$route.query.examType == 'local') {
funCoop = getCoopResultNewsLocal;
}
}
}
funCoop({examId:this.id, token:this.token}).catch(res => {
this.historyList = res.data.examRecordList;
this.historyList.map(res => {
res.createdTime = res.createdTime.substring(0, 10);
});
});
}
}
};
</script>
<style scoped>
.history-nomore{
......
<template>
<list>
<cell>
<div class="head-fixed">
<div class="head-bg" :style="{backgroundColor: headBg, height: '5px'}"></div>
<div class="head wrap">
<img @click="back" src="http://pica-pro.oss-cn-shanghai.aliyuncs.com/md_resources/back_gray.png" style="width: 25px; height: 25px;"/>
<text class="title">错题集</text>
<text class="empty"></text>
</div>
</div>
<div class="img-wrap">
<img src="https://pica-pro.oss-cn-shanghai.aliyuncs.com/eagle_plan/icon_report_grey.png" style="width: 53px; height: 65px;"/>
</div>
<div class="result-wrap">
<div style="font-size: 16px;">正确题目数 :{{rightNum}}</div>
<div style="padding-left: 15px;font-size: 16px;">错误题目数 :</div>
<div style="color: #d84a38;font-size: 16px;">{{wrongNum}}</div>
</div>
<div style="padding: 0 15px">
<div class="separator"></div>
</div>
<div class="info">
<div style="font-size: 20px; padding-bottom: 20px; padding-top: 10px;">试题分析</div>
<div class="detail" v-for="(wrong,index) in wrongList" :key="index">
<div class="question-index">{{wrong.seqNo}}题:</div>
<div class="question-title">{{wrong.question}}</div>
<div class="answer" style="color: #d84a38;">您的答案:{{wrong.answer}}</div>
<div class="answer" style="color: #35CBCA;">正确答案:{{wrong.correctAnswer}}</div>
</div>
</div>
<!-- <wxc-loading :show="showLoading"></wxc-loading> -->
</cell>
</list>
<list>
<cell>
<div class="head-fixed">
<div
class="head-bg"
:style="{backgroundColor: headBg, height: '5px'}"
/>
<div class="head wrap">
<img
src="http://pica-pro.oss-cn-shanghai.aliyuncs.com/md_resources/back_gray.png"
style="width: 25px; height: 25px;"
@click="back"
>
<text class="title">
错题集
</text>
<text class="empty" />
</div>
</div>
<div class="img-wrap">
<img
src="https://pica-pro.oss-cn-shanghai.aliyuncs.com/eagle_plan/icon_report_grey.png"
style="width: 53px; height: 65px;"
>
</div>
<div class="result-wrap">
<div style="font-size: 16px;">
正确题目数 :{{ rightNum }}
</div>
<div style="padding-left: 15px;font-size: 16px;">
错误题目数 :
</div>
<div style="color: #d84a38;font-size: 16px;">
{{ wrongNum }}
</div>
</div>
<div style="padding: 0 15px">
<div class="separator" />
</div>
<div class="info">
<div style="font-size: 20px; padding-bottom: 20px; padding-top: 10px;">
试题分析
</div>
<div
v-for="(wrong,index) in wrongList"
:key="index"
class="detail"
>
<div class="question-index">
{{ wrong.seqNo }}题:
</div>
<div class="question-title">
{{ wrong.question }}
</div>
<div
class="answer"
style="color: #d84a38;"
>
您的答案:{{ wrong.answer }}
</div>
<div
class="answer"
style="color: #35CBCA;"
>
正确答案:{{ wrong.correctAnswer }}
</div>
</div>
</div>
<!-- <wxc-loading :show="showLoading"></wxc-loading> -->
</cell>
</list>
</template>
<style scoped>
......@@ -114,47 +152,47 @@
<script>
// import { WxcLoading } from 'weex-ui'
// import WxcLoading from '../../components/wxc-loading'
//let modal = weex.requireModule('modal')
//import WxcLoading from '../../components/wxc-loading'
// let modal = weex.requireModule('modal')
// import WxcLoading from '../../components/wxc-loading'
import { getCoopExamWrongRecords} from '@/api/exam.js';
export default {
//components: { WxcLoading },
data: () => ({
showLoading: false,
wrongList: [],
rightNum: '',
wrongNum: '',
headBg: '#ffffff',
headHeight: 0,
token:""
}),
computed: {
export default {
// components: { WxcLoading },
data: () => ({
showLoading: false,
wrongList: [],
rightNum: '',
wrongNum: '',
headBg: '#ffffff',
headHeight: 0,
token:''
}),
computed: {
},
created () {
this.token=this.$storejs.get('token');
this.init();
},
methods: {
init() {
this.showLoading = true;
let para = {
answerResultId: this.$route.query.answerResultId,
type: 5,
created () {
this.token = this.$storejs.get('token');
this.init();
},
methods: {
init() {
this.showLoading = true;
const para = {
answerResultId: this.$route.query.answerResultId,
type: 5,
token:this.token
};
getCoopExamWrongRecords(para).catch(res=>{
this.showLoading = false
let data = res.data;
if(data.respCode == 200) {
this.wrongList = data.wrongList
this.rightNum = data.correctNo
this.wrongNum = data.wrongNo
} else {
this.$toast(data.respMsg);
}
})
// this.GET('app/projectExam/wrongs', para, res => {
// this.showLoading = false
getCoopExamWrongRecords(para).catch(res => {
this.showLoading = false;
const data = res.data;
if(data.respCode == 200) {
this.wrongList = data.wrongList;
this.rightNum = data.correctNo;
this.wrongNum = data.wrongNo;
} else {
this.$toast(data.respMsg);
}
});
// this.GET('app/projectExam/wrongs', para, res => {
// this.showLoading = false
// let data = res.data;
// if(data.respCode == 200) {
// this.wrongList = data.wrongList
......@@ -163,11 +201,11 @@
// } else {
// this.$toast(data.respMsg);
// }
// })
},
back() {
this.$router.go(-1)
}
}
}
// })
},
back() {
this.$router.go(-1);
}
}
};
</script>
\ No newline at end of file
<template>
<list>
<cell>
<div class="head-fixed">
<div class="head-bg" :style="{backgroundColor: headBg, height:'15px'}"></div>
<div class="head wrap">
<div @click="giveUp" class="back-wrap">
<img src="http://pica-pro.oss-cn-shanghai.aliyuncs.com/md_resources/back_gray.png" style="width: 25px; height: 25px;"/>
<div class="back-txt">放弃考试</div>
</div>
<text class="empty"></text>
<div class="time-left">
<div class="time-label">剩余时间 </div>
<van-count-down :time="TIME" format="mm:ss">
<template #default="timeData">
<!-- <span class="block">{{ timeData.hours }}</span>
<list>
<cell>
<div class="head-fixed">
<div
class="head-bg"
:style="{backgroundColor: headBg, height:'15px'}"
/>
<div class="head wrap">
<div
class="back-wrap"
@click="giveUp"
>
<img
src="http://pica-pro.oss-cn-shanghai.aliyuncs.com/md_resources/back_gray.png"
style="width: 25px; height: 25px;"
>
<div class="back-txt">
放弃考试
</div>
</div>
<text class="empty" />
<div class="time-left">
<div class="time-label">
剩余时间
</div>
<van-count-down
:time="TIME"
format="mm:ss"
>
<template #default="timeData">
<!-- <span class="block">{{ timeData.hours }}</span>
<span class="colon">:</span> -->
<span class="block">{{ timeData.minutes }}</span>
<span class="colon">:</span>
<span class="block">{{ timeData.seconds }}</span>
</template>
</van-count-down>
<!-- <wxc-countdown v-if="isInitFinished" tpl="{m}:{s}" :time="TIME" class="time" @wxcOnComplete="timeout"
<span class="block">{{ timeData.minutes }}</span>
<span class="colon">:</span>
<span class="block">{{ timeData.seconds }}</span>
</template>
</van-count-down>
<!-- <wxc-countdown v-if="isInitFinished" tpl="{m}:{s}" :time="TIME" class="time" @wxcOnComplete="timeout"
:timeBoxStyle="{backgroundColor: '#ffffff', width: '50px', height: '50px', paddingBottom: '10px'}"
:timeTextStyle="{fontSize: '38px', color: 'rgb(51,51,51)'}"
:dotTextStyle="{color: 'rgb(51,51,51)', fontSize: '38px', fontWeight: '400'}"
:dotBoxStyle="{width: '35px', paddingBottom: '10px'}">
</wxc-countdown> 111-->
</div>
</div>
</div>
</div>
</div>
</div>
<div class="questions-wrap">
<div class="question" v-for="(item, index) in questions" :ref="'question_' + index" :key="index">
<div class="description">{{index + 1}}:{{item.name}}</div>
<pica-radio :list="item.answerList" @wxcRadioListChecked="select"></pica-radio>
</div>
</div>
<div class="questions-wrap">
<div
v-for="(item, index) in questions"
:ref="'question_' + index"
:key="index"
class="question"
>
<div class="description">
{{ index + 1 }}:{{ item.name }}
</div>
<pica-radio
:list="item.answerList"
@wxcRadioListChecked="select"
/>
</div>
</div>
<div class="submit-wrap">
<div class="select-status">
<div class="status-label">已答题:</div>
<div class="status-value">{{selectedCount}}/{{questions.length}}</div>
</div>
<div>
<van-button type="primary" class="coop-btn" @click="submitQuery">{{isSubmitting ? '提交中' : '提交'}}</van-button>
</div>
<!-- <wxc-button :btnStyle="submitBtnStyle" :text="isSubmitting ? '提交中' : '提交'"
<div class="submit-wrap">
<div class="select-status">
<div class="status-label">
已答题:
</div>
<div class="status-value">
{{ selectedCount }}/{{ questions.length }}
</div>
</div>
<div>
<van-button
type="primary"
class="coop-btn"
@click="submitQuery"
>
{{ isSubmitting ? '提交中' : '提交' }}
</van-button>
</div>
<!-- <wxc-button :btnStyle="submitBtnStyle" :text="isSubmitting ? '提交中' : '提交'"
@wxcButtonClicked="submitQuery"></wxc-button> 111-->
</div>
</div>
<!-- <wxc-dialog confirm-text="提交考卷"
<!-- <wxc-dialog confirm-text="提交考卷"
cancel-text="再想一下"
:show="showSubmitConfirm"
main-btn-color="#2ab9a5"
......@@ -87,9 +123,8 @@
</wxc-dialog>
<wxc-loading :show="showLoading"></wxc-loading> -->
</cell>
</list>
</cell>
</list>
</template>
<style scoped>
......@@ -215,24 +250,24 @@
</style>
<script>
//import { WxcButton, WxcMinibar, WxcCountdown } from 'weex-ui'
// import { WxcButton, WxcMinibar, WxcCountdown } from 'weex-ui'
// import WxcLoading from '../../components/wxc-loading'
import PicaRadio from '@/components/pica-radio'
// import WxcDialog from '../../components/wxc-dialog'
import PicaRadio from '@/components/pica-radio';
// import WxcDialog from '../../components/wxc-dialog'
// import {click_submit_test,click_cancel_test} from '../../util/buryingPoint'
// let modal = weex.requireModule('modal')
//let navigator = weex.requireModule('navigator')
// const storage = weex.requireModule('storage')
// const dom = weex.requireModule('dom')
// let modal = weex.requireModule('modal')
// let navigator = weex.requireModule('navigator')
// const storage = weex.requireModule('storage')
// const dom = weex.requireModule('dom')
import { getCoopExamQuest,getAnwserExam} from '@/api/exam.js';
export default {
components: {
import { getCoopExamQuest, getAnwserExam} from '@/api/exam.js';
export default {
components: {
PicaRadio
// WxcButton, WxcDialog, WxcLoading, WxcMinibar,
// WxcButton, WxcDialog, WxcLoading, WxcMinibar,
// PicaRadio, WxcCountdown
},
data() {
data() {
return{
selected: {},
selectedCount: 0,
......@@ -251,244 +286,255 @@ export default {
startNum: -1,
isSubmitting: false,
submitBtnStyle: {
width: '230px',
fontSize: '40px',
borderRadius: 0,
backgroundColor: '#58b5a8',
},
token:""
}
},
computed: {
width: '230px',
fontSize: '40px',
borderRadius: 0,
backgroundColor: '#58b5a8',
},
created () {
this.token=this.$storejs.get('token');
this.startNum = this.$route.query.startNum || -1
this.init();
// weex.requireModule('globalEvent').addEventListener("goPreviousPage", e=> {//监听物理返回上一页
// this.back()
// });
},
token:''
};
},
computed: {
},
created () {
this.token = this.$storejs.get('token');
this.startNum = this.$route.query.startNum || -1;
this.init();
// weex.requireModule('globalEvent').addEventListener("goPreviousPage", e=> {//监听物理返回上一页
// this.back()
// });
},
methods: {
isAllSelected() {
return this.selectedCount && this.questions.length == this.selectedCount
},
getCorrectId(list) {
for(var i = 0, len = list.length; i < len; i++) {
if(list[i].type == 1) {
return list[i].id
}
}
},
format(questions) {
questions.forEach( (question, i) => {
let choices = ['a', 'b', 'c', 'd']
let correctId = this.getCorrectId(question.answerList)
question.answerList.forEach( (answer, j) => {
answer.title = choices[j].toUpperCase() + '. ' + answer.answer
answer.value = choices[j].toUpperCase()
answer.index = i
answer.seqNo = i + 1
answer.correctId = correctId
answer.questionType = question.type
answer.answerId = answer.id
})
})
return questions
},
init() {
let para = {
methods: {
isAllSelected() {
return this.selectedCount && this.questions.length == this.selectedCount;
},
getCorrectId(list) {
for(var i = 0, len = list.length; i < len; i++) {
if(list[i].type == 1) {
return list[i].id;
}
}
},
format(questions) {
questions.forEach( (question, i) => {
const choices = ['a', 'b', 'c', 'd'];
const correctId = this.getCorrectId(question.answerList);
question.answerList.forEach( (answer, j) => {
answer.title = choices[j].toUpperCase() + '. ' + answer.answer;
answer.value = choices[j].toUpperCase();
answer.index = i;
answer.seqNo = i + 1;
answer.correctId = correctId;
answer.questionType = question.type;
answer.answerId = answer.id;
});
});
return questions;
},
init() {
const para = {
'examId': this.$route.query.examId,
'type': 5,
'token':this.token
'type': 5,
'token':this.token
};
getCoopExamQuest(para).catch(res=>{
this.showLoading = false
let data = res.data;
if(data.respCode == 200) {
this.isInitFinished = true
this.questions = this.format(data.questionList)
this.examTime = data.examTime*1000
this.TIME = new Date().getTime() + this.examTime
console.log(this.TIME,"----000-----");
} else {
this.$toast(data.respMsg);
getCoopExamQuest(para).catch(res => {
this.showLoading = false;
const data = res.data;
if(data.respCode == 200) {
this.isInitFinished = true;
this.questions = this.format(data.questionList);
this.examTime = data.examTime * 1000;
this.TIME = new Date().getTime() + this.examTime;
} else {
this.$toast(data.respMsg);
}
})
// this.GET('app/projectExam/questions', para, res => {
// this.showLoading = false
});
// this.GET('app/projectExam/questions', para, res => {
// this.showLoading = false
// let data = res.data
// if(data.respCode == 200) {
// this.isInitFinished = true
// this.questions = this.format(data.questionList)
// this.isInitFinished = true
// this.questions = this.format(data.questionList)
// this.examTime = data.examTime*1000
// this.TIME = new Date().getTime() + this.examTime
// } else {
// this.toast({
// this.toast({
// message: data.respMsg
// })
// }
// })
},
back() {
},
back() {
this.$router.go(-1);
//weex.requireModule('eventModule').backPreviousPage({})
},
getUnselected() {
let result = []
let selected = this.selected
this.questions.forEach( (question, i) => {
if(!selected[i]) {
result.push({
questionId: question.id,
correctId: question.answerList[0].correctId,
answerId: 0,
questionType: question.type,
seqNo: question.answerList[0].seqNo,
type: 2
})
}
})
return result
// weex.requireModule('eventModule').backPreviousPage({})
},
getAnswerTime() {
let surplusTime = this.TIME - new Date().getTime()
return surplusTime > 0 ? Math.floor((this.examTime - surplusTime)/1000) : this.examTime/1000
},
submit() {
let para = {
answerTime: this.getAnswerTime(),
examId: this.$route.query.examId,
type: 5
}
let resultList = []
Object.keys(this.selected).forEach( attr => {
resultList.push(this.selected[attr])
getUnselected() {
const result = [];
const selected = this.selected;
this.questions.forEach( (question, i) => {
if(!selected[i]) {
result.push({
questionId: question.id,
correctId: question.answerList[0].correctId,
answerId: 0,
questionType: question.type,
seqNo: question.answerList[0].seqNo,
type: 2
});
if(this.selected.length != this.questions.length) {
resultList = resultList.concat(this.getUnselected())
}
para.resultList = resultList
this.showLoading = true
this.isSubmitting = true
getAnwserExam(para).catch(res=>{
}
});
return result;
},
getAnswerTime() {
const surplusTime = this.TIME - new Date().getTime();
return surplusTime > 0 ? Math.floor((this.examTime - surplusTime) / 1000) : this.examTime / 1000;
},
submit() {
alert(123);
const para = {
answerTime: this.getAnswerTime(),
examId: this.$route.query.examId,
type: 5,
token:this.token
};
console.log(this.token, '--------');
let resultList = [];
Object.keys(this.selected).forEach( attr => {
resultList.push(this.selected[attr]);
});
if(this.selected.length != this.questions.length) {
resultList = resultList.concat(this.getUnselected());
}
para.resultList = resultList;
this.showLoading = true;
this.isSubmitting = true;
console.log(para, 'para');
getAnwserExam(para).catch(res => {
this.showLoading = false;
this.isSubmitting = false;
let data = res.data;
this.isSubmitting = false;
const data = res.data;
if(data.respCode == 200) {
let query = {
examId: this.$route.query.examId,
answerResultId: data.answerResultId,
from: 'exam'
}
if (this.startNum >0){
Vue.set(query, "endNum", this.startNum - 1)
}
this.$router.push({
path:'/exam-result',
query: query
})
} else {
this.$toast(data.respMsg)
}
})
// this.POST('app/projectExam/apply', para, res => {
// this.showLoading = false
// this.isSubmitting = false
// let data = res.data
// if(data.respCode == 200) {
alert(2222);
const query = {
examId: this.$route.query.examId,
answerResultId: data.answerResultId,
from: 'exam'
};
alert(33);
if (this.startNum > 0) {
alert(4);
query.endNum = this.startNum - 1;
// this.$set(this.query, 'endNum', this.startNum - 1);
// Vue.set(query, 'endNum', this.startNum - 1);
}
alert(5);
this.$router.push({name:'examResult', query: query});
// alert(1111);
return;
// this.$router.push({
// path:'/exam-result',
// query: query
// });
alert(1111);
} else {
this.$toast(data.respMsg);
}
});
// this.POST('app/projectExam/apply', para, res => {
// this.showLoading = false
// this.isSubmitting = false
// let data = res.data
// if(data.respCode == 200) {
// let query = {
// examId: this.$route.query.examId,
// answerResultId: data.answerResultId,
// // origin: 'end',
// from: 'exam'
// }
// let query = {
// examId: this.$route.query.examId,
// answerResultId: data.answerResultId,
// // origin: 'end',
// from: 'exam'
// }
// if (this.startNum >0){
// Vue.set(query, "endNum", this.startNum - 1)
// }
// this.$router.push({
// path:'/exam_result',
// query: query
// })
// } else {
// this.$toast(data.respMsg)
// }
// })
// if (this.startNum >0){
// Vue.set(query, "endNum", this.startNum - 1)
// }
// this.$router.push({
// path:'/exam_result',
// query: query
// })
// } else {
// this.$toast(data.respMsg)
// }
// })
},
submitQuery() {
if(this.isSubmitting) {
return
}
if(this.isAllSelected()) {
this.showSubmitConfirm = true
this.submitDialog();
} else {
this.showUnFinishedTip = true;
this.firstUnselectedIndex = this.getFirstUnselected();
this.submitDialogFinish();
}
if(this.isSubmitting) {
return;
}
if(this.isAllSelected()) {
this.showSubmitConfirm = true;
this.submitDialog();
} else {
this.showUnFinishedTip = true;
this.firstUnselectedIndex = this.getFirstUnselected();
this.submitDialogFinish();
}
},
submitDialogFinish(){
let msg=`第${this.firstUnselectedIndex}题尚未做答,请回答所有题目后再提交`
this.$dialog
.alert({
title: '提醒',
message: msg,
confirmButtonColor: '#94dcd2',
})
.then(() => {
this.unFinishedConfirm();
})
submitDialogFinish() {
const msg = `第${this.firstUnselectedIndex}题尚未做答,请回答所有题目后再提交`;
this.$dialog
.alert({
title: '提醒',
message: msg,
confirmButtonColor: '#94dcd2',
})
.then(() => {
this.unFinishedConfirm();
});
},
submitDialog(){
submitDialog() {
this.$dialog
.confirm({
title: '确定提交考卷',
message: '一旦提交后,将无法修改答题内容',
cancelButtonText: '在想一下',
confirmButtonText: '提交考卷',
confirmButtonColor: '#94dcd2',
cancelButtonColor: '#666',
})
.then(() => {
this.submitConfirm();
})
.catch(() => {
this.hideSubmitConfirm();
});
.confirm({
title: '确定提交考卷',
message: '一旦提交后,将无法修改答题内容',
cancelButtonText: '在想一下',
confirmButtonText: '提交考卷',
confirmButtonColor: '#94dcd2',
cancelButtonColor: '#666',
})
.then(() => {
this.submitConfirm();
})
.catch(() => {
this.hideSubmitConfirm();
});
},
getFirstUnselected() {
let count = this.questions.length
let selectedIndexs = Object.keys(this.selected)
for(var i = 0; i < count; i++) {
if(selectedIndexs.indexOf(i + '') == -1) {
return i + 1
}
}
const count = this.questions.length;
const selectedIndexs = Object.keys(this.selected);
for(var i = 0; i < count; i++) {
if(selectedIndexs.indexOf(i + '') == -1) {
return i + 1;
}
}
},
unFinishedConfirm() {
this.showUnFinishedTip = false;
},
unFinishedConfirm() {
this.showUnFinishedTip = false
const el = this.$refs['question_' + (this.firstUnselectedIndex - 1)][0]
//dom.scrollToElement(el, { offset: -140, animated: false })
submitConfirm() {
this.showSubmitConfirm = false;
this.submit();
},
submitConfirm() {
this.showSubmitConfirm = false
this.submit()
hideSubmitConfirm() {
this.showSubmitConfirm = false;
},
hideSubmitConfirm() {
this.showSubmitConfirm = false
},
select(obj) {
let item = obj.item
this.selected[item.index] = item
this.selectedCount = Object.keys(this.selected).length
const item = obj.item;
this.selected[item.index] = item;
this.selectedCount = Object.keys(this.selected).length;
},
timeout() {
if(!this.showSubmitConfirm) {
this.showTimeoutConfirm = true
timeout() {
if(!this.showSubmitConfirm) {
this.showTimeoutConfirm = true;
this.$dialog
.alert({
title: '提醒',
......@@ -502,36 +548,36 @@ export default {
}
},
timeoutConfirm() {
this.showTimeoutConfirm = false
this.submit()
timeoutConfirm() {
this.showTimeoutConfirm = false;
this.submit();
},
giveUp() {
if(this.isSubmitting) {return}
this.showGiveUpConfirm = true
giveUp() {
if(this.isSubmitting) {return;}
this.showGiveUpConfirm = true;
this.$dialog
.confirm({
title: '提醒',
message: '确认要放弃本次考试吗?',
cancelButtonText: '放弃',
confirmButtonText: '继续考试',
confirmButtonColor: '#94dcd2',
cancelButtonColor: '#666',
})
.then(() => {
this.giveUpConfirm();
})
.catch(() => {
this.hideGiveUpConfirm();
});
.confirm({
title: '提醒',
message: '确认要放弃本次考试吗?',
cancelButtonText: '放弃',
confirmButtonText: '继续考试',
confirmButtonColor: '#94dcd2',
cancelButtonColor: '#666',
})
.then(() => {
this.giveUpConfirm();
})
.catch(() => {
this.hideGiveUpConfirm();
});
},
hideGiveUpConfirm() {
this.showGiveUpConfirm = false
this.back()
hideGiveUpConfirm() {
this.showGiveUpConfirm = false;
this.back();
},
giveUpConfirm() {
this.showGiveUpConfirm = false
giveUpConfirm() {
this.showGiveUpConfirm = false;
}
}
}
}
};
</script>
\ No newline at end of file
<template>
<div class="contenter">
<lives-exam-history :showHeaderH="false" :localHistoryList="historyList" @goExamStart="goExamStart" @watchResult="watchResult"></lives-exam-history>
<div class="history-nomore" v-if="historyList.length > 0">
<div class="nomore-text">没有更多记录了</div>
<div class="contenter">
<lives-exam-history
:show-header-h="false"
:local-history-list="historyList"
@goExamStart="goExamStart"
@watchResult="watchResult"
/>
<div
v-if="historyList.length > 0"
class="history-nomore"
>
<div class="nomore-text">
没有更多记录了
</div>
<pica-header title="考试记录" @goBack="goBack" showHeader="true"></pica-header>
</div>
<pica-header
title="考试记录"
show-header="true"
@goBack="goBack"
/>
</div>
</template>
<style scoped>
......@@ -19,83 +33,76 @@
</style>
<script>
import picaHeader from '@/components/stroke/picaHeader'
import livesExamHistory from "@/components/stroke/livesExamHistory";
import picaHeader from '@/components/stroke/picaHeader';
import livesExamHistory from '@/components/stroke/livesExamHistory';
import { getCoopLiveExam } from '@/api/storke.js';
export default {
data: () => ({
id: '',
isPassExam: false,
showHeaderH:false,
historyList:[],
export default {
components:{
livesExamHistory,
picaHeader},
data: () => ({
id: '',
isPassExam: false,
showHeaderH:false,
historyList:[],
livesList:{
examId: '',
examResultId: '',
endDate: ''
examId: '',
examResultId: '',
endDate: ''
},
token:""
}),
computed: {
},
components:{
livesExamHistory,
picaHeader},
created () {
this.token=this.$storejs.get('token');
this.id = this.$route.query.projectId
this.init()
},
methods: {
init(){
/*this.GET('app/exam/lives/results',{examId:id,pageNo:1,pageSize:15},res=>{
console.log("所有现场考试记录",res)
this.historyList = res.data.examRecordList
this.historyList.map(res=>{
// res.createdTime = res.createdTime.substring(0,10)
})
})*/
let _self = this
getCoopLiveExam({id:id,token:this.token}).catch(res=>{
if (res && res.data){
if (res.data.pLiveExamList && res.data.pLiveExamList.length){
_self.historyList = res.data.pLiveExamList
_self.historyList = _self.historyList.concat([])
}else {
_self.historyList = []
}
}else{
this.$toast('网络异常,请稍后再试');
}
});
},
//重考
goExamStart(obj){
this.$router.push({
path: '/exam-result',
query:{
examId: obj.id,
origin: 'start',
examType: 'local',
endDate: obj.endDate,
answerResultId: obj.examResultId
}
})
},
//查看
watchResult(obj){
this.$router.push({
path: '/exam-result',
query:{
examId: obj.id,
origin: '',
examType: 'local',
endDate: obj.endDate,
answerResultId: obj.examResultId
}
})
token:''
}),
computed: {
},
created () {
this.token = this.$storejs.get('token');
this.id = this.$route.query.projectId;
this.init();
},
methods: {
init() {
const _self = this;
getCoopLiveExam({id:this.id, token:this.token}).catch(res => {
if (res && res.data) {
if (res.data.pLiveExamList && res.data.pLiveExamList.length) {
_self.historyList = res.data.pLiveExamList;
_self.historyList = _self.historyList.concat([]);
}else {
_self.historyList = [];
}
}
}
}else{
this.$toast('网络异常,请稍后再试');
}
});
},
// 重考
goExamStart(obj) {
this.$router.push({
path: '/exam-result',
query:{
examId: obj.id,
origin: 'start',
examType: 'local',
endDate: obj.endDate,
answerResultId: obj.examResultId
}
});
},
// 查看
watchResult(obj) {
this.$router.push({
path: '/exam-result',
query:{
examId: obj.id,
origin: '',
examType: 'local',
endDate: obj.endDate,
answerResultId: obj.examResultId
}
});
}
}
};
</script>
<style scoped>
.history-nomore{
......
<template>
<!-- <scroller show-scrollbar="false" style="background-color: white;"> -->
<div>
<div class="body_background">
<pica-header @goBack="goBack" :type="type" :showHeader="showHeader"></pica-header>
<exam-info :exam="exam" :type="type" @reExamStart="reExamStart" :startNum="startNum" :endNum="endNum" :examType="examType" v-bind:hasWrong="hasWrong"></exam-info>
<exam-history :showHeaderH="showHeaderH" :historyList="historyList" :examId="examId" :exam="exam"></exam-history>
</div>
</div>
<!-- <wxc-loading :show="isShow"></wxc-loading> -->
<!-- </scroller> -->
<template>
<!-- <scroller show-scrollbar="false" style="background-color: white;"> -->
<div>
<div class="body_background">
<pica-header
:type="type"
:show-header="showHeader"
@goBack="goBack"
/>
<exam-info
:exam="exam"
:type="type"
:start-num="startNum"
:end-num="endNum"
:exam-type="examType"
:has-wrong="hasWrong"
@reExamStart="reExamStart"
/>
<exam-history
:show-header-h="showHeaderH"
:history-list="historyList"
:exam-id="examId"
:exam="exam"
/>
</div>
</div>
<!-- <wxc-loading :show="isShow"></wxc-loading> -->
<!-- </scroller> -->
</template>
<style scoped>
......@@ -18,150 +35,150 @@
}
</style>
<script>
import examInfo from '@/components/stroke/examInfo'
import examHistory from '@/components/stroke/examHistory'
import picaHeader from '@/components/stroke/picaHeader'
import { getCoopExam ,getCoopExamResultNew,getCoopExamResultNews} from '@/api/exam.js';
//import WxcLoading from '../../components/wxc-loading'
//let configurationModule = weex.requireModule('configurationModule')
//let modal = weex.requireModule('modal')
export default {
data: () => ({
answerResultId: '',
id: '',
examId: '',
isPassExam: false,
showHeader: true,
showHeaderH: true, //历史记录的header
exam:{},//考试基本信息
historyList:[],
type: 2, //2 考试开始, 0 考试失败, 1 考试成功
source: '',
startNum: -1,
endNum: -1,
isShow: false,
from: '',
testMsg: '',
examType: 'common',
hasWrong:false,
token:""
}),
computed: {},
import examInfo from '@/components/stroke/examInfo';
import examHistory from '@/components/stroke/examHistory';
import picaHeader from '@/components/stroke/picaHeader';
import { getCoopExam, getCoopExamResultNew, getCoopExamResultNews} from '@/api/exam.js';
// import WxcLoading from '../../components/wxc-loading'
// let configurationModule = weex.requireModule('configurationModule')
// let modal = weex.requireModule('modal')
export default {
components:{
examInfo,
examHistory,picaHeader,
//WxcLoading
examInfo,
examHistory, picaHeader,
// WxcLoading
},
data: () => ({
answerResultId: '',
id: '',
examId: '',
isPassExam: false,
showHeader: true,
showHeaderH: true, // 历史记录的header
exam:{}, // 考试基本信息
historyList:[],
type: 2, // 2 考试开始, 0 考试失败, 1 考试成功
source: '',
startNum: -1,
endNum: -1,
isShow: false,
from: '',
testMsg: '',
examType: 'common',
hasWrong:false,
token:''
}),
computed: {},
created () {
this.token = this.$storejs.get('token');
this.examId = this.$route.query.examId;
this.from = this.$route.query.from;
this.showHeader = this.from != 'exam';
this.answerResultId = this.$route.query.answerResultId || 0;
const startNum = this.$route.query.startNum;
const endNum = this.$route.query.endNum;
this.startNum = startNum >= 0 ? startNum : -1;
this.endNum = endNum >= 0 ? endNum : -1;
},
created () {
this.token=this.$storejs.get('token');
this.examId = this.$route.query.examId
this.from = this.$route.query.from
this.showHeader = this.from != 'exam'
this.answerResultId = this.$route.query.answerResultId || 0
let startNum = this.$route.query.startNum
let endNum = this.$route.query.endNum
this.startNum = startNum >= 0 ? startNum : -1
this.endNum = endNum >= 0 ? endNum : -1
},
mounted(){
this.init()
mounted() {
this.init();
},
methods: {
init(){
this.isShow = true
this.hasWrong = false;
if (this.from !== "exam" && !(this.answerResultId > 0)){//开始页面
this.type = 2
getCoopExam({"examId":this.examId, "type": 5,token:this.token}).catch(res=>{
if(res.data){
if (res.data.respCode == 1000) {
return this.$toast(res.data.respMsg);
} else if (res.data.respCode == 401 || res.data.respCode == 404) {
return this.$rocNative.gotoLogin();
};
if(res.data.respCode == 200){
this.exam = res.data.examBaseInfo
}
}else{
this.hasWrong = true;
this.$toast(res.data.respMsg)
}
})
}else{//结果页面
this.hasWrong = false;
getCoopExamResultNew({answerResultId:this.answerResultId, type: 5,token:this.token}).catch(res=>{
if(res.data){
if (res.data.respCode == 200){
// weex.requireModule('CourseModule').finishTest(res.data)
this.exam = res.data.answerResult
this.type = this.exam.passFlag == 5 ? 1 : 0;
}else if (res.data.respCode == 1000) {
return this.$toast(res.data.respMsg);
}else if (res.data.respCode == 401 || res.data.respCode == 404) {
return this.$rocNative.gotoLogin();
}else{
this.hasWrong = true;
this.$toast(res.data.respMsg)
}
}else{
this.hasWrong = true;
this.$toast(res.data.respMsg)
}
});
methods: {
init() {
this.isShow = true;
this.hasWrong = false;
if (this.from !== 'exam' && !(this.answerResultId > 0)) {// 开始页面
this.type = 2;
getCoopExam({'examId':this.examId, 'type': 5, token:this.token}).catch(res => {
if(res.data) {
if (res.data.respCode == 1000) {
return this.$toast(res.data.respMsg);
} else if (res.data.respCode == 401 || res.data.respCode == 404) {
return this.$rocNative.gotoLogin();
}
this.hasWrong = false;
getCoopExamResultNews({examId:this.examId,pageNo:1,pageSize:3, type: 5,token:this.token}).catch(res=>{
this.isShow = false
if(res.data){
if (res.data.respCode == 200){
this.historyList = res.data.examRecordList
this.historyList.map(res=>{
res.createdTime = res.createdTime.substring(0,10)
})
}else if (res.data.respCode == 1000) {
return this.$toast(res.data.respMsg);
}else if (res.data.respCode == 401 || res.data.respCode == 404) {
return this.$rocNative.gotoLogin();
}else{
this.hasWrong = true;
this.$toast(res.data.respMsg)
}
}else{
this.hasWrong = true;
this.$toast(res.data.respMsg)
}
})
// this.GET('app/projectExam/results',{examId:this.examId,pageNo:1,pageSize:3, type: 5},res=>{
// this.isShow = false
// if (res.data && res.data.respCode == 200){
// this.historyList = res.data.examRecordList
// this.historyList.map(res=>{
// res.createdTime = res.createdTime.substring(0,10)
// })
// }else {
// this.hasWrong = true;
// modal.toast({
// message: res.data.respMsg,
// duration: 1.0
// })
// }
// })
},
goBack(){
this.$router.go(-1);
},
reExamStart(){
this.from = "start"
this.type = 2
this.showHeader = true
if (this.endNum > 0){
this.startNum = this.endNum
}
this.answerResultId = -1
this.init()
if(res.data.respCode == 200) {
this.exam = res.data.examBaseInfo;
}
}else{
this.hasWrong = true;
this.$toast(res.data.respMsg);
}
}
}
});
}else{// 结果页面
this.hasWrong = false;
getCoopExamResultNew({answerResultId:this.answerResultId, type: 5, token:this.token}).catch(res => {
if(res.data) {
if (res.data.respCode == 200) {
// weex.requireModule('CourseModule').finishTest(res.data)
this.exam = res.data.answerResult;
this.type = this.exam.passFlag == 5 ? 1 : 0;
}else if (res.data.respCode == 1000) {
return this.$toast(res.data.respMsg);
}else if (res.data.respCode == 401 || res.data.respCode == 404) {
return this.$rocNative.gotoLogin();
}else{
this.hasWrong = true;
this.$toast(res.data.respMsg);
}
}else{
this.hasWrong = true;
this.$toast(res.data.respMsg);
}
});
}
this.hasWrong = false;
getCoopExamResultNews({examId:this.examId, pageNo:1, pageSize:3, type: 5, token:this.token}).catch(res => {
this.isShow = false;
if(res.data) {
if (res.data.respCode == 200) {
this.historyList = res.data.examRecordList;
this.historyList.map(res => {
res.createdTime = res.createdTime.substring(0, 10);
});
}else if (res.data.respCode == 1000) {
return this.$toast(res.data.respMsg);
}else if (res.data.respCode == 401 || res.data.respCode == 404) {
return this.$rocNative.gotoLogin();
}else{
this.hasWrong = true;
this.$toast(res.data.respMsg);
}
}else{
this.hasWrong = true;
this.$toast(res.data.respMsg);
}
});
// this.GET('app/projectExam/results',{examId:this.examId,pageNo:1,pageSize:3, type: 5},res=>{
// this.isShow = false
// if (res.data && res.data.respCode == 200){
// this.historyList = res.data.examRecordList
// this.historyList.map(res=>{
// res.createdTime = res.createdTime.substring(0,10)
// })
// }else {
// this.hasWrong = true;
// modal.toast({
// message: res.data.respMsg,
// duration: 1.0
// })
// }
// })
},
goBack() {
this.$router.go(-1);
},
reExamStart() {
this.from = 'start';
this.type = 2;
this.showHeader = true;
if (this.endNum > 0) {
this.startNum = this.endNum;
}
this.answerResultId = -1;
this.init();
}
}
};
</script>
\ No newline at end of file
// import WxcDialog from '../components/wxc-dialog'
// import strokeSlot from '../components/business/strokeSlot'
//import examHistory from '../components/stroke/examHistory';
//import main from '../components/stroke/main';
// import examHistory from '../components/stroke/examHistory';
// import main from '../components/stroke/main';
// import picaCommon from '../util/picaCommon'
// import WxcLoading from '../components/wxc-loading'
// import livesExamHistory from "../components/stroke/livesExamHistory";
//import WxcDialog from '../components/wxc-dialog';
// import WxcDialog from '../components/wxc-dialog';
// let modal = weex.requireModule('modal')
// let configurationModule = weex.requireModule('configurationModule')
// let globalEvent = weex.requireModule('globalEvent')
// let storage = weex.requireModule('storage')
//import WxcDialog from '../components/wxc-dialog'
// import WxcDialog from '../components/wxc-dialog'
import componentMain from '@/components/stroke/componentMain';
import CommonHeader from '@/components/common/header';
import livesExamHistory from "@/components/stroke/livesExamHistory";
import livesExamHistory from '@/components/stroke/livesExamHistory';
import { getCoopTop, getCoopBottom, getCoopMiddle, getCoopLiveExam, getCoopOrder } from '@/api/storke.js';
import { getCoopExamResult } from '@/api/exam.js';
export default {
......@@ -27,7 +27,8 @@ import { getCoopExamResult } from '@/api/exam.js';
livesExamHistory
},
data() {
return{
return {
isLoading:true,
keyIndex:0,
showExamFinishedTip: false,
showReInputTip: false,
......@@ -66,7 +67,7 @@ import { getCoopExamResult } from '@/api/exam.js';
height: '45px',
backgroundColor: 'rgba(106, 159, 233, 0.1)',
borderRadius: '30px',
margin:"0 auto",
margin:'0 auto',
width: '200px'
},
codeTextStyle: {
......@@ -88,10 +89,10 @@ import { getCoopExamResult } from '@/api/exam.js';
needMarginBottom: false,
marginBottom: '0px',
parms:{
id: 4, token: "6A713648AB954CAEAE6B39265F624B52"
id: 4, token: 'BEB69157CD5E45CC8076B3AF54049A88'
},
flagLoading:0,
title:"",
title:'',
bgColor: 'rgba(255,255,255,0)',
isFixHeader: true,
orderListFlag:false
......@@ -103,6 +104,7 @@ import { getCoopExamResult } from '@/api/exam.js';
},
flagLoading(newv) {
if (newv == 4) {
this.isLoading = false;
this.getOrder();
}
}
......@@ -113,21 +115,25 @@ import { getCoopExamResult } from '@/api/exam.js';
this.allowFlag = this.$route.query.allowFlag || 1;
this.projectId = this.$route.query.projectId || 2;
this.parms.id = this.projectId;
let _that = this;
this.parms.token = 2;
const _that = this;
this.$rocNative.getUserInfo()
.then((res) => {
let token=""
let token = '';
if (res.userToken) {
token=res.userToken
token = res.userToken;
} else {
token=_that.$route.query.token
token = _that.$route.query.token;
}
_that.parms.token = token;
_that.$storejs.set('token', token);
this.init();
})
.catch(() => {
this.init();
if (this.$rocNative.isWeb) {
this.init();
}
this.$rocNative.gotoLogin();
});
},
mounted() {
......@@ -140,17 +146,21 @@ import { getCoopExamResult } from '@/api/exam.js';
// });
// }) ///
window.addEventListener('scroll', this.scrollToTop)
window.addEventListener('scroll', this.scrollToTop);
},
methods: {
onRefresh() {
this.flagLoading = 0;
this.init();
},
scrollToTop() {
var scrollTop = window.pageYOffset || document.documentElement. scrollTop || document.body.scrollTop;
if (scrollTop > 83) {
this.bgColor = "#fff";
var scrollTop = window.pageYOffset || document.documentElement. scrollTop || document.body.scrollTop;
if (scrollTop > 63) {
this.bgColor = '#fff';
this.title = this.projectName;
} else if(scrollTop<83){
this.bgColor = "rgba(255,255,255,0)";
this.title=""
} else if(scrollTop < 63) {
this.bgColor = 'rgba(255,255,255,0)';
this.title = '';
}
},
getCurrentIndex(key) {
......@@ -199,26 +209,26 @@ import { getCoopExamResult } from '@/api/exam.js';
}
this.isShow = false;
var result = res.data.checkResult;
let flag = result.resultFlag;
const flag = result.resultFlag;
if(flag == 1) {
this.$router.push({
path:'/exam-result', query:{'examId': result.examId, 'origin': 'start', 'examType': 'local', 'endDate': result.endDate}
});
} else if(flag == 5) {
this.showExamNotStartTip = true;
this.noExamStart("考试未开始");
this.noExamStart('考试未开始');
} else if(flag == 10 || flag == 20) {
this.showExamFinishedTip = true;
this.noExamStart("考试已结束");
this.noExamStart('考试已结束');
} else if(flag == 15) {
this.showReInputTip = true;
this.resetExamCodeEnter()
this.resetExamCodeEnter();
}else if(flag == 30) {
this.timesFull = true;
this.noExamStart("考试次数已用完");
this.noExamStart('考试次数已用完');
}
}
})
});
// this.GET('app/exam/lives/check', {examCode: code}, (res) => {
// this.isShow = false;
// var result = res.data.checkResult,
......@@ -243,7 +253,7 @@ import { getCoopExamResult } from '@/api/exam.js';
this.$dialog.alert({
title: '',
message: message,
confirmButtonText:"我知道了"
confirmButtonText:'我知道了'
}).then(() => {
// on close
});
......@@ -305,25 +315,25 @@ import { getCoopExamResult } from '@/api/exam.js';
getTop() {
this.isShow = true;
const _self = this;
//得到顶部的方法
// 得到顶部的方法
getCoopTop(this.parms).catch((res) => {
if (res && res.data) {
if (this.flagLoading !=5) {
this.flagLoading=this.flagLoading + 1
if (this.flagLoading != 4) {
this.flagLoading = this.flagLoading + 1;
}
if (res.data.respCode == 1000) {
return this.$toast(res.data.respMsg);
} else if (res.data.respCode == 401 || res.data.respCode == 404) {
return this.$rocNative.gotoLogin();
};
}
this.infoLists = res.data.texts; // 简介(文案)组件
this.sliderLists = res.data.carousels; // 轮播图组件
this.projectName = res.data.projectName; // 项目名称
//this.projectName = this.getLength(this.projectName, 8);
// this.projectName = this.getLength(this.projectName, 8);
}else{
this.$toast("网络异常,请稍后再试");
this.$toast('网络异常,请稍后再试');
}
})
});
},
getBottom() {
getCoopBottom(this.parms).catch((res) => {
......@@ -332,9 +342,9 @@ import { getCoopExamResult } from '@/api/exam.js';
return this.$toast(res.data.respMsg);
} else if (res.data.respCode == 401 || res.data.respCode == 404) {
return this.$rocNative.gotoLogin();
};
if (this.flagLoading !=5) {
this.flagLoading=this.flagLoading + 1
}
if (this.flagLoading != 4) {
this.flagLoading = this.flagLoading + 1;
}
this.courseLists = res.data.courses;
if (this.courseLists && this.courseLists.length) {
......@@ -344,9 +354,9 @@ import { getCoopExamResult } from '@/api/exam.js';
}
this.courseLists = this.courseLists.concat([]);
} else {
this.$toast("网络异常,请稍后再试");
this.$toast('网络异常,请稍后再试');
}
})
});
},
getMiddle() {
getCoopMiddle(this.parms).catch((res) => {
......@@ -356,9 +366,9 @@ import { getCoopExamResult } from '@/api/exam.js';
return this.$toast(res.data.respMsg);
} else if (res.data.respCode == 401 || res.data.respCode == 404) {
return this.$rocNative.gotoLogin();
};
if (this.flagLoading !=5) {
this.flagLoading=this.flagLoading + 1
}
if (this.flagLoading != 4) {
this.flagLoading = this.flagLoading + 1;
}
this.examLists = res.data.moduleTypeExams;
if (this.examLists && this.examLists.length) {
......@@ -385,9 +395,9 @@ import { getCoopExamResult } from '@/api/exam.js';
this.examLists = [];
}
} else {
this.$toast("网络异常,请稍后再试")
this.$toast('网络异常,请稍后再试');
}
})
});
// const _self = this;
// this.GET('contents/projects/middle', {id: this.projectId}, function (res) {
// _self.isShow = false;
......@@ -434,8 +444,8 @@ import { getCoopExamResult } from '@/api/exam.js';
} else if (res.data.respCode == 401 || res.data.respCode == 404) {
return this.$rocNative.gotoLogin();
}
if (this.flagLoading !=5) {
this.flagLoading=this.flagLoading + 1
if (this.flagLoading != 4) {
this.flagLoading = this.flagLoading + 1;
}
this.pLiveMapping = res.data.pLiveMapping;
if (res.data.pLiveExamList && res.data.pLiveExamList.length) {
......@@ -443,14 +453,14 @@ import { getCoopExamResult } from '@/api/exam.js';
this.localHistoryList = this.localHistoryList.concat([]);
}
} else {
this.$toast("网络异常,请稍后再试");
this.$toast('网络异常,请稍后再试');
}
//this.getOrder();
// this.getOrder();
});
},
getOrder() {
//const _self = this;
// const _self = this;
getCoopOrder(this.parms).catch((res) => {
if (res && res.data) {
if (res.data.respCode == 1000) {
......@@ -460,13 +470,13 @@ import { getCoopExamResult } from '@/api/exam.js';
}
// 组件type
// module_type:1、轮播图组件 5、文案组件 10、考试组件 15、关联课程组件 20、链接组件 25、现场考试组件
if (this.flagLoading !=5) {
this.flagLoading = this.flagLoading + 1;
}
// if (this.flagLoading !=5) {
// this.flagLoading = this.flagLoading + 1;
// }
this.orderList = res.data.projectList;
this.orderListFlag = this.orderList.some(item => {
return item.module_type == 25
})
return item.module_type == 25;
});
if (res.data.respCode != 200) {
return this.$toast(res.data.respMsg);
}
......@@ -494,27 +504,27 @@ import { getCoopExamResult } from '@/api/exam.js';
}
this.slots = this.slots.concat([]);
this.allComponentLists = [];
this.sliderLists.forEach( (item)=> {
this.sliderLists.forEach( (item) => {
this.allComponentLists.push(item);
});
this.infoLists.forEach((item)=> {
this.infoLists.forEach((item) => {
this.allComponentLists.push(item);
});
this.courseLists.forEach((item)=> {
this.courseLists.forEach((item) => {
this.allComponentLists.push(item);
});
this.examLists.forEach((item)=> {
this.examLists.forEach((item) => {
this.allComponentLists.push(item);
});
this.livesExamLists.forEach((item)=> {
this.livesExamLists.forEach((item) => {
this.allComponentLists.push(item);
});
this.allComponentLists.sort((a,b)=> {
this.allComponentLists.sort((a, b) => {
return a.seq_no - b.seq_no;
});
this.allComponentLists = this.allComponentLists.concat([]);// Object.assign([],)
} else {
this.$toast("网络异常,请稍后再试");
this.$toast('网络异常,请稍后再试');
}
});
},
......@@ -545,7 +555,7 @@ import { getCoopExamResult } from '@/api/exam.js';
this.$router.go(-1);
}
// storage.setItem('needFlash', 'true');
//configurationModule.goBack(); 11
// configurationModule.goBack(); 11
},
// 重考
goExamStart(obj) {
......
<template>
<div>
<div class="stroke_container" v-if="this.flagLoading==5">
<common-header
:bg-color="bgColor"
:title="title"
:is-fix-header="isFixHeader"
:is-custom-back="true"
@selfGoBack="consulOrder"
/>
<template v-if="allComponentLists.length">
<div
v-for="(value, key) in slots"
ref="scrollerDom"
:key="'a'+key"
>
<component-main
ref="mainCp"
:type="value.slot"
:datas="allComponentLists[key]"
:keyIndex="key"
@click.native="getCurrentIndex(key)"
/>
</div>
</template>
<!--</stroke-slot>-->
<div v-if="orderListFlag">
<div class="local-exam">
<van-pull-refresh
v-model="isLoading"
@refresh="onRefresh"
>
<div class="stroke_container">
<common-header
:bg-color="bgColor"
:title="title"
:is-fix-header="isFixHeader"
:is-custom-back="true"
@selfGoBack="consulOrder"
/>
<template v-if="allComponentLists.length">
<div
v-if="allowFlag == 0"
class="project_advice_new"
v-for="(value, key) in slots"
ref="scrollerDom"
:key="'a'+key"
>
<div class="project_advice_text_new">
您暂不属于该项目,若想获得学习权限,请拨打电话 400-920-8877 联系云鹊医工作人员。
</div>
<component-main
ref="mainCp"
:type="value.slot"
:datas="allComponentLists[key]"
:key-index="key"
@click.native="getCurrentIndex(key)"
/>
</div>
<div class="project_title">
{{ pLiveMapping.examName }}
</div>
<div class="code-btn-wrap">
<div :class="{'code-btn': (allowFlag == 0),'code-active-btn': (allowFlag != 0)}"
:style="codeBtn"
@click="codeBtnClicked"
</template>
<!--</stroke-slot>-->
<div v-if="orderListFlag">
<div class="local-exam">
<div
v-if="allowFlag == 0"
class="project_advice_new"
>
<!-- :textStyle="allowFlag == 0 ? codeTextStyleNo : codeTextStyle" -->
{{pLiveMapping.buttonName}}
<div class="project_advice_text_new">
您暂不属于该项目,若想获得学习权限,请拨打电话 400-920-8877 联系云鹊医工作人员。
</div>
</div>
<div class="project_title">
{{ pLiveMapping.examName }}
</div>
<div class="code-btn-wrap">
<div
:class="{'code-btn': (allowFlag == 0),'code-active-btn': (allowFlag != 0)}"
:style="codeBtn"
@click="codeBtnClicked"
>
<!-- :textStyle="allowFlag == 0 ? codeTextStyleNo : codeTextStyle" -->
{{ pLiveMapping.buttonName }}
</div>
</div>
</div>
</div>
<div class="history-wrap">
<div class="history-header">
<div class="project_title his_label">
考试记录
</div>
<div
v-if="localHistoryList.length >= 5"
class="course_see_more"
@click="seeMoreHistory"
>
<div class="see_more">
更多
<div class="history-wrap">
<div class="history-header">
<div class="project_title his_label">
考试记录
</div>
<img
class="see_more_img"
src="https://pica-pro.oss-cn-shanghai.aliyuncs.com/eagle_plan/arrow_right_gray%403x.png"
<div
v-if="localHistoryList.length >= 5"
class="course_see_more"
@click="seeMoreHistory"
>
<div class="see_more">
更多
</div>
<img
class="see_more_img"
src="https://pica-pro.oss-cn-shanghai.aliyuncs.com/eagle_plan/arrow_right_gray%403x.png"
>
</div>
</div>
<lives-exam-history
:show-header-h="false"
:local-history-list="localHistoryList.slice(0,5)"
@goExamStart="goExamStart"
@watchResult="watchResult"
/>
</div>
<lives-exam-history
:show-header-h="false"
:local-history-list="localHistoryList.slice(0,5)"
@goExamStart="goExamStart"
@watchResult="watchResult"
/>
</div>
</div>
</div>
<!-- <wxc-loading :show="isShow"></wxc-loading> -->
<!-- <wxc-loading :show="isShow"></wxc-loading> -->
<!-- <wxc-dialog confirm-text="重新输入"
<!-- <wxc-dialog confirm-text="重新输入"
cancel-text="取消"
:show="showReInputTip"
@wxcDialogCancelBtnClicked="hideReInput"
......@@ -88,7 +91,7 @@
<div slot="content" class="content-subtext">考试码不正确</div>
</wxc-dialog> 11-->
<!-- <wxc-dialog confirm-text="我知道了"
<!-- <wxc-dialog confirm-text="我知道了"
:show="showExamNotStartTip"
main-btn-color="#35cbca"
:single="true"
......@@ -96,7 +99,7 @@
<text slot="content" class="content-subtext">考试未开始</text>
</wxc-dialog> 11-->
<!-- <wxc-dialog confirm-text="我知道了"
<!-- <wxc-dialog confirm-text="我知道了"
:show="showExamFinishedTip"
main-btn-color="#35cbca"
:single="true"
......@@ -104,7 +107,7 @@
<text slot="content" class="content-subtext">考试已结束</text>
</wxc-dialog> 11-->
<!-- <wxc-dialog confirm-text="我知道了"
<!-- <wxc-dialog confirm-text="我知道了"
:show="timesFull"
main-btn-color="#35cbca"
:single="true"
......@@ -112,9 +115,9 @@
<text slot="content" class="content-subtext">考试次数已用完</text>
</wxc-dialog> 11-->
<!--height="342"-->
<!--height="342"-->
<!-- <wxc-mask height="642"
<!-- <wxc-mask height="642"
width="750"
border-radius="0"
duration="200"
......@@ -139,24 +142,86 @@
</div>
</div>
</wxc-mask> 11-->
<van-overlay :show="showCodeInputDialog" @click="showCodeInputDialog = false">
<div class="wrapper" @click.stop>
<div class="code-content">
<div class="code-title-wrap">
<img class="code-img" src="https://pica-pro.oss-cn-shanghai.aliyuncs.com/eagle_plan/close%403x.png" @click="showCodeInputDialog=false"/>
<div class="code-title">请输入考试码</div>
</div>
<div class="code-input-wrap">
<input type="text" class="code-input" :class="[code1.length > 0 ? 'code-active': '']" v-model="code1" maxlength="1" @input="codeChange(code1, 'code2')" ref="code1" autofocus="true"/>
<input type="text" class="code-input" :class="[code2.length > 0 ? 'code-active': '']" v-model="code2" maxlength="1" @input="codeChange(code2, 'code3')" ref="code2"/>
<input type="text" class="code-input" :class="[code3.length > 0 ? 'code-active': '']" v-model="code3" maxlength="1" @input="codeChange(code3, 'code4')" ref="code3"/>
<input type="text" class="code-input" :class="[code4.length > 0 ? 'code-active': '']" v-model="code4" maxlength="1" @input="codeChange(code4, 'code5')" ref="code4"/>
<input type="text" class="code-input" :class="[code5.length > 0 ? 'code-active': '']" v-model="code5" maxlength="1" @input="codeChange(code5, 'code6')" ref="code5"/>
<input type="text" class="code-input" :class="[code6.length > 0 ? 'code-active': '']" v-model="code6" maxlength="1" @input="codeChange(code6, '')" ref="code6"/>
<van-overlay
:show="showCodeInputDialog"
@click="showCodeInputDialog = false"
>
<div
class="wrapper"
@click.stop
>
<div class="code-content">
<div class="code-title-wrap">
<img
class="code-img"
src="https://pica-pro.oss-cn-shanghai.aliyuncs.com/eagle_plan/close%403x.png"
@click="showCodeInputDialog=false"
>
<div class="code-title">
请输入考试码
</div>
</div>
<div class="code-input-wrap">
<input
ref="code1"
v-model="code1"
type="text"
class="code-input"
:class="[code1.length > 0 ? 'code-active': '']"
maxlength="1"
autofocus="true"
@input="codeChange(code1, 'code2')"
>
<input
ref="code2"
v-model="code2"
type="text"
class="code-input"
:class="[code2.length > 0 ? 'code-active': '']"
maxlength="1"
@input="codeChange(code2, 'code3')"
>
<input
ref="code3"
v-model="code3"
type="text"
class="code-input"
:class="[code3.length > 0 ? 'code-active': '']"
maxlength="1"
@input="codeChange(code3, 'code4')"
>
<input
ref="code4"
v-model="code4"
type="text"
class="code-input"
:class="[code4.length > 0 ? 'code-active': '']"
maxlength="1"
@input="codeChange(code4, 'code5')"
>
<input
ref="code5"
v-model="code5"
type="text"
class="code-input"
:class="[code5.length > 0 ? 'code-active': '']"
maxlength="1"
@input="codeChange(code5, 'code6')"
>
<input
ref="code6"
v-model="code6"
type="text"
class="code-input"
:class="[code6.length > 0 ? 'code-active': '']"
maxlength="1"
@input="codeChange(code6, '')"
>
</div>
</div>
</div>
</div>
</div>
</van-overlay>
</van-overlay>
</van-pull-refresh>
</div>
</template>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册