Commit a8329433 authored by zhengke's avatar zhengke

修改

parent 915430b5
...@@ -11,15 +11,12 @@ ...@@ -11,15 +11,12 @@
</template> </template>
</van-nav-bar> </van-nav-bar>
<swiper class="swiper-box" :style="{height: `calc(100vh - 180rpx)`}" :current="current" @change="onchange"> <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"> <swiper-item v-for="(item1, index1) in dataList" :key="index1">
<!-- <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> -->
<view class="My_listen" @click="play(item1.Src)"> <view class="My_listen" @click="play(item1.Src)">
<i class="icon_audio_default" v-if="!isPlay"></i> <i class="icon_audio_default" v-if="!isPlay"></i>
<i class="icon_audio_playing" v-else></i> <i class="icon_audio_playing" v-else></i>
</view> </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"> <template v-if="item1.StudentAnswer.length<item1.QuestionContentObj.length">
<view class="questionView"> <view class="questionView">
<view v-for="(item2, index2) in item1.QuestionContentObj" :key="index2" class="item2"> <view v-for="(item2, index2) in item1.QuestionContentObj" :key="index2" class="item2">
...@@ -95,10 +92,10 @@ ...@@ -95,10 +92,10 @@
</view> </view>
</template> </template>
</view> </view>
<view class="AnswerBtn clear"> <view class="AnswerBtn clear" style="display:none">
<view class="AnswerBtnFirst" @click="getBeforeExam()" v-if="current!=0">上一题</view> <view class="AnswerBtnFirst" @click="getBeforeExam()" v-if="current!=0">上一题</view>
<view class="AnswerBtnSecond" :class="{'isCanNext':item1.StudentAnswer.length==0}" v-if="current!=dataList.length" <view class="AnswerBtnSecond" :class="{'isCanNext':item1.StudentAnswer.length==0}"
@click="getNextExam(item1)">下一题</view> v-if="current!=dataList.length" @click="getNextExam(item1)">下一题</view>
</view> </view>
</swiper-item> </swiper-item>
</swiper> </swiper>
...@@ -143,13 +140,17 @@ ...@@ -143,13 +140,17 @@
method: "pause" method: "pause"
}, },
isIOS: false, isIOS: false,
isPlay:false isPlay: false
}); });
let UserInfo = uni.getStorageSync('userInfo'); let UserInfo = uni.getStorageSync('userInfo');
let sys = uni.getSystemInfoSync().system; let sys = uni.getSystemInfoSync().system;
watch(() => [...props.paperData], (val) => { watch(() => [...props.paperData], (val) => {
data.dataList = [...data.dataList, ...val]; data.dataList = [...data.dataList, ...val];
}) })
watch(()=>data.current, (newVal, oldValue) => {
innerAudioContext.stop();
data.isPlay=false;
},{deep:true});
let methods = { let methods = {
//阻止手动滑动 //阻止手动滑动
stopTouchMove() { stopTouchMove() {
...@@ -167,6 +168,9 @@ ...@@ -167,6 +168,9 @@
// 单选 // 单选
singerChange(item1, index, item3) { singerChange(item1, index, item3) {
item1.StudentAnswer[index] = item3.Name; item1.StudentAnswer[index] = item3.Name;
if (item1.StudentAnswer.length == item1.QuestionAnswerList.length) {
this.getNextExam();
}
}, },
getErrorAnswer(item1, index, name) { getErrorAnswer(item1, index, name) {
if (item1.StudentAnswer[index] == name) { if (item1.StudentAnswer[index] == name) {
...@@ -183,14 +187,14 @@ ...@@ -183,14 +187,14 @@
} }
}, },
play(Src) { play(Src) {
if(data.isPlay){ if (data.isPlay) {
innerAudioContext.pause(); innerAudioContext.pause();
data.isPlay=false; data.isPlay = false;
}else{ } else {
innerAudioContext.src = Src; innerAudioContext.src = Src;
innerAudioContext.play() innerAudioContext.play()
data.isPlay = true; data.isPlay = true;
innerAudioContext.onEnded((e)=>{ innerAudioContext.onEnded((e) => {
data.isPlay = false; data.isPlay = false;
}) })
} }
...@@ -201,9 +205,6 @@ ...@@ -201,9 +205,6 @@
}, },
//点击下一题 //点击下一题
getNextExam(item) { getNextExam(item) {
if (item.StudentAnswer.length>0) {
innerAudioContext.stop();
data.isPlay=false;
let msg = { let msg = {
Id: 0, Id: 0,
StudentId: UserInfo.AccountId, StudentId: UserInfo.AccountId,
...@@ -241,7 +242,10 @@ ...@@ -241,7 +242,10 @@
} }
} }
}); });
if(msg.IsWrong == 0){
data.current = data.current + 1; data.current = data.current + 1;
innerAudioContext.stop();
data.isPlay = false;
} }
}, },
}; };
...@@ -262,7 +266,7 @@ ...@@ -262,7 +266,7 @@
</script> </script>
<style scoped> <style scoped>
.AnswerBtn { .AnswerBtn {
margin-top:38rpx; margin-top: 38rpx;
/* position: absolute; */ /* position: absolute; */
} }
...@@ -302,24 +306,29 @@ ...@@ -302,24 +306,29 @@
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
} }
.isRightAnswer{
background-color: green!important; .isRightAnswer {
color:#fff!important; background-color: green !important;
color: #fff !important;
} }
.isRightText{
color:green!important; .isRightText {
color: green !important;
} }
.isTrueAnswer { .isTrueAnswer {
color: green !important; color: green !important;
} }
.isNotRightAnswer{
.isNotRightAnswer {
background-color: red; background-color: red;
color:#fff!important; color: #fff !important;
} }
.isNotAnswer { .isNotAnswer {
color: red ; color: red;
} }
.AnswerContent { .AnswerContent {
font-size: 30rpx; font-size: 30rpx;
padding: 25rpx; padding: 25rpx;
...@@ -437,6 +446,7 @@ ...@@ -437,6 +446,7 @@
.isCanNext { .isCanNext {
background-color: gray !important; background-color: gray !important;
} }
.icon_audio_default { .icon_audio_default {
background: transparent url('https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/iconloop.png') no-repeat 0 0; background: transparent url('https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/iconloop.png') no-repeat 0 0;
width: 18px; width: 18px;
...@@ -481,6 +491,7 @@ ...@@ -481,6 +491,7 @@
background-position: -36px center; background-position: -36px center;
} }
} }
.My_listen { .My_listen {
width: 150rpx; width: 150rpx;
height: 150rpx; height: 150rpx;
......
...@@ -11,9 +11,9 @@ ...@@ -11,9 +11,9 @@
</template> </template>
</van-nav-bar> </van-nav-bar>
<swiper class="swiper-box" :style="{height: `calc(100vh - 320rpx)`}" :current="current" @change="onchange"> <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="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 class="num readTitle" v-html="item1.Title"></view>
</view> </view>
<view :style="{maxHeight: `calc(100vh - 800rpx)`}" <view :style="{maxHeight: `calc(100vh - 800rpx)`}"
...@@ -98,7 +98,7 @@ ...@@ -98,7 +98,7 @@
</swiper-item> </swiper-item>
</swiper> </swiper>
</view> </view>
<view class="AnswerBtn clear"> <view class="AnswerBtn clear" style="display:none;">
<view class="AnswerBtnFirst" @click="getBeforeExam()" v-if="current!=0">上一题 <view class="AnswerBtnFirst" @click="getBeforeExam()" v-if="current!=0">上一题
</view> </view>
<view class="AnswerBtnSecond" :class="{'isCanNext':!isCanNext}" v-if="current!=dataList.length" @click="getNextExam()">下一题</view> <view class="AnswerBtnSecond" :class="{'isCanNext':!isCanNext}" v-if="current!=dataList.length" @click="getNextExam()">下一题</view>
...@@ -143,6 +143,9 @@ ...@@ -143,6 +143,9 @@
data.dataList = [...data.dataList, ...val]; data.dataList = [...data.dataList, ...val];
}) })
let methods = { let methods = {
stopTouchMove(){
return true
},
clickImg(src) { clickImg(src) {
console.log(src); console.log(src);
wx.previewImage({ wx.previewImage({
...@@ -175,6 +178,7 @@ ...@@ -175,6 +178,7 @@
//判断题数已经全做 //判断题数已经全做
if(item1.StudentAnswer.length==item1.QuestionContentObj.length){ if(item1.StudentAnswer.length==item1.QuestionContentObj.length){
data.isCanNext=true; data.isCanNext=true;
this.getNextExam();
} }
}, },
onchange(e) { onchange(e) {
...@@ -189,7 +193,6 @@ ...@@ -189,7 +193,6 @@
}, },
//点击下一题 //点击下一题
getNextExam() { getNextExam() {
if(data.isCanNext){
let msg = { let msg = {
Id: 0, Id: 0,
StudentId: UserInfo.AccountId, StudentId: UserInfo.AccountId,
...@@ -225,6 +228,7 @@ ...@@ -225,6 +228,7 @@
} }
} }
}); });
if(msg.IsWrong==0){
data.current = data.current + 1; 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