|
@@ -5,7 +5,6 @@ cc.Class({
|
|
properties: {
|
|
properties: {
|
|
|
|
|
|
content: cc.Node,
|
|
content: cc.Node,
|
|
- myNode: cc.Node,
|
|
|
|
|
|
|
|
allRankSpriteFrame: [cc.SpriteFrame],
|
|
allRankSpriteFrame: [cc.SpriteFrame],
|
|
friendRankSpriteFrame: [cc.SpriteFrame],
|
|
friendRankSpriteFrame: [cc.SpriteFrame],
|
|
@@ -39,7 +38,9 @@ cc.Class({
|
|
},
|
|
},
|
|
|
|
|
|
allRankSelected() {
|
|
allRankSelected() {
|
|
-
|
|
|
|
|
|
+ if (this.loading) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
// this.allRankTab.node.x = 480;
|
|
// this.allRankTab.node.x = 480;
|
|
// this.friendRankTab.node.x = 496;
|
|
// this.friendRankTab.node.x = 496;
|
|
this.allRankTab.node.zIndex = 99;
|
|
this.allRankTab.node.zIndex = 99;
|
|
@@ -53,6 +54,9 @@ cc.Class({
|
|
},
|
|
},
|
|
|
|
|
|
friendRankSelected() {
|
|
friendRankSelected() {
|
|
|
|
+ if (this.loading) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
// this.allRankTab.node.x = 496;
|
|
// this.allRankTab.node.x = 496;
|
|
// this.friendRankTab.node.x = 480;
|
|
// this.friendRankTab.node.x = 480;
|
|
this.allRankTab.node.zIndex = 0;
|
|
this.allRankTab.node.zIndex = 0;
|
|
@@ -67,20 +71,16 @@ cc.Class({
|
|
|
|
|
|
companyTabSelected() {
|
|
companyTabSelected() {
|
|
this.secondTab = 0;
|
|
this.secondTab = 0;
|
|
- this.companyTab.spriteFrame = this.secondTabSpriteFrame[1];
|
|
|
|
- this.artistTab.spriteFrame = this.secondTabSpriteFrame[0];
|
|
|
|
- this.setSelectedText(this.companyText, '经济公司');
|
|
|
|
- this.setDefaultText(this.artistText, '艺人');
|
|
|
|
|
|
+ this.companyTab.spriteFrame = this.secondTabSpriteFrame[0];
|
|
|
|
+ this.artistTab.spriteFrame = null;
|
|
this.companySrcollView.node.active = true;
|
|
this.companySrcollView.node.active = true;
|
|
this.artistSrcollView.node.active = false;
|
|
this.artistSrcollView.node.active = false;
|
|
},
|
|
},
|
|
|
|
|
|
artistTabSelected() {
|
|
artistTabSelected() {
|
|
this.secondTab = 1;
|
|
this.secondTab = 1;
|
|
- this.companyTab.spriteFrame = this.secondTabSpriteFrame[0];
|
|
|
|
|
|
+ this.companyTab.spriteFrame = null;
|
|
this.artistTab.spriteFrame = this.secondTabSpriteFrame[1];
|
|
this.artistTab.spriteFrame = this.secondTabSpriteFrame[1];
|
|
- this.setDefaultText(this.companyText, '经济公司');
|
|
|
|
- this.setSelectedText(this.artistText, '艺人');
|
|
|
|
this.companySrcollView.node.active = false;
|
|
this.companySrcollView.node.active = false;
|
|
this.artistSrcollView.node.active = true;
|
|
this.artistSrcollView.node.active = true;
|
|
},
|
|
},
|
|
@@ -100,6 +100,7 @@ cc.Class({
|
|
},
|
|
},
|
|
|
|
|
|
close() {
|
|
close() {
|
|
|
|
+ this.loading = false;
|
|
if (this.node && this.node.parent) {
|
|
if (this.node && this.node.parent) {
|
|
let self = this;
|
|
let self = this;
|
|
let finish = cc.callFunc(() => {
|
|
let finish = cc.callFunc(() => {
|
|
@@ -110,6 +111,7 @@ cc.Class({
|
|
},
|
|
},
|
|
|
|
|
|
getData() {
|
|
getData() {
|
|
|
|
+ this.loading = true;
|
|
let promise = null;
|
|
let promise = null;
|
|
this.companySrcollView.getComponent('RankListWithAdapter').setLoading();
|
|
this.companySrcollView.getComponent('RankListWithAdapter').setLoading();
|
|
if (this.currentTab === 0) {
|
|
if (this.currentTab === 0) {
|
|
@@ -122,8 +124,10 @@ cc.Class({
|
|
this.data = res.data;
|
|
this.data = res.data;
|
|
this.companySrcollView.getComponent('RankListWithAdapter').bindData(this.data.companyRank);
|
|
this.companySrcollView.getComponent('RankListWithAdapter').bindData(this.data.companyRank);
|
|
this.artistSrcollView.getComponent('RankListWithAdapter').bindData(this.data.artistRank);
|
|
this.artistSrcollView.getComponent('RankListWithAdapter').bindData(this.data.artistRank);
|
|
|
|
+ this.loading = false;
|
|
}).catch((code, msg) => {
|
|
}).catch((code, msg) => {
|
|
console.log(code)
|
|
console.log(code)
|
|
|
|
+ this.loading = false;
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
|