# HarmonyOS_tool **Repository Path**: xtxiaolu/harmony-os_tool ## Basic Information - **Project Name**: HarmonyOS_tool - **Description**: 鸿蒙工具类总结 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2024-07-22 - **Last Updated**: 2025-04-08 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README I EventBus: 触发事件 showLoading I Request config 显示正常 I AxiosRequest 请求方法: post I AxiosRequest 请求链接: 显示正常 I AxiosRequest Params: {"versionCode":"670","cate_id":"10771"} I AxiosRequest data: undefined I AxiosRequest 加载中... I EventBus: 触发事件 showLoading E Dlopen absolute pathname: /system/lib64/libnet_bundle_utils.z.so E Dlopen absolute pathname: /system/lib64/libnet_bundle_utils.z.so E [bundle_mgr_proxy.cpp(GetBigString:4492)]host reply ErrCode : 8521232 E [network_security_config.cpp:322]Failed to get json from bundler manager. E [network_security_config.cpp:68]Fail to get NetworkSecurityConfig I [window_scene_session_impl.cpp] ConsumePointerEventInner<555>: InputTracking id:5397, windowId:166, pointId:0, sourceType:2, pointPos:[286, 211], winRect:[0, 0, 1260, 2720], needNotifyEvent:1 I [http_response.cpp 49] HEAD: HTTP/1.1 200 OK I [http_exec.cpp 389] taskid=-2147483648, size:0, dns:7.693, connect:15.620, tls:61.658, firstSend:0.100, firstRecv:311.545, total:397.491, redirect:0.000 I AxiosRequest 加载完成... I EventBus: 触发事件 showLoading I AxiosRequest 响应Response: 响应数据正常 I EventBus: 触发事件 hideLoading W 54:~WorkerThread:58 WorkerThread enter destruction W 58:~WorkerThread:58 WorkerThread enter destruction W 62:~WorkerThread:58 WorkerThread enter destruction ``` @State list: ListEntity[] = [] controller: RefreshController = new RefreshController() @State showFooter: boolean = false; @State showErrorLayout: boolean = false; @State showEmptyLayout: boolean = false; @State showLoadingLayout: boolean = true; RefreshListLayout({ items: $list, controller: this.controller, showErrorLayout: this.showErrorLayout, showEmptyLayout: this.showEmptyLayout, showLoadingLayout: this.showLoadingLayout, itemLayout: (item: object, index: number) => { this.itemLayout(item as ListEntity, index) }, getList: (page): void => { getLiveNewsList(CommonConstants.COMMERCE_LIVE_CATE_ID, CommonConstants.VERSION_CODE, page) .then((res) => { if (res.code === 2000) { if (page === 1) { this.list = []; // 清空列表 this.showLoadingLayout = false; } const dataList: ListEntity[] = page === 1 ? res.data.list : res.data; if (Array.isArray(dataList) && dataList.length > 0) { this.list = page === 1 ? dataList : [...this.list, ...dataList]; this.showFooter = (this.list.length < 10) this.controller.finishLoadMore(this.list.length < 10); } else { this.showEmptyLayout = (page === 1); this.controller.finishLoadMore(true); this.showFooter = true } // 确保错误布局在成功时不显示 this.showErrorLayout = false } else { this.showErrorLayout = true this.showLoadingLayout = false; } }) } }) // 新闻直播列表 export const getLiveNewsList = (cate_id:string,versionCode:number,page:number) =>{ // return axiosAPIRequest.post({url:'appAPI/index.php?act=news&op=getCatePageList', // params:{ // "cate_id":cate_id, // "versionCode":versionCode, // "page":page // }}) if(page === 1){ return AxiosRequest.post>({ url: ApiBaseUrl.API_BASE_URL + ApiConfig.API_LIVE_LIST, params: { "cate_id": cate_id, "versionCode": versionCode, "page": page }, headers: undefined, showLoading: false, isPullUp: true }) } else { return AxiosRequest.post>({ url: ApiBaseUrl.API_BASE_URL + ApiConfig.API_LIVE_LIST, params: { "cate_id": cate_id, "versionCode": versionCode, "page": page }, headers: undefined, showLoading: false, isPullUp: true }) } } ```