From b94bf994654e4e0924ac87032b27fa0d22870ec0 Mon Sep 17 00:00:00 2001 From: handongxun Date: Thu, 15 Oct 2020 19:07:57 +0800 Subject: [PATCH] =?UTF-8?q?ad:=20=E5=85=A8=E5=B1=8F=E8=A7=86=E9=A2=91?= =?UTF-8?q?=EF=BC=8C=E7=A7=BB=E9=99=A4=E5=88=9B=E5=BB=BA=E5=AE=9E=E4=BE=8B?= =?UTF-8?q?=E5=90=8E=E8=87=AA=E5=8A=A8=E5=8A=A0=E8=BD=BD=E5=92=8C=E5=AE=8C?= =?UTF-8?q?=E6=88=90=E5=90=8E=E9=A2=84=E8=BD=BD=E9=80=BB=E8=BE=91=EF=BC=8C?= =?UTF-8?q?=E9=81=BF=E5=85=8D=E6=95=B0=E6=8D=AE=E8=BF=87=E6=9C=9F=E5=92=8C?= =?UTF-8?q?=E8=AF=B7=E6=B1=82=E5=90=8E=E4=B8=8D=E5=B1=95=E7=A4=BA=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/api/ad/full-screen-video-ad.js | 25 +++---------------- 1 file changed, 3 insertions(+), 22 deletions(-) diff --git a/src/platforms/app-plus/service/api/ad/full-screen-video-ad.js b/src/platforms/app-plus/service/api/ad/full-screen-video-ad.js index b10d7bccc..c3d9e9c8c 100644 --- a/src/platforms/app-plus/service/api/ad/full-screen-video-ad.js +++ b/src/platforms/app-plus/service/api/ad/full-screen-video-ad.js @@ -4,11 +4,6 @@ const eventNames = [ 'error' ] -const ERROR_CODE_LIST = [-5001, -5002, -5003, -5004, -5005, -5006] -const EXPIRED_TIME = 1000 * 60 * 30 -const EXPIRED_TEXT = { code: -5008, errMsg: '广告数据已过期,请重新加载' } -const ProviderType = { CSJ: 'csj', GDT: 'gdt' } - class FullScreenVideoAd { constructor (options = {}) { const _callbacks = this._callbacks = {} @@ -38,6 +33,7 @@ class FullScreenVideoAd { } }) ad.onClose((e) => { + this._isLoad = false this._dispatchEvent('close', { isEnded: e.isEnded }) }) ad.onError((e) => { @@ -48,18 +44,12 @@ class FullScreenVideoAd { this._isLoad = false } this._dispatchEvent('error', data) - // TODO - if ((code === -5005 || ERROR_CODE_LIST.index(code) === -1) && this._loadPromiseReject != null) { + + if (this._loadPromiseReject != null) { this._loadPromiseReject(data) this._loadPromiseReject = null } }) - - this._loadAd() - } - - get isExpired () { - return (this._lastLoadTime !== 0 && (Math.abs(Date.now() - this._lastLoadTime) > EXPIRED_TIME)) } load () { @@ -76,15 +66,6 @@ class FullScreenVideoAd { show () { return new Promise((resolve, reject) => { - const provider = this.getProvider() - if (provider === ProviderType.CSJ && this.isExpired) { - this._isLoad = false - // TODO - this._dispatchEvent('error', EXPIRED_TEXT) - reject(new Error(EXPIRED_TEXT.errMsg)) - return - } - if (this._isLoad) { this._ad.show() resolve() -- GitLab