Commit 07feade9 authored by huoshizhe's avatar huoshizhe

feat: uri

parent f5b60d11
...@@ -296,18 +296,21 @@ ...@@ -296,18 +296,21 @@
}, },
{ {
"__id__": 24 "__id__": 24
},
{
"__id__": 251
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 251 "__id__": 266
}, },
{ {
"__id__": 252 "__id__": 267
}, },
{ {
"__id__": 253 "__id__": 268
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -13014,6 +13017,639 @@ ...@@ -13014,6 +13017,639 @@
"_originalHeight": 0, "_originalHeight": 0,
"_id": "62X0iD36lCsowK/OhMSTuH" "_id": "62X0iD36lCsowK/OhMSTuH"
}, },
{
"__type__": "cc.Node",
"_name": "New Sprite(Splash)",
"_objFlags": 0,
"_parent": {
"__id__": 7
},
"_children": [
{
"__id__": 252
},
{
"__id__": 255
},
{
"__id__": 258
},
{
"__id__": 261
}
],
"_active": true,
"_components": [
{
"__id__": 264
},
{
"__id__": 265
}
],
"_prefab": null,
"_opacity": 90,
"_color": {
"__type__": "cc.Color",
"r": 0,
"g": 76,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1280,
"height": 720
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
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": "36hLBWWytLh4LbO3xgClPZ"
},
{
"__type__": "cc.Node",
"_name": "New Sprite(Splash)",
"_objFlags": 0,
"_parent": {
"__id__": 251
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 253
},
{
"__id__": 254
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1280,
"height": 10
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
355,
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": "71dHG5u+hDbJIbS1KkhBXz"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 252
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "a23235d1-15db-4b95-8439-a2e005bfff91"
},
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "f0kOGSKqRC/4gcvlZjH/C0"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 252
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 41,
"_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": 100,
"_originalHeight": 0,
"_id": "7b/QC6kMNFvaDlgL9JwCkV"
},
{
"__type__": "cc.Node",
"_name": "New Sprite(Splash)",
"_objFlags": 0,
"_parent": {
"__id__": 251
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 256
},
{
"__id__": 257
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 10,
"height": 720
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-635,
0,
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": "6b+TwE7MVE26huxUbN5zoq"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 255
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "a23235d1-15db-4b95-8439-a2e005bfff91"
},
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "c6h7K7G5tIxov6diIk/+ZN"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 255
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 13,
"_left": 0,
"_right": 590,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 100,
"_originalHeight": 10,
"_id": "73hzOk3aZMjpORoHrWaJG9"
},
{
"__type__": "cc.Node",
"_name": "New Sprite(Splash)",
"_objFlags": 0,
"_parent": {
"__id__": 251
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 259
},
{
"__id__": 260
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1280,
"height": 10
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
-355,
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": "4cT60ZYWRLpJUFQNxdM8vj"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 258
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "a23235d1-15db-4b95-8439-a2e005bfff91"
},
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "f1YPS4BOJJWLGRRfmW1477"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 258
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 44,
"_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": 100,
"_originalHeight": 10,
"_id": "6cbUAd/xdGJ5i/DtxIcD6g"
},
{
"__type__": "cc.Node",
"_name": "New Sprite(Splash)",
"_objFlags": 0,
"_parent": {
"__id__": 251
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 262
},
{
"__id__": 263
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 10,
"height": 720
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
635,
0,
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": "69ryqKvkFG8qZ1twJWMp3w"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 261
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "a23235d1-15db-4b95-8439-a2e005bfff91"
},
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "64uJGUm/tFT7xXvRzkuLN4"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 261
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 37,
"_left": 590,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 100,
"_originalHeight": 10,
"_id": "76RSPkZA9K373tL/lz15l5"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 251
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "a23235d1-15db-4b95-8439-a2e005bfff91"
},
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "48ZqFr955OkooIa1aFvOib"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 251
},
"_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": 100,
"_originalHeight": 100,
"_id": "58v92nFAJJPbNGvcA+Csy1"
},
{ {
"__type__": "cc.Widget", "__type__": "cc.Widget",
"_name": "", "_name": "",
......
...@@ -81,8 +81,8 @@ cc.Class({ ...@@ -81,8 +81,8 @@ cc.Class({
// /api/syllabus/v1/tree?orgid=483&pid=18567 // /api/syllabus/v1/tree?orgid=483&pid=18567
// this.baseUrl = 'http://staging-teach.ireadabc.com'; this.baseUrl = 'http://staging-teach.ireadabc.com';
// this.initStoryBoxView({ coursewareId: 18307 }); this.initStoryBoxView({ coursewareId: 18307 });
}, },
asyncDelayLog(str) { asyncDelayLog(str) {
...@@ -137,7 +137,7 @@ cc.Class({ ...@@ -137,7 +137,7 @@ cc.Class({
initStoryBoxView(bundleInfo) { initStoryBoxView(bundleInfo) {
this.hideWWView(); this.hideWWView();
this.callNetworkApiGet('/api/syllabus/v1/tree', { orgid: 483, pid: bundleInfo.coursewareId }, (data) => { this.callNetworkApiGet('syllabus/v1/tree', { orgid: 483, pid: bundleInfo.coursewareId }, (data) => {
console.log(data); console.log(data);
const defaultBondle = data.rows.find(row => row.name == '默认'); const defaultBondle = data.rows.find(row => row.name == '默认');
if (!defaultBondle) { if (!defaultBondle) {
...@@ -558,15 +558,32 @@ cc.Class({ ...@@ -558,15 +558,32 @@ cc.Class({
cc.audioEngine.stopAll(); cc.audioEngine.stopAll();
cc.director.runScene(scene, null, () => { cc.director.runScene(scene, null, () => {
console.log('sceneName = ' + conf.sceneName); console.log('sceneName = ' + conf.sceneName);
const Canvas = cc.find('Canvas'); const canvas = cc.find('Canvas');
const middleLayer = cc.find('middleLayer'); const middleLayer = cc.find('middleLayer');
this.hideWaitingLetters(); this.hideWaitingLetters();
callback && callback(); callback && callback();
Canvas.getComponent(cc.Widget).updateAlignment(); canvas.getComponent(cc.Widget).updateAlignment();
// middleLayer.scale = Canvas.width / middleLayer.width;
const frameSize = cc.view.getFrameSize(); const frameSize = cc.view.getFrameSize();
console.log(`Canvas.size = ${Canvas.width}, ${Canvas.height}`); console.log(`Canvas.size = ${canvas.width}, ${canvas.height}`);
console.log(`frameSize.size = ${frameSize.width}, ${frameSize.height}`); console.log(`frameSize.size = ${frameSize.width}, ${frameSize.height}`);
const canvasComponent = canvas.getComponent(cc.Canvas);
// middleLayer.removeComponent(cc.Widget);
// middleLayer.width = frameSize.width;
// middleLayer.height = frameSize.height;
if (!canvasComponent.fitHeight && !canvasComponent.fitWidth) {
console.log('汪汪汪 1')
} else if (!canvasComponent.fitHeight) {
console.log('汪汪汪 2')
// const heightOffset = ((canvas.width / frameSize.size.width) * frameSize.size.height - canvas.height) / 2;
// console.log('heightOffset = ' + heightOffset);
// middleLayer.getComponent(cc.Widget).top = -heightOffset;
// middleLayer.getComponent(cc.Widget).bottom = -heightOffset;
// middleLayer.getComponent(cc.Widget).updateAlignment();
} else if (!canvasComponent.fitWidth) {
console.log('汪汪汪 3')
} else {
console.log('汪汪汪 4')
}
}); });
}); });
}); });
......
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