Commit e898f71c authored by 李维's avatar 李维

修复列表滚动不复位的问题

parent f457fb4c
......@@ -2222,7 +2222,7 @@
}
],
"_prefab": null,
"_opacity": 0,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
......@@ -5714,7 +5714,7 @@
}
],
"_prefab": null,
"_opacity": 0,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
......@@ -13501,7 +13501,7 @@
}
],
"_prefab": null,
"_opacity": 0,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
......@@ -18385,7 +18385,7 @@
}
],
"_prefab": null,
"_opacity": 0,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
......@@ -34698,7 +34698,7 @@
}
],
"_prefab": null,
"_opacity": 0,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
......@@ -36566,7 +36566,7 @@
}
],
"_prefab": null,
"_opacity": 0,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
......@@ -39147,7 +39147,7 @@
}
],
"_prefab": null,
"_opacity": 0,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
......@@ -43628,7 +43628,7 @@
}
],
"_prefab": null,
"_opacity": 0,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
......@@ -46175,7 +46175,7 @@
}
],
"_prefab": null,
"_opacity": 0,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
......
......@@ -176,9 +176,9 @@ export default class PageViewerClass extends cc.Component {
if(aniType == "leftIn") {
targetX = -targetX
}
inPage.opacity = 255;
inPage.active = true;
inPage.x = -targetX;
outPage.opacity = 255;
outPage.active = true;
cc.tween(inPage)
.to(0.2, {
x: 0
......@@ -190,7 +190,7 @@ export default class PageViewerClass extends cc.Component {
x: targetX
})
.call(() => {
outPage.opacity = 0;
outPage.active = false;
outPage.emit("unmounted")
resovle(true)
})
......@@ -202,8 +202,8 @@ export default class PageViewerClass extends cc.Component {
targetY = -targetY
}
inPage.y = -targetY;
inPage.opacity = 255;
outPage.opacity = 255;
inPage.active = true;
outPage.active = true;
cc.tween(inPage)
.to(0.2, {
y: 0
......@@ -215,7 +215,7 @@ export default class PageViewerClass extends cc.Component {
y: targetY
})
.call(() => {
outPage.opacity = 0;
outPage.active = false;
outPage.emit("unmounted")
resovle(true)
})
......@@ -223,16 +223,16 @@ export default class PageViewerClass extends cc.Component {
})
} else {
if(outPage) {
outPage.opacity = 0;
outPage.active = false;
outPage.emit("unmounted")
} else {
// 未传移除页面 则全部移除
for(let key in PageMap) {
this[PageMap[key]].opacity = 0;
this[PageMap[key]].active = false;
this[PageMap[key]].emit("unmounted");
}
}
inPage.opacity = 255;
inPage.active = true;
inPage.x = 0;
inPage.y = 0;
return new Promise((resovle, reject)=>{
......@@ -241,7 +241,6 @@ export default class PageViewerClass extends cc.Component {
}, 200)
})
}
}
// update (dt) {}
}
......@@ -69,7 +69,9 @@ export default class UnitPageClass extends PageComponentBaseClass {
isDestory = false;
async unmounted() {
const content = this.svContent;
this.unitScrollView.off("scrolling")
const sv = this.unitScrollView.getComponent(cc.ScrollView);
this.unitScrollView.off("scrolling");
sv.scrollToTop();
content.destroyAllChildren();
this.isDestory = true;
this.lastUpdate = 0;
......@@ -134,7 +136,6 @@ export default class UnitPageClass extends PageComponentBaseClass {
})
}
async initTitle() {
const titleLabelNode = cc.find("bg/bg_title/label", this.node);
const titleLabel = titleLabelNode.getComponent(cc.Label);
......
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