Showing
39 changed files
with
341 additions
and
268 deletions
| @@ -46,7 +46,7 @@ export class ProcessUtils { | @@ -46,7 +46,7 @@ export class ProcessUtils { | ||
| 46 | 46 | ||
| 47 | if ('1' == type) { | 47 | if ('1' == type) { |
| 48 | // 内链 | 48 | // 内链 |
| 49 | - let content: ContentDTO = {} as ContentDTO; | 49 | + let content: ContentDTO = new ContentDTO(); |
| 50 | content.linkUrl = linkUrl; | 50 | content.linkUrl = linkUrl; |
| 51 | ProcessUtils.gotoWeb(content); | 51 | ProcessUtils.gotoWeb(content); |
| 52 | } else if ('2' == type) { | 52 | } else if ('2' == type) { |
| @@ -62,16 +62,13 @@ export class ProcessUtils { | @@ -62,16 +62,13 @@ export class ProcessUtils { | ||
| 62 | * @param advert 展现中心的展现广告 | 62 | * @param advert 展现中心的展现广告 |
| 63 | */ | 63 | */ |
| 64 | static advJumpMainPage(advert: AdvertsBean) { | 64 | static advJumpMainPage(advert: AdvertsBean) { |
| 65 | - | ||
| 66 | - let content: ContentDTO = { | ||
| 67 | - linkUrl: advert.linkUrl, | ||
| 68 | - pageId: advert.pageId, | ||
| 69 | - objectId: advert.objectId, | ||
| 70 | - objectType: advert.objectType.toString(), | ||
| 71 | - relId: advert.relId, | ||
| 72 | - bottomNavId: advert.bottomNavId | ||
| 73 | - } as ContentDTO; | ||
| 74 | - | 65 | + let content: ContentDTO = new ContentDTO() |
| 66 | + content.linkUrl = advert.linkUrl; | ||
| 67 | + content.pageId = advert.pageId; | ||
| 68 | + content.objectId = advert.objectId; | ||
| 69 | + content.objectType = advert.objectType.toString(); | ||
| 70 | + content.relId = advert.relId; | ||
| 71 | + content.bottomNavId = advert.bottomNavId; | ||
| 75 | ProcessUtils.processPage(content); | 72 | ProcessUtils.processPage(content); |
| 76 | } | 73 | } |
| 77 | 74 |
| @@ -134,12 +134,12 @@ function handleJsCallReceiveH5Data(data: Message) { | @@ -134,12 +134,12 @@ function handleJsCallReceiveH5Data(data: Message) { | ||
| 134 | break; | 134 | break; |
| 135 | case '6': | 135 | case '6': |
| 136 | let contentJson: IDataJson = JSON.parse(data?.data?.dataJson || '{}') | 136 | let contentJson: IDataJson = JSON.parse(data?.data?.dataJson || '{}') |
| 137 | - let content: ContentDTO = { | ||
| 138 | - objectId: contentJson?.newsId, | ||
| 139 | - relId: contentJson?.newsRelId, | ||
| 140 | - pageId: contentJson?.pageId, | ||
| 141 | - objectType: String(contentJson?.newsObjectType) | ||
| 142 | - } as ContentDTO | 137 | + let content: ContentDTO = new ContentDTO(); |
| 138 | + | ||
| 139 | + content.objectId = contentJson?.newsId; | ||
| 140 | + content.relId = contentJson?.newsRelId; | ||
| 141 | + content.pageId = contentJson?.pageId; | ||
| 142 | + content.objectType = String(contentJson?.newsObjectType); | ||
| 143 | ProcessUtils.processPage(content) | 143 | ProcessUtils.processPage(content) |
| 144 | break; | 144 | break; |
| 145 | default: | 145 | default: |
| @@ -150,15 +150,15 @@ function handleJsCallReceiveH5Data(data: Message) { | @@ -150,15 +150,15 @@ function handleJsCallReceiveH5Data(data: Message) { | ||
| 150 | function handleJsCallAppInnerLinkMethod(data: Message) { | 150 | function handleJsCallAppInnerLinkMethod(data: Message) { |
| 151 | let urlObject = Url.URL.parseURL(data?.data?.appInnerLink); | 151 | let urlObject = Url.URL.parseURL(data?.data?.appInnerLink); |
| 152 | let urlParams = new Url.URLParams(urlObject.search); | 152 | let urlParams = new Url.URLParams(urlObject.search); |
| 153 | - let content: ContentDTO = { | ||
| 154 | - objectId: urlParams.get('contentId') || '', | ||
| 155 | - relId: urlParams.get('relId') || '', | ||
| 156 | - relType: urlParams.get('relType') || '', | ||
| 157 | - pageId: urlParams.get('pageId') || '', | ||
| 158 | - objectType: '', | ||
| 159 | - linkUrl: encodeURI(urlParams.get('url') || '') | ||
| 160 | - } as ContentDTO | ||
| 161 | - switch (urlParams.get('type')) { | 153 | + let content: ContentDTO = new ContentDTO() |
| 154 | + | ||
| 155 | + content.objectId = urlParams.get('contentId') || ''; | ||
| 156 | + content.relId = urlParams.get('relId') || ''; | ||
| 157 | + content.relType = urlParams.get('relType') || ''; | ||
| 158 | + content.pageId = urlParams.get('pageId') || ''; | ||
| 159 | + content.objectType = ''; | ||
| 160 | + content.linkUrl = encodeURI(urlParams.get('url') || ''); | ||
| 161 | + switch (urlParams.get('type')) { | ||
| 162 | case 'video': | 162 | case 'video': |
| 163 | content.objectType = ContentConstants.TYPE_VOD | 163 | content.objectType = ContentConstants.TYPE_VOD |
| 164 | ProcessUtils.processPage(content) | 164 | ProcessUtils.processPage(content) |
| @@ -3,47 +3,48 @@ import { AudioDTO } from '../content/AudioDTO'; | @@ -3,47 +3,48 @@ import { AudioDTO } from '../content/AudioDTO'; | ||
| 3 | import { ContentDTO } from '../content/ContentDTO'; | 3 | import { ContentDTO } from '../content/ContentDTO'; |
| 4 | import { BaseDTO } from './BaseDTO'; | 4 | import { BaseDTO } from './BaseDTO'; |
| 5 | 5 | ||
| 6 | -export interface CompDTO extends BaseDTO{ | ||
| 7 | - backgroundColor: string; | ||
| 8 | - backgroundImgUrl: string; | ||
| 9 | - cityCode: string; | ||
| 10 | - compStyle: string; | ||
| 11 | - compType: string; | 6 | +@Observed |
| 7 | +export class CompDTO implements BaseDTO{ | ||
| 8 | + backgroundColor: string=''; | ||
| 9 | + backgroundImgUrl: string=''; | ||
| 10 | + cityCode: string=''; | ||
| 11 | + compStyle: string=''; | ||
| 12 | + compType: string=''; | ||
| 12 | 13 | ||
| 13 | // dataSourceRequest: any[]; | 14 | // dataSourceRequest: any[]; |
| 14 | - districtCode: string; | 15 | + districtCode: string=''; |
| 15 | extraData?: string; | 16 | extraData?: string; |
| 16 | - hasAdInfo: number; | ||
| 17 | - id: number; | ||
| 18 | - imgSize: string; | ||
| 19 | - innerUrl: string; | ||
| 20 | - linkUrl: string; | 17 | + hasAdInfo: number=-1; |
| 18 | + id: number=0; | ||
| 19 | + imgSize: string=''; | ||
| 20 | + innerUrl: string=''; | ||
| 21 | + linkUrl: string=''; | ||
| 21 | 22 | ||
| 22 | // meddleDataList: any[]; | 23 | // meddleDataList: any[]; |
| 23 | - name: string; | ||
| 24 | - objectId: string; // 跳转页面id? | ||
| 25 | - objectTitle: string; // comp标题 | 24 | + name: string=''; |
| 25 | + objectId: string=''; // 跳转页面id? | ||
| 26 | + objectTitle: string=''; // comp标题 | ||
| 26 | // objectType?: string; // 跳转类型,枚举: | 27 | // objectType?: string; // 跳转类型,枚举: |
| 27 | - operDataList: ContentDTO[]; // 运营数据列表【正常运营配置的强运营数据,部分推荐场景的配置(自动源兜底数据)】 | 28 | + operDataList: ContentDTO[]=[]; // 运营数据列表【正常运营配置的强运营数据,部分推荐场景的配置(自动源兜底数据)】 |
| 28 | // pageId?: any; | 29 | // pageId?: any; |
| 29 | - posterSize: string; | ||
| 30 | - posterUrl: string; | ||
| 31 | - provinceCode: string; | ||
| 32 | - sortValue: number; | ||
| 33 | - subType: string; | ||
| 34 | - imageScale: number; // 封面图比例 1-4:3, 2-16:9, 3-3:2 | ||
| 35 | - audioDataList: AudioDTO[]; | ||
| 36 | - titleShowPolicy: string | number; | 30 | + posterSize: string=''; |
| 31 | + posterUrl: string=''; | ||
| 32 | + provinceCode: string=''; | ||
| 33 | + sortValue: number=-1; | ||
| 34 | + subType: string=''; | ||
| 35 | + imageScale: number=-1; // 封面图比例 1-4:3, 2-16:9, 3-3:2 | ||
| 36 | + audioDataList: AudioDTO[]=[]; | ||
| 37 | + titleShowPolicy: string | number=''; | ||
| 37 | 38 | ||
| 38 | /** | 39 | /** |
| 39 | * 组件内容源类型 (LIVE_HORIZONTAL_CARD\LIVE_RESERVATION\LIVE_LARGE_CARD\LIVE_END\LIVE_MONTHLY_RANKING ) | 40 | * 组件内容源类型 (LIVE_HORIZONTAL_CARD\LIVE_RESERVATION\LIVE_LARGE_CARD\LIVE_END\LIVE_MONTHLY_RANKING ) |
| 40 | */ | 41 | */ |
| 41 | - dataSourceType: string; | 42 | + dataSourceType: string=''; |
| 42 | 43 | ||
| 43 | /** | 44 | /** |
| 44 | * 信息流广告素材 | 45 | * 信息流广告素材 |
| 45 | */ | 46 | */ |
| 46 | - matInfo: CompAdvMatInfoBean | 47 | + matInfo: CompAdvMatInfoBean = {} as CompAdvMatInfoBean |
| 47 | 48 | ||
| 48 | pageId?: string; | 49 | pageId?: string; |
| 49 | objectType?: string; | 50 | objectType?: string; |
| @@ -8,81 +8,148 @@ import { RmhInfoDTO } from '../detail/RmhInfoDTO'; | @@ -8,81 +8,148 @@ import { RmhInfoDTO } from '../detail/RmhInfoDTO'; | ||
| 8 | import { commentInfo } from './commentInfo'; | 8 | import { commentInfo } from './commentInfo'; |
| 9 | import { BaseDTO } from '../component/BaseDTO'; | 9 | import { BaseDTO } from '../component/BaseDTO'; |
| 10 | 10 | ||
| 11 | -export interface ContentDTO extends BaseDTO { | ||
| 12 | - appStyle: string; | ||
| 13 | - cityCode: string; | ||
| 14 | - coverSize: string; | ||
| 15 | - coverType: number; | ||
| 16 | - coverUrl: string; | ||
| 17 | - description: string; | ||
| 18 | - districtCode: string; | ||
| 19 | - endTime: string; | ||
| 20 | - hImageUrl: string; | ||
| 21 | - heatValue: string; | ||
| 22 | - innerUrl: string; | ||
| 23 | - landscape: number; | 11 | +@Observed |
| 12 | +export class ContentDTO implements BaseDTO { | ||
| 13 | + appStyle: string = ''; | ||
| 14 | + cityCode: string = ''; | ||
| 15 | + coverSize: string = ''; | ||
| 16 | + coverType: number = -1; | ||
| 17 | + coverUrl: string = ''; | ||
| 18 | + description: string = ''; | ||
| 19 | + districtCode: string = ''; | ||
| 20 | + endTime: string = ''; | ||
| 21 | + hImageUrl: string = ''; | ||
| 22 | + heatValue: string = ''; | ||
| 23 | + innerUrl: string = ''; | ||
| 24 | + landscape: number = -1; | ||
| 24 | lengthTime?: object; | 25 | lengthTime?: object; |
| 25 | - linkUrl: string; | ||
| 26 | - openLikes: number; | 26 | + linkUrl: string = ''; |
| 27 | + openLikes: number = 0; | ||
| 27 | openComment?: number; | 28 | openComment?: number; |
| 28 | - openUrl: string; | ||
| 29 | - pageId: string; | ||
| 30 | - | 29 | + openUrl: string = ''; |
| 30 | + pageId: string = ''; | ||
| 31 | // playUrls: any[]; | 31 | // playUrls: any[]; |
| 32 | - programAuth: string; | ||
| 33 | - programId: string; | ||
| 34 | - programName: string; | ||
| 35 | - programSource: number; | ||
| 36 | - programType: number; | ||
| 37 | - provinceCode: string; | ||
| 38 | - | 32 | + programAuth: string = ''; |
| 33 | + programId: string = ''; | ||
| 34 | + programName: string = ''; | ||
| 35 | + programSource: number = -1; | ||
| 36 | + programType: number = -1; | ||
| 37 | + provinceCode: string = ''; | ||
| 39 | // rankingList: any[]; | 38 | // rankingList: any[]; |
| 40 | - showTitleEd: string; | ||
| 41 | - showTitleIng: string; | ||
| 42 | - showTitleNo: string; | ||
| 43 | - | 39 | + showTitleEd: string = ''; |
| 40 | + showTitleIng: string = ''; | ||
| 41 | + showTitleNo: string = ''; | ||
| 44 | // sortValue?: any; | 42 | // sortValue?: any; |
| 45 | - startTime: string; | ||
| 46 | - subType: string; | ||
| 47 | - subtitle: string; | ||
| 48 | - title: string; | ||
| 49 | - vImageUrl: string; | ||
| 50 | - screenType: string; | ||
| 51 | - source: string; | ||
| 52 | - objectId: string; | ||
| 53 | - objectType: string; | ||
| 54 | - channelId: string; | ||
| 55 | - relId: string; | ||
| 56 | - relType: string; | ||
| 57 | - newsTitle: string; //单图卡/2行标题/3行标题 | ||
| 58 | - publishTime: string; | ||
| 59 | - publishTimestamp: string; | ||
| 60 | - visitorComment: number; | ||
| 61 | - fullColumnImgUrls: FullColumnImgUrlDTO[]; | ||
| 62 | - liveInfo: LiveInfoDTO; // 直播新闻信息【BFF聚合】 | ||
| 63 | - videoInfo: VideoInfoDTO; // 视频新闻信息【BFF聚合】,视频非原片+清晰度最高的 | 43 | + startTime: string = ''; |
| 44 | + subType: string = ''; | ||
| 45 | + subtitle: string = ''; | ||
| 46 | + title: string = ''; | ||
| 47 | + vImageUrl: string = ''; | ||
| 48 | + screenType: string = ''; | ||
| 49 | + source: string = ''; | ||
| 50 | + objectId: string = ''; | ||
| 51 | + objectType: string = ''; | ||
| 52 | + channelId: string = ''; | ||
| 53 | + relId: string = ''; | ||
| 54 | + relType: string = ''; | ||
| 55 | + newsTitle: string = ''; //单图卡/2行标题/3行标题 | ||
| 56 | + publishTime: string = ''; | ||
| 57 | + publishTimestamp: string = ''; | ||
| 58 | + visitorComment: number = 0; | ||
| 59 | + fullColumnImgUrls: FullColumnImgUrlDTO[] = []; | ||
| 60 | + liveInfo: LiveInfoDTO = {} as LiveInfoDTO; // 直播新闻信息【BFF聚合】 | ||
| 61 | + videoInfo: VideoInfoDTO = {} as VideoInfoDTO; // 视频新闻信息【BFF聚合】,视频非原片+清晰度最高的 | ||
| 64 | 62 | ||
| 65 | - newsSummary: string; //appstyle:2 ,新闻详情 | 63 | + newsSummary: string = ''; //appstyle:2 ,新闻详情 |
| 66 | 64 | ||
| 67 | // 二次请求接口,返回的数据,这里组装到content里; | 65 | // 二次请求接口,返回的数据,这里组装到content里; |
| 68 | - interactData: InteractDataDTO; | ||
| 69 | - hasMore: number, | ||
| 70 | - slideShows: slideShows[], | ||
| 71 | - voiceInfo: VoiceInfoDTO, | ||
| 72 | - tagWord: number, | ||
| 73 | - isSelect: boolean; | ||
| 74 | - rmhInfo: RmhInfoDTO; // 人民号信息 | ||
| 75 | - photoNum: number; | ||
| 76 | - corner: string; | ||
| 77 | - rmhPlatform: number; | ||
| 78 | - newTags: string; | 66 | + interactData?: InteractDataDTO; |
| 67 | + hasMore: number = -1; | ||
| 68 | + slideShows: slideShows[] = []; | ||
| 69 | + voiceInfo: VoiceInfoDTO = {} as VoiceInfoDTO; | ||
| 70 | + tagWord: number = -1; | ||
| 71 | + isSelect: boolean = false; | ||
| 72 | + rmhInfo: RmhInfoDTO = {} as RmhInfoDTO; // 人民号信息 | ||
| 73 | + photoNum: number = 0; | ||
| 74 | + corner: string = ''; | ||
| 75 | + rmhPlatform: number = 0; | ||
| 76 | + newTags: string = ''; | ||
| 79 | titleShow?: number; | 77 | titleShow?: number; |
| 80 | isSearch?: boolean; // 是否是搜索的结果,区分搜索和主页的数据 | 78 | isSearch?: boolean; // 是否是搜索的结果,区分搜索和主页的数据 |
| 81 | isCollection?: boolean; // 是否是收藏的结果,区分搜索和主页的数据 | 79 | isCollection?: boolean; // 是否是收藏的结果,区分搜索和主页的数据 |
| 82 | commentInfo?: commentInfo | 80 | commentInfo?: commentInfo |
| 83 | //底部导航栏 id(用于频道跳转) | 81 | //底部导航栏 id(用于频道跳转) |
| 84 | - bottomNavId:string; | 82 | + bottomNavId: string = ''; |
| 85 | // 链接类型: 0:无链接;1:内链(文章);2:外链 | 83 | // 链接类型: 0:无链接;1:内链(文章);2:外链 |
| 86 | - openType:string | ||
| 87 | - extra:string | 84 | + openType: string = ''; |
| 85 | + extra: string = '' | ||
| 86 | + | ||
| 87 | + static clone(old:ContentDTO): ContentDTO { | ||
| 88 | + let content = new ContentDTO(); | ||
| 89 | + content.appStyle = old.appStyle; | ||
| 90 | + content.cityCode = old.cityCode; | ||
| 91 | + content.coverSize = old.coverSize; | ||
| 92 | + content.coverType = old.coverType; | ||
| 93 | + content.coverUrl = old.coverUrl; | ||
| 94 | + content.description = old.description; | ||
| 95 | + content.districtCode = old.districtCode; | ||
| 96 | + content.endTime = old.endTime; | ||
| 97 | + content.hImageUrl = old.hImageUrl; | ||
| 98 | + content.heatValue = old.heatValue; | ||
| 99 | + content.innerUrl = old.innerUrl; | ||
| 100 | + content.landscape = old.landscape; | ||
| 101 | + content.lengthTime = old.lengthTime; | ||
| 102 | + content.linkUrl = old.linkUrl; | ||
| 103 | + content.openLikes = old.openLikes; | ||
| 104 | + content.openComment = old.openComment; | ||
| 105 | + content.openUrl = old.openUrl; | ||
| 106 | + content.pageId = old.pageId; | ||
| 107 | + content.programAuth = old.programAuth; | ||
| 108 | + content.programId = old.programId; | ||
| 109 | + content.programName = old.programName; | ||
| 110 | + content.programSource = old.programSource; | ||
| 111 | + content.programType = old.programType; | ||
| 112 | + content.provinceCode = old.provinceCode; | ||
| 113 | + content.showTitleEd = old.showTitleEd; | ||
| 114 | + content.showTitleIng = old.showTitleIng; | ||
| 115 | + content.showTitleNo = old.showTitleNo; | ||
| 116 | + content.startTime = old.startTime; | ||
| 117 | + content.subType = old.subType; | ||
| 118 | + content.subtitle = old.subtitle; | ||
| 119 | + content.title = old.title; | ||
| 120 | + content.vImageUrl = old.vImageUrl; | ||
| 121 | + content.source = old.source; | ||
| 122 | + content.objectId = old.objectId; | ||
| 123 | + content.objectType = old.objectType; | ||
| 124 | + content.channelId = old.channelId; | ||
| 125 | + content.relId = old.relId; | ||
| 126 | + content.relType = old.relType; | ||
| 127 | + content.newsTitle = old.newsTitle; | ||
| 128 | + content.publishTime = old.publishTime; | ||
| 129 | + content.publishTimestamp = old.publishTimestamp; | ||
| 130 | + content.visitorComment = old.visitorComment; | ||
| 131 | + content.fullColumnImgUrls = old.fullColumnImgUrls; | ||
| 132 | + content.liveInfo = old.liveInfo; | ||
| 133 | + content.videoInfo = old.videoInfo; | ||
| 134 | + content.newsSummary = old.newsSummary; | ||
| 135 | + content.interactData = old.interactData; | ||
| 136 | + content.hasMore = old.hasMore; | ||
| 137 | + content.slideShows = old.slideShows; | ||
| 138 | + content.voiceInfo = old.voiceInfo; | ||
| 139 | + content.tagWord = old.tagWord; | ||
| 140 | + content.isSelect = old.isSelect; | ||
| 141 | + content.rmhInfo = old.rmhInfo; | ||
| 142 | + content.photoNum = old.photoNum; | ||
| 143 | + content.corner = old.corner; | ||
| 144 | + content.rmhPlatform = old.rmhPlatform; | ||
| 145 | + content.newTags = old.newTags; | ||
| 146 | + content.titleShow = old.titleShow; | ||
| 147 | + content.isSearch = old.isSearch; | ||
| 148 | + content.isCollection = old.isCollection; | ||
| 149 | + content.commentInfo = old.commentInfo; | ||
| 150 | + content.bottomNavId = old.bottomNavId; | ||
| 151 | + content.openType = old.openType; | ||
| 152 | + content.extra = old.extra; | ||
| 153 | + return content; | ||
| 154 | + } | ||
| 88 | } | 155 | } |
| 1 | /** | 1 | /** |
| 2 | * 批查接口查询互动相关数据,返回数据bean | 2 | * 批查接口查询互动相关数据,返回数据bean |
| 3 | */ | 3 | */ |
| 4 | -export interface InteractDataDTO { | ||
| 5 | - collectNum: number | string; | ||
| 6 | - commentNum: number | string; | ||
| 7 | - contentId: string; | ||
| 8 | - contentType: number; | ||
| 9 | - likeNum: number | string; | ||
| 10 | - readNum: number; | ||
| 11 | - shareNum: number; | 4 | +@Observed |
| 5 | +export class InteractDataDTO { | ||
| 6 | + collectNum: number | string = 0; | ||
| 7 | + commentNum: number | string = 0; | ||
| 8 | + contentId: string = ''; | ||
| 9 | + contentType: number = 0; | ||
| 10 | + likeNum: number | string = 0; | ||
| 11 | + readNum: number = 0; | ||
| 12 | + shareNum: number = 0; | ||
| 12 | } | 13 | } |
| @@ -23,7 +23,7 @@ import { Card21Component } from './cardview/Card21Component'; | @@ -23,7 +23,7 @@ import { Card21Component } from './cardview/Card21Component'; | ||
| 23 | */ | 23 | */ |
| 24 | @Component | 24 | @Component |
| 25 | export struct CardParser { | 25 | export struct CardParser { |
| 26 | - @State contentDTO: ContentDTO = {} as ContentDTO; | 26 | + @State contentDTO: ContentDTO = new ContentDTO(); |
| 27 | 27 | ||
| 28 | build() { | 28 | build() { |
| 29 | this.contentBuilder(this.contentDTO); | 29 | this.contentBuilder(this.contentDTO); |
| @@ -55,7 +55,7 @@ export struct DynamicDetailComponent { | @@ -55,7 +55,7 @@ export struct DynamicDetailComponent { | ||
| 55 | 55 | ||
| 56 | @State newsStatusOfUser: batchLikeAndCollectResult = {} as batchLikeAndCollectResult// 点赞、收藏状态 | 56 | @State newsStatusOfUser: batchLikeAndCollectResult = {} as batchLikeAndCollectResult// 点赞、收藏状态 |
| 57 | //跳转 | 57 | //跳转 |
| 58 | - private mJumpInfo: ContentDTO = {} as ContentDTO; | 58 | + private mJumpInfo: ContentDTO = new ContentDTO(); |
| 59 | 59 | ||
| 60 | @State publishTime: string = '' | 60 | @State publishTime: string = '' |
| 61 | @State isNetConnected: boolean = true | 61 | @State isNetConnected: boolean = true |
| @@ -9,7 +9,7 @@ import { DateTimeUtils } from 'wdKit/Index' | @@ -9,7 +9,7 @@ import { DateTimeUtils } from 'wdKit/Index' | ||
| 9 | */ | 9 | */ |
| 10 | @Component | 10 | @Component |
| 11 | export struct CardMediaInfo { | 11 | export struct CardMediaInfo { |
| 12 | - @State contentDTO: ContentDTO = {} as ContentDTO // 如果有duraion,代表点播,显示时长;如果不传或者传0,显示直播中 | 12 | + @State contentDTO: ContentDTO = new ContentDTO() // 如果有duraion,代表点播,显示时长;如果不传或者传0,显示直播中 |
| 13 | 13 | ||
| 14 | // objectType 0:不跳转 1:点播,2:直播,3:活动,4:广告,5:专题,6:链接,7:榜单,8:图文,9:组图,10:H5新闻,11:频道,12:组件,13:音频, | 14 | // objectType 0:不跳转 1:点播,2:直播,3:活动,4:广告,5:专题,6:链接,7:榜单,8:图文,9:组图,10:H5新闻,11:频道,12:组件,13:音频, |
| 15 | // 14动态图文,15动态视频16问政;100人民号,101标签 | 15 | // 14动态图文,15动态视频16问政;100人民号,101标签 |
| @@ -4,7 +4,7 @@ import { DateTimeUtils } from 'wdKit/Index'; | @@ -4,7 +4,7 @@ import { DateTimeUtils } from 'wdKit/Index'; | ||
| 4 | 4 | ||
| 5 | @Component | 5 | @Component |
| 6 | export struct CardSourceInfo { | 6 | export struct CardSourceInfo { |
| 7 | - @State contentDTO: ContentDTO = {} as ContentDTO; | 7 | + @State contentDTO: ContentDTO = new ContentDTO(); |
| 8 | 8 | ||
| 9 | build() { | 9 | build() { |
| 10 | Flex() { | 10 | Flex() { |
| @@ -20,7 +20,7 @@ const TAG: string = 'Card2Component'; | @@ -20,7 +20,7 @@ const TAG: string = 'Card2Component'; | ||
| 20 | @Component | 20 | @Component |
| 21 | export struct CardAdvVideoComponent { | 21 | export struct CardAdvVideoComponent { |
| 22 | @State compDTO: CompDTO = {} as CompDTO | 22 | @State compDTO: CompDTO = {} as CompDTO |
| 23 | - @State contentDTO: ContentDTO = {} as ContentDTO | 23 | + @State contentDTO: ContentDTO = new ContentDTO() |
| 24 | pageModel: PageModel = new PageModel(); | 24 | pageModel: PageModel = new PageModel(); |
| 25 | aboutToAppear(): void { | 25 | aboutToAppear(): void { |
| 26 | 26 |
| 1 | -import { ContentDTO, slideShows } from 'wdBean'; | 1 | +import { ContentDTO, slideShows, VideoInfoDTO } from 'wdBean'; |
| 2 | import { CommonConstants } from 'wdConstant'; | 2 | import { CommonConstants } from 'wdConstant'; |
| 3 | import { ProcessUtils } from 'wdRouter'; | 3 | import { ProcessUtils } from 'wdRouter'; |
| 4 | import { CardSourceInfo } from '../cardCommon/CardSourceInfo'; | 4 | import { CardSourceInfo } from '../cardCommon/CardSourceInfo'; |
| @@ -14,7 +14,7 @@ const TAG: string = 'Card10Component'; | @@ -14,7 +14,7 @@ const TAG: string = 'Card10Component'; | ||
| 14 | @Preview | 14 | @Preview |
| 15 | @Component | 15 | @Component |
| 16 | export struct Card10Component { | 16 | export struct Card10Component { |
| 17 | - @State contentDTO: ContentDTO = {} as ContentDTO; | 17 | + @State contentDTO: ContentDTO = new ContentDTO(); |
| 18 | @State loadImg: boolean = false; | 18 | @State loadImg: boolean = false; |
| 19 | 19 | ||
| 20 | async aboutToAppear(): Promise<void> { | 20 | async aboutToAppear(): Promise<void> { |
| @@ -111,10 +111,7 @@ export struct Card10Component { | @@ -111,10 +111,7 @@ export struct Card10Component { | ||
| 111 | 111 | ||
| 112 | CardSourceInfo( | 112 | CardSourceInfo( |
| 113 | { | 113 | { |
| 114 | - contentDTO: { | ||
| 115 | - publishTime: item.publishTime || '', | ||
| 116 | - source: item.source || '' | ||
| 117 | - } as ContentDTO | 114 | + contentDTO: this.createContent(item) |
| 118 | } | 115 | } |
| 119 | ) | 116 | ) |
| 120 | } | 117 | } |
| @@ -132,12 +129,7 @@ export struct Card10Component { | @@ -132,12 +129,7 @@ export struct Card10Component { | ||
| 132 | .borderRadius($r('app.float.image_border_radius')) | 129 | .borderRadius($r('app.float.image_border_radius')) |
| 133 | .margin({ left: 12 }) | 130 | .margin({ left: 12 }) |
| 134 | CardMediaInfo({ | 131 | CardMediaInfo({ |
| 135 | - contentDTO: { | ||
| 136 | - objectType: String(item.objectType), | ||
| 137 | - videoInfo: { videoDuration: Number(item.videoDuration) as number }, | ||
| 138 | - photoNum: Number(item.photoNum), | ||
| 139 | - voiceInfo: { voiceDuration: Number(item.voiceDuration) as number } | ||
| 140 | - } as ContentDTO | 132 | + contentDTO: this.createMediaInfoContent(item) |
| 141 | }) | 133 | }) |
| 142 | } | 134 | } |
| 143 | .alignContent(Alignment.BottomEnd) | 135 | .alignContent(Alignment.BottomEnd) |
| @@ -153,4 +145,20 @@ export struct Card10Component { | @@ -153,4 +145,20 @@ export struct Card10Component { | ||
| 153 | ProcessUtils.processPage(data) | 145 | ProcessUtils.processPage(data) |
| 154 | }) | 146 | }) |
| 155 | } | 147 | } |
| 148 | + | ||
| 149 | + private createContent(item: slideShows): ContentDTO { | ||
| 150 | + let contentDTO = new ContentDTO() | ||
| 151 | + contentDTO.publishTime = item.publishTime.toString() || ''; | ||
| 152 | + contentDTO.source = item.source || ''; | ||
| 153 | + return contentDTO; | ||
| 154 | + } | ||
| 155 | + | ||
| 156 | + private createMediaInfoContent(item: slideShows): ContentDTO { | ||
| 157 | + let contentDTO = new ContentDTO() | ||
| 158 | + contentDTO.objectType = String(item.objectType); | ||
| 159 | + contentDTO.videoInfo = { videoDuration: Number(item.videoDuration) as number } as VideoInfoDTO; | ||
| 160 | + contentDTO.photoNum = Number(item.photoNum); | ||
| 161 | + contentDTO.voiceInfo = { voiceDuration: Number(item.voiceDuration) as number }; | ||
| 162 | + return contentDTO; | ||
| 163 | + } | ||
| 156 | } | 164 | } |
| @@ -11,7 +11,7 @@ const TAG = 'Card11Component'; | @@ -11,7 +11,7 @@ const TAG = 'Card11Component'; | ||
| 11 | */ | 11 | */ |
| 12 | @Component | 12 | @Component |
| 13 | export struct Card11Component { | 13 | export struct Card11Component { |
| 14 | - @State contentDTO: ContentDTO = {} as ContentDTO; | 14 | + @State contentDTO: ContentDTO = new ContentDTO(); |
| 15 | @State clicked: boolean = false; | 15 | @State clicked: boolean = false; |
| 16 | 16 | ||
| 17 | build() { | 17 | build() { |
| @@ -12,7 +12,7 @@ const TAG = 'Card12Component'; | @@ -12,7 +12,7 @@ const TAG = 'Card12Component'; | ||
| 12 | */ | 12 | */ |
| 13 | @Component | 13 | @Component |
| 14 | export struct Card12Component { | 14 | export struct Card12Component { |
| 15 | - @State contentDTO: ContentDTO = {} as ContentDTO; | 15 | + @State contentDTO: ContentDTO = new ContentDTO(); |
| 16 | @State clicked: boolean = false; | 16 | @State clicked: boolean = false; |
| 17 | 17 | ||
| 18 | aboutToAppear(): void { | 18 | aboutToAppear(): void { |
| @@ -13,7 +13,7 @@ const TAG = 'Card14Component'; | @@ -13,7 +13,7 @@ const TAG = 'Card14Component'; | ||
| 13 | */ | 13 | */ |
| 14 | @Component | 14 | @Component |
| 15 | export struct Card14Component { | 15 | export struct Card14Component { |
| 16 | - @State contentDTO: ContentDTO = {} as ContentDTO; | 16 | + @State contentDTO: ContentDTO = new ContentDTO(); |
| 17 | @State loadImg: boolean = false; | 17 | @State loadImg: boolean = false; |
| 18 | @State clicked: boolean = false; | 18 | @State clicked: boolean = false; |
| 19 | 19 |
| @@ -17,7 +17,7 @@ const TAG: string = 'Card15Component'; | @@ -17,7 +17,7 @@ const TAG: string = 'Card15Component'; | ||
| 17 | */ | 17 | */ |
| 18 | @Component | 18 | @Component |
| 19 | export struct Card15Component { | 19 | export struct Card15Component { |
| 20 | - @State contentDTO: ContentDTO = {} as ContentDTO; | 20 | + @State contentDTO: ContentDTO = new ContentDTO(); |
| 21 | @State loadImg: boolean = false; | 21 | @State loadImg: boolean = false; |
| 22 | @State clicked: boolean = false; | 22 | @State clicked: boolean = false; |
| 23 | 23 |
| @@ -18,7 +18,7 @@ interface fullColumnImgUrlItem { | @@ -18,7 +18,7 @@ interface fullColumnImgUrlItem { | ||
| 18 | */ | 18 | */ |
| 19 | @Component | 19 | @Component |
| 20 | export struct Card16Component { | 20 | export struct Card16Component { |
| 21 | - @State contentDTO: ContentDTO = {} as ContentDTO; | 21 | + @State contentDTO: ContentDTO = new ContentDTO(); |
| 22 | @State loadImg: boolean = false; | 22 | @State loadImg: boolean = false; |
| 23 | @State clicked: boolean = false; | 23 | @State clicked: boolean = false; |
| 24 | 24 |
| @@ -15,7 +15,7 @@ const TAG = 'Card17Component'; | @@ -15,7 +15,7 @@ const TAG = 'Card17Component'; | ||
| 15 | @Component | 15 | @Component |
| 16 | export struct Card17Component { | 16 | export struct Card17Component { |
| 17 | @State compDTO: CompDTO = {} as CompDTO | 17 | @State compDTO: CompDTO = {} as CompDTO |
| 18 | - @State contentDTO: ContentDTO = {} as ContentDTO; | 18 | + @State contentDTO: ContentDTO = new ContentDTO(); |
| 19 | @State loadImg: boolean = false; | 19 | @State loadImg: boolean = false; |
| 20 | @State clicked: boolean = false; | 20 | @State clicked: boolean = false; |
| 21 | 21 |
| @@ -12,8 +12,7 @@ const TAG = 'Card19Component'; | @@ -12,8 +12,7 @@ const TAG = 'Card19Component'; | ||
| 12 | */ | 12 | */ |
| 13 | @Component | 13 | @Component |
| 14 | export struct Card19Component { | 14 | export struct Card19Component { |
| 15 | - @State contentDTO: ContentDTO = { | ||
| 16 | - } as ContentDTO | 15 | + @State contentDTO: ContentDTO = new ContentDTO() |
| 17 | @State clicked: boolean = false; | 16 | @State clicked: boolean = false; |
| 18 | 17 | ||
| 19 | build() { | 18 | build() { |
| @@ -13,8 +13,7 @@ const TAG = 'Card20Component'; | @@ -13,8 +13,7 @@ const TAG = 'Card20Component'; | ||
| 13 | */ | 13 | */ |
| 14 | @Component | 14 | @Component |
| 15 | export struct Card20Component { | 15 | export struct Card20Component { |
| 16 | - @State contentDTO: ContentDTO = { | ||
| 17 | - } as ContentDTO; | 16 | + @State contentDTO: ContentDTO = new ContentDTO(); |
| 18 | @State clicked: boolean = false; | 17 | @State clicked: boolean = false; |
| 19 | 18 | ||
| 20 | aboutToAppear(): void { | 19 | aboutToAppear(): void { |
| @@ -13,7 +13,7 @@ const TAG: string = 'Card6Component-Card13Component'; | @@ -13,7 +13,7 @@ const TAG: string = 'Card6Component-Card13Component'; | ||
| 13 | */ | 13 | */ |
| 14 | @Component | 14 | @Component |
| 15 | export struct Card21Component { | 15 | export struct Card21Component { |
| 16 | - @State contentDTO: ContentDTO = {} as ContentDTO; | 16 | + @State contentDTO: ContentDTO = new ContentDTO(); |
| 17 | @State loadImg: boolean = false; | 17 | @State loadImg: boolean = false; |
| 18 | @State clicked: boolean = false; | 18 | @State clicked: boolean = false; |
| 19 | 19 |
| @@ -18,7 +18,7 @@ const TAG: string = 'Card2Component'; | @@ -18,7 +18,7 @@ const TAG: string = 'Card2Component'; | ||
| 18 | */ | 18 | */ |
| 19 | @Component | 19 | @Component |
| 20 | export struct Card2Component { | 20 | export struct Card2Component { |
| 21 | - @State contentDTO: ContentDTO = {} as ContentDTO; | 21 | + @State contentDTO: ContentDTO = new ContentDTO(); |
| 22 | @State loadImg: boolean = false; | 22 | @State loadImg: boolean = false; |
| 23 | @State clicked: boolean = false; | 23 | @State clicked: boolean = false; |
| 24 | 24 |
| @@ -9,8 +9,7 @@ import { CardSourceInfo } from '../cardCommon/CardSourceInfo' | @@ -9,8 +9,7 @@ import { CardSourceInfo } from '../cardCommon/CardSourceInfo' | ||
| 9 | */ | 9 | */ |
| 10 | @Component | 10 | @Component |
| 11 | export struct Card3Component { | 11 | export struct Card3Component { |
| 12 | - @State contentDTO: ContentDTO = { | ||
| 13 | - } as ContentDTO; | 12 | + @State contentDTO: ContentDTO = new ContentDTO(); |
| 14 | @State clicked: boolean = false; | 13 | @State clicked: boolean = false; |
| 15 | 14 | ||
| 16 | build() { | 15 | build() { |
| @@ -15,7 +15,7 @@ const TAG: string = 'Card4Component'; | @@ -15,7 +15,7 @@ const TAG: string = 'Card4Component'; | ||
| 15 | */ | 15 | */ |
| 16 | @Component | 16 | @Component |
| 17 | export struct Card4Component { | 17 | export struct Card4Component { |
| 18 | - @State contentDTO: ContentDTO = {} as ContentDTO; | 18 | + @State contentDTO: ContentDTO = new ContentDTO(); |
| 19 | @State loadImg: boolean = false; | 19 | @State loadImg: boolean = false; |
| 20 | @State clicked: boolean = false; | 20 | @State clicked: boolean = false; |
| 21 | 21 |
| @@ -11,7 +11,7 @@ const TAG: string = 'Card5Component'; | @@ -11,7 +11,7 @@ const TAG: string = 'Card5Component'; | ||
| 11 | */ | 11 | */ |
| 12 | @Component | 12 | @Component |
| 13 | export struct Card5Component { | 13 | export struct Card5Component { |
| 14 | - @State contentDTO: ContentDTO = {} as ContentDTO; | 14 | + @State contentDTO: ContentDTO = new ContentDTO(); |
| 15 | @State titleShowPolicy: number | string = 1 | 15 | @State titleShowPolicy: number | string = 1 |
| 16 | @State loadImg: boolean = false; | 16 | @State loadImg: boolean = false; |
| 17 | @State clicked: boolean = false; | 17 | @State clicked: boolean = false; |
| @@ -13,7 +13,7 @@ const TAG: string = 'Card6Component-Card13Component'; | @@ -13,7 +13,7 @@ const TAG: string = 'Card6Component-Card13Component'; | ||
| 13 | */ | 13 | */ |
| 14 | @Component | 14 | @Component |
| 15 | export struct Card6Component { | 15 | export struct Card6Component { |
| 16 | - @State contentDTO: ContentDTO = {} as ContentDTO; | 16 | + @State contentDTO: ContentDTO = new ContentDTO(); |
| 17 | @State loadImg: boolean = false; | 17 | @State loadImg: boolean = false; |
| 18 | @State clicked: boolean = false; | 18 | @State clicked: boolean = false; |
| 19 | 19 |
| @@ -12,7 +12,7 @@ const TAG: string = 'Card9Component'; | @@ -12,7 +12,7 @@ const TAG: string = 'Card9Component'; | ||
| 12 | 12 | ||
| 13 | @Component | 13 | @Component |
| 14 | export struct Card9Component { | 14 | export struct Card9Component { |
| 15 | - @State contentDTO: ContentDTO = {} as ContentDTO; | 15 | + @State contentDTO: ContentDTO = new ContentDTO(); |
| 16 | @State loadImg: boolean = false; | 16 | @State loadImg: boolean = false; |
| 17 | @State clicked: boolean = false; | 17 | @State clicked: boolean = false; |
| 18 | 18 |
sight_harmony/features/wdComponent/src/main/ets/components/comment/view/QualityCommentsComponent.ets
| @@ -443,18 +443,14 @@ struct QualityCommentItem { | @@ -443,18 +443,14 @@ struct QualityCommentItem { | ||
| 443 | 443 | ||
| 444 | jumpToDetail() { | 444 | jumpToDetail() { |
| 445 | // programInfoModel.api_isCommentAction = YES; | 445 | // programInfoModel.api_isCommentAction = YES; |
| 446 | - | ||
| 447 | - let program: ContentDTO = { | ||
| 448 | - objectId: this.item.targetId, | ||
| 449 | - objectType: this.item.targetType, | ||
| 450 | - relId: this.item.targetRelId, | ||
| 451 | - relType: this.item.targetRelType, | ||
| 452 | - // objectLevel: this.item.topicType, | ||
| 453 | - pageId: this.item.pageId, | ||
| 454 | - linkUrl: this.item.h5Url, | ||
| 455 | - } as ContentDTO | ||
| 456 | - | ||
| 457 | - ProcessUtils.processPage(program) | 446 | + let content = new ContentDTO() |
| 447 | + content.objectId = this.item.targetId; | ||
| 448 | + content.objectType = this.item.targetType; | ||
| 449 | + content.relId = this.item.targetRelId; | ||
| 450 | + content.relType = this.item.targetRelType; | ||
| 451 | + content.pageId = this.item.pageId; | ||
| 452 | + content.linkUrl = this.item.h5Url; | ||
| 453 | + ProcessUtils.processPage(content) | ||
| 458 | } | 454 | } |
| 459 | 455 | ||
| 460 | replyComment() { | 456 | replyComment() { |
| @@ -162,7 +162,7 @@ export struct ZhCarouselLayout01 { | @@ -162,7 +162,7 @@ export struct ZhCarouselLayout01 { | ||
| 162 | 162 | ||
| 163 | @Component | 163 | @Component |
| 164 | struct CarouselLayout01CardView { | 164 | struct CarouselLayout01CardView { |
| 165 | - private item: ContentDTO = {} as ContentDTO; | 165 | + private item: ContentDTO = new ContentDTO(); |
| 166 | private length: number = 1; // 轮播图数量 | 166 | private length: number = 1; // 轮播图数量 |
| 167 | @State loadImg: boolean = false; | 167 | @State loadImg: boolean = false; |
| 168 | 168 |
| @@ -195,13 +195,12 @@ export struct ChildCommentComponent { | @@ -195,13 +195,12 @@ export struct ChildCommentComponent { | ||
| 195 | }.height('69lpx') | 195 | }.height('69lpx') |
| 196 | .justifyContent(FlexAlign.Center) | 196 | .justifyContent(FlexAlign.Center) |
| 197 | .onClick(() => { | 197 | .onClick(() => { |
| 198 | - ProcessUtils.processPage( | ||
| 199 | - { | ||
| 200 | - objectId: this.data.targetId, | ||
| 201 | - relType: this.data.targetRelType + "", | ||
| 202 | - relId: this.data.targetRelId, | ||
| 203 | - objectType: this.data.targetType + "", | ||
| 204 | - } as ContentDTO) | 198 | + let content = new ContentDTO() |
| 199 | + content.objectId = this.data.targetId; | ||
| 200 | + content.relType = this.data.targetRelType + ""; | ||
| 201 | + content.relId = this.data.targetRelId; | ||
| 202 | + content.objectType = this.data.targetType + ""; | ||
| 203 | + ProcessUtils.processPage(content) | ||
| 205 | }) | 204 | }) |
| 206 | } | 205 | } |
| 207 | .margin({ top: '19lpx', bottom: '31lpx', left: '31lpx', right: '31lpx' }) | 206 | .margin({ top: '19lpx', bottom: '31lpx', left: '31lpx', right: '31lpx' }) |
| @@ -15,7 +15,7 @@ const TAG: string = 'CardView'; | @@ -15,7 +15,7 @@ const TAG: string = 'CardView'; | ||
| 15 | */ | 15 | */ |
| 16 | @Component | 16 | @Component |
| 17 | export struct CarouselLayout01CardView { | 17 | export struct CarouselLayout01CardView { |
| 18 | - private item: ContentDTO = {} as ContentDTO; | 18 | + private item: ContentDTO = new ContentDTO(); |
| 19 | private index: number = -1; | 19 | private index: number = -1; |
| 20 | 20 | ||
| 21 | build() { | 21 | build() { |
| @@ -85,7 +85,7 @@ export struct CarouselLayout01CardView { | @@ -85,7 +85,7 @@ export struct CarouselLayout01CardView { | ||
| 85 | */ | 85 | */ |
| 86 | @Component | 86 | @Component |
| 87 | export struct SingleColumn01CardView { | 87 | export struct SingleColumn01CardView { |
| 88 | - private item: ContentDTO = {} as ContentDTO; | 88 | + private item: ContentDTO = new ContentDTO(); |
| 89 | private index: number = -1; | 89 | private index: number = -1; |
| 90 | 90 | ||
| 91 | build() { | 91 | build() { |
| @@ -164,7 +164,7 @@ export struct SingleColumn01CardView { | @@ -164,7 +164,7 @@ export struct SingleColumn01CardView { | ||
| 164 | */ | 164 | */ |
| 165 | @Component | 165 | @Component |
| 166 | export struct SingleColumn02CardView { | 166 | export struct SingleColumn02CardView { |
| 167 | - private item: ContentDTO = {} as ContentDTO; | 167 | + private item: ContentDTO = new ContentDTO(); |
| 168 | private index: number = -1; | 168 | private index: number = -1; |
| 169 | 169 | ||
| 170 | build() { | 170 | build() { |
| @@ -288,7 +288,7 @@ export struct SingleColumn02CardView { | @@ -288,7 +288,7 @@ export struct SingleColumn02CardView { | ||
| 288 | */ | 288 | */ |
| 289 | @Component | 289 | @Component |
| 290 | export struct MasonryLayout01CardView { | 290 | export struct MasonryLayout01CardView { |
| 291 | - private item: ContentDTO = {} as ContentDTO; | 291 | + private item: ContentDTO = new ContentDTO(); |
| 292 | private index: number = -1; | 292 | private index: number = -1; |
| 293 | 293 | ||
| 294 | build() { | 294 | build() { |
| @@ -387,7 +387,7 @@ export struct MasonryLayout01CardView { | @@ -387,7 +387,7 @@ export struct MasonryLayout01CardView { | ||
| 387 | */ | 387 | */ |
| 388 | @Component | 388 | @Component |
| 389 | export struct PaperSingleColumn999CardView { | 389 | export struct PaperSingleColumn999CardView { |
| 390 | - private item: ContentDTO = {} as ContentDTO; | 390 | + private item: ContentDTO = new ContentDTO(); |
| 391 | private index: number = -1; | 391 | private index: number = -1; |
| 392 | @State interactData: InteractDataDTO = {} as InteractDataDTO; | 392 | @State interactData: InteractDataDTO = {} as InteractDataDTO; |
| 393 | @Consume @Watch('onChangeCommentList') commentList: InteractDataDTO[] | 393 | @Consume @Watch('onChangeCommentList') commentList: InteractDataDTO[] |
| @@ -29,7 +29,7 @@ struct LiveMorePage { | @@ -29,7 +29,7 @@ struct LiveMorePage { | ||
| 29 | pageSize: number = 20; | 29 | pageSize: number = 20; |
| 30 | operDataList: ContentDTO[] = []; | 30 | operDataList: ContentDTO[] = []; |
| 31 | title: string = '直播列表' | 31 | title: string = '直播列表' |
| 32 | - @State contentDTO: ContentDTO = { | 32 | + @State contentDTO: ContentDTO = new ContentDTO(); |
| 33 | // appStyle: '15', | 33 | // appStyle: '15', |
| 34 | // coverType: 1, | 34 | // coverType: 1, |
| 35 | // objectType: '9', | 35 | // objectType: '9', |
| @@ -67,7 +67,7 @@ struct LiveMorePage { | @@ -67,7 +67,7 @@ struct LiveMorePage { | ||
| 67 | // voiceInfo: { | 67 | // voiceInfo: { |
| 68 | // voiceDuration: 12 | 68 | // voiceDuration: 12 |
| 69 | // } | 69 | // } |
| 70 | - } as ContentDTO; | 70 | + // } as ContentDTO; |
| 71 | 71 | ||
| 72 | aboutToAppear(): void { | 72 | aboutToAppear(): void { |
| 73 | PageViewModel.getLiveMoreUrl(this.type, this.currentPage, this.pageSize).then((liveReviewDTO) => { | 73 | PageViewModel.getLiveMoreUrl(this.type, this.currentPage, this.pageSize).then((liveReviewDTO) => { |
| @@ -96,7 +96,7 @@ export struct PageComponent { | @@ -96,7 +96,7 @@ export struct PageComponent { | ||
| 96 | // comp自己处理分页,这里设置EdgeEffect.None | 96 | // comp自己处理分页,这里设置EdgeEffect.None |
| 97 | .edgeEffect(this.pageModel.contentNeedScroll ? EdgeEffect.None : EdgeEffect.Spring) | 97 | .edgeEffect(this.pageModel.contentNeedScroll ? EdgeEffect.None : EdgeEffect.Spring) |
| 98 | .scrollBar(BarState.Off) | 98 | .scrollBar(BarState.Off) |
| 99 | - .cachedCount(8) | 99 | + .cachedCount(5) |
| 100 | .height(CommonConstants.FULL_PARENT) | 100 | .height(CommonConstants.FULL_PARENT) |
| 101 | .onScrollIndex((start: number, end: number) => { | 101 | .onScrollIndex((start: number, end: number) => { |
| 102 | // Listen to the first index of the current list. | 102 | // Listen to the first index of the current list. |
| @@ -33,7 +33,7 @@ struct ReserveMorePage { | @@ -33,7 +33,7 @@ struct ReserveMorePage { | ||
| 33 | title: string = '预约列表' | 33 | title: string = '预约列表' |
| 34 | //是否预约过直播 | 34 | //是否预约过直播 |
| 35 | @State isAppointmentLive: boolean = false | 35 | @State isAppointmentLive: boolean = false |
| 36 | - @State contentDTO: ContentDTO = { | 36 | + @State contentDTO: ContentDTO = new ContentDTO() |
| 37 | // appStyle: '15', | 37 | // appStyle: '15', |
| 38 | // coverType: 1, | 38 | // coverType: 1, |
| 39 | // objectType: '9', | 39 | // objectType: '9', |
| @@ -71,7 +71,7 @@ struct ReserveMorePage { | @@ -71,7 +71,7 @@ struct ReserveMorePage { | ||
| 71 | // voiceInfo: { | 71 | // voiceInfo: { |
| 72 | // voiceDuration: 12 | 72 | // voiceDuration: 12 |
| 73 | // } | 73 | // } |
| 74 | - } as ContentDTO; | 74 | + // } as ContentDTO; |
| 75 | 75 | ||
| 76 | async aboutToAppear(): Promise<void> { | 76 | async aboutToAppear(): Promise<void> { |
| 77 | // PageViewModel.get | 77 | // PageViewModel.get |
| @@ -214,7 +214,7 @@ export struct PeopleShipHomeArticleListComponent { | @@ -214,7 +214,7 @@ export struct PeopleShipHomeArticleListComponent { | ||
| 214 | this.arr = [] | 214 | this.arr = [] |
| 215 | } | 215 | } |
| 216 | for (const element of listData.list) { | 216 | for (const element of listData.list) { |
| 217 | - let contentDTO = {} as ContentDTO | 217 | + let contentDTO = new ContentDTO() |
| 218 | contentDTO.appStyle = this.changeCommon(element.appStyle) | 218 | contentDTO.appStyle = this.changeCommon(element.appStyle) |
| 219 | contentDTO.newsTitle = element.title; | 219 | contentDTO.newsTitle = element.title; |
| 220 | contentDTO.newsSummary = element.description; | 220 | contentDTO.newsSummary = element.description; |
| @@ -6,7 +6,7 @@ import { ProcessUtils } from 'wdRouter/Index'; | @@ -6,7 +6,7 @@ import { ProcessUtils } from 'wdRouter/Index'; | ||
| 6 | 6 | ||
| 7 | @Component | 7 | @Component |
| 8 | export struct ActivityItemComponent { | 8 | export struct ActivityItemComponent { |
| 9 | - @State contentDTO: ContentDTO = {} as ContentDTO; | 9 | + @State contentDTO: ContentDTO = new ContentDTO(); |
| 10 | 10 | ||
| 11 | build() { | 11 | build() { |
| 12 | Row() { | 12 | Row() { |
| @@ -10,7 +10,7 @@ import { WDRouterPage, WDRouterRule } from 'wdRouter/Index' | @@ -10,7 +10,7 @@ import { WDRouterPage, WDRouterRule } from 'wdRouter/Index' | ||
| 10 | import SearcherAboutDataModel from '../../model/SearcherAboutDataModel' | 10 | import SearcherAboutDataModel from '../../model/SearcherAboutDataModel' |
| 11 | import { CreatorDetailRequestItem } from '../../viewmodel/CreatorDetailRequestItem' | 11 | import { CreatorDetailRequestItem } from '../../viewmodel/CreatorDetailRequestItem' |
| 12 | import { SearchResultContentData } from '../../viewmodel/SearchResultContentData' | 12 | import { SearchResultContentData } from '../../viewmodel/SearchResultContentData' |
| 13 | -import { SearchRmhDescription } from '../../viewmodel/SearchResultContentItem' | 13 | +import { SearchResultContentItem, SearchRmhDescription } from '../../viewmodel/SearchResultContentItem' |
| 14 | import { CardParser } from '../CardParser' | 14 | import { CardParser } from '../CardParser' |
| 15 | import { ListHasNoMoreDataUI } from '../reusable/ListHasNoMoreDataUI' | 15 | import { ListHasNoMoreDataUI } from '../reusable/ListHasNoMoreDataUI' |
| 16 | import { ActivityItemComponent } from './ActivityItemComponent' | 16 | import { ActivityItemComponent } from './ActivityItemComponent' |
| @@ -132,80 +132,7 @@ export struct SearchResultContentComponent{ | @@ -132,80 +132,7 @@ export struct SearchResultContentComponent{ | ||
| 132 | }) | 132 | }) |
| 133 | } | 133 | } |
| 134 | 134 | ||
| 135 | - let contentDTO:ContentDTO = { | ||
| 136 | - appStyle: value.data.appStyle + "", | ||
| 137 | - cityCode: value.data.cityCode, | ||
| 138 | - coverSize: "", | ||
| 139 | - coverType: value.data.type == "5"?1:-1, | ||
| 140 | - coverUrl: this.searchType=="activity"?value.data.zhChannelPageImg:value.data.appStyleImages.split("&&")[0], | ||
| 141 | - description: value.data.description, | ||
| 142 | - districtCode: value.data.districtCode, | ||
| 143 | - endTime: value.data.endTime, | ||
| 144 | - hImageUrl: "", | ||
| 145 | - heatValue: "", | ||
| 146 | - innerUrl: "", | ||
| 147 | - landscape: Number.parseInt(value.data.landscape), | ||
| 148 | - // lengthTime:null, | ||
| 149 | - linkUrl: value.data.linkUrl, | ||
| 150 | - openLikes: Number.parseInt(value.data.openLikes), | ||
| 151 | - openUrl: "", | ||
| 152 | - pageId: value.data.pageId, | ||
| 153 | - programAuth: "", | ||
| 154 | - programId: "", | ||
| 155 | - programName: "", | ||
| 156 | - programSource: -1, | ||
| 157 | - programType: Number.parseInt(value.data.status), | ||
| 158 | - provinceCode: value.data.provinceCode, | ||
| 159 | - showTitleEd: value.data.showTitleEd, | ||
| 160 | - showTitleIng: value.data.showTitleIng, | ||
| 161 | - showTitleNo: value.data.showTitleNo, | ||
| 162 | - startTime: value.data.startTime, | ||
| 163 | - subType: "", | ||
| 164 | - subtitle: "", | ||
| 165 | - title: value.data.title, | ||
| 166 | - vImageUrl: "", | ||
| 167 | - screenType: "", | ||
| 168 | - source: StringUtils.isEmpty(value.data.creatorName) ? value.data.sourceName : value.data.creatorName, | ||
| 169 | - objectId: value.data.id, | ||
| 170 | - objectType: value.data.type, | ||
| 171 | - channelId: value.data.channelId, | ||
| 172 | - relId: value.data.relId, | ||
| 173 | - relType: value.data.relType, | ||
| 174 | - newsTitle: value.data.titleLiteral, | ||
| 175 | - publishTime: StringUtils.isNotEmpty(value.data.firstPublishTime)?value.data.firstPublishTime:value.data.publishTime, | ||
| 176 | - visitorComment: -1, | ||
| 177 | - fullColumnImgUrls: photos, | ||
| 178 | - newsSummary: "", | ||
| 179 | - hasMore: -1, | ||
| 180 | - slideShows: [], | ||
| 181 | - voiceInfo: {} as VoiceInfoDTO, | ||
| 182 | - tagWord: -1, | ||
| 183 | - isSelect: true, | ||
| 184 | - rmhInfo: {} as RmhInfoDTO, | ||
| 185 | - photoNum: -1, | ||
| 186 | - liveInfo: {} as LiveInfoDTO, | ||
| 187 | - videoInfo: { | ||
| 188 | - videoDuration: Number.parseInt(value.data.duration) | ||
| 189 | - } as VideoInfoDTO, | ||
| 190 | - interactData: { | ||
| 191 | - collectNum:value.data.collectNum , | ||
| 192 | - commentNum:value.data.commentNum, | ||
| 193 | - contentId:value.data.id, | ||
| 194 | - contentType :Number.parseInt(value.data.type), | ||
| 195 | - likeNum: value.data.likeNum, | ||
| 196 | - readNum:Number.parseInt(value.data.readNum), | ||
| 197 | - shareNum:Number.parseInt(value.data.shareNum) | ||
| 198 | - } as InteractDataDTO, | ||
| 199 | - corner: '', | ||
| 200 | - rmhPlatform: 0, | ||
| 201 | - newTags: '', | ||
| 202 | - isSearch: true, | ||
| 203 | - publishTimestamp:"", | ||
| 204 | - bottomNavId:'', | ||
| 205 | - openType:'', | ||
| 206 | - extra:'', | ||
| 207 | - titleShow:value.data.type == "5"?1:0, | ||
| 208 | - } | 135 | + let contentDTO = this.dataTransform(value,photos); |
| 209 | if(contentDTO.appStyle != "13"){ | 136 | if(contentDTO.appStyle != "13"){ |
| 210 | this.data.push(contentDTO) | 137 | this.data.push(contentDTO) |
| 211 | } | 138 | } |
| @@ -339,4 +266,84 @@ export struct SearchResultContentComponent{ | @@ -339,4 +266,84 @@ export struct SearchResultContentComponent{ | ||
| 339 | .layoutWeight(1) | 266 | .layoutWeight(1) |
| 340 | .width('100%') | 267 | .width('100%') |
| 341 | } | 268 | } |
| 269 | + | ||
| 270 | + private dataTransform(value: SearchResultContentItem, photos: FullColumnImgUrlDTO[]): ContentDTO { | ||
| 271 | + let contentDTO = new ContentDTO(); | ||
| 272 | + contentDTO.appStyle = value.data.appStyle + "" | ||
| 273 | + contentDTO.cityCode = value.data.cityCode | ||
| 274 | + contentDTO.coverSize = "" | ||
| 275 | + contentDTO.coverType = value.data.type == "5" ? 1 : -1 | ||
| 276 | + contentDTO.coverUrl = | ||
| 277 | + this.searchType == "activity" ? value.data.zhChannelPageImg : value.data.appStyleImages.split("&&")[0]; | ||
| 278 | + contentDTO.description = value.data.description | ||
| 279 | + contentDTO.districtCode = value.data.districtCode | ||
| 280 | + contentDTO.endTime = value.data.endTime | ||
| 281 | + contentDTO.hImageUrl = "" | ||
| 282 | + contentDTO.heatValue = "" | ||
| 283 | + contentDTO.innerUrl = "" | ||
| 284 | + contentDTO.landscape = Number.parseInt(value.data.landscape) | ||
| 285 | + contentDTO.linkUrl = value.data.linkUrl | ||
| 286 | + contentDTO.openLikes = Number.parseInt(value.data.openLikes) | ||
| 287 | + contentDTO.openUrl = "" | ||
| 288 | + contentDTO.pageId = value.data.pageId | ||
| 289 | + contentDTO.programAuth = "" | ||
| 290 | + contentDTO.programId = "" | ||
| 291 | + contentDTO.programName = "" | ||
| 292 | + contentDTO.programSource = -1 | ||
| 293 | + contentDTO.programType = Number.parseInt(value.data.status) | ||
| 294 | + contentDTO.provinceCode = value.data.provinceCode | ||
| 295 | + contentDTO.showTitleEd = value.data.showTitleEd | ||
| 296 | + contentDTO.showTitleIng = value.data.showTitleIng | ||
| 297 | + contentDTO.showTitleNo = value.data.showTitleNo | ||
| 298 | + contentDTO.startTime = value.data.startTime | ||
| 299 | + contentDTO.subType = "" | ||
| 300 | + contentDTO.subtitle = "" | ||
| 301 | + contentDTO.title = value.data.title | ||
| 302 | + contentDTO.vImageUrl = "" | ||
| 303 | + contentDTO.screenType = "" | ||
| 304 | + contentDTO.source = StringUtils.isEmpty(value.data.creatorName) ? value.data.sourceName : value.data.creatorName | ||
| 305 | + contentDTO.objectId = value.data.id | ||
| 306 | + contentDTO.objectType = value.data.type | ||
| 307 | + contentDTO.channelId = value.data.channelId | ||
| 308 | + contentDTO.relId = value.data.relId | ||
| 309 | + contentDTO.relType = value.data.relType | ||
| 310 | + contentDTO.newsTitle = value.data.titleLiteral; | ||
| 311 | + contentDTO.publishTime = | ||
| 312 | + StringUtils.isNotEmpty(value.data.firstPublishTime) ? value.data.firstPublishTime : value.data.publishTime | ||
| 313 | + contentDTO.visitorComment = -1 | ||
| 314 | + contentDTO.fullColumnImgUrls = photos | ||
| 315 | + contentDTO.newsSummary = "" | ||
| 316 | + contentDTO.hasMore = -1 | ||
| 317 | + contentDTO.slideShows = [] | ||
| 318 | + contentDTO.voiceInfo = {} as VoiceInfoDTO | ||
| 319 | + contentDTO.tagWord = -1 | ||
| 320 | + contentDTO.isSelect = true | ||
| 321 | + contentDTO.rmhInfo = {} as RmhInfoDTO | ||
| 322 | + contentDTO.photoNum = -1 | ||
| 323 | + contentDTO.liveInfo = {} as LiveInfoDTO; | ||
| 324 | + contentDTO.videoInfo = { | ||
| 325 | + videoDuration: Number.parseInt(value.data.duration) | ||
| 326 | + } as VideoInfoDTO; | ||
| 327 | + | ||
| 328 | + let interact = new InteractDataDTO() | ||
| 329 | + interact.collectNum = value.data.collectNum | ||
| 330 | + interact.commentNum = value.data.commentNum | ||
| 331 | + interact.contentId = value.data.id | ||
| 332 | + interact.contentType = Number.parseInt(value.data.type) | ||
| 333 | + interact.likeNum = value.data.likeNum | ||
| 334 | + interact.readNum = Number.parseInt(value.data.readNum) | ||
| 335 | + interact.shareNum = Number.parseInt(value.data.shareNum) | ||
| 336 | + contentDTO.interactData = interact | ||
| 337 | + contentDTO.corner = '' | ||
| 338 | + contentDTO.rmhPlatform = 0 | ||
| 339 | + contentDTO.newTags = '' | ||
| 340 | + contentDTO.isSearch = true | ||
| 341 | + contentDTO.publishTimestamp = "" | ||
| 342 | + contentDTO.bottomNavId = ''; | ||
| 343 | + contentDTO.openType = ''; | ||
| 344 | + contentDTO.extra = ''; | ||
| 345 | + contentDTO.titleShow = value.data.type == "5" ? 1 : 0; | ||
| 346 | + | ||
| 347 | + return contentDTO; | ||
| 348 | + } | ||
| 342 | } | 349 | } |
| @@ -15,7 +15,7 @@ const TAG: string = 'BigPicCardComponent'; | @@ -15,7 +15,7 @@ const TAG: string = 'BigPicCardComponent'; | ||
| 15 | @Component | 15 | @Component |
| 16 | export struct BigPicCardComponent { | 16 | export struct BigPicCardComponent { |
| 17 | @State compDTO: CompDTO = {} as CompDTO | 17 | @State compDTO: CompDTO = {} as CompDTO |
| 18 | - contentDTO: ContentDTO = {} as ContentDTO; | 18 | + contentDTO: ContentDTO = new ContentDTO(); |
| 19 | 19 | ||
| 20 | aboutToAppear() { | 20 | aboutToAppear() { |
| 21 | // 取第一个数据 | 21 | // 取第一个数据 |
| @@ -4,7 +4,7 @@ import { ContentDTO } from 'wdBean' | @@ -4,7 +4,7 @@ import { ContentDTO } from 'wdBean' | ||
| 4 | import { CardMediaInfo } from '../cardCommon/CardMediaInfo' | 4 | import { CardMediaInfo } from '../cardCommon/CardMediaInfo' |
| 5 | @Component | 5 | @Component |
| 6 | export struct LiveHorizontalCardForOneComponent { | 6 | export struct LiveHorizontalCardForOneComponent { |
| 7 | - @State contentDTO: ContentDTO = {} as ContentDTO | 7 | + @State contentDTO: ContentDTO = new ContentDTO() |
| 8 | 8 | ||
| 9 | build() { | 9 | build() { |
| 10 | Column() { | 10 | Column() { |
| @@ -236,7 +236,7 @@ export class PageHelper { | @@ -236,7 +236,7 @@ export class PageHelper { | ||
| 236 | 236 | ||
| 237 | // 轮播组件广告数据转 业务信息 | 237 | // 轮播组件广告数据转 业务信息 |
| 238 | let changeContentDTO = (matInfo: CompAdvMatInfoBean) => { | 238 | let changeContentDTO = (matInfo: CompAdvMatInfoBean) => { |
| 239 | - let advContentBean: ContentDTO = {} as ContentDTO; | 239 | + let advContentBean: ContentDTO = new ContentDTO(); |
| 240 | advContentBean.newsTitle = matInfo.advTitle | 240 | advContentBean.newsTitle = matInfo.advTitle |
| 241 | advContentBean.objectType = matInfo.advType == "0" ? matInfo.advType.toString() : "4" | 241 | advContentBean.objectType = matInfo.advType == "0" ? matInfo.advType.toString() : "4" |
| 242 | advContentBean.coverUrl = matInfo.matImageUrl[0] | 242 | advContentBean.coverUrl = matInfo.matImageUrl[0] |
-
Please register or login to post a comment