Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
2
20250310_人保春游
Project
Project
Details
Activity
Releases
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
SparkProjects
20250310_人保春游
Commits
a2211f94
Commit
a2211f94
authored
Mar 18, 2025
by
haiyoucuv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
music
parent
98fab2ad
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
0 deletions
+11
-0
longImgPop.jsx
src/components/longImgPop/longImgPop.jsx
+4
-0
musicStore.js
src/store/musicStore.js
+7
-0
No files found.
src/components/longImgPop/longImgPop.jsx
View file @
a2211f94
...
...
@@ -7,6 +7,8 @@ import modalStore from "@src/store/modal";
import
{
_throttle
}
from
"@src/utils/utils"
;
import
{
Button
}
from
"../Button"
;
import
DPlayer
from
"dplayer"
;
import
musicStore
from
"@src/store/musicStore"
;
import
{
RES_PATH
}
from
"../../../sparkrc"
;
@
observer
class
LongImgPop
extends
React
.
Component
{
...
...
@@ -33,9 +35,11 @@ class LongImgPop extends React.Component {
});
this
.
dp
.
on
(
"play"
,
()
=>
{
this
.
startInterval
();
musicStore
.
stopSound
(
RES_PATH
+
"audio/bgm.mp3"
);
});
this
.
dp
.
on
(
"pause"
,
()
=>
{
// this.endCountDown()
musicStore
.
playSound
(
RES_PATH
+
"audio/bgm.mp3"
,
true
);
});
}
if
(
this
.
props
.
popData
?.
noCount
)
{
...
...
src/store/musicStore.js
View file @
a2211f94
...
...
@@ -64,6 +64,13 @@ const musicStore = makeAutoObservable(new class {
howl
.
play
();
}
async
stopSound
(
src
)
{
const
howl
=
await
loadAudio
(
src
);
if
(
howl
)
{
howl
.
stop
();
}
}
});
...
...
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