Commit Graph

6 Commits

Author SHA1 Message Date
clz 499b0846d7 fix(market-ranking): 行点击增加item.market null guard,防止undefined时crash 2026-07-28 13:47:05 +08:00
clz d5ca2ba23f fix(market-ranking): 最新价格式化与涨跌色对齐商品期权
- 去掉 formatPrice 的 .toFixed(2),改为直接显示原始数值
- 平盘/无值颜色从 price_even 改为 elements_text_primary_02,与商品期权 getPriceColor 逻辑一致
2026-07-28 11:16:43 +08:00
clz f57a0c3ebb fix card gradients and AI Pick tag alignment
Use a theme-qualified tab gradient start color in both AI Pick and market ranking so the fade no longer introduces a white tint in dark mode.

Add light and dark resource variants, and wrap AI Pick strategy tags in a fixed-height centered container while preserving single-line ellipsis behavior.
2026-07-27 19:34:13 +08:00
clz 30d9154086 fix market ranking state and quote rendering 2026-07-27 15:19:28 +08:00
clz 5af37bfa51 fix market ranking display fallbacks 2026-07-27 10:31:22 +08:00
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