ClubGameRuleSet.js 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. cc.Class({
  2. extends: cc.BaseClass,
  3. properties: {
  4. },
  5. OnShowView:function(){
  6. if(this.m_ListCtrl == null) this.m_ListCtrl = this.$('@CustomListCtrl');
  7. },
  8. OnBtModifyRoomRule:function(){
  9. this.m_Hook.m_Hook.m_Hook.OnModifyTableRule(this.m_Hook.m_RoomInfo);
  10. this.HideView();
  11. },
  12. OnBtDelTable:function(){
  13. this.m_Hook.OnBtClickDiss(this);
  14. },
  15. OnSetInof:function(Obj){
  16. this._RoomID = Obj.RoomNum;
  17. this.$('BtNode/BtModTable').active = g_ShowClubInfo && g_ShowClubInfo.cbClubLevel>=CLUB_LEVEL_MANAGER;
  18. this.$('BtNode/BtDelTable').active = g_ShowClubInfo && g_ShowClubInfo.cbClubLevel>=CLUB_LEVEL_MANAGER;
  19. this.$('Lab1@Label').string = Obj.GameName;
  20. this.$('Lab2@Label').string = Obj.RoomNum;
  21. this.$('Lab3@Label').string = Obj.GameRule;
  22. this.$('Lab4@Label').string = Obj.RoomRule;
  23. this.$('BtNode/BtAddAndroid').active = false;
  24. this.$('BtNode/BtEmpty').active = true;
  25. var webUrl = window.PHP_HOME+'/ClubAndroid.php?&GetMark=2&ClubID='+g_ShowClubInfo.dwClubID;
  26. webUrl += '&KindID='+this.m_Hook.m_RoomInfo.wKindID;
  27. WebCenter.GetData(webUrl, null, function (data) {
  28. var isAndroid = JSON.parse(data);
  29. if(isAndroid>0 && g_ShowClubInfo.cbClubLevel == CLUB_LEVEL_OWNER){
  30. this.$('BtNode/BtAddAndroid').active = true;
  31. this.$('BtNode/BtEmpty').active = false;
  32. }
  33. }.bind(this));
  34. this.m_ListCtrl.InitList(0,'ClubGameRuleSetUserItem',this);
  35. for(var i in this.m_Hook.m_Hook.m_RoomInfoMap.UserList.UserInfo){
  36. let userInfo = this.m_Hook.m_Hook.m_RoomInfoMap.UserList.UserInfo[i];
  37. if(userInfo.dwRoomID == this._RoomID){
  38. this.m_ListCtrl.InsertListInfo(0,[userInfo.dwUserID,userInfo.dwRoomID]);
  39. }
  40. }
  41. },
  42. OnBtAddAndroid:function(){
  43. this.ShowPrefabDLG('ClubAndroidCreat',this.node,function(Js){
  44. Js.OnSetInfo(this.m_Hook.m_RoomInfo);
  45. }.bind(this));
  46. },
  47. ResetUserItem:function(userInfo){
  48. this.m_ListCtrl.InitList(0,'ClubGameRuleSetUserItem',this);
  49. for(var i in this.m_Hook.m_Hook.m_RoomInfoMap.UserList.UserInfo){
  50. let userInfo = this.m_Hook.m_Hook.m_RoomInfoMap.UserList.UserInfo[i];
  51. if(userInfo.dwRoomID == this._RoomID){
  52. this.m_ListCtrl.InsertListInfo(0,[userInfo.dwUserID,userInfo.dwRoomID]);
  53. }
  54. }
  55. },
  56. // update (dt) {},
  57. });