Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
ym008
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
ym008
Commits
3ca61d0c
Commit
3ca61d0c
authored
Feb 22, 2020
by
liujiangnan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
支持课件11
parent
180b2328
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
237 additions
and
171 deletions
+237
-171
form.component.html
src/app/form/form.component.html
+102
-86
play.component.ts
src/app/play/play.component.ts
+135
-85
No files found.
src/app/form/form.component.html
View file @
3ca61d0c
<div
class=
"model-content"
>
<div
class=
"model-content"
>
<div
nz-row
>
<div
nz-row
>
<div
nz-col
nzOffset=
'4'
><h1
nz-title
>
课程内容编辑
</h1></div>
<div
nz-col
nzOffset=
'4'
>
<h1
nz-title
>
课程内容编辑
</h1>
</div>
</div>
</div>
<div
nz-form
>
<div
nz-form
>
<div
id=
'title-anchor'
>
<div
id=
'title-anchor'
>
...
@@ -22,8 +24,7 @@
...
@@ -22,8 +24,7 @@
<nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
3
"
nzFor=
"t_audio_url"
>
发音
</nz-form-label>
<nz-form-label
[
nzSpan
]="
3
"
nzFor=
"t_audio_url"
>
发音
</nz-form-label>
<nz-form-control
[
nzSpan
]="
6
"
>
<nz-form-control
[
nzSpan
]="
6
"
>
<app-audio-recorder
<app-audio-recorder
[
audioUrl
]="
item
.
title
.
t_audio_url
"
id=
"t_audio_url"
[
audioUrl
]="
item
.
title
.
t_audio_url
"
id=
"t_audio_url"
(
audioUploaded
)="
onAudioUploadSuccess
($
event
,
item
.
title
,
'
t_audio_url
')"
>
(
audioUploaded
)="
onAudioUploadSuccess
($
event
,
item
.
title
,
'
t_audio_url
')"
>
</app-audio-recorder>
</app-audio-recorder>
</nz-form-control>
</nz-form-control>
...
@@ -31,13 +32,15 @@
...
@@ -31,13 +32,15 @@
<nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
3
"
nzFor=
"t_font_size"
>
字体大小
</nz-form-label>
<nz-form-label
[
nzSpan
]="
3
"
nzFor=
"t_font_size"
>
字体大小
</nz-form-label>
<nz-form-control
[
nzSpan
]="
6
"
>
<nz-form-control
[
nzSpan
]="
6
"
>
<nz-input-number
[(
ngModel
)]="
item
.
title
.
t_font_size
"
[
nzMin
]="
1
"
[
nzStep
]="
1
"
(
blur
)="
save
()"
></nz-input-number>
<nz-input-number
[(
ngModel
)]="
item
.
title
.
t_font_size
"
[
nzMin
]="
1
"
[
nzStep
]="
1
"
(
blur
)="
save
()"
>
</nz-input-number>
</nz-form-control>
</nz-form-control>
</nz-form-item>
</nz-form-item>
<nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
3
"
nzFor=
"t_font"
>
字体
</nz-form-label>
<nz-form-label
[
nzSpan
]="
3
"
nzFor=
"t_font"
>
字体
</nz-form-label>
<nz-form-control
[
nzSpan
]="
4
"
>
<nz-form-control
[
nzSpan
]="
4
"
>
<nz-select
[(
ngModel
)]="
item
.
title
.
t_font
"
[
nzShowSearch
]='
true
'
nzAllowClear
nzPlaceHolder=
"Please select the font"
(
ngModelChange
)="
save
()"
>
<nz-select
[(
ngModel
)]="
item
.
title
.
t_font
"
[
nzShowSearch
]='
true
'
nzAllowClear
nzPlaceHolder=
"Please select the font"
(
ngModelChange
)="
save
()"
>
<nz-option
nzValue=
"BRLNSB"
nzLabel=
"BRLNSB"
></nz-option>
<nz-option
nzValue=
"BRLNSB"
nzLabel=
"BRLNSB"
></nz-option>
<nz-option
nzValue=
"BRLNSDB"
nzLabel=
"BRLNSDB"
></nz-option>
<nz-option
nzValue=
"BRLNSDB"
nzLabel=
"BRLNSDB"
></nz-option>
<nz-option
nzValue=
"BRLNSR"
nzLabel=
"BRLNSR"
></nz-option>
<nz-option
nzValue=
"BRLNSR"
nzLabel=
"BRLNSR"
></nz-option>
...
@@ -55,145 +58,159 @@
...
@@ -55,145 +58,159 @@
<nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
3
"
nzFor=
"t_font_color"
>
颜色
</nz-form-label>
<nz-form-label
[
nzSpan
]="
3
"
nzFor=
"t_font_color"
>
颜色
</nz-form-label>
<nz-form-control
[
nzSpan
]="
4
"
>
<nz-form-control
[
nzSpan
]="
4
"
>
<nz-select
[(
ngModel
)]="
item
.
title
.
t_font_color
"
[
nzShowSearch
]='
true
'
nzAllowClear
nzPlaceHolder=
"Please select the color"
(
ngModelChange
)="
save
()"
>
<nz-select
[(
ngModel
)]="
item
.
title
.
t_font_color
"
[
nzShowSearch
]='
true
'
nzAllowClear
nzPlaceHolder=
"Please select the color"
(
ngModelChange
)="
save
()"
>
<nz-option
nzValue=
"#008000"
nzLabel=
"绿色"
></nz-option>
<nz-option
nzValue=
"#008000"
nzLabel=
"绿色"
></nz-option>
<nz-option
nzValue=
"#FF0000"
nzLabel=
"红色"
></nz-option>
<nz-option
nzValue=
"#FF0000"
nzLabel=
"红色"
></nz-option>
<nz-option
nzValue=
"#D2691E"
nzLabel=
"巧克力色"
></nz-option>
<nz-option
nzValue=
"#D2691E"
nzLabel=
"巧克力色"
></nz-option>
<nz-option
nzValue=
"#000000"
nzLabel=
"黑色"
></nz-option>
<nz-option
nzValue=
"#000000"
nzLabel=
"黑色"
></nz-option>
</nz-select>
</nz-select>
</nz-form-control>
</nz-form-control>
</nz-form-item>
</nz-form-item>
</div>
</div>
<div
id=
'listen-anchor'
>
<div
id=
'listen-anchor'
>
<nz-divider
nzText=
"听力材料"
nzOrientation=
"left"
></nz-divider>
<nz-divider
nzText=
"听力材料"
nzOrientation=
"left"
></nz-divider>
<nz-form-item>
<nz-form-item>
<nz-form-control
[
nzSpan
]="
6
"
nzOffset=
"3"
>
<nz-form-control
[
nzSpan
]="
6
"
nzOffset=
"3"
>
<app-audio-recorder
id=
"item.listen_audio_url"
<app-audio-recorder
id=
"item.listen_audio_url"
[
audioUrl
]="
item
.
listen_audio_url
"
[
audioUrl
]="
item
.
listen_audio_url
"
(
audioUploaded
)="
onAudioUploadSuccess
($
event
,
item
,
'
listen_audio_url
')"
>
(
audioUploaded
)="
onAudioUploadSuccess
($
event
,
item
,
'
listen_audio_url
')"
>
</app-audio-recorder>
</app-audio-recorder>
</nz-form-control>
</nz-form-control>
</nz-form-item>
</nz-form-item>
</div>
</div>
<div>
<div>
<nz-divider
nzText=
"字母(组合)"
nzOrientation=
"left"
></nz-divider>
<nz-divider
nzText=
"字母(组合)"
nzOrientation=
"left"
></nz-divider>
<nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
3
"
nzFor=
"words"
>
字母组合
</nz-form-label>
<nz-form-label
[
nzSpan
]="
3
"
nzFor=
"words"
>
字母组合一
</nz-form-label>
<nz-form-control
[
nzSpan
]="
6
"
>
<nz-form-control
[
nzSpan
]="
6
"
>
<input
nz-input
type=
"text"
id=
"words"
[(
ngModel
)]="
item
.
words
"
(
blur
)="
save
()"
>
<input
nz-input
type=
"text"
id=
"words"
[(
ngModel
)]="
item
.
words
"
(
blur
)="
save
()"
>
</nz-form-control>
</nz-form-control>
</nz-form-item>
</nz-form-item>
<nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
3
"
nzFor=
"words_audio_url"
>
字母组合发音
</nz-form-label>
<nz-form-label
[
nzSpan
]="
3
"
nzFor=
"words_audio_url"
>
字母组合一发音
</nz-form-label>
<nz-form-control
[
nzSpan
]="
6
"
>
<nz-form-control
[
nzSpan
]="
6
"
>
<app-audio-recorder
<app-audio-recorder
[
audioUrl
]="
item
.
words_audio_url
"
id=
"words_audio_url"
[
audioUrl
]="
item
.
words_audio_url
"
id=
"words_audio_url"
(
audioUploaded
)="
onAudioUploadSuccess
($
event
,
item
,
'
words_audio_url
')"
>
(
audioUploaded
)="
onAudioUploadSuccess
($
event
,
item
,
'
words_audio_url
')"
>
</app-audio-recorder>
</app-audio-recorder>
</nz-form-control>
</nz-form-control>
</nz-form-item>
</nz-form-item>
</div>
<nz-form-item>
<div>
<nz-form-label
[
nzSpan
]="
3
"
nzFor=
"words_two"
>
字母组合二
</nz-form-label>
<nz-divider
nzText=
"单词组"
nzOrientation=
"left"
></nz-divider>
<nz-form-control
[
nzSpan
]="
6
"
>
<input
nz-input
type=
"text"
id=
"words_two"
[(
ngModel
)]="
item
.
words_two
"
(
blur
)="
save
()"
>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
3
"
nzFor=
"words_two_audio_url"
>
字母组合二发音
</nz-form-label>
<nz-form-control
[
nzSpan
]="
6
"
>
<app-audio-recorder
[
audioUrl
]="
item
.
words_two_audio_url
"
id=
"words_two_audio_url"
(
audioUploaded
)="
onAudioUploadSuccess
($
event
,
item
,
'
words_two_audio_url
')"
>
</app-audio-recorder>
</nz-form-control>
</nz-form-item>
</div>
<div>
<nz-divider
nzText=
"单词组"
nzOrientation=
"left"
></nz-divider>
<nz-form-item>
<nz-form-item>
<nz-form-control
[
nzSpan
]="
20
"
nzOffset=
"2"
>
<nz-form-control
[
nzSpan
]="
20
"
nzOffset=
"2"
>
<div
*
ngFor=
"let it of wordArr; let i = index"
class=
"card-item"
style=
"padding: 0.5vw;"
>
<div
*
ngFor=
"let it of wordArr; let i = index"
class=
"card-item"
style=
"padding: 0.5vw;"
>
<div
class=
"border"
>
<div
class=
"border"
>
<h5
style=
"width: 100%; line-height: 40px; text-align: center;"
>
单词组-{{i+1}}
</h5>
<h5
style=
"width: 100%; line-height: 40px; text-align: center;"
>
单词组-{{i+1}}
</h5>
<nz-divider
nzText=
"左侧单词"
nzOrientation=
"left"
></nz-divider>
<nz-divider
nzText=
"左侧单词"
nzOrientation=
"left"
></nz-divider>
<div
nz-form
>
<div
nz-form
>
<nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
6
"
nzFor=
"it.left.word_val"
>
单词
</nz-form-label>
<nz-form-label
[
nzSpan
]="
6
"
nzFor=
"it.left.word_val"
>
单词
</nz-form-label>
<nz-form-control
[
nzSpan
]="
6
"
>
<nz-form-control
[
nzSpan
]="
6
"
>
<input
type=
"text"
nz-input
placeholder=
"请录入单词"
[(
ngModel
)]="
it
.
left
.
word_val
"
(
blur
)="
saveWordItem
(
i
,'
left
')"
>
<input
type=
"text"
nz-input
placeholder=
"请录入单词"
[(
ngModel
)]="
it
.
left
.
word_val
"
(
blur
)="
saveWordItem
(
i
,'
left
')"
>
</nz-form-control>
</nz-form-control>
</nz-form-item>
</nz-form-item>
<nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
6
"
nzFor=
"it.left.word_audio_url"
>
发音
</nz-form-label>
<nz-form-label
[
nzSpan
]="
6
"
nzFor=
"it.left.word_audio_url"
>
发音
</nz-form-label>
<nz-form-control
[
nzSpan
]="
6
"
>
<nz-form-control
[
nzSpan
]="
6
"
>
<app-audio-recorder
id=
"it.left.word_audio_url"
<app-audio-recorder
id=
"it.left.word_audio_url"
[
audioUrl
]="
it
.
left
.
word_audio_url
"
[
audioUrl
]="
it
.
left
.
word_audio_url
"
(
audioUploaded
)="
onAudioUploadSuccessByItem
($
event
,
it
.
left
,'
word_audio_url
')"
>
(
audioUploaded
)="
onAudioUploadSuccessByItem
($
event
,
it
.
left
,'
word_audio_url
')"
>
</app-audio-recorder>
</app-audio-recorder>
</nz-form-control>
</nz-form-control>
</nz-form-item>
</nz-form-item>
<nz-form-item>
<nz-form-item>
<div
nz-col
[
nzSpan
]="
15
"
nzOffset=
"2"
>
<div
nz-col
[
nzSpan
]="
15
"
nzOffset=
"2"
>
<nz-table
[
nzData
]="
it
.
left
.
letters
"
[
nzHideOnSinglePage
]="
true
"
[
nzBordered
]="
true
"
>
<nz-table
[
nzData
]="
it
.
left
.
letters
"
[
nzHideOnSinglePage
]="
true
"
[
nzBordered
]="
true
"
>
<thead>
<thead>
<tr>
<tr>
<th>
字母
</th>
<th>
字母
</th>
<th>
颜色
</th>
<th>
颜色
</th>
<th>
是否填空
</th>
<th>
是否填空
</th>
</tr>
</tr>
</thead>
</thead>
<tbody>
<tbody>
<tr
*
ngFor=
"let data of it.left.letters;let j = index"
>
<tr
*
ngFor=
"let data of it.left.letters;let j = index"
>
<td>
{{data.letter_val}}
</td>
<td>
{{data.letter_val}}
</td>
<td>
<td>
<nz-select
[(
ngModel
)]="
data
.
letter_color
"
(
ngModelChange
)="
saveItem
()"
>
<nz-select
[(
ngModel
)]="
data
.
letter_color
"
(
ngModelChange
)="
saveItem
()"
>
<!--<nz-option nzValue="C01" nzLabel="绿色"></nz-option>-->
<!--<nz-option nzValue="C01" nzLabel="绿色"></nz-option>-->
<nz-option
nzValue=
"C02"
nzLabel=
"红色"
></nz-option>
<nz-option
nzValue=
"C02"
nzLabel=
"红色"
></nz-option>
<!--<nz-option nzValue="C03" nzLabel="巧克力色"></nz-option>-->
<!--<nz-option nzValue="C03" nzLabel="巧克力色"></nz-option>-->
<nz-option
nzValue=
"C04"
nzLabel=
"黑色"
></nz-option>
<nz-option
nzValue=
"C04"
nzLabel=
"黑色"
></nz-option>
</nz-select>
</nz-select>
</td>
</td>
<td>
<td>
<nz-select
[(
ngModel
)]="
data
.
is_
"
(
ngModelChange
)="
saveItem
()"
>
<nz-select
[(
ngModel
)]="
data
.
is_
"
(
ngModelChange
)="
saveItem
()"
>
<nz-option
nzValue=
"1"
nzLabel=
"是"
></nz-option>
<nz-option
nzValue=
"1"
nzLabel=
"是"
></nz-option>
<nz-option
nzValue=
"0"
nzLabel=
"否"
></nz-option>
<nz-option
nzValue=
"0"
nzLabel=
"否"
></nz-option>
</nz-select>
</nz-select>
</td>
</td>
</tr>
</tr>
</tbody>
</tbody>
</nz-table>
</nz-table>
</div>
</div>
</nz-form-item>
</nz-form-item>
</div>
</div>
<nz-divider
nzText=
"右侧单词"
nzOrientation=
"left"
></nz-divider>
<nz-divider
nzText=
"右侧单词"
nzOrientation=
"left"
></nz-divider>
<div
nz-form
>
<div
nz-form
>
<nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
6
"
nzFor=
"it.right.word_val"
>
单词
</nz-form-label>
<nz-form-label
[
nzSpan
]="
6
"
nzFor=
"it.right.word_val"
>
单词
</nz-form-label>
<nz-form-control
[
nzSpan
]="
6
"
>
<nz-form-control
[
nzSpan
]="
6
"
>
<input
type=
"text"
nz-input
placeholder=
"请录入单词"
[(
ngModel
)]="
it
.
right
.
word_val
"
(
blur
)="
saveWordItem
(
i
,'
right
')"
>
<input
type=
"text"
nz-input
placeholder=
"请录入单词"
[(
ngModel
)]="
it
.
right
.
word_val
"
(
blur
)="
saveWordItem
(
i
,'
right
')"
>
</nz-form-control>
</nz-form-control>
</nz-form-item>
</nz-form-item>
<nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
6
"
nzFor=
"it.right.word_audio_url"
>
发音
</nz-form-label>
<nz-form-label
[
nzSpan
]="
6
"
nzFor=
"it.right.word_audio_url"
>
发音
</nz-form-label>
<nz-form-control
[
nzSpan
]="
6
"
>
<nz-form-control
[
nzSpan
]="
6
"
>
<app-audio-recorder
id=
"it.right.word_audio_url"
<app-audio-recorder
id=
"it.right.word_audio_url"
[
audioUrl
]="
it
.
right
.
word_audio_url
"
[
audioUrl
]="
it
.
right
.
word_audio_url
"
(
audioUploaded
)="
onAudioUploadSuccessByItem
($
event
,
it
.
right
,'
word_audio_url
')"
>
(
audioUploaded
)="
onAudioUploadSuccessByItem
($
event
,
it
.
right
,'
word_audio_url
')"
>
</app-audio-recorder>
</app-audio-recorder>
</nz-form-control>
</nz-form-control>
</nz-form-item>
</nz-form-item>
<nz-form-item>
<nz-form-item>
<div
nz-col
[
nzSpan
]="
22
"
nzOffset=
"1"
>
<div
nz-col
[
nzSpan
]="
22
"
nzOffset=
"1"
>
<nz-table
[
nzData
]="
it
.
right
.
letters
"
[
nzHideOnSinglePage
]="
true
"
[
nzBordered
]="
true
"
>
<nz-table
[
nzData
]="
it
.
right
.
letters
"
[
nzHideOnSinglePage
]="
true
"
[
nzBordered
]="
true
"
>
<thead>
<thead>
<tr>
<tr>
<th>
字母
</th>
<th>
字母
</th>
<th>
颜色
</th>
<th>
颜色
</th>
<th>
是否填空
</th>
<th>
是否填空
</th>
</tr>
</tr>
</thead>
</thead>
<tbody>
<tbody>
<tr
*
ngFor=
"let data of it.right.letters;let j = index"
>
<tr
*
ngFor=
"let data of it.right.letters;let j = index"
>
<td>
{{data.letter_val}}
</td>
<td>
{{data.letter_val}}
</td>
<td>
<td>
<nz-select
[(
ngModel
)]="
data
.
letter_color
"
(
ngModelChange
)="
saveItem
()"
>
<nz-select
[(
ngModel
)]="
data
.
letter_color
"
(
ngModelChange
)="
saveItem
()"
>
<nz-option
nzValue=
"C02"
nzLabel=
"红色"
></nz-option>
<nz-option
nzValue=
"C02"
nzLabel=
"红色"
></nz-option>
<nz-option
nzValue=
"C04"
nzLabel=
"黑色"
></nz-option>
<nz-option
nzValue=
"C04"
nzLabel=
"黑色"
></nz-option>
</nz-select>
</nz-select>
</td>
</td>
<td>
<td>
<nz-select
[(
ngModel
)]="
data
.
is_
"
(
ngModelChange
)="
saveItem
()"
>
<nz-select
[(
ngModel
)]="
data
.
is_
"
(
ngModelChange
)="
saveItem
()"
>
<nz-option
nzValue=
"1"
nzLabel=
"是"
></nz-option>
<nz-option
nzValue=
"1"
nzLabel=
"是"
></nz-option>
<nz-option
nzValue=
"0"
nzLabel=
"否"
></nz-option>
<nz-option
nzValue=
"0"
nzLabel=
"否"
></nz-option>
</nz-select>
</nz-select>
</td>
</td>
</tr>
</tr>
</tbody>
</tbody>
</nz-table>
</nz-table>
</div>
</div>
...
@@ -208,12 +225,11 @@
...
@@ -208,12 +225,11 @@
</nz-form-item>
</nz-form-item>
<nz-form-item>
<nz-form-item>
<nz-form-control
[
nzSpan
]="
3
"
nzOffset=
"3"
class=
"add-btn-box"
>
<nz-form-control
[
nzSpan
]="
3
"
nzOffset=
"3"
class=
"add-btn-box"
>
<button
nz-button
nzType=
"dashed"
class=
"add-btn"
id=
"add-btn"
<button
nz-button
nzType=
"dashed"
class=
"add-btn"
id=
"add-btn"
(
click
)="
addItem
()"
>
(
click
)="
addItem
()"
>
<i
nz-icon
nzType=
"plus-circle"
nzTheme=
"outline"
></i>
添加
<i
nz-icon
nzType=
"plus-circle"
nzTheme=
"outline"
></i>
添加
</button>
</button>
</nz-form-control>
</nz-form-control>
</nz-form-item>
</nz-form-item>
</div>
</div>
</div>
</div>
</div>
</div>
\ No newline at end of file
\ No newline at end of file
src/app/play/play.component.ts
View file @
3ca61d0c
...
@@ -77,6 +77,7 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -77,6 +77,7 @@ export class PlayComponent implements OnInit, OnDestroy {
curAudio
;
curAudio
;
play
=
false
;
play
=
false
;
words_bg
;
words_bg
;
words_bg_right
;
title_bg
;
title_bg
;
wordLoad
:{[
key
:
string
]:{
loaded
:
boolean
;
letters
:{[
key
:
string
]:{
loaded
:
boolean
,
letter
:
Label
}}}}
=
{};
wordLoad
:{[
key
:
string
]:{
loaded
:
boolean
;
letters
:{[
key
:
string
]:{
loaded
:
boolean
,
letter
:
Label
}}}}
=
{};
...
@@ -866,6 +867,7 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -866,6 +867,7 @@ export class PlayComponent implements OnInit, OnDestroy {
this
.
addUrlToAudioObj
(
this
.
data
.
title
.
t_audio_url
);
this
.
addUrlToAudioObj
(
this
.
data
.
title
.
t_audio_url
);
this
.
addUrlToAudioObj
(
this
.
data
.
words_audio_url
);
this
.
addUrlToAudioObj
(
this
.
data
.
words_audio_url
);
this
.
addUrlToAudioObj
(
this
.
data
.
words_two_audio_url
);
// 初始化单词音效
// 初始化单词音效
for
(
let
i
=
0
;
i
<
this
.
data
.
wordArr
.
length
;
++
i
)
{
for
(
let
i
=
0
;
i
<
this
.
data
.
wordArr
.
length
;
++
i
)
{
...
@@ -988,12 +990,38 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -988,12 +990,38 @@ export class PlayComponent implements OnInit, OnDestroy {
words_content
.
fontWeight
=
600
;
words_content
.
fontWeight
=
600
;
words_content
.
fontColor
=
'
#ab5a23
'
;
words_content
.
fontColor
=
'
#ab5a23
'
;
words_content
.
refreshSize
();
words_content
.
refreshSize
();
words_bg
.
addChild
(
words_content
);
words_bg
.
addChild
(
words_content
);
words_bg
.
setScaleXY
(
this
.
mapScale
);
words_bg
.
setRadius
(
words_content
.
width
/
3
*
2
);
let
scale
=
getMinScale
(
words_bg
,
80
)
*
this
.
mapScale
;
this
.
body_bg
.
addChild
(
words_bg
);
words_bg
.
setScaleXY
(
scale
);
this
.
words_bg
=
words_bg
;
// this.data.words_two = "apo";
if
(
this
.
data
.
words_two
){
words_bg
.
x
=
words_bg
.
x
-
(
words_bg
.
width
/
2
)
*
this
.
mapScale
;
//重设第一个球的位置
const
words_bg_right
=
new
ShapeCircle
();
words_bg_right
.
setRadius
(
50
);
words_bg_right
.
fillColor
=
'
#ab5a23
'
;
words_bg_right
.
x
=
this
.
body_bg
.
width
/
2
+
(
words_bg_right
.
width
/
2
)
*
this
.
mapScale
;
words_bg_right
.
y
=
0
;
const
words_content_right
=
new
Label
();
words_content_right
.
text
=
this
.
data
.
words_two
;
words_content_right
.
textAlign
=
'
center
'
;
words_content_right
.
fontSize
=
50
;
words_content_right
.
fontName
=
'
GOTHICB
'
;
words_content_right
.
fontWeight
=
600
;
words_content_right
.
fontColor
=
'
#fdcd00
'
;
words_content_right
.
refreshSize
();
words_bg_right
.
addChild
(
words_content_right
);
words_bg_right
.
setRadius
(
words_content
.
width
/
3
*
2
);
let
scale_r
=
getMinScale
(
words_bg_right
,
80
)
*
this
.
mapScale
;
words_bg_right
.
setScaleXY
(
scale_r
);
this
.
body_bg
.
addChild
(
words_bg_right
);
this
.
words_bg_right
=
words_bg_right
;
}
this
.
body_bg
.
addChild
(
words_bg
);
this
.
words_bg
=
words_bg
;
}
}
/**
/**
...
@@ -1071,9 +1099,7 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -1071,9 +1099,7 @@ export class PlayComponent implements OnInit, OnDestroy {
// letter_spr.fontSize = word_content.word_font_size ? word_content.word_font_size : 110;
// letter_spr.fontSize = word_content.word_font_size ? word_content.word_font_size : 110;
letter_spr
.
fontSize
=
letterFontSize
;
letter_spr
.
fontSize
=
letterFontSize
;
letter_spr
.
fontName
=
'
MMTextBook
'
;
letter_spr
.
fontName
=
'
MMTextBook
'
;
letter_spr
.
fontColor
=
this
.
getColor
(
letter
.
letter_color
);
letter_spr
.
fontColor
=
this
.
getColor
(
letter
.
letter_color
);
//设置不显示
letter_spr
.
visible
=
true
;
letter_spr
.
refreshSize
();
letter_spr
.
refreshSize
();
letter_spr_arr
.
push
(
letter_spr
);
letter_spr_arr
.
push
(
letter_spr
);
//设置坐标
//设置坐标
...
@@ -1109,89 +1135,95 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -1109,89 +1135,95 @@ export class PlayComponent implements OnInit, OnDestroy {
this
.
word_arr_left
.
push
(
word_bg
);
this
.
word_arr_left
.
push
(
word_bg
);
//中间斜杠
if
(
word_content
.
right
.
letters
.
length
>
0
){
let
splitStr
=
new
Label
();
//中间斜杠
let
splitStrWidth
=
60
;
let
splitStr
=
new
Label
();
splitStr
.
text
=
'
/
'
;
let
splitStrWidth
=
60
;
splitStr
.
textAlign
=
'
center
'
;
splitStr
.
text
=
'
/
'
;
splitStr
.
fontSize
=
letterFontSize
;
splitStr
.
textAlign
=
'
center
'
;
splitStr
.
fontName
=
'
MMTextBook
'
;
splitStr
.
fontSize
=
letterFontSize
;
splitStr
.
fontColor
=
'
black
'
;
splitStr
.
fontName
=
'
MMTextBook
'
;
//设置不显示
splitStr
.
fontColor
=
'
black
'
;
splitStr
.
visible
=
true
;
//设置不显示
splitStr
.
refreshSize
();
splitStr
.
visible
=
true
;
splitStr
.
y
=
splitStr
.
height
/
2
;
splitStr
.
refreshSize
();
splitStr
.
x
=
startWidth
+
totalWidth
+
40
;
splitStr
.
y
=
splitStr
.
height
/
2
;
word_bg_group
.
addChild
(
splitStr
)
;
splitStr
.
x
=
startWidth
+
totalWidth
+
40
;
word_bg_group
.
addChild
(
splitStr
)
;
//=============================右侧单词========================================
//=============================右侧单词========================================
// 单词背景
// 单词背景
let
word_bg_right
=
new
ShapeRect
();
let
word_bg_right
=
new
ShapeRect
();
word_bg_right
.
fillColor
=
'
transparent
'
;
word_bg_right
.
fillColor
=
'
transparent
'
;
word_bg_right
.
x
=
startWidth
+
totalWidth
+
splitStrWidth
;
word_bg_right
.
x
=
startWidth
+
totalWidth
+
splitStrWidth
;
word_bg_right
.
y
=
0
;
word_bg_right
.
y
=
0
;
word_bg_right
[
"
wordLoaded
"
]
=
true
;
word_bg_right
[
"
wordLoaded
"
]
=
true
;
//单词
//单词
let
totalWidth_right
=
0
;
let
totalWidth_right
=
0
;
let
height_right
=
0
;
let
height_right
=
0
;
let
letter_spr_arr_right
=
[];
let
letter_spr_arr_right
=
[];
for
(
let
i
=
0
;
i
<
word_content
.
right
.
letters
.
length
;
++
i
)
{
for
(
let
i
=
0
;
i
<
word_content
.
right
.
letters
.
length
;
++
i
)
{
//字母
//字母
let
letter
=
word_content
.
right
.
letters
[
i
];
let
letter
=
word_content
.
right
.
letters
[
i
];
let
letter_spr
=
new
Label
();
let
letter_spr
=
new
Label
();
letter_spr
.
text
=
letter
.
letter_val
;
letter_spr
.
text
=
letter
.
letter_val
;
if
(
letter
.
is_
==
"
0
"
){
if
(
letter
.
is_
==
"
0
"
){
//设置不显示
//设置不显示
letter_spr
.
visible
=
true
;
letter_spr
.
visible
=
true
;
}
else
{
}
else
{
word_bg_right
[
"
wordLoaded
"
]
=
false
;
word_bg_right
[
"
wordLoaded
"
]
=
false
;
//设置不显示
//设置不显示
letter_spr
.
visible
=
false
;
letter_spr
.
visible
=
false
;
}
}
letter_spr
.
textAlign
=
'
left
'
;
letter_spr
.
textAlign
=
'
left
'
;
letter_spr
.
fontSize
=
letterFontSize
;
letter_spr
.
fontSize
=
letterFontSize
;
letter_spr
.
fontName
=
'
MMTextBook
'
;
letter_spr
.
fontName
=
'
MMTextBook
'
;
letter_spr
.
fontColor
=
this
.
getColor
(
letter
.
letter_color
);
letter_spr
.
fontColor
=
this
.
getColor
(
letter
.
letter_color
);
letter_spr
.
refreshSize
();
letter_spr
.
refreshSize
();
letter_spr_arr_right
.
push
(
letter_spr
);
letter_spr_arr_right
.
push
(
letter_spr
);
//设置坐标
letter_spr
.
x
=
Math
.
ceil
(
letter_spr
.
width
/
2
)
+
totalWidth_right
+
5
;
letter_spr
.
y
=
letter_spr
.
height
/
2
;
if
(
letter
.
is_
==
"
1
"
){
let
lts_
=
new
Label
();
lts_
.
text
=
"
_
"
;
lts_
.
textAlign
=
'
left
'
;
lts_
.
fontSize
=
letterFontSize
;
lts_
.
fontName
=
'
MMTextBook
'
;
lts_
.
fontColor
=
this
.
getColor
(
letter
.
letter_color
);
lts_
.
x
=
letter_spr
.
x
;
lts_
.
y
=
letter_spr
.
y
+
2
;
lts_
.
visible
=
true
;
word_bg_right
.
addChild
(
lts_
);
}
//设置坐标
height_right
=
letter_spr
.
height
;
letter_spr
.
x
=
Math
.
ceil
(
letter_spr
.
width
/
2
)
+
totalWidth_right
+
5
;
totalWidth_right
+=
letter_spr
.
width
+
10
;
letter_spr
.
y
=
letter_spr
.
height
/
2
;
// 设置单词未加截完
// this.setWordLoad(index, String(i), false, letter_spr);
if
(
letter
.
is_
==
"
1
"
){
word_bg_right
.
addChild
(
letter_spr
);
let
lts_
=
new
Label
();
}
lts_
.
text
=
"
_
"
;
lts_
.
textAlign
=
'
left
'
;
lts_
.
fontSize
=
letterFontSize
;
lts_
.
fontName
=
'
MMTextBook
'
;
lts_
.
fontColor
=
this
.
getColor
(
letter
.
letter_color
);
lts_
.
x
=
letter_spr
.
x
;
lts_
.
y
=
letter_spr
.
y
+
2
;
lts_
.
visible
=
true
;
word_bg_right
.
addChild
(
lts_
);
}
height_right
=
letter_spr
.
height
;
totalWidth_right
+=
letter_spr
.
width
+
10
;
// 设置单词未加截完
// this.setWordLoad(index, String(i), false, letter_spr);
word_bg_right
.
addChild
(
letter_spr
);
}
word_bg_right
.
setSize
(
totalWidth_right
,
height_right
);
word_bg_right
.
setSize
(
totalWidth_right
,
height_right
);
word_bg_group
.
addChild
(
word_bg_right
)
;
word_bg_group
.
addChild
(
word_bg_right
)
;
word_bg_group
.
setSize
((
totalWidth_right
+
totalWidth
+
splitStrWidth
+
startWidth
),
height
);
word_bg_group
.
setSize
((
totalWidth_right
+
totalWidth
+
splitStrWidth
+
startWidth
),
height
);
this
.
word_arr
.
push
(
word_bg_right
);
}
else
{
this
.
word_arr
.
push
(
null
);
//站位用
word_bg_group
.
setSize
((
totalWidth
+
startWidth
),
height
);
}
if
(
word_bg_group
.
width
>
350
){
if
(
word_bg_group
.
width
>
350
){
word_bg_group
.
setScaleXY
(
getMinScale
(
word_bg_group
,
350
)
*
this
.
mapScale
);
word_bg_group
.
setScaleXY
(
getMinScale
(
word_bg_group
,
350
)
*
this
.
mapScale
);
}
else
{
}
else
{
word_bg_group
.
setScaleXY
(
this
.
mapScale
);
word_bg_group
.
setScaleXY
(
this
.
mapScale
);
}
}
this
.
word_arr
.
push
(
word_bg_right
);
this
.
word_bg_groups
.
push
(
word_bg_group
);
this
.
word_bg_groups
.
push
(
word_bg_group
);
this
.
body_bg
.
addChild
(
word_bg_group
);
this
.
body_bg
.
addChild
(
word_bg_group
);
};
};
...
@@ -1279,11 +1311,29 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -1279,11 +1311,29 @@ export class PlayComponent implements OnInit, OnDestroy {
return
;
return
;
}
}
if
(
this
.
words_bg_right
&&
this
.
checkClickTarget
(
this
.
words_bg_right
))
{
this
.
playAudio
(
this
.
data
.
words_two_audio_url
)
;
return
;
}
for
(
let
i
=
0
;
i
<
this
.
word_arr_left
.
length
;
++
i
){
for
(
let
i
=
0
;
i
<
this
.
word_arr_left
.
length
;
++
i
){
let
word
=
this
.
word_arr_left
[
i
];
let
word
=
this
.
word_arr_left
[
i
];
// console.log('word', word) ;
// console.log('word', word) ;
if
(
this
.
checkClickTarget
(
word
))
{
if
(
this
.
checkClickTarget
(
word
))
{
console
.
log
(
'
this word left:
'
,
this
.
data
.
wordArr
[
i
])
;
// 获取是否加载完成
let
loaded
=
word
.
wordLoaded
;
// 未加载,不触发音效,加载单词
if
(
!
loaded
)
{
let
letters
:
Array
<
Label
>
=
word
.
children
.
slice
(
1
);
for
(
let
j
=
0
;
j
<
letters
.
length
;
j
++
)
{
let
labelItem
=
letters
[
j
];
if
(
!
labelItem
.
visible
){
labelItem
.
visible
=
true
;
}
}
word
.
wordLoaded
=
true
;
return
;
}
this
.
playAudio
(
this
.
data
.
wordArr
[
i
].
left
.
word_audio_url
);
this
.
playAudio
(
this
.
data
.
wordArr
[
i
].
left
.
word_audio_url
);
return
;
return
;
}
}
...
@@ -1293,7 +1343,7 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -1293,7 +1343,7 @@ export class PlayComponent implements OnInit, OnDestroy {
for
(
let
i
=
0
;
i
<
this
.
word_arr
.
length
;
++
i
){
for
(
let
i
=
0
;
i
<
this
.
word_arr
.
length
;
++
i
){
let
word
=
this
.
word_arr
[
i
];
let
word
=
this
.
word_arr
[
i
];
// console.log('word', word) ;
// console.log('word', word) ;
if
(
this
.
checkClickTarget
(
word
))
{
if
(
word
&&
this
.
checkClickTarget
(
word
))
{
// 获取是否加载完成
// 获取是否加载完成
let
loaded
=
word
.
wordLoaded
;
let
loaded
=
word
.
wordLoaded
;
// 未加载,不触发音效,加载单词
// 未加载,不触发音效,加载单词
...
...
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