Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
W
wechatapp.shangjiadao.com
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangxuelai
wechatapp.shangjiadao.com
Commits
70d9f3d8
Commit
70d9f3d8
authored
Mar 03, 2020
by
lvtz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fi
parent
88921047
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
58 additions
and
54 deletions
+58
-54
index.js
business/pages/calendarthemeeditor/index.js
+1
-1
index.js
business/pages/themeeditor/index.js
+57
-53
No files found.
business/pages/calendarthemeeditor/index.js
View file @
70d9f3d8
...
...
@@ -734,7 +734,7 @@ Page({
}
})
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
;
...
...
business/pages/themeeditor/index.js
View file @
70d9f3d8
...
...
@@ -112,10 +112,52 @@ Page({
{
type
:
5
,
label
:
"今日练字作业"
,
title
:
'请各位同学认真查看今日要练习的作业,并跟着练习'
}
],
currentMockType
:
0
,
successDailogShow
:
false
successDailogShow
:
false
,
actPalyaudioValue
:
''
},
onLoad
:
function
(
options
)
{
// Do some initialize when page load.
const
that
=
this
;
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
{
id
,
tid
,
...
...
@@ -612,60 +654,22 @@ Page({
audioStorage
[
value
].
play
=
true
;
}
}
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
.
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.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,
// })
// }
// })
console
.
log
(
audioStorage
[
value
].
currentTime
,
'audioStorage[value].currentTime'
);
this
.
innerAudioContext
.
seek
(
audioStorage
[
value
].
currentTime
)
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
.
setData
({
audioStorage
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment