zhangbo1_wd

展排数据bean,interface改为class

Showing 39 changed files with 340 additions and 267 deletions
... ... @@ -46,7 +46,7 @@ export class ProcessUtils {
if ('1' == type) {
// 内链
let content: ContentDTO = {} as ContentDTO;
let content: ContentDTO = new ContentDTO();
content.linkUrl = linkUrl;
ProcessUtils.gotoWeb(content);
} else if ('2' == type) {
... ... @@ -62,16 +62,13 @@ export class ProcessUtils {
* @param advert 展现中心的展现广告
*/
static advJumpMainPage(advert: AdvertsBean) {
let content: ContentDTO = {
linkUrl: advert.linkUrl,
pageId: advert.pageId,
objectId: advert.objectId,
objectType: advert.objectType.toString(),
relId: advert.relId,
bottomNavId: advert.bottomNavId
} as ContentDTO;
let content: ContentDTO = new ContentDTO()
content.linkUrl = advert.linkUrl;
content.pageId = advert.pageId;
content.objectId = advert.objectId;
content.objectType = advert.objectType.toString();
content.relId = advert.relId;
content.bottomNavId = advert.bottomNavId;
ProcessUtils.processPage(content);
}
... ...
... ... @@ -134,12 +134,12 @@ function handleJsCallReceiveH5Data(data: Message) {
break;
case '6':
let contentJson: IDataJson = JSON.parse(data?.data?.dataJson || '{}')
let content: ContentDTO = {
objectId: contentJson?.newsId,
relId: contentJson?.newsRelId,
pageId: contentJson?.pageId,
objectType: String(contentJson?.newsObjectType)
} as ContentDTO
let content: ContentDTO = new ContentDTO();
content.objectId = contentJson?.newsId;
content.relId = contentJson?.newsRelId;
content.pageId = contentJson?.pageId;
content.objectType = String(contentJson?.newsObjectType);
ProcessUtils.processPage(content)
break;
default:
... ... @@ -150,14 +150,14 @@ function handleJsCallReceiveH5Data(data: Message) {
function handleJsCallAppInnerLinkMethod(data: Message) {
let urlObject = Url.URL.parseURL(data?.data?.appInnerLink);
let urlParams = new Url.URLParams(urlObject.search);
let content: ContentDTO = {
objectId: urlParams.get('contentId') || '',
relId: urlParams.get('relId') || '',
relType: urlParams.get('relType') || '',
pageId: urlParams.get('pageId') || '',
objectType: '',
linkUrl: encodeURI(urlParams.get('url') || '')
} as ContentDTO
let content: ContentDTO = new ContentDTO()
content.objectId = urlParams.get('contentId') || '';
content.relId = urlParams.get('relId') || '';
content.relType = urlParams.get('relType') || '';
content.pageId = urlParams.get('pageId') || '';
content.objectType = '';
content.linkUrl = encodeURI(urlParams.get('url') || '');
switch (urlParams.get('type')) {
case 'video':
content.objectType = ContentConstants.TYPE_VOD
... ...
... ... @@ -3,47 +3,48 @@ import { AudioDTO } from '../content/AudioDTO';
import { ContentDTO } from '../content/ContentDTO';
import { BaseDTO } from './BaseDTO';
export interface CompDTO extends BaseDTO{
backgroundColor: string;
backgroundImgUrl: string;
cityCode: string;
compStyle: string;
compType: string;
@Observed
export class CompDTO implements BaseDTO{
backgroundColor: string='';
backgroundImgUrl: string='';
cityCode: string='';
compStyle: string='';
compType: string='';
// dataSourceRequest: any[];
districtCode: string;
districtCode: string='';
extraData?: string;
hasAdInfo: number;
id: number;
imgSize: string;
innerUrl: string;
linkUrl: string;
hasAdInfo: number=-1;
id: number=0;
imgSize: string='';
innerUrl: string='';
linkUrl: string='';
// meddleDataList: any[];
name: string;
objectId: string; // 跳转页面id?
objectTitle: string; // comp标题
name: string='';
objectId: string=''; // 跳转页面id?
objectTitle: string=''; // comp标题
// objectType?: string; // 跳转类型,枚举:
operDataList: ContentDTO[]; // 运营数据列表【正常运营配置的强运营数据,部分推荐场景的配置(自动源兜底数据)】
operDataList: ContentDTO[]=[]; // 运营数据列表【正常运营配置的强运营数据,部分推荐场景的配置(自动源兜底数据)】
// pageId?: any;
posterSize: string;
posterUrl: string;
provinceCode: string;
sortValue: number;
subType: string;
imageScale: number; // 封面图比例 1-4:3, 2-16:9, 3-3:2
audioDataList: AudioDTO[];
titleShowPolicy: string | number;
posterSize: string='';
posterUrl: string='';
provinceCode: string='';
sortValue: number=-1;
subType: string='';
imageScale: number=-1; // 封面图比例 1-4:3, 2-16:9, 3-3:2
audioDataList: AudioDTO[]=[];
titleShowPolicy: string | number='';
/**
* 组件内容源类型 (LIVE_HORIZONTAL_CARD\LIVE_RESERVATION\LIVE_LARGE_CARD\LIVE_END\LIVE_MONTHLY_RANKING )
*/
dataSourceType: string;
dataSourceType: string='';
/**
* 信息流广告素材
*/
matInfo: CompAdvMatInfoBean
matInfo: CompAdvMatInfoBean = {} as CompAdvMatInfoBean
pageId?: string;
objectType?: string;
... ...
... ... @@ -8,81 +8,148 @@ import { RmhInfoDTO } from '../detail/RmhInfoDTO';
import { commentInfo } from './commentInfo';
import { BaseDTO } from '../component/BaseDTO';
export interface ContentDTO extends BaseDTO {
appStyle: string;
cityCode: string;
coverSize: string;
coverType: number;
coverUrl: string;
description: string;
districtCode: string;
endTime: string;
hImageUrl: string;
heatValue: string;
innerUrl: string;
landscape: number;
@Observed
export class ContentDTO implements BaseDTO {
appStyle: string = '';
cityCode: string = '';
coverSize: string = '';
coverType: number = -1;
coverUrl: string = '';
description: string = '';
districtCode: string = '';
endTime: string = '';
hImageUrl: string = '';
heatValue: string = '';
innerUrl: string = '';
landscape: number = -1;
lengthTime?: object;
linkUrl: string;
openLikes: number;
linkUrl: string = '';
openLikes: number = 0;
openComment?: number;
openUrl: string;
pageId: string;
openUrl: string = '';
pageId: string = '';
// playUrls: any[];
programAuth: string;
programId: string;
programName: string;
programSource: number;
programType: number;
provinceCode: string;
programAuth: string = '';
programId: string = '';
programName: string = '';
programSource: number = -1;
programType: number = -1;
provinceCode: string = '';
// rankingList: any[];
showTitleEd: string;
showTitleIng: string;
showTitleNo: string;
showTitleEd: string = '';
showTitleIng: string = '';
showTitleNo: string = '';
// sortValue?: any;
startTime: string;
subType: string;
subtitle: string;
title: string;
vImageUrl: string;
screenType: string;
source: string;
objectId: string;
objectType: string;
channelId: string;
relId: string;
relType: string;
newsTitle: string; //单图卡/2行标题/3行标题
publishTime: string;
publishTimestamp: string;
visitorComment: number;
fullColumnImgUrls: FullColumnImgUrlDTO[];
liveInfo: LiveInfoDTO; // 直播新闻信息【BFF聚合】
videoInfo: VideoInfoDTO; // 视频新闻信息【BFF聚合】,视频非原片+清晰度最高的
startTime: string = '';
subType: string = '';
subtitle: string = '';
title: string = '';
vImageUrl: string = '';
screenType: string = '';
source: string = '';
objectId: string = '';
objectType: string = '';
channelId: string = '';
relId: string = '';
relType: string = '';
newsTitle: string = ''; //单图卡/2行标题/3行标题
publishTime: string = '';
publishTimestamp: string = '';
visitorComment: number = 0;
fullColumnImgUrls: FullColumnImgUrlDTO[] = [];
liveInfo: LiveInfoDTO = {} as LiveInfoDTO; // 直播新闻信息【BFF聚合】
videoInfo: VideoInfoDTO = {} as VideoInfoDTO; // 视频新闻信息【BFF聚合】,视频非原片+清晰度最高的
newsSummary: string; //appstyle:2 ,新闻详情
newsSummary: string = ''; //appstyle:2 ,新闻详情
// 二次请求接口,返回的数据,这里组装到content里;
interactData: InteractDataDTO;
hasMore: number,
slideShows: slideShows[],
voiceInfo: VoiceInfoDTO,
tagWord: number,
isSelect: boolean;
rmhInfo: RmhInfoDTO; // 人民号信息
photoNum: number;
corner: string;
rmhPlatform: number;
newTags: string;
interactData?: InteractDataDTO;
hasMore: number = -1;
slideShows: slideShows[] = [];
voiceInfo: VoiceInfoDTO = {} as VoiceInfoDTO;
tagWord: number = -1;
isSelect: boolean = false;
rmhInfo: RmhInfoDTO = {} as RmhInfoDTO; // 人民号信息
photoNum: number = 0;
corner: string = '';
rmhPlatform: number = 0;
newTags: string = '';
titleShow?: number;
isSearch?: boolean; // 是否是搜索的结果,区分搜索和主页的数据
isCollection?: boolean; // 是否是收藏的结果,区分搜索和主页的数据
commentInfo?: commentInfo
//底部导航栏 id(用于频道跳转)
bottomNavId:string;
bottomNavId: string = '';
// 链接类型: 0:无链接;1:内链(文章);2:外链
openType:string
extra:string
openType: string = '';
extra: string = ''
static clone(old:ContentDTO): ContentDTO {
let content = new ContentDTO();
content.appStyle = old.appStyle;
content.cityCode = old.cityCode;
content.coverSize = old.coverSize;
content.coverType = old.coverType;
content.coverUrl = old.coverUrl;
content.description = old.description;
content.districtCode = old.districtCode;
content.endTime = old.endTime;
content.hImageUrl = old.hImageUrl;
content.heatValue = old.heatValue;
content.innerUrl = old.innerUrl;
content.landscape = old.landscape;
content.lengthTime = old.lengthTime;
content.linkUrl = old.linkUrl;
content.openLikes = old.openLikes;
content.openComment = old.openComment;
content.openUrl = old.openUrl;
content.pageId = old.pageId;
content.programAuth = old.programAuth;
content.programId = old.programId;
content.programName = old.programName;
content.programSource = old.programSource;
content.programType = old.programType;
content.provinceCode = old.provinceCode;
content.showTitleEd = old.showTitleEd;
content.showTitleIng = old.showTitleIng;
content.showTitleNo = old.showTitleNo;
content.startTime = old.startTime;
content.subType = old.subType;
content.subtitle = old.subtitle;
content.title = old.title;
content.vImageUrl = old.vImageUrl;
content.source = old.source;
content.objectId = old.objectId;
content.objectType = old.objectType;
content.channelId = old.channelId;
content.relId = old.relId;
content.relType = old.relType;
content.newsTitle = old.newsTitle;
content.publishTime = old.publishTime;
content.publishTimestamp = old.publishTimestamp;
content.visitorComment = old.visitorComment;
content.fullColumnImgUrls = old.fullColumnImgUrls;
content.liveInfo = old.liveInfo;
content.videoInfo = old.videoInfo;
content.newsSummary = old.newsSummary;
content.interactData = old.interactData;
content.hasMore = old.hasMore;
content.slideShows = old.slideShows;
content.voiceInfo = old.voiceInfo;
content.tagWord = old.tagWord;
content.isSelect = old.isSelect;
content.rmhInfo = old.rmhInfo;
content.photoNum = old.photoNum;
content.corner = old.corner;
content.rmhPlatform = old.rmhPlatform;
content.newTags = old.newTags;
content.titleShow = old.titleShow;
content.isSearch = old.isSearch;
content.isCollection = old.isCollection;
content.commentInfo = old.commentInfo;
content.bottomNavId = old.bottomNavId;
content.openType = old.openType;
content.extra = old.extra;
return content;
}
}
\ No newline at end of file
... ...
/**
* 批查接口查询互动相关数据,返回数据bean
*/
export interface InteractDataDTO {
collectNum: number | string;
commentNum: number | string;
contentId: string;
contentType: number;
likeNum: number | string;
readNum: number;
shareNum: number;
@Observed
export class InteractDataDTO {
collectNum: number | string = 0;
commentNum: number | string = 0;
contentId: string = '';
contentType: number = 0;
likeNum: number | string = 0;
readNum: number = 0;
shareNum: number = 0;
}
\ No newline at end of file
... ...
... ... @@ -23,7 +23,7 @@ import { Card21Component } from './cardview/Card21Component';
*/
@Component
export struct CardParser {
@State contentDTO: ContentDTO = {} as ContentDTO;
@State contentDTO: ContentDTO = new ContentDTO();
build() {
this.contentBuilder(this.contentDTO);
... ...
... ... @@ -55,7 +55,7 @@ export struct DynamicDetailComponent {
@State newsStatusOfUser: batchLikeAndCollectResult = {} as batchLikeAndCollectResult// 点赞、收藏状态
//跳转
private mJumpInfo: ContentDTO = {} as ContentDTO;
private mJumpInfo: ContentDTO = new ContentDTO();
@State publishTime: string = ''
@State isNetConnected: boolean = true
... ...
... ... @@ -9,7 +9,7 @@ import { DateTimeUtils } from 'wdKit/Index'
*/
@Component
export struct CardMediaInfo {
@State contentDTO: ContentDTO = {} as ContentDTO // 如果有duraion,代表点播,显示时长;如果不传或者传0,显示直播中
@State contentDTO: ContentDTO = new ContentDTO() // 如果有duraion,代表点播,显示时长;如果不传或者传0,显示直播中
// objectType 0:不跳转 1:点播,2:直播,3:活动,4:广告,5:专题,6:链接,7:榜单,8:图文,9:组图,10:H5新闻,11:频道,12:组件,13:音频,
// 14动态图文,15动态视频16问政;100人民号,101标签
... ...
... ... @@ -4,7 +4,7 @@ import { DateTimeUtils } from 'wdKit/Index';
@Component
export struct CardSourceInfo {
@State contentDTO: ContentDTO = {} as ContentDTO;
@State contentDTO: ContentDTO = new ContentDTO();
build() {
Flex() {
... ...
... ... @@ -20,7 +20,7 @@ const TAG: string = 'Card2Component';
@Component
export struct CardAdvVideoComponent {
@State compDTO: CompDTO = {} as CompDTO
@State contentDTO: ContentDTO = {} as ContentDTO
@State contentDTO: ContentDTO = new ContentDTO()
pageModel: PageModel = new PageModel();
aboutToAppear(): void {
... ...
import { ContentDTO, slideShows } from 'wdBean';
import { ContentDTO, slideShows, VideoInfoDTO } from 'wdBean';
import { CommonConstants } from 'wdConstant';
import { ProcessUtils } from 'wdRouter';
import { CardSourceInfo } from '../cardCommon/CardSourceInfo';
... ... @@ -14,7 +14,7 @@ const TAG: string = 'Card10Component';
@Preview
@Component
export struct Card10Component {
@State contentDTO: ContentDTO = {} as ContentDTO;
@State contentDTO: ContentDTO = new ContentDTO();
@State loadImg: boolean = false;
async aboutToAppear(): Promise<void> {
... ... @@ -111,10 +111,7 @@ export struct Card10Component {
CardSourceInfo(
{
contentDTO: {
publishTime: item.publishTime || '',
source: item.source || ''
} as ContentDTO
contentDTO: this.createContent(item)
}
)
}
... ... @@ -132,12 +129,7 @@ export struct Card10Component {
.borderRadius($r('app.float.image_border_radius'))
.margin({ left: 12 })
CardMediaInfo({
contentDTO: {
objectType: String(item.objectType),
videoInfo: { videoDuration: Number(item.videoDuration) as number },
photoNum: Number(item.photoNum),
voiceInfo: { voiceDuration: Number(item.voiceDuration) as number }
} as ContentDTO
contentDTO: this.createMediaInfoContent(item)
})
}
.alignContent(Alignment.BottomEnd)
... ... @@ -153,4 +145,20 @@ export struct Card10Component {
ProcessUtils.processPage(data)
})
}
private createContent(item: slideShows): ContentDTO {
let contentDTO = new ContentDTO()
contentDTO.publishTime = item.publishTime.toString() || '';
contentDTO.source = item.source || '';
return contentDTO;
}
private createMediaInfoContent(item: slideShows): ContentDTO {
let contentDTO = new ContentDTO()
contentDTO.objectType = String(item.objectType);
contentDTO.videoInfo = { videoDuration: Number(item.videoDuration) as number } as VideoInfoDTO;
contentDTO.photoNum = Number(item.photoNum);
contentDTO.voiceInfo = { voiceDuration: Number(item.voiceDuration) as number };
return contentDTO;
}
}
\ No newline at end of file
... ...
... ... @@ -11,7 +11,7 @@ const TAG = 'Card11Component';
*/
@Component
export struct Card11Component {
@State contentDTO: ContentDTO = {} as ContentDTO;
@State contentDTO: ContentDTO = new ContentDTO();
@State clicked: boolean = false;
build() {
... ...
... ... @@ -12,7 +12,7 @@ const TAG = 'Card12Component';
*/
@Component
export struct Card12Component {
@State contentDTO: ContentDTO = {} as ContentDTO;
@State contentDTO: ContentDTO = new ContentDTO();
@State clicked: boolean = false;
aboutToAppear(): void {
... ...
... ... @@ -13,7 +13,7 @@ const TAG = 'Card14Component';
*/
@Component
export struct Card14Component {
@State contentDTO: ContentDTO = {} as ContentDTO;
@State contentDTO: ContentDTO = new ContentDTO();
@State loadImg: boolean = false;
@State clicked: boolean = false;
... ...
... ... @@ -17,7 +17,7 @@ const TAG: string = 'Card15Component';
*/
@Component
export struct Card15Component {
@State contentDTO: ContentDTO = {} as ContentDTO;
@State contentDTO: ContentDTO = new ContentDTO();
@State loadImg: boolean = false;
@State clicked: boolean = false;
... ...
... ... @@ -18,7 +18,7 @@ interface fullColumnImgUrlItem {
*/
@Component
export struct Card16Component {
@State contentDTO: ContentDTO = {} as ContentDTO;
@State contentDTO: ContentDTO = new ContentDTO();
@State loadImg: boolean = false;
@State clicked: boolean = false;
... ...
... ... @@ -15,7 +15,7 @@ const TAG = 'Card17Component';
@Component
export struct Card17Component {
@State compDTO: CompDTO = {} as CompDTO
@State contentDTO: ContentDTO = {} as ContentDTO;
@State contentDTO: ContentDTO = new ContentDTO();
@State loadImg: boolean = false;
@State clicked: boolean = false;
... ...
... ... @@ -12,8 +12,7 @@ const TAG = 'Card19Component';
*/
@Component
export struct Card19Component {
@State contentDTO: ContentDTO = {
} as ContentDTO
@State contentDTO: ContentDTO = new ContentDTO()
@State clicked: boolean = false;
build() {
... ...
... ... @@ -13,8 +13,7 @@ const TAG = 'Card20Component';
*/
@Component
export struct Card20Component {
@State contentDTO: ContentDTO = {
} as ContentDTO;
@State contentDTO: ContentDTO = new ContentDTO();
@State clicked: boolean = false;
aboutToAppear(): void {
... ...
... ... @@ -13,7 +13,7 @@ const TAG: string = 'Card6Component-Card13Component';
*/
@Component
export struct Card21Component {
@State contentDTO: ContentDTO = {} as ContentDTO;
@State contentDTO: ContentDTO = new ContentDTO();
@State loadImg: boolean = false;
@State clicked: boolean = false;
... ...
... ... @@ -18,7 +18,7 @@ const TAG: string = 'Card2Component';
*/
@Component
export struct Card2Component {
@State contentDTO: ContentDTO = {} as ContentDTO;
@State contentDTO: ContentDTO = new ContentDTO();
@State loadImg: boolean = false;
@State clicked: boolean = false;
... ...
... ... @@ -9,8 +9,7 @@ import { CardSourceInfo } from '../cardCommon/CardSourceInfo'
*/
@Component
export struct Card3Component {
@State contentDTO: ContentDTO = {
} as ContentDTO;
@State contentDTO: ContentDTO = new ContentDTO();
@State clicked: boolean = false;
build() {
... ...
... ... @@ -15,7 +15,7 @@ const TAG: string = 'Card4Component';
*/
@Component
export struct Card4Component {
@State contentDTO: ContentDTO = {} as ContentDTO;
@State contentDTO: ContentDTO = new ContentDTO();
@State loadImg: boolean = false;
@State clicked: boolean = false;
... ...
... ... @@ -11,7 +11,7 @@ const TAG: string = 'Card5Component';
*/
@Component
export struct Card5Component {
@State contentDTO: ContentDTO = {} as ContentDTO;
@State contentDTO: ContentDTO = new ContentDTO();
@State titleShowPolicy: number | string = 1
@State loadImg: boolean = false;
@State clicked: boolean = false;
... ...
... ... @@ -13,7 +13,7 @@ const TAG: string = 'Card6Component-Card13Component';
*/
@Component
export struct Card6Component {
@State contentDTO: ContentDTO = {} as ContentDTO;
@State contentDTO: ContentDTO = new ContentDTO();
@State loadImg: boolean = false;
@State clicked: boolean = false;
... ...
... ... @@ -12,7 +12,7 @@ const TAG: string = 'Card9Component';
@Component
export struct Card9Component {
@State contentDTO: ContentDTO = {} as ContentDTO;
@State contentDTO: ContentDTO = new ContentDTO();
@State loadImg: boolean = false;
@State clicked: boolean = false;
... ...
... ... @@ -443,18 +443,14 @@ struct QualityCommentItem {
jumpToDetail() {
// programInfoModel.api_isCommentAction = YES;
let program: ContentDTO = {
objectId: this.item.targetId,
objectType: this.item.targetType,
relId: this.item.targetRelId,
relType: this.item.targetRelType,
// objectLevel: this.item.topicType,
pageId: this.item.pageId,
linkUrl: this.item.h5Url,
} as ContentDTO
ProcessUtils.processPage(program)
let content = new ContentDTO()
content.objectId = this.item.targetId;
content.objectType = this.item.targetType;
content.relId = this.item.targetRelId;
content.relType = this.item.targetRelType;
content.pageId = this.item.pageId;
content.linkUrl = this.item.h5Url;
ProcessUtils.processPage(content)
}
replyComment() {
... ...
... ... @@ -162,7 +162,7 @@ export struct ZhCarouselLayout01 {
@Component
struct CarouselLayout01CardView {
private item: ContentDTO = {} as ContentDTO;
private item: ContentDTO = new ContentDTO();
private length: number = 1; // 轮播图数量
@State loadImg: boolean = false;
... ...
... ... @@ -195,13 +195,12 @@ export struct ChildCommentComponent {
}.height('69lpx')
.justifyContent(FlexAlign.Center)
.onClick(() => {
ProcessUtils.processPage(
{
objectId: this.data.targetId,
relType: this.data.targetRelType + "",
relId: this.data.targetRelId,
objectType: this.data.targetType + "",
} as ContentDTO)
let content = new ContentDTO()
content.objectId = this.data.targetId;
content.relType = this.data.targetRelType + "";
content.relId = this.data.targetRelId;
content.objectType = this.data.targetType + "";
ProcessUtils.processPage(content)
})
}
.margin({ top: '19lpx', bottom: '31lpx', left: '31lpx', right: '31lpx' })
... ...
... ... @@ -15,7 +15,7 @@ const TAG: string = 'CardView';
*/
@Component
export struct CarouselLayout01CardView {
private item: ContentDTO = {} as ContentDTO;
private item: ContentDTO = new ContentDTO();
private index: number = -1;
build() {
... ... @@ -85,7 +85,7 @@ export struct CarouselLayout01CardView {
*/
@Component
export struct SingleColumn01CardView {
private item: ContentDTO = {} as ContentDTO;
private item: ContentDTO = new ContentDTO();
private index: number = -1;
build() {
... ... @@ -164,7 +164,7 @@ export struct SingleColumn01CardView {
*/
@Component
export struct SingleColumn02CardView {
private item: ContentDTO = {} as ContentDTO;
private item: ContentDTO = new ContentDTO();
private index: number = -1;
build() {
... ... @@ -288,7 +288,7 @@ export struct SingleColumn02CardView {
*/
@Component
export struct MasonryLayout01CardView {
private item: ContentDTO = {} as ContentDTO;
private item: ContentDTO = new ContentDTO();
private index: number = -1;
build() {
... ... @@ -387,7 +387,7 @@ export struct MasonryLayout01CardView {
*/
@Component
export struct PaperSingleColumn999CardView {
private item: ContentDTO = {} as ContentDTO;
private item: ContentDTO = new ContentDTO();
private index: number = -1;
@State interactData: InteractDataDTO = {} as InteractDataDTO;
@Consume @Watch('onChangeCommentList') commentList: InteractDataDTO[]
... ...
... ... @@ -29,7 +29,7 @@ struct LiveMorePage {
pageSize: number = 20;
operDataList: ContentDTO[] = [];
title: string = '直播列表'
@State contentDTO: ContentDTO = {
@State contentDTO: ContentDTO = new ContentDTO();
// appStyle: '15',
// coverType: 1,
// objectType: '9',
... ... @@ -67,7 +67,7 @@ struct LiveMorePage {
// voiceInfo: {
// voiceDuration: 12
// }
} as ContentDTO;
// } as ContentDTO;
aboutToAppear(): void {
PageViewModel.getLiveMoreUrl(this.type, this.currentPage, this.pageSize).then((liveReviewDTO) => {
... ...
... ... @@ -96,7 +96,7 @@ export struct PageComponent {
// comp自己处理分页,这里设置EdgeEffect.None
.edgeEffect(this.pageModel.contentNeedScroll ? EdgeEffect.None : EdgeEffect.Spring)
.scrollBar(BarState.Off)
.cachedCount(8)
.cachedCount(5)
.height(CommonConstants.FULL_PARENT)
.onScrollIndex((start: number, end: number) => {
// Listen to the first index of the current list.
... ...
... ... @@ -33,7 +33,7 @@ struct ReserveMorePage {
title: string = '预约列表'
//是否预约过直播
@State isAppointmentLive: boolean = false
@State contentDTO: ContentDTO = {
@State contentDTO: ContentDTO = new ContentDTO()
// appStyle: '15',
// coverType: 1,
// objectType: '9',
... ... @@ -71,7 +71,7 @@ struct ReserveMorePage {
// voiceInfo: {
// voiceDuration: 12
// }
} as ContentDTO;
// } as ContentDTO;
async aboutToAppear(): Promise<void> {
// PageViewModel.get
... ...
... ... @@ -214,7 +214,7 @@ export struct PeopleShipHomeArticleListComponent {
this.arr = []
}
for (const element of listData.list) {
let contentDTO = {} as ContentDTO
let contentDTO = new ContentDTO()
contentDTO.appStyle = this.changeCommon(element.appStyle)
contentDTO.newsTitle = element.title;
contentDTO.newsSummary = element.description;
... ...
... ... @@ -6,7 +6,7 @@ import { ProcessUtils } from 'wdRouter/Index';
@Component
export struct ActivityItemComponent {
@State contentDTO: ContentDTO = {} as ContentDTO;
@State contentDTO: ContentDTO = new ContentDTO();
build() {
Row() {
... ...
... ... @@ -10,7 +10,7 @@ import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'
import SearcherAboutDataModel from '../../model/SearcherAboutDataModel'
import { CreatorDetailRequestItem } from '../../viewmodel/CreatorDetailRequestItem'
import { SearchResultContentData } from '../../viewmodel/SearchResultContentData'
import { SearchRmhDescription } from '../../viewmodel/SearchResultContentItem'
import { SearchResultContentItem, SearchRmhDescription } from '../../viewmodel/SearchResultContentItem'
import { CardParser } from '../CardParser'
import { ListHasNoMoreDataUI } from '../reusable/ListHasNoMoreDataUI'
import { ActivityItemComponent } from './ActivityItemComponent'
... ... @@ -132,80 +132,7 @@ export struct SearchResultContentComponent{
})
}
let contentDTO:ContentDTO = {
appStyle: value.data.appStyle + "",
cityCode: value.data.cityCode,
coverSize: "",
coverType: value.data.type == "5"?1:-1,
coverUrl: this.searchType=="activity"?value.data.zhChannelPageImg:value.data.appStyleImages.split("&&")[0],
description: value.data.description,
districtCode: value.data.districtCode,
endTime: value.data.endTime,
hImageUrl: "",
heatValue: "",
innerUrl: "",
landscape: Number.parseInt(value.data.landscape),
// lengthTime:null,
linkUrl: value.data.linkUrl,
openLikes: Number.parseInt(value.data.openLikes),
openUrl: "",
pageId: value.data.pageId,
programAuth: "",
programId: "",
programName: "",
programSource: -1,
programType: Number.parseInt(value.data.status),
provinceCode: value.data.provinceCode,
showTitleEd: value.data.showTitleEd,
showTitleIng: value.data.showTitleIng,
showTitleNo: value.data.showTitleNo,
startTime: value.data.startTime,
subType: "",
subtitle: "",
title: value.data.title,
vImageUrl: "",
screenType: "",
source: StringUtils.isEmpty(value.data.creatorName) ? value.data.sourceName : value.data.creatorName,
objectId: value.data.id,
objectType: value.data.type,
channelId: value.data.channelId,
relId: value.data.relId,
relType: value.data.relType,
newsTitle: value.data.titleLiteral,
publishTime: StringUtils.isNotEmpty(value.data.firstPublishTime)?value.data.firstPublishTime:value.data.publishTime,
visitorComment: -1,
fullColumnImgUrls: photos,
newsSummary: "",
hasMore: -1,
slideShows: [],
voiceInfo: {} as VoiceInfoDTO,
tagWord: -1,
isSelect: true,
rmhInfo: {} as RmhInfoDTO,
photoNum: -1,
liveInfo: {} as LiveInfoDTO,
videoInfo: {
videoDuration: Number.parseInt(value.data.duration)
} as VideoInfoDTO,
interactData: {
collectNum:value.data.collectNum ,
commentNum:value.data.commentNum,
contentId:value.data.id,
contentType :Number.parseInt(value.data.type),
likeNum: value.data.likeNum,
readNum:Number.parseInt(value.data.readNum),
shareNum:Number.parseInt(value.data.shareNum)
} as InteractDataDTO,
corner: '',
rmhPlatform: 0,
newTags: '',
isSearch: true,
publishTimestamp:"",
bottomNavId:'',
openType:'',
extra:'',
titleShow:value.data.type == "5"?1:0,
}
let contentDTO = this.dataTransform(value,photos);
if(contentDTO.appStyle != "13"){
this.data.push(contentDTO)
}
... ... @@ -339,4 +266,84 @@ export struct SearchResultContentComponent{
.layoutWeight(1)
.width('100%')
}
private dataTransform(value: SearchResultContentItem, photos: FullColumnImgUrlDTO[]): ContentDTO {
let contentDTO = new ContentDTO();
contentDTO.appStyle = value.data.appStyle + ""
contentDTO.cityCode = value.data.cityCode
contentDTO.coverSize = ""
contentDTO.coverType = value.data.type == "5" ? 1 : -1
contentDTO.coverUrl =
this.searchType == "activity" ? value.data.zhChannelPageImg : value.data.appStyleImages.split("&&")[0];
contentDTO.description = value.data.description
contentDTO.districtCode = value.data.districtCode
contentDTO.endTime = value.data.endTime
contentDTO.hImageUrl = ""
contentDTO.heatValue = ""
contentDTO.innerUrl = ""
contentDTO.landscape = Number.parseInt(value.data.landscape)
contentDTO.linkUrl = value.data.linkUrl
contentDTO.openLikes = Number.parseInt(value.data.openLikes)
contentDTO.openUrl = ""
contentDTO.pageId = value.data.pageId
contentDTO.programAuth = ""
contentDTO.programId = ""
contentDTO.programName = ""
contentDTO.programSource = -1
contentDTO.programType = Number.parseInt(value.data.status)
contentDTO.provinceCode = value.data.provinceCode
contentDTO.showTitleEd = value.data.showTitleEd
contentDTO.showTitleIng = value.data.showTitleIng
contentDTO.showTitleNo = value.data.showTitleNo
contentDTO.startTime = value.data.startTime
contentDTO.subType = ""
contentDTO.subtitle = ""
contentDTO.title = value.data.title
contentDTO.vImageUrl = ""
contentDTO.screenType = ""
contentDTO.source = StringUtils.isEmpty(value.data.creatorName) ? value.data.sourceName : value.data.creatorName
contentDTO.objectId = value.data.id
contentDTO.objectType = value.data.type
contentDTO.channelId = value.data.channelId
contentDTO.relId = value.data.relId
contentDTO.relType = value.data.relType
contentDTO.newsTitle = value.data.titleLiteral;
contentDTO.publishTime =
StringUtils.isNotEmpty(value.data.firstPublishTime) ? value.data.firstPublishTime : value.data.publishTime
contentDTO.visitorComment = -1
contentDTO.fullColumnImgUrls = photos
contentDTO.newsSummary = ""
contentDTO.hasMore = -1
contentDTO.slideShows = []
contentDTO.voiceInfo = {} as VoiceInfoDTO
contentDTO.tagWord = -1
contentDTO.isSelect = true
contentDTO.rmhInfo = {} as RmhInfoDTO
contentDTO.photoNum = -1
contentDTO.liveInfo = {} as LiveInfoDTO;
contentDTO.videoInfo = {
videoDuration: Number.parseInt(value.data.duration)
} as VideoInfoDTO;
let interact = new InteractDataDTO()
interact.collectNum = value.data.collectNum
interact.commentNum = value.data.commentNum
interact.contentId = value.data.id
interact.contentType = Number.parseInt(value.data.type)
interact.likeNum = value.data.likeNum
interact.readNum = Number.parseInt(value.data.readNum)
interact.shareNum = Number.parseInt(value.data.shareNum)
contentDTO.interactData = interact
contentDTO.corner = ''
contentDTO.rmhPlatform = 0
contentDTO.newTags = ''
contentDTO.isSearch = true
contentDTO.publishTimestamp = ""
contentDTO.bottomNavId = '';
contentDTO.openType = '';
contentDTO.extra = '';
contentDTO.titleShow = value.data.type == "5" ? 1 : 0;
return contentDTO;
}
}
\ No newline at end of file
... ...
... ... @@ -15,7 +15,7 @@ const TAG: string = 'BigPicCardComponent';
@Component
export struct BigPicCardComponent {
@State compDTO: CompDTO = {} as CompDTO
contentDTO: ContentDTO = {} as ContentDTO;
contentDTO: ContentDTO = new ContentDTO();
aboutToAppear() {
// 取第一个数据
... ...
... ... @@ -4,7 +4,7 @@ import { ContentDTO } from 'wdBean'
import { CardMediaInfo } from '../cardCommon/CardMediaInfo'
@Component
export struct LiveHorizontalCardForOneComponent {
@State contentDTO: ContentDTO = {} as ContentDTO
@State contentDTO: ContentDTO = new ContentDTO()
build() {
Column() {
... ...
... ... @@ -236,7 +236,7 @@ export class PageHelper {
// 轮播组件广告数据转 业务信息
let changeContentDTO = (matInfo: CompAdvMatInfoBean) => {
let advContentBean: ContentDTO = {} as ContentDTO;
let advContentBean: ContentDTO = new ContentDTO();
advContentBean.newsTitle = matInfo.advTitle
advContentBean.objectType = matInfo.advType == "0" ? matInfo.advType.toString() : "4"
advContentBean.coverUrl = matInfo.matImageUrl[0]
... ...