Commit 1f8be06d authored by zhengke's avatar zhengke

修改

parent cc63fa89
...@@ -12,9 +12,13 @@ ...@@ -12,9 +12,13 @@
</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" :catchtouchmove="true">
<audio style="text-align: left" ref="audio" v-if="isShow" <!-- <audio style="text-align: left" ref="audio" v-if="isShow"
poster="http://pic.pimg.tw/pam86591/1408719752-3322564110_n.jpg" :src="item1.Src" name="日语听力" poster="http://pic.pimg.tw/pam86591/1408719752-3322564110_n.jpg" :src="item1.Src" name="日语听力"
:action="audioAction" controls></audio> :action="audioAction" controls></audio> -->
<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 - 460rpx)` }"> <view class="item1" :style="{ height: `calc(100vh - 460rpx)` }">
<template v-if="item1.StudentAnswer.length<item1.QuestionContentObj.length"> <template v-if="item1.StudentAnswer.length<item1.QuestionContentObj.length">
<view class="questionView"> <view class="questionView">
...@@ -139,7 +143,7 @@ ...@@ -139,7 +143,7 @@
method: "pause" method: "pause"
}, },
isIOS: false, isIOS: false,
isShow: true isPlay:false
}); });
let UserInfo = uni.getStorageSync('userInfo'); let UserInfo = uni.getStorageSync('userInfo');
let sys = uni.getSystemInfoSync().system; let sys = uni.getSystemInfoSync().system;
...@@ -178,6 +182,19 @@ ...@@ -178,6 +182,19 @@
this.$emit('getAfter'); this.$emit('getAfter');
} }
}, },
play(Src) {
if(data.isPlay){
innerAudioContext.pause();
data.isPlay=false;
}else{
innerAudioContext.src = Src;
innerAudioContext.play()
data.isPlay = true;
innerAudioContext.onEnded((e)=>{
data.isPlay = false;
})
}
},
//点击上一题 //点击上一题
getBeforeExam() { getBeforeExam() {
data.current = data.current - 1; data.current = data.current - 1;
...@@ -185,7 +202,8 @@ ...@@ -185,7 +202,8 @@
//点击下一题 //点击下一题
getNextExam(item) { getNextExam(item) {
if (item.StudentAnswer.length>0) { if (item.StudentAnswer.length>0) {
data.isShow = false innerAudioContext.stop();
data.isPlay=false;
let msg = { let msg = {
Id: 0, Id: 0,
StudentId: UserInfo.AccountId, StudentId: UserInfo.AccountId,
...@@ -219,7 +237,7 @@ ...@@ -219,7 +237,7 @@
let res = SetStudentPractice(msg).then(res => { let res = SetStudentPractice(msg).then(res => {
if (res) { if (res) {
if (res.Code == 1) { if (res.Code == 1) {
data.isShow = true;
} }
} }
}); });
...@@ -244,7 +262,7 @@ ...@@ -244,7 +262,7 @@
</script> </script>
<style scoped> <style scoped>
.AnswerBtn { .AnswerBtn {
margin-top:40rpx; margin-top:38rpx;
/* position: absolute; */ /* position: absolute; */
} }
...@@ -411,4 +429,58 @@ ...@@ -411,4 +429,58 @@
.isCanNext { .isCanNext {
background-color: gray !important; 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;
height: 25px;
vertical-align: middle;
display: inline-block;
-webkit-background-size: 54px 25px;
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;
height: 25px;
vertical-align: middle;
display: inline-block;
-webkit-background-size: 54px 25px;
background-size: 54px 25px;
-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;
background-color: #E4E5FB;
border-radius: 50%;
margin: 0 auto 30rpx;
display: flex;
justify-content: center;
align-items: center;
}
</style> </style>
...@@ -6,11 +6,7 @@ ...@@ -6,11 +6,7 @@
<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>
<!-- <audio style="text-align: left" ref="audio" poster="http://pic.pimg.tw/pam86591/1408719752-3322564110_n.jpg" <text class="Exam_Score">{{dataObj.Score}}分)</text>
:src="getAudioSrc(dataObj.Title)" name="日语听力" :action="audioAction" controls></audio> -->
<view style="float: right;margin:20rpx 0;">
<text class="Exam_Score">{{dataObj.Score}}分)</text>
</view>
<view class="item1" :style="{ height: `calc(100vh - 414rpx)` }"> <view class="item1" :style="{ height: `calc(100vh - 414rpx)` }">
<view class="questionView" v-if="!isShowJx"> <view class="questionView" v-if="!isShowJx">
<view v-for="(item, index) in dataObj.QuestionContentObj" :key="index" class="item2"> <view v-for="(item, index) in dataObj.QuestionContentObj" :key="index" class="item2">
...@@ -131,20 +127,6 @@ ...@@ -131,20 +127,6 @@
return false return false
} }
}, },
//获取音频链接
getAudioSrc(Src){
let arr = Src.split(" "); //按空格分段
var MySrc='';
arr.map((e) => {
if (e.indexOf("src") != -1) {
let Before = e.split("url=")[1]
if (Before) {
MySrc = decodeURIComponent(Before.slice(0, -1));
}
}
});
return MySrc
},
play(Src) { play(Src) {
let arr = Src.split(" "); //按空格分段 let arr = Src.split(" "); //按空格分段
var MySrc=''; var MySrc='';
......
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
dataList: [], dataList: [],
msg: { msg: {
pageIndex: 1, pageIndex: 1,
pageSize: 1000, pageSize: 10000,
BankId: 0, BankId: 0,
StudentId:0 StudentId:0
}, },
...@@ -93,7 +93,8 @@ ...@@ -93,7 +93,8 @@
}, },
setMsg:{ setMsg:{
Id:0 Id:0
} },
CommonType:-1
}); });
let UserInfo = uni.getStorageSync('userInfo'); let UserInfo = uni.getStorageSync('userInfo');
...@@ -105,15 +106,19 @@ ...@@ -105,15 +106,19 @@
if(e&&e.detail){ if(e&&e.detail){
data.current = e.detail.current; data.current = e.detail.current;
ctx.$refs.myRef[0].clickParent(); ctx.$refs.myRef[0].clickParent();
this.setPractise(); if(data.CommonType==3||data.CommonType==4||data.CommonType==5||data.CommonType==6){
this.setPractise();
}
} }
}, },
//设置已答题 //设置已答题
setPractise(){ setPractise(){
data.setMsg.Id = data.dataList[data.current-1].Id; if(data.current>=1){
SetPracticeReview(data.setMsg).then(res=>{ data.setMsg.Id = data.dataList[data.current-1].Id;
SetPracticeReview(data.setMsg).then(res=>{
})
})
}
}, },
getList() { getList() {
if(data.isShowJx){ if(data.isShowJx){
...@@ -123,21 +128,13 @@ ...@@ -123,21 +128,13 @@
if (res) { if (res) {
if (res.Code == 1) { if (res.Code == 1) {
let TempData = res.Data.PageData; let TempData = res.Data.PageData;
//解析音频 data.dataList=TempData;
TempData.forEach(x=>{
if(x.QuestionTypeKey=='listening'){ // if(data.msg.pageSize==20){
let arr = x.Title.split(" "); //按空格分段 // data.dataList=TempData;
arr.map((e) => { // }else{
if (e.indexOf("src") != -1) { // data.dataList = [...data.dataList, ...TempData];
let Before = e.split("url=")[1] // }
if (Before) {
x.Src = decodeURIComponent(Before.slice(0, -1));
}
}
});
}
})
data.dataList = TempData;
data.Count = res.Data.Count; data.Count = res.Data.Count;
} }
} }
...@@ -200,10 +197,20 @@ ...@@ -200,10 +197,20 @@
this.msg.StudentId=''; this.msg.StudentId='';
this.isShowJx=false; this.isShowJx=false;
this.getList(); this.getList();
// setTimeout(function(){
// let _that = this;
// console.log('111');
// _that.msg.pageSize=1000;
// this.getList();
// },2000)
} }
if(options.Type==2){ if(options.Type==2){
this.isShowJx=true; this.isShowJx=true;
this.getList(); this.getList();
// setTimeout(function(){
// this.msg.pageSize=1000;
// this.getList();
// },2000)
} }
//3 4 5 6从错题跳过来 //3 4 5 6从错题跳过来
if(options.Type==3){ if(options.Type==3){
...@@ -234,6 +241,7 @@ ...@@ -234,6 +241,7 @@
this.getWrongWord(); this.getWrongWord();
this.isShowJx=true; this.isShowJx=true;
} }
this.CommonType = options.Type;
} }
} }
}; };
......
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