Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
4d615d46
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
大约 1 年 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
4d615d46
编写于
8月 25, 2022
作者:
X
xiongjun_gitee
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
xtsfixed_825
Signed-off-by:
N
xiongjun_gitee
<
xiongjun28@huawei.com
>
上级
4e0d27ac
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
32 addition
and
24 deletion
+32
-24
arkui/ace_ets_web_dev/entry/src/main/ets/MainAbility/pages/web.ets
..._ets_web_dev/entry/src/main/ets/MainAbility/pages/web.ets
+19
-17
arkui/ace_ets_web_dev/entry/src/main/ets/test/WebJsunit.test.ets
...ce_ets_web_dev/entry/src/main/ets/test/WebJsunit.test.ets
+1
-1
arkui/ace_ets_web_dev/entry/src/main/resources/rawfile/index.html
...e_ets_web_dev/entry/src/main/resources/rawfile/index.html
+11
-5
arkui/ace_ets_web_dev/entry/src/main/resources/rawfile/second.html
..._ets_web_dev/entry/src/main/resources/rawfile/second.html
+1
-1
未找到文件。
arkui/ace_ets_web_dev/entry/src/main/ets/MainAbility/pages/web.ets
浏览文件 @
4d615d46
...
...
@@ -59,7 +59,7 @@ struct Index {
},
toString:(str)=>{
console.info("ets toString:"+String(str));
}
}
,
register:(res)=>{
Utils.emitEvent(res,86);
return "web222"
...
...
@@ -76,8 +76,6 @@ struct Index {
build(){
Column(){
Web({src:$rawfile('index.html'),controller:this.controller})
.width('300px')
.height('300px')
.javaScriptAccess(this.javaScriptAccess)
.userAgent("Mozila/5.0 (Linux; Andriod 9; VRD-AL10; HMSCore 6.3.0.331) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.105 HuaweiBrowser/12.0.4.1 MobileSafari/537.36")
.javaScriptProxy({
...
...
@@ -124,7 +122,7 @@ struct Index {
this.alert = event.message
return false
})
.onCon
sole
((event) => {
.onCon
firm
((event) => {
this.confirm = event.message
return false
})
...
...
@@ -357,7 +355,7 @@ struct Index {
setTimeout(()=>{
this.controller.zoom(2)
setTimeout(() => {
if(this.controller.getPageHeight() > 400){
if(this.controller.getPageHeight() >
1
400){
var zoomCalled = true
}
Utils.emitEvent(zoomCalled,77)
...
...
@@ -366,9 +364,11 @@ struct Index {
break;
}
case "emitZoomOut":{
this.controller.loadUrl({url:"file:///data/storage/el1/bundle/phone/resources/rawfile/second.html"})
setTimeout(()=>{
let zoomOutCalled = this.controller.zoomOut()
this.controller.zoomOut()
setTimeout(()=>{
if(this.controller.getPageHeight() < 1500){
var zoomOutCalled = true
}
Utils.emitEvent(zoomOutCalled,78)
},3000)
break;
...
...
@@ -377,7 +377,7 @@ struct Index {
this.controller.zoomIn()
setTimeout(()=>{
var zoomInCalled = false
if(this.controller.getPageHeight() >
3
00){
if(this.controller.getPageHeight() >
14
00){
zoomInCalled = true
}
Utils.emitEvent(zoomInCalled,79)
...
...
@@ -425,7 +425,7 @@ struct Index {
this.controller.zoomOut()
setTimeout(()=>{
var onInactiveCalled = false
if(this.controller.getPageHeight
> 400'
){
if(this.controller.getPageHeight
() < 2600
){
onInactiveCalled = true
}
Utils.emitEvent(onInactiveCalled,84)
...
...
@@ -462,13 +462,15 @@ struct Index {
}
case "emitJavaScriptAccess":{
this.javaScriptAccess = false
this.controller.runJavaScript({script:"registerTest()"})
setTimeout(()=>{
if(this.console !== "web222"){
let javaScriptAccessCalled = true
Utils.emitEvent(javaScriptAccessCalled,88)
}
},3000)
setTimeout(() => {
this.controller.runJavaScript({script:"jsAccess()"})
setTimeout(()=>{
if(this.console !== "web111"){
let javaScriptAccessCalled = true
Utils.emitEvent(javaScriptAccessCalled,88)
}
},3000)
},3000)
break;
}
case "emitGetCookieManager":{
...
...
arkui/ace_ets_web_dev/entry/src/main/ets/test/WebJsunit.test.ets
浏览文件 @
4d615d46
...
...
@@ -447,7 +447,7 @@ export default function webJsunit() {
*tc.desic Registers the JavaScript object and method list
*/
it('registerJavaScriptProxy',0,async function(done){
emitKey="emitDelete
EntireCookie
";
emitKey="emitDelete
JavaScriptRegister
";
Utils.registerEvent("registerJavaScriptProxy","backToEts",86,done);
sendEventByKey('webcomponent',10,'');
})
...
...
arkui/ace_ets_web_dev/entry/src/main/resources/rawfile/index.html
浏览文件 @
4d615d46
...
...
@@ -12,10 +12,8 @@
</style>
</head>
<body>
<div
style=
"width: 300px;height: 300px;background-color: #999999;"
>
<div
id=
"container"
>
首页
</div>
<div
id=
"pageHeight"
></div>
</div>
<div
id=
"container"
>
首页
</div>
<div
id=
"pageHeight"
></div>
</body>
<script>
function
getUserAgent
(){
...
...
@@ -32,7 +30,15 @@
return
height
}
function
proxy
(){
backToEts
.
register
(
"
backToEts
"
)
objName
.
register
(
"
backToEts
"
)
}
function
registerTest
(){
let
str
=
objName
.
register
();
console
.
log
(
str
);
return
str
}
function
jsAccess
(){
console
.
log
(
"
web111
"
)
}
function
consoleTest
(){
console
.
log
(
"
console test
"
)
...
...
arkui/ace_ets_web_dev/entry/src/main/resources/rawfile/second.html
浏览文件 @
4d615d46
...
...
@@ -7,6 +7,6 @@
<title>
second
</title>
</head>
<body>
<div
style=
"
width: 300px;height:
300px;background-color: #999999;"
>
second pages
</div>
<div
style=
"
height: 1
300px;background-color: #999999;"
>
second pages
</div>
</body>
</html>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录