Commit 72610769 authored by 罗超's avatar 罗超

2

parent 95d22c35
...@@ -119,6 +119,8 @@ ...@@ -119,6 +119,8 @@
provide provide
} from "vue"; } from "vue";
import Explain from './explain.vue' import Explain from './explain.vue'
const innerAudioContext = uni.createInnerAudioContext();
innerAudioContext.autoplay = false;
export default { export default {
components: { components: {
Explain Explain
...@@ -151,15 +153,18 @@ ...@@ -151,15 +153,18 @@
let data = reactive({ let data = reactive({
current: '', //用户选择 current: '', //用户选择
isShowExplain: false, isShowExplain: false,
}) })
let methods = { let methods = {
choice(x) { choice(x) {
data.current = x.Name; data.current = x.Name;
if (data.current !== props.item.Answer) { if (data.current !== props.item.Answer) {
methods.play('https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/audio/false.mp3')
setTimeout(() => { setTimeout(() => {
data.isShowExplain = true data.isShowExplain = true
}, 800) }, 800)
} else { } else {
methods.play('https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/audio/true.mp3')
setTimeout(() => { setTimeout(() => {
emit('next',1) emit('next',1)
}, 500) }, 500)
...@@ -168,6 +173,10 @@ ...@@ -168,6 +173,10 @@
todo() { todo() {
emit('next') emit('next')
data.isShowExplain = false data.isShowExplain = false
},
play(url) {
innerAudioContext.src =url
innerAudioContext.play()
} }
} }
onMounted(() => { onMounted(() => {
......
...@@ -99,6 +99,8 @@ ...@@ -99,6 +99,8 @@
import {ref,reactive,toRefs,toRef,getCurrentInstance,watch,computed,onMounted,provide} from "vue"; import {ref,reactive,toRefs,toRef,getCurrentInstance,watch,computed,onMounted,provide} from "vue";
import mypone from './myp-one.vue' import mypone from './myp-one.vue'
import Explain from './explain.vue' import Explain from './explain.vue'
const innerAudioContext = uni.createInnerAudioContext();
innerAudioContext.autoplay = false;
export default { export default {
components: { components: {
mypone, mypone,
...@@ -146,11 +148,13 @@ ...@@ -146,11 +148,13 @@
} }
if(data.test==props.item.Answer||props.item.Answer.indexOf(data.test)>-1){ if(data.test==props.item.Answer||props.item.Answer.indexOf(data.test)>-1){
data.type=1 data.type=1
methods.play('https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/audio/true.mp3')
setTimeout(()=>{ setTimeout(()=>{
emit('next',1) emit('next',1)
},500) },500)
}else{ }else{
data.type=2 data.type=2
methods.play('https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/audio/false.mp3')
setTimeout(()=>{ setTimeout(()=>{
data.isShowExplain=true data.isShowExplain=true
},500) },500)
...@@ -162,6 +166,10 @@ ...@@ -162,6 +166,10 @@
todo(){ todo(){
emit('next') emit('next')
data.isShowExplain = false data.isShowExplain = false
},
play(url) {
innerAudioContext.src =url
innerAudioContext.play()
} }
} }
onMounted(()=>{ onMounted(()=>{
......
...@@ -63,7 +63,8 @@ ...@@ -63,7 +63,8 @@
<view class="wordDuration" style="visibility: hidden;"> <view class="wordDuration" style="visibility: hidden;">
预计用时10分钟 预计用时10分钟
</view> </view>
<view class="wordBtn" <view class="wordBtn" v-if="(pageData.Words.NextWord==0||!pageData.Words.NextWord)&&(pageData.Words.ReviewWord==0||!pageData.Words.ReviewWord)"> 暂无新词</view>
<view class="wordBtn" v-else
@click="jumpPage(`/pages/word/word?CourseId=${pageData.Words.CourseId||0}&&ChapterId=${pageData.Words.NextCourseNo||0}&&ReviewChapterId=${pageData.Words.ReviewCourseNo||0}&&ClassId=${pageData.Words.ClassId||0}`)"> @click="jumpPage(`/pages/word/word?CourseId=${pageData.Words.CourseId||0}&&ChapterId=${pageData.Words.NextCourseNo||0}&&ReviewChapterId=${pageData.Words.ReviewCourseNo||0}&&ClassId=${pageData.Words.ClassId||0}`)">
开始学习 开始学习
</view> </view>
......
This diff is collapsed.
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