Commit 532e5987 authored by zhengke's avatar zhengke

修改

parent 1a8f0ca9
......@@ -72,3 +72,39 @@ export function GetQuestionReading(data) {
data
})
}
/**
* 获取等级评测
* @param {JSON参数} data
*/
export function GetBankTypeList(data) {
return request({
url: '/Question/GetBankTypeList',
method: 'post',
data
})
}
/**
* 获取问题数量
* @param {JSON参数} data
*/
export function GetAppQuestionStatic(data) {
return request({
url: '/Exam/GetAppQuestionStatic',
method: 'post',
data
})
}
/**
* 获取单词
* @param {JSON参数} data
*/
export function GetQuestionWords(data) {
return request({
url: '/Exam/GetQuestionWords',
method: 'post',
data
})
}
\ No newline at end of file
<template>
<view>
<!-- <van-nav-bar fixed>
<van-nav-bar fixed>
<template #left>
<van-icon
name="cross"
......@@ -19,7 +19,7 @@
>答题卡</view
>
</template>
</van-nav-bar> -->
</van-nav-bar>
<view class="answer-sheets">
<view class="flex flex_wrap">
<view class="flex flex_wrap">
......
......@@ -12,7 +12,7 @@
</view>
</view>
<swiper class="swiper-box" :style="{
height: `calc(100vh - 200rpx)`,
height: `calc(100vh - 350rpx)`,
}" :autoplay="autoplay" :current="current" @change="onchange">
<swiper-item v-if="sortIndex != 1"></swiper-item>
<swiper-item v-for="(item1, index1) in data" :key="index1">
......
<template>
<!-- 单选题 -->
<view>
<view class="item" style="padding: 0 20px">
<!-- <view class="name">
<view class="grow">
{{ changeNumToHan(sortIndex) }}{{ data.GroupName }}
<text class="Exam_Score">(共{{ data.DetailsList.length }}道,{{ data.GScore }}分)</text>
</view>
<view class="ExamIndex_Box">
<text class="Single_Before">{{ ExamIndex }}</text
>/<text class="Exam_Total">{{ data.DetailsList.length }}</text>
</view>
</view> -->
<view style="height: 100rpx"></view>
<van-nav-bar fixed>
<template #left>
<van-icon name="cross" size="32rpx" @click="goBack()" />
</template>
<template #title>
{{dataList.length}}
</template>
</van-nav-bar>
<swiper
class="swiper-box"
:style="{
height: `calc(100vh - 300rpx - ${statusBarHeight}px)`,
}"
:autoplay="autoplay"
:current="current"
@change="onchange"
:skip-hidden-item-layout="true"
:disable-programmatic-animation="true"
>
<swiper-item v-for="(item1, index1) in data" :key="index1">
<!-- <view class="item1" :style="{height: `calc(100vh - 390rpx - ${statusBarHeight}px)`}">
<view class="flex flex_start_center">
<view class="num" v-html="item1.Title"></view><text class="Exam_Score">({{item1.Score}})</text>
</view>
<view
v-for="(item2, index2) in item1.QuestionContentObj"
:key="index2"
class="flex item2 flex_start_center"
>
<template v-if="isOperate">
<view
class="chooseNum"
:class="{ myAnswer: item2.IsAnswer }"
@click="change(item1, item2)"
>{{ item2.ShowName }}
</view>
<view
class="chooseName"
@click="change(item1, item2)"
v-html="item2.Content"
></view>
</template>
<template v-else>
<view
class="chooseNum"
:class="{ isTrueAnswer: item2.IsAnswer }"
>{{ item2.Name }}
</view>
<view
class="chooseName"
:class="{ isTrueAnswer: item2.IsAnswer }"
v-html="item2.Content"
>
</view>
</template>
</view>
<view class="AnswerContent" v-if="!isOperate">
<view>
<text style="color: #8c8a94">正确答案:</text>
<text class="isTrueAnswer">{{ item1.Answer }}</text
>,
<text
>您的答案是:
<template v-if="item1.StundetAnswer != ''">
<text
v-if="item1.Answer == item1.StundetAnswer"
class="isTrueAnswer"
>
{{ item1.StundetAnswer }},回答正确
</text>
<text v-else class="isNotAnswer"
>{{ item1.StundetAnswer }},回答错误</text
>
</template>
<template v-else>
<text>未作答</text>
</template>
</text>
</view>
<view style="margin:20rpx 0;" v-if="item1.StudentScore!=''||item1.StudentScore===0">
<text style="color:#8c8a94">您的得分:</text>
<text class="isTrueAnswer" v-if="item1.StudentScore>0">{{item1.StudentScore}}</text>
<text class="isNotAnswer" v-else>{{item1.StudentScore}}</text>
</view>
<view
style="margin-top: 20rpx; word-wrap: break-word"
v-if="item1.AnswerParse" class="flex"
>
<text style="color: #8c8a94;flex-shrink: 0;">解析:</text>
<view style="color: #000" v-html="item1.AnswerParse"></view>
</view>
</view>
</view> -->
<!-- <view class="AnswerBtn clear">
<view class="AnswerBtnFirst" @click="getBeforeExam()" v-if="ExamIndex!=1||sortIndex!=1">上一题</view>
<view class="AnswerBtnSecond" v-if="sortIndex != sortTotal" @click="getNextExam()">下一题</view>
</view> -->
</swiper-item>
</swiper>
</view>
<van-toast id="van-toast" />
</view>
</template>
<script>
import {
ref,
reactive,
toRefs,
toRef,
getCurrentInstance,
watch,
computed,
onMounted,
} from "vue";
export default {
props: {
paperData: Array
},
setup(props, context) {
let { ctx } = getCurrentInstance();
let data = reactive({
autoplay: false,
dataList: [],
current: 1, //默认从第几个开始-用于从快捷菜单点入
ExamIndex: 1, //第几题
isOperate: props.isOperate,
statusBarHeight: 0,
ExamStatus: props.ExamStatus
});
watch(()=>[...props.paperData],(val)=>{
data.dataList=val
})
console.log(data,'dataList');
let methods = {
back() {
uni.navigateBack();
},
onchange(e) {
data.ExamIndex = e.detail.current;
// if (data.sortIndex == 1) {
// data.ExamIndex = e.detail.current + 1;
// }
},
jumpAnswerSheet() {
uni.navigateTo({
url: "/pages/exam/answerSheet",
});
},
// //点击上一题
// getBeforeExam(){
// data.current = data.current-1;
// },
// //点击下一题
// getNextExam(){
// data.current = data.current+1;
// }
};
onMounted(() => {
data.statusBarHeight = uni.getSystemInfoSync().statusBarHeight;
});
let that = methods;
return {
...toRefs(data),
...methods,
};
},
async onLoad(options) {
}
};
</script>
<style scoped>
.AnswerBtn{
margin-top: 20rpx;
padding:0 20px;
}
.clear{ clear:both}
.AnswerBtnFirst{
width:250rpx;
height:60rpx;
text-align: center;
line-height: 60rpx;
border-radius: 10rpx;
border:1px solid #00ACF9;
color:#00ACF9;
float:left;
}
.AnswerBtnSecond{
width:250rpx;
height:60rpx;
text-align: center;
line-height: 60rpx;
border-radius: 10rpx;
background-color: #00ACF9;
color:#fff;
float:right;
}
.name {
height: 90rpx;
font-size: 30rpx;
font-family: PingFang SC;
font-weight: 800;
color: #111111;
display: flex;
align-items: center;
justify-content: space-between;
}
.isTrueAnswer {
color: green !important;
}
.isNotAnswer {
color: red !important;
}
.AnswerContent {
font-size: 28rpx;
padding: 25rpx;
background-color: #f4f4f4;
border-radius: 5px;
}
.Single_Before {
font-size: 30rpx;
font-weight: bold;
color: #da7878;
}
.ExamIndex_Box {
margin-right: 40rpx;
}
.Exam_Total {
font-size: 25rpx;
color: gray;
}
.answerSheet {
font-size: 30rpx;
margin-left: 20rpx;
color: #000;
}
.swiper-box {
box-sizing: border-box;
}
.num {
font-size: 30rpx;
font-family: PingFang SC;
color: #111111;
}
.item {
/* margin-bottom: 40rpx; */
position: relative;
}
.item1 {
/* margin: 25rpx 0; */
align-items: center;
}
.item2 {
padding-left: 25rpx;
margin: 30rpx 0;
}
.myAnswer {
background-color: #00acf9 !important;
color: #ffffff !important;
}
.chooseNum {
width: 50rpx;
height: 50rpx;
text-align: center;
line-height: 50rpx;
border-radius: 50%;
border: 1px solid #e2e2e2;
margin-right: 30rpx;
font-size: 30rpx;
font-family: PingFang SC;
font-weight: bold;
color: #111111;
}
.chooseName {
font-size: 30rpx;
font-family: PingFang SC;
font-weight: 500;
color: #111111;
}
.Exam_Score{
color:#999999;
font-size:28rpx;
}
</style>
......@@ -95,7 +95,10 @@
},{
"path": "MyExam"
},{
"path": "examStart"
"path": "examStart",
"style": {
"navigationStyle": "custom"
}
},{
"path": "examGradeList"
}]
......
......@@ -20,13 +20,13 @@
.Ques_Select {
padding: 5rpx;
width: 80rpx;
background-color: #FFF3F8;
color: #F27573;
border-radius: 20rpx;
font-size: 25rpx;
position: relative;
padding: 5rpx 0 5rpx 15rpx;
display: flex;
align-items: center;
padding: 5rpx 10rpx 5rpx 20rpx;
}
.Ques_CirContent {
......@@ -160,8 +160,6 @@
border-top: 5px solid #F27573;
display: inline-block;
margin-left: 10rpx;
position: absolute;
top: 17rpx;
}
.level_Choice{
color:#000000;
......@@ -171,9 +169,7 @@
margin-bottom:50rpx;
}
.level_Content{
display:flex;
width:100%;
justify-content: space-between;
}
.level_Content view{
padding:10rpx 0;
......@@ -182,11 +178,16 @@
border-radius: 30rpx;
text-align: center;
margin:0 30rpx 30rpx 0;
width:180rpx;
width:173rpx;
display:inline-block;
}
.level_Content view:nth-child(3n){
margin-right:0;
}
.checkedLevel{
background-color: #FFF3F8!important;
color: #F27573!important;
}
</style>
<template>
<view class="Question_Bank">
......@@ -200,24 +201,24 @@
</view>
</view>
<view class="Ques_CirContent">
<view class="Ques_Circle" @click="goExam()">
<view class="Ques_Circle" @click="goExam(1)">
<view class="Ques_Top">单词</view>
<view class="Ques_Num">6/89</view>
<view class="Ques_Num">{{TypeObj.wordsFinishCount}}/{{TypeObj.wordsTotalCount}}</view>
<img src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/word1.png" alt="" />
</view>
<view class="Ques_Circle">
<view class="Ques_Top">语法</view>
<view class="Ques_Num">6/89</view>
<view class="Ques_Num">{{TypeObj.grammarFinishCount}}/{{TypeObj.grammarTotalCount}}</view>
<img src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/word2.png" alt="" />
</view>
<view class="Ques_Circle">
<view class="Ques_Top">听力</view>
<view class="Ques_Num">6/89</view>
<view class="Ques_Num">{{TypeObj.listeningFinishCount}}/{{TypeObj.listeningTotalCount}}</view>
<img src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/word3.png" alt="" />
</view>
<view class="Ques_Circle" style="margin-right:0;">
<view class="Ques_Circle" style="margin-right:0;" @click="goExam()">
<view class="Ques_Top">阅读</view>
<view class="Ques_Num">6/89</view>
<view class="Ques_Num">{{TypeObj.readingFinishCount}}/{{TypeObj.readingTotalCount}}</view>
<img src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/word4.png" alt="" />
</view>
</view>
......@@ -275,23 +276,13 @@
flex-direction: column;
align-items: center;
background: #fff;
width: 500rpx;
height: 400rpx;
width: 580rpx;
height: 420rpx;
padding:20rpx;
">
<view class="level_Choice">等级选择</view>
<view class="level_Content">
<view @click="getLevel('N5')">N5</view>
<view @click="getLevel('N4')">N4</view>
<view @click="getLevel('N3')">N3</view>
</view>
<view class="level_Content">
<view @click="getLevel('N2')">N2</view>
<view @click="getLevel('N1')">N1</view>
<view>高考真题</view>
</view>
<view class="level_Content">
<view>高考模拟</view>
<view v-for="(item,index) in LevelData" :key="index" :class="{'checkedLevel':item.Id==TypeMsg.BankType}" @click="getLevel(item)">{{item.Name}}</view>
</view>
</view>
</van-popup>
......@@ -309,19 +300,35 @@
computed,
onMounted,
} from "vue";
import { GetBankTypeList,GetAppQuestionStatic } from "../../api/exam";
export default {
props: {},
setup(props, ctx) {
let data = reactive({
msg: {},
showPop: false,
comNum:'N3'
LevelData: [],
comNum:'N3',
TypeMsg:{
BankType:3,
StudentId:1
},
TypeObj:{}
});
let methods = {
//获取等级
async getLevels(){
let res = await GetBankTypeList({});
if (res) {
if (res.Code == 1) {
this.LevelData = res.Data;
}
}
},
//返回首页
goExam() {
goExam(Type) {
uni.navigateTo({
url: '/pages/exam/examStart'
url: '/pages/exam/examStart?Type='+Type+'&&BankType='+data.TypeMsg.BankType
});
},
showExambox() {
......@@ -332,10 +339,18 @@
data.showPop = false;
},
//点击选择等级
getLevel(num){
console.log(num,'num');
data.comNum = num;
getLevel(obj){
data.comNum = obj.Name;
data.TypeMsg.BankType = obj.Id;
data.showPop = false;
this.getLevelTotal();
},
//获取等级切换数据
async getLevelTotal(){
let res = await GetAppQuestionStatic(data.TypeMsg);
if (res) {
data.TypeObj = res.Data;
}
},
//跳转到日语等级评测列表
goJpGrade(){
......@@ -345,12 +360,19 @@
}
};
let that = methods;
onMounted(() => {
});
return {
...toRefs(data),
...methods,
};
},
onLoad(options) {},
async onLoad(options) {
await this.getLevels();
let UserInfo = uni.getStorageSync('userInfo');
this.TypeMsg.StudentId = UserInfo.AccountId;
await this.getLevelTotal();
}
};
</script>
......
<template>
<view>
<view :style="{ 'padding-top': `${statusBarHeight}px` }">
<view style="height: 100rpx"></view>
<van-nav-bar fixed>
<template #left>
<van-icon name="cross" size="32rpx" @click="goBack()" />
</template>
<template #title>
</template>
</van-nav-bar>
<view class="exam-con" v-if="!isShowAnswer && !isShowNotice">
<i
class="iconfont icon-caidanzu answerSheet"
......@@ -11,8 +19,7 @@
"
@click="showAnswerSheet"
></i>
<view v-for="(item, index) in dataList" :key="index">
<!-- 阅读理解 -->
<!-- <view v-for="(item, index) in dataList" :key="index">
<readingCompre
:startIndex="item.startIndex"
:paperData="dataList"
......@@ -22,7 +29,9 @@
@answerChange="getAnswerChange($event, index)"
v-if="item.QuestionTypeKey === 'reading-comprehensio' && index === changeIndex"
/>
</view>
</view> -->
<!-- 单词 -->
<word v-if="Type==1" :paperData="dataList" />
</view>
<view v-if="isShowAnswer">
<view class="answer-con" v-if="!isShowAnswerSee">
......@@ -69,12 +78,14 @@ import {
} from "vue";
import { GetQuestionReading } from "../../api/exam";
import { changeNumToHan } from "../../utils/index";
import { submitPaper } from "../../api/exam";
import { submitPaper,GetQuestionWords } from "../../api/exam";
import answer from "../../components/question/answer.vue"; //答题卡
import readingCompre from "../../components/question/readingCompre";
import word from "../../components/question/word.vue";
export default {
components: {
word,
readingCompre,
answer
},
......@@ -97,14 +108,35 @@ export default {
ExamStatus: -1,
SubmitTimes: 0, //后台设置几分钟后可提交
isShowAnswerSee: false,
examMsg:{
PageIndex: 1,
PageSize:20,
BankType: 1
},
Type: 1, //1单词 2语法 3听力 4阅读
});
let methods = {
changeNumToHan,
//返回
goBack(){
uni.navigateBack();
},
jumpPage() {
uni.navigateTo({
url: "/pages/exam/examPaper",
});
},
GetWords(){
let res = GetQuestionWords(data.examMsg).then(res=>{
if (res) {
if (res.Code == 1) {
this.dataList = res.Data.PageData;
console.log(data.dataList,'数据');
}
}
});
},
async GetMyQuestionReading() {
let res = await GetQuestionReading(data.msg);
if (res) {
......@@ -138,54 +170,9 @@ export default {
this.dataList[val.index].startIndex = val.index + 1;
data.isShowAnswer = false;
},
getNowTime() {
let dateTime;
let yy = new Date().getFullYear();
let mm = new Date().getMonth() + 1;
let dd = new Date().getDate();
let hh = new Date().getHours();
let mf =
new Date().getMinutes() < 10
? "0" + new Date().getMinutes()
: new Date().getMinutes();
let ss =
new Date().getSeconds() < 10
? "0" + new Date().getSeconds()
: new Date().getSeconds();
dateTime = yy + "-" + mm + "-" + dd + " " + hh + ":" + mf + ":" + ss;
return dateTime;
},
//交卷
async savePaper() {
let obj = JSON.parse(JSON.stringify(data.peaperDetail.Paper));
delete obj.Group_Id;
obj.Exam_Student_Id = parseInt(data.Exam_Student_Id);
let time1 = data.StartTime;
let time2 = methods.getNowTime();
var d1 = new Date(time1);
var d2 = new Date(time2);
let TimeDis = parseInt(d2 - d1) / 1000 / 60;
if (TimeDis < data.SubmitTimes) {
uni.showToast({
title: `开考不足${data.SubmitTimes}分钟禁止交卷哦~`,
icon: "none",
});
return;
}
let res = await submitPaper(obj);
if (res) {
if (res.Code == 1) {
uni.showToast({
title: res.Message,
icon: "none",
});
setTimeout(() => {
uni.navigateTo({
url: "/pages/index/index",
});
}, 1000);
}
}
},
};
onMounted(() => {
......@@ -197,7 +184,18 @@ export default {
};
},
async onLoad(options) {
await this.GetMyQuestionReading();
console.log(options,'options');
if(options&&options.Type){
this.Type = options.Type;
}
if(options&&options.BankType){
this.examMsg.BankType = options.BankType;
}
//获取单词
if(this.Type==1){
this.GetWords();
}
// await this.GetMyQuestionReading();
},
};
</script>
......
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