MoreGame.ts 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /**
  2. * @description 互推界面
  3. * @author kaka
  4. */
  5. const { ccclass, property } = cc._decorator;
  6. @ccclass
  7. export default class MoreGame extends cc.Component {
  8. @property(cc.Node)
  9. node_sv: cc.Node = null;
  10. @property(cc.Prefab)
  11. moreGameNormalNode: cc.Prefab = null
  12. private normalDatas = null
  13. start() {
  14. this.node.setContentSize(cc.winSize)
  15. gData.moreGame.init();
  16. gData.gameData.popTableScreenADLogic(11);
  17. }
  18. update() {
  19. if (gData.moreGame.init_moreGameList) {
  20. this.initView();
  21. }
  22. }
  23. lateUpdate() {
  24. gData.moreGame.init_moreGameList = false;
  25. }
  26. initView() {
  27. this.normalDatas = gData.moreGame.moreGameList.normal;
  28. let data = [];
  29. let len = this.normalDatas.length;
  30. for (var i = 0; i < len; i++) {
  31. let pfbType = 0;
  32. let obj = {
  33. item_data: this.normalDatas[i],
  34. pfbType: pfbType
  35. }
  36. data.push(obj);
  37. if (i == 1) {
  38. pfbType = 1;
  39. let obj = {
  40. item_data: gData.moreGame.moreGameList.banner,
  41. pfbType: pfbType
  42. }
  43. data.push(obj);
  44. }
  45. }
  46. this.node_sv.emit('srollview-init', data)
  47. }
  48. onClickClose() {
  49. }
  50. }