Commit 89550a46 authored by 李维's avatar 李维

修改视频弹窗显示隐藏逻辑

parent bd157ac1
...@@ -119,14 +119,14 @@ ...@@ -119,14 +119,14 @@
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{
"__id__": 896
},
{ {
"__id__": 897 "__id__": 897
}, },
{ {
"__id__": 898 "__id__": 898
},
{
"__id__": 899
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -34413,13 +34413,13 @@ ...@@ -34413,13 +34413,13 @@
"__id__": 889 "__id__": 889
}, },
{ {
"__id__": 891 "__id__": 892
} }
], ],
"_active": true, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 895 "__id__": 896
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -34482,6 +34482,9 @@ ...@@ -34482,6 +34482,9 @@
"_components": [ "_components": [
{ {
"__id__": 890 "__id__": 890
},
{
"__id__": 891
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -34495,8 +34498,8 @@ ...@@ -34495,8 +34498,8 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 0, "width": 1920,
"height": 0 "height": 1200
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
...@@ -34552,6 +34555,33 @@ ...@@ -34552,6 +34555,33 @@
"_N$keepAspectRatio": true, "_N$keepAspectRatio": true,
"_id": "2dwRPMu0FBT6coCtStcbFS" "_id": "2dwRPMu0FBT6coCtStcbFS"
}, },
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 889
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 45,
"_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": "47GO3cdelHW6EEJk90A+7I"
},
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "close", "_name": "close",
...@@ -34562,14 +34592,14 @@ ...@@ -34562,14 +34592,14 @@
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{
"__id__": 892
},
{ {
"__id__": 893 "__id__": 893
}, },
{ {
"__id__": 894 "__id__": 894
},
{
"__id__": 895
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -34596,7 +34626,7 @@ ...@@ -34596,7 +34626,7 @@
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
860, 860,
274.8, 474.8,
0, 0,
0, 0,
0, 0,
...@@ -34625,7 +34655,7 @@ ...@@ -34625,7 +34655,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 891 "__id__": 892
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -34658,7 +34688,7 @@ ...@@ -34658,7 +34688,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 891 "__id__": 892
}, },
"_enabled": true, "_enabled": true,
"alignMode": 1, "alignMode": 1,
...@@ -34668,7 +34698,7 @@ ...@@ -34668,7 +34698,7 @@
"_alignFlags": 33, "_alignFlags": 33,
"_left": 0, "_left": 0,
"_right": 60, "_right": 60,
"_top": 300, "_top": 100,
"_bottom": 0, "_bottom": 0,
"_verticalCenter": 0, "_verticalCenter": 0,
"_horizontalCenter": 0, "_horizontalCenter": 0,
...@@ -34687,7 +34717,7 @@ ...@@ -34687,7 +34717,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 891 "__id__": 892
}, },
"_enabled": true, "_enabled": true,
"_normalMaterial": null, "_normalMaterial": null,
......
...@@ -2997,12 +2997,21 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -2997,12 +2997,21 @@ export default class SceneComponent extends MyCocosSceneComponent {
} }
// 显示视频播放页面 // 显示视频播放页面
hideLayerPosSaved = {};
showVideoLayer() { showVideoLayer() {
const canvas = cc.find("Canvas"); const canvas = cc.find("Canvas");
const hideNodeNames = ["MainContent", "Header", "Footer", "ActionBtnMaskBg", "ActionBtn", "backBtn"];
canvas.children.forEach(nodeItem => { canvas.children.forEach(nodeItem => {
if(nodeItem.name != "VideoPlayerContainer") { if(hideNodeNames.indexOf(nodeItem.name) != -1) {
nodeItem.opacity = 0; this.hideLayerPosSaved[nodeItem.name] = {
} else { x: nodeItem.x, y: nodeItem.y
}
nodeItem.x = canvas.width * -1;
nodeItem.y = canvas.height * -1;
nodeItem.opacity = 100;
}
if(nodeItem.name == "VideoPlayerContainer") {
nodeItem.active = true; nodeItem.active = true;
nodeItem.opacity = 255; nodeItem.opacity = 255;
} }
...@@ -3012,12 +3021,17 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -3012,12 +3021,17 @@ export default class SceneComponent extends MyCocosSceneComponent {
// 隐藏视频播放页面 // 隐藏视频播放页面
hideVideoLayer() { hideVideoLayer() {
const canvas = cc.find("Canvas"); const canvas = cc.find("Canvas");
const hideNodeNames = ["MainContent", "Header", "Footer", "ActionBtnMaskBg", "ActionBtn", "backBtn"];
canvas.children.forEach(nodeItem => { canvas.children.forEach(nodeItem => {
if(hideNodeNames.indexOf(nodeItem.name) != -1) {
nodeItem.x = this.hideLayerPosSaved[nodeItem.name].x;
nodeItem.y = this.hideLayerPosSaved[nodeItem.name].y;
nodeItem.opacity = 255;
}
if(nodeItem.name == "VideoPlayerContainer") { if(nodeItem.name == "VideoPlayerContainer") {
nodeItem.opacity = 0;
nodeItem.active = false; nodeItem.active = false;
} else { nodeItem.opacity = 0;
nodeItem.opacity = 255;
} }
}); });
} }
......
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