| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- import { _decorator, Component, Node } from 'cc';
- import { Http } from './core/net/Http';
- import { g } from './Data/g';
- const { ccclass, property } = _decorator;
- @ccclass('ADLog')
- export class ADLog extends Component {
- @property({ type: Http })
- public http: Http;
- update() {
- if (g.adData.interstitalADShow) {
- g.adData.ad_type = 2;
- g.adData.interstitalADShow = false;
- //视频上报
- this.http.send("/api/ad/videoLog", { adData: g.adData });
- }
- if (g.adData.nativeExpressADShow) {
- g.adData.ad_type = 3;
- g.adData.nativeExpressADShow = false;
- //视频上报
- this.http.send("/api/ad/videoLog", { adData: g.adData });
- }
- if (g.adData.splashADShow) {
- g.adData.ad_type = 6;
- g.adData.splashADShow = false;
- //视频上报
- this.http.send("/api/ad/videoLog", { adData: g.adData });
- }
- if (g.adData.bannerADShow) {
- g.adData.ad_type = 7;
- g.adData.bannerADShow = false;
- //视频上报
- this.http.send("/api/ad/videoLog", { adData: g.adData });
- }
- if (g.adData.fullScreenADComplete) {
- g.adData.ad_type = 8;
- g.adData.fullScreenADComplete = false;
- //视频上报
- this.http.send("/api/ad/videoLog", { adData: g.adData });
- }
- if (g.adData.fullScreenADShow) {
- g.adData.ad_type = 9;
- g.adData.fullScreenADShow = false;
- //视频上报
- this.http.send("/api/ad/videoLog", { adData: g.adData });
- }
- if (g.adData.fullScreenADError) {
- g.adData.ad_type = 10;
- g.adData.fullScreenADError = false;
- //视频上报
- this.http.send("/api/ad/videoLog", { adData: g.adData });
- }
- if (g.adData.interstitalADError) {
- g.adData.ad_type = 11;
- g.adData.interstitalADError = false;
- //视频上报
- this.http.send("/api/ad/videoLog", { adData: g.adData });
- }
- if (g.adData.nativeExpressADError) {
- g.adData.ad_type = 12;
- g.adData.nativeExpressADError = false;
- //视频上报
- this.http.send("/api/ad/videoLog", { adData: g.adData });
- }
- }
- }
|