当所有图片都点亮后,显示隐藏角色已开启
This commit is contained in:
parent
69c16702f6
commit
b380c70725
@ -67,7 +67,8 @@ cc.Class({
|
|||||||
logined: false,
|
logined: false,
|
||||||
mobile: '',
|
mobile: '',
|
||||||
images: [],
|
images: [],
|
||||||
uid: ''
|
uid: '',
|
||||||
|
allshow: false
|
||||||
},
|
},
|
||||||
|
|
||||||
// LIFE-CYCLE CALLBACKS:
|
// LIFE-CYCLE CALLBACKS:
|
||||||
@ -92,6 +93,7 @@ cc.Class({
|
|||||||
if (userRep.errcode === 0) {
|
if (userRep.errcode === 0) {
|
||||||
self.mobile = userRep.user.username;
|
self.mobile = userRep.user.username;
|
||||||
self.images = userRep.user.images;
|
self.images = userRep.user.images;
|
||||||
|
self.checkAllShow();
|
||||||
self.uid = userRep.user.uid;
|
self.uid = userRep.user.uid;
|
||||||
self.mainScrollContent.getComponent('scrollContent').updateUserName(stringUtil.parseMobile(self.mobile));
|
self.mainScrollContent.getComponent('scrollContent').updateUserName(stringUtil.parseMobile(self.mobile));
|
||||||
self.mainScrollContent.getComponent('scrollContent').updatePuzzle(self.images);
|
self.mainScrollContent.getComponent('scrollContent').updatePuzzle(self.images);
|
||||||
@ -213,6 +215,7 @@ cc.Class({
|
|||||||
self.logined = true;
|
self.logined = true;
|
||||||
self.mobile = rep.user.username;
|
self.mobile = rep.user.username;
|
||||||
self.images = rep.user.images;
|
self.images = rep.user.images;
|
||||||
|
self.checkAllShow();
|
||||||
self.uid = rep.user.uid;
|
self.uid = rep.user.uid;
|
||||||
self.mainScrollContent.getComponent('scrollContent').updateUserName(stringUtil.parseMobile(self.mobile));
|
self.mainScrollContent.getComponent('scrollContent').updateUserName(stringUtil.parseMobile(self.mobile));
|
||||||
self.mainScrollContent.getComponent('scrollContent').updatePuzzle(self.images);
|
self.mainScrollContent.getComponent('scrollContent').updatePuzzle(self.images);
|
||||||
@ -246,5 +249,15 @@ cc.Class({
|
|||||||
console.log(err);
|
console.log(err);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
checkAllShow() {
|
||||||
|
let result = 0;
|
||||||
|
for(let i of this.images) {
|
||||||
|
result += i;
|
||||||
|
}
|
||||||
|
this.allshow = result === 9;
|
||||||
|
if (this.allshow) {
|
||||||
|
this.mainScrollContent.getComponent('scrollContent').updateTipTxt('隐藏角色已开启');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -71,7 +71,11 @@ cc.Class({
|
|||||||
default: null,
|
default: null,
|
||||||
type: cc.Node
|
type: cc.Node
|
||||||
},
|
},
|
||||||
touchTarget: null
|
touchTarget: null,
|
||||||
|
tipLabel: {
|
||||||
|
default: null,
|
||||||
|
type: cc.Node
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// LIFE-CYCLE CALLBACKS:
|
// LIFE-CYCLE CALLBACKS:
|
||||||
@ -85,9 +89,9 @@ cc.Class({
|
|||||||
processBar.getComponent('progressBar').updateShow(50000);
|
processBar.getComponent('progressBar').updateShow(50000);
|
||||||
this.puzzle = cc.instantiate(this.puzzlePrefab);
|
this.puzzle = cc.instantiate(this.puzzlePrefab);
|
||||||
this.part2.addChild(this.puzzle);
|
this.part2.addChild(this.puzzle);
|
||||||
var tip = cc.instantiate(this.tipPrefab);
|
this.tipLabel = cc.instantiate(this.tipPrefab);
|
||||||
this.part2.addChild(tip);
|
this.part2.addChild(this.tipLabel);
|
||||||
tip.getComponent('inviteTip').setLabelTxt('xx接受了您的邀请');
|
|
||||||
var imageSwiper = cc.instantiate(this.imageSwiperPrefab);
|
var imageSwiper = cc.instantiate(this.imageSwiperPrefab);
|
||||||
this.part4.addChild(imageSwiper, 0);
|
this.part4.addChild(imageSwiper, 0);
|
||||||
var bottomSwiper = cc.instantiate(this.bottomSwiperPrefab);
|
var bottomSwiper = cc.instantiate(this.bottomSwiperPrefab);
|
||||||
@ -137,5 +141,8 @@ cc.Class({
|
|||||||
toggleLoginStatus(status) {
|
toggleLoginStatus(status) {
|
||||||
this.loginStatusLabel.node.active = status;
|
this.loginStatusLabel.node.active = status;
|
||||||
this.joinBtn.active = !status;
|
this.joinBtn.active = !status;
|
||||||
|
},
|
||||||
|
updateTipTxt(str) {
|
||||||
|
this.tipLabel.getComponent('inviteTip').setLabelTxt(str);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user