Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
公瑾
/
lucky-draw
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
73cbe31f
authored
2020-01-02 22:08:46 +0800
by
vito
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
add audio
1 parent
c85c64a7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
4 deletions
README.md
src/App.vue
README.md
View file @
73cbe31
...
...
@@ -39,6 +39,7 @@
-
本抽奖程序无暗箱操作,无后台,无后门。
-
名单和照片显示只需导入一种即可,无导入数据则使用抽奖号码。
-
建议使用最新的 Chrome 浏览器打开体验最佳。
-
由于背景游戏音乐加载较慢,可以在抽奖前提前打开缓存好。
## License
...
...
src/App.vue
View file @
73cbe31
...
...
@@ -68,7 +68,15 @@
</div>
</transition>
<el-button
class=
"audio"
type=
"text"
@
click=
"audioPlaying = !audioPlaying"
>
<el-button
class=
"audio"
type=
"text"
@
click=
"
() =>
{
playAudio(!audioPlaying);
}
"
>
<i
class=
"iconfont"
:class=
"[audioPlaying ? 'iconstop' : 'iconplay1']"
...
...
@@ -96,6 +104,7 @@
autoplay
loop
@
play=
"playHandler"
@
pause=
"pauseHandler"
>
<source
:src=
"audioSrc"
/>
你的浏览器不支持audio标签
...
...
@@ -231,9 +240,6 @@ export default {
this
.
reloadTagCanvas
();
});
}
},
audioPlaying
(
v
)
{
this
.
playAudio
(
v
);
}
},
mounted
()
{
...
...
@@ -246,6 +252,9 @@ export default {
playHandler
()
{
this
.
audioPlaying
=
true
;
},
pauseHandler
()
{
this
.
audioPlaying
=
false
;
},
playAudio
(
type
)
{
if
(
type
)
{
this
.
$el
.
querySelector
(
'#audiobg'
).
play
();
...
...
Please
register
or
sign in
to post a comment