Commit d190260e authored by limingzhe's avatar limingzhe

fix: 增加翻页按钮

parent 1770b381
No preview for this file type
...@@ -103,18 +103,21 @@ ...@@ -103,18 +103,21 @@
}, },
{ {
"__id__": 114 "__id__": 114
},
{
"__id__": 116
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 116 "__id__": 119
}, },
{ {
"__id__": 117 "__id__": 120
}, },
{ {
"__id__": 118 "__id__": 121
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -5274,6 +5277,130 @@ ...@@ -5274,6 +5277,130 @@
"_N$enableBatch": false, "_N$enableBatch": false,
"_id": "85pbnJ3DhOO5vkZVP5GeAa" "_id": "85pbnJ3DhOO5vkZVP5GeAa"
}, },
{
"__type__": "cc.Node",
"_name": "btn_next",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 117
},
{
"__id__": 118
}
],
"_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": [
893.239,
470,
0,
0,
0,
0,
1,
0.4,
0.4,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "c4DdFcHAhJ7L+aSyk9ZnxP"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 116
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 1,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "d12c688a-ef21-4722-b6c7-242a37c7c342"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "5cDoxUOfFKXacHEyEIrroU"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 116
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 33,
"_left": 0,
"_right": 24.961000000000013,
"_top": 40.80000000000001,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": "7fETVnCSFIY5nnwLlHapeD"
},
{ {
"__type__": "cc.Canvas", "__type__": "cc.Canvas",
"_name": "", "_name": "",
......
...@@ -298,6 +298,9 @@ cc.Class({ ...@@ -298,6 +298,9 @@ cc.Class({
videoItemList: null, videoItemList: null,
videoPlayIndex: null, videoPlayIndex: null,
async initView() { async initView() {
this.initNextBtn();
this.videoItemList = []; this.videoItemList = [];
const videoListContent = cc.find(`Canvas/videolist/view/content`); const videoListContent = cc.find(`Canvas/videolist/view/content`);
const templateItem = cc.find(`item`, videoListContent); const templateItem = cc.find(`item`, videoListContent);
...@@ -328,6 +331,31 @@ cc.Class({ ...@@ -328,6 +331,31 @@ cc.Class({
} }
}, },
initNextBtn() {
const middleLayer = cc.find('middleLayer');
if (!middleLayer) {
return;
}
if(!middleLayer.getComponent('middleLayer')?.hasNextPage()) {
return;
}
const nextBtn = cc.find("Canvas/btn_next");
nextBtn.active = true;
nextBtn.on('touchstart', () => {
console.log('nextBtn touchstart');
// const middleLayer = cc.find('middleLayer');
// if (middleLayer) {
middleLayer.getComponent('middleLayer').goNextPage();
// }
nextBtn.active = false;
})
},
showTips(tips) { showTips(tips) {
const middleLayer = cc.find('middleLayer')?.getComponent('middleLayer'); const middleLayer = cc.find('middleLayer')?.getComponent('middleLayer');
if (middleLayer) { if (middleLayer) {
......
{
"ver": "2.3.5",
"uuid": "076b61b6-b882-479b-aac9-5f055bd2d8be",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": true,
"genMipmaps": false,
"packable": true,
"width": 209,
"height": 146,
"platformSettings": {},
"subMetas": {
"btnRight": {
"ver": "1.0.4",
"uuid": "d12c688a-ef21-4722-b6c7-242a37c7c342",
"rawTextureUuid": "076b61b6-b882-479b-aac9-5f055bd2d8be",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 209,
"height": 146,
"rawWidth": 209,
"rawHeight": 146,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
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