Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool into main
* 'main' of http://192.168.1.42/developOne/harmonyPool: 早晚报头版现网数据替换本地数据
Showing
7 changed files
with
85 additions
and
49 deletions
| @@ -2,6 +2,7 @@ export interface Group { | @@ -2,6 +2,7 @@ export interface Group { | ||
| 2 | blockDesc: string; | 2 | blockDesc: string; |
| 3 | groupStrategy: number; | 3 | groupStrategy: number; |
| 4 | id: number; | 4 | id: number; |
| 5 | + // itemNum?: any; | ||
| 5 | showType: number; | 6 | showType: number; |
| 6 | sortValue: number; | 7 | sortValue: number; |
| 7 | } | 8 | } |
| @@ -8,6 +8,9 @@ export interface PageInfoBean { | @@ -8,6 +8,9 @@ export interface PageInfoBean { | ||
| 8 | baselineColor: string; | 8 | baselineColor: string; |
| 9 | baselineCopywriting: string; | 9 | baselineCopywriting: string; |
| 10 | baselineShow: number; | 10 | baselineShow: number; |
| 11 | + // channelInfo?: any; | ||
| 12 | + // cornersAdv?: any; | ||
| 13 | + // cornersAdv2: any[]; | ||
| 11 | description: string; | 14 | description: string; |
| 12 | groups: Group[]; | 15 | groups: Group[]; |
| 13 | hasAdInfo: number; | 16 | hasAdInfo: number; |
| @@ -15,8 +18,10 @@ export interface PageInfoBean { | @@ -15,8 +18,10 @@ export interface PageInfoBean { | ||
| 15 | id: number; | 18 | id: number; |
| 16 | mainLogoImgUrl: string; | 19 | mainLogoImgUrl: string; |
| 17 | name: string; | 20 | name: string; |
| 21 | + // pageTopParams?: any; | ||
| 18 | pageTopType: number; | 22 | pageTopType: number; |
| 19 | pageType: number; | 23 | pageType: number; |
| 24 | + // popUps: any[]; | ||
| 20 | pushupLogoImgUrl: string; | 25 | pushupLogoImgUrl: string; |
| 21 | shareCoverUrl: string; | 26 | shareCoverUrl: string; |
| 22 | shareIconUrl: string; | 27 | shareIconUrl: string; |
| @@ -28,6 +33,3 @@ export interface PageInfoBean { | @@ -28,6 +33,3 @@ export interface PageInfoBean { | ||
| 28 | titleColor: string; | 33 | titleColor: string; |
| 29 | topicInfo: TopicInfo; | 34 | topicInfo: TopicInfo; |
| 30 | } | 35 | } |
| 31 | - | ||
| 32 | - | ||
| 33 | - |
| 1 | +import { FrontLinkObject } from '../component/FrontLinkObject'; | ||
| 2 | + | ||
| 1 | export interface TopicInfo { | 3 | export interface TopicInfo { |
| 2 | axisColor: string; | 4 | axisColor: string; |
| 5 | + // channelId?: any; | ||
| 3 | commentFlag: number; | 6 | commentFlag: number; |
| 4 | commentPreviewFlag: number; | 7 | commentPreviewFlag: number; |
| 5 | commentShowFlag: number; | 8 | commentShowFlag: number; |
| 9 | + // frontFlag?: any; | ||
| 10 | + frontLinkObject?: FrontLinkObject; | ||
| 6 | posterFlag: number; | 11 | posterFlag: number; |
| 7 | posterUrl: string; | 12 | posterUrl: string; |
| 13 | + // relId?: any; | ||
| 14 | + // relObjectId?: any; | ||
| 15 | + // relType?: any; | ||
| 8 | shareCoverUrl: string; | 16 | shareCoverUrl: string; |
| 9 | shareOpen: number; | 17 | shareOpen: number; |
| 10 | sharePosterCoverUrl: string; | 18 | sharePosterCoverUrl: string; |
| 19 | + // sharePosterOpen?: any; | ||
| 11 | shareSummary: string; | 20 | shareSummary: string; |
| 12 | shareTitle: string; | 21 | shareTitle: string; |
| 13 | shareUrl: string; | 22 | shareUrl: string; |
| @@ -18,7 +27,9 @@ export interface TopicInfo { | @@ -18,7 +27,9 @@ export interface TopicInfo { | ||
| 18 | topicDate: string; | 27 | topicDate: string; |
| 19 | topicId: string; | 28 | topicId: string; |
| 20 | topicPattern: number; | 29 | topicPattern: number; |
| 30 | + // topicTemplate?: any; | ||
| 21 | topicType: number; | 31 | topicType: number; |
| 22 | transluceImgUrl: string; | 32 | transluceImgUrl: string; |
| 23 | visitorComment: number; | 33 | visitorComment: number; |
| 34 | + // voteInfo?: any; | ||
| 24 | } | 35 | } |
| 1 | -import { MorningEveningPaperDTO, PageInfoBean } from 'wdBean' | ||
| 2 | -import { Logger } from 'wdKit/Index'; | ||
| 3 | -import { DateTimeUtils } from 'wdKit/src/main/ets/utils/DateTimeUtils'; | 1 | +// import { FrontLinkObject, MorningEveningPaperDTO, PageInfoBean } from 'wdBean'; |
| 2 | +import { PageInfoBean } from 'wdBean'; | ||
| 3 | +import { DateTimeUtils, Logger } from 'wdKit/Index'; | ||
| 4 | import { MorningEveningViewModel } from '../../viewmodel/MorningEveningViewModel'; | 4 | import { MorningEveningViewModel } from '../../viewmodel/MorningEveningViewModel'; |
| 5 | import { AudioBarView } from './AudioBarView'; | 5 | import { AudioBarView } from './AudioBarView'; |
| 6 | import { PaperTitleComponent } from './PaperTitleComponent'; | 6 | import { PaperTitleComponent } from './PaperTitleComponent'; |
| @@ -15,37 +15,43 @@ const PATTERN_DATE_CN_RN: string = 'yyyy年\nMM月dd日'; // 日期中包含包 | @@ -15,37 +15,43 @@ const PATTERN_DATE_CN_RN: string = 'yyyy年\nMM月dd日'; // 日期中包含包 | ||
| 15 | @Component | 15 | @Component |
| 16 | export struct MorningEveningPaperComponent { | 16 | export struct MorningEveningPaperComponent { |
| 17 | @State pageInfoBean: PageInfoBean = {} as PageInfoBean | 17 | @State pageInfoBean: PageInfoBean = {} as PageInfoBean |
| 18 | - | ||
| 19 | - @State morningEveningPaperDTO: MorningEveningPaperDTO = { | ||
| 20 | - name: "新闻夜读", | ||
| 21 | - topicInfo: { | ||
| 22 | - frontLinkObject: { | ||
| 23 | - coverSize: "599*798", | ||
| 24 | - coverUrl: "https://cdnjdphoto.aikan.pdnews.cn/zhbj-20240116/image/content/9a91a96077174087852cf93c5e26acce.jpeg", | ||
| 25 | - newsId: "30002086032", | ||
| 26 | - newsRelId: 500000256225, | ||
| 27 | - summary: "欧尔班多次明确反对欧盟此举。2023年底,匈牙利否决了欧盟对乌克兰的500亿欧元援助计划,认为欧盟不应向乌克兰提供更多资金,而应尽快结束俄乌冲突。因此,欧盟领导人在去年12月欧盟峰会上未能就该计划达成一致。欧尔班多次明确反对欧盟此举。2023年底,匈牙利否决了欧盟对乌克兰的500亿欧元援助计划,认为欧盟不应向乌克兰提供更多资金,而应尽快结束俄乌冲突。因此,欧盟领导人在去年12月欧盟峰会上未能就该计", | ||
| 28 | - title: "匈牙利总理欧尔班妥协,阻碍欧盟向乌克兰援助的最后一个障碍被解" | ||
| 29 | - }, | ||
| 30 | - title: "新闻夜读", | ||
| 31 | - topicDate: "2024-01-16", | ||
| 32 | - topicId: "10000002068", | ||
| 33 | - } | ||
| 34 | - } as MorningEveningPaperDTO | 18 | + // @State morningEveningPaperDTO: MorningEveningPaperDTO = { |
| 19 | + // name: "新闻夜读", | ||
| 20 | + // topicInfo: { | ||
| 21 | + // frontLinkObject: { | ||
| 22 | + // coverSize: "599*798", | ||
| 23 | + // coverUrl: "https://cdnjdphoto.aikan.pdnews.cn/zhbj-20240116/image/content/9a91a96077174087852cf93c5e26acce.jpeg", | ||
| 24 | + // newsId: "30002086032", | ||
| 25 | + // newsRelId: 500000256225, | ||
| 26 | + // summary: "欧尔班多次明确反对欧盟此举。2023年底,匈牙利否决了欧盟对乌克兰的500亿欧元援助计划,认为欧盟不应向乌克兰提供更多资金,而应尽快结束俄乌冲突。因此,欧盟领导人在去年12月欧盟峰会上未能就该计划达成一致。欧尔班多次明确反对欧盟此举。2023年底,匈牙利否决了欧盟对乌克兰的500亿欧元援助计划,认为欧盟不应向乌克兰提供更多资金,而应尽快结束俄乌冲突。因此,欧盟领导人在去年12月欧盟峰会上未能就该计", | ||
| 27 | + // title: "匈牙利总理欧尔班妥协,阻碍欧盟向乌克兰援助的最后一个障碍被解" | ||
| 28 | + // }, | ||
| 29 | + // title: "新闻夜读", | ||
| 30 | + // topicDate: "2024-01-16", | ||
| 31 | + // topicId: "10000002068", | ||
| 32 | + // } | ||
| 33 | + // } as MorningEveningPaperDTO | ||
| 35 | @State subTitle: string = '' | 34 | @State subTitle: string = '' |
| 36 | 35 | ||
| 37 | async aboutToAppear() { | 36 | async aboutToAppear() { |
| 38 | - console.info(TAG, `aboutToAppear`); | ||
| 39 | - let dateTime = DateTimeUtils.parseDate(this.morningEveningPaperDTO?.topicInfo?.topicDate ?? '', DateTimeUtils.PATTERN_DATE_HYPHEN); | ||
| 40 | - this.subTitle = DateTimeUtils.formatDate(dateTime, PATTERN_DATE_CN_RN) | 37 | + console.info(TAG, `aboutToAppear`) |
| 41 | 38 | ||
| 39 | + const currentTime = new Date().getTime() | ||
| 40 | + Logger.info(TAG, "currentTime = " + currentTime) | ||
| 41 | + Logger.info(TAG, `currentTime = ${currentTime}`) | ||
| 42 | try { | 42 | try { |
| 43 | - let listBean = await MorningEveningViewModel.getMorningEveningPageInfo("28927") | ||
| 44 | - Logger.info(TAG,"listBean title = "+listBean.topicInfo.title) | ||
| 45 | - Logger.info(TAG,"listBean topicDate = "+listBean.topicInfo.topicDate) | ||
| 46 | - this.pageInfoBean = listBean; | ||
| 47 | - let compInfoBean = await MorningEveningViewModel.getMorningEveningCompInfo("28927") | ||
| 48 | - Logger.info(TAG,"compInfoBean compStyle = "+compInfoBean.compList[0].compStyle) | 43 | + let pageInfoBean = await MorningEveningViewModel.getMorningEveningPageInfo("28927") |
| 44 | + this.pageInfoBean = pageInfoBean; | ||
| 45 | + let dateTime = DateTimeUtils.parseDate(this.pageInfoBean?.topicInfo?.topicDate ?? '', DateTimeUtils.PATTERN_DATE_HYPHEN); | ||
| 46 | + this.subTitle = DateTimeUtils.formatDate(dateTime, PATTERN_DATE_CN_RN) | ||
| 47 | + Logger.info(TAG, "pageInfoBean topicDate = " + this.pageInfoBean?.topicInfo?.topicDate) | ||
| 48 | + Logger.info(TAG, "pageInfoBean title = " + this.pageInfoBean?.topicInfo?.title) | ||
| 49 | + | ||
| 50 | + Logger.info(TAG, "pageInfoBean dateTime = " + dateTime) | ||
| 51 | + Logger.info(TAG, "pageInfoBean subTitle = " + this.subTitle) | ||
| 52 | + | ||
| 53 | + let compInfoBean = await MorningEveningViewModel.getMorningEveningCompInfo(pageInfoBean?.id, pageInfoBean?.groups[0]?.id, currentTime + "") | ||
| 54 | + Logger.info(TAG, "compInfoBean compStyle = " + compInfoBean.compList[0].compStyle) | ||
| 49 | } catch (exception) { | 55 | } catch (exception) { |
| 50 | 56 | ||
| 51 | } | 57 | } |
| @@ -54,8 +60,11 @@ export struct MorningEveningPaperComponent { | @@ -54,8 +60,11 @@ export struct MorningEveningPaperComponent { | ||
| 54 | build() { | 60 | build() { |
| 55 | Stack({ alignContent: Alignment.Top }) { | 61 | Stack({ alignContent: Alignment.Top }) { |
| 56 | List() { | 62 | List() { |
| 63 | + if (this.pageInfoBean?.topicInfo?.frontLinkObject) { | ||
| 64 | + | ||
| 57 | ListItem() { | 65 | ListItem() { |
| 58 | - topicInfoView({ frontLinkObject: this.morningEveningPaperDTO?.topicInfo?.frontLinkObject }) | 66 | + topicInfoView({ frontLinkObject: this.pageInfoBean?.topicInfo?.frontLinkObject }) |
| 67 | + } | ||
| 59 | } | 68 | } |
| 60 | 69 | ||
| 61 | ListItem() { | 70 | ListItem() { |
| @@ -72,7 +81,8 @@ export struct MorningEveningPaperComponent { | @@ -72,7 +81,8 @@ export struct MorningEveningPaperComponent { | ||
| 72 | .margin({ left: 14, right: 14 }) | 81 | .margin({ left: 14, right: 14 }) |
| 73 | 82 | ||
| 74 | PaperTitleComponent({ | 83 | PaperTitleComponent({ |
| 75 | - title: this.morningEveningPaperDTO?.topicInfo?.title ?? "", | 84 | + // title: this.morningEveningPaperDTO?.topicInfo?.title ?? "", |
| 85 | + title: this.pageInfoBean?.topicInfo?.title ?? "", | ||
| 76 | // subtitle: this.morningEveningPaperDTO?.topicInfo?.topicDate ?? '' | 86 | // subtitle: this.morningEveningPaperDTO?.topicInfo?.topicDate ?? '' |
| 77 | subtitle: this.subTitle | 87 | subtitle: this.subTitle |
| 78 | }) | 88 | }) |
| @@ -6,14 +6,16 @@ import { FrontLinkObject } from 'wdBean'; | @@ -6,14 +6,16 @@ import { FrontLinkObject } from 'wdBean'; | ||
| 6 | @Entry | 6 | @Entry |
| 7 | @Component | 7 | @Component |
| 8 | export struct topicInfoView { | 8 | export struct topicInfoView { |
| 9 | - @State frontLinkObject: FrontLinkObject = { | ||
| 10 | - coverSize: "599*798", | ||
| 11 | - coverUrl: "https://cdnjdphoto.aikan.pdnews.cn/zhbj-20240116/image/content/9a91a96077174087852cf93c5e26acce.jpeg", | ||
| 12 | - newsId: "30002086032", | ||
| 13 | - newsRelId: 500000256225, | ||
| 14 | - summary: "欧尔班多次明确反对欧盟此举。2023年底,匈牙利否决了欧盟对乌克兰的500亿欧元援助计划,认为欧盟不应向乌克兰提供更多资金,而应尽快结束俄乌冲突。因此,欧盟领导人在去年12月欧盟峰会上未能就该计划达成一致。欧尔班多次明确反对欧盟此举。2023年底,匈牙利否决了欧盟对乌克兰的500亿欧元援助计划,认为欧盟不应向乌克兰提供更多资金,而应尽快结束俄乌冲突。因此,欧盟领导人在去年12月欧盟峰会上未能就该计", | ||
| 15 | - title: "匈牙利总理欧尔班妥协,阻碍欧盟向乌克兰援助的最后一个障碍被解" | ||
| 16 | - } as FrontLinkObject | 9 | + // @State frontLinkObject: FrontLinkObject = { |
| 10 | + // coverSize: "599*798", | ||
| 11 | + // coverUrl: "https://cdnjdphoto.aikan.pdnews.cn/zhbj-20240116/image/content/9a91a96077174087852cf93c5e26acce.jpeg", | ||
| 12 | + // newsId: "30002086032", | ||
| 13 | + // newsRelId: 500000256225, | ||
| 14 | + // summary: "欧尔班多次明确反对欧盟此举。2023年底,匈牙利否决了欧盟对乌克兰的500亿欧元援助计划,认为欧盟不应向乌克兰提供更多资金,而应尽快结束俄乌冲突。因此,欧盟领导人在去年12月欧盟峰会上未能就该计划达成一致。欧尔班多次明确反对欧盟此举。2023年底,匈牙利否决了欧盟对乌克兰的500亿欧元援助计划,认为欧盟不应向乌克兰提供更多资金,而应尽快结束俄乌冲突。因此,欧盟领导人在去年12月欧盟峰会上未能就该计", | ||
| 15 | + // title: "匈牙利总理欧尔班妥协,阻碍欧盟向乌克兰援助的最后一个障碍被解" | ||
| 16 | + // } as FrontLinkObject | ||
| 17 | + | ||
| 18 | + frontLinkObject: FrontLinkObject = {} as FrontLinkObject | ||
| 17 | 19 | ||
| 18 | aboutToAppear() { | 20 | aboutToAppear() { |
| 19 | } | 21 | } |
| @@ -88,11 +88,21 @@ export class PageRepository { | @@ -88,11 +88,21 @@ export class PageRepository { | ||
| 88 | 88 | ||
| 89 | /** | 89 | /** |
| 90 | * 早晚报compInfo请求 | 90 | * 早晚报compInfo请求 |
| 91 | + * pageId:页面id | ||
| 92 | + * groupId:楼层id | ||
| 93 | + * pageNum:页码,默认1 | ||
| 94 | + * pageSize:页数,默认20 | ||
| 95 | + * refreshTime:第一页刷新时间,用于频道分页排序时过滤,查询时携带【首刷、下拉取当前最新时间;其他的都使用首刷的时间】 | ||
| 96 | + * | ||
| 97 | + * 可选 | ||
| 98 | + * channelId:频道id | ||
| 99 | + * channelStrategy:频道策略 | ||
| 100 | + * topicId:专题id | ||
| 91 | * */ | 101 | * */ |
| 92 | - static getMorningEveningCompInfoUrl(pageId: string) { | 102 | + static getMorningEveningCompInfoUrl(pageId: number,groupId:number,refreshTime:string,pageNum:number,pageSize:number) { |
| 93 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.MORNING_EVENING_COMP_INFO_PATH; | 103 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.MORNING_EVENING_COMP_INFO_PATH; |
| 94 | - url = url + "?loadStrategy=first_load&pageNum=1&refreshTime=1710853254592&pageId=" | ||
| 95 | - +pageId+"&channelStrategy=2&groupId=40621&topicId=10000009445&pageSize=20"; | 104 | + url = url + "?loadStrategy=first_load&pageNum="+pageNum+"&refreshTime="+refreshTime+"&pageId=" |
| 105 | + +pageId+"&channelStrategy=2&groupId="+groupId+"&topicId=10000009445&pageSize="+pageSize; | ||
| 96 | Logger.info(TAG,"getMorningEveningCompInfoUrl url = "+url) | 106 | Logger.info(TAG,"getMorningEveningCompInfoUrl url = "+url) |
| 97 | return url; | 107 | return url; |
| 98 | } | 108 | } |
| @@ -160,8 +170,8 @@ export class PageRepository { | @@ -160,8 +170,8 @@ export class PageRepository { | ||
| 160 | /** | 170 | /** |
| 161 | * 获取早晚报compInfo | 171 | * 获取早晚报compInfo |
| 162 | * */ | 172 | * */ |
| 163 | - static fetchMorningEveningCompInfo(pageId: string) { | ||
| 164 | - let url = PageRepository.getMorningEveningCompInfoUrl(pageId) | 173 | + static fetchMorningEveningCompInfo(pageId: number,groupId:number,refreshTime:string,pageNum:number,pageSize:number) { |
| 174 | + let url = PageRepository.getMorningEveningCompInfoUrl(pageId,groupId,refreshTime,pageNum,pageSize) | ||
| 165 | let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); | 175 | let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); |
| 166 | return WDHttp.get<ResponseDTO<CompInfoBean>>(url, headers) | 176 | return WDHttp.get<ResponseDTO<CompInfoBean>>(url, headers) |
| 167 | }; | 177 | }; |
| @@ -31,10 +31,10 @@ export class MorningEveningViewModel { | @@ -31,10 +31,10 @@ export class MorningEveningViewModel { | ||
| 31 | }) | 31 | }) |
| 32 | } | 32 | } |
| 33 | 33 | ||
| 34 | - static async getMorningEveningCompInfo(pageId: string): Promise<CompInfoBean> { | 34 | + static async getMorningEveningCompInfo(pageId: number,groupId:number,refreshTime:string,pageNum:number = 1,pageSize:number = 20): Promise<CompInfoBean> { |
| 35 | return new Promise<CompInfoBean>((success, error) => { | 35 | return new Promise<CompInfoBean>((success, error) => { |
| 36 | Logger.info(TAG, `getMorningEveningCompInfo pageInfo start`); | 36 | Logger.info(TAG, `getMorningEveningCompInfo pageInfo start`); |
| 37 | - PageRepository.fetchMorningEveningCompInfo(pageId).then((resDTO: ResponseDTO<CompInfoBean>) => { | 37 | + PageRepository.fetchMorningEveningCompInfo(pageId,groupId,refreshTime,pageNum,pageSize).then((resDTO: ResponseDTO<CompInfoBean>) => { |
| 38 | if (!resDTO || !resDTO.data) { | 38 | if (!resDTO || !resDTO.data) { |
| 39 | Logger.error(TAG, 'getMorningEveningCompInfo then navResDTO is empty'); | 39 | Logger.error(TAG, 'getMorningEveningCompInfo then navResDTO is empty'); |
| 40 | error('resDTO is empty'); | 40 | error('resDTO is empty'); |
-
Please register or login to post a comment