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
4a57f417
Commit
4a57f417
authored
Feb 07, 2020
by
Chen Jiping
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复bug
parent
e7037bdb
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
211 additions
and
94 deletions
+211
-94
form.component.html
src/app/form/form.component.html
+16
-12
form.component.ts
src/app/form/form.component.ts
+4
-3
Unit.ts
src/app/play/Unit.ts
+78
-0
play.component.ts
src/app/play/play.component.ts
+113
-79
No files found.
src/app/form/form.component.html
View file @
4a57f417
...
...
@@ -43,17 +43,6 @@
<input
type=
"text"
nz-input
placeholder=
"字母(组合)"
[(
ngModel
)]="
it
.
title_val
"
(
blur
)="
saveItem
()"
>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
6
"
nzFor=
"it.title_color"
>
颜色
</nz-form-label>
<nz-form-control
[
nzSpan
]="
6
"
>
<nz-select
[(
ngModel
)]="
it
.
title_color
"
nzAllowClear
nzPlaceHolder=
"Please select the color"
(
ngModelChange
)="
saveItem
()"
>
<nz-option
nzValue=
"C01"
nzLabel=
"绿色"
></nz-option>
<nz-option
nzValue=
"C02"
nzLabel=
"红色"
></nz-option>
<nz-option
nzValue=
"C03"
nzLabel=
"巧克力色"
></nz-option>
<nz-option
nzValue=
"C04"
nzLabel=
"黑色"
></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
6
"
nzFor=
"it.title_audio_url"
>
发音
</nz-form-label>
<nz-form-control
[
nzSpan
]="
6
"
>
...
...
@@ -83,7 +72,7 @@
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-control
[
nzSpan
]="
1
2
"
nzOffset=
"3"
>
<nz-form-control
[
nzSpan
]="
1
5
"
nzOffset=
"3"
>
<div
*
ngFor=
"let it of wordArr; let i = index"
class=
"card-item"
style=
"padding: 0.5vw;"
>
<div
class=
"border"
>
<h5
style=
"width: 100%; line-height: 40px; text-align: center;"
>
单词-{{i+1}}
</h5>
...
...
@@ -103,6 +92,12 @@
</app-audio-recorder>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
6
"
nzFor=
"word_font_size"
>
字体大小
</nz-form-label>
<nz-form-control
[
nzSpan
]="
6
"
>
<nz-input-number
[(
ngModel
)]="
it
.
word_font_size
"
[
nzMin
]="
1
"
[
nzStep
]="
1
"
(
blur
)="
saveItem
()"
></nz-input-number>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
6
"
nzFor=
"it.word_audio_url"
>
单词字组(组合)
</nz-form-label>
<nz-form-control
[
nzSpan
]="
6
"
>
...
...
@@ -120,6 +115,7 @@
<th>
序号
</th>
<th>
字母(组合)
</th>
<th>
发音
</th>
<th>
颜色
</th>
<th>
操作
</th>
</tr>
</thead>
...
...
@@ -133,6 +129,14 @@
(
audioUploaded
)="
onAudioUploadSuccessByItem
($
event
,
data
,
'
letter_audio_url
')"
>
</app-audio-recorder>
</td>
<td>
<nz-select
[(
ngModel
)]="
data
.
letter_color
"
nzAllowClear
nzPlaceHolder=
"Please select the color"
(
ngModelChange
)="
saveItem
()"
>
<nz-option
nzValue=
"C01"
nzLabel=
"绿色"
></nz-option>
<nz-option
nzValue=
"C02"
nzLabel=
"红色"
></nz-option>
<nz-option
nzValue=
"C03"
nzLabel=
"巧克力色"
></nz-option>
<nz-option
nzValue=
"C04"
nzLabel=
"黑色"
></nz-option>
</nz-select>
</td>
<td>
<a
(
click
)="
deleteLetterItem
(
it
.
letters
,
j
)"
>
delete
</a>
</td>
...
...
src/app/form/form.component.ts
View file @
4a57f417
...
...
@@ -149,6 +149,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
return
{
word_val
:
""
,
word_audio_url
:
""
,
word_font_size
:
110
,
letters
:[]
};
}
...
...
@@ -156,7 +157,8 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
letterData
(){
return
{
letter_val
:
""
,
letter_audio_url
:
""
letter_audio_url
:
""
,
letter_color
:
"
C04
"
};
}
...
...
@@ -186,8 +188,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
titleItem
(){
return
{
title_val
:
""
,
title_audio_url
:
""
,
title_color
:
"
C04
"
title_audio_url
:
""
}
}
...
...
src/app/play/Unit.ts
View file @
4a57f417
...
...
@@ -864,6 +864,84 @@ export class ShapeRect extends MySprite {
}
}
export
class
ShapeRectNew
extends
MySprite
{
radius
=
0
;
fillColor
=
'
#ffffff
'
;
strokeColor
=
'
#000000
'
;
fill
=
true
;
stroke
=
false
;
lineWidth
=
1
;
setSize
(
w
,
h
,
r
)
{
this
.
width
=
w
;
this
.
height
=
h
;
this
.
radius
=
r
;
}
setOutLine
(
color
,
lineWidth
)
{
this
.
stroke
=
true
;
this
.
strokeColor
=
color
;
this
.
lineWidth
=
lineWidth
;
}
drawShape
()
{
const
ctx
=
this
.
ctx
;
const
width
=
this
.
width
;
const
height
=
this
.
height
;
const
radius
=
this
.
radius
;
ctx
.
save
();
ctx
.
beginPath
(
0
);
// 从右下角顺时针绘制,弧度从0到1/2PI
ctx
.
arc
(
width
-
radius
,
height
-
radius
,
radius
,
0
,
Math
.
PI
/
2
);
// 矩形下边线
ctx
.
lineTo
(
radius
,
height
);
// 左下角圆弧,弧度从1/2PI到PI
ctx
.
arc
(
radius
,
height
-
radius
,
radius
,
Math
.
PI
/
2
,
Math
.
PI
);
// 矩形左边线
ctx
.
lineTo
(
0
,
radius
);
// 左上角圆弧,弧度从PI到3/2PI
ctx
.
arc
(
radius
,
radius
,
radius
,
Math
.
PI
,
Math
.
PI
*
3
/
2
);
// 上边线
ctx
.
lineTo
(
width
-
radius
,
0
);
// 右上角圆弧
ctx
.
arc
(
width
-
radius
,
radius
,
radius
,
Math
.
PI
*
3
/
2
,
Math
.
PI
*
2
);
// 右边线
ctx
.
lineTo
(
width
,
height
-
radius
);
ctx
.
closePath
();
if
(
this
.
fill
)
{
ctx
.
fillStyle
=
this
.
fillColor
;
ctx
.
fill
();
}
if
(
this
.
stroke
)
{
ctx
.
lineWidth
=
this
.
lineWidth
;
ctx
.
strokeStyle
=
this
.
strokeColor
;
ctx
.
stroke
();
}
ctx
.
restore
();
}
drawSelf
()
{
super
.
drawSelf
();
this
.
drawShape
();
}
}
export
class
ShapeCircle
extends
MySprite
{
...
...
src/app/play/play.component.ts
View file @
4a57f417
This diff is collapsed.
Click to expand it.
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