Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
zhangbo1_wd
2024-04-23 18:25:34 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
307e0a20e378af84b4d49d85fd354c6e79df9d2b
307e0a20
1 parent
33e2d1d7
新增外链跳转方法
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
1 deletions
sight_harmony/commons/wdKit/src/main/ets/utils/ResourcesUtils.ets
sight_harmony/commons/wdRouter/src/main/ets/utils/ProcessUtils.ets
sight_harmony/commons/wdKit/src/main/ets/utils/ResourcesUtils.ets
View file @
307e0a2
...
...
@@ -26,7 +26,7 @@ export class ResourcesUtils {
try {
let text = buffer.from(content).toString("utf8");
if (text) {
Logger.info(TAG, "getResourcesText then text:" + text);
//
Logger.info(TAG, "getResourcesText then text:" + text);
success(text);
} else {
Logger.warn(TAG, "getResourcesText then text is empty");
...
...
sight_harmony/commons/wdRouter/src/main/ets/utils/ProcessUtils.ets
View file @
307e0a2
...
...
@@ -4,6 +4,8 @@ import { Logger } from 'wdKit';
import { StringUtils } from 'wdKit/src/main/ets/utils/StringUtils';
import { WDRouterRule } from '../router/WDRouterRule';
import { ContentConstants } from 'wdConstant';
import { common, Want } from '@kit.AbilityKit';
import { BusinessError } from '@kit.BasicServicesKit';
// import { LiveModel } from '../viewmodel/LiveModel';
...
...
@@ -214,3 +216,21 @@ export class ProcessUtils {
Logger.debug(TAG, `gotoAtlasDetailPage, ${content.objectId}`);
}
}
/**
* 打开外链
* @param url 外链地址
*/
public static jumpExternalWebPage(url: string) {
let context = getContext() as common.UIAbilityContext;
let wantInfo: Want = {
action: 'ohos.want.action.viewData',
entities: ['entity.system.browsable'],
uri: url
}
context.startAbility(wantInfo).then(() => {
Logger.debug(TAG, 'jumpExternalWebPage success')
}).catch((err: BusinessError) => {
Logger.error(TAG, 'jumpExternalWebPage success, error: ' + JSON.stringify(err))
})
}
}
...
...
Please
register
or
login
to post a comment