Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xiaoxiaole
Project
Project
Details
Activity
Releases
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
wildfirecode13
xiaoxiaole
Commits
544c681a
Commit
544c681a
authored
May 25, 2020
by
zjz1994
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
webview适配暂存
parent
4b9598e3
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
11 deletions
+12
-11
WebView.ts
egret/src/webview/WebView.ts
+10
-9
advert.json
mock/happyclear/advert.json
+2
-2
No files found.
egret/src/webview/WebView.ts
View file @
544c681a
...
...
@@ -50,9 +50,10 @@ export default class WebView extends egret.DisplayObjectContainer {
var
matrixdata1
=
matrixdata
[
1
].
split
(
")"
)[
0
];
var
matrixdata2
=
matrixdata1
.
split
(
","
);
console
.
log
(
"缩放详细"
,
matrixdata2
);
var
scaleX
=
Number
(
matrixdata2
[
0
]);
var
scaleY
=
Number
(
matrixdata2
[
3
]);
var
mscaleX
=
Number
(
matrixdata2
[
0
]);
var
mscaleY
=
Number
(
matrixdata2
[
3
]);
var
tscaleX
=
Number
((
1
/
mscaleX
).
toFixed
(
2
));
var
tscaleY
=
Number
((
1
/
mscaleY
).
toFixed
(
2
));
var
body
=
document
.
body
;
// stageDelegateDom.style.width="100%";
// stageDelegateDom.style.height="100%";
...
...
@@ -89,8 +90,8 @@ export default class WebView extends egret.DisplayObjectContainer {
console
.
log
(
"webview长短屏幕适配"
,
whl
,
islongScreen
);
this
.
_iframe
.
width
=
this
.
_iframeWrapper
.
style
.
width
=
body
.
clientWidth
*
3
+
"px"
;
this
.
_iframe
.
height
=
this
.
_iframeWrapper
.
style
.
height
=
body
.
clientHeight
*
3
+
"px"
;
this
.
_iframe
.
width
=
this
.
_iframeWrapper
.
style
.
width
=
body
.
clientWidth
*
tscaleX
+
"px"
;
this
.
_iframe
.
height
=
this
.
_iframeWrapper
.
style
.
height
=
body
.
clientHeight
*
tscaleY
+
"px"
;
// this._iframe.width = this._iframeWrapper.style.width = this._windowW+"px";
// this._iframe.height = this._iframeWrapper.style.height = this._windowH+"px";
...
...
@@ -98,11 +99,11 @@ export default class WebView extends egret.DisplayObjectContainer {
this
.
closebtn
.
src
=
"http://yun.duiba.com.cn/aurora/assets/571906f5a3b59d6e654e6522c916ed1707231551.png"
;
this
.
closebtn
.
style
.
position
=
"absolute"
;
this
.
closebtn
.
style
.
top
=
"100
px"
;
this
.
closebtn
.
style
.
right
=
"100
px"
;
this
.
closebtn
.
style
.
top
=
30
*
tscaleX
+
"
px"
;
this
.
closebtn
.
style
.
right
=
30
*
tscaleY
+
"
px"
;
this
.
_iframeWrapper
.
append
(
this
.
closebtn
);
this
.
closebtn
.
style
.
width
=
"150
px"
;
this
.
closebtn
.
style
.
height
=
"150
px"
;
this
.
closebtn
.
style
.
width
=
50
*
tscaleX
+
"
px"
;
this
.
closebtn
.
style
.
height
=
50
*
tscaleY
+
"
px"
;
this
.
closebtn
.
addEventListener
(
"click"
,
this
.
clickCloseBtn
.
bind
(
this
),
false
);
}
...
...
mock/happyclear/advert.json
View file @
544c681a
...
...
@@ -35,11 +35,11 @@
"advertList"
:[
{
"img"
:
"http://yun.dui88.com/images/201909/lsh4tdkp5n.jpg"
,
"url"
:
"https://cuxiao.
m.suning.com/scms/BECHEERY.html?adTypeCode=1137&adId=https%3A%2F%2Flib.suning.com%2Fweex%2FBECHEERY.js%3FpageCode%3DBECHEERY%26adtype%3D
3"
"url"
:
"https://cuxiao.
suning.com/city/nubia.html?adtype=
3"
},
{
"img"
:
"http://yun.dui88.com/images/201909/lsh4tdkp5n.jpg"
,
"url"
:
"https://cuxiao.
m.suning.com/scms/BECHEERY.html?adTypeCode=1137&adId=https%3A%2F%2Flib.suning.com%2Fweex%2FBECHEERY.js%3FpageCode%3DBECHEERY%26adtype%3D
3"
"url"
:
"https://cuxiao.
suning.com/city/nubia.html?adtype=
3"
}
]
}
...
...
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