Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
YM4-10
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
template admin
YM4-10
Commits
e11a0036
Commit
e11a0036
authored
Oct 14, 2020
by
Chen Jiping
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:修复图片无音效的问题
parent
a5287492
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
1 deletion
+24
-1
ExercisesBean.ts
src/app/bean/ExercisesBean.ts
+2
-0
form.component.html
src/app/form/form.component.html
+8
-0
Exercises.ts
src/app/play/Exercises.ts
+3
-1
play.component.ts
src/app/play/play.component.ts
+11
-0
No files found.
src/app/bean/ExercisesBean.ts
View file @
e11a0036
...
@@ -3,6 +3,8 @@ import { Obj } from './ObjBean';
...
@@ -3,6 +3,8 @@ import { Obj } from './ObjBean';
export
class
ExercisesBean
extends
Obj
{
export
class
ExercisesBean
extends
Obj
{
answerIndex
:
number
;
answerIndex
:
number
;
picAudioUrl
:
String
;
wordArr
:
Array
<
WordBean
>
=
[];
wordArr
:
Array
<
WordBean
>
=
[];
}
}
...
...
src/app/form/form.component.html
View file @
e11a0036
...
@@ -198,6 +198,14 @@
...
@@ -198,6 +198,14 @@
</app-upload-image-with-preview>
</app-upload-image-with-preview>
</nz-form-control>
</nz-form-control>
</nz-form-item>
</nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
6
"
nzFor=
"{{j}}.audioUrl"
>
图片发音
</nz-form-label>
<nz-form-control
[
nzSpan
]="
6
"
>
<app-audio-recorder
id=
"{{j}}.picAudioUrl"
[
audioUrl
]="
data
.
picAudioUrl
"
(
audioUploaded
)="
onAudioUploadSuccess
($
event
,
data
,
'
picAudioUrl
')"
>
</app-audio-recorder>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
6
"
nzFor=
"exercises"
>
操作
</nz-form-label>
<nz-form-label
[
nzSpan
]="
6
"
nzFor=
"exercises"
>
操作
</nz-form-label>
<nz-form-control
[
nzSpan
]="
6
"
>
<nz-form-control
[
nzSpan
]="
6
"
>
...
...
src/app/play/Exercises.ts
View file @
e11a0036
...
@@ -24,6 +24,8 @@ export class Exercises {
...
@@ -24,6 +24,8 @@ export class Exercises {
shown
=
false
;
shown
=
false
;
pic
:
MySprite
;
init
(
images
,
data
)
{
init
(
images
,
data
)
{
...
@@ -109,7 +111,7 @@ export class Exercises {
...
@@ -109,7 +111,7 @@ export class Exercises {
pic
.
x
=
this
.
bg
.
width
/
2
;
pic
.
x
=
this
.
bg
.
width
/
2
;
pic
.
y
=
150
/
2
;
pic
.
y
=
150
/
2
;
console
.
log
(
pic
.
y
)
;
this
.
pic
=
pic
;
this
.
bg
.
addChild
(
pic
);
this
.
bg
.
addChild
(
pic
);
}
}
...
...
src/app/play/play.component.ts
View file @
e11a0036
...
@@ -589,6 +589,8 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -589,6 +589,8 @@ export class PlayComponent implements OnInit, OnDestroy {
this
.
addUrlToAudioObj
(
'
index_
'
+
i
,
exercises
.
audioUrl
);
this
.
addUrlToAudioObj
(
'
index_
'
+
i
,
exercises
.
audioUrl
);
this
.
addUrlToAudioObj
(
'
pic_
'
+
i
,
exercises
.
picAudioUrl
);
let
wordArr
=
exercises
.
wordArr
;
let
wordArr
=
exercises
.
wordArr
;
for
(
let
j
=
0
;
j
<
wordArr
.
length
;
++
j
){
for
(
let
j
=
0
;
j
<
wordArr
.
length
;
++
j
){
...
@@ -887,6 +889,15 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -887,6 +889,15 @@ export class PlayComponent implements OnInit, OnDestroy {
return
;
return
;
}
}
if
(
this
.
checkClickTarget
(
exercises
.
pic
)){
let
key
=
'
pic_
'
+
index
;
this
.
curAudio
=
this
.
audioObj
[
key
];
this
.
playAudio
(
key
,
true
);
return
;
}
if
(
!
exercises
.
answered
){
if
(
!
exercises
.
answered
){
if
(
this
.
checkClickTarget
(
exercises
.
indexBg1
)){
if
(
this
.
checkClickTarget
(
exercises
.
indexBg1
)){
...
...
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