SelectGameMatch.js 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. var SelGame = window.clientName + '_C_G'
  2. cc.Class({
  3. extends: cc.BaseClass,
  4. properties: {
  5. m_ldiamond: cc.Label,
  6. },
  7. ctor: function () {
  8. this.m_RoomType = 0;// 0普通 1俱乐部
  9. this.m_personIndex = 1;
  10. this.m_playMethod = 0;
  11. },
  12. onLoad: function () {
  13. this._Sub = [];
  14. this._Sub.push(this.$('NewNode/Sub1'));
  15. // this._Sub.push(this.$('NewNode/Sub2'));
  16. // this._Sub.push(this.$('NewNode/Sub3'));
  17. this.updateDiamond()
  18. },
  19. OnShowView: function () {
  20. if (this.m_FirstCtrl == null) {
  21. this.m_FirstCtrl = this.$('LeftBG/Layout/T0@Toggle');
  22. this.m_FirstCtrl.isChecked = false;
  23. this.m_FirstCtrl.check();
  24. }
  25. return
  26. },
  27. OnSetRoomType: function (type) {
  28. this.m_RoomType = type;
  29. this.FilterGame(type);
  30. },
  31. FilterGame: function (type) {
  32. // this.$('NewNode/Sub2/view/content/63500').active = type>0;
  33. },
  34. OnTogClick: function (tag, data) {
  35. // console.log('data:'+data);
  36. // for(let i =0;i<3;i++){
  37. // this._Sub[i].active = false;
  38. // }
  39. // this._Sub[data].active = true;
  40. },
  41. onClickPlayMethod: function (data, tag) {
  42. console.log("点击玩法", tag)
  43. this.m_playMethod = tag;
  44. },
  45. OnClickButtonPerson: function (data, tag) {
  46. console.log("点击Person", tag)
  47. this.m_personIndex = tag;
  48. },
  49. OnClickButtonMatch: function (data, tag) {
  50. console.log("点击data", tag)
  51. this.m_Hook.matchRoom(this.m_personIndex, tag,this.m_playMethod)
  52. // this.ShowPrefabDLG('CreateRoom2',null,(Js)=>{
  53. // Js.OnSetGameID(tag.currentTarget.name);
  54. // Js.OnClubAutoView(this.m_RoomType);
  55. // });
  56. },
  57. OnCreateRoom: function (KindID, dwRules, dwServerRules, Name) {
  58. this.m_Hook.OnCreateRoom(KindID, dwRules, dwServerRules, Name, 0, 0);
  59. this.HideView();
  60. },
  61. updateDiamond: function () {
  62. let diamond = g_GlobalUserInfo.GetGlobalUserData().llUserIngot;
  63. this.m_ldiamond.string = diamond;
  64. },
  65. });