添加scheme 调用
This commit is contained in:
@@ -7,6 +7,7 @@ import { BusinessError } from '@ohos.base';
|
||||
import { Log } from '@devwiki/base';
|
||||
import { BaseLocalStorage, ScreenUtil } from '@devwiki/base';
|
||||
import { HomeItem, HomeItemGroup } from '../model/Home';
|
||||
import { common, Want } from '@kit.AbilityKit';
|
||||
|
||||
|
||||
@Entry
|
||||
@@ -43,6 +44,13 @@ struct Index {
|
||||
items: [
|
||||
{ name: 'AVPlayer', page: 'pages/media/AVPlayerPage' },
|
||||
]
|
||||
},
|
||||
//系统能力
|
||||
{
|
||||
name: 'System',
|
||||
items: [
|
||||
{name: "Scheme", page: 'pages/system/SchemePage'}
|
||||
]
|
||||
}
|
||||
];
|
||||
|
||||
|
19
app/src/main/ets/pages/system/SchemePage.ets
Normal file
19
app/src/main/ets/pages/system/SchemePage.ets
Normal file
@@ -0,0 +1,19 @@
|
||||
import { common, Want } from '@kit.AbilityKit';
|
||||
|
||||
@Component
|
||||
@Entry
|
||||
export struct SchemePage {
|
||||
|
||||
|
||||
|
||||
build() {
|
||||
}
|
||||
|
||||
openHttp() {
|
||||
let context = getContext(this) as common.UIAbilityContext;
|
||||
let wantInfo: Want = {
|
||||
uri: 'https://devwiki.net'
|
||||
}
|
||||
context.startAbility(wantInfo);
|
||||
}
|
||||
}
|
@@ -18,6 +18,14 @@ export struct WebPage {
|
||||
onTitleBarRightClick(event: ClickEvent) {
|
||||
this.webViewController?.refresh();
|
||||
}
|
||||
|
||||
onBackPress(): boolean | void {
|
||||
if (this.webViewController?.accessBackward()) {
|
||||
this.webViewController?.backward();
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
build() {
|
||||
Column() {
|
||||
|
Reference in New Issue
Block a user