ClubPersonalInfoPre.js 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. cc.Class({
  2. extends: cc.BaseClass,
  3. properties: {
  4. },
  5. InitPre:function(){
  6. if(this.m_LbCnt1 == null) this.m_LbCnt1 = this.$('Cnt1@Label');
  7. if(this.m_LbCnt2 == null) this.m_LbCnt2 = this.$('Cnt2@Label');
  8. if(this.m_LbCnt3 == null) this.m_LbCnt3 = this.$('Cnt3@Label');
  9. if(this.m_LbCnt4 == null) this.m_LbCnt4 = this.$('Cnt4@Label');
  10. this.node.active = false;
  11. },
  12. SetPreInfo:function(ParaArr){//[i+1,Res[i][0],Res[i][1], RandType]); index userid cnt type
  13. switch(ParaArr[1][1]){
  14. case 0:this.OnShowGameInfor(ParaArr[1][0]);return;
  15. case 1:this.OnShowScoreInfor(ParaArr[1][0]);return;
  16. case 2:this.OnShowRevenceInfor(ParaArr[1][0]);return;
  17. case 3:this.OnShowRoomInfor(ParaArr[1][0]);return;
  18. default:return;
  19. }
  20. },
  21. OnShowGameInfor:function(arr){
  22. this.m_LbCnt1.string = arr[1];
  23. this.m_LbCnt2.string = Score2Str(parseInt(arr[0]));
  24. this.m_LbCnt3.string = arr[2].replace(/ /,'\n');
  25. this.node.active = true;
  26. },
  27. OnShowScoreInfor:function(arr){
  28. this.m_LbCnt1.string = arr[2]>0?'贈送':'撤銷';
  29. var strLv = '';
  30. if(arr[1]==CLUB_LEVEL_OWNER){
  31. strLv = '老闆';
  32. }else if(arr[1]==CLUB_LEVEL_MANAGER){
  33. strLv = '管理員';
  34. }
  35. else if(arr[1]==CLUB_LEVEL_PARTNER){
  36. strLv = '合夥人';
  37. }
  38. else if(arr[1]==CLUB_LEVEL_MEMBER){
  39. strLv = '會員';
  40. }
  41. this.m_LbCnt2.string = strLv;
  42. this.m_LbCnt3.string = Score2Str(parseInt(arr[2]));
  43. this.m_LbCnt4.string = arr[3].replace(/ /,'\n');
  44. this.node.active = true;
  45. },
  46. OnShowRevenceInfor:function(arr){
  47. this.m_LbCnt1.string = arr[0];
  48. this.m_LbCnt2.string = Score2Str(parseInt(arr[1]));
  49. this.m_LbCnt3.string = arr[2].replace(/ /,'\n');
  50. this.node.active = true;
  51. },
  52. OnShowRoomInfor:function(arr){
  53. this.m_LbCnt1.string = arr[1];
  54. this.m_LbCnt2.string = arr[0];
  55. this.m_LbCnt3.string = arr[3];
  56. this.m_LbCnt4.string = arr[2];
  57. this.node.active = true;
  58. },
  59. // update (dt) {},
  60. });