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
f4111a1a
Commit
f4111a1a
authored
Nov 30, 2018
by
liuxinjun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改广告ad_sdk.js中的变量规范
parent
f2fc3a2c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
21 deletions
+21
-21
ad_sdk.js
assets/llewan-weixin-sdk/ad_sdk.js
+21
-21
No files found.
assets/llewan-weixin-sdk/ad_sdk.js
View file @
f4111a1a
...
@@ -7,9 +7,9 @@ var sdk = require("sdk");
...
@@ -7,9 +7,9 @@ var sdk = require("sdk");
var
adSdk
=
{
var
adSdk
=
{
B
annerAd
:
null
,
b
annerAd
:
null
,
V
ideoAd
:
null
,
v
ideoAd
:
null
,
videoAd1
:
null
,
videoAd1
:
null
,
videoAd2
:
null
,
videoAd2
:
null
,
videoAd3
:
null
,
videoAd3
:
null
,
...
@@ -42,22 +42,22 @@ var adSdk = {
...
@@ -42,22 +42,22 @@ var adSdk = {
*/
*/
createVideoAd
(
index
,
videoAdUnitId
)
{
createVideoAd
(
index
,
videoAdUnitId
)
{
if
(
index
==
1
)
{
if
(
index
==
1
)
{
if
(
this
.
V
ideoAd1
)
{
if
(
this
.
v
ideoAd1
)
{
return
this
.
V
ideoAd1
;
return
this
.
v
ideoAd1
;
}
}
}
else
if
(
index
==
2
)
{
}
else
if
(
index
==
2
)
{
if
(
this
.
V
ideoAd2
)
{
if
(
this
.
v
ideoAd2
)
{
return
this
.
V
ideoAd2
;
return
this
.
v
ideoAd2
;
}
}
}
else
if
(
index
==
3
)
{
}
else
if
(
index
==
3
)
{
if
(
this
.
V
ideoAd3
)
{
if
(
this
.
v
ideoAd3
)
{
return
this
.
V
ideoAd3
;
return
this
.
v
ideoAd3
;
}
}
}
}
else
{
else
{
if
(
this
.
V
ideoAd
)
{
if
(
this
.
v
ideoAd
)
{
return
this
.
V
ideoAd
;
return
this
.
v
ideoAd
;
}
}
}
}
return
adSdk
.
createRewardedVideoAd
(
index
,
videoAdUnitId
);
return
adSdk
.
createRewardedVideoAd
(
index
,
videoAdUnitId
);
...
@@ -71,7 +71,7 @@ var adSdk = {
...
@@ -71,7 +71,7 @@ var adSdk = {
* @param {string} bannerAdUnitId
* @param {string} bannerAdUnitId
* 多个banner广告id调用如下:
* 多个banner广告id调用如下:
* adSdk.createBannerAdByAdId({},bannerAdUnitId).destroy();
* adSdk.createBannerAdByAdId({},bannerAdUnitId).destroy();
* adSdk.
B
annerAd =null;
* adSdk.
b
annerAd =null;
* var bannerAd =adSdk.createBannerAdByAdId({},bannerAdUnitId2);
* var bannerAd =adSdk.createBannerAdByAdId({},bannerAdUnitId2);
* bannerAd.show();
* bannerAd.show();
*
*
...
@@ -80,8 +80,8 @@ var adSdk = {
...
@@ -80,8 +80,8 @@ var adSdk = {
createBannerAdByAdId
(
obj
,
bannerAdUnitId
){
createBannerAdByAdId
(
obj
,
bannerAdUnitId
){
var
self
=
this
;
var
self
=
this
;
if
(
cc
.
sys
.
platform
===
cc
.
sys
.
WECHAT_GAME
)
{
if
(
cc
.
sys
.
platform
===
cc
.
sys
.
WECHAT_GAME
)
{
if
(
this
.
B
annerAd
){
if
(
this
.
b
annerAd
){
return
this
.
B
annerAd
;
return
this
.
b
annerAd
;
}
else
{
}
else
{
if
(
!
obj
.
style
){
if
(
!
obj
.
style
){
obj
.
style
=
{};
obj
.
style
=
{};
...
@@ -92,23 +92,23 @@ var adSdk = {
...
@@ -92,23 +92,23 @@ var adSdk = {
obj
.
style
.
top
=
0
;
obj
.
style
.
top
=
0
;
obj
.
style
.
width
=
300
;
obj
.
style
.
width
=
300
;
}
}
this
.
B
annerAd
=
wx
.
createBannerAd
({
this
.
b
annerAd
=
wx
.
createBannerAd
({
adUnitId
:
bannerAdUnitId
,
adUnitId
:
bannerAdUnitId
,
style
:
obj
.
style
,
style
:
obj
.
style
,
})
})
this
.
B
annerAd
.
onResize
(
function
(
res
){
this
.
b
annerAd
.
onResize
(
function
(
res
){
console
.
log
(
"sdk BannerAd广告缩放事件:"
,
res
)
console
.
log
(
"sdk BannerAd广告缩放事件:"
,
res
)
self
.
BannerAd
.
style
.
left
=
self
.
w
-
self
.
B
annerAd
.
style
.
realWidth
/
2
+
0.1
;
self
.
bannerAd
.
style
.
left
=
self
.
w
-
self
.
b
annerAd
.
style
.
realWidth
/
2
+
0.1
;
self
.
BannerAd
.
style
.
top
=
self
.
h
-
self
.
B
annerAd
.
style
.
realHeight
+
0.1
;
self
.
bannerAd
.
style
.
top
=
self
.
h
-
self
.
b
annerAd
.
style
.
realHeight
+
0.1
;
});
});
this
.
B
annerAd
.
onLoad
(
function
(
res
){
this
.
b
annerAd
.
onLoad
(
function
(
res
){
console
.
log
(
"sdk BannerAd广告加载事件:"
,
res
)
console
.
log
(
"sdk BannerAd广告加载事件:"
,
res
)
});
});
this
.
B
annerAd
.
onError
(
function
(
res
){
this
.
b
annerAd
.
onError
(
function
(
res
){
console
.
log
(
"sdk BannerAd广告错误事件:"
,
res
)
console
.
log
(
"sdk BannerAd广告错误事件:"
,
res
)
});
});
return
this
.
B
annerAd
;
return
this
.
b
annerAd
;
}
}
}
}
},
},
...
@@ -172,7 +172,7 @@ var adSdk = {
...
@@ -172,7 +172,7 @@ var adSdk = {
this
.
videoAd3
=
videoAd
;
this
.
videoAd3
=
videoAd
;
}
}
else
{
else
{
this
.
V
ideoAd
=
videoAd
;
this
.
v
ideoAd
=
videoAd
;
}
}
return
videoAd
;
return
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