Commit 40a19edc authored by liujiangnan's avatar liujiangnan

feat: 退出APP功能改变

parent 3f445935
......@@ -299,31 +299,22 @@
"__id__": 9
},
{
"__id__": 13
},
{
"__id__": 17
"__id__": 11
},
{
"__id__": 21
},
{
"__id__": 23
},
{
"__id__": 33
},
{
"__id__": 35
}
],
"_active": true,
"_components": [
{
"__id__": 37
"__id__": 25
},
{
"__id__": 38
"__id__": 26
}
],
"_prefab": null,
......@@ -374,591 +365,6 @@
"groupIndex": 0,
"_id": "c2DZ4wlX1HzbimXNoMnVZO"
},
{
"__type__": "cc.Node",
"_name": "ExitBtn",
"_objFlags": 0,
"_parent": {
"__id__": 8
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 10
},
{
"__id__": 11
},
{
"__id__": 12
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 131,
"height": 131
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-863.522,
453.12800000000004,
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": "eacQSP+NxNWYIBuiqnv/FH"
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 9
},
"_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": "25VWkik+9GAKOaKfpA9Tf6"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 9
},
"_enabled": true,
"alignMode": 2,
"_target": null,
"_alignFlags": 9,
"_left": 30.977999999999952,
"_right": 0,
"_top": 21.371999999999957,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": "669Abf8UBIJ5w+8w83zBHw"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 9
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "57bdc862-1a68-4657-9b66-b5115d097b7e"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "30FbSxv/hP9r+UK0P/aTYj"
},
{
"__type__": "cc.Node",
"_name": "BtnLeft",
"_objFlags": 0,
"_parent": {
"__id__": 8
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 14
},
{
"__id__": 15
},
{
"__id__": 16
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 209,
"height": 146
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
757.75,
483.5,
0,
0,
0,
0,
1,
-0.5,
0.5,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "373lsjYxpDjpBPdG7XpKNm"
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 13
},
"_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": "74T1oR96VGfbL7Rscguciw"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 13
},
"_enabled": true,
"alignMode": 2,
"_target": null,
"_alignFlags": 33,
"_left": 20,
"_right": 150,
"_top": 20,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 61,
"_originalHeight": 0,
"_id": "4bUHjla2BOwLTjCU561v1O"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 13
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "b2282c0f-dd0f-4bf3-9d51-63fd72bd25ca"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "34fnL+7EFC5ahjRfoVG4qk"
},
{
"__type__": "cc.Node",
"_name": "BtnRight",
"_objFlags": 0,
"_parent": {
"__id__": 8
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 18
},
{
"__id__": 19
},
{
"__id__": 20
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 209,
"height": 146
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
887.75,
483.5,
0,
0,
0,
0,
1,
0.5,
0.5,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "8cBKHK6udLybTPmRmBBF98"
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 17
},
"_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": "c5vS0hDupNequQ4j3jK6Uk"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 17
},
"_enabled": true,
"alignMode": 2,
"_target": null,
"_alignFlags": 33,
"_left": 20,
"_right": 20,
"_top": 20,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 84,
"_originalHeight": 0,
"_id": "e3o0XQ1KlN9qhDSk0KTqMm"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 17
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "b2282c0f-dd0f-4bf3-9d51-63fd72bd25ca"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "ccVC042cxCdIpDBInpf/O+"
},
{
"__type__": "cc.Node",
"_name": "layout",
......@@ -970,7 +376,7 @@
"_active": true,
"_components": [
{
"__id__": 22
"__id__": 10
}
],
"_prefab": null,
......@@ -1026,7 +432,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 21
"__id__": 9
},
"_enabled": true,
"_layoutSize": {
......@@ -1062,16 +468,16 @@
},
"_children": [
{
"__id__": 24
"__id__": 12
}
],
"_active": false,
"_components": [
{
"__id__": 31
"__id__": 19
},
{
"__id__": 32
"__id__": 20
}
],
"_prefab": null,
......@@ -1127,24 +533,24 @@
"_name": "progress",
"_objFlags": 0,
"_parent": {
"__id__": 23
"__id__": 11
},
"_children": [
{
"__id__": 25
"__id__": 13
}
],
"_active": true,
"_components": [
{
"__id__": 28
"__id__": 16
},
{
"__id__": 29
"__id__": 17
}
],
"_prefab": {
"__id__": 30
"__id__": 18
},
"_opacity": 255,
"_color": {
......@@ -1198,17 +604,17 @@
"_name": "bar",
"_objFlags": 0,
"_parent": {
"__id__": 24
"__id__": 12
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 26
"__id__": 14
}
],
"_prefab": {
"__id__": 27
"__id__": 15
},
"_opacity": 255,
"_color": {
......@@ -1262,7 +668,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 25
"__id__": 13
},
"_enabled": true,
"_materials": [
......@@ -1292,7 +698,7 @@
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 24
"__id__": 12
},
"asset": {
"__uuid__": "3d356c4d-cb23-4239-aa5f-8a913f420fa4"
......@@ -1305,7 +711,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 24
"__id__": 12
},
"_enabled": true,
"_materials": [
......@@ -1337,7 +743,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 24
"__id__": 12
},
"_enabled": true,
"_id": "3eMT/DXoJNGZT/8Z3nuTUH"
......@@ -1345,7 +751,7 @@
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 24
"__id__": 12
},
"asset": {
"__uuid__": "3d356c4d-cb23-4239-aa5f-8a913f420fa4"
......@@ -1358,7 +764,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 23
"__id__": 11
},
"_enabled": true,
"_materials": [
......@@ -1390,7 +796,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 23
"__id__": 11
},
"_enabled": true,
"_id": "d9Sm5lOKBAxKufJF2Q8Nr8"
......@@ -1406,7 +812,7 @@
"_active": false,
"_components": [
{
"__id__": 34
"__id__": 22
}
],
"_prefab": null,
......@@ -1462,7 +868,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 33
"__id__": 21
},
"_enabled": true,
"_materials": [
......@@ -1500,7 +906,7 @@
"_active": false,
"_components": [
{
"__id__": 36
"__id__": 24
}
],
"_prefab": null,
......@@ -1556,7 +962,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 35
"__id__": 23
},
"_enabled": true,
"_id": "c8RSZKHRJO95/RfIMIkSA5"
......
......@@ -70,23 +70,25 @@ export default class NewClass extends middleLayerBase {
});
}
exitFlag;
exitGame(data = null) {
if (this.token) {
this.callNetworkApiPost(`api/dige/v1/user/report`, {
token: this.token,
syllabus_id: this.courseItem.course_id,
courseware_id: this.courseItem.id,
template_name: this.courseItem.template_name,
study_duration: Date.now() - this.courseOpenTimeStamp,
result: JSON.stringify(data),
}, () => {
this.callNativeFunction({ name: "exit", value: "" });
});
} else {
this.callNativeFunction({ name: "exit", value: "" });
}
}
initListener() {
const ExitBtn = cc.find('middleLayer/ExitBtn');
ExitBtn.on("click", () => {
if (this.exitFlag) {
return;
}
this.exitFlag = true;
cc.tween(ExitBtn)
.to(0.1, { scaleX: 0.9, scaleY: 1.1 })
.to(0.1, { scaleX: 1.1, scaleY: 0.9 })
.to(0.1, { scaleX: 1, scaleY: 1 })
.call(() => {
this.callNativeFunction({ name: "exit", value: "" });
})
.start();
});
}
reWriteAir() {
......
......@@ -205,7 +205,6 @@ export abstract class middleLayerBase extends cc.Component {
console.log('sceneName = ' + sceneName);
const canvas = cc.find('Canvas');
const middleLayer = cc.find('middleLayer');
cc.find('middleLayer/ExitBtn').active = true;
this.hideWaitingLetters();
canvas.getComponent(cc.Widget).updateAlignment();
middleLayer.scale = canvas.width / middleLayer.width;
......
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