ClubRankDataInfoPre.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. cc.Class({
  2. extends: cc.BaseClass,
  3. properties: {
  4. },
  5. InitPre:function(){
  6. if(this.m_userCtrl == null)this.m_userCtrl = this.$('@UserCtrl')
  7. this.m_userCtrl.SetUserByID(0);
  8. if(this.m_LbCnt1 == null) this.m_LbCnt1 = this.$('Cnt1@Label');
  9. if(this.m_LbCnt2 == null) this.m_LbCnt2 = this.$('Cnt2@Label');
  10. if(this.m_LbCnt3 == null) this.m_LbCnt3 = this.$('Cnt3@Label');
  11. this.node.active = false;
  12. },
  13. SetPreInfo:function(ParaArr){//[i+1,Res[i][0],Res[i][1], RandType]); index userid cnt type
  14. switch(ParaArr[1][1]){
  15. case 0:this.OnShowGameInfor(ParaArr[1][0]);return;
  16. case 1:this.OnShowScoreInfor(ParaArr[1][0]);return;
  17. case 2:this.OnShowRevenceInfor(ParaArr[1][0]);return;
  18. case 3:this.OnShowRoomInfor(ParaArr[1][0]);return;
  19. default:return;
  20. }
  21. },
  22. OnShowGameInfor:function(arr){
  23. this.m_userCtrl.SetUserByID(arr[0]);
  24. this.m_LbCnt3.string = arr[1];
  25. this.node.active = true;
  26. },
  27. OnShowScoreInfor:function(arr){
  28. this.m_userCtrl.SetUserByID(arr[0]);
  29. this.m_LbCnt3.string = arr[1];
  30. this.node.active = true;
  31. },
  32. OnShowRevenceInfor:function(arr){
  33. this.m_userCtrl.SetUserByID(arr[0]);
  34. this.m_LbCnt3.string = Score2Str(parseInt(arr[1]));
  35. this.node.active = true;
  36. },
  37. OnShowRoomInfor:function(arr){
  38. this.m_userCtrl.SetUserByID(arr[0]);
  39. this.m_LbCnt3.string = Score2Str(parseInt(arr[1]));
  40. this.node.active = true;
  41. },
  42. // update (dt) {},
  43. });