DreamMain.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. let ButtonSelect1 = require('ButtonSelect1')
  2. let ViewBase = require('ViewBase')
  3. cc.Class({
  4. extends: ViewBase,
  5. properties: {
  6. button1: {
  7. default: null,
  8. type: ButtonSelect1,
  9. serializable: true,
  10. },
  11. button2: {
  12. default: null,
  13. type: ButtonSelect1,
  14. serializable: true,
  15. },
  16. button3: {
  17. default: null,
  18. type: ButtonSelect1,
  19. serializable: true,
  20. },
  21. button4: {
  22. default: null,
  23. type: ButtonSelect1,
  24. serializable: true,
  25. },
  26. },
  27. onLoad () {
  28. self.buttons = [
  29. this.button1,
  30. this.button2,
  31. this.button3,
  32. this.button4,
  33. ];
  34. this.views = [
  35. {type:JMC.UIEnum.DreamMain, view:null, initing:false},
  36. {type:JMC.UIEnum.DreamMain, view:null, initing:false},
  37. {type:JMC.UIEnum.DreamMain, view:null, initing:false},
  38. {type:JMC.UIEnum.DreamMain, view:null, initing:false},
  39. ];
  40. this.curViewType = null
  41. this.onClickTitle(null, "0")
  42. },
  43. onClickTitle(event, customEventData) {
  44. let index = parseInt(customEventData)
  45. let viewType = this.views[index]
  46. this.curViewType = viewType;
  47. this.createOrShowView(this.curViewType)
  48. cc.log(G.CfgMgr.battleBoxAwardConfig.getByMultipleKey(2001, 10001));
  49. cc.log(G.CfgMgr.battleBoxConfig.getByMainKey(2001));
  50. },
  51. createOrShowView(type) {
  52. }
  53. // update (dt) {},
  54. });