Commit 0516b50f authored by liujiangnan's avatar liujiangnan

feat: 大退APP

parent 7704b44f
......@@ -82,18 +82,21 @@
},
{
"__id__": 33
},
{
"__id__": 37
}
],
"_active": true,
"_components": [
{
"__id__": 36
"__id__": 40
},
{
"__id__": 37
"__id__": 41
},
{
"__id__": 38
"__id__": 42
}
],
"_prefab": null,
......@@ -1545,6 +1548,201 @@
"_originalHeight": 0,
"_id": "b36Ubd5olJrpvGM0wzH0oD"
},
{
"__type__": "cc.Node",
"_name": "close",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 34
},
{
"__id__": 35
},
{
"__id__": 36
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 103.5,
"height": 107.5
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-588.25,
306.25,
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": "92CCqaSIlD0bgp+OmQzlkH"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 33
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "90d9553f-40f6-4a5b-895b-8a4b4b0b822f"
},
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "ceEMq5/o1GdYkHFDJ4o6iy"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 33
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 9,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": "8f+520fipDAZv1d+pwn49X"
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 33
},
"_enabled": true,
"_normalMaterial": null,
"_grayMaterial": null,
"duration": 0.1,
"zoomScale": 1.2,
"clickEvents": [],
"_N$interactable": true,
"_N$enableAutoGrayEffect": false,
"_N$transition": 0,
"transition": 0,
"_N$normalColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"_N$hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$disabledColor": {
"__type__": "cc.Color",
"r": 124,
"g": 124,
"b": 124,
"a": 255
},
"_N$normalSprite": null,
"_N$pressedSprite": null,
"pressedSprite": null,
"_N$hoverSprite": null,
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": null,
"_id": "4dNBAxyslIcb/j/z9eUsXy"
},
{
"__type__": "cc.Node",
"_name": "audio",
......@@ -1554,7 +1752,7 @@
},
"_children": [
{
"__id__": 34
"__id__": 38
}
],
"_active": false,
......@@ -1612,13 +1810,13 @@
"_name": "btn",
"_objFlags": 0,
"_parent": {
"__id__": 33
"__id__": 37
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 35
"__id__": 39
}
],
"_prefab": null,
......@@ -1674,7 +1872,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 34
"__id__": 38
},
"_enabled": true,
"_clip": {
......
......@@ -8,11 +8,9 @@ const { ccclass, property } = cc._decorator;
export default class SceneComponent extends MyCocosSceneComponent {
addPreloadImage() {
// TODO 根据自己的配置预加载图片资源
}
addPreloadAudio() {
// TODO 根据自己的配置预加载音频资源
}
addPreloadAnima() {
......@@ -57,6 +55,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
if (route) {
cc.find(`Canvas/lefttop/bg_title/title`).getComponent(cc.Label).string = route.name;
cc.find(`Canvas/lefttop`).active = true;
cc.find(`Canvas/close`).active = false;
this.rows = await this.loadData(route.id);
} else {
this.rows = await this.loadData();
......@@ -136,6 +135,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
await this.drawPage();
cc.find(`Canvas/lefttop/bg_title/title`).getComponent(cc.Label).string = row.name;
cc.find(`Canvas/lefttop`).active = true;
cc.find(`Canvas/close`).active = false;
} else {
showTips("内容还未制作!");
}
......@@ -170,10 +170,17 @@ export default class SceneComponent extends MyCocosSceneComponent {
const routers = this.getRouters();
if (routers.length === 0) {
cc.find(`Canvas/lefttop`).active = false;
cc.find(`Canvas/close`).active = true;
} else {
cc.find(`Canvas/lefttop/bg_title/title`).getComponent(cc.Label).string = routers[routers.length-1].name;
}
});
buttonOnClick(cc.find(`Canvas/close`), () => {
if (window && (<any>window).courseware && (<any>window).courseware.exitApp) {
(<any>window).courseware.exitApp();
}
});
}
playLocalAudio(audioName) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment