Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
frontend-h5
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
songrui
frontend-h5
Commits
47252085
Commit
47252085
authored
Nov 22, 2024
by
songrui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
音频播放修改
parent
bdc6452d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
15 deletions
+26
-15
Mp3.vue
src/residentWX/components/mediaPlay/Mp3.vue
+20
-12
Mp4.vue
src/residentWX/components/mediaPlay/Mp4.vue
+1
-0
mp3.js
src/residentWX/components/mediaPlay/mp3.js
+0
-1
GeneralFUDetail.vue
src/residentWX/visit/detail/GeneralFUDetail.vue
+5
-2
No files found.
src/residentWX/components/mediaPlay/Mp3.vue
View file @
47252085
...
...
@@ -25,7 +25,8 @@ import { showToast } from 'vant'
export
default
{
props
:
{
file
:
{
default
:
()
=>
({})
}
file
:
{
default
:
()
=>
({})
},
activeMediaUrl
:
{
default
:
''
}
},
data
()
{
return
{
...
...
@@ -50,6 +51,8 @@ export default {
methods
:
{
init
()
{
this
.
player
=
new
musicPlayer
(
this
.
$refs
.
audio
)
this
.
player
.
init
()
this
.
player
.
setSrc
(
this
.
file
.
annexUrl
)
this
.
player
.
audioEl
.
onended
=
()
=>
{
console
.
log
(
'播放结束'
)
this
.
stop
()
...
...
@@ -62,19 +65,16 @@ export default {
}
if
(
!
this
.
player
.
audioCtx
)
{
this
.
player
.
init
()
this
.
player
.
setSrc
(
item
.
annexUrl
)
}
if
(
this
.
player
.
duration
&&
item
.
annexId
===
this
.
activeAudio
.
annexId
)
{
if
(
this
.
player
.
playing
)
{
this
.
stop
()
}
else
{
this
.
player
.
audioEl
.
play
()
this
.
player
.
playing
=
true
}
return
if
(
this
.
player
.
playing
)
{
this
.
stop
()
}
else
{
this
.
player
.
audioEl
.
play
()
this
.
activeAudio
=
item
this
.
player
.
playing
=
true
this
.
$emit
(
'play'
,
item
)
}
this
.
player
.
setSrc
(
item
.
annexUrl
)
this
.
activeAudio
=
item
this
.
player
.
playing
=
true
console
.
log
(
'this.player'
,
this
.
player
)
},
stop
()
{
...
...
@@ -95,6 +95,14 @@ export default {
this
.
player
.
progressChange
(
value
)
this
.
player
.
playing
=
true
}
},
watch
:
{
activeMediaUrl
(
val
)
{
console
.
log
(
'activeMediaUrl'
,
val
)
if
(
val
!==
this
.
file
.
annexUrl
)
{
this
.
stop
()
}
}
}
}
</
script
>
...
...
src/residentWX/components/mediaPlay/Mp4.vue
View file @
47252085
...
...
@@ -45,6 +45,7 @@ export default {
start
(
item
)
{
this
.
activeVideo
=
item
this
.
visible
=
true
this
.
$emit
(
'play'
,
item
)
}
}
}
...
...
src/residentWX/components/mediaPlay/mp3.js
View file @
47252085
...
...
@@ -70,7 +70,6 @@ export class musicPlayer {
this
.
audioEl
.
oncanplay
=
()
=>
{
console
.
log
(
'可播放'
)
setTimeout
(()
=>
{
this
.
audioEl
.
play
()
this
.
getAudioSource
()
},
100
)
}
...
...
src/residentWX/visit/detail/GeneralFUDetail.vue
View file @
47252085
...
...
@@ -144,10 +144,12 @@
</div>
</div>
<div
class=
"card mt-2"
v-if=
"detailInfo?.publicizeType?.includes(3)"
>
<Mp4
:files=
"mp4List"
/>
<Mp4
:files=
"mp4List"
:activeMediaUrl=
"activeMediaUrl"
@
play=
"e => activeMediaUrl = e.annexUrl"
/>
</div>
<div
class=
"card flex flex-col mt-2"
style=
"row-gap: .06rem;"
v-if=
"detailInfo?.publicizeType?.includes(2)"
>
<Mp3
:file=
"item"
v-for=
"item in mp3List"
:key=
"item.annexId"
/>
<Mp3
:file=
"item"
v-for=
"item in mp3List"
:key=
"item.annexId"
:activeMediaUrl=
"activeMediaUrl"
@
play=
"e => activeMediaUrl = e.annexUrl"
/>
</div>
</div>
</van-collapse-item>
...
...
@@ -278,6 +280,7 @@ export default {
{
title
:
'随访科室'
,
key
:
'visitOfficeName'
},
{
title
:
'随访医生'
,
key
:
'visitDoctorName'
}
],
activeMediaUrl
:
''
}
},
computed
:
{
...
...
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