Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OP_03_2
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
OP_03_2
Commits
44390a77
Commit
44390a77
authored
Apr 20, 2022
by
Chen Jiping
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:支持缩放位置调整
parent
81b80e23
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
84 additions
and
24 deletions
+84
-24
ExercisesBean.ts
form/src/app/bean/ExercisesBean.ts
+3
-0
form.component.html
form/src/app/form/form.component.html
+9
-0
form.component.ts
form/src/app/form/form.component.ts
+5
-0
OP_03_2.fire
play/assets/OP_03_2/scene/OP_03_2.fire
+2
-2
OP_03_2.js
play/assets/OP_03_2/scene/OP_03_2.js
+62
-20
defaultData.js
play/assets/OP_03_2/script/defaultData.js
+3
-2
No files found.
form/src/app/bean/ExercisesBean.ts
View file @
44390a77
...
...
@@ -8,6 +8,9 @@ export class ExercisesBean extends Obj{
//单词数组
word2Arr
=
[];
//放大位置:默认首字母
zoomIn
=
'
0
'
;
}
export
function
getDefaultExercises
(){
...
...
form/src/app/form/form.component.html
View file @
44390a77
...
...
@@ -123,6 +123,15 @@
</button>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
2
"
>
放大位置
</nz-form-label>
<nz-form-control
[
nzSpan
]="
4
"
>
<nz-radio-group
[(
ngModel
)]="
item
.
exercises
.
zoomIn
"
(
ngModelChange
)="
save
()"
>
<label
nz-radio
nzValue=
"0"
>
首字母
</label>
<label
nz-radio
nzValue=
"1"
>
尾字母
</label>
</nz-radio-group>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-control
[
nzOffset
]="
2
"
[
nzSpan
]="
15
"
>
<nz-table
#
wordTable2
nzBordered
[
nzData
]="
item
.
exercises
.
word2Arr
"
nzBordered
nzTitle=
"单词数组"
...
...
form/src/app/form/form.component.ts
View file @
44390a77
...
...
@@ -76,6 +76,11 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
if
(
!
this
.
item
.
exercises
.
word2Arr
){
this
.
item
.
exercises
.
word2Arr
=
[];
}
if
(
!
this
.
item
.
exercises
.
zoomIn
){
this
.
item
.
exercises
.
zoomIn
=
"
0
"
;
this
.
save
();
}
}
...
...
play/assets/OP_03_2/scene/OP_03_2.fire
View file @
44390a77
...
...
@@ -731,7 +731,7 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width":
88
0,
"width":
50
0,
"height": 300
},
"_anchorPoint": {
...
...
@@ -1263,7 +1263,7 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width":
30
0,
"width":
25
0,
"height": 60
},
"_anchorPoint": {
...
...
play/assets/OP_03_2/scene/OP_03_2.js
View file @
44390a77
...
...
@@ -425,10 +425,12 @@ cc.Class({
continue
;
}
if
(
this
.
data
.
exercises
.
zoomIn
==
'
0
'
){
//首字母
let
initial
=
wordArr
[
i
].
val
.
substr
(
0
,
1
);
let
label
=
this
.
getWord
(
initial
,
80
,
true
);
label
.
isInitial
=
true
;
label
.
zoomIn
=
true
;
wordNodeArr
.
push
(
label
);
label
.
addComponent
(
cc
.
Button
);
label
.
on
(
'
click
'
,
()
=>
{
...
...
@@ -438,12 +440,40 @@ cc.Class({
//其余字母
let
last
=
wordArr
[
i
].
val
.
substr
(
1
);
let
lastLabel
=
this
.
getWord
(
last
,
80
,
false
);
lastLabel
.
isInitial
=
false
;
wordNodeArr
.
push
(
lastLabel
);
lastLabel
.
addComponent
(
cc
.
Button
);
lastLabel
.
on
(
'
click
'
,
()
=>
{
play
();
});
}
else
{
let
len
=
wordArr
[
i
].
val
.
length
;
//其余字母
let
initial
=
wordArr
[
i
].
val
.
substr
(
0
,
len
-
1
);
let
label
=
this
.
getWord
(
initial
,
80
,
true
);
label
.
isInitial
=
true
;
wordNodeArr
.
push
(
label
);
label
.
addComponent
(
cc
.
Button
);
label
.
on
(
'
click
'
,
()
=>
{
play
();
});
//尾字母
let
last
=
wordArr
[
i
].
val
.
substr
(
len
-
1
);
let
lastLabel
=
this
.
getWord
(
last
,
80
,
false
);
lastLabel
.
isInitial
=
false
;
lastLabel
.
zoomIn
=
true
;
wordNodeArr
.
push
(
lastLabel
);
lastLabel
.
addComponent
(
cc
.
Button
);
lastLabel
.
on
(
'
click
'
,
()
=>
{
play
();
});
}
}
textNode
.
wordNodeArr
=
wordNodeArr
;
...
...
@@ -631,7 +661,18 @@ cc.Class({
let
wordNodeArr
=
textNode
.
wordNodeArr
let
wordNode
=
wordNodeArr
[
2
*
index
];
let
_index
=
0
;
//首字母
if
(
this
.
data
.
exercises
.
zoomIn
==
'
0
'
){
_index
=
2
*
index
;
}
else
{
_index
=
2
*
index
+
1
;
}
let
wordNode
=
wordNodeArr
[
_index
];
if
(
!
wordNode
)
{
...
...
@@ -876,9 +917,10 @@ cc.Class({
for
(
let
i
=
0
;
i
<
wordNodeArr
.
length
;
++
i
)
{
let
wordNode
=
wordNodeArr
[
i
];
console
.
log
(
wordNode
.
zoomIn
);
//如果是放大字母,则执行动画
if
(
wordNode
.
zoomIn
)
{
//如果是首字母,则执行动画
if
(
wordNode
.
isInitial
)
{
this
.
textTwinkle
(
wordNode
);
}
}
...
...
play/assets/OP_03_2/script/defaultData.js
View file @
44390a77
export
const
defaultData
=
{
"
exercises
"
:{
"
zoomIn
"
:
"
1
"
,
"
wordArr
"
:[
{
"
val
"
:
"
A
"
,
...
...
@@ -14,10 +15,10 @@ export const defaultData = {
],
"
word2Arr
"
:[
{
"
val
"
:
"
Angry
"
"
val
"
:
"
fox
"
},
{
"
val
"
:
"
Apple
"
"
val
"
:
"
in a box
"
}
],
"
picUrl
"
:
"
http://staging-teach.cdn.ireadabc.com/101cdabba6404b73292d3b676f4683b1.png
"
,
...
...
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