ClubRevenueList&Pre.js 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. cc.Class({
  2. extends: cc.BaseClass,
  3. properties: {
  4. },
  5. ctor:function () {
  6. },
  7. OnUpdateList:function (LeaderID, ClubID) {
  8. this.m_ClubID=ClubID;
  9. this.m_LeaderID=LeaderID;
  10. this.m_YYDSum = 0;
  11. this.m_YDSum = 0;
  12. this.m_TDSum = 0;
  13. this.OnDateSum(0,0,0);
  14. if(this.m_ListCtrl == null) this.m_ListCtrl = this.node.getComponent('CustomListCtrl');
  15. this.m_ListCtrl.InitList(0, 'ClubRevenueList&Pre', this);
  16. g_Lobby.ShowLoading();
  17. var webUrl = window.PHP_HOME+'/League.php?&GetMark=37&dwLeaderID='+LeaderID+'&ClubID='+ClubID;
  18. WebCenter.GetData(webUrl, 3, function (data) {
  19. g_Lobby.StopLoading();
  20. var UserArr = JSON.parse(data);
  21. for(var i in UserArr) this.m_ListCtrl.InsertListInfo(0, UserArr[i]);
  22. }.bind(this));
  23. },
  24. OnDateSum:function (YYd,YD,Td) {
  25. this.m_YYDSum += parseInt(YYd);
  26. this.m_YDSum += parseInt(YD);
  27. this.m_TDSum += parseInt(Td);
  28. this.$('BGM/YYD@Label').string = '前日總和:'+ this.m_YYDSum ;
  29. this.$('BGM/YD@Label').string = '昨日總和:'+ this.m_YDSum ;
  30. this.$('BGM/TD@Label').string = '今日總和:'+ this.m_TDSum ;
  31. },
  32. /////////////////////////////////////////////////////////////////////////////
  33. //Pre js
  34. InitPre:function(){
  35. if(this.m_UserCtrl == null) this.m_UserCtrl = this.node.getComponent("UserCtrl");
  36. this.m_UserCtrl.SetUserByID(0);
  37. this.$('LbYYS@Label').string = 0;
  38. this.$('LbYS@Label').string = 0;
  39. this.$('LbTS@Label').string = 0;
  40. },
  41. SetPreInfo:function(Para){
  42. this.m_UserCtrl.SetUserByID(Para);
  43. var webUrl = window.PHP_HOME+'/League.php?GetMark=38&dwUserID='+Para;
  44. webUrl+='&ClubID='+this.m_Hook.m_ClubID+'&LeaderID='+this.m_Hook.m_LeaderID;
  45. WebCenter.GetData(webUrl, 3, function (data) {
  46. var UserData = JSON.parse(data);
  47. this.$('LbYYS@Label').string = UserData[0];
  48. this.$('LbYS@Label').string = UserData[1];
  49. this.$('LbTS@Label').string = UserData[2];
  50. this.m_Hook.OnDateSum(UserData[0], UserData[1], UserData[2]);
  51. }.bind(this));
  52. },
  53. /////////////////////////////////////////////////////////////////////////////
  54. });