Commit a8329433 authored by zhengke's avatar zhengke

修改

parent 915430b5
......@@ -11,15 +11,12 @@
</template>
</van-nav-bar>
<swiper class="swiper-box" :style="{height: `calc(100vh - 180rpx)`}" :current="current" @change="onchange">
<swiper-item v-for="(item1, index1) in dataList" :key="index1" :catchtouchmove="true">
<!-- <audio style="text-align: left" ref="audio" v-if="isShow"
poster="http://pic.pimg.tw/pam86591/1408719752-3322564110_n.jpg" :src="item1.Src" name="日语听力"
:action="audioAction" controls></audio> -->
<swiper-item v-for="(item1, index1) in dataList" :key="index1">
<view class="My_listen" @click="play(item1.Src)">
<i class="icon_audio_default" v-if="!isPlay"></i>
<i class="icon_audio_playing" v-else></i>
</view>
<view class="item1" :style="{ height: `calc(100vh - 560rpx)` }">
<view class="item1" :style="{ height: `calc(100vh - 480rpx)` }">
<template v-if="item1.StudentAnswer.length<item1.QuestionContentObj.length">
<view class="questionView">
<view v-for="(item2, index2) in item1.QuestionContentObj" :key="index2" class="item2">
......@@ -95,10 +92,10 @@
</view>
</template>
</view>
<view class="AnswerBtn clear">
<view class="AnswerBtn clear" style="display:none">
<view class="AnswerBtnFirst" @click="getBeforeExam()" v-if="current!=0">上一题</view>
<view class="AnswerBtnSecond" :class="{'isCanNext':item1.StudentAnswer.length==0}" v-if="current!=dataList.length"
@click="getNextExam(item1)">下一题</view>
<view class="AnswerBtnSecond" :class="{'isCanNext':item1.StudentAnswer.length==0}"
v-if="current!=dataList.length" @click="getNextExam(item1)">下一题</view>
</view>
</swiper-item>
</swiper>
......@@ -143,13 +140,17 @@
method: "pause"
},
isIOS: false,
isPlay:false
isPlay: false
});
let UserInfo = uni.getStorageSync('userInfo');
let sys = uni.getSystemInfoSync().system;
watch(() => [...props.paperData], (val) => {
data.dataList = [...data.dataList, ...val];
})
watch(()=>data.current, (newVal, oldValue) => {
innerAudioContext.stop();
data.isPlay=false;
},{deep:true});
let methods = {
//阻止手动滑动
stopTouchMove() {
......@@ -167,6 +168,9 @@
// 单选
singerChange(item1, index, item3) {
item1.StudentAnswer[index] = item3.Name;
if (item1.StudentAnswer.length == item1.QuestionAnswerList.length) {
this.getNextExam();
}
},
getErrorAnswer(item1, index, name) {
if (item1.StudentAnswer[index] == name) {
......@@ -183,14 +187,14 @@
}
},
play(Src) {
if(data.isPlay){
if (data.isPlay) {
innerAudioContext.pause();
data.isPlay=false;
}else{
data.isPlay = false;
} else {
innerAudioContext.src = Src;
innerAudioContext.play()
data.isPlay = true;
innerAudioContext.onEnded((e)=>{
innerAudioContext.onEnded((e) => {
data.isPlay = false;
})
}
......@@ -201,47 +205,47 @@
},
//点击下一题
getNextExam(item) {
if (item.StudentAnswer.length>0) {
innerAudioContext.stop();
data.isPlay=false;
let msg = {
Id: 0,
StudentId: UserInfo.AccountId,
Category: data.dataList[data.current].Category,
QuestionId: data.dataList[data.current].QuestionId,
Title: data.dataList[data.current].Title,
QuestionContent: data.dataList[data.current].QuestionContentObj,
QuestionTypeId: data.dataList[data.current].QuestionTypeId,
QuestionTypeKey: data.dataList[data.current].QuestionTypeKey,
StudentAnswer: data.dataList[data.current].StudentAnswer,
AnswerParse: data.dataList[data.current].AnswerParse,
LevelType: data.dataList[data.current].LevelType,
Answer: data.dataList[data.current].QuestionAnswerList.toString(),
IsAnswer: 0,
IsWrong: 0
}
if (data.dataList[data.current].StudentAnswer.length > 0) {
msg.IsAnswer = 1;
let msg = {
Id: 0,
StudentId: UserInfo.AccountId,
Category: data.dataList[data.current].Category,
QuestionId: data.dataList[data.current].QuestionId,
Title: data.dataList[data.current].Title,
QuestionContent: data.dataList[data.current].QuestionContentObj,
QuestionTypeId: data.dataList[data.current].QuestionTypeId,
QuestionTypeKey: data.dataList[data.current].QuestionTypeKey,
StudentAnswer: data.dataList[data.current].StudentAnswer,
AnswerParse: data.dataList[data.current].AnswerParse,
LevelType: data.dataList[data.current].LevelType,
Answer: data.dataList[data.current].QuestionAnswerList.toString(),
IsAnswer: 0,
IsWrong: 0
}
if (data.dataList[data.current].StudentAnswer.length > 0) {
msg.IsAnswer = 1;
} else {
msg.IsAnswer = 0;
}
if (data.dataList[data.current].StudentAnswer.length == data.dataList[data.current]
.QuestionAnswerList.length) {
if (data.dataList[data.current].StudentAnswer.toString() == data.dataList[data.current]
.QuestionAnswerList.toString()) {
msg.IsWrong = 0
} else {
msg.IsAnswer = 0;
msg.IsWrong = 1
}
if (data.dataList[data.current].StudentAnswer.length == data.dataList[data.current]
.QuestionAnswerList.length) {
if (data.dataList[data.current].StudentAnswer.toString() == data.dataList[data.current]
.QuestionAnswerList.toString()) {
msg.IsWrong = 0
} else {
msg.IsWrong = 1
}
let res = SetStudentPractice(msg).then(res => {
if (res) {
if (res.Code == 1) {
}
}
let res = SetStudentPractice(msg).then(res => {
if (res) {
if (res.Code == 1) {
}
}
});
});
if(msg.IsWrong == 0){
data.current = data.current + 1;
innerAudioContext.stop();
data.isPlay = false;
}
},
};
......@@ -262,7 +266,7 @@
</script>
<style scoped>
.AnswerBtn {
margin-top:38rpx;
margin-top: 38rpx;
/* position: absolute; */
}
......@@ -302,24 +306,29 @@
align-items: center;
justify-content: space-between;
}
.isRightAnswer{
background-color: green!important;
color:#fff!important;
.isRightAnswer {
background-color: green !important;
color: #fff !important;
}
.isRightText{
color:green!important;
.isRightText {
color: green !important;
}
.isTrueAnswer {
color: green !important;
}
.isNotRightAnswer{
.isNotRightAnswer {
background-color: red;
color:#fff!important;
color: #fff !important;
}
.isNotAnswer {
color: red ;
color: red;
}
.AnswerContent {
font-size: 30rpx;
padding: 25rpx;
......@@ -437,6 +446,7 @@
.isCanNext {
background-color: gray !important;
}
.icon_audio_default {
background: transparent url('https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/iconloop.png') no-repeat 0 0;
width: 18px;
......@@ -447,7 +457,7 @@
background-size: 54px 25px;
background-position: -36px center;
}
.icon_audio_playing {
background: transparent url('https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/iconloop.png') no-repeat 0 0;
width: 18px;
......@@ -459,28 +469,29 @@
-webkit-animation: audio_playing 1s infinite;
background-position: 0px center;
}
@-webkit-keyframes audio_playing {
30% {
background-position: 0px center;
}
31% {
background-position: -18px center;
}
61% {
background-position: -18px center;
}
61.5% {
background-position: -36px center;
}
100% {
background-position: -36px center;
}
}
.My_listen {
width: 150rpx;
height: 150rpx;
......
......@@ -11,9 +11,9 @@
</template>
</van-nav-bar>
<swiper class="swiper-box" :style="{height: `calc(100vh - 320rpx)`}" :current="current" @change="onchange">
<swiper-item v-for="(item1, index1) in dataList" :key="index1" :catchtouchmove="true">
<swiper-item v-for="(item1, index1) in dataList" :key="index1">
<view class="item1">
<view class="flex" style="max-height:520rpx;overflow:auto;">
<view class="flex" style="max-height:600rpx;overflow:auto;">
<view class="num readTitle" v-html="item1.Title"></view>
</view>
<view :style="{maxHeight: `calc(100vh - 800rpx)`}"
......@@ -98,7 +98,7 @@
</swiper-item>
</swiper>
</view>
<view class="AnswerBtn clear">
<view class="AnswerBtn clear" style="display:none;">
<view class="AnswerBtnFirst" @click="getBeforeExam()" v-if="current!=0">上一题
</view>
<view class="AnswerBtnSecond" :class="{'isCanNext':!isCanNext}" v-if="current!=dataList.length" @click="getNextExam()">下一题</view>
......@@ -143,6 +143,9 @@
data.dataList = [...data.dataList, ...val];
})
let methods = {
stopTouchMove(){
return true
},
clickImg(src) {
console.log(src);
wx.previewImage({
......@@ -175,6 +178,7 @@
//判断题数已经全做
if(item1.StudentAnswer.length==item1.QuestionContentObj.length){
data.isCanNext=true;
this.getNextExam();
}
},
onchange(e) {
......@@ -189,42 +193,42 @@
},
//点击下一题
getNextExam() {
if(data.isCanNext){
let msg = {
Id: 0,
StudentId: UserInfo.AccountId,
Category: data.dataList[data.current].Category,
QuestionId: data.dataList[data.current].QuestionId,
Title: data.dataList[data.current].Title,
QuestionContent: data.dataList[data.current].QuestionContentObj,
QuestionTypeId: data.dataList[data.current].QuestionTypeId,
QuestionTypeKey: data.dataList[data.current].QuestionTypeKey,
StudentAnswer: data.dataList[data.current].StudentAnswer,
AnswerParse: data.dataList[data.current].AnswerParse,
LevelType:data.dataList[data.current].LevelType,
Answer:data.dataList[data.current].Answer,
IsAnswer: 0,
IsWrong: 0
}
if(data.dataList[data.current].StudentAnswer.length>0){
msg.IsAnswer=1;
let msg = {
Id: 0,
StudentId: UserInfo.AccountId,
Category: data.dataList[data.current].Category,
QuestionId: data.dataList[data.current].QuestionId,
Title: data.dataList[data.current].Title,
QuestionContent: data.dataList[data.current].QuestionContentObj,
QuestionTypeId: data.dataList[data.current].QuestionTypeId,
QuestionTypeKey: data.dataList[data.current].QuestionTypeKey,
StudentAnswer: data.dataList[data.current].StudentAnswer,
AnswerParse: data.dataList[data.current].AnswerParse,
LevelType:data.dataList[data.current].LevelType,
Answer:data.dataList[data.current].Answer,
IsAnswer: 0,
IsWrong: 0
}
if(data.dataList[data.current].StudentAnswer.length>0){
msg.IsAnswer=1;
}else{
msg.IsAnswer=0;
}
if(data.dataList[data.current].StudentAnswer.length==data.dataList[data.current].QuestionAnswerList.length){
if(data.dataList[data.current].StudentAnswer.toString()==data.dataList[data.current].QuestionAnswerList.toString()){
msg.IsWrong = 0
}else{
msg.IsAnswer=0;
msg.IsWrong = 1
}
if(data.dataList[data.current].StudentAnswer.length==data.dataList[data.current].QuestionAnswerList.length){
if(data.dataList[data.current].StudentAnswer.toString()==data.dataList[data.current].QuestionAnswerList.toString()){
msg.IsWrong = 0
}else{
msg.IsWrong = 1
}
let res = SetStudentPractice(msg).then(res => {
if (res) {
if (res.Code == 1) {
}
}
let res = SetStudentPractice(msg).then(res => {
if (res) {
if (res.Code == 1) {
}
}
});
});
if(msg.IsWrong==0){
data.current = data.current + 1;
}
}
......
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