Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
llewan-weixin-sdk
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
llewan
llewan-weixin-sdk
Commits
ad7b4738
Commit
ad7b4738
authored
Dec 05, 2018
by
liuxinjun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
视频广告多次注册事件问题
parent
f4111a1a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
ad_sdk.js
assets/llewan-weixin-sdk/ad_sdk.js
+12
-0
No files found.
assets/llewan-weixin-sdk/ad_sdk.js
View file @
ad7b4738
...
@@ -9,6 +9,7 @@ var adSdk = {
...
@@ -9,6 +9,7 @@ var adSdk = {
bannerAd
:
null
,
bannerAd
:
null
,
isOnce
:
true
,
videoAd
:
null
,
videoAd
:
null
,
videoAd1
:
null
,
videoAd1
:
null
,
videoAd2
:
null
,
videoAd2
:
null
,
...
@@ -136,7 +137,12 @@ var adSdk = {
...
@@ -136,7 +137,12 @@ var adSdk = {
createRewardedVideoAd
(
index
,
videoAdUnitId1
)
{
createRewardedVideoAd
(
index
,
videoAdUnitId1
)
{
let
self
=
this
;
let
self
=
this
;
if
(
cc
.
sys
.
platform
===
cc
.
sys
.
WECHAT_GAME
)
{
if
(
cc
.
sys
.
platform
===
cc
.
sys
.
WECHAT_GAME
)
{
let
videoAd
=
wx
.
createRewardedVideoAd
({
adUnitId
:
videoAdUnitId1
})
let
videoAd
=
wx
.
createRewardedVideoAd
({
adUnitId
:
videoAdUnitId1
})
if
(
self
.
isOnce
)
{
self
.
isOnce
=
false
;
videoAd
.
onLoad
(
function
(
res
)
{
videoAd
.
onLoad
(
function
(
res
)
{
console
.
log
(
"sdk VideoAd广告加载事件:"
,
res
)
console
.
log
(
"sdk VideoAd广告加载事件:"
,
res
)
});
});
...
@@ -157,10 +163,16 @@ var adSdk = {
...
@@ -157,10 +163,16 @@ var adSdk = {
videoAd
.
onClose
(
closeFun1
);
videoAd
.
onClose
(
closeFun1
);
videoAd
.
onError
(
function
(
res
)
{
videoAd
.
onError
(
function
(
res
)
{
wx
.
showToast
({
title
:
'今日视频已上限,明日再来!'
,
icon
:
'none'
});
if
(
self
.
videoError
)
{
if
(
self
.
videoError
)
{
self
.
videoError
();
self
.
videoError
();
}
}
});
});
}
if
(
index
==
1
)
{
if
(
index
==
1
)
{
this
.
videoAd1
=
videoAd
;
this
.
videoAd1
=
videoAd
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment