Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool
Showing
17 changed files
with
702 additions
and
80 deletions
| @@ -19,30 +19,36 @@ export class HttpBizUtil { | @@ -19,30 +19,36 @@ export class HttpBizUtil { | ||
| 19 | * @param headers 请求header参数 | 19 | * @param headers 请求header参数 |
| 20 | * @returns 返回值 | 20 | * @returns 返回值 |
| 21 | */ | 21 | */ |
| 22 | - static get<T = string>(url: string, headers?: HashMap<string, string>): Promise<ResponseDTO<T>> { | ||
| 23 | - return new Promise<ResponseDTO<T>>((success, debug) => { | ||
| 24 | - WDHttp.get<ResponseDTO<T>>(url, headers).then((resDTO: ResponseDTO<T>) => { | ||
| 25 | - Logger.debug(TAG, 'get: ' + resDTO.code) | ||
| 26 | - Logger.debug(TAG, 'get: ' + resDTO.message) | ||
| 27 | - // 403:临时token;406:强制下线、封禁、清空登录信息还要跳转登录页面 | ||
| 28 | - if (resDTO.code == 403 || resDTO.code == 406) { | ||
| 29 | - HttpBizUtil.refreshToken().then((token: string) => { | ||
| 30 | - if (headers) { | ||
| 31 | - headers.replace('RMRB-X-TOKEN', token) | ||
| 32 | - headers.replace('cookie', 'RMRB-X-TOKEN=' + token) | ||
| 33 | - } | ||
| 34 | - Logger.debug(TAG, 'get again send: ' + token) | ||
| 35 | - // refreshToken为空场景不处理,直接请求接口。 | ||
| 36 | - WDHttp.get<ResponseDTO<T>>(url, headers).then((resDTO: ResponseDTO<T>) => { | ||
| 37 | - Logger.debug(TAG, 'get again: ' + resDTO.message) | ||
| 38 | - success(resDTO) | ||
| 39 | - }).catch((res: object) => { | ||
| 40 | - debug(res) | ||
| 41 | - }) | ||
| 42 | - }); | ||
| 43 | - } else { | ||
| 44 | - success(resDTO) | 22 | + static get<T = ResponseDTO<string>>(url: string, headers?: HashMap<string, string>): Promise<T> { |
| 23 | + return new Promise<T>((success, debug) => { | ||
| 24 | + WDHttp.get<T>(url, headers).then((originalRes: T) => { | ||
| 25 | + try { | ||
| 26 | + let resDTO = originalRes as ResponseDTO | ||
| 27 | + Logger.debug(TAG, 'get: ' + resDTO.code) | ||
| 28 | + Logger.debug(TAG, 'get: ' + resDTO.message) | ||
| 29 | + // 403:临时token;406:强制下线、封禁、清空登录信息还要跳转登录页面 | ||
| 30 | + if (resDTO.code == 403 || resDTO.code == 406) { | ||
| 31 | + HttpBizUtil.refreshToken().then((token: string) => { | ||
| 32 | + if (headers) { | ||
| 33 | + headers.replace('RMRB-X-TOKEN', token) | ||
| 34 | + headers.replace('cookie', 'RMRB-X-TOKEN=' + token) | ||
| 35 | + } | ||
| 36 | + Logger.debug(TAG, 'get again send: ' + token) | ||
| 37 | + // refreshToken为空场景不处理,直接请求接口。 | ||
| 38 | + WDHttp.get<T>(url, headers).then((againResDTO: T) => { | ||
| 39 | + Logger.debug(TAG, 'get again: ' + againResDTO) | ||
| 40 | + success(againResDTO) | ||
| 41 | + }).catch((res: object) => { | ||
| 42 | + debug(res) | ||
| 43 | + }) | ||
| 44 | + }); | ||
| 45 | + } else { | ||
| 46 | + success(originalRes) | ||
| 47 | + } | ||
| 48 | + } catch (e) { | ||
| 49 | + debug(originalRes) | ||
| 45 | } | 50 | } |
| 51 | + | ||
| 46 | }).catch((res: object) => { | 52 | }).catch((res: object) => { |
| 47 | debug(res) | 53 | debug(res) |
| 48 | }) | 54 | }) |
| @@ -56,27 +62,32 @@ export class HttpBizUtil { | @@ -56,27 +62,32 @@ export class HttpBizUtil { | ||
| 56 | * @param headers 请求header参数 | 62 | * @param headers 请求header参数 |
| 57 | * @returns 返回值 | 63 | * @returns 返回值 |
| 58 | */ | 64 | */ |
| 59 | - static post<T = string>(url: string, data?: object, headers?: HashMap<string, string>): Promise<ResponseDTO<T>> { | ||
| 60 | - return new Promise<ResponseDTO<T>>((success, debug) => { | ||
| 61 | - WDHttp.post<ResponseDTO<T>>(url, data, headers).then((resDTO: ResponseDTO<T>) => { | ||
| 62 | - Logger.debug(TAG, 'post: ' + resDTO.code) | ||
| 63 | - Logger.debug(TAG, 'post: ' + resDTO.message) | ||
| 64 | - // 403:临时token;406:强制下线、封禁、清空登录信息还要跳转登录页面 | ||
| 65 | - if (resDTO.code == 403 || resDTO.code == 406) { | ||
| 66 | - HttpBizUtil.refreshToken().then((token: string) => { | ||
| 67 | - if (headers) { | ||
| 68 | - headers.replace('RMRB-X-TOKEN', token) | ||
| 69 | - headers.replace('cookie', 'RMRB-X-TOKEN=' + token) | ||
| 70 | - } | ||
| 71 | - // refreshToken为空场景不处理,直接请求接口。 | ||
| 72 | - WDHttp.post<ResponseDTO<T>>(url, headers).then((resDTO: ResponseDTO<T>) => { | ||
| 73 | - success(resDTO) | ||
| 74 | - }).catch((res: object) => { | ||
| 75 | - debug(res) | ||
| 76 | - }) | ||
| 77 | - }); | ||
| 78 | - } else { | ||
| 79 | - success(resDTO) | 65 | + static post<T = ResponseDTO<string>>(url: string, data?: object, headers?: HashMap<string, string>): Promise<T> { |
| 66 | + return new Promise<T>((success, debug) => { | ||
| 67 | + WDHttp.post<T>(url, data, headers).then((originalRes: T) => { | ||
| 68 | + try { | ||
| 69 | + let resDTO = originalRes as ResponseDTO | ||
| 70 | + Logger.debug(TAG, 'post: ' + resDTO.code) | ||
| 71 | + Logger.debug(TAG, 'post: ' + resDTO.message) | ||
| 72 | + // 403:临时token;406:强制下线、封禁、清空登录信息还要跳转登录页面 | ||
| 73 | + if (resDTO.code == 403 || resDTO.code == 406) { | ||
| 74 | + HttpBizUtil.refreshToken().then((token: string) => { | ||
| 75 | + if (headers) { | ||
| 76 | + headers.replace('RMRB-X-TOKEN', token) | ||
| 77 | + headers.replace('cookie', 'RMRB-X-TOKEN=' + token) | ||
| 78 | + } | ||
| 79 | + // refreshToken为空场景不处理,直接请求接口。 | ||
| 80 | + WDHttp.post<T>(url, headers).then((againResDTO: T) => { | ||
| 81 | + success(againResDTO) | ||
| 82 | + }).catch((res: object) => { | ||
| 83 | + debug(res) | ||
| 84 | + }) | ||
| 85 | + }); | ||
| 86 | + } else { | ||
| 87 | + success(originalRes) | ||
| 88 | + } | ||
| 89 | + } catch (e) { | ||
| 90 | + success(originalRes) | ||
| 80 | } | 91 | } |
| 81 | }).catch((res: object) => { | 92 | }).catch((res: object) => { |
| 82 | debug(res) | 93 | debug(res) |
| @@ -230,10 +230,9 @@ export class HttpUrlUtils { | @@ -230,10 +230,9 @@ export class HttpUrlUtils { | ||
| 230 | */ | 230 | */ |
| 231 | static readonly SEARCH_RESULT_COUNT_DATA_PATH: string = "/api/rmrb-search-api/zh/c/count?keyword="; | 231 | static readonly SEARCH_RESULT_COUNT_DATA_PATH: string = "/api/rmrb-search-api/zh/c/count?keyword="; |
| 232 | /** | 232 | /** |
| 233 | - * 搜索结果 显示list 详情 | ||
| 234 | - */ | 233 | + * 搜索结果 显示list 详情 |
| 234 | + */ | ||
| 235 | static readonly SEARCH_RESULT_LIST_DATA_PATH: string = "/api/rmrb-search-api/zh/c/search"; | 235 | static readonly SEARCH_RESULT_LIST_DATA_PATH: string = "/api/rmrb-search-api/zh/c/search"; |
| 236 | - | ||
| 237 | /** | 236 | /** |
| 238 | * 创作者详情接口 | 237 | * 创作者详情接口 |
| 239 | */ | 238 | */ |
| @@ -242,17 +241,14 @@ export class HttpUrlUtils { | @@ -242,17 +241,14 @@ export class HttpUrlUtils { | ||
| 242 | * 客态查询发布作品数量 | 241 | * 客态查询发布作品数量 |
| 243 | */ | 242 | */ |
| 244 | static readonly ARTICLE_COUNT_HOTS_DATA_PATH: string = "/api/rmrb-content-search/zh/c/article/count"; | 243 | static readonly ARTICLE_COUNT_HOTS_DATA_PATH: string = "/api/rmrb-content-search/zh/c/article/count"; |
| 245 | - | ||
| 246 | /** | 244 | /** |
| 247 | * 客户端 客态主页页面-获取作品-从发布库获取该创作者下 稿件列表 | 245 | * 客户端 客态主页页面-获取作品-从发布库获取该创作者下 稿件列表 |
| 248 | */ | 246 | */ |
| 249 | static readonly ARTICLE_LIST_HOTS_DATA_PATH: string = "/api/rmrb-content-search/zh/c/article/articleList"; | 247 | static readonly ARTICLE_LIST_HOTS_DATA_PATH: string = "/api/rmrb-content-search/zh/c/article/articleList"; |
| 250 | - | ||
| 251 | /** | 248 | /** |
| 252 | * 客户端 客态主页页面-获取影响力 | 249 | * 客户端 客态主页页面-获取影响力 |
| 253 | */ | 250 | */ |
| 254 | static readonly CREATOR_INFLUENCE_HOTS_DATA_PATH: string = "/api/rmrb-bigdata-bi/zh/c/stats/creator/influence/info"; | 251 | static readonly CREATOR_INFLUENCE_HOTS_DATA_PATH: string = "/api/rmrb-bigdata-bi/zh/c/stats/creator/influence/info"; |
| 255 | - | ||
| 256 | /** | 252 | /** |
| 257 | * 早晚报列表 | 253 | * 早晚报列表 |
| 258 | * 根据页面id获取页面楼层列表 | 254 | * 根据页面id获取页面楼层列表 |
| @@ -269,10 +265,14 @@ export class HttpUrlUtils { | @@ -269,10 +265,14 @@ export class HttpUrlUtils { | ||
| 269 | * */ | 265 | * */ |
| 270 | static readonly LIVE_REVIEW_PATH: string = "/api/rmrb-bff-display-zh/display/zh/c/channel/live/reviewList"; //?pageNum=1&pageSize=20 | 266 | static readonly LIVE_REVIEW_PATH: string = "/api/rmrb-bff-display-zh/display/zh/c/channel/live/reviewList"; //?pageNum=1&pageSize=20 |
| 271 | /** | 267 | /** |
| 268 | + * 正在直播-更多 type=1 | ||
| 269 | + * 直播预约-更多 type=2 | ||
| 270 | + * */ | ||
| 271 | + static readonly LIVE_MORE_PATH: string = "/api/rmrb-bff-display-zh/display/zh/c/channel/live/list"; //?pageNum=1&pageSize=20 | ||
| 272 | + /** | ||
| 272 | * 早晚报获取PAGEID | 273 | * 早晚报获取PAGEID |
| 273 | * */ | 274 | * */ |
| 274 | static readonly DAILY_PAPER_TOPIC: string = "/api/rmrb-bff-display-zh/display/zh/c/dailyPaperTopic"; | 275 | static readonly DAILY_PAPER_TOPIC: string = "/api/rmrb-bff-display-zh/display/zh/c/dailyPaperTopic"; |
| 275 | - | ||
| 276 | /** | 276 | /** |
| 277 | * app启动页 兴趣偏好 | 277 | * app启动页 兴趣偏好 |
| 278 | */ | 278 | */ |
| @@ -281,8 +281,6 @@ export class HttpUrlUtils { | @@ -281,8 +281,6 @@ export class HttpUrlUtils { | ||
| 281 | * 更新 兴趣偏好 | 281 | * 更新 兴趣偏好 |
| 282 | */ | 282 | */ |
| 283 | static readonly INTERESTS_UPDATETAG_PATH: string = "/api/rmrb-user-center/user/zh/c/tag/updateUserTag"; | 283 | static readonly INTERESTS_UPDATETAG_PATH: string = "/api/rmrb-user-center/user/zh/c/tag/updateUserTag"; |
| 284 | - | ||
| 285 | - | ||
| 286 | private static _hostUrl: string = HttpUrlUtils.HOST_PRODUCT; | 284 | private static _hostUrl: string = HttpUrlUtils.HOST_PRODUCT; |
| 287 | /** | 285 | /** |
| 288 | * 推荐列表 | 286 | * 推荐列表 |
| @@ -88,6 +88,10 @@ export function registerRouter() { | @@ -88,6 +88,10 @@ export function registerRouter() { | ||
| 88 | return WDRouterPage.broadcastPage | 88 | return WDRouterPage.broadcastPage |
| 89 | } else if (action.params?.pageID == "SPACIAL_TOPIC_PAGE") { | 89 | } else if (action.params?.pageID == "SPACIAL_TOPIC_PAGE") { |
| 90 | return WDRouterPage.spacialTopicPage | 90 | return WDRouterPage.spacialTopicPage |
| 91 | + } else if (action.params?.pageID == "LIVE_MORE_PAGE") { | ||
| 92 | + return WDRouterPage.liveMorePage | ||
| 93 | + } else if (action.params?.pageID == "ORDER_MORE_PAGE") { | ||
| 94 | + return WDRouterPage.reserveMorePage | ||
| 91 | } | 95 | } |
| 92 | return undefined | 96 | return undefined |
| 93 | }) | 97 | }) |
| @@ -102,9 +102,7 @@ export class WDRouterPage { | @@ -102,9 +102,7 @@ export class WDRouterPage { | ||
| 102 | static launchAdvertisingPage = new WDRouterPage("phone", "ets/pages/launchPage/LaunchAdvertisingPage"); | 102 | static launchAdvertisingPage = new WDRouterPage("phone", "ets/pages/launchPage/LaunchAdvertisingPage"); |
| 103 | //主页 | 103 | //主页 |
| 104 | static mainPage = new WDRouterPage("phone", "ets/pages/MainPage"); | 104 | static mainPage = new WDRouterPage("phone", "ets/pages/MainPage"); |
| 105 | - | ||
| 106 | static launchInterestsPage = new WDRouterPage("phone", "ets/pages/launchPage/LaunchInterestsHobbiesPage"); | 105 | static launchInterestsPage = new WDRouterPage("phone", "ets/pages/launchPage/LaunchInterestsHobbiesPage"); |
| 107 | - | ||
| 108 | // static loginProtocolPage = new WDRouterPage("wdLogin", "ets/pages/login/LoginProtocolWebview"); | 106 | // static loginProtocolPage = new WDRouterPage("wdLogin", "ets/pages/login/LoginProtocolWebview"); |
| 109 | 107 | ||
| 110 | //播报页面 | 108 | //播报页面 |
| @@ -115,4 +113,8 @@ export class WDRouterPage { | @@ -115,4 +113,8 @@ export class WDRouterPage { | ||
| 115 | static searchCreatorPage = new WDRouterPage("wdComponent", "ets/pages/SearchCreatorPage"); | 113 | static searchCreatorPage = new WDRouterPage("wdComponent", "ets/pages/SearchCreatorPage"); |
| 116 | //人民号主页 | 114 | //人民号主页 |
| 117 | static peopleShipHomePage = new WDRouterPage("wdComponent", "ets/components/page/PeopleShipHomePage"); | 115 | static peopleShipHomePage = new WDRouterPage("wdComponent", "ets/components/page/PeopleShipHomePage"); |
| 116 | + //直播更多页 | ||
| 117 | + static liveMorePage = new WDRouterPage("wdComponent", "ets/components/page/LiveMorePage"); | ||
| 118 | + //预约更多页 | ||
| 119 | + static reserveMorePage = new WDRouterPage("wdComponent", "ets/components/page/ReserveMorePage"); | ||
| 118 | } | 120 | } |
| @@ -4,8 +4,9 @@ import { VideoInfoDTO } from '../detail/VideoInfoDTO'; | @@ -4,8 +4,9 @@ import { VideoInfoDTO } from '../detail/VideoInfoDTO'; | ||
| 4 | import { InteractDataDTO } from './InteractDataDTO'; | 4 | import { InteractDataDTO } from './InteractDataDTO'; |
| 5 | import { slideShows } from '../morningevening/slideShows'; | 5 | import { slideShows } from '../morningevening/slideShows'; |
| 6 | import { VoiceInfoDTO } from '../detail/VoiceInfoDTO'; | 6 | import { VoiceInfoDTO } from '../detail/VoiceInfoDTO'; |
| 7 | -import { RmhInfoDTO } from '../detail/RmhInfoDTO' | ||
| 8 | -import {commentInfo} from './commentInfo' | 7 | +import { RmhInfoDTO } from '../detail/RmhInfoDTO'; |
| 8 | +import { commentInfo } from './commentInfo'; | ||
| 9 | + | ||
| 9 | export interface ContentDTO { | 10 | export interface ContentDTO { |
| 10 | appStyle: string; | 11 | appStyle: string; |
| 11 | cityCode: string; | 12 | cityCode: string; |
| @@ -25,6 +26,7 @@ export interface ContentDTO { | @@ -25,6 +26,7 @@ export interface ContentDTO { | ||
| 25 | openComment?: number; | 26 | openComment?: number; |
| 26 | openUrl: string; | 27 | openUrl: string; |
| 27 | pageId: string; | 28 | pageId: string; |
| 29 | + | ||
| 28 | // playUrls: any[]; | 30 | // playUrls: any[]; |
| 29 | programAuth: string; | 31 | programAuth: string; |
| 30 | programId: string; | 32 | programId: string; |
| @@ -32,10 +34,12 @@ export interface ContentDTO { | @@ -32,10 +34,12 @@ export interface ContentDTO { | ||
| 32 | programSource: number; | 34 | programSource: number; |
| 33 | programType: number; | 35 | programType: number; |
| 34 | provinceCode: string; | 36 | provinceCode: string; |
| 37 | + | ||
| 35 | // rankingList: any[]; | 38 | // rankingList: any[]; |
| 36 | showTitleEd: string; | 39 | showTitleEd: string; |
| 37 | showTitleIng: string; | 40 | showTitleIng: string; |
| 38 | showTitleNo: string; | 41 | showTitleNo: string; |
| 42 | + | ||
| 39 | // sortValue?: any; | 43 | // sortValue?: any; |
| 40 | startTime: string; | 44 | startTime: string; |
| 41 | subType: string; | 45 | subType: string; |
| @@ -43,27 +47,24 @@ export interface ContentDTO { | @@ -43,27 +47,24 @@ export interface ContentDTO { | ||
| 43 | title: string; | 47 | title: string; |
| 44 | vImageUrl: string; | 48 | vImageUrl: string; |
| 45 | screenType: string; | 49 | screenType: string; |
| 46 | - | ||
| 47 | source: string; | 50 | source: string; |
| 48 | objectId: string; | 51 | objectId: string; |
| 49 | objectType: string; | 52 | objectType: string; |
| 50 | channelId: string; | 53 | channelId: string; |
| 51 | relId: string; | 54 | relId: string; |
| 52 | relType: string; | 55 | relType: string; |
| 53 | - | ||
| 54 | - | ||
| 55 | - newsTitle:string;//单图卡/2行标题/3行标题 | ||
| 56 | - publishTime:string; | ||
| 57 | - visitorComment:number; | ||
| 58 | - fullColumnImgUrls:FullColumnImgUrlDTO[]; | 56 | + newsTitle: string; //单图卡/2行标题/3行标题 |
| 57 | + publishTime: string; | ||
| 58 | + publishTimestamp: string; | ||
| 59 | + visitorComment: number; | ||
| 60 | + fullColumnImgUrls: FullColumnImgUrlDTO[]; | ||
| 59 | liveInfo: LiveInfoDTO; // 直播新闻信息【BFF聚合】 | 61 | liveInfo: LiveInfoDTO; // 直播新闻信息【BFF聚合】 |
| 60 | videoInfo: VideoInfoDTO; // 视频新闻信息【BFF聚合】,视频非原片+清晰度最高的 | 62 | videoInfo: VideoInfoDTO; // 视频新闻信息【BFF聚合】,视频非原片+清晰度最高的 |
| 61 | 63 | ||
| 62 | newsSummary: string; //appstyle:2 ,新闻详情 | 64 | newsSummary: string; //appstyle:2 ,新闻详情 |
| 63 | 65 | ||
| 64 | // 二次请求接口,返回的数据,这里组装到content里; | 66 | // 二次请求接口,返回的数据,这里组装到content里; |
| 65 | - interactData:InteractDataDTO; | ||
| 66 | - | 67 | + interactData: InteractDataDTO; |
| 67 | hasMore: number, | 68 | hasMore: number, |
| 68 | slideShows: slideShows[], | 69 | slideShows: slideShows[], |
| 69 | voiceInfo: VoiceInfoDTO, | 70 | voiceInfo: VoiceInfoDTO, |
| 1 | +import { ContentDTO } from 'wdBean'; | ||
| 2 | +import { ProcessUtils } from '../../utils/ProcessUtils'; | ||
| 3 | +import { CommonConstants } from 'wdConstant/Index'; | ||
| 4 | +import PageViewModel from '../../viewmodel/PageViewModel'; | ||
| 5 | +import RefreshLayout from '../page/RefreshLayout'; | ||
| 6 | +import { RefreshLayoutBean } from '../page/RefreshLayoutBean'; | ||
| 7 | +import PageModel from '../../viewmodel/PageModel'; | ||
| 8 | +import { DateTimeUtils, LazyDataSource } from 'wdKit/Index'; | ||
| 9 | +import { router } from '@kit.ArkUI'; | ||
| 10 | + | ||
| 11 | +const TAG: string = 'LiveMorePage'; | ||
| 12 | + | ||
| 13 | +/** | ||
| 14 | + * 直播更多: | ||
| 15 | + * type=1 直播 | ||
| 16 | + * type=2 预约 | ||
| 17 | + * 卡片结构:上下结构 | ||
| 18 | + * 卡片宽度:充满父窗口 | ||
| 19 | + * 卡片高度,仅包含横板图片:图片高度由图片的宽度及宽高比决定,图片宽度占父窗口'100%',宽高比为16:9: | ||
| 20 | + */ | ||
| 21 | +@Entry | ||
| 22 | +@Component | ||
| 23 | +struct LiveMorePage { | ||
| 24 | + @State private pageModel: PageModel = new PageModel(); | ||
| 25 | + @State data: LazyDataSource<ContentDTO> = new LazyDataSource(); | ||
| 26 | + topSafeHeight: number = AppStorage.get<number>('topSafeHeight') as number; | ||
| 27 | + type: number = 1; | ||
| 28 | + currentPage: number = 1; | ||
| 29 | + pageSize: number = 20; | ||
| 30 | + operDataList: ContentDTO[] = []; | ||
| 31 | + title: string = '直播列表' | ||
| 32 | + @State contentDTO: ContentDTO = { | ||
| 33 | + // appStyle: '15', | ||
| 34 | + // coverType: 1, | ||
| 35 | + // objectType: '9', | ||
| 36 | + // coverUrl: 'https://rmrbcmsonline.peopleapp.com/rb_recsys/img/2024/0413/VL20Z09ISBEKXZU_963672030241091584.jpeg?x-oss-process=image/resize,m_fill,h_450,w_800/quality,q_90', | ||
| 37 | + // fullColumnImgUrls: [ | ||
| 38 | + // { | ||
| 39 | + // landscape: 2, | ||
| 40 | + // size: 1, | ||
| 41 | + // url: 'https://rmrbcmsonline.peopleapp.com/rb_recsys/img/2024/0413/VL20Z09ISBEKXZU_963672030241091584.jpeg?x-oss-process=image/resize,m_fill,h_450,w_800/quality,q_90', | ||
| 42 | + // weight: 1170 | ||
| 43 | + // } | ||
| 44 | + // ], | ||
| 45 | + // newsTitle: '押解画面公开!被湖北民警从柬埔寨押解回国被湖北民警从柬埔寨押解回国的130名涉赌诈嫌疑人是他们被湖北民警从柬埔寨押解回国的130名涉赌诈嫌疑人是他们的130名涉赌诈嫌疑人是他们', | ||
| 46 | + // publishTime: '1712993333000', | ||
| 47 | + // rmhInfo: { | ||
| 48 | + // authIcon: '', | ||
| 49 | + // authTitle: '', | ||
| 50 | + // authTitle2: '', | ||
| 51 | + // banControl: 0, | ||
| 52 | + // cnIsAttention: 1, | ||
| 53 | + // rmhDesc: '中共武汉市委机关报长江日报官方人民号', | ||
| 54 | + // rmhHeadUrl: 'https://uatjdcdnphoto.aikan.pdnews.cn/vod/content/202302/202302Sa121448724/TUw.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg', | ||
| 55 | + // rmhId: '4255270', | ||
| 56 | + // rmhName: '长江日报', | ||
| 57 | + // userId: '513696944662469', | ||
| 58 | + // userType: '3' | ||
| 59 | + // }, | ||
| 60 | + // videoInfo: { | ||
| 61 | + // firstFrameImageUri: '', | ||
| 62 | + // videoDuration: 12, | ||
| 63 | + // // videoLandscape: 2, | ||
| 64 | + // videoUrl: 'https://rmrbcmsonline.peopleapp.com/rb_recsys/video/2024/0413/VL20Z09ISBEKXZU_963672027208609792.mp4' | ||
| 65 | + // }, | ||
| 66 | + // photoNum: '9', | ||
| 67 | + // voiceInfo: { | ||
| 68 | + // voiceDuration: 12 | ||
| 69 | + // } | ||
| 70 | + } as ContentDTO; | ||
| 71 | + | ||
| 72 | + aboutToAppear(): void { | ||
| 73 | + PageViewModel.getLiveMoreUrl(this.type, this.currentPage, this.pageSize).then((liveReviewDTO) => { | ||
| 74 | + // this.operDataList = [] | ||
| 75 | + // this.operDataList.push(...liveReviewDTO.list) | ||
| 76 | + this.data.push(...liveReviewDTO.list) | ||
| 77 | + }) | ||
| 78 | + } | ||
| 79 | + | ||
| 80 | + build() { | ||
| 81 | + // Navigation() { | ||
| 82 | + // //滑动区域 | ||
| 83 | + // this.ListLayout() | ||
| 84 | + // } | ||
| 85 | + // .titleMode(NavigationTitleMode.Mini) | ||
| 86 | + // .title('直播列表') | ||
| 87 | + | ||
| 88 | + Column() { | ||
| 89 | + this.TabbarNormal() | ||
| 90 | + | ||
| 91 | + this.ListLayout() | ||
| 92 | + } | ||
| 93 | + .padding({ | ||
| 94 | + left: $r('app.float.card_comp_pagePadding_lf'), | ||
| 95 | + right: $r('app.float.card_comp_pagePadding_lf'), | ||
| 96 | + bottom: $r('app.float.card_comp_pagePadding_tb') | ||
| 97 | + }) | ||
| 98 | + .onClick((event: ClickEvent) => { | ||
| 99 | + ProcessUtils.processPage(this.contentDTO) | ||
| 100 | + }) | ||
| 101 | + } | ||
| 102 | + | ||
| 103 | + @Builder | ||
| 104 | + ListLayout() { | ||
| 105 | + List() { | ||
| 106 | + // 下拉刷新 | ||
| 107 | + ListItem() { | ||
| 108 | + RefreshLayout({ | ||
| 109 | + refreshBean: new RefreshLayoutBean(this.pageModel.isVisiblePullDown, this.pageModel.pullDownRefreshImage, | ||
| 110 | + this.pageModel.pullDownRefreshText, this.pageModel.pullDownRefreshHeight) | ||
| 111 | + }) | ||
| 112 | + } | ||
| 113 | + | ||
| 114 | + LazyForEach(this.data, (contentDTO: ContentDTO, contentIndex: number) => { | ||
| 115 | + ListItem() { | ||
| 116 | + // Column() { | ||
| 117 | + // CompParser({ compDTO: compDTO, compIndex: compIndex }); | ||
| 118 | + // } | ||
| 119 | + this.buildItem(contentDTO) | ||
| 120 | + } | ||
| 121 | + }, | ||
| 122 | + (contentDTO: ContentDTO, contentIndex: number) => contentDTO.pageId + contentIndex.toString() | ||
| 123 | + ) | ||
| 124 | + } | ||
| 125 | + .scrollBar(BarState.Off) | ||
| 126 | + .cachedCount(8) | ||
| 127 | + .height(CommonConstants.FULL_PARENT) | ||
| 128 | + .onScrollIndex((start: number, end: number) => { | ||
| 129 | + // Listen to the first index of the current list. | ||
| 130 | + this.pageModel.startIndex = start; | ||
| 131 | + // 包含了 头尾item,判断时需要考虑+2 | ||
| 132 | + this.pageModel.endIndex = end; | ||
| 133 | + }) | ||
| 134 | + } | ||
| 135 | + | ||
| 136 | + /** | ||
| 137 | + * 组件项 | ||
| 138 | + * | ||
| 139 | + * @param programmeBean item 组件项, 上面icon,下面标题 | ||
| 140 | + */ | ||
| 141 | + @Builder | ||
| 142 | + buildItem(item: ContentDTO) { | ||
| 143 | + Column() { | ||
| 144 | + Text(item.newsTitle) | ||
| 145 | + .fontSize(17) | ||
| 146 | + .maxLines(2) | ||
| 147 | + .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 148 | + .margin({ top: 16, bottom: 8 }) | ||
| 149 | + .alignSelf(ItemAlign.Start) | ||
| 150 | + Stack() { | ||
| 151 | + Image(item.fullColumnImgUrls[0].url) | ||
| 152 | + .width('100%') | ||
| 153 | + .height(196) | ||
| 154 | + .borderRadius(4) | ||
| 155 | + this.LiveImage() | ||
| 156 | + | ||
| 157 | + } | ||
| 158 | + .alignContent(Alignment.BottomEnd) | ||
| 159 | + | ||
| 160 | + Text(DateTimeUtils.getCommentTime(Number.parseFloat(item.publishTimestamp))) | ||
| 161 | + .fontSize(13) | ||
| 162 | + .maxLines(1) | ||
| 163 | + .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 164 | + .margin({ top: 8, bottom: 8 }) | ||
| 165 | + .align(Alignment.Start) | ||
| 166 | + .width('100%') | ||
| 167 | + | ||
| 168 | + Divider() | ||
| 169 | + .strokeWidth(1) | ||
| 170 | + .margin({ top: 6 }) | ||
| 171 | + .width('100%') | ||
| 172 | + .color('#f5f5f5') | ||
| 173 | + } | ||
| 174 | + .width('100%') | ||
| 175 | + .onClick(() => { | ||
| 176 | + ProcessUtils.processPage(item) | ||
| 177 | + }) | ||
| 178 | + } | ||
| 179 | + | ||
| 180 | + /*导航栏*/ | ||
| 181 | + @Builder | ||
| 182 | + TabbarNormal() { | ||
| 183 | + RelativeContainer() { | ||
| 184 | + //标题栏目 | ||
| 185 | + Image($r('app.media.icon_arrow_left')) | ||
| 186 | + .width(24) | ||
| 187 | + .height(24) | ||
| 188 | + .objectFit(ImageFit.Auto) | ||
| 189 | + .id("back_icon") | ||
| 190 | + .alignRules({ | ||
| 191 | + center: { anchor: "__container__", align: VerticalAlign.Center }, | ||
| 192 | + left: { anchor: "__container__", align: HorizontalAlign.Start } | ||
| 193 | + }) | ||
| 194 | + .onClick(() => { | ||
| 195 | + router.back() | ||
| 196 | + }) | ||
| 197 | + | ||
| 198 | + Text(this.title)// .height('42lpx') | ||
| 199 | + .maxLines(1) | ||
| 200 | + .id("title") | ||
| 201 | + .fontSize('35lpx') | ||
| 202 | + .fontWeight(400) | ||
| 203 | + .fontColor($r('app.color.color_222222')) | ||
| 204 | + .lineHeight('42lpx') | ||
| 205 | + .alignRules({ | ||
| 206 | + center: { anchor: "__container__", align: VerticalAlign.Center }, | ||
| 207 | + middle: { anchor: "__container__", align: HorizontalAlign.Center } | ||
| 208 | + }) | ||
| 209 | + } | ||
| 210 | + .height(44) | ||
| 211 | + .width('100%') | ||
| 212 | + } | ||
| 213 | + | ||
| 214 | + @Builder | ||
| 215 | + LiveImage() { | ||
| 216 | + Row() { | ||
| 217 | + Image($r('app.media.icon_live_status_running')) | ||
| 218 | + .width(22) | ||
| 219 | + .height(18) | ||
| 220 | + Text('直播中') | ||
| 221 | + .fontSize('11fp') | ||
| 222 | + .fontWeight(400) | ||
| 223 | + .fontColor(Color.White) | ||
| 224 | + } | ||
| 225 | + .backgroundColor('#4D000000') | ||
| 226 | + .margin({ right: 8, bottom: 8 }) | ||
| 227 | + } | ||
| 228 | +} |
| 1 | +import { ContentDTO } from 'wdBean'; | ||
| 2 | +import { ProcessUtils } from '../../utils/ProcessUtils'; | ||
| 3 | +import { CommonConstants } from 'wdConstant/Index'; | ||
| 4 | +import PageViewModel from '../../viewmodel/PageViewModel'; | ||
| 5 | +import RefreshLayout from '../page/RefreshLayout'; | ||
| 6 | +import { RefreshLayoutBean } from '../page/RefreshLayoutBean'; | ||
| 7 | +import PageModel from '../../viewmodel/PageModel'; | ||
| 8 | +import { LazyDataSource } from 'wdKit/Index'; | ||
| 9 | +import { router } from '@kit.ArkUI'; | ||
| 10 | + | ||
| 11 | +const TAG: string = 'ReserveMorePage'; | ||
| 12 | + | ||
| 13 | +/** | ||
| 14 | + * 预约更多: | ||
| 15 | + * type=1 直播 | ||
| 16 | + * type=2 预约 | ||
| 17 | + * 卡片结构:上下结构 | ||
| 18 | + * 卡片宽度:充满父窗口 | ||
| 19 | + * 卡片高度,仅包含横板图片:图片高度由图片的宽度及宽高比决定,图片宽度占父窗口'100%',宽高比为16:9: | ||
| 20 | + */ | ||
| 21 | +@Entry | ||
| 22 | +@Component | ||
| 23 | +struct ReserveMorePage { | ||
| 24 | + @State private pageModel: PageModel = new PageModel(); | ||
| 25 | + @State data: LazyDataSource<ContentDTO> = new LazyDataSource(); | ||
| 26 | + topSafeHeight: number = AppStorage.get<number>('topSafeHeight') as number; | ||
| 27 | + type: number = 2; | ||
| 28 | + currentPage: number = 1; | ||
| 29 | + pageSize: number = 20; | ||
| 30 | + operDataList: ContentDTO[] = []; | ||
| 31 | + title: string = '预约列表' | ||
| 32 | + @State contentDTO: ContentDTO = { | ||
| 33 | + // appStyle: '15', | ||
| 34 | + // coverType: 1, | ||
| 35 | + // objectType: '9', | ||
| 36 | + // coverUrl: 'https://rmrbcmsonline.peopleapp.com/rb_recsys/img/2024/0413/VL20Z09ISBEKXZU_963672030241091584.jpeg?x-oss-process=image/resize,m_fill,h_450,w_800/quality,q_90', | ||
| 37 | + // fullColumnImgUrls: [ | ||
| 38 | + // { | ||
| 39 | + // landscape: 2, | ||
| 40 | + // size: 1, | ||
| 41 | + // url: 'https://rmrbcmsonline.peopleapp.com/rb_recsys/img/2024/0413/VL20Z09ISBEKXZU_963672030241091584.jpeg?x-oss-process=image/resize,m_fill,h_450,w_800/quality,q_90', | ||
| 42 | + // weight: 1170 | ||
| 43 | + // } | ||
| 44 | + // ], | ||
| 45 | + // newsTitle: '押解画面公开!被湖北民警从柬埔寨押解回国被湖北民警从柬埔寨押解回国的130名涉赌诈嫌疑人是他们被湖北民警从柬埔寨押解回国的130名涉赌诈嫌疑人是他们的130名涉赌诈嫌疑人是他们', | ||
| 46 | + // publishTime: '1712993333000', | ||
| 47 | + // rmhInfo: { | ||
| 48 | + // authIcon: '', | ||
| 49 | + // authTitle: '', | ||
| 50 | + // authTitle2: '', | ||
| 51 | + // banControl: 0, | ||
| 52 | + // cnIsAttention: 1, | ||
| 53 | + // rmhDesc: '中共武汉市委机关报长江日报官方人民号', | ||
| 54 | + // rmhHeadUrl: 'https://uatjdcdnphoto.aikan.pdnews.cn/vod/content/202302/202302Sa121448724/TUw.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg', | ||
| 55 | + // rmhId: '4255270', | ||
| 56 | + // rmhName: '长江日报', | ||
| 57 | + // userId: '513696944662469', | ||
| 58 | + // userType: '3' | ||
| 59 | + // }, | ||
| 60 | + // videoInfo: { | ||
| 61 | + // firstFrameImageUri: '', | ||
| 62 | + // videoDuration: 12, | ||
| 63 | + // // videoLandscape: 2, | ||
| 64 | + // videoUrl: 'https://rmrbcmsonline.peopleapp.com/rb_recsys/video/2024/0413/VL20Z09ISBEKXZU_963672027208609792.mp4' | ||
| 65 | + // }, | ||
| 66 | + // photoNum: '9', | ||
| 67 | + // voiceInfo: { | ||
| 68 | + // voiceDuration: 12 | ||
| 69 | + // } | ||
| 70 | + } as ContentDTO; | ||
| 71 | + | ||
| 72 | + aboutToAppear(): void { | ||
| 73 | + PageViewModel.getLiveMoreUrl(this.type, this.currentPage, this.pageSize).then((liveReviewDTO) => { | ||
| 74 | + // this.operDataList = [] | ||
| 75 | + // this.operDataList.push(...liveReviewDTO.list) | ||
| 76 | + this.data.push(...liveReviewDTO.list) | ||
| 77 | + }) | ||
| 78 | + } | ||
| 79 | + | ||
| 80 | + build() { | ||
| 81 | + // Navigation() { | ||
| 82 | + // //滑动区域 | ||
| 83 | + // this.ListLayout() | ||
| 84 | + // } | ||
| 85 | + // .titleMode(NavigationTitleMode.Mini) | ||
| 86 | + // .title('直播列表') | ||
| 87 | + | ||
| 88 | + Column() { | ||
| 89 | + Column() { | ||
| 90 | + this.TabbarNormal() | ||
| 91 | + | ||
| 92 | + this.ListLayout() | ||
| 93 | + } | ||
| 94 | + .padding({ | ||
| 95 | + left: $r('app.float.card_comp_pagePadding_lf'), | ||
| 96 | + right: $r('app.float.card_comp_pagePadding_lf'), | ||
| 97 | + bottom: $r('app.float.card_comp_pagePadding_tb') | ||
| 98 | + }) | ||
| 99 | + } | ||
| 100 | + .backgroundColor('#F5F5F5') | ||
| 101 | + | ||
| 102 | + // .onClick((event: ClickEvent) => { | ||
| 103 | + // ProcessUtils.processPage(this.contentDTO) | ||
| 104 | + // }) | ||
| 105 | + } | ||
| 106 | + | ||
| 107 | + @Builder | ||
| 108 | + ListLayout() { | ||
| 109 | + List() { | ||
| 110 | + // 下拉刷新 | ||
| 111 | + ListItem() { | ||
| 112 | + RefreshLayout({ | ||
| 113 | + refreshBean: new RefreshLayoutBean(this.pageModel.isVisiblePullDown, this.pageModel.pullDownRefreshImage, | ||
| 114 | + this.pageModel.pullDownRefreshText, this.pageModel.pullDownRefreshHeight) | ||
| 115 | + }) | ||
| 116 | + } | ||
| 117 | + | ||
| 118 | + LazyForEach(this.data, (contentDTO: ContentDTO, contentIndex: number) => { | ||
| 119 | + ListItem() { | ||
| 120 | + // Column() { | ||
| 121 | + // CompParser({ compDTO: compDTO, compIndex: compIndex }); | ||
| 122 | + // } | ||
| 123 | + this.buildItem(contentDTO) | ||
| 124 | + } | ||
| 125 | + }, | ||
| 126 | + (contentDTO: ContentDTO, contentIndex: number) => contentDTO.pageId + contentIndex.toString() | ||
| 127 | + ) | ||
| 128 | + } | ||
| 129 | + .scrollBar(BarState.Off) | ||
| 130 | + .cachedCount(8) | ||
| 131 | + .height(CommonConstants.FULL_PARENT) | ||
| 132 | + .backgroundColor('#F5F5F5') | ||
| 133 | + .onScrollIndex((start: number, end: number) => { | ||
| 134 | + // Listen to the first index of the current list. | ||
| 135 | + this.pageModel.startIndex = start; | ||
| 136 | + // 包含了 头尾item,判断时需要考虑+2 | ||
| 137 | + this.pageModel.endIndex = end; | ||
| 138 | + }) | ||
| 139 | + } | ||
| 140 | + | ||
| 141 | + /** | ||
| 142 | + * 组件项 | ||
| 143 | + * | ||
| 144 | + * @param programmeBean item 组件项, 上面icon,下面标题 | ||
| 145 | + */ | ||
| 146 | + @Builder | ||
| 147 | + buildItem(item: ContentDTO) { | ||
| 148 | + Column({ space: 8 }) { | ||
| 149 | + Stack() { | ||
| 150 | + Image(item.fullColumnImgUrls[0].url) | ||
| 151 | + .width('100%') | ||
| 152 | + .height(196) | ||
| 153 | + .borderRadius(4) | ||
| 154 | + this.LiveImage() | ||
| 155 | + | ||
| 156 | + } | ||
| 157 | + .alignContent(Alignment.BottomEnd) | ||
| 158 | + | ||
| 159 | + Text(item.newsTitle) | ||
| 160 | + .fontSize(17) | ||
| 161 | + .maxLines(2) | ||
| 162 | + .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 163 | + .margin({ top: 16, left: 12, right: 12 }) | ||
| 164 | + .alignSelf(ItemAlign.Start) | ||
| 165 | + Row() { | ||
| 166 | + Row() { | ||
| 167 | + Image($r('app.media.reserve_play_icon')) | ||
| 168 | + .width(20) | ||
| 169 | + .height(20) | ||
| 170 | + .margin({ left: 10, top: 2, bottom: 2, right: 6 }) | ||
| 171 | + // Text(DateTimeUtils.formatDate(item.liveInfo.liveStartTime, "MM月dd日 HH:mm")) | ||
| 172 | + Text(this.getReserveDate(item.liveInfo.liveStartTime, 1)) | ||
| 173 | + .fontSize(12) | ||
| 174 | + .fontWeight(500) | ||
| 175 | + .fontColor('#ED2800') | ||
| 176 | + .fontFamily('PingFang SC-Medium') | ||
| 177 | + .maxLines(1) | ||
| 178 | + .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 179 | + .margin({ top: 8, bottom: 8 }) | ||
| 180 | + .align(Alignment.Start) | ||
| 181 | + | ||
| 182 | + Image($r('app.media.point_icon')) | ||
| 183 | + .objectFit(ImageFit.Auto) | ||
| 184 | + .interpolation(ImageInterpolation.High) | ||
| 185 | + .width(6) | ||
| 186 | + .height(16) | ||
| 187 | + .margin(2) | ||
| 188 | + | ||
| 189 | + Text(this.getReserveDate(item.liveInfo.liveStartTime, 2)) | ||
| 190 | + .fontSize(12) | ||
| 191 | + .fontWeight(500) | ||
| 192 | + .fontColor('#ED2800') | ||
| 193 | + .fontFamily('PingFang SC-Medium') | ||
| 194 | + .maxLines(1) | ||
| 195 | + .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 196 | + .margin({ top: 8, bottom: 8, right: 10 }) | ||
| 197 | + .align(Alignment.Start) | ||
| 198 | + } | ||
| 199 | + .backgroundColor('#F5F5F5') | ||
| 200 | + .margin(12) | ||
| 201 | + | ||
| 202 | + Flex({ justifyContent: FlexAlign.Center }) { | ||
| 203 | + Text('预约') | ||
| 204 | + .fontSize(12) | ||
| 205 | + .fontWeight(400) | ||
| 206 | + .fontFamily('PingFang SC-Regular') | ||
| 207 | + .width(52) | ||
| 208 | + .height(24) | ||
| 209 | + .fontColor(Color.White) | ||
| 210 | + .textAlign(TextAlign.Center) | ||
| 211 | + } | ||
| 212 | + .width(52) | ||
| 213 | + .backgroundColor('#ED2800') | ||
| 214 | + .borderRadius(3) | ||
| 215 | + .margin({ right: 12 }) | ||
| 216 | + } | ||
| 217 | + .width('100%') | ||
| 218 | + .justifyContent(FlexAlign.SpaceBetween) | ||
| 219 | + | ||
| 220 | + } | ||
| 221 | + .borderRadius(4) | ||
| 222 | + .backgroundColor(Color.White) | ||
| 223 | + .width('100%') | ||
| 224 | + .margin({ top: 12, bottom: 8 }) | ||
| 225 | + .onClick(() => { | ||
| 226 | + ProcessUtils.processPage(item) | ||
| 227 | + }) | ||
| 228 | + } | ||
| 229 | + | ||
| 230 | + getReserveDate(eventDateTimeString: string, type: number): string { | ||
| 231 | + // 解析事件的日期和时间 | ||
| 232 | + const eventDateTime = new Date(eventDateTimeString); | ||
| 233 | + const currentDateTime = new Date(); | ||
| 234 | + | ||
| 235 | + // 截取事件时间的小时和分钟(假设事件时间是按照24小时制) | ||
| 236 | + const eventHour = eventDateTime.getHours(); | ||
| 237 | + const eventMinutes = eventDateTime.getMinutes(); | ||
| 238 | + const eventTimeStr = `${eventHour}:${eventMinutes.toString().padStart(2, '0')}开始`; // 格式化时间,确保分钟是两位数 | ||
| 239 | + | ||
| 240 | + // 计算时间差 | ||
| 241 | + const timeDifference = eventDateTime.getTime() - currentDateTime.getTime(); | ||
| 242 | + | ||
| 243 | + // 如果事件在24小时内 | ||
| 244 | + if (type === 1) { | ||
| 245 | + if (timeDifference > 0 && timeDifference <= 24 * 60 * 60 * 1000) { | ||
| 246 | + return `今天`; | ||
| 247 | + } else { | ||
| 248 | + // 如果事件不在24小时内 | ||
| 249 | + const month = eventDateTime.getMonth() + 1; // 月份从0开始 | ||
| 250 | + const date = eventDateTime.getDate(); | ||
| 251 | + return `${month}月${date}日`; | ||
| 252 | + } | ||
| 253 | + } else { | ||
| 254 | + return `${eventTimeStr}`; | ||
| 255 | + } | ||
| 256 | + } | ||
| 257 | + | ||
| 258 | + /*导航栏*/ | ||
| 259 | + @Builder | ||
| 260 | + TabbarNormal() { | ||
| 261 | + RelativeContainer() { | ||
| 262 | + //标题栏目 | ||
| 263 | + Image($r('app.media.icon_arrow_left')) | ||
| 264 | + .width(24) | ||
| 265 | + .height(24) | ||
| 266 | + .objectFit(ImageFit.Auto) | ||
| 267 | + .id("back_icon") | ||
| 268 | + .alignRules({ | ||
| 269 | + center: { anchor: "__container__", align: VerticalAlign.Center }, | ||
| 270 | + left: { anchor: "__container__", align: HorizontalAlign.Start } | ||
| 271 | + }) | ||
| 272 | + .onClick(() => { | ||
| 273 | + router.back() | ||
| 274 | + }) | ||
| 275 | + | ||
| 276 | + Text(this.title)// .height('42lpx') | ||
| 277 | + .maxLines(1) | ||
| 278 | + .id("title") | ||
| 279 | + .fontSize('35lpx') | ||
| 280 | + .fontWeight(400) | ||
| 281 | + .fontColor($r('app.color.color_222222')) | ||
| 282 | + .lineHeight('42lpx') | ||
| 283 | + .alignRules({ | ||
| 284 | + center: { anchor: "__container__", align: VerticalAlign.Center }, | ||
| 285 | + middle: { anchor: "__container__", align: HorizontalAlign.Center } | ||
| 286 | + }) | ||
| 287 | + } | ||
| 288 | + .backgroundColor('#FFFFFF') | ||
| 289 | + .height(44) | ||
| 290 | + .width('100%') | ||
| 291 | + } | ||
| 292 | + | ||
| 293 | + @Builder | ||
| 294 | + LiveImage() { | ||
| 295 | + Row() { | ||
| 296 | + Image($r('app.media.reserve_icon')) | ||
| 297 | + .width(22) | ||
| 298 | + .height(18) | ||
| 299 | + Text('预约') | ||
| 300 | + .fontSize('11fp') | ||
| 301 | + .fontWeight(400) | ||
| 302 | + .fontColor(Color.White) | ||
| 303 | + } | ||
| 304 | + .backgroundColor('#4D000000') | ||
| 305 | + .margin({ right: 8, bottom: 8 }) | ||
| 306 | + } | ||
| 307 | +} |
| @@ -191,7 +191,8 @@ export struct SearchResultContentComponent{ | @@ -191,7 +191,8 @@ export struct SearchResultContentComponent{ | ||
| 191 | corner: '', | 191 | corner: '', |
| 192 | rmhPlatform: 0, | 192 | rmhPlatform: 0, |
| 193 | newTags: '', | 193 | newTags: '', |
| 194 | - isSearch: true | 194 | + isSearch: true, |
| 195 | + publishTimestamp:"" | ||
| 195 | } | 196 | } |
| 196 | 197 | ||
| 197 | this.data.push(contentDTO) | 198 | this.data.push(contentDTO) |
| @@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
| 2 | import { LiveHorizontalCardForOneComponent } from './LiveHorizontalCardForOneComponent' | 2 | import { LiveHorizontalCardForOneComponent } from './LiveHorizontalCardForOneComponent' |
| 3 | import { Action, CompDTO, ContentDTO, Params } from 'wdBean' | 3 | import { Action, CompDTO, ContentDTO, Params } from 'wdBean' |
| 4 | import { CommonConstants } from 'wdConstant' | 4 | import { CommonConstants } from 'wdConstant' |
| 5 | -import { WDRouterRule } from 'wdRouter/Index' | 5 | +import { WDRouterPage, WDRouterRule } from 'wdRouter/Index' |
| 6 | import { CardMediaInfo } from '../cardCommon/CardMediaInfo' | 6 | import { CardMediaInfo } from '../cardCommon/CardMediaInfo' |
| 7 | import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO' | 7 | import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO' |
| 8 | import { LiveModel } from '../../viewmodel/LiveModel' | 8 | import { LiveModel } from '../../viewmodel/LiveModel' |
| @@ -36,13 +36,17 @@ export struct LiveHorizontalCardComponent { | @@ -36,13 +36,17 @@ export struct LiveHorizontalCardComponent { | ||
| 36 | .height(14) | 36 | .height(14) |
| 37 | } | 37 | } |
| 38 | .onClick(() => { | 38 | .onClick(() => { |
| 39 | - let taskAction: Action = { | ||
| 40 | - type: 'JUMP_H5_BY_WEB_VIEW', | ||
| 41 | - params: { | ||
| 42 | - url: this.compDTO.linkUrl | ||
| 43 | - } as Params, | ||
| 44 | - }; | ||
| 45 | - WDRouterRule.jumpWithAction(taskAction) | 39 | + if (this.compDTO.linkUrl) { |
| 40 | + let taskAction: Action = { | ||
| 41 | + type: 'JUMP_H5_BY_WEB_VIEW', | ||
| 42 | + params: { | ||
| 43 | + url: this.compDTO.linkUrl | ||
| 44 | + } as Params, | ||
| 45 | + }; | ||
| 46 | + WDRouterRule.jumpWithAction(taskAction) | ||
| 47 | + } else { | ||
| 48 | + this.jumpToLiveMorePage() | ||
| 49 | + } | ||
| 46 | }) | 50 | }) |
| 47 | } | 51 | } |
| 48 | }.justifyContent(FlexAlign.SpaceBetween) | 52 | }.justifyContent(FlexAlign.SpaceBetween) |
| @@ -101,6 +105,17 @@ export struct LiveHorizontalCardComponent { | @@ -101,6 +105,17 @@ export struct LiveHorizontalCardComponent { | ||
| 101 | .backgroundColor($r("app.color.white")) | 105 | .backgroundColor($r("app.color.white")) |
| 102 | } | 106 | } |
| 103 | 107 | ||
| 108 | + private jumpToLiveMorePage() { | ||
| 109 | + // let taskAction: Action = { | ||
| 110 | + // type: 'JUMP_INNER_NEW_PAGE', | ||
| 111 | + // params: { | ||
| 112 | + // pageID: 'LIVE_MORE_PAGE' | ||
| 113 | + // } as Params, | ||
| 114 | + // }; | ||
| 115 | + // WDRouterRule.jumpWithAction(taskAction) | ||
| 116 | + WDRouterRule.jumpWithPage(WDRouterPage.liveMorePage) | ||
| 117 | + } | ||
| 118 | + | ||
| 104 | async gotoLive(content: ContentDTO) { | 119 | async gotoLive(content: ContentDTO) { |
| 105 | const liveDetail = await LiveModel.getLiveDetails(content?.objectId || '', content?.relId || '', content?.relType || '') | 120 | const liveDetail = await LiveModel.getLiveDetails(content?.objectId || '', content?.relId || '', content?.relType || '') |
| 106 | const liveStyle = liveDetail[0].liveInfo.liveStyle | 121 | const liveStyle = liveDetail[0].liveInfo.liveStyle |
| @@ -5,7 +5,7 @@ import { CommonConstants } from 'wdConstant' | @@ -5,7 +5,7 @@ import { CommonConstants } from 'wdConstant' | ||
| 5 | import { StringUtils } from 'wdKit/Index' | 5 | import { StringUtils } from 'wdKit/Index' |
| 6 | import { CardMediaInfo } from '../cardCommon/CardMediaInfo' | 6 | import { CardMediaInfo } from '../cardCommon/CardMediaInfo' |
| 7 | import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO' | 7 | import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO' |
| 8 | -import { WDRouterRule } from 'wdRouter/Index' | 8 | +import { WDRouterPage, WDRouterRule } from 'wdRouter/Index' |
| 9 | import { LiveModel } from '../../viewmodel/LiveModel' | 9 | import { LiveModel } from '../../viewmodel/LiveModel' |
| 10 | 10 | ||
| 11 | @Component | 11 | @Component |
| @@ -36,6 +36,9 @@ export struct LiveHorizontalReservationComponent { | @@ -36,6 +36,9 @@ export struct LiveHorizontalReservationComponent { | ||
| 36 | .width(14) | 36 | .width(14) |
| 37 | .height(14) | 37 | .height(14) |
| 38 | } | 38 | } |
| 39 | + .onClick(() => { | ||
| 40 | + this.jumpToReserveMorePage() | ||
| 41 | + }) | ||
| 39 | } | 42 | } |
| 40 | }.justifyContent(FlexAlign.SpaceBetween) | 43 | }.justifyContent(FlexAlign.SpaceBetween) |
| 41 | .padding({ left: 16, right: 16 }) | 44 | .padding({ left: 16, right: 16 }) |
| @@ -93,6 +96,17 @@ export struct LiveHorizontalReservationComponent { | @@ -93,6 +96,17 @@ export struct LiveHorizontalReservationComponent { | ||
| 93 | .backgroundColor($r("app.color.white")) | 96 | .backgroundColor($r("app.color.white")) |
| 94 | } | 97 | } |
| 95 | 98 | ||
| 99 | + private jumpToReserveMorePage() { | ||
| 100 | + // let taskAction: Action = { | ||
| 101 | + // type: 'JUMP_INNER_NEW_PAGE', | ||
| 102 | + // params: { | ||
| 103 | + // pageID: 'LIVE_MORE_PAGE' | ||
| 104 | + // } as Params, | ||
| 105 | + // }; | ||
| 106 | + // WDRouterRule.jumpWithAction(taskAction) | ||
| 107 | + WDRouterRule.jumpWithPage(WDRouterPage.reserveMorePage) | ||
| 108 | + } | ||
| 109 | + | ||
| 96 | async gotoLive(content: ContentDTO) { | 110 | async gotoLive(content: ContentDTO) { |
| 97 | const liveDetail = await LiveModel.getLiveDetails(content?.objectId || '', content?.relId || '', content?.relType || '') | 111 | const liveDetail = await LiveModel.getLiveDetails(content?.objectId || '', content?.relId || '', content?.relType || '') |
| 98 | const liveStyle = liveDetail[0].liveInfo.liveStyle | 112 | const liveStyle = liveDetail[0].liveInfo.liveStyle |
| @@ -372,7 +372,7 @@ class MinePageDatasModel{ | @@ -372,7 +372,7 @@ class MinePageDatasModel{ | ||
| 372 | let url = HttpUrlUtils.getMineUserLevelDataUrl() | 372 | let url = HttpUrlUtils.getMineUserLevelDataUrl() |
| 373 | let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); | 373 | let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); |
| 374 | // return WDHttp.get<ResponseDTO<MineUserLevelItem>>(url, headers) | 374 | // return WDHttp.get<ResponseDTO<MineUserLevelItem>>(url, headers) |
| 375 | - return HttpBizUtil.get<MineUserLevelItem>(url, headers) | 375 | + return HttpBizUtil.get<ResponseDTO<MineUserLevelItem>>(url, headers) |
| 376 | }; | 376 | }; |
| 377 | 377 | ||
| 378 | async getMineUserLevelDataLocal(context: Context): Promise<MineUserLevelItem> { | 378 | async getMineUserLevelDataLocal(context: Context): Promise<MineUserLevelItem> { |
| @@ -411,7 +411,7 @@ class MinePageDatasModel{ | @@ -411,7 +411,7 @@ class MinePageDatasModel{ | ||
| 411 | let url = HttpUrlUtils.getMineUserDetailDataUrl() | 411 | let url = HttpUrlUtils.getMineUserDetailDataUrl() |
| 412 | let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); | 412 | let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); |
| 413 | // return WDHttp.get<ResponseDTO<MineUserDetailItem>>(url, headers) | 413 | // return WDHttp.get<ResponseDTO<MineUserDetailItem>>(url, headers) |
| 414 | - return HttpBizUtil.get<MineUserDetailItem>(url, headers) | 414 | + return HttpBizUtil.get<ResponseDTO<MineUserDetailItem>>(url, headers) |
| 415 | }; | 415 | }; |
| 416 | 416 | ||
| 417 | async getMineUserDetailDataLocal(context: Context): Promise<MineUserDetailItem> { | 417 | async getMineUserDetailDataLocal(context: Context): Promise<MineUserDetailItem> { |
| @@ -111,6 +111,12 @@ export class PageRepository { | @@ -111,6 +111,12 @@ export class PageRepository { | ||
| 111 | return url; | 111 | return url; |
| 112 | } | 112 | } |
| 113 | 113 | ||
| 114 | + static getLiveMoreUrl(type: number, pageNum: number = 1, pageSize: number = 20) { | ||
| 115 | + let url = HttpUrlUtils.getHost() + HttpUrlUtils.LIVE_MORE_PATH + "?type=" + type + "&pageNum=" + pageNum + "&pageSize=" + pageSize; | ||
| 116 | + Logger.info(TAG, "getLiveMoreUrl url = " + url) | ||
| 117 | + return url; | ||
| 118 | + } | ||
| 119 | + | ||
| 114 | static getDetailInfoUrl(relId: string, contentId: string, relType: string) { | 120 | static getDetailInfoUrl(relId: string, contentId: string, relType: string) { |
| 115 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.DETAIL_PATH; | 121 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.DETAIL_PATH; |
| 116 | url = url + "?relId=" + relId | 122 | url = url + "?relId=" + relId |
| @@ -390,6 +396,15 @@ export class PageRepository { | @@ -390,6 +396,15 @@ export class PageRepository { | ||
| 390 | }; | 396 | }; |
| 391 | 397 | ||
| 392 | /** | 398 | /** |
| 399 | + * 获取更多直播/预约 | ||
| 400 | + * */ | ||
| 401 | + static fetchLiveMoreUrl(type: number,pageNum: number, pageSize: number) { | ||
| 402 | + let url = PageRepository.getLiveMoreUrl(type,pageNum, pageSize) | ||
| 403 | + let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); | ||
| 404 | + return WDHttp.get<ResponseDTO<LiveReviewDTO>>(url, headers) | ||
| 405 | + }; | ||
| 406 | + | ||
| 407 | + /** | ||
| 393 | * 获取推荐列表 | 408 | * 获取推荐列表 |
| 394 | * https://pdapis.pdnews.cn/api/rmrb-bff-display-zh/recommend/zh/c/list | 409 | * https://pdapis.pdnews.cn/api/rmrb-bff-display-zh/recommend/zh/c/list |
| 395 | * @param params | 410 | * @param params |
| @@ -354,6 +354,30 @@ export class PageViewModel extends BaseViewModel { | @@ -354,6 +354,30 @@ export class PageViewModel extends BaseViewModel { | ||
| 354 | }) | 354 | }) |
| 355 | }) | 355 | }) |
| 356 | } | 356 | } |
| 357 | + | ||
| 358 | + async getLiveMoreUrl(type: number, pageNum: number, pageSize: number): Promise<LiveReviewDTO> { | ||
| 359 | + return new Promise<LiveReviewDTO>((success, error) => { | ||
| 360 | + Logger.info(TAG, `getLiveMoreUrl pageInfo start`); | ||
| 361 | + PageRepository.fetchLiveMoreUrl(type,pageNum, pageSize).then((resDTO: ResponseDTO<LiveReviewDTO>) => { | ||
| 362 | + if (!resDTO || !resDTO.data) { | ||
| 363 | + Logger.error(TAG, 'getLiveMoreUrl then navResDTO is empty'); | ||
| 364 | + error('resDTO is empty'); | ||
| 365 | + return | ||
| 366 | + } | ||
| 367 | + if (resDTO.code != 0) { | ||
| 368 | + Logger.error(TAG, `getLiveMoreUrl then code:${resDTO.code}, message:${resDTO.message}`); | ||
| 369 | + error('resDTO Response Code is failure'); | ||
| 370 | + return | ||
| 371 | + } | ||
| 372 | + // let navResStr = JSON.stringify(navResDTO); | ||
| 373 | + Logger.info(TAG, "getLiveMoreUrl then,navResDTO.timestamp:" + resDTO.timestamp); | ||
| 374 | + success(resDTO.data); | ||
| 375 | + }).catch((err: Error) => { | ||
| 376 | + Logger.error(TAG, `getLiveMoreUrl catch, error.name : ${err.name}, error.message:${err.message}`); | ||
| 377 | + error(err); | ||
| 378 | + }) | ||
| 379 | + }) | ||
| 380 | + } | ||
| 357 | } | 381 | } |
| 358 | 382 | ||
| 359 | 383 |
sight_harmony/features/wdComponent/src/main/resources/base/media/icon_live_status_running.png
0 → 100644
1.26 KB
342 Bytes
| @@ -17,6 +17,8 @@ | @@ -17,6 +17,8 @@ | ||
| 17 | "pages/SearchPage", | 17 | "pages/SearchPage", |
| 18 | "pages/SearchCreatorPage", | 18 | "pages/SearchCreatorPage", |
| 19 | "components/page/PeopleShipHomePage", | 19 | "components/page/PeopleShipHomePage", |
| 20 | - "pages/MultiPictureListPage" | 20 | + "pages/MultiPictureListPage", |
| 21 | + "components/page/LiveMorePage", | ||
| 22 | + "components/page/ReserveMorePage" | ||
| 21 | ] | 23 | ] |
| 22 | } | 24 | } |
| @@ -224,7 +224,7 @@ export class LoginModel { | @@ -224,7 +224,7 @@ export class LoginModel { | ||
| 224 | let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); | 224 | let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); |
| 225 | 225 | ||
| 226 | return new Promise<string>((success, fail) => { | 226 | return new Promise<string>((success, fail) => { |
| 227 | - HttpBizUtil.post<string>(HttpUrlUtils.getLogoutUrl(), bean, headers).then((data: ResponseDTO<string>)=>{ | 227 | + HttpBizUtil.post<ResponseDTO<string>>(HttpUrlUtils.getLogoutUrl(), bean, headers).then((data: ResponseDTO<string>)=>{ |
| 228 | if (!data) { | 228 | if (!data) { |
| 229 | fail("数据为空") | 229 | fail("数据为空") |
| 230 | return | 230 | return |
-
Please register or login to post a comment