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