MoreGame.ts 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. }
  17. update() {
  18. if (gData.moreGame.init_moreGameList) {
  19. this.initView();
  20. }
  21. }
  22. lateUpdate() {
  23. gData.moreGame.init_moreGameList = false;
  24. }
  25. initView() {
  26. this.normalDatas = gData.moreGame.moreGameList.normal;
  27. let data = [];
  28. let len = this.normalDatas.length;
  29. for (var i = 0; i < len; i++) {
  30. let pfbType = 0;
  31. let obj = {
  32. item_data: this.normalDatas[i],
  33. pfbType: pfbType
  34. }
  35. data.push(obj);
  36. if (i == 1) {
  37. pfbType = 1;
  38. let obj = {
  39. item_data: gData.moreGame.moreGameList.banner,
  40. pfbType: pfbType
  41. }
  42. data.push(obj);
  43. }
  44. }
  45. this.node_sv.emit('srollview-init', data)
  46. }
  47. onClickClose() {
  48. mk.ad.checkShowInterByChance();
  49. }
  50. }