ClubPersonalInfo.js 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. cc.Class({
  2. extends: cc.BaseClass,
  3. properties: {
  4. },
  5. ctor:function(){
  6. this.m_bNeedUpdate = false;
  7. this._day = 0;
  8. },
  9. OnShowView:function(){
  10. },
  11. OnSetBaseInfo:function(dwUserID){
  12. // this.$('BGB/LeaderID@Label').string = '888888';
  13. this.m_bNeedUpdate = true;
  14. this.m_dwUserID = dwUserID;
  15. var webUrl = window.PHP_HOME+ '/League.php?&GetMark=132&dwClubID='+this.m_Hook.m_Hook.m_SelClubInfo.dwClubID;
  16. webUrl += '&dwUserID='+this.m_dwUserID;
  17. WebCenter.GetData(webUrl, null, function (data) {
  18. var Res = JSON.parse(data);
  19. if(!Res['LeaderID'] ){
  20. var pGlobalUserData = g_GlobalUserInfo.GetGlobalUserData();
  21. this.$('BGB/LeaderID@Label').string =pGlobalUserData.dwGameID;
  22. }else{
  23. this.$('BGB/LeaderID@Label').string = Res['LeaderID'];
  24. }
  25. }.bind(this));
  26. this.ShowPrefabDLG('FilterNode',this.node,function(Js){
  27. this._filter = Js;
  28. this._filter.SetMode(FILTER_MENU_PAGE|FILTER_MENU_DAY,function(o){
  29. this._day = o.d;
  30. this._page = o.p;
  31. this.m_bNeedUpdate = true;
  32. }.bind(this),cc.Vec2(510,-330));
  33. }.bind(this));
  34. },
  35. OnToggleClick:function(Tag){
  36. this._page = 1;
  37. this._totalPage = 1;
  38. this.m_bNeedUpdate = true;
  39. },
  40. update:function(){
  41. if( this.m_bNeedUpdate ){
  42. this.m_bNeedUpdate = false;
  43. }else{
  44. return;
  45. }
  46. for(var i=0;i<4;i++){
  47. this.$(`${i}`).active = false;
  48. }
  49. var RandType = 0;
  50. for(var i=0;i<4;i++){
  51. if(this.$('BGB/Type/'+i+'@Toggle').isChecked) RandType = i;
  52. }
  53. this.$(`${RandType}`).active = true;
  54. if(this.m_ListCtrl == null) this.m_ListCtrl = this.$('@CustomListCtrl');
  55. this.m_ListCtrl.InitList(RandType, 'ClubPersonalInfoPre');
  56. var webUrl = '';
  57. //上下分日志
  58. if(RandType == 0){
  59. webUrl = window.PHP_HOME+ '/League.php?GetMark=108&ClubID='+this.m_Hook.m_Hook.m_SelClubInfo.dwClubID+'&dwUserID='+this.m_dwUserID;
  60. }else if(RandType == 1){
  61. webUrl = window.PHP_HOME+ '/League.php?GetMark=111&ClubID='+this.m_Hook.m_Hook.m_SelClubInfo.dwClubID+'&dwUserID='+this.m_dwUserID;
  62. }else if(RandType == 2){
  63. webUrl = window.PHP_HOME+ '/League.php?GetMark=110&dwUserID='+this.m_dwUserID+'&ClubID='+this.m_Hook.m_Hook.m_SelClubInfo.dwClubID;
  64. }
  65. else if(RandType == 3){
  66. webUrl = window.PHP_HOME+ '/League.php?GetMark=109&dwUserID='+this.m_dwUserID+'&ClubID='+this.m_Hook.m_Hook.m_SelClubInfo.dwClubID;
  67. }
  68. else{
  69. webUrl = window.PHP_HOME+ '/League.php?&GetMark=8&ClubID='+this.m_Hook.m_SelClubInfo.dwClubID;
  70. webUrl += '&RandType='+1+'&TimeType='+0;
  71. }
  72. if(RandType < 3){
  73. webUrl += `&start=${(this._page - 1) * window.PAGE_ITEM_CNT + 1}`;
  74. webUrl += `&end=${(this._page) * window.PAGE_ITEM_CNT}`;
  75. webUrl += `&day=${this._day}`;
  76. }
  77. WebCenter.GetData(webUrl, null, function (data) {
  78. var Res = JSON.parse(data);
  79. if (RandType == 3) {
  80. this.m_ListCtrl.InsertListInfo(RandType, [0,[Res, RandType]]);
  81. }else
  82. {
  83. if (Res.length > 0) {
  84. this._totalPage = Math.ceil(Res[0][5] / window.PAGE_ITEM_CNT);
  85. }else{
  86. this._totalPage = 1;
  87. }
  88. this._filter.SetPageTotalCnt(this._totalPage,this._page);
  89. var inforArr = [];
  90. for(var i=0;i<Res.length;i++){
  91. inforArr.push([Res[i], RandType]);
  92. //this.m_ListCtrl.InsertListInfo(RandType, [Res[i], RandType]);
  93. }
  94. this.m_ListCtrl.InsertListInfoArr(RandType,inforArr);
  95. }
  96. }.bind(this));
  97. },
  98. });