提交 b1c292c4 authored 作者: zhengyadong's avatar zhengyadong

Merge branch 'zyd'

......@@ -23,7 +23,7 @@ module.exports = {
// Various Dev Server settings
host: '192.168.2.40', // can be overwritten by process.env.HOST
host: '192.168.2.39', // can be overwritten by process.env.HOST
port: 8082, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
autoOpenBrowser: false,
errorOverlay: true,
......
差异被折叠。
......@@ -32,7 +32,8 @@
"vue-validator": "^3.0.0-alpha.2",
"vue-video-player": "^5.0.2",
"vuex": "^3.1.2",
"vux": "^2.9.4"
"vux": "^2.9.4",
"xgplayer": "^2.8.3"
},
"devDependencies": {
"autoprefixer": "^7.1.2",
......
import request from '@/utils/request';
import { requestPath } from '@/utils/global.js';
// 错题详情
export function getWeekDetailAPI(params){
return request({
url:`${requestPath.resource}/error-book/page`,
method:'get',
params
})
}
......@@ -38,13 +38,13 @@ export function createPaperAPI(data){
}
// 保存每次答题记录
// export function saveWeekAPI(data){
// return request({
// url:`${requestPath.resource}/record/create-week`,
// method:'post',
// data
// })
// }
export function createRecordAPI(data){
return request({
url:`${requestPath.resource}/record/create-record`,
method:'post',
data
})
}
<template>
<div class="type-answer">
<div class="right-answer">正确答案:{{answer}}</div>
<div class="right-answer">正确答案:{{answer.replace(',','')}}</div>
<div class="answer-analysis">
<span class="analysis-t">解析:</span>
<span v-html="analysis"></span>
......
......@@ -3,9 +3,9 @@
<div v-html="dataObj.content"></div>
<div v-html="dataObj.filterContent"></div>
<div class="answer-single">
<div>
<!-- <div>
{{currentStatus.answer1}}{{activeName}}
</div>
</div> -->
<div class="option-item default-a" v-if="dataObj.answer1" :class="{'option-right':(currentStatus.answer1 ==3)||activeName.indexOf('A') != -1,
'option-false':currentStatus.answer1 ==2,'option-no':currentStatus.answer1 ==1}" @click="choiseSelect('A')">
<div class="option-num"></div>
......@@ -92,7 +92,6 @@ export default {
answer6:0,
}
this.activeName = []
this.$forceUpdate()
},
choiseSelect(name){
if(this.showButton !== 'curent') return
......
......@@ -2,7 +2,11 @@
<div class="type-text">
<div class="answer-cnt" :style="{'height':(open ? autoHeight:'2rem')}">
<div class="detail-cnt" v-html="dataObj.content"></div>
<video class="video" v-if="dataObj.video" :src="videoUrl(dataObj.video)" controls></video>
<!-- <video class="video" v-if="dataObj.video" :src="videoUrl(dataObj.video)" controls></video> -->
<div class="video" v-if="dataObj.video">
<div id="mse"></div>
</div>
</div>
<div class="answer-text">
<div class="icon-wrap" @click="open = !open">
......@@ -15,6 +19,7 @@
<script>
import { videoUrl } from '@/utils/global'
import Player from 'xgplayer'
export default {
name: 'textCase',
props:{
......@@ -28,12 +33,26 @@ export default {
videoUrl:videoUrl,
open:false,
autoHeight:null,
playerConfig:{
id: "mse", // 挂载节点id
playsinline: true, // 是否在线播放
url:'',
autoplay: false, // 自动播放
fluid: true, // 流式布局
useHls:true,
"x5-video-player-type": "h5"
},
player:null
}
},
created() {
this.autoHeight = this.autoHeigh(2.5)
},
mounted() {
console.log(this.videoUrl(this.dataObj.video),11111111);
this.playerConfig.url = this.videoUrl(this.dataObj.video)
this.player = new Player(this.playerConfig)
},
watch: {},
methods: {
......
......@@ -94,6 +94,15 @@ let router = new Router({
component: () => import('@/views/wrongBook/index.vue'),
},
{
path: '/myWrongDetail',
name: 'myWrongDetail',
meta: {
title: "错题详情",
isLogin: true
},
component: () => import('@/views/wrongBook/detail.vue'),
},
{
path: '/myCollection',
name: 'myCollection',
meta: {
......
......@@ -23,5 +23,6 @@ export const downloadPath = 'download'
export const uploadPath = 'upload'
export const videoUrl = function(link){
return `${process.env.BASE_API}/file/file/?fileName=${link}&isOnLine=true`
// return `${process.env.BASE_API}/file/file/?fileName=${link}&isOnLine=true`
return `${process.env.BASE_API}/file/file/download/${link}`
}
......@@ -4,14 +4,14 @@
<topHeader header-title="在线考试" :showCol="false" @back="$router.push({name:'home'})"></topHeader>
<div class="list-cnt">
<div v-for="(item,key) in list" :key="key" class="list-item">
<div class="item-name" @click="linkTo(item)">{{item.name}}</div>
<div class="item-name" >{{item.name}}</div>
<div class="item-detail">
<div class="item-time">
<span>{{item.beginTime}}-{{item.endTime}}</span>
<span v-if="item.beginTime">{{item.beginTime}}-{{item.endTime}}</span>
</div>
<div class="item-btn">
<span>查看解析</span>
<span :class="statusObj[item.examStatus ? item.examStatus:3].class">{{statusObj[item.examStatus ? item.examStatus:2].label}}</span>
<span v-if="item.examStatus === '3'||item.examStatus === '-2'">查看解析</span>
<span :class="statusObj[item.examStatus].class" @click="linkTo(item)">{{statusObj[item.examStatus].label}}</span>
</div>
</div>
</div>
......@@ -37,24 +37,28 @@ export default {
pageNum:1,
pageSize:100,
},
statusObj:{
1:{
statusObj:{ //答题状态 0未开始 1开始答题 2继续答题 3重新答题 -1已过期(无答题记录) -2(有答题记录)
'0':{
label:'未开始',
class:'no-begin',
},
2:{
'1':{
label:'开始答题',
class:'has-begin',
},
3:{
'2':{
label:'继续答题',
class:'continue',
},
4:{
'3':{
label:'重新答题',
class:'reset-begin',
},
5:{
'-1':{
label:'已过期',
class:'expired',
},
'-2':{
label:'已过期',
class:'expired',
},
......@@ -75,8 +79,27 @@ export default {
}
})
},
linkTo(item){
this.$router.push({name:'match',query:{id:item.id, title:item.name}})
linkTo(item){
//答题状态 0未开始 1开始答题 2继续答题 3重新答题 -1已过期(无答题记录) -2(有答题记录)
let begin = ()=>{
this.$router.push({name:'match',query:{id:item.id, title:item.name}})
}
let conti = ()=>{
this.$router.push({name:'match',query:{id:item.id, title:item.name}})
}
let again = ()=>{
this.$router.push({name:'match',query:{id:item.id, title:item.name}})
}
let status = {
'0':()=> false,
'1':begin,
'2':conti,
'3':again,
'-1':()=> false,
'-2':()=> false,
}
status[item.examStatus]()
// this.$router.push({name:'match',query:{id:item.id, title:item.name}})
}
}
};
......
......@@ -78,7 +78,7 @@ import pMultiple from "@/components/practice/pMultiple.vue"; // 多选
import completion from "@/components/practice/completion.vue"; // 填空
import textCase from "@/components/practice/textCase.vue"; // 填空
import { getTimer } from "@/utils/function.js"
import { getMatchDetailAPI, createPaperAPI } from '@/api/moon'
import { getMatchDetailAPI, createPaperAPI,createRecordAPI } from '@/api/moon'
export default {
name: "weekPractice",
......@@ -126,7 +126,7 @@ export default {
coverId:null, // 成套试题id
type:1, // 试卷类型 1考试 2练习
},
crreateRecord:{ // 做题保存记录
createRecord:{ // 做题保存记录
coverId:null, // 试卷id
parentQuestionsId:null, // 父级试题id
questionType: null, // 试题类型
......@@ -178,6 +178,7 @@ export default {
this.listQuery.id = this.id
this.createPaper.coverId = this.id
this.createPaper.begintime = getTimer()
this.createRecord.coverId = this.id
this.getDetail()
},
mounted(){
......@@ -295,26 +296,49 @@ export default {
},
async _createPaper(){
console.log(33333);
return createPaperAPI(this.createPaper).then(res=>{
console.log(res.data,222222);
if(res.data.code == 0){
}else{
}
return new Promise((resolve,reject)=>{
createPaperAPI(this.createPaper).then(res=>{
console.log(res.data,222222);
if(res.data.code == 0){
resolve(res.data.data)
}else{
reject(res.data.msg)
}
})
})
},
async _createRecord(){
console.log(this.createRecord,33);
return new Promise((resolve,reject)=>{
createRecordAPI(this.createRecord).then(res=>{
console.log(res.data,222222);
if(res.data.code == 0){
resolve(res.data.data)
}else{
reject(res.data.msg)
}
})
})
},
// 下一题
async nextQuestion(){
this.currentIndex += 1
this._saveAnswer(this.userAns,this.currentIndex,this.answerRecordList) // 本地保存记录
let result = await this._createPaper()
result.then(res=>{
try{
let result = await this._createPaper()
console.log(result,22);
this.createRecord.testPaperId = result.id // 试卷id
this.createRecord.questionType = this.currentObj.questionType // 试题类型
this.createRecord.questionsId = this.currentObj.questionid // 试题id
this.createRecord.stuanswer = this.userAns // 考生答案
let res = await this._createRecord()
console.log(res,11);
},
reason=>{
this.$message.error(reason)
})
}catch(error){
console.log(error);
}
// createPaper:{ // 第一次答题需要
......@@ -333,10 +357,8 @@ export default {
// this.showButton = 'curent' // 更改按钮状态
// this.$refs[this.refObj[this.currentObj.questionType]].changeStatus()
// this.currentObj = this.list[this.currentIndex] // 当前题目
// 当前题目索引值
this.$refs[this.refObj[this.currentObj.questionType]].changeStatus()
this.currentObj = this.list[this.currentIndex] // 当前题目
this.userAns = ''
if(this.currentObj.questionType === 5||this.currentObj.questionType === 6){ // 如果下一题是文字和视频
......
......@@ -72,6 +72,8 @@ export default {
background: #F2F2F2;
.list-item{
.item-time{
font-size: .15rem;
font-weight: Bold;
padding-left:.15rem;
line-height: .445rem;
height: .445rem;
......@@ -100,6 +102,7 @@ export default {
font-size: .12rem;
}
.item-child-title{
font-weight: medium;
color: #000000;
font-size: .15rem;
}
......
......@@ -106,7 +106,6 @@ export default {
beforeRouteLeave (to, from, next) {
// const answer = window.confirm('Do you really want to leave? you have unsaved changes!')
console.log(this.backStatus,22222);
if (this.backStatus) {
next()
} else {
......@@ -356,6 +355,8 @@ export default {
this.changeScore(obj)
this.showButton = 'next'
this.showAnswer = true
console.log(this.currentStatus,2222);
this.$refs[this.refChildrenObj[obj.questionType]].currentStatus = this.currentStatus
}else if(type == '4'){ // 填空
let curentRef = this.$refs[this.refChildrenObj[obj.questionType]]
......@@ -401,12 +402,29 @@ export default {
this.currentChildrenObj = this.childrenList[this.currentChildrenIndex] // 当前题目
this.currentChildrenIndex += 1 // 当前题目索引值
this.rightAns = this.currentChildrenObj.rightanswer // 正确答案
// console.log(this.currentChildrenObj,111);
// console.log(this.rightAns,'子试题正确答案');
this.userAns = ''
}else{
// this.nextQuestion()
// this.currentObj = this.list[this.currentIndex] // 当前题目
// this.currentIndex += 1 // 当前题目索引值
// this.rightAns = this.currentObj.rightanswer // 正确答案
// this.userAns = ''
this.currentObj = this.list[this.currentIndex] // 当前题目
this.currentIndex += 1 // 当前题目索引值
this.rightAns = this.currentObj.rightanswer // 正确答案
this.userAns = ''
this.colQuery.goodsId = this.currentObj.questionid
this.getColStatus()
if(this.currentObj.questionType === 5||this.currentObj.questionType === 6){ // 如果下一题是文字和视频
this.childrenList = this.currentObj.children
this.currentChildrenIndex = 1
this.currentChildrenObj = this.childrenList[0]
this.rightAns = this.currentChildrenObj.rightanswer
}
}
},
......
......@@ -93,7 +93,9 @@ export default {
})
},
backTo() {},
backTo() {
this.$router.push({name:'weekPractice'})
},
doAgain() {
this.$router.push({name:'practice',query:{
title:this.title,
......
差异被折叠。
......@@ -24,7 +24,7 @@
<!--<img :src="`./static/img/icon_0${index+1}.png`" alt="">-->
<div class="word">
<p><span>{{item.codeZh}}</span> <span>{{item.num}}道题</span></p>
<h2 @click="">查看</h2><!--code-->
<h2 @click="toView(item)">查看</h2><!--code-->
</div>
</li>
</ul>
......@@ -45,6 +45,7 @@
total:0,
loading: false,
finished: false,
}
},
created() {
......@@ -66,6 +67,10 @@
}
})
},
toView(item){
console.log(item,1);
this.$router.push({name:'myWrongDetail',query:{code:item.code}})
}
},
}
</script>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论