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
9fb49bf5
Commit
9fb49bf5
authored
Jan 03, 2019
by
liuxinjun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改ad_sdk的banner广告创建适配iphoneX
parent
01716855
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
3 deletions
+16
-3
README.md
README.md
+4
-0
ad_sdk.js
assets/llewan-weixin-sdk/ad_sdk.js
+12
-3
No files found.
README.md
View file @
9fb49bf5
...
...
@@ -323,5 +323,9 @@
3.23.1 修改createImage 增加回调处理图片加载缓存问题
#1.113
3.24.1 修改ad_sdk.js中的createBannerAdByAdId方法添加对iphoneX的适配
assets/llewan-weixin-sdk/ad_sdk.js
View file @
9fb49bf5
...
...
@@ -72,9 +72,11 @@ var adSdk = {
* @param {json} obj
* @param {string} bannerAdUnitId
* 多个banner广告id调用如下:(注意第一次调起不需要去做销毁destory)
*
* if(adSdk.bannerAd)
* {
* adSdk.createBannerAdByAdId({},bannerAdUnitId1).destroy();
* adSdk.bannerAd =null;
* }
* var bannerAd =adSdk.createBannerAdByAdId({},bannerAdUnitId2);
* bannerAd.show();
* //如果多个banner广告id(bannerAdUnitId)的情况,通过后台技术配置Config2获取对应的banner广告id,比如:sdk.getConfig2().bannerAdUnitId1 或者sdk.getConfig2().bannerAdUnitId2
...
...
@@ -89,11 +91,18 @@ var adSdk = {
if
(
!
obj
.
style
){
obj
.
style
=
{};
var
phone
=
wx
.
getSystemInfoSync
();
let
phoneModel
=
phone
.
model
;
this
.
w
=
phone
.
screenWidth
/
2
;
this
.
h
=
phone
.
screenHeight
;
obj
.
style
.
left
=
0
;
obj
.
style
.
top
=
0
;
obj
.
style
.
width
=
300
;
if
(
phoneModel
.
search
(
"iPhone X"
)
!=
-
1
){
//要处理的机型
obj
.
style
.
width
=
this
.
w
*
1.1
;
}
else
{
obj
.
style
.
width
=
this
.
w
*
1.71
;
}
//obj.style.width = 300;
}
this
.
bannerAd
=
wx
.
createBannerAd
({
adUnitId
:
bannerAdUnitId
,
...
...
@@ -102,7 +111,7 @@ var adSdk = {
this
.
bannerAd
.
onResize
(
function
(
res
){
console
.
log
(
"sdk BannerAd广告缩放事件:"
,
res
)
self
.
bannerAd
.
style
.
left
=
self
.
w
-
self
.
bannerAd
.
style
.
realWidth
/
2
+
0.1
;
self
.
bannerAd
.
style
.
top
=
self
.
h
-
self
.
bannerAd
.
style
.
realHeight
+
0.1
;
self
.
bannerAd
.
style
.
top
=
self
.
h
-
self
.
bannerAd
.
style
.
realHeight
-
0.05
;
});
this
.
bannerAd
.
onLoad
(
function
(
res
){
console
.
log
(
"sdk BannerAd广告加载事件:"
,
res
)
...
...
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