import { _decorator, Component, Node, game } from 'cc'; import { Http } from './core/net/Http'; import { g } from './Data/g'; const { ccclass, property } = _decorator; @ccclass('VideoLog') export class VideoLog extends Component { start() { game.addPersistRootNode(this.node);//常驻节点 } update() { if (g.userData && g.adData.splashADShow && g.userData.id) {//开屏 g.adData.splashADShow = false; g.adData.ad_type = 6; //上报展示 this.node.addComponent(Http).send("/api/ad/videoLog", { adData: g.adData }); } } }