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)
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
/**
|
||||
* AI 看涨跌接口响应
|
||||
*/
|
||||
export interface AiRiseFallResponse {
|
||||
code: number
|
||||
msg: string
|
||||
data: AiRiseFallData
|
||||
}
|
||||
|
||||
/**
|
||||
* AI 看涨跌数据
|
||||
*/
|
||||
export interface AiRiseFallData {
|
||||
date: string // 日期 "2026-06-01"
|
||||
last_trade_date_accuracy: string // 昨日正确率 "66.7"
|
||||
last_twenty_trade_date_accuracy: string // 近20日正确率 "66.4"
|
||||
rise: RiseFallListData // 看涨列表
|
||||
fall: RiseFallListData // 看跌列表
|
||||
}
|
||||
|
||||
/**
|
||||
* 看涨/看跌列表数据
|
||||
*/
|
||||
export interface RiseFallListData {
|
||||
count: number
|
||||
data: RiseFallItem[]
|
||||
}
|
||||
|
||||
/**
|
||||
* 看涨/看跌项
|
||||
*/
|
||||
export interface RiseFallItem {
|
||||
variety: string // 品种代码 "SA"
|
||||
name: string // 合约名称 "纯碱2609"
|
||||
contract: string // 合约代码 "SA2609"
|
||||
market: string // 市场代码 "67"
|
||||
forecast: number // 预测方向 0=看涨, 1=看跌
|
||||
accuracy: string // 品种正确率 "80.0"
|
||||
show_quote: number // 是否显示行情 1=显示
|
||||
}
|
||||
|
||||
/**
|
||||
* 合约行情数据(用于行情订阅)
|
||||
*/
|
||||
export interface ContractHqData {
|
||||
contract: string
|
||||
market: string
|
||||
name: string
|
||||
priceChg: number | null // 涨跌幅,null 表示待开盘
|
||||
}
|
||||
Reference in New Issue
Block a user