Commit 3321f247 authored by Tt's avatar Tt

调整1 2 个适配

parent 9545e3c9
...@@ -81,13 +81,13 @@ ...@@ -81,13 +81,13 @@
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 51 "__id__": 53
}, },
{ {
"__id__": 52 "__id__": 54
}, },
{ {
"__id__": 53 "__id__": 55
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -773,15 +773,18 @@ ...@@ -773,15 +773,18 @@
}, },
{ {
"__id__": 41 "__id__": 41
},
{
"__id__": 49
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 49 "__id__": 51
}, },
{ {
"__id__": 50 "__id__": 52
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -1759,8 +1762,8 @@ ...@@ -1759,8 +1762,8 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 126, "width": 226,
"height": 56.4 "height": 40
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
...@@ -1772,7 +1775,7 @@ ...@@ -1772,7 +1775,7 @@
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
-13.107, -13.107,
-128.045, -130.562,
0, 0,
0, 0,
0, 0,
...@@ -1814,8 +1817,8 @@ ...@@ -1814,8 +1817,8 @@
"_string": "剧情预告", "_string": "剧情预告",
"_N$string": "剧情预告", "_N$string": "剧情预告",
"_fontSize": 30, "_fontSize": 30,
"_lineHeight": 40, "_lineHeight": 30,
"_enableWrapText": true, "_enableWrapText": false,
"_N$file": { "_N$file": {
"__uuid__": "8700c4ce-513b-4374-b284-b51c1d29393c" "__uuid__": "8700c4ce-513b-4374-b284-b51c1d29393c"
}, },
...@@ -1827,7 +1830,7 @@ ...@@ -1827,7 +1830,7 @@
"_N$horizontalAlign": 1, "_N$horizontalAlign": 1,
"_N$verticalAlign": 1, "_N$verticalAlign": 1,
"_N$fontFamily": "Arial", "_N$fontFamily": "Arial",
"_N$overflow": 0, "_N$overflow": 2,
"_N$cacheMode": 0, "_N$cacheMode": 0,
"_id": "4c7HOTq3NLJLT472LpS2+F" "_id": "4c7HOTq3NLJLT472LpS2+F"
}, },
...@@ -2045,7 +2048,7 @@ ...@@ -2045,7 +2048,7 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 1292, "width": 1334,
"height": 600 "height": 600
}, },
"_anchorPoint": { "_anchorPoint": {
...@@ -2057,7 +2060,7 @@ ...@@ -2057,7 +2060,7 @@
"__type__": "TypedArray", "__type__": "TypedArray",
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
-628.723, -667,
-27.235, -27.235,
0, 0,
0, 0,
...@@ -2114,7 +2117,7 @@ ...@@ -2114,7 +2117,7 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 1292, "width": 1334,
"height": 600 "height": 600
}, },
"_anchorPoint": { "_anchorPoint": {
...@@ -2234,8 +2237,8 @@ ...@@ -2234,8 +2237,8 @@
"height": 40 "height": 40
}, },
"_N$startAxis": 0, "_N$startAxis": 0,
"_N$paddingLeft": 0, "_N$paddingLeft": 100,
"_N$paddingRight": 0, "_N$paddingRight": 100,
"_N$paddingTop": 0, "_N$paddingTop": 0,
"_N$paddingBottom": 0, "_N$paddingBottom": 0,
"_N$spacingX": -17, "_N$spacingX": -17,
...@@ -2329,8 +2332,8 @@ ...@@ -2329,8 +2332,8 @@
"alignMode": 1, "alignMode": 1,
"_target": null, "_target": null,
"_alignFlags": 40, "_alignFlags": 40,
"_left": 38.277000000000044, "_left": 0,
"_right": 3.7229999999999563, "_right": 0,
"_top": 0, "_top": 0,
"_bottom": 0, "_bottom": 0,
"_verticalCenter": 0, "_verticalCenter": 0,
...@@ -2345,6 +2348,100 @@ ...@@ -2345,6 +2348,100 @@
"_originalHeight": 0, "_originalHeight": 0,
"_id": "26mF12Z0VGNJ5V9nzBTiCg" "_id": "26mF12Z0VGNJ5V9nzBTiCg"
}, },
{
"__type__": "cc.Node",
"_name": "layout",
"_objFlags": 0,
"_parent": {
"__id__": 15
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 50
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 880,
"height": 200
},
"_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": "64PQnXAjxHNoO/UJsE3qC+"
},
{
"__type__": "cc.Layout",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 49
},
"_enabled": true,
"_layoutSize": {
"__type__": "cc.Size",
"width": 880,
"height": 200
},
"_resize": 0,
"_N$layoutType": 1,
"_N$cellSize": {
"__type__": "cc.Size",
"width": 40,
"height": 40
},
"_N$startAxis": 0,
"_N$paddingLeft": 0,
"_N$paddingRight": 0,
"_N$paddingTop": 0,
"_N$paddingBottom": 0,
"_N$spacingX": 0,
"_N$spacingY": 0,
"_N$verticalDirection": 1,
"_N$horizontalDirection": 0,
"_N$affectedByScale": false,
"_id": "c5NrIm611GRpfTxX4SLbOe"
},
{ {
"__type__": "cfef9RS1bRFZqpW++GCoUte", "__type__": "cfef9RS1bRFZqpW++GCoUte",
"_name": "", "_name": "",
......
...@@ -34,13 +34,18 @@ export default class NewClass extends cc.Component { ...@@ -34,13 +34,18 @@ export default class NewClass extends cc.Component {
private layout: cc.Node; private layout: cc.Node;
private item: cc.Node; private item: cc.Node;
onLoad() { onLoad() {
let scrollview = this.node.getChildByName("scrollview");
let view = scrollview.getChildByName("view");
this.layout = view.getChildByName("content");
this.item = this.node.getChildByName("item"); this.item = this.node.getChildByName("item");
this.item.active = false; this.item.active = false;
} }
initView() { initView() {
if (this.list.length < 3) {
this.layout = this.node.getChildByName("layout");
this.layout.width = this.list.length == 2 ? 880 : 440;
} else {
let scrollview = this.node.getChildByName("scrollview");
let view = scrollview.getChildByName("view");
this.layout = view.getChildByName("content");
}
this.list.forEach((data, index) => { this.list.forEach((data, index) => {
let item = cc.instantiate(this.item); let item = cc.instantiate(this.item);
this.updateItem(item, data, index); this.updateItem(item, data, index);
......
...@@ -34,30 +34,34 @@ export const defaultData = { ...@@ -34,30 +34,34 @@ export const defaultData = {
//游戏列表 //游戏列表
gameList: [{ gameList: [{
img: 'http://staging-teach.cdn.ireadabc.com/0d332cb2b167feb4204b1d77a6f02ed6.jpg', img: 'http://staging-teach.cdn.ireadabc.com/0d332cb2b167feb4204b1d77a6f02ed6.jpg',
name: '小红帽历险记1', name: '小红帽历险记1设施难以熊圣诞节否',
locked: false, locked: false,
id: 1231, id: 1231,
}, { },
{
img: 'http://staging-teach.cdn.ireadabc.com/0d332cb2b167feb4204b1d77a6f02ed6.jpg', img: 'http://staging-teach.cdn.ireadabc.com/0d332cb2b167feb4204b1d77a6f02ed6.jpg',
name: '小红帽历险记2', name: '小红帽历险记2',
locked: false, locked: false,
id: 1232, id: 1232,
}, { },
img: 'http://staging-teach.cdn.ireadabc.com/0d332cb2b167feb4204b1d77a6f02ed6.jpg', // {
name: '小红帽历险记3', // img: 'http://staging-teach.cdn.ireadabc.com/0d332cb2b167feb4204b1d77a6f02ed6.jpg',
locked: false, // name: '小红帽历险记3',
id: 1233, // locked: false,
}, { // id: 1233,
img: 'http://staging-teach.cdn.ireadabc.com/0d332cb2b167feb4204b1d77a6f02ed6.jpg', // },
name: '小红帽历险记4', // {
locked: false, // img: 'http://staging-teach.cdn.ireadabc.com/0d332cb2b167feb4204b1d77a6f02ed6.jpg',
id: 1234, // name: '小红帽历险记4',
}, { // locked: false,
img: 'http://staging-teach.cdn.ireadabc.com/0d332cb2b167feb4204b1d77a6f02ed6.jpg', // id: 1234,
name: '小红帽历险记5', // }, {
locked: false, // img: 'http://staging-teach.cdn.ireadabc.com/0d332cb2b167feb4204b1d77a6f02ed6.jpg',
id: 1235, // name: '小红帽历险记5',
totalIcon: 100, // locked: false,
}], // id: 1235,
// totalIcon: 100,
// }
],
} }
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