VideoLog.ts 614 B

123456789101112131415161718192021
  1. import { _decorator, Component, Node, game } from 'cc';
  2. import { Http } from './core/net/Http';
  3. import { g } from './Data/g';
  4. const { ccclass, property } = _decorator;
  5. @ccclass('VideoLog')
  6. export class VideoLog extends Component {
  7. start() {
  8. game.addPersistRootNode(this.node);//常驻节点
  9. }
  10. update() {
  11. if (g.userData && g.adData.splashADShow && g.userData.id) {//开屏
  12. g.adData.splashADShow = false;
  13. g.adData.ad_type = 6;
  14. //上报展示
  15. this.node.addComponent(Http).send("/api/ad/videoLog", { adData: g.adData });
  16. }
  17. }
  18. }