Commit 7252b178 authored by sujie@126.com's avatar sujie@126.com

Merge branch 'lvtz_home' of git.server:wangxuelai/wechatapp.shangjiadao.com into sj-dev-0220

parents 44cd9c0b 3ce56b61
...@@ -734,7 +734,7 @@ Page({ ...@@ -734,7 +734,7 @@ Page({
} }
}) })
this.innerAudioContext.seek(audioStorage[value].currentTime) this.innerAudioContext.seek(audioStorage[value].currentTime)
this.innerAudioContext.play(); this.innerAudioContext.play()
this.innerAudioContext.onError((e)=>{ this.innerAudioContext.onError((e)=>{
const { actPalyaudioValue, audioStorage} = this.data const { actPalyaudioValue, audioStorage} = this.data
audioStorage[actPalyaudioValue].isWaiting = false; audioStorage[actPalyaudioValue].isWaiting = false;
......
...@@ -112,10 +112,52 @@ Page({ ...@@ -112,10 +112,52 @@ Page({
{type: 5,label:"今日练字作业",title: '请各位同学认真查看今日要练习的作业,并跟着练习'} {type: 5,label:"今日练字作业",title: '请各位同学认真查看今日要练习的作业,并跟着练习'}
], ],
currentMockType: 0, currentMockType: 0,
successDailogShow: false successDailogShow: false,
actPalyaudioValue: ''
}, },
onLoad: function(options) { // Do some initialize when page load. onLoad: function(options) { // Do some initialize when page load.
const that = this;
this.innerAudioContext = wx.createInnerAudioContext(); // 当前页面唯一的一个音频容器 this.innerAudioContext = wx.createInnerAudioContext(); // 当前页面唯一的一个音频容器
this.innerAudioContext.onWaiting((e)=>{
const { actPalyaudioValue, audioStorage} = this.data
if(audioStorage[actPalyaudioValue].isWaiting){
return
}
audioStorage[actPalyaudioValue].isWaiting = true
that.setData({
audioStorage,
})
setTimeout((e)=>{
this.data.audioStorage[actPalyaudioValue].isWaiting = false;
this.setData({
audioStorage: this.data.audioStorage
})
},5000)
})
this.innerAudioContext.onTimeUpdate((e) => {
const { actPalyaudioValue, audioStorage} = this.data
if (audioStorage[actPalyaudioValue].isWaiting) {
clearInterval(that.data.voiceInterval);
that.voiceIntervalPlay(actPalyaudioValue);
audioStorage[actPalyaudioValue].isWaiting = false
that.setData({
audioStorage,
})
}
})
this.innerAudioContext.onError((e)=>{
const { actPalyaudioValue, audioStorage} = this.data
audioStorage[actPalyaudioValue].isWaiting = false;
audioStorage[actPalyaudioValue].play = false;
wx.showToast({
title: '音频播放出错啦',
icon: 'none',
duration: 2000
})
that.setData({
audioStorage,
})
});
const { const {
id, id,
tid, tid,
...@@ -612,60 +654,22 @@ Page({ ...@@ -612,60 +654,22 @@ Page({
audioStorage[value].play = true; audioStorage[value].play = true;
} }
} }
this.innerAudioContext.onWaiting((e)=>{
const { actPalyaudioValue, audioStorage} = this.data // this.innerAudioContext.onCanplay((e)=>{
if(audioStorage[actPalyaudioValue].isWaiting){ // const { actPalyaudioValue, audioStorage} = this.data
return // if (audioStorage[actPalyaudioValue].isWaiting) {
} // clearInterval(that.data.voiceInterval);
audioStorage[actPalyaudioValue].isWaiting = true // that.voiceIntervalPlay(actPalyaudioValue);
that.setData({ // audioStorage[actPalyaudioValue].isWaiting = false
audioStorage, // that.setData({
}) // audioStorage,
setTimeout((e)=>{ // })
this.data.audioStorage[actPalyaudioValue].isWaiting = false; // }
this.setData({ // })
audioStorage: this.data.audioStorage console.log(audioStorage[value].currentTime, 'audioStorage[value].currentTime');
})
},5000)
})
this.innerAudioContext.onTimeUpdate((e) => {
const { actPalyaudioValue, audioStorage} = this.data
if (audioStorage[actPalyaudioValue].isWaiting) {
clearInterval(that.data.voiceInterval);
that.voiceIntervalPlay(actPalyaudioValue);
audioStorage[actPalyaudioValue].isWaiting = false
that.setData({
audioStorage,
})
}
})
this.innerAudioContext.onCanplay((e)=>{
const { actPalyaudioValue, audioStorage} = this.data
if (audioStorage[actPalyaudioValue].isWaiting) {
clearInterval(that.data.voiceInterval);
that.voiceIntervalPlay(actPalyaudioValue);
audioStorage[actPalyaudioValue].isWaiting = false
that.setData({
audioStorage,
})
}
})
this.innerAudioContext.seek(audioStorage[value].currentTime) this.innerAudioContext.seek(audioStorage[value].currentTime)
this.innerAudioContext.play(); this.innerAudioContext.play();
this.innerAudioContext.onError((e)=>{
const { actPalyaudioValue, audioStorage} = this.data
audioStorage[actPalyaudioValue].isWaiting = false;
audioStorage[actPalyaudioValue].play = false;
wx.showToast({
title: '音频播放出错啦',
icon: 'none',
duration: 2000
})
that.setData({
audioStorage,
})
});
//that.voiceIntervalPlay(value); //that.voiceIntervalPlay(value);
that.setData({ that.setData({
audioStorage, audioStorage,
......
...@@ -112,7 +112,10 @@ Component({ ...@@ -112,7 +112,10 @@ Component({
fingureAnimation:false, fingureAnimation:false,
}, },
created () { created () {
// console.log(LocalStorage.getItem('visitor'), "LocalStorage.getItem('visitor')")
// this.setData({
// visitor: LocalStorage.getItem('visitor'),
// })
}, },
attached () { attached () {
}, },
...@@ -123,6 +126,9 @@ Component({ ...@@ -123,6 +126,9 @@ Component({
// 最后一次单击事件点击发生时间 // 最后一次单击事件点击发生时间
lastTapTime: 0, lastTapTime: 0,
ready () { ready () {
this.setData({
visitor: LocalStorage.getItem('visitor'),
})
// const customerId = LocalStorage.getItem('visitor') && LocalStorage.getItem('visitor').studentId; // const customerId = LocalStorage.getItem('visitor') && LocalStorage.getItem('visitor').studentId;
const customerId = app.globalData.currentSchoolStudentId; const customerId = app.globalData.currentSchoolStudentId;
this.setData({ this.setData({
......
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