Commit e898f71c authored by 李维's avatar 李维

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

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