zhenghy

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

# Conflicts:
#	sight_harmony/features/wdComponent/src/main/ets/components/page/PageComponent.ets
... ... @@ -50,6 +50,8 @@ export { GroupDTO } from './src/main/ets/bean/component/GroupDTO';
export { CompDTO } from './src/main/ets/bean/component/CompDTO';
export { LiveReviewDTO } from './src/main/ets/bean/component/LiveReviewDTO';
export { NewspaperListBean } from './src/main/ets/bean/newspaper/NewspaperListBean';
export { NewspaperListItemBean } from './src/main/ets/bean/newspaper/NewspaperListItemBean';
... ...
import { ContentDTO } from '../content/ContentDTO';
export interface LiveReviewDTO {
hasNext: boolean;
pageNum: number;
pageSize: number;
totalCount: number;
list: ContentDTO[];
}
\ No newline at end of file
... ...
... ... @@ -62,9 +62,11 @@ export interface ContentDTO {
// 二次请求接口,返回的数据,这里组装到content里;
interactData:InteractDataDTO;
hasMore: number,
slideShows: slideShows[],
voiceInfo: VoiceInfoDTO,
tagWord: number,
rmhInfo: RmhInfoDTO, // 人民号信息
hasMore: number;
slideShows: slideShows[];
voiceInfo: VoiceInfoDTO;
tagWord: number;
rmhInfo: RmhInfoDTO; // 人民号信息
photoNum: string;
}
\ No newline at end of file
... ...
... ... @@ -3,6 +3,7 @@ export interface FullColumnImgUrlDTO {
height: number;
landscape: number;
size: number | null;
url: string;
url: string; // 图片地址--列表显示
weight: number;
fullUrl: string; // 图片地址--预览地址使用;【人民号动态卡预览】
}
... ...
... ... @@ -42,12 +42,14 @@ export struct CardParser {
Card9Component({ contentDTO })
} else if (contentDTO.appStyle === CompStyle.Card_10) {
Card10Component({ contentDTO })
} else if (contentDTO.appStyle === CompStyle.Card_15) {
// Card15Component({ contentDTO })
} else if (contentDTO.appStyle === CompStyle.Card_11) {
Card11Component({ contentDTO })
} else if (contentDTO.appStyle === CompStyle.Card_15) {
Card15Component({ contentDTO })
} else if (contentDTO.appStyle === CompStyle.Card_17) {
Card17Component({ contentDTO })
} else if (contentDTO.appStyle === CompStyle.Card_19) {
Card19Component({ contentDTO })
} else if (contentDTO.appStyle === CompStyle.Card_20) {
Card20Component({ contentDTO })
}
... ...
import { ContentDTO } from 'wdBean/Index'
import { DateTimeUtils } from 'wdKit/Index'
/**
... ... @@ -6,35 +7,81 @@ import { DateTimeUtils } from 'wdKit/Index'
* 音频: 音频图标+时长
* 视频:点播图标+时长;直播图标+'直播中'
*/
@Preview
@Component
export struct CardMediaInfo {
@State duration: number = 0 // 如果有duraion,代表点播,显示时长;如果不传或者传0,显示直播中
@State mediaType: string = 'video' // audio: 音频;video: 视频
@State contentDTO: ContentDTO = {} as ContentDTO // 如果有duraion,代表点播,显示时长;如果不传或者传0,显示直播中
// objectType 0:不跳转 1:点播,2:直播,3:活动,4:广告,5:专题,6:链接,7:榜单,8:图文,9:组图,10:H5新闻,11:频道,12:组件,13:音频,
// 14动态图文,15动态视频16问政;100人民号,101标签
build() {
Row() {
if (this.mediaType === 'audio') {
Image($r('app.media.broadcast_listen'))
.height(14)
.borderRadius($r('app.float.button_border_radius'))
} else {
Image(this.duration ? $r('app.media.videoTypeIcon') : $r('app.media.icon_live'))
.width(22)
.height(18)
.borderRadius($r('app.float.button_border_radius'))
if(this.contentDTO.objectType === '1') {
// 显示点播
Row(){
Image($r('app.media.videoTypeIcon'))
.width(22)
.height(18)
.borderRadius($r('app.float.button_border_radius'))
Text(DateTimeUtils.getFormattedDuration(this.contentDTO.videoInfo.videoDuration * 1000))
.fontColor($r('app.color.color_fff'))
.fontSize($r('app.float.font_size_12'))
.width(40)
.height(18)
.textAlign(TextAlign.Center)
.margin({ left: -3 })
}
.backgroundColor('#4d000000')
.borderRadius($r('app.float.button_border_radius'))
} else if(this.contentDTO.objectType === '2') {
// 显示直播信息
Row(){
Image($r('app.media.icon_live'))
.width(22)
.height(18)
.borderRadius($r('app.float.button_border_radius'))
Text('直播中')
.fontColor($r('app.color.color_fff'))
.fontSize($r('app.float.font_size_12'))
.width(40)
.height(18)
.textAlign(TextAlign.Center)
.margin({ left: -3 })
}
.backgroundColor('#4d000000')
.borderRadius($r('app.float.button_border_radius'))
} else if(this.contentDTO.objectType === '9') {
// 显示组图;图片数量
Row(){
Image($r('app.media.album_card_shape'))
.width(22)
.height(18)
.borderRadius($r('app.float.button_border_radius'))
Text(this.contentDTO.photoNum)
.fontColor($r('app.color.color_fff'))
.fontSize($r('app.float.font_size_12'))
.width(20)
.height(18)
.textAlign(TextAlign.Center)
.margin({ left: -3 })
}
.backgroundColor('#4d000000')
.borderRadius($r('app.float.button_border_radius'))
} else if(this.contentDTO.objectType === '13') {
// 显示音频信息
Row(){
Image($r('app.media.broadcast_listen'))
.height(14)
.borderRadius($r('app.float.button_border_radius'))
Text(DateTimeUtils.getFormattedDuration(this.contentDTO.voiceInfo.voiceDuration * 1000))
.fontColor($r('app.color.color_fff'))
.fontSize($r('app.float.font_size_12'))
.width(40)
.height(18)
.textAlign(TextAlign.Center)
.margin({ left: -3 })
}
}
Text(this.duration ? DateTimeUtils.getFormattedDuration(this.duration * 1000) : '直播中')
.fontColor($r('app.color.color_fff'))
.fontSize($r('app.float.font_size_12'))
.width(40)
.height(18)
.textAlign(TextAlign.Center)
.margin({ left: -3 })
}
.backgroundColor(this.mediaType === 'audio' ? '': '#4d000000')
.borderRadius($r('app.float.button_border_radius'))
.margin(6)
}
}
\ No newline at end of file
... ...
//全标题 "appStyle":"2",
import { ContentDTO } from 'wdBean';
import { ProcessUtils } from '../../utils/ProcessUtils';
import { RmhTitle } from '../cardCommon/RmhTitle'
import { CardMediaInfo } from '../cardCommon/CardMediaInfo'
import { CommonConstants } from 'wdConstant/Index';
const TAG: string = 'Card15Component';
... ... @@ -12,89 +13,91 @@ const TAG: string = 'Card15Component';
* 卡片宽度:充满父窗口
* 卡片高度,仅包含横板图片:图片高度由图片的宽度及宽高比决定,图片宽度占父窗口'100%',宽高比为16:9:
*/
// @Entry
@Component
export struct Card15Component {
@State contentDTO: ContentDTO = {} as ContentDTO;
@State contentDTO: ContentDTO = {
// appStyle: '15',
// coverType: 1,
// objectType: '9',
// 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',
// fullColumnImgUrls: [
// {
// landscape: 2,
// size: 1,
// 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',
// weight: 1170
// }
// ],
// newsTitle: '押解画面公开!被湖北民警从柬埔寨押解回国被湖北民警从柬埔寨押解回国的130名涉赌诈嫌疑人是他们被湖北民警从柬埔寨押解回国的130名涉赌诈嫌疑人是他们的130名涉赌诈嫌疑人是他们',
// publishTime: '1712993333000',
// rmhInfo: {
// authIcon: '',
// authTitle: '',
// authTitle2: '',
// banControl: 0,
// cnIsAttention: 1,
// rmhDesc: '中共武汉市委机关报长江日报官方人民号',
// 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',
// rmhId: '4255270',
// rmhName: '长江日报',
// userId: '513696944662469',
// userType: '3'
// },
// videoInfo: {
// firstFrameImageUri: '',
// videoDuration: 12,
// // videoLandscape: 2,
// videoUrl: 'https://rmrbcmsonline.peopleapp.com/rb_recsys/video/2024/0413/VL20Z09ISBEKXZU_963672027208609792.mp4'
// },
// photoNum: '9',
// voiceInfo: {
// voiceDuration: 12
// }
} as ContentDTO;
build() {
Column() {
Column() {
//新闻标题
// rmh信息
RmhTitle({ rmhInfo: this.contentDTO.rmhInfo })
//新闻标题
if (this.contentDTO.newsTitle) {
Text(this.contentDTO.newsTitle)
.fontSize(17)
.fontColor('#222222')
.maxLines(3)
.textOverflow({ overflow: TextOverflow.Ellipsis })// 超出的部分显示省略号。
.align(Alignment.Start)
//大图
Stack() {
Image(this.contentDTO.coverUrl)
.borderRadius(4)
//播放状态+时长
Row() {
Image($r('app.media.icon_live'))
.width(22)
.height(18)
Stack() {
Text('直播中')
.fontColor('#FFFFFF')
.fontSize(11)
}
.width(44)
.height(18)
.backgroundColor('#4d000000')
}.margin({ right: 8, bottom: 8 })
}
.width('100%')
.height(192)
.alignContent(Alignment.BottomEnd)
.margin({ top: 8 })
.fontSize($r('app.float.font_size_17'))
.fontColor($r('app.color.color_222222'))
.width(CommonConstants.FULL_WIDTH)
.textOverflowStyle(2)
.margin({ bottom: 8 })
}
.width('100%')
.justifyContent(FlexAlign.Start)
.alignItems(HorizontalAlign.Start)
.padding({ top: 14 })
//bottom
Row() {
Text(this.contentDTO.source)
.bottomTextStyle()
//间隔点
Image($r('app.media.point'))
.width(12)
.height(12)
Text(this.contentDTO.source)
.bottomTextStyle()
Text(' ')
Text(this.contentDTO.subtitle)
.bottomTextStyle()
//大图
Stack() {
Image(this.contentDTO.coverUrl)
.borderRadius($r('app.float.image_border_radius'))
//播放状态+时长
CardMediaInfo({
contentDTO: this.contentDTO
})
}
.width('100%')
.height(18)
.justifyContent(FlexAlign.Start)
// .padding({bottom:14})
.margin({ top: 8 })
.width(CommonConstants.FULL_WIDTH)
.aspectRatio(16 / 9)
.alignContent(Alignment.BottomEnd)
//TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件
}
.width('100%')
.padding({ left: 16, right: 16 })
.padding({
left: $r('app.float.card_comp_pagePadding_lf'),
right: $r('app.float.card_comp_pagePadding_lf'),
top: $r('app.float.card_comp_pagePadding_tb'),
bottom: $r('app.float.card_comp_pagePadding_tb')
})
.onClick((event: ClickEvent) => {
ProcessUtils.processPage(this.contentDTO)
})
}
}
@Extend(Text)
function bottomTextStyle() {
.fontSize(12)
.fontColor('#B0B0B0')
function textOverflowStyle(maxLine: number) {
.maxLines(maxLine)
.textOverflow({ overflow: TextOverflow.Ellipsis })
}
\ No newline at end of file
... ...
import { ArticleListDTO, appStyleImagesDTO } from 'wdBean';
import { ContentDTO, FullColumnImgUrlDTO } from 'wdBean';
import { RmhTitle } from '../cardCommon/RmhTitle'
const TAG = 'Card19Component';
... ... @@ -9,7 +9,66 @@ const TAG = 'Card19Component';
@Entry
@Component
export struct Card19Component {
@State articleListItem: ArticleListDTO = {} as ArticleListDTO
@State contentDTO: ContentDTO = {
// appStyle: '19',
// coverUrl: 'https://rmrbcmsonline.peopleapp.com/upload/ueditor/image/20240323/a_955994160362418176.png?x-oss-process=image/resize,w_550/quality,q_90/format,jpg',
// fullColumnImgUrls: [
// {
// fullUrl: 'https://rmrbcmsonline.peopleapp.com/upload/ueditor/image/20240323/a_955994160362418176.png?x-oss-process=image/quality,q_90/auto-orient,1',
// height: 1500,
// landscape: 1,
// size: 1,
// url: 'https://rmrbcmsonline.peopleapp.com/upload/ueditor/image/20240323/a_955994160362418176.png?x-oss-process=image/resize,w_550/quality,q_90/format,jpg',
// weight: 2000
// },
// {
// fullUrl: 'https://rmrbcmsonline.peopleapp.com/upload/ueditor/image/20240323/a_955994155727712256.png?x-oss-process=image/quality,q_90/auto-orient,1',
// height: 1500,
// landscape: 1,
// size: 1,
// url: 'https://rmrbcmsonline.peopleapp.com/upload/ueditor/image/20240323/a_955994155727712256.png?x-oss-process=image/resize,w_550/quality,q_90/format,jpg',
// weight: 2000
// },
// {
// fullUrl: 'https://rmrbcmsonline.peopleapp.com/upload/ueditor/image/20240323/a_955994132109586432.png?x-oss-process=image/quality,q_90/auto-orient,1',
// height: 1280,
// landscape: 1,
// size: 1,
// url: 'https://rmrbcmsonline.peopleapp.com/upload/ueditor/image/20240323/a_955994132109586432.png?x-oss-process=image/resize,w_550/quality,q_90/format,jpg',
// weight: 1707
// },
// {
// fullUrl: 'https://rmrbcmsonline.peopleapp.com/upload/ueditor/image/20240323/a_955994132109586432.png?x-oss-process=image/quality,q_90/auto-orient,1',
// height: 1280,
// landscape: 1,
// size: 1,
// url: 'https://rmrbcmsonline.peopleapp.com/upload/ueditor/image/20240323/a_955994132109586432.png?x-oss-process=image/resize,w_550/quality,q_90/format,jpg',
// weight: 1707
// }
// ],
// newsSummary: '#平安建设双提升#【进工地,送安全】3月21日下午,@合肥交警 包河大队走进辖区建筑工地为驾驶员、安全员们开展春季交通安全主题宣传活动。活动中,交警结合涉工程运输车、渣土车交通事故案例,详细讲解行驶注意事项,并普及了“一盔一带”“右转必停”等安全常识,要求驾驶员牢固树立交通安全意识,自觉遵守交通法律法规,确保出行安全。',
// newsTitle: '#平安建设双提升#【进工地,送安全】3月21日下午,@合肥交警 包河大队走进辖区建筑工地为驾驶员、安全员们开展春季交通安全主题宣传活动。活动中,交警结合涉工程运输车、渣土车交通事故案例,详细讲解行驶注意事项,并普及了“一盔一带”“右转必停”等安全常识,要求驾驶员牢固树立交通安全意识,自觉遵守交通法律法规,确保出行安全。',
// publishTime: '1711185754000',
// relType: '1',
// rmhInfo: {
// authIcon: '',
// authTitle: '',
// authTitle2: '',
// banControl: 0,
// cnIsAttention: 1,
// cnIsComment: 1,
// cnIsLike: 1,
// cnMainControl: 1,
// cnShareControl: 1,
// posterShareControl: 1,
// rmhDesc: '合肥市公安局官方人民号',
// 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',
// rmhId: '4255290',
// rmhName: '合肥警方',
// userId: '513697181730757',
// userType: '2'
// }
} as ContentDTO
aboutToAppear(): void {
}
... ... @@ -17,17 +76,17 @@ export struct Card19Component {
build() {
Column() {
// rmh信息
// RmhTitle()
RmhTitle({ rmhInfo: this.contentDTO.rmhInfo })
// 标题
if (this.articleListItem.title) {
Text(this.articleListItem.title)
if (this.contentDTO.newsTitle) {
Text(this.contentDTO.newsTitle)
.fontSize($r('app.float.font_size_17'))
.fontColor($r('app.color.color_222222'))
.textOverflowStyle(2)
.margin({ bottom: 8 })
}
// 图片-从无图到9图展示
createArticleListItem({ appStyleImages: this.articleListItem.appStyleImages })
createImg({ fullColumnImgUrls: this.contentDTO.fullColumnImgUrls })
//TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件
}
.padding({
... ... @@ -47,9 +106,15 @@ interface radiusType {
}
@Component
struct createArticleListItem {
@Prop appStyleImages: appStyleImagesDTO[]
struct createImg {
@Prop fullColumnImgUrls: FullColumnImgUrlDTO[]
aboutToAppear(): void {
if(this.fullColumnImgUrls.length === 4) { // 为了使用栅格布局以便于占用三分之二的宽度,加一个占位
this.fullColumnImgUrls.splice(2,0, {
fullUrl: ''
} as FullColumnImgUrlDTO)
}
}
caclImageRadius(index: number) {
let radius: radiusType = {
topLeft: index === 0 ? $r('app.float.image_border_radius') : 0,
... ... @@ -57,14 +122,14 @@ struct createArticleListItem {
bottomLeft: 0,
bottomRight: 0,
}
if (this.appStyleImages.length === 1) {
if (this.fullColumnImgUrls.length === 1) {
radius.topRight = index === 0 ? $r('app.float.image_border_radius') : 0
radius.bottomLeft = index === 0 ? $r('app.float.image_border_radius') : 0
radius.bottomRight = index === 0 ? $r('app.float.image_border_radius') : 0
} else if (this.appStyleImages.length === 4) {
} else if (this.fullColumnImgUrls.length === 5 && !this.fullColumnImgUrls[2].fullUrl) {
radius.topRight = index === 1 ? $r('app.float.image_border_radius') : 0
radius.bottomLeft = index === 2 ? $r('app.float.image_border_radius') : 0
radius.bottomRight = index === 3 ? $r('app.float.image_border_radius') : 0
radius.bottomLeft = index === 3 ? $r('app.float.image_border_radius') : 0
radius.bottomRight = index === 4 ? $r('app.float.image_border_radius') : 0
} else {
radius.topRight = index === 2 ? $r('app.float.image_border_radius') : 0
radius.bottomLeft = index === 6 ? $r('app.float.image_border_radius') : 0
... ... @@ -77,8 +142,8 @@ struct createArticleListItem {
GridRow({
gutter: { x: 2, y: 2 }
}) {
ForEach(this.appStyleImages, (item: appStyleImagesDTO, index: number) => {
if (this.appStyleImages.length === 1) {
ForEach(this.fullColumnImgUrls, (item: FullColumnImgUrlDTO, index: number) => {
if (this.fullColumnImgUrls.length === 1) {
GridCol({
span: { xs: 8 }
}) {
... ... @@ -86,9 +151,9 @@ struct createArticleListItem {
.width('100%')
.borderRadius(this.caclImageRadius(index))
}
} else if (this.appStyleImages.length === 4) {
} else if (this.fullColumnImgUrls.length === 4) {
GridCol({
span: { xs: 5 }
span: { xs: 4 }
}) {
Image(item.fullUrl)
.aspectRatio(1)
... ...
import { ContentDTO } from 'wdBean';
import { ContentDTO } from 'wdBean';
import { RmhTitle } from '../cardCommon/RmhTitle'
import { CardMediaInfo } from '../cardCommon/CardMediaInfo'
import { CommonConstants } from 'wdConstant/Index';
... ... @@ -38,6 +37,7 @@ export struct Card20Component {
// userId: '522435359667845',
// userType: '2'
// },
// objectType: '1',
// videoInfo: {
// firstFrameImageUri: '',
// videoDuration: 37,
... ... @@ -45,12 +45,13 @@ export struct Card20Component {
// }
} as ContentDTO;
aboutToAppear(): void {}
aboutToAppear(): void {
}
build() {
Column() {
// rmh信息
RmhTitle({rmhInfo: this.contentDTO.rmhInfo})
RmhTitle({ rmhInfo: this.contentDTO.rmhInfo })
// 标题
if (this.contentDTO.newsTitle) {
Text(this.contentDTO.newsTitle)
... ... @@ -60,7 +61,7 @@ export struct Card20Component {
.textOverflowStyle(2)
.margin({ bottom: 8 })
}
if(this.contentDTO.fullColumnImgUrls[0]) {
if (this.contentDTO.fullColumnImgUrls[0]) {
createImg({ contentDTO: this.contentDTO })
}
//TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件
... ... @@ -95,11 +96,9 @@ struct createImg {
Stack() {
Image(this.contentDTO.coverUrl)
.width(CommonConstants.FULL_WIDTH)
.aspectRatio(16/9)
.aspectRatio(16 / 9)
.borderRadius($r('app.float.image_border_radius'))
CardMediaInfo({
duration: this.contentDTO.videoInfo.videoDuration, mediaType: 'video'
})
CardMediaInfo({ contentDTO: this.contentDTO })
}
.align(Alignment.BottomEnd)
}
... ... @@ -112,9 +111,7 @@ struct createImg {
Image(this.contentDTO.coverUrl)
.width(CommonConstants.FULL_WIDTH)
.borderRadius($r('app.float.image_border_radius'))
CardMediaInfo({
duration: this.contentDTO.videoInfo.videoDuration, mediaType: 'video'
})
CardMediaInfo({ contentDTO: this.contentDTO })
}
.align(Alignment.BottomEnd)
}
... ...
import { CommonConstants, ViewType } from 'wdConstant';
import { Logger, DateTimeUtils } from 'wdKit';
import { DateTimeUtils, Logger } from 'wdKit';
import PageViewModel from '../../viewmodel/PageViewModel';
import { EmptyComponent } from '../view/EmptyComponent';
import { ErrorComponent } from '../view/ErrorComponent';
... ... @@ -11,8 +11,8 @@ import NoMoreLayout from './NoMoreLayout';
import LoadMoreLayout from './LoadMoreLayout';
import CustomRefreshLoadLayout from './CustomRefreshLoadLayout';
import { CompParser } from '../CompParser';
import { CompDTO } from 'wdBean';
import { VideoChannelDetail } from 'wdDetailPlayShortVideo/Index';
import { CompDTO, LiveReviewDTO } from 'wdBean';
const TAG = 'PageComponent';
... ... @@ -22,6 +22,14 @@ export struct PageComponent {
navIndex: number = 0;
pageId: string = "";
channelId: string = "";
pageNum: number = 1;
liveReviewDTO: LiveReviewDTO = {
hasNext: false,
pageNum: 0,
pageSize: 0,
totalCount: 0,
list: []
};
name: string = "";
@Link @Watch('onChange') currentTopNavSelectedIndex: number
... ... @@ -109,9 +117,12 @@ export struct PageComponent {
async aboutToAppear() {
// 选中tab,才请求数据。拦截大量接口请求
if (this.navIndex === this.currentTopNavSelectedIndex) {
if (this.navIndex === 0 && this.navIndex === this.currentTopNavSelectedIndex) {
this.getData();
} else if (this.navIndex === 1) {
this.getPreviewData()
}
}
onChange() {
... ... @@ -149,6 +160,13 @@ export struct PageComponent {
Logger.debug(TAG, 'aboutToAppear, data response page ' + this.pageId + ', comp list is empty.');
this.pageModel.viewType = ViewType.EMPTY;
}
}
async getPreviewData() {
this.liveReviewDTO = await PageViewModel.getLiveReviewUrl(this.pageNum, this.pageModel.pageSize)
Logger.debug(TAG, 'aboutToAppear, getPreviewData ' + this.liveReviewDTO.hasNext);
this.getData();
}
}
... ...
... ... @@ -5,8 +5,10 @@ import {
batchLikeAndCollectResult,
CompInfoBean,
ContentDetailDTO,
ContentDTO,
contentListParams,
InteractDataDTO,
LiveReviewDTO,
MorningEveningPaperDTO,
NavigationBodyDTO,
NewspaperListBean,
... ... @@ -18,8 +20,7 @@ import {
postExecuteCollectRecordParams,
postExecuteLikeParams,
postInteractAccentionOperateParams,
postRecommendListParams,
ContentDTO
postRecommendListParams
} from 'wdBean';
const TAG = 'HttpRequest';
... ... @@ -146,9 +147,9 @@ export class PageRepository {
return url;
}
static getLivePreviewUrl() {
let url = HttpUrlUtils.getHost() + HttpUrlUtils.LIVE_REVIEW_PATH;
Logger.info(TAG, "getLivePreviewUrl url = " + url)
static getLiveReviewUrl(pageNum: number = 1, pageSize: number = 20) {
let url = HttpUrlUtils.getHost() + HttpUrlUtils.LIVE_REVIEW_PATH + "?pageNum=" + pageNum + "&pageSize=" + pageSize;
Logger.info(TAG, "getLiveReviewUrl url = " + url)
return url;
}
... ... @@ -322,10 +323,10 @@ export class PageRepository {
/**
* 获取直播回顾双卡位数据
* */
static fetchLivePreviewUrl() {
let url = PageRepository.getLivePreviewUrl()
static fetchLiveReviewUrl(pageNum: number, pageSize: number) {
let url = PageRepository.getLiveReviewUrl(pageNum, pageSize)
let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
return WDHttp.get<ResponseDTO<PageInfoBean>>(url, headers)
return WDHttp.get<ResponseDTO<LiveReviewDTO>>(url, headers)
};
/**
... ... @@ -334,7 +335,7 @@ export class PageRepository {
* @param params
* @returns
* */
static postRecommendList(params:postRecommendListParams){
static postRecommendList(params: postRecommendListParams) {
let url = HttpUrlUtils.getHost() + HttpUrlUtils.RECOMMEND_LIST
let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
Logger.info(TAG, "postRecommendList url = " + url + JSON.stringify(params))
... ...
... ... @@ -3,11 +3,12 @@ import {
ContentBean,
InteractDataDTO,
InteractParam,
LiveReviewDTO,
MorningEveningPaperDTO,
NavigationBodyDTO,
PageDTO,
PageInfoBean
PageDTO
} from 'wdBean';
import { CollectionUtils, Logger, ResourcesUtils, StringUtils } from 'wdKit';
import { ResponseDTO, } from 'wdNetwork';
import { PageRepository } from '../repository/PageRepository';
... ... @@ -285,10 +286,10 @@ export class PageViewModel extends BaseViewModel {
return param;
}
async getLivePreviewUrl(): Promise<PageInfoBean> {
return new Promise<PageInfoBean>((success, error) => {
async getLiveReviewUrl(pageNum: number, pageSize: number): Promise<LiveReviewDTO> {
return new Promise<LiveReviewDTO>((success, error) => {
Logger.info(TAG, `getLivePreviewUrl pageInfo start`);
PageRepository.fetchLivePreviewUrl().then((resDTO: ResponseDTO<PageInfoBean>) => {
PageRepository.fetchLiveReviewUrl(pageNum, pageSize).then((resDTO: ResponseDTO<LiveReviewDTO>) => {
if (!resDTO || !resDTO.data) {
Logger.error(TAG, 'getLivePreviewUrl then navResDTO is empty');
error('resDTO is empty');
... ...