Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
ym_013
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
ym_013
Commits
e7037bdb
Commit
e7037bdb
authored
Feb 06, 2020
by
Chen Jiping
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改字体;调整表格不能实时刷新的问题
parent
461b9995
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
39 additions
and
9 deletions
+39
-9
form.component.html
src/app/form/form.component.html
+2
-2
form.component.ts
src/app/form/form.component.ts
+3
-2
play.component.scss
src/app/play/play.component.scss
+7
-1
play.component.ts
src/app/play/play.component.ts
+27
-4
MMTextBook.otf
src/assets/font/MMTextBook.otf
+0
-0
No files found.
src/app/form/form.component.html
View file @
e7037bdb
...
...
@@ -107,7 +107,7 @@
<nz-form-label
[
nzSpan
]="
6
"
nzFor=
"it.word_audio_url"
>
单词字组(组合)
</nz-form-label>
<nz-form-control
[
nzSpan
]="
6
"
>
<button
nz-button
nzType=
"dashed"
class=
"add-btn"
id=
"add-btn"
(
click
)="
addLetterItem
(
it
)"
>
(
click
)="
addLetterItem
(
it
.
letters
)"
>
<i
nz-icon
nzType=
"plus-circle"
nzTheme=
"outline"
></i>
添加
</button>
</nz-form-control>
...
...
@@ -124,7 +124,7 @@
</tr>
</thead>
<tbody>
<tr
*
ngFor=
"let data of
lettersTable.data
;let j = index"
>
<tr
*
ngFor=
"let data of
it.letters
;let j = index"
>
<td>
{{j+1}}
</td>
<td><input
type=
"text"
nz-input
placeholder=
"请录入字母(组合)"
[(
ngModel
)]="
data
.
letter_val
"
(
blur
)="
saveItem
()"
></td>
<td>
...
...
src/app/form/form.component.ts
View file @
e7037bdb
...
...
@@ -127,10 +127,11 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
this
.
saveItem
();
}
addLetterItem
(
wordItem
){
addLetterItem
(
letters
){
let
letter
=
this
.
letterData
();
wordItem
.
letters
.
push
(
letter
);
letters
.
push
(
letter
);
this
.
save
();
}
...
...
src/app/play/play.component.scss
View file @
e7037bdb
...
...
@@ -21,4 +21,10 @@
{
font-family
:
'GOTHICB'
;
src
:
url("../../assets/font/GOTHICB.TTF")
;
}
\ No newline at end of file
}
@font-face
{
font-family
:
'MMTextBookBold'
;
src
:
url("../../assets/font/MMTextBookBold.otf")
;
}
src/app/play/play.component.ts
View file @
e7037bdb
...
...
@@ -491,12 +491,16 @@ export class PlayComponent implements OnInit, OnDestroy {
addUrlToAudioObj
(
key
,
url
=
null
,
vlomue
=
1
,
loop
=
false
,
callback
=
null
)
{
console
.
log
(
'
add audio
'
,
key
);
if
(
!
key
){
return
;
}
const
audioObj
=
this
.
audioObj
;
if
(
url
==
null
)
{
url
=
key
;
}
console
.
log
(
'
add audio
'
,
key
);
this
.
rawAudios
.
set
(
key
,
url
);
const
audio
=
new
Audio
();
...
...
@@ -537,8 +541,27 @@ export class PlayComponent implements OnInit, OnDestroy {
if
(
!
this
.
data
.
pic_url
)
{
this
.
data
.
pic_url
=
'
assets/play/default/pic.jpg
'
;
}
if
(
!
this
.
data
.
wordArr
)
{
this
.
data
.
wordArr
=
this
.
getDefaultWordArr
();
}
if
(
!
this
.
data
.
titleArr
){
this
.
data
.
titleArr
=
this
.
getDefaultTitleArr
()
;
}
console
.
log
(
'
data
'
,
this
.
data
);
}
getDefaultWordArr
()
{
let
arr
=
[];
return
arr
;
}
getDefaultTitleArr
()
{
let
arr
=
[];
return
arr
;
}
/**
* 添加预加载图片
...
...
@@ -722,7 +745,7 @@ export class PlayComponent implements OnInit, OnDestroy {
letter_spr
.
text
=
letter
.
letter_val
;
letter_spr
.
textAlign
=
'
center
'
;
letter_spr
.
fontSize
=
60
;
letter_spr
.
fontName
=
'
GOTHICB
'
;
letter_spr
.
fontName
=
'
MMTextBookBold
'
;
letter_spr
.
fontColor
=
this
.
getColor
(
colorId
);
//设置不显示
letter_spr
.
alpha
=
0
;
...
...
@@ -737,7 +760,7 @@ export class PlayComponent implements OnInit, OnDestroy {
totalWidth
+=
letter_spr
.
width
;
if
((
i
+
1
)
<
word_content
.
letters
.
length
){
totalWidth
+=
5
;
totalWidth
+=
0
;
}
//设置单词未加截完
...
...
@@ -757,7 +780,7 @@ export class PlayComponent implements OnInit, OnDestroy {
startX
=
letter_spr_arr
[
i
].
width
/
2
;
}
else
{
temp_startX
+=
letter_spr_arr
[
i
-
1
].
width
+
5
;
temp_startX
+=
letter_spr_arr
[
i
-
1
].
width
+
0
;
startX
=
temp_startX
+
letter_spr_arr
[
i
].
width
/
2
;
}
...
...
src/assets/font/MMTextBook.otf
0 → 100644
View file @
e7037bdb
File added
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