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:
clz
2026-07-26 01:10:20 +08:00
commit af0025ce38
137 changed files with 13358 additions and 0 deletions
@@ -0,0 +1,96 @@
/**
* author : liuqingliang@myhexin.com
* time : created on 2026/6/2
* desc : 首页模块公共常量
*/
// cbas相关
export const CBAS_SPLIT_DIAN = "."
export const CBAS_SERVE_PAGE_ROBOT = "robot"
export const CBAS_PREFIX_SHOUYE = "newshouye"
export const CBAS_FIRST_PAGE_TOP_FUNCT = "topFunc"
export const CBAS_FIRST_PAGE_TOP_BANNER = "topBanner"
export const CBAS_FIRST_PAGE_USER_CENTER = "userCenter"
export const CBAS_FIRST_PAGE_BOTTOM_FUNCT = "bottom"
export const WEB_RESOURCES_ID = "free_per_login"
export const CBAS_FIRST_PAGE_NOT_LOGIN = "weidenglu"
export const CBAS_FIRST_PAGE_MESSAGE = "message"
export const CBAS_SEARCH = "search"
export const CBAS_SHOW = "show"
export const CBAS_CLICK = "click"
export const CBAS_BOTTOM_MANAGE = "pageManage"
export const CBAS_BOTTOM_FEED_BACK = "feedback"
/**
* 首页运营广告 CBAS 前缀
*/
export const CBAS_FIRST_PAGE_PREFIX = "newshouye"
/**
* 广告 CBAS object 前缀
*/
export const CBAS_OBJECT_PREFIX_AD = "ad"
/**
* Banner 点击 CBAS 数字部分(无点号后缀),配合 sendStandardJumpPageCbas 使用
*/
export const CBAS_CLICK_BANNER_NO_DOT = "1"
/**
* WebView 页面 frameId,对齐 Android FRAME_ID_COMMON_BROWSER
*/
export const FRAME_ID_COMMON_BROWSER = "web"
/**
* 点击操作
*/
export const AD_CLICK_TYPE_INVALIDE: number = -1
export const ACTION_OPERATE_TYPE_CLICK = 1
export const AD_TYPE_INVALID = ""
export const AD_CLICK_TYPE_UNINTEREST = 0
export const AD_CLICK_TYPE_INTEREST = 1
// 广告操作类型
/***广告显示 */
export const AD_OPERATION_SHOW = 1
/***广告点击 */
export const AD_OPERATION_CLICK = 2
/***广告请求错误 */
export const AD_OPERATION_ERROR = 3
/*** 广告手动轮播 */
export const AD_OPERATION_SWITCH = 4
/*** 广告自动轮播 */
export const AD_OPERATION_AUTO = 5
/*** 首页运营广告 */
export const AD_LOCATION_YUNYING_SHOUYE = "indexFeedYunYing"
export const CBAS_FIRSTPAGE_PREFIX = '_tanchuangad.%s.'
export const CBAS_FIRSTPAGE_TANGCHUANGAD_BAOGUANG = 'baoguang.ad%s'
export const CBAS_FIRSTPAGE_TANGCHUANGAD_CLOSE = 'close.ad%s'
export const CBAS_FIRSTPAGE_TANGCHUANGAD_DIANJI = "_tanchuangad.dianji.ad%s"; //弹窗广告
@@ -0,0 +1,12 @@
/**
* author : liuqingliang@myhexin.com
* time : created on 2026/6/12
* desc : 首页五段式埋点常量
*/
export class FirstPageFiveCBASConstants {
static CBAS_BANNER_LOGMAP_ADID = 'adId'
// ========== OID常量 ==========
static CBAS_SHOUYE_BANNER = 'qht_qhtshouye_Banner_banner'
static CBAS_ADS_POPUP = 'qht_xuanfuqiu_fuchuang_FloatingWindow'
}