Files
biz_firstpage/src/main/ets/util/RouterUtil.ets
T
clz af0025ce38 Initial commit: @b2c/first_page HarmonyOS stage-mode HAR
## Repository
- HarmonyOS stage-mode HAR module, consumed by host app
- No standalone build — hvigorw, oh_modules, and ../biz_quote absent here

## Architecture
### Feed Cards
- FirstPage.createNodeView dispatches cards by FirstPageConstant.KEY_*
- Card config from first_page_cards_config.json loaded by FirstPageCardsConfigLoader
- Public entrypoint: Index.ets

### Market Ranking (src/main/ets/market-ranking/)
- HTTP: MarketRankingDataFetcher fetches recommend_futures contracts
- HQ: MarketRankingHqRequestClient subscribes via 4106/frame 2201/scenario qht_qihuo_sort
- TCP reconnect rebuilds subscription from original HTTP contract list
- Async callbacks guarded by request/subscription versions

### Other Cards
- HotList, CommodityOptions, AiDiagnosis, AiRiseFall, SelfSelectedStock, CustomEntryList, FourEntryList
- Each has DataFetcher + HQ request client + NodeComponent

## Key Changes (from CardHarmonyOS reference)
- Added MetricId, PeriodId, SortOrder enums (MarketRankingModels.ets)
- Replaced string comparisons with enum switches in thirdColumnTitle/Value/Color
- Removed redundant undefined guards in thirdColumnColor/priceColor, delegated to riseFallColor
- Inlined priceColor(), use riseFallColor directly
- Tab bar Stack.height(30), Alignment.End (reverted from 46/TopEnd)
- Name column fontWeight removed (default regular)
2026-07-26 01:13:28 +08:00

36 lines
1.4 KiB
Plaintext

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))
}
}
}
}