Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MRBR02
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
MRBR02
Commits
8a178f58
Commit
8a178f58
authored
Apr 22, 2022
by
Tt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
表单修改完成
parent
603f975c
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
396 additions
and
339 deletions
+396
-339
cocos_generator.fire
assets/cocos_generator/scene/cocos_generator.fire
+261
-162
cocos_generator.ts
assets/cocos_generator/scene/cocos_generator.ts
+3
-146
defaultData.ts
assets/cocos_generator/script/defaultData.ts
+13
-4
app.module.ts
form/src/app/app.module.ts
+3
-1
form.component.html
form/src/app/form/form.component.html
+73
-20
form.component.ts
form/src/app/form/form.component.ts
+43
-6
No files found.
assets/cocos_generator/scene/cocos_generator.fire
View file @
8a178f58
...
@@ -84,13 +84,13 @@
...
@@ -84,13 +84,13 @@
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 11
2
"__id__": 11
4
},
},
{
{
"__id__": 11
3
"__id__": 11
5
},
},
{
{
"__id__": 11
4
"__id__": 11
6
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -874,10 +874,10 @@
...
@@ -874,10 +874,10 @@
"__id__": 20
"__id__": 20
},
},
{
{
"__id__": 1
08
"__id__": 1
10
},
},
{
{
"__id__": 11
0
"__id__": 11
2
}
}
],
],
"_active": true,
"_active": true,
...
@@ -1039,37 +1039,37 @@
...
@@ -1039,37 +1039,37 @@
"__id__": 23
"__id__": 23
},
},
{
{
"__id__": 25
"__id__": 27
},
{
"__id__": 38
},
},
{
{
"__id__":
57
"__id__":
40
},
},
{
{
"__id__":
76
"__id__":
59
},
},
{
{
"__id__":
85
"__id__":
78
},
},
{
{
"__id__":
94
"__id__":
87
},
},
{
{
"__id__":
101
"__id__":
96
},
},
{
{
"__id__": 103
"__id__": 103
},
},
{
{
"__id__": 105
"__id__": 105
},
{
"__id__": 107
}
}
],
],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 10
7
"__id__": 10
9
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -1221,11 +1221,15 @@
...
@@ -1221,11 +1221,15 @@
"_parent": {
"_parent": {
"__id__": 20
"__id__": 20
},
},
"_children": [],
"_children": [
{
"__id__": 24
}
],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 2
4
"__id__": 2
6
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -1276,6 +1280,101 @@
...
@@ -1276,6 +1280,101 @@
"groupIndex": 0,
"groupIndex": 0,
"_id": "f5GQmC5B5HFbE6hFlgJvBP"
"_id": "f5GQmC5B5HFbE6hFlgJvBP"
},
},
{
"__type__": "cc.Node",
"_name": "label",
"_objFlags": 0,
"_parent": {
"__id__": 23
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 25
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 48.65,
"height": 44.1
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
2.776,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "88aGfJz0tOtaDHceuCe7Sh"
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 24
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_string": "1/3",
"_N$string": "1/3",
"_fontSize": 35,
"_lineHeight": 35,
"_enableWrapText": true,
"_N$file": null,
"_isSystemFontUsed": true,
"_spacingX": 0,
"_batchAsBitmap": false,
"_styleFlags": 0,
"_underlineHeight": 0,
"_N$horizontalAlign": 1,
"_N$verticalAlign": 1,
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$cacheMode": 0,
"_id": "004vz0kylN7pe56byWb0OY"
},
{
{
"__type__": "cc.Sprite",
"__type__": "cc.Sprite",
"_name": "",
"_name": "",
...
@@ -1316,9 +1415,6 @@
...
@@ -1316,9 +1415,6 @@
"__id__": 20
"__id__": 20
},
},
"_children": [
"_children": [
{
"__id__": 26
},
{
{
"__id__": 28
"__id__": 28
},
},
...
@@ -1333,6 +1429,9 @@
...
@@ -1333,6 +1429,9 @@
},
},
{
{
"__id__": 36
"__id__": 36
},
{
"__id__": 38
}
}
],
],
"_active": true,
"_active": true,
...
@@ -1390,13 +1489,13 @@
...
@@ -1390,13 +1489,13 @@
"_name": "small_mouse_left",
"_name": "small_mouse_left",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 2
5
"__id__": 2
7
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 2
7
"__id__": 2
9
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -1452,7 +1551,7 @@
...
@@ -1452,7 +1551,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 2
6
"__id__": 2
8
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -1484,13 +1583,13 @@
...
@@ -1484,13 +1583,13 @@
"_name": "small_mouse_center",
"_name": "small_mouse_center",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 2
5
"__id__": 2
7
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__":
29
"__id__":
31
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -1546,7 +1645,7 @@
...
@@ -1546,7 +1645,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__":
28
"__id__":
30
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -1578,13 +1677,13 @@
...
@@ -1578,13 +1677,13 @@
"_name": "small_mouse_right",
"_name": "small_mouse_right",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 2
5
"__id__": 2
7
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 3
1
"__id__": 3
3
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -1640,7 +1739,7 @@
...
@@ -1640,7 +1739,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 3
0
"__id__": 3
2
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -1672,13 +1771,13 @@
...
@@ -1672,13 +1771,13 @@
"_name": "small_mouse_highlight_left",
"_name": "small_mouse_highlight_left",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 2
5
"__id__": 2
7
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 3
3
"__id__": 3
5
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -1734,7 +1833,7 @@
...
@@ -1734,7 +1833,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 3
2
"__id__": 3
4
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -1766,13 +1865,13 @@
...
@@ -1766,13 +1865,13 @@
"_name": "small_mouse_highlight_center",
"_name": "small_mouse_highlight_center",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 2
5
"__id__": 2
7
},
},
"_children": [],
"_children": [],
"_active": false,
"_active": false,
"_components": [
"_components": [
{
{
"__id__": 3
5
"__id__": 3
7
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -1828,7 +1927,7 @@
...
@@ -1828,7 +1927,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 3
4
"__id__": 3
6
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -1860,13 +1959,13 @@
...
@@ -1860,13 +1959,13 @@
"_name": "small_mouse_highlight_right",
"_name": "small_mouse_highlight_right",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 2
5
"__id__": 2
7
},
},
"_children": [],
"_children": [],
"_active": false,
"_active": false,
"_components": [
"_components": [
{
{
"__id__": 3
7
"__id__": 3
9
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -1922,7 +2021,7 @@
...
@@ -1922,7 +2021,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 3
6
"__id__": 3
8
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -1958,13 +2057,13 @@
...
@@ -1958,13 +2057,13 @@
},
},
"_children": [
"_children": [
{
{
"__id__":
39
"__id__":
41
},
},
{
{
"__id__": 4
5
"__id__": 4
7
},
},
{
{
"__id__": 5
1
"__id__": 5
3
}
}
],
],
"_active": true,
"_active": true,
...
@@ -2022,20 +2121,20 @@
...
@@ -2022,20 +2121,20 @@
"_name": "card_up_left",
"_name": "card_up_left",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__":
38
"__id__":
40
},
},
"_children": [
"_children": [
{
{
"__id__": 4
0
"__id__": 4
2
},
},
{
{
"__id__": 4
2
"__id__": 4
4
}
}
],
],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 4
4
"__id__": 4
6
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -2091,13 +2190,13 @@
...
@@ -2091,13 +2190,13 @@
"_name": "highlight_blue",
"_name": "highlight_blue",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__":
39
"__id__":
41
},
},
"_children": [],
"_children": [],
"_active": false,
"_active": false,
"_components": [
"_components": [
{
{
"__id__": 4
1
"__id__": 4
3
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -2153,7 +2252,7 @@
...
@@ -2153,7 +2252,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 4
0
"__id__": 4
2
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -2185,13 +2284,13 @@
...
@@ -2185,13 +2284,13 @@
"_name": "highlight_orange",
"_name": "highlight_orange",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__":
39
"__id__":
41
},
},
"_children": [],
"_children": [],
"_active": false,
"_active": false,
"_components": [
"_components": [
{
{
"__id__": 4
3
"__id__": 4
5
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -2247,7 +2346,7 @@
...
@@ -2247,7 +2346,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 4
2
"__id__": 4
4
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -2279,7 +2378,7 @@
...
@@ -2279,7 +2378,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__":
39
"__id__":
41
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -2311,20 +2410,20 @@
...
@@ -2311,20 +2410,20 @@
"_name": "card_up_center",
"_name": "card_up_center",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__":
38
"__id__":
40
},
},
"_children": [
"_children": [
{
{
"__id__": 4
6
"__id__": 4
8
},
},
{
{
"__id__":
48
"__id__":
50
}
}
],
],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 5
0
"__id__": 5
2
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -2380,13 +2479,13 @@
...
@@ -2380,13 +2479,13 @@
"_name": "highlight_blue",
"_name": "highlight_blue",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 4
5
"__id__": 4
7
},
},
"_children": [],
"_children": [],
"_active": false,
"_active": false,
"_components": [
"_components": [
{
{
"__id__": 4
7
"__id__": 4
9
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -2442,7 +2541,7 @@
...
@@ -2442,7 +2541,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 4
6
"__id__": 4
8
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -2474,13 +2573,13 @@
...
@@ -2474,13 +2573,13 @@
"_name": "highlight_orange",
"_name": "highlight_orange",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 4
5
"__id__": 4
7
},
},
"_children": [],
"_children": [],
"_active": false,
"_active": false,
"_components": [
"_components": [
{
{
"__id__":
49
"__id__":
51
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -2536,7 +2635,7 @@
...
@@ -2536,7 +2635,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__":
48
"__id__":
50
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -2568,7 +2667,7 @@
...
@@ -2568,7 +2667,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 4
5
"__id__": 4
7
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -2600,20 +2699,20 @@
...
@@ -2600,20 +2699,20 @@
"_name": "card_up_right",
"_name": "card_up_right",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__":
38
"__id__":
40
},
},
"_children": [
"_children": [
{
{
"__id__": 5
2
"__id__": 5
4
},
},
{
{
"__id__": 5
4
"__id__": 5
6
}
}
],
],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 5
6
"__id__": 5
8
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -2669,13 +2768,13 @@
...
@@ -2669,13 +2768,13 @@
"_name": "highlight_blue",
"_name": "highlight_blue",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 5
1
"__id__": 5
3
},
},
"_children": [],
"_children": [],
"_active": false,
"_active": false,
"_components": [
"_components": [
{
{
"__id__": 5
3
"__id__": 5
5
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -2731,7 +2830,7 @@
...
@@ -2731,7 +2830,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 5
2
"__id__": 5
4
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -2763,13 +2862,13 @@
...
@@ -2763,13 +2862,13 @@
"_name": "highlight_orange",
"_name": "highlight_orange",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 5
1
"__id__": 5
3
},
},
"_children": [],
"_children": [],
"_active": false,
"_active": false,
"_components": [
"_components": [
{
{
"__id__": 5
5
"__id__": 5
7
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -2825,7 +2924,7 @@
...
@@ -2825,7 +2924,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 5
4
"__id__": 5
6
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -2857,7 +2956,7 @@
...
@@ -2857,7 +2956,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 5
1
"__id__": 5
3
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -2893,13 +2992,13 @@
...
@@ -2893,13 +2992,13 @@
},
},
"_children": [
"_children": [
{
{
"__id__":
58
"__id__":
60
},
},
{
{
"__id__": 6
4
"__id__": 6
6
},
},
{
{
"__id__": 7
0
"__id__": 7
2
}
}
],
],
"_active": true,
"_active": true,
...
@@ -2957,20 +3056,20 @@
...
@@ -2957,20 +3056,20 @@
"_name": "card_down_left",
"_name": "card_down_left",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 5
7
"__id__": 5
9
},
},
"_children": [
"_children": [
{
{
"__id__":
59
"__id__":
61
},
},
{
{
"__id__": 6
1
"__id__": 6
3
}
}
],
],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 6
3
"__id__": 6
5
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -3026,13 +3125,13 @@
...
@@ -3026,13 +3125,13 @@
"_name": "highlight_orange",
"_name": "highlight_orange",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__":
58
"__id__":
60
},
},
"_children": [],
"_children": [],
"_active": false,
"_active": false,
"_components": [
"_components": [
{
{
"__id__": 6
0
"__id__": 6
2
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -3088,7 +3187,7 @@
...
@@ -3088,7 +3187,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__":
59
"__id__":
61
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -3120,13 +3219,13 @@
...
@@ -3120,13 +3219,13 @@
"_name": "highlight_blue",
"_name": "highlight_blue",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__":
58
"__id__":
60
},
},
"_children": [],
"_children": [],
"_active": false,
"_active": false,
"_components": [
"_components": [
{
{
"__id__": 6
2
"__id__": 6
4
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -3182,7 +3281,7 @@
...
@@ -3182,7 +3281,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 6
1
"__id__": 6
3
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -3214,7 +3313,7 @@
...
@@ -3214,7 +3313,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__":
58
"__id__":
60
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -3246,20 +3345,20 @@
...
@@ -3246,20 +3345,20 @@
"_name": "card_down_center",
"_name": "card_down_center",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 5
7
"__id__": 5
9
},
},
"_children": [
"_children": [
{
{
"__id__": 6
5
"__id__": 6
7
},
},
{
{
"__id__": 6
7
"__id__": 6
9
}
}
],
],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__":
69
"__id__":
71
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -3315,13 +3414,13 @@
...
@@ -3315,13 +3414,13 @@
"_name": "highlight_orange",
"_name": "highlight_orange",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 6
4
"__id__": 6
6
},
},
"_children": [],
"_children": [],
"_active": false,
"_active": false,
"_components": [
"_components": [
{
{
"__id__": 6
6
"__id__": 6
8
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -3377,7 +3476,7 @@
...
@@ -3377,7 +3476,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 6
5
"__id__": 6
7
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -3409,13 +3508,13 @@
...
@@ -3409,13 +3508,13 @@
"_name": "highlight_blue",
"_name": "highlight_blue",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 6
4
"__id__": 6
6
},
},
"_children": [],
"_children": [],
"_active": false,
"_active": false,
"_components": [
"_components": [
{
{
"__id__":
68
"__id__":
70
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -3471,7 +3570,7 @@
...
@@ -3471,7 +3570,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 6
7
"__id__": 6
9
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -3503,7 +3602,7 @@
...
@@ -3503,7 +3602,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 6
4
"__id__": 6
6
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -3535,20 +3634,20 @@
...
@@ -3535,20 +3634,20 @@
"_name": "card_down_right",
"_name": "card_down_right",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 5
7
"__id__": 5
9
},
},
"_children": [
"_children": [
{
{
"__id__": 7
1
"__id__": 7
3
},
},
{
{
"__id__": 7
3
"__id__": 7
5
}
}
],
],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 7
5
"__id__": 7
7
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -3604,13 +3703,13 @@
...
@@ -3604,13 +3703,13 @@
"_name": "highlight_orange",
"_name": "highlight_orange",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 7
0
"__id__": 7
2
},
},
"_children": [],
"_children": [],
"_active": false,
"_active": false,
"_components": [
"_components": [
{
{
"__id__": 7
2
"__id__": 7
4
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -3666,7 +3765,7 @@
...
@@ -3666,7 +3765,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 7
1
"__id__": 7
3
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -3698,13 +3797,13 @@
...
@@ -3698,13 +3797,13 @@
"_name": "highlight_blue",
"_name": "highlight_blue",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 7
0
"__id__": 7
2
},
},
"_children": [],
"_children": [],
"_active": false,
"_active": false,
"_components": [
"_components": [
{
{
"__id__": 7
4
"__id__": 7
6
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -3760,7 +3859,7 @@
...
@@ -3760,7 +3859,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 7
3
"__id__": 7
5
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -3792,7 +3891,7 @@
...
@@ -3792,7 +3891,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 7
0
"__id__": 7
2
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -3827,9 +3926,6 @@
...
@@ -3827,9 +3926,6 @@
"__id__": 20
"__id__": 20
},
},
"_children": [
"_children": [
{
"__id__": 77
},
{
{
"__id__": 79
"__id__": 79
},
},
...
@@ -3838,6 +3934,9 @@
...
@@ -3838,6 +3934,9 @@
},
},
{
{
"__id__": 83
"__id__": 83
},
{
"__id__": 85
}
}
],
],
"_active": false,
"_active": false,
...
@@ -3895,13 +3994,13 @@
...
@@ -3895,13 +3994,13 @@
"_name": "microphone1",
"_name": "microphone1",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 7
6
"__id__": 7
8
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__":
78
"__id__":
80
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -3957,7 +4056,7 @@
...
@@ -3957,7 +4056,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 7
7
"__id__": 7
9
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -3989,13 +4088,13 @@
...
@@ -3989,13 +4088,13 @@
"_name": "voice_in",
"_name": "voice_in",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 7
6
"__id__": 7
8
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 8
0
"__id__": 8
2
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -4051,7 +4150,7 @@
...
@@ -4051,7 +4150,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__":
79
"__id__":
81
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -4083,13 +4182,13 @@
...
@@ -4083,13 +4182,13 @@
"_name": "voice_middle",
"_name": "voice_middle",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 7
6
"__id__": 7
8
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 8
2
"__id__": 8
4
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -4145,7 +4244,7 @@
...
@@ -4145,7 +4244,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 8
1
"__id__": 8
3
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -4177,13 +4276,13 @@
...
@@ -4177,13 +4276,13 @@
"_name": "voice_out",
"_name": "voice_out",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 7
6
"__id__": 7
8
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 8
4
"__id__": 8
6
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -4239,7 +4338,7 @@
...
@@ -4239,7 +4338,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 8
3
"__id__": 8
5
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -4274,9 +4373,6 @@
...
@@ -4274,9 +4373,6 @@
"__id__": 20
"__id__": 20
},
},
"_children": [
"_children": [
{
"__id__": 86
},
{
{
"__id__": 88
"__id__": 88
},
},
...
@@ -4285,6 +4381,9 @@
...
@@ -4285,6 +4381,9 @@
},
},
{
{
"__id__": 92
"__id__": 92
},
{
"__id__": 94
}
}
],
],
"_active": false,
"_active": false,
...
@@ -4342,13 +4441,13 @@
...
@@ -4342,13 +4441,13 @@
"_name": "microphone2",
"_name": "microphone2",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 8
5
"__id__": 8
7
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 8
7
"__id__": 8
9
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -4404,7 +4503,7 @@
...
@@ -4404,7 +4503,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 8
6
"__id__": 8
8
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -4436,13 +4535,13 @@
...
@@ -4436,13 +4535,13 @@
"_name": "progressbar_grey",
"_name": "progressbar_grey",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 8
5
"__id__": 8
7
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__":
89
"__id__":
91
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -4498,7 +4597,7 @@
...
@@ -4498,7 +4597,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__":
88
"__id__":
90
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -4530,13 +4629,13 @@
...
@@ -4530,13 +4629,13 @@
"_name": "progressbar_red",
"_name": "progressbar_red",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 8
5
"__id__": 8
7
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 9
1
"__id__": 9
3
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -4592,7 +4691,7 @@
...
@@ -4592,7 +4691,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 9
0
"__id__": 9
2
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -4624,13 +4723,13 @@
...
@@ -4624,13 +4723,13 @@
"_name": "progressbar_highlight",
"_name": "progressbar_highlight",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 8
5
"__id__": 8
7
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 9
3
"__id__": 9
5
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -4686,7 +4785,7 @@
...
@@ -4686,7 +4785,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 9
2
"__id__": 9
4
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -4721,14 +4820,14 @@
...
@@ -4721,14 +4820,14 @@
"__id__": 20
"__id__": 20
},
},
"_children": [
"_children": [
{
"__id__": 95
},
{
{
"__id__": 97
"__id__": 97
},
},
{
{
"__id__": 99
"__id__": 99
},
{
"__id__": 101
}
}
],
],
"_active": false,
"_active": false,
...
@@ -4786,13 +4885,13 @@
...
@@ -4786,13 +4885,13 @@
"_name": "text_up",
"_name": "text_up",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 9
4
"__id__": 9
6
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 9
6
"__id__": 9
8
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -4848,7 +4947,7 @@
...
@@ -4848,7 +4947,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 9
5
"__id__": 9
7
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -4880,13 +4979,13 @@
...
@@ -4880,13 +4979,13 @@
"_name": "text_middle",
"_name": "text_middle",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 9
4
"__id__": 9
6
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__":
98
"__id__":
100
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -4942,7 +5041,7 @@
...
@@ -4942,7 +5041,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 9
7
"__id__": 9
9
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -4974,13 +5073,13 @@
...
@@ -4974,13 +5073,13 @@
"_name": "text_down",
"_name": "text_down",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 9
4
"__id__": 9
6
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 10
0
"__id__": 10
2
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -5036,7 +5135,7 @@
...
@@ -5036,7 +5135,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__":
99
"__id__":
101
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -5074,7 +5173,7 @@
...
@@ -5074,7 +5173,7 @@
"_active": false,
"_active": false,
"_components": [
"_components": [
{
{
"__id__": 10
2
"__id__": 10
4
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -5130,7 +5229,7 @@
...
@@ -5130,7 +5229,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 10
1
"__id__": 10
3
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -5168,7 +5267,7 @@
...
@@ -5168,7 +5267,7 @@
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 10
4
"__id__": 10
6
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -5224,7 +5323,7 @@
...
@@ -5224,7 +5323,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 10
3
"__id__": 10
5
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -5262,7 +5361,7 @@
...
@@ -5262,7 +5361,7 @@
"_active": false,
"_active": false,
"_components": [
"_components": [
{
{
"__id__": 10
6
"__id__": 10
8
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -5318,7 +5417,7 @@
...
@@ -5318,7 +5417,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 10
5
"__id__": 10
7
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -5388,7 +5487,7 @@
...
@@ -5388,7 +5487,7 @@
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 1
09
"__id__": 1
11
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -5444,7 +5543,7 @@
...
@@ -5444,7 +5543,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 1
08
"__id__": 1
10
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -5482,7 +5581,7 @@
...
@@ -5482,7 +5581,7 @@
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 11
1
"__id__": 11
3
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -5538,7 +5637,7 @@
...
@@ -5538,7 +5637,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 11
0
"__id__": 11
2
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
...
assets/cocos_generator/scene/cocos_generator.ts
View file @
8a178f58
...
@@ -25,163 +25,20 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -25,163 +25,20 @@ export default class SceneComponent extends MyCocosSceneComponent {
// TODO 加载完成后的逻辑写在这里, 下面的代码仅供参考
// TODO 加载完成后的逻辑写在这里, 下面的代码仅供参考
this
.
initData
();
this
.
initData
();
this
.
initView
();
this
.
initView
();
this
.
init
Listener
();
this
.
init
Event
();
}
}
_cantouch
=
null
;
initData
()
{
initData
()
{
// 所有全局变量 默认都是null
this
.
_cantouch
=
true
;
}
initView
()
{
this
.
initBg
();
this
.
initPic
();
this
.
initBtn
();
this
.
initIcon
();
}
initBg
()
{
const
bgNode
=
cc
.
find
(
'
Canvas/bg
'
);
bgNode
.
scale
=
this
.
_mapScaleMax
;
}
pic1
=
null
;
pic2
=
null
;
initPic
()
{
const
canvas
=
cc
.
find
(
'
Canvas
'
);
const
maxW
=
canvas
.
width
*
0.7
;
this
.
getSprNodeByUrl
(
this
.
data
.
pic_url
,
(
sprNode
)
=>
{
const
picNode1
=
sprNode
;
picNode1
.
scale
=
maxW
/
picNode1
.
width
;
picNode1
.
baseX
=
picNode1
.
x
;
canvas
.
addChild
(
picNode1
);
this
.
pic1
=
picNode1
;
const
labelNode
=
new
cc
.
Node
();
labelNode
.
color
=
cc
.
Color
.
YELLOW
;
const
label
=
labelNode
.
addComponent
(
cc
.
Label
);
label
.
string
=
this
.
data
.
text
;
label
.
fontSize
=
60
;
label
.
lineHeight
=
60
;
label
.
font
=
cc
.
find
(
'
Canvas/res/font/BRLNSDB
'
).
getComponent
(
'
cc.Label
'
).
font
;
picNode1
.
addChild
(
labelNode
);
});
this
.
getSprNodeByUrl
(
this
.
data
.
pic_url_2
,
(
sprNode
)
=>
{
const
picNode2
=
sprNode
;
picNode2
.
scale
=
maxW
/
picNode2
.
width
;
canvas
.
addChild
(
picNode2
);
picNode2
.
x
=
canvas
.
width
;
picNode2
.
baseX
=
picNode2
.
x
;
this
.
pic2
=
picNode2
;
const
labelNode
=
new
cc
.
Node
();
const
label
=
labelNode
.
addComponent
(
cc
.
RichText
);
const
size
=
60
label
.
font
=
cc
.
find
(
'
Canvas/res/font/BRLNSDB
'
).
getComponent
(
cc
.
Label
).
font
;
label
.
string
=
`<outline color=#751e00 width=4><size=
${
size
}
><color=#ffffff>
${
this
.
data
.
text
}
</color></size></outline>`
label
.
lineHeight
=
size
;
picNode2
.
addChild
(
labelNode
);
});
}
initIcon
()
{
const
iconNode
=
this
.
getSprNode
(
'
icon
'
);
iconNode
.
zIndex
=
5
;
iconNode
.
anchorX
=
1
;
iconNode
.
anchorY
=
1
;
iconNode
.
parent
=
cc
.
find
(
'
Canvas
'
);
iconNode
.
x
=
iconNode
.
parent
.
width
/
2
-
10
;
iconNode
.
y
=
iconNode
.
parent
.
height
/
2
-
10
;
iconNode
.
on
(
cc
.
Node
.
EventType
.
TOUCH_START
,
()
=>
{
this
.
playAudioByUrl
(
this
.
data
.
audio_url
);
})
}
curPage
=
null
;
initBtn
()
{
this
.
curPage
=
0
;
const
bottomPart
=
cc
.
find
(
'
Canvas/bottomPart
'
);
bottomPart
.
zIndex
=
5
;
// 提高层级
bottomPart
.
x
=
bottomPart
.
parent
.
width
/
2
;
bottomPart
.
y
=
-
bottomPart
.
parent
.
height
/
2
;
const
leftBtnNode
=
bottomPart
.
getChildByName
(
'
btn_left
'
);
//节点中添加了button组件 则可以添加click事件监听
leftBtnNode
.
on
(
'
click
'
,
()
=>
{
if
(
!
this
.
_cantouch
)
{
return
;
}
if
(
this
.
curPage
==
0
)
{
return
;
}
this
.
curPage
=
0
this
.
leftMove
();
this
.
playLocalAudio
(
'
btn
'
);
})
const
rightBtnNode
=
bottomPart
.
getChildByName
(
'
btn_right
'
);
//节点中添加了button组件 则可以添加click事件监听
rightBtnNode
.
on
(
'
click
'
,
()
=>
{
if
(
!
this
.
_cantouch
)
{
return
;
}
if
(
this
.
curPage
==
1
)
{
return
;
}
this
.
curPage
=
1
this
.
rightMove
();
// 游戏结束时需要调用这个方法通知系统作业完成
onHomeworkFinish
();
this
.
playLocalAudio
(
'
btn
'
);
})
}
}
initView
()
{
leftMove
()
{
this
.
_cantouch
=
false
;
const
len
=
this
.
pic1
.
parent
.
width
;
cc
.
tween
(
this
.
pic1
)
.
to
(
1
,
{
x
:
this
.
pic1
.
baseX
},
{
easing
:
'
cubicInOut
'
})
.
start
();
cc
.
tween
(
this
.
pic2
)
.
to
(
1
,
{
x
:
this
.
pic2
.
baseX
},
{
easing
:
'
cubicInOut
'
})
.
call
(()
=>
{
this
.
_cantouch
=
true
;
})
.
start
();
}
}
initEvent
()
{
rightMove
()
{
this
.
_cantouch
=
false
;
const
len
=
this
.
pic1
.
parent
.
width
;
cc
.
tween
(
this
.
pic1
)
.
to
(
1
,
{
x
:
this
.
pic1
.
baseX
-
len
},
{
easing
:
'
cubicInOut
'
})
.
start
();
cc
.
tween
(
this
.
pic2
)
.
to
(
1
,
{
x
:
this
.
pic2
.
baseX
-
len
},
{
easing
:
'
cubicInOut
'
})
.
call
(()
=>
{
this
.
_cantouch
=
true
;
})
.
start
();
}
}
// update (dt) {},
initListener
()
{
}
playLocalAudio
(
audioName
)
{
playLocalAudio
(
audioName
)
{
const
audio
=
cc
.
find
(
`Canvas/res/audio/
${
audioName
}
`
).
getComponent
(
cc
.
AudioSource
);
const
audio
=
cc
.
find
(
`Canvas/res/audio/
${
audioName
}
`
).
getComponent
(
cc
.
AudioSource
);
...
...
assets/cocos_generator/script/defaultData.ts
View file @
8a178f58
export
const
defaultData
=
{
export
const
defaultData
=
{
"
pic_url
"
:
"
http://staging-teach.cdn.ireadabc.com/ed94332a503c31e0908bd4c6923a2665.png
"
,
"
aniEnter
"
:
{
"
pic_url_2
"
:
"
http://staging-teach.cdn.ireadabc.com/5fb60317ade0195d35ad8034d5370a7f.png
"
,
"
skeJsonData
"
:
{},
"
texJsonData
"
:
{},
"
texPngData
"
:
{},
"
audioUrl
"
:
"
http://staging-teach.cdn.ireadabc.com/7fe846cbce9c853eb000e567eee5e4f6.mp3
"
,
"
time
"
:
"
2
"
"
text
"
:
"
This is a test label.
"
,
},
"
audio_url
"
:
"
http://staging-teach.cdn.ireadabc.com/f47f1d7b5c160fe1c59500d180346240.mp3
"
"
item
"
:
{
"
questionList
"
:
[
{
"
audio
"
:
""
,
"
image
"
:
""
,
"
optionList
"
:
[{
"
type
"
:
"
text
"
,
"
text
"
:
"
a
"
,
"
image
"
:
""
,
"
optionAudio
"
:
"
http://staging-teach.cdn.ireadabc.com/116fb7accb5428361836fbc46287f769.mp3
"
},
{
"
type
"
:
"
text
"
,
"
text
"
:
"
b
"
,
"
image
"
:
""
,
"
optionAudio
"
:
"
http://staging-teach.cdn.ireadabc.com/526624b47ba5e46f698add9e152a4b4e.mp3
"
},
{
"
type
"
:
"
text
"
,
"
text
"
:
""
,
"
image
"
:
""
,
"
optionAudio
"
:
"
http://staging-teach.cdn.ireadabc.com/fe2520ea0b12ad8c482595f6dddf8019.mp3
"
}]
},
{
"
audio
"
:
""
,
"
image
"
:
"
http://staging-teach.cdn.ireadabc.com/a5b6943a004bc48b07220f832853bd46.png
"
,
"
optionList
"
:
[{
"
type
"
:
"
picText
"
,
"
text
"
:
"
as
"
,
"
image
"
:
"
http://staging-teach.cdn.ireadabc.com/418486dc95e98b7d3f88f652c4716bbc.png
"
,
"
optionAudio
"
:
"
http://staging-teach.cdn.ireadabc.com/116fb7accb5428361836fbc46287f769.mp3
"
},
{
"
type
"
:
"
picText
"
,
"
text
"
:
"
bs
"
,
"
image
"
:
"
http://staging-teach.cdn.ireadabc.com/476305ab6763e6821b34f66f1b6a59ed.png
"
,
"
optionAudio
"
:
"
http://staging-teach.cdn.ireadabc.com/f7fb9f71ab7d460ac2f78c85efba7610.mp3
"
},
{
"
type
"
:
"
picText
"
,
"
text
"
:
"
cd
"
,
"
image
"
:
"
http://staging-teach.cdn.ireadabc.com/cda87159d3d022b6469b186e325c2bb6.png
"
,
"
optionAudio
"
:
""
},
{
"
type
"
:
"
picText
"
,
"
text
"
:
"
dd
"
,
"
image
"
:
"
http://staging-teach.cdn.ireadabc.com/bb4244d166b6d077617ff089f7fd46c4.png
"
,
"
optionAudio
"
:
""
},
{
"
type
"
:
"
picText
"
,
"
text
"
:
"
ed
"
,
"
image
"
:
"
http://staging-teach.cdn.ireadabc.com/be64edcdfed05f4a61690207570f39d7.png
"
,
"
optionAudio
"
:
"
http://staging-teach.cdn.ireadabc.com/9df3f14bc88bcffc49b6717c40428ed8.mp3
"
}]
}
]
}
}
}
\ No newline at end of file
form/src/app/app.module.ts
View file @
8a178f58
...
@@ -61,6 +61,8 @@ registerLocaleData(zh);
...
@@ -61,6 +61,8 @@ registerLocaleData(zh);
})
})
export
class
AppModule
{
export
class
AppModule
{
constructor
(
library
:
FaIconLibrary
)
{
constructor
(
library
:
FaIconLibrary
)
{
library
.
addIconPacks
(
fas
,
far
);
let
fs
:
any
=
fas
;
let
fa
:
any
=
far
;
library
.
addIconPacks
(
fs
,
fa
);
}
}
}
}
form/src/app/form/form.component.html
View file @
8a178f58
<div
class=
"model-content"
>
<div
class=
"model-content"
>
<div
class=
"card-config"
>
<div>
入场动画配置
<div
style=
"width: 700px;height: 300px; margin:10px 0; min-width: 300px;margin-top: 20px;border: 2px dashed;padding: 20px 10px 5px 10px;"
>
骨骼动画
<app-upload-dragon-bone
[
skeJsonData
]=
aniEnter
.
skeJsonData
[
texJsonData
]=
aniEnter
.
texJsonData
[
texPngData
]=
aniEnter
.
texPngData
(
save
)="
saveAniEnter
($
event
)"
>
</app-upload-dragon-bone>
音频配置
<app-audio-recorder
[
audioUrl
]="
aniEnter
.
audioUrl
"
[
withRmBtn
]="
aniEnter
.
audioUrl
!=''"
(
audioUploaded
)="
onAudioUploadAniEnter
($
event
)"
>
</app-audio-recorder>
时间配置
<input
type=
"text"
nz-input
[(
ngModel
)]="
aniEnter
.
time
"
(
ngModelChange
)="
this
.
onTxtChangeAniEnter
()"
>
</div>
</div>
<!-- <div class="card-config">
<div class="card-item clearfix" style="padding: 0.5vw; width: 600px; ">
<div class="card-item clearfix" style="padding: 0.5vw; width: 600px; ">
<div class="card-item-content border">
<div class="card-item-content border">
<span style="margin-left: 5%;height: 30px; font-size: 18px;">标题音频:</span>
<span style="margin-left: 5%;height: 30px; font-size: 18px;">标题音频:</span>
...
@@ -15,21 +37,28 @@
...
@@ -15,21 +37,28 @@
<br>
<br>
</div>
</div>
</div>
</div>
</div>
</div>
-->
<div
class=
"card-config"
>
<div
class=
"card-config"
>
<div
*
ngFor=
"let question of item.questionList; let i = index"
class=
"card-item clearfix"
<div
*
ngFor=
"let question of item.questionList; let i = index"
class=
"card-item clearfix"
style=
"padding: 0.5vw; width: 100%; "
>
style=
"padding: 0.5vw; width: 100%; "
>
<div
class=
"card-item-content border"
>
<div
class=
"card-item-content border"
>
<div>
<span
style=
"height: 30px; font-size: 18px;"
>
完整单词:
</span>
<span
style=
"height: 30px; font-size: 18px;"
>
完整单词:
</span>
<span
style=
"height: 30px; font-size: 18px;"
>
{{getQuestionText(question)}}
</span>
<span
style=
"height: 30px; font-size: 18px;"
>
{{getQuestionText(question)}}
</span>
<br>
</div>
<span
style=
"height: 30px; font-size: 18px;"
>
单词音频:
</span>
<div>
<br>
<button
style=
"margin-top: 5px;border-width: 1px;border-style: dotted; padding: 5px 20px;color: #f00;"
nz-button
nzType=
"dashed"
class=
"add-btn"
(
click
)="
removeQuestion
(
i
)"
>
删除题目
</button>
</div>
<div>
<div
style=
"height: 30px; font-size: 18px;"
>
单词音频:
</div>
<app-audio-recorder
[
audioUrl
]="
question
.
audio
"
(
audioUploaded
)="
onAudioUploadSuccess
($
event
,
i
)"
>
<app-audio-recorder
[
audioUrl
]="
question
.
audio
"
(
audioUploaded
)="
onAudioUploadSuccess
($
event
,
i
)"
>
</app-audio-recorder>
</app-audio-recorder>
<
br
>
<
/div
>
<span
style=
"height: 30px; font-size: 18px;"
>
拼图图片:
</span>
<span
style=
"height: 30px; font-size: 18px;"
>
拼图图片
(可忽略)
:
</span>
<br>
<br>
<div
style=
"width: 300px;"
>
<div
style=
"width: 300px;"
>
<app-upload-image-with-preview
[
picUrl
]="
question
.
image
"
<app-upload-image-with-preview
[
picUrl
]="
question
.
image
"
...
@@ -40,15 +69,32 @@
...
@@ -40,15 +69,32 @@
<div
*
ngFor=
"let option of question.optionList; let j = index"
class=
"section-content;text-align:center"
<div
*
ngFor=
"let option of question.optionList; let j = index"
class=
"section-content;text-align:center"
style=
"padding: 0.5vw; display: inline-block"
>
style=
"padding: 0.5vw; display: inline-block"
>
<div
style=
"margin-top: 20px; float: left; border-width: 1px; border-style: dotted;
<div
style=
"margin-top: 20px; float: left; border-width: 1px; border-style: dotted;
padding: 20px; margin-right: 0px; width: 220px; height: 215px;"
>
padding: 20px; margin-right: 0px; width: 420px; height: 385px;"
>
<span
style=
"height: 30px; font-size: 18px;"
>
选项文本:
</span>
<h2>
选项类型:
</h2>
<nz-radio-group
[(
ngModel
)]="
option
.
type
"
style=
"margin-left: 20px; margin-top: -11px"
(
ngModelChange
)="
save
()"
>
<label
nz-radio
nzValue=
"text"
>
文本
</label>
<label
nz-radio
nzValue=
"pic"
>
图片
</label>
<label
nz-radio
nzValue=
"picText"
>
图片加文本
</label>
</nz-radio-group>
<div
*
ngIf=
"option.type !='pic'"
>
<div
style=
"height: 30px; font-size: 18px;"
>
选项文本:
</div>
<input
style=
"width: 150px; "
type=
"text"
maxlength=
""
nz-input
[(
ngModel
)]="
option
.
text
"
(
blur
)="
save
()"
>
<input
style=
"width: 150px; "
type=
"text"
maxlength=
""
nz-input
[(
ngModel
)]="
option
.
text
"
(
blur
)="
save
()"
>
<br>
</div>
<span
style=
"height: 30px; font-size: 18px;"
>
选项音频:
</span>
<div
*
ngIf=
"option.type != 'text'"
>
<div
style=
"height: 30px; font-size: 18px;"
>
选项图片:
</div>
<div
style=
"width: 100px;"
>
<app-upload-image-with-preview
[
picUrl
]="
option
.
image
"
(
imageUploaded
)="
onOptionImageUploadSuccessByItem
($
event
,
option
)"
>
</app-upload-image-with-preview>
</div>
</div>
<div
style=
"margin-top:10px;height: 30px; font-size: 18px;"
>
选项音频:
</div>
<app-audio-recorder
[
audioUrl
]="
option
.
optionAudio
"
(
audioUploaded
)="
onOptionUploadSuccess
($
event
,
i
,
j
)"
>
<app-audio-recorder
[
audioUrl
]="
option
.
optionAudio
"
(
audioUploaded
)="
onOptionUploadSuccess
($
event
,
i
,
j
)"
>
</app-audio-recorder>
</app-audio-recorder>
<div
*
ngIf=
"(question.optionList.length >
3
)"
>
<div
*
ngIf=
"(question.optionList.length >
2
)"
>
<button
style=
"margin-top: 20px; width: 100%; height: 32px; color: red;"
nz-button
nzType=
"dashed"
<button
style=
"margin-top: 20px; width: 100%; height: 32px; color: red;"
nz-button
nzType=
"dashed"
class=
"add-btn"
(
click
)="
removeOption
(
i
,
j
)"
>
class=
"add-btn"
(
click
)="
removeOption
(
i
,
j
)"
>
删除选项
删除选项
...
@@ -64,11 +110,18 @@
...
@@ -64,11 +110,18 @@
增加选项
增加选项
</button>
</button>
</div>
</div>
<br>
</div>
</div>
</div>
</div>
</div>
</div>
<div>
<button
style=
"margin-top: 20px; float: left; border-width: 1px;
border-style: dotted; padding: 20px; margin-right: 20px;
width: 220px; height: 215px;"
nz-button
nzType=
"dashed"
class=
"add-btn"
(
click
)="
addQuestion
()"
>
增加题目
</button>
</div>
</div>
</div>
\ No newline at end of file
form/src/app/form/form.component.ts
View file @
8a178f58
...
@@ -13,6 +13,13 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -13,6 +13,13 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
saveKey
=
"
DataKey_Cocos_ET20
"
;
saveKey
=
"
DataKey_Cocos_ET20
"
;
// 储存对象
// 储存对象
item
;
item
;
aniEnter
:
any
=
{
skeJsonData
:
{},
texJsonData
:
{},
texPngData
:
{},
audioUrl
:
null
,
time
:
1
,
}
copyQuestionData
;
copyQuestionData
;
constructor
(
private
appRef
:
ApplicationRef
,
private
changeDetectorRef
:
ChangeDetectorRef
)
{
constructor
(
private
appRef
:
ApplicationRef
,
private
changeDetectorRef
:
ChangeDetectorRef
)
{
...
@@ -25,7 +32,9 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -25,7 +32,9 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
"
audio
"
:
""
,
"
audio
"
:
""
,
"
image
"
:
""
,
"
image
"
:
""
,
"
optionList
"
:
[{
"
optionList
"
:
[{
"
type
"
:
0
,
"
text
"
:
""
,
"
text
"
:
""
,
"
image
"
:
""
,
"
optionAudio
"
:
""
"
optionAudio
"
:
""
}]
}]
}
}
...
@@ -46,7 +55,9 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -46,7 +55,9 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
addOption
(
questionIdx
)
{
addOption
(
questionIdx
)
{
this
.
item
.
questionList
[
questionIdx
].
optionList
.
push
({
this
.
item
.
questionList
[
questionIdx
].
optionList
.
push
({
"
type
"
:
0
,
"
text
"
:
""
,
"
text
"
:
""
,
"
image
"
:
""
,
"
optionAudio
"
:
""
"
optionAudio
"
:
""
});
});
this
.
save
();
this
.
save
();
...
@@ -67,13 +78,13 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -67,13 +78,13 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
ngOnInit
()
{
ngOnInit
()
{
this
.
item
=
{
this
.
item
=
{
questionAudio
:
""
,
questionText
:
""
,
questionList
:
[{
questionList
:
[{
"
audio
"
:
""
,
"
audio
"
:
""
,
"
image
"
:
""
,
"
image
"
:
""
,
"
optionList
"
:
[{
"
optionList
"
:
[{
"
type
"
:
0
,
"
text
"
:
""
,
"
text
"
:
""
,
"
image
"
:
""
,
"
optionAudio
"
:
""
"
optionAudio
"
:
""
}]
}]
}]
}]
...
@@ -82,8 +93,14 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -82,8 +93,14 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
// 获取存储的数据
// 获取存储的数据
(
<
any
>
window
).
courseware
.
getData
((
data
)
=>
{
(
<
any
>
window
).
courseware
.
getData
((
data
)
=>
{
console
.
log
(
"
data
"
,
data
);
if
(
data
)
{
if
(
data
)
{
this
.
item
=
data
;
if
(
data
.
aniEnter
)
{
this
.
aniEnter
=
data
.
aniEnter
;
}
if
(
data
.
item
)
{
this
.
item
=
data
.
item
;
}
}
}
this
.
init
();
this
.
init
();
...
@@ -113,8 +130,8 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -113,8 +130,8 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
}
}
onQuestionAudioUploadSuccess
(
e
)
{
onQuestionAudioUploadSuccess
(
e
)
{
this
.
item
.
questionAudio
=
e
.
url
;
//
this.item.questionAudio = e.url;
this
.
save
();
//
this.save();
// questionText
// questionText
}
}
onImageUploadSuccessByItem
(
e
,
questionIdx
)
{
onImageUploadSuccessByItem
(
e
,
questionIdx
)
{
...
@@ -123,6 +140,10 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -123,6 +140,10 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
this
,
this
.
refresh
()
this
,
this
.
refresh
()
this
.
save
();
this
.
save
();
}
}
onOptionImageUploadSuccessByItem
(
e
,
option
)
{
option
.
image
=
e
.
url
;
this
.
save
();
}
radioClick
(
questionIdx
,
optionIdx
)
{
radioClick
(
questionIdx
,
optionIdx
)
{
this
.
item
.
questionList
[
questionIdx
].
rightOptionIdx
=
optionIdx
;
this
.
item
.
questionList
[
questionIdx
].
rightOptionIdx
=
optionIdx
;
this
.
changeDetectorRef
.
markForCheck
();
this
.
changeDetectorRef
.
markForCheck
();
...
@@ -143,11 +164,27 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -143,11 +164,27 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
this
.
save
();
this
.
save
();
}
}
saveAniEnter
(
e
)
{
console
.
log
(
e
);
this
.
save
();
}
onAudioUploadAniEnter
(
e
)
{
this
.
aniEnter
.
audioUrl
=
e
.
url
this
.
save
();
}
onTxtChangeAniEnter
()
{
this
.
save
()
}
/**
/**
* 储存数据
* 储存数据
*/
*/
save
()
{
save
()
{
(
<
any
>
window
).
courseware
.
setData
(
this
.
item
,
null
,
this
.
saveKey
);
let
obj
:
any
=
{
aniEnter
:
this
.
aniEnter
,
item
:
this
.
item
};
(
<
any
>
window
).
courseware
.
setData
(
obj
,
null
,
this
.
saveKey
);
this
.
refresh
();
this
.
refresh
();
console
.
log
(
'
this.item =
'
+
JSON
.
stringify
(
this
.
item
));
console
.
log
(
'
this.item =
'
+
JSON
.
stringify
(
this
.
item
));
...
...
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