Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
educationStu
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
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
向伟
educationStu
Commits
ba23f732
Commit
ba23f732
authored
Jan 12, 2022
by
zhengke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
be795b78
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
60 additions
and
4 deletions
+60
-4
Pronunciation.vue
src/components/word/Pronunciation.vue
+60
-4
No files found.
src/components/word/Pronunciation.vue
View file @
ba23f732
...
...
@@ -18,8 +18,10 @@
</view>
</view>
<view
class=
"listen"
@
click=
"play"
>
<image
src=
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/laba2x.png"
mode=
"aspectFit"
class=
"listenIcon"
></image>
<!--
<image
src=
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/laba2x.png"
mode=
"aspectFit"
class=
"listenIcon"
></image>
-->
<i
class=
"icon_audio_default"
v-if=
"!isPlay"
></i>
<i
class=
"icon_audio_playing"
v-else
></i>
</view>
<view
class=
"listenText"
>
播放读音
...
...
@@ -63,13 +65,22 @@
}
},
setup
(
props
)
{
const
data
=
reactive
({
isPlay
:
false
})
const
methods
=
{
play
()
{
innerAudioContext
.
src
=
`https://fanyi.baidu.com/gettts?lan=jp&text=
${
encodeURIComponent
(
props
.
item
.
WordContent
)}
&spd=3&source=web`
innerAudioContext
.
src
=
`https://fanyi.baidu.com/gettts?lan=jp&text=
${
encodeURIComponent
(
props
.
item
.
WordContent
)}
&spd=3&source=web`
innerAudioContext
.
play
()
data
.
isPlay
=
true
;
innerAudioContext
.
onEnded
((
e
)
=>
{
data
.
isPlay
=
false
;
})
}
}
return
{
...
toRefs
(
data
),
...
methods
};
}
...
...
@@ -77,6 +88,51 @@
</
script
>
<
style
scoped
>
.icon_audio_default
{
background
:
transparent
url('https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/iconloop.png')
no-repeat
0
0
;
width
:
18px
;
height
:
25px
;
vertical-align
:
middle
;
display
:
inline-block
;
-webkit-background-size
:
54px
25px
;
background-size
:
54px
25px
;
background-position
:
-36px
center
;
}
.icon_audio_playing
{
background
:
transparent
url('https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/iconloop.png')
no-repeat
0
0
;
width
:
18px
;
height
:
25px
;
vertical-align
:
middle
;
display
:
inline-block
;
-webkit-background-size
:
54px
25px
;
background-size
:
54px
25px
;
-webkit-animation
:
audio_playing
1s
infinite
;
background-position
:
0px
center
;
}
@-webkit-keyframes
audio_playing
{
30
%
{
background-position
:
0px
center
;
}
31
%
{
background-position
:
-18px
center
;
}
61
%
{
background-position
:
-18px
center
;
}
61
.5
%
{
background-position
:
-36px
center
;
}
100
%
{
background-position
:
-36px
center
;
}
}
.wordPronItem
{
width
:
640
rpx
;
height
:
990
rpx
;
...
...
@@ -160,4 +216,4 @@
color
:
#B8B8B8
;
text-align
:
center
;
}
</
style
>
\ No newline at end of file
</
style
>
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