MoreGame.ts 1.5 KB

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