import { HXLog, jumpToWebPage } from 'biz_common' import { StringUtils } from 'hxutil' import { landingPageRouteParam } from '../route' import { promptAction } from '@kit.ArkUI'; import { call } from '@kit.TelephonyKit'; import { BusinessError } from '@kit.BasicServicesKit'; export class RouterUtil { static jumpPage(url: string | null, fullscreen?: boolean) { if (url && StringUtils.isNotEmpty(url)) { if (url.startsWith('client.html')) { let protocolItems = url.split('^') for (let index = 0; index < protocolItems.length; index++) { const protocolItem = protocolItems[index] let urlKey = 'url' if (protocolItem.startsWith(urlKey)) { let jumpUrl = protocolItem.substring(urlKey.length + 1) if (jumpUrl.startsWith('http://') || jumpUrl.startsWith('https://')) { jumpToWebPage(landingPageRouteParam(url, jumpUrl, fullscreen)) return } } } promptAction.showToast({ message: '鸿蒙暂不支持' }) } else if (url.startsWith('tel://')) { call.makeCall(url).then(() => { HXLog.i("Telephony Service", "makeCallSuccess"); }).catch((err: BusinessError) => { HXLog.i("Telephony Service", "makeCallFailed with message " + err.message) }); } else { jumpToWebPage(landingPageRouteParam(url, url, fullscreen)) } } } }