wangliang_wd

Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool into main

* 'main' of http://192.168.1.42/developOne/harmonyPool:
  早晚报头版现网数据替换本地数据
... ... @@ -2,6 +2,7 @@ export interface Group {
blockDesc: string;
groupStrategy: number;
id: number;
// itemNum?: any;
showType: number;
sortValue: number;
}
\ No newline at end of file
... ...
... ... @@ -8,6 +8,9 @@ export interface PageInfoBean {
baselineColor: string;
baselineCopywriting: string;
baselineShow: number;
// channelInfo?: any;
// cornersAdv?: any;
// cornersAdv2: any[];
description: string;
groups: Group[];
hasAdInfo: number;
... ... @@ -15,8 +18,10 @@ export interface PageInfoBean {
id: number;
mainLogoImgUrl: string;
name: string;
// pageTopParams?: any;
pageTopType: number;
pageType: number;
// popUps: any[];
pushupLogoImgUrl: string;
shareCoverUrl: string;
shareIconUrl: string;
... ... @@ -27,7 +32,4 @@ export interface PageInfoBean {
templateType: number;
titleColor: string;
topicInfo: TopicInfo;
}
}
\ No newline at end of file
... ...
import { FrontLinkObject } from '../component/FrontLinkObject';
export interface TopicInfo {
axisColor: string;
// channelId?: any;
commentFlag: number;
commentPreviewFlag: number;
commentShowFlag: number;
// frontFlag?: any;
frontLinkObject?: FrontLinkObject;
posterFlag: number;
posterUrl: string;
// relId?: any;
// relObjectId?: any;
// relType?: any;
shareCoverUrl: string;
shareOpen: number;
sharePosterCoverUrl: string;
// sharePosterOpen?: any;
shareSummary: string;
shareTitle: string;
shareUrl: string;
... ... @@ -18,7 +27,9 @@ export interface TopicInfo {
topicDate: string;
topicId: string;
topicPattern: number;
// topicTemplate?: any;
topicType: number;
transluceImgUrl: string;
visitorComment: number;
// voteInfo?: any;
}
\ No newline at end of file
... ...
import { MorningEveningPaperDTO, PageInfoBean } from 'wdBean'
import { Logger } from 'wdKit/Index';
import { DateTimeUtils } from 'wdKit/src/main/ets/utils/DateTimeUtils';
// import { FrontLinkObject, MorningEveningPaperDTO, PageInfoBean } from 'wdBean';
import { PageInfoBean } from 'wdBean';
import { DateTimeUtils, Logger } from 'wdKit/Index';
import { MorningEveningViewModel } from '../../viewmodel/MorningEveningViewModel';
import { AudioBarView } from './AudioBarView';
import { PaperTitleComponent } from './PaperTitleComponent';
... ... @@ -15,37 +15,43 @@ const PATTERN_DATE_CN_RN: string = 'yyyy年\nMM月dd日'; // 日期中包含包
@Component
export struct MorningEveningPaperComponent {
@State pageInfoBean: PageInfoBean = {} as PageInfoBean
@State morningEveningPaperDTO: MorningEveningPaperDTO = {
name: "新闻夜读",
topicInfo: {
frontLinkObject: {
coverSize: "599*798",
coverUrl: "https://cdnjdphoto.aikan.pdnews.cn/zhbj-20240116/image/content/9a91a96077174087852cf93c5e26acce.jpeg",
newsId: "30002086032",
newsRelId: 500000256225,
summary: "欧尔班多次明确反对欧盟此举。2023年底,匈牙利否决了欧盟对乌克兰的500亿欧元援助计划,认为欧盟不应向乌克兰提供更多资金,而应尽快结束俄乌冲突。因此,欧盟领导人在去年12月欧盟峰会上未能就该计划达成一致。欧尔班多次明确反对欧盟此举。2023年底,匈牙利否决了欧盟对乌克兰的500亿欧元援助计划,认为欧盟不应向乌克兰提供更多资金,而应尽快结束俄乌冲突。因此,欧盟领导人在去年12月欧盟峰会上未能就该计",
title: "匈牙利总理欧尔班妥协,阻碍欧盟向乌克兰援助的最后一个障碍被解"
},
title: "新闻夜读",
topicDate: "2024-01-16",
topicId: "10000002068",
}
} as MorningEveningPaperDTO
// @State morningEveningPaperDTO: MorningEveningPaperDTO = {
// name: "新闻夜读",
// topicInfo: {
// frontLinkObject: {
// coverSize: "599*798",
// coverUrl: "https://cdnjdphoto.aikan.pdnews.cn/zhbj-20240116/image/content/9a91a96077174087852cf93c5e26acce.jpeg",
// newsId: "30002086032",
// newsRelId: 500000256225,
// summary: "欧尔班多次明确反对欧盟此举。2023年底,匈牙利否决了欧盟对乌克兰的500亿欧元援助计划,认为欧盟不应向乌克兰提供更多资金,而应尽快结束俄乌冲突。因此,欧盟领导人在去年12月欧盟峰会上未能就该计划达成一致。欧尔班多次明确反对欧盟此举。2023年底,匈牙利否决了欧盟对乌克兰的500亿欧元援助计划,认为欧盟不应向乌克兰提供更多资金,而应尽快结束俄乌冲突。因此,欧盟领导人在去年12月欧盟峰会上未能就该计",
// title: "匈牙利总理欧尔班妥协,阻碍欧盟向乌克兰援助的最后一个障碍被解"
// },
// title: "新闻夜读",
// topicDate: "2024-01-16",
// topicId: "10000002068",
// }
// } as MorningEveningPaperDTO
@State subTitle: string = ''
async aboutToAppear() {
console.info(TAG, `aboutToAppear`);
let dateTime = DateTimeUtils.parseDate(this.morningEveningPaperDTO?.topicInfo?.topicDate ?? '', DateTimeUtils.PATTERN_DATE_HYPHEN);
this.subTitle = DateTimeUtils.formatDate(dateTime, PATTERN_DATE_CN_RN)
console.info(TAG, `aboutToAppear`)
const currentTime = new Date().getTime()
Logger.info(TAG, "currentTime = " + currentTime)
Logger.info(TAG, `currentTime = ${currentTime}`)
try {
let listBean = await MorningEveningViewModel.getMorningEveningPageInfo("28927")
Logger.info(TAG,"listBean title = "+listBean.topicInfo.title)
Logger.info(TAG,"listBean topicDate = "+listBean.topicInfo.topicDate)
this.pageInfoBean = listBean;
let compInfoBean = await MorningEveningViewModel.getMorningEveningCompInfo("28927")
Logger.info(TAG,"compInfoBean compStyle = "+compInfoBean.compList[0].compStyle)
let pageInfoBean = await MorningEveningViewModel.getMorningEveningPageInfo("28927")
this.pageInfoBean = pageInfoBean;
let dateTime = DateTimeUtils.parseDate(this.pageInfoBean?.topicInfo?.topicDate ?? '', DateTimeUtils.PATTERN_DATE_HYPHEN);
this.subTitle = DateTimeUtils.formatDate(dateTime, PATTERN_DATE_CN_RN)
Logger.info(TAG, "pageInfoBean topicDate = " + this.pageInfoBean?.topicInfo?.topicDate)
Logger.info(TAG, "pageInfoBean title = " + this.pageInfoBean?.topicInfo?.title)
Logger.info(TAG, "pageInfoBean dateTime = " + dateTime)
Logger.info(TAG, "pageInfoBean subTitle = " + this.subTitle)
let compInfoBean = await MorningEveningViewModel.getMorningEveningCompInfo(pageInfoBean?.id, pageInfoBean?.groups[0]?.id, currentTime + "")
Logger.info(TAG, "compInfoBean compStyle = " + compInfoBean.compList[0].compStyle)
} catch (exception) {
}
... ... @@ -54,8 +60,11 @@ export struct MorningEveningPaperComponent {
build() {
Stack({ alignContent: Alignment.Top }) {
List() {
ListItem() {
topicInfoView({ frontLinkObject: this.morningEveningPaperDTO?.topicInfo?.frontLinkObject })
if (this.pageInfoBean?.topicInfo?.frontLinkObject) {
ListItem() {
topicInfoView({ frontLinkObject: this.pageInfoBean?.topicInfo?.frontLinkObject })
}
}
ListItem() {
... ... @@ -72,11 +81,12 @@ export struct MorningEveningPaperComponent {
.margin({ left: 14, right: 14 })
PaperTitleComponent({
title: this.morningEveningPaperDTO?.topicInfo?.title ?? "",
// title: this.morningEveningPaperDTO?.topicInfo?.title ?? "",
title: this.pageInfoBean?.topicInfo?.title ?? "",
// subtitle: this.morningEveningPaperDTO?.topicInfo?.topicDate ?? ''
subtitle: this.subTitle
})
.margin({ left: 14, right: 14 })
.margin({ left: 14, right: 14 })
}
.width('100%')
// .backgroundColor('#000080')
... ...
... ... @@ -6,14 +6,16 @@ import { FrontLinkObject } from 'wdBean';
@Entry
@Component
export struct topicInfoView {
@State frontLinkObject: FrontLinkObject = {
coverSize: "599*798",
coverUrl: "https://cdnjdphoto.aikan.pdnews.cn/zhbj-20240116/image/content/9a91a96077174087852cf93c5e26acce.jpeg",
newsId: "30002086032",
newsRelId: 500000256225,
summary: "欧尔班多次明确反对欧盟此举。2023年底,匈牙利否决了欧盟对乌克兰的500亿欧元援助计划,认为欧盟不应向乌克兰提供更多资金,而应尽快结束俄乌冲突。因此,欧盟领导人在去年12月欧盟峰会上未能就该计划达成一致。欧尔班多次明确反对欧盟此举。2023年底,匈牙利否决了欧盟对乌克兰的500亿欧元援助计划,认为欧盟不应向乌克兰提供更多资金,而应尽快结束俄乌冲突。因此,欧盟领导人在去年12月欧盟峰会上未能就该计",
title: "匈牙利总理欧尔班妥协,阻碍欧盟向乌克兰援助的最后一个障碍被解"
} as FrontLinkObject
// @State frontLinkObject: FrontLinkObject = {
// coverSize: "599*798",
// coverUrl: "https://cdnjdphoto.aikan.pdnews.cn/zhbj-20240116/image/content/9a91a96077174087852cf93c5e26acce.jpeg",
// newsId: "30002086032",
// newsRelId: 500000256225,
// summary: "欧尔班多次明确反对欧盟此举。2023年底,匈牙利否决了欧盟对乌克兰的500亿欧元援助计划,认为欧盟不应向乌克兰提供更多资金,而应尽快结束俄乌冲突。因此,欧盟领导人在去年12月欧盟峰会上未能就该计划达成一致。欧尔班多次明确反对欧盟此举。2023年底,匈牙利否决了欧盟对乌克兰的500亿欧元援助计划,认为欧盟不应向乌克兰提供更多资金,而应尽快结束俄乌冲突。因此,欧盟领导人在去年12月欧盟峰会上未能就该计",
// title: "匈牙利总理欧尔班妥协,阻碍欧盟向乌克兰援助的最后一个障碍被解"
// } as FrontLinkObject
frontLinkObject: FrontLinkObject = {} as FrontLinkObject
aboutToAppear() {
}
... ...
... ... @@ -88,11 +88,21 @@ export class PageRepository {
/**
* 早晚报compInfo请求
* pageId:页面id
* groupId:楼层id
* pageNum:页码,默认1
* pageSize:页数,默认20
* refreshTime:第一页刷新时间,用于频道分页排序时过滤,查询时携带【首刷、下拉取当前最新时间;其他的都使用首刷的时间】
*
* 可选
* channelId:频道id
* channelStrategy:频道策略
* topicId:专题id
* */
static getMorningEveningCompInfoUrl(pageId: string) {
static getMorningEveningCompInfoUrl(pageId: number,groupId:number,refreshTime:string,pageNum:number,pageSize:number) {
let url = HttpUrlUtils.getHost() + HttpUrlUtils.MORNING_EVENING_COMP_INFO_PATH;
url = url + "?loadStrategy=first_load&pageNum=1&refreshTime=1710853254592&pageId="
+pageId+"&channelStrategy=2&groupId=40621&topicId=10000009445&pageSize=20";
url = url + "?loadStrategy=first_load&pageNum="+pageNum+"&refreshTime="+refreshTime+"&pageId="
+pageId+"&channelStrategy=2&groupId="+groupId+"&topicId=10000009445&pageSize="+pageSize;
Logger.info(TAG,"getMorningEveningCompInfoUrl url = "+url)
return url;
}
... ... @@ -160,8 +170,8 @@ export class PageRepository {
/**
* 获取早晚报compInfo
* */
static fetchMorningEveningCompInfo(pageId: string) {
let url = PageRepository.getMorningEveningCompInfoUrl(pageId)
static fetchMorningEveningCompInfo(pageId: number,groupId:number,refreshTime:string,pageNum:number,pageSize:number) {
let url = PageRepository.getMorningEveningCompInfoUrl(pageId,groupId,refreshTime,pageNum,pageSize)
let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
return WDHttp.get<ResponseDTO<CompInfoBean>>(url, headers)
};
... ...
... ... @@ -31,10 +31,10 @@ export class MorningEveningViewModel {
})
}
static async getMorningEveningCompInfo(pageId: string): Promise<CompInfoBean> {
static async getMorningEveningCompInfo(pageId: number,groupId:number,refreshTime:string,pageNum:number = 1,pageSize:number = 20): Promise<CompInfoBean> {
return new Promise<CompInfoBean>((success, error) => {
Logger.info(TAG, `getMorningEveningCompInfo pageInfo start`);
PageRepository.fetchMorningEveningCompInfo(pageId).then((resDTO: ResponseDTO<CompInfoBean>) => {
PageRepository.fetchMorningEveningCompInfo(pageId,groupId,refreshTime,pageNum,pageSize).then((resDTO: ResponseDTO<CompInfoBean>) => {
if (!resDTO || !resDTO.data) {
Logger.error(TAG, 'getMorningEveningCompInfo then navResDTO is empty');
error('resDTO is empty');
... ...