Showing
17 changed files
with
663 additions
and
17 deletions
| @@ -64,4 +64,21 @@ export const enum CompStyle { | @@ -64,4 +64,21 @@ export const enum CompStyle { | ||
| 64 | Card_21 = '21', // 小视频卡人民号 | 64 | Card_21 = '21', // 小视频卡人民号 |
| 65 | Card_22 = '22', // 时间链 | 65 | Card_22 = '22', // 时间链 |
| 66 | Card_23 = '23', // 问政卡 | 66 | Card_23 = '23', // 问政卡 |
| 67 | + | ||
| 68 | + | ||
| 69 | + | ||
| 70 | + Card_Adv_4 = 4, //4:轮播图 5:三图广告 6:小图广告 7:长通栏广告 8:大图广告 9:视频广告 10:展会广告 11:冠名广告 12:顶部长通栏广告 | ||
| 71 | + Card_Adv_5 = 5, | ||
| 72 | + Card_Adv_6 = 5, | ||
| 73 | + Card_Adv_7 = 7, | ||
| 74 | + Card_Adv_8 = 8, | ||
| 75 | + Card_Adv_9 = 9, | ||
| 76 | + Card_Adv_10 = 10, | ||
| 77 | + Card_Adv_11 = 11, | ||
| 78 | + Card_Adv_12 = 12, | ||
| 79 | + | ||
| 80 | + /** | ||
| 81 | + * 本地稿件和组件样式 | ||
| 82 | + */ | ||
| 83 | + Card_Comp_Adv = 'card_comp_adv', // | ||
| 67 | } | 84 | } |
| @@ -90,6 +90,8 @@ export class LazyDataSource<T> extends BasicDataSource<T> { | @@ -90,6 +90,8 @@ export class LazyDataSource<T> extends BasicDataSource<T> { | ||
| 90 | } | 90 | } |
| 91 | } | 91 | } |
| 92 | 92 | ||
| 93 | + | ||
| 94 | + | ||
| 93 | // 在数据尾部增加一个同类型的LazyDataSource | 95 | // 在数据尾部增加一个同类型的LazyDataSource |
| 94 | public pushDataSource(dataSource: LazyDataSource<T>): void { | 96 | public pushDataSource(dataSource: LazyDataSource<T>): void { |
| 95 | this.push(...dataSource.dataArray) | 97 | this.push(...dataSource.dataArray) |
| @@ -123,6 +125,7 @@ export class LazyDataSource<T> extends BasicDataSource<T> { | @@ -123,6 +125,7 @@ export class LazyDataSource<T> extends BasicDataSource<T> { | ||
| 123 | this.addItem(item, 3) | 125 | this.addItem(item, 3) |
| 124 | } | 126 | } |
| 125 | 127 | ||
| 128 | + | ||
| 126 | // 把from位置的item移动到to位置(暂不支持from/to为负数或大于等于数组长度) | 129 | // 把from位置的item移动到to位置(暂不支持from/to为负数或大于等于数组长度) |
| 127 | public moveItem(from: number, to: number): void { | 130 | public moveItem(from: number, to: number): void { |
| 128 | // 当from/to大于/等于数组长度时; | 131 | // 当from/to大于/等于数组长度时; |
| @@ -23,7 +23,7 @@ export interface CompAdvMatInfoBean { | @@ -23,7 +23,7 @@ export interface CompAdvMatInfoBean { | ||
| 23 | /** | 23 | /** |
| 24 | * 信息流广告类型(4:轮播图 5:三图广告 6:小图广告 7:长通栏广告 8:大图广告 9:视频广告 10:展会广告 11:冠名广告 12:顶部长通栏广告) | 24 | * 信息流广告类型(4:轮播图 5:三图广告 6:小图广告 7:长通栏广告 8:大图广告 9:视频广告 10:展会广告 11:冠名广告 12:顶部长通栏广告) |
| 25 | */ | 25 | */ |
| 26 | - advSubType: string | 26 | + advSubType: number |
| 27 | /** | 27 | /** |
| 28 | * 素材图片信息;adv_subtype=4,5,6,7,8,9,12 时使用 | 28 | * 素材图片信息;adv_subtype=4,5,6,7,8,9,12 时使用 |
| 29 | */ | 29 | */ |
| 1 | +import { CompAdvMatInfoBean } from '../adv/CompAdvInfoBean'; | ||
| 1 | import { AudioDTO } from '../content/AudioDTO'; | 2 | import { AudioDTO } from '../content/AudioDTO'; |
| 2 | import { ContentDTO } from '../content/ContentDTO'; | 3 | import { ContentDTO } from '../content/ContentDTO'; |
| 3 | 4 | ||
| @@ -7,6 +8,7 @@ export interface CompDTO { | @@ -7,6 +8,7 @@ export interface CompDTO { | ||
| 7 | cityCode: string; | 8 | cityCode: string; |
| 8 | compStyle: string; | 9 | compStyle: string; |
| 9 | compType: string; | 10 | compType: string; |
| 11 | + | ||
| 10 | // dataSourceRequest: any[]; | 12 | // dataSourceRequest: any[]; |
| 11 | districtCode: string; | 13 | districtCode: string; |
| 12 | extraData?: string; | 14 | extraData?: string; |
| @@ -15,6 +17,7 @@ export interface CompDTO { | @@ -15,6 +17,7 @@ export interface CompDTO { | ||
| 15 | imgSize: string; | 17 | imgSize: string; |
| 16 | innerUrl: string; | 18 | innerUrl: string; |
| 17 | linkUrl: string; | 19 | linkUrl: string; |
| 20 | + | ||
| 18 | // meddleDataList: any[]; | 21 | // meddleDataList: any[]; |
| 19 | name: string; | 22 | name: string; |
| 20 | objectId: string; // 跳转页面id? | 23 | objectId: string; // 跳转页面id? |
| @@ -34,4 +37,9 @@ export interface CompDTO { | @@ -34,4 +37,9 @@ export interface CompDTO { | ||
| 34 | * 组件内容源类型 (LIVE_HORIZONTAL_CARD\LIVE_RESERVATION\LIVE_LARGE_CARD\LIVE_END\LIVE_MONTHLY_RANKING ) | 37 | * 组件内容源类型 (LIVE_HORIZONTAL_CARD\LIVE_RESERVATION\LIVE_LARGE_CARD\LIVE_END\LIVE_MONTHLY_RANKING ) |
| 35 | */ | 38 | */ |
| 36 | dataSourceType: string; | 39 | dataSourceType: string; |
| 40 | + | ||
| 41 | + /** | ||
| 42 | + * 信息流广告素材 | ||
| 43 | + */ | ||
| 44 | + matInfo: CompAdvMatInfoBean | ||
| 37 | } | 45 | } |
| 1 | +import { CompAdvBean } from '../adv/AdvsRuleBean'; | ||
| 1 | import { CompDTO } from './CompDTO'; | 2 | import { CompDTO } from './CompDTO'; |
| 2 | 3 | ||
| 3 | /** | 4 | /** |
| @@ -10,4 +11,6 @@ export interface PageDTO { | @@ -10,4 +11,6 @@ export interface PageDTO { | ||
| 10 | name: string; // 名称 | 11 | name: string; // 名称 |
| 11 | branchMark: boolean; | 12 | branchMark: boolean; |
| 12 | compList: CompDTO[]; // Components集合的布局信息 | 13 | compList: CompDTO[]; // Components集合的布局信息 |
| 14 | + | ||
| 15 | + compAdList:CompAdvBean[] // 页面广告 | ||
| 13 | } | 16 | } |
| @@ -23,6 +23,8 @@ import { ZhGridLayout02 } from './compview/ZhGridLayout02'; | @@ -23,6 +23,8 @@ import { ZhGridLayout02 } from './compview/ZhGridLayout02'; | ||
| 23 | import { Card5Component } from './cardview/Card5Component'; | 23 | import { Card5Component } from './cardview/Card5Component'; |
| 24 | import { Card2Component } from './cardview/Card2Component'; | 24 | import { Card2Component } from './cardview/Card2Component'; |
| 25 | import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; | 25 | import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; |
| 26 | +import { CardAdvComponent } from './cardViewAdv/CardAdvComponent'; | ||
| 27 | +import { AdvCardParser } from './cardViewAdv/AdvCardParser'; | ||
| 26 | 28 | ||
| 27 | /** | 29 | /** |
| 28 | * comp适配器. | 30 | * comp适配器. |
| @@ -42,7 +44,7 @@ export struct CompParser { | @@ -42,7 +44,7 @@ export struct CompParser { | ||
| 42 | 44 | ||
| 43 | @Builder | 45 | @Builder |
| 44 | componentBuilder(compDTO: CompDTO, compIndex: number) { | 46 | componentBuilder(compDTO: CompDTO, compIndex: number) { |
| 45 | - if (compDTO.operDataList[0]?.objectType !== '3' && compDTO.operDataList[0]?.objectType !== '13') { //暂时屏蔽活动和音频详情入口 | 47 | + // if (compDTO.operDataList[0]?.objectType !== '3' && compDTO.operDataList[0]?.objectType !== '13') { //暂时屏蔽活动和音频详情入口 |
| 46 | if (compDTO.compStyle === CompStyle.Label_03) { | 48 | if (compDTO.compStyle === CompStyle.Label_03) { |
| 47 | LabelComponent({ compDTO: compDTO }) | 49 | LabelComponent({ compDTO: compDTO }) |
| 48 | } else if (compDTO.compStyle === CompStyle.Zh_Carousel_Layout_01) { | 50 | } else if (compDTO.compStyle === CompStyle.Zh_Carousel_Layout_01) { |
| @@ -81,6 +83,8 @@ export struct CompParser { | @@ -81,6 +83,8 @@ export struct CompParser { | ||
| 81 | ZhSingleColumn05({ compDTO: compDTO }) | 83 | ZhSingleColumn05({ compDTO: compDTO }) |
| 82 | } else if (compDTO.compStyle === CompStyle.Zh_Single_Column_09) { | 84 | } else if (compDTO.compStyle === CompStyle.Zh_Single_Column_09) { |
| 83 | ZhSingleColumn09({ compDTO }) | 85 | ZhSingleColumn09({ compDTO }) |
| 86 | + } else if (compDTO.compStyle === CompStyle.Card_Comp_Adv) { // 广告 | ||
| 87 | + AdvCardParser({compDTO}) | ||
| 84 | } else if (!Number.isNaN(Number(compDTO.compStyle))) { | 88 | } else if (!Number.isNaN(Number(compDTO.compStyle))) { |
| 85 | CardParser({ contentDTO: compDTO.operDataList[0] }); | 89 | CardParser({ contentDTO: compDTO.operDataList[0] }); |
| 86 | } | 90 | } |
| @@ -96,6 +100,7 @@ export struct CompParser { | @@ -96,6 +100,7 @@ export struct CompParser { | ||
| 96 | } | 100 | } |
| 97 | Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) | 101 | Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) |
| 98 | } | 102 | } |
| 99 | - } | 103 | + |
| 104 | + // } | ||
| 100 | } | 105 | } |
| 101 | 106 |
| 1 | +import { CompStyle } from 'wdConstant'; | ||
| 2 | +import { CompDTO } from 'wdBean'; | ||
| 3 | +import { CardAdvComponent } from './CardAdvComponent'; | ||
| 4 | +import { CardAdvThreeImageComponent } from './CardAdvThreeImageComponent'; | ||
| 5 | +import { CardAdvSmallImageComponent } from './CardAdvSmallImageComponent'; | ||
| 6 | +import { CardAdvLongImageComponent } from './CardAdvLongImageComponent'; | ||
| 7 | +import { CardAdvBigImageComponent } from './CardAdvBigImageComponent'; | ||
| 8 | +import { CardAdvVideoComponent } from './CardAdvVideoComponent'; | ||
| 9 | +import { CardAdvGanMiComponent } from './CardAdvGanMiComponent'; | ||
| 10 | +import { CardAdvVideoExComponent } from './CardAdvVideoExComponent'; | ||
| 11 | + | ||
| 12 | +/** | ||
| 13 | + * @Description: 广告稿件解析类 | ||
| 14 | + * @Author: | ||
| 15 | + * @Email: liyubing@wondertek.com.cn | ||
| 16 | + * @CreateDate: | ||
| 17 | + * @UpdateRemark: 更新说明 | ||
| 18 | + * @Version: 1.0 | ||
| 19 | + */ | ||
| 20 | +@Component | ||
| 21 | +export struct AdvCardParser { | ||
| 22 | + @State compDTO: CompDTO = {} as CompDTO; | ||
| 23 | + | ||
| 24 | + build() { | ||
| 25 | + this.contentBuilder(this.compDTO); | ||
| 26 | + } | ||
| 27 | + | ||
| 28 | + @Builder | ||
| 29 | + contentBuilder(compDTO: CompDTO) { | ||
| 30 | + if (compDTO.matInfo.advSubType === CompStyle.Card_Adv_5) { //三图广告 | ||
| 31 | + CardAdvThreeImageComponent({ compDTO }) | ||
| 32 | + } else if (compDTO.matInfo.advSubType === CompStyle.Card_Adv_6) { //小图广告 | ||
| 33 | + CardAdvSmallImageComponent({ compDTO }) | ||
| 34 | + } else if (compDTO.matInfo.advSubType === CompStyle.Card_Adv_7 || | ||
| 35 | + compDTO.matInfo.advSubType === CompStyle.Card_Adv_12) { // 长通栏广告 和 顶部长通栏广告 | ||
| 36 | + CardAdvLongImageComponent({ compDTO }) | ||
| 37 | + } else if (compDTO.matInfo.advSubType === CompStyle.Card_Adv_8) { //大图广告 | ||
| 38 | + CardAdvBigImageComponent({ compDTO }) | ||
| 39 | + } else if (compDTO.matInfo.advSubType === CompStyle.Card_Adv_9) { //视频广告 | ||
| 40 | + CardAdvVideoComponent({ compDTO }) | ||
| 41 | + } else if (compDTO.matInfo.advSubType === CompStyle.Card_Adv_10) { //展会广告 | ||
| 42 | + CardAdvVideoExComponent({ compDTO }) | ||
| 43 | + } else if (compDTO.matInfo.advSubType === CompStyle.Card_Adv_11) { //冠名广告 | ||
| 44 | + CardAdvGanMiComponent({ compDTO }) | ||
| 45 | + } | ||
| 46 | + } | ||
| 47 | +} |
sight_harmony/features/wdComponent/src/main/ets/components/cardViewAdv/CardAdvBigImageComponent.ets
0 → 100644
| 1 | +//全标题 "appStyle":"2", | ||
| 2 | +import { CompDTO, ContentDTO } from 'wdBean'; | ||
| 3 | +import { CommonConstants } from 'wdConstant/Index'; | ||
| 4 | +import { ProcessUtils } from 'wdRouter'; | ||
| 5 | +import { CardMediaInfo } from '../cardCommon/CardMediaInfo' | ||
| 6 | +import { CardSourceInfo } from '../cardCommon/CardSourceInfo' | ||
| 7 | + | ||
| 8 | +const TAG: string = 'Card2Component'; | ||
| 9 | + | ||
| 10 | +/** | ||
| 11 | + * @Description: 广告---大图卡 | ||
| 12 | + * @Author: | ||
| 13 | + * @Email: liyubing@wondertek.com.cn | ||
| 14 | + * @CreateDate: | ||
| 15 | + * @UpdateRemark: 更新说明 | ||
| 16 | + * @Version: 1.0 | ||
| 17 | + */ | ||
| 18 | +@Component | ||
| 19 | +export struct CardAdvBigImageComponent { | ||
| 20 | + | ||
| 21 | + @State compDTO: CompDTO = {} as CompDTO | ||
| 22 | + | ||
| 23 | + aboutToAppear(): void { | ||
| 24 | + | ||
| 25 | + console.error('ZZZXXXXX', '--------aboutToAppear-----') | ||
| 26 | + } | ||
| 27 | + | ||
| 28 | + aboutToDisappear(): void { | ||
| 29 | + | ||
| 30 | + console.error('ZZZXXXXX', '--------aboutToDisappear-----') | ||
| 31 | + } | ||
| 32 | + | ||
| 33 | + build() { | ||
| 34 | + | ||
| 35 | + Column() { | ||
| 36 | + Text(this.compDTO.matInfo.advTitle) | ||
| 37 | + .fontSize($r('app.float.font_size_17')) | ||
| 38 | + .fontColor($r('app.color.color_222222')) | ||
| 39 | + .maxLines(3) | ||
| 40 | + .textOverflow({ overflow: TextOverflow.Ellipsis })// 超出的部分显示省略号。 | ||
| 41 | + .align(Alignment.Start) | ||
| 42 | + } | ||
| 43 | + .width(CommonConstants.FULL_WIDTH) | ||
| 44 | + .padding({ | ||
| 45 | + left: $r('app.float.card_comp_pagePadding_lf'), | ||
| 46 | + right: $r('app.float.card_comp_pagePadding_lf'), | ||
| 47 | + top: $r('app.float.card_comp_pagePadding_tb'), | ||
| 48 | + bottom: $r('app.float.card_comp_pagePadding_tb') | ||
| 49 | + }) | ||
| 50 | + .onClick((event: ClickEvent) => { | ||
| 51 | + //ProcessUtils.processPage(this.contentDTO) | ||
| 52 | + }) | ||
| 53 | + } | ||
| 54 | +} | ||
| 55 | + | ||
| 56 | +@Extend(Text) | ||
| 57 | +function bottomTextStyle() { | ||
| 58 | + .fontSize(12) | ||
| 59 | + .fontColor('#B0B0B0') | ||
| 60 | +} |
sight_harmony/features/wdComponent/src/main/ets/components/cardViewAdv/CardAdvComponent.ets
0 → 100644
| 1 | +//全标题 "appStyle":"2", | ||
| 2 | +import { CompDTO, ContentDTO } from 'wdBean'; | ||
| 3 | +import { CommonConstants } from 'wdConstant/Index'; | ||
| 4 | +import { ProcessUtils } from 'wdRouter'; | ||
| 5 | +import { CardMediaInfo } from '../cardCommon/CardMediaInfo' | ||
| 6 | +import { CardSourceInfo } from '../cardCommon/CardSourceInfo' | ||
| 7 | + | ||
| 8 | +const TAG: string = 'Card2Component'; | ||
| 9 | + | ||
| 10 | +/** | ||
| 11 | + * @Description: 类描述 | ||
| 12 | + * @Author: | ||
| 13 | + * @Email: liyubing@wondertek.com.cn | ||
| 14 | + * @CreateDate: | ||
| 15 | + * @UpdateRemark: 更新说明 | ||
| 16 | + * @Version: 1.0 | ||
| 17 | + */ | ||
| 18 | +@Component | ||
| 19 | +export struct CardAdvComponent { | ||
| 20 | + | ||
| 21 | + @State compDTO: CompDTO = {} as CompDTO | ||
| 22 | + | ||
| 23 | + aboutToAppear(): void { | ||
| 24 | + | ||
| 25 | + console.error('ZZZXXXXX', '--------aboutToAppear-----') | ||
| 26 | + } | ||
| 27 | + | ||
| 28 | + aboutToDisappear(): void { | ||
| 29 | + | ||
| 30 | + console.error('ZZZXXXXX', '--------aboutToDisappear-----') | ||
| 31 | + } | ||
| 32 | + | ||
| 33 | + build() { | ||
| 34 | + | ||
| 35 | + Column() { | ||
| 36 | + Text(this.compDTO.matInfo.advTitle) | ||
| 37 | + .fontSize($r('app.float.font_size_17')) | ||
| 38 | + .fontColor($r('app.color.color_222222')) | ||
| 39 | + .maxLines(3) | ||
| 40 | + .textOverflow({ overflow: TextOverflow.Ellipsis })// 超出的部分显示省略号。 | ||
| 41 | + .align(Alignment.Start) | ||
| 42 | + } | ||
| 43 | + .width(CommonConstants.FULL_WIDTH) | ||
| 44 | + .padding({ | ||
| 45 | + left: $r('app.float.card_comp_pagePadding_lf'), | ||
| 46 | + right: $r('app.float.card_comp_pagePadding_lf'), | ||
| 47 | + top: $r('app.float.card_comp_pagePadding_tb'), | ||
| 48 | + bottom: $r('app.float.card_comp_pagePadding_tb') | ||
| 49 | + }) | ||
| 50 | + .onClick((event: ClickEvent) => { | ||
| 51 | + //ProcessUtils.processPage(this.contentDTO) | ||
| 52 | + }) | ||
| 53 | + } | ||
| 54 | +} | ||
| 55 | + | ||
| 56 | +@Extend(Text) | ||
| 57 | +function bottomTextStyle() { | ||
| 58 | + .fontSize(12) | ||
| 59 | + .fontColor('#B0B0B0') | ||
| 60 | +} |
sight_harmony/features/wdComponent/src/main/ets/components/cardViewAdv/CardAdvGanMiComponent.ets
0 → 100644
| 1 | +//全标题 "appStyle":"2", | ||
| 2 | +import { CompDTO, ContentDTO } from 'wdBean'; | ||
| 3 | +import { CommonConstants } from 'wdConstant/Index'; | ||
| 4 | +import { ProcessUtils } from 'wdRouter'; | ||
| 5 | +import { CardMediaInfo } from '../cardCommon/CardMediaInfo' | ||
| 6 | +import { CardSourceInfo } from '../cardCommon/CardSourceInfo' | ||
| 7 | + | ||
| 8 | +const TAG: string = 'Card2Component'; | ||
| 9 | + | ||
| 10 | +/** | ||
| 11 | + * @Description: 广告---冠名广告 | ||
| 12 | + * @Author: | ||
| 13 | + * @Email: liyubing@wondertek.com.cn | ||
| 14 | + * @CreateDate: | ||
| 15 | + * @UpdateRemark: 更新说明 | ||
| 16 | + * @Version: 1.0 | ||
| 17 | + */ | ||
| 18 | +@Component | ||
| 19 | +export struct CardAdvGanMiComponent { | ||
| 20 | + | ||
| 21 | + @State compDTO: CompDTO = {} as CompDTO | ||
| 22 | + | ||
| 23 | + aboutToAppear(): void { | ||
| 24 | + | ||
| 25 | + console.error('ZZZXXXXX', '--------aboutToAppear-----') | ||
| 26 | + } | ||
| 27 | + | ||
| 28 | + aboutToDisappear(): void { | ||
| 29 | + | ||
| 30 | + console.error('ZZZXXXXX', '--------aboutToDisappear-----') | ||
| 31 | + } | ||
| 32 | + | ||
| 33 | + build() { | ||
| 34 | + | ||
| 35 | + Column() { | ||
| 36 | + Text(this.compDTO.matInfo.advTitle) | ||
| 37 | + .fontSize($r('app.float.font_size_17')) | ||
| 38 | + .fontColor($r('app.color.color_222222')) | ||
| 39 | + .maxLines(3) | ||
| 40 | + .textOverflow({ overflow: TextOverflow.Ellipsis })// 超出的部分显示省略号。 | ||
| 41 | + .align(Alignment.Start) | ||
| 42 | + } | ||
| 43 | + .width(CommonConstants.FULL_WIDTH) | ||
| 44 | + .padding({ | ||
| 45 | + left: $r('app.float.card_comp_pagePadding_lf'), | ||
| 46 | + right: $r('app.float.card_comp_pagePadding_lf'), | ||
| 47 | + top: $r('app.float.card_comp_pagePadding_tb'), | ||
| 48 | + bottom: $r('app.float.card_comp_pagePadding_tb') | ||
| 49 | + }) | ||
| 50 | + .onClick((event: ClickEvent) => { | ||
| 51 | + //ProcessUtils.processPage(this.contentDTO) | ||
| 52 | + }) | ||
| 53 | + } | ||
| 54 | +} | ||
| 55 | + | ||
| 56 | +@Extend(Text) | ||
| 57 | +function bottomTextStyle() { | ||
| 58 | + .fontSize(12) | ||
| 59 | + .fontColor('#B0B0B0') | ||
| 60 | +} |
sight_harmony/features/wdComponent/src/main/ets/components/cardViewAdv/CardAdvLongImageComponent.ets
0 → 100644
| 1 | +//全标题 "appStyle":"2", | ||
| 2 | +import { CompDTO, ContentDTO } from 'wdBean'; | ||
| 3 | +import { CommonConstants } from 'wdConstant/Index'; | ||
| 4 | +import { ProcessUtils } from 'wdRouter'; | ||
| 5 | +import { CardMediaInfo } from '../cardCommon/CardMediaInfo' | ||
| 6 | +import { CardSourceInfo } from '../cardCommon/CardSourceInfo' | ||
| 7 | + | ||
| 8 | +const TAG: string = 'Card2Component'; | ||
| 9 | + | ||
| 10 | +/** | ||
| 11 | + * @Description: 广告---长通栏广告 和 顶部长通栏广告 | ||
| 12 | + * @Author: | ||
| 13 | + * @Email: liyubing@wondertek.com.cn | ||
| 14 | + * @CreateDate: | ||
| 15 | + * @UpdateRemark: 更新说明 | ||
| 16 | + * @Version: 1.0 | ||
| 17 | + */ | ||
| 18 | +@Component | ||
| 19 | +export struct CardAdvLongImageComponent { | ||
| 20 | + | ||
| 21 | + @State compDTO: CompDTO = {} as CompDTO | ||
| 22 | + | ||
| 23 | + aboutToAppear(): void { | ||
| 24 | + | ||
| 25 | + console.error('ZZZXXXXX', '--------aboutToAppear-----') | ||
| 26 | + } | ||
| 27 | + | ||
| 28 | + aboutToDisappear(): void { | ||
| 29 | + | ||
| 30 | + console.error('ZZZXXXXX', '--------aboutToDisappear-----') | ||
| 31 | + } | ||
| 32 | + | ||
| 33 | + build() { | ||
| 34 | + | ||
| 35 | + Column() { | ||
| 36 | + Text(this.compDTO.matInfo.advTitle) | ||
| 37 | + .fontSize($r('app.float.font_size_17')) | ||
| 38 | + .fontColor($r('app.color.color_222222')) | ||
| 39 | + .maxLines(3) | ||
| 40 | + .textOverflow({ overflow: TextOverflow.Ellipsis })// 超出的部分显示省略号。 | ||
| 41 | + .align(Alignment.Start) | ||
| 42 | + } | ||
| 43 | + .width(CommonConstants.FULL_WIDTH) | ||
| 44 | + .padding({ | ||
| 45 | + left: $r('app.float.card_comp_pagePadding_lf'), | ||
| 46 | + right: $r('app.float.card_comp_pagePadding_lf'), | ||
| 47 | + top: $r('app.float.card_comp_pagePadding_tb'), | ||
| 48 | + bottom: $r('app.float.card_comp_pagePadding_tb') | ||
| 49 | + }) | ||
| 50 | + .onClick((event: ClickEvent) => { | ||
| 51 | + //ProcessUtils.processPage(this.contentDTO) | ||
| 52 | + }) | ||
| 53 | + } | ||
| 54 | +} | ||
| 55 | + | ||
| 56 | +@Extend(Text) | ||
| 57 | +function bottomTextStyle() { | ||
| 58 | + .fontSize(12) | ||
| 59 | + .fontColor('#B0B0B0') | ||
| 60 | +} |
| 1 | +//全标题 "appStyle":"2", | ||
| 2 | +import { CompDTO, ContentDTO } from 'wdBean'; | ||
| 3 | +import { CommonConstants } from 'wdConstant/Index'; | ||
| 4 | +import { ProcessUtils } from 'wdRouter'; | ||
| 5 | +import { CardMediaInfo } from '../cardCommon/CardMediaInfo' | ||
| 6 | +import { CardSourceInfo } from '../cardCommon/CardSourceInfo' | ||
| 7 | + | ||
| 8 | +const TAG: string = 'Card2Component'; | ||
| 9 | + | ||
| 10 | +/** | ||
| 11 | + * @Description: 广告---小图卡 | ||
| 12 | + * @Author: | ||
| 13 | + * @Email: liyubing@wondertek.com.cn | ||
| 14 | + * @CreateDate: | ||
| 15 | + * @UpdateRemark: 更新说明 | ||
| 16 | + * @Version: 1.0 | ||
| 17 | + */ | ||
| 18 | +@Component | ||
| 19 | +export struct CardAdvSmallImageComponent { | ||
| 20 | + | ||
| 21 | + @State compDTO: CompDTO = {} as CompDTO | ||
| 22 | + | ||
| 23 | + aboutToAppear(): void { | ||
| 24 | + | ||
| 25 | + console.error('ZZZXXXXX', '--------aboutToAppear-----') | ||
| 26 | + } | ||
| 27 | + | ||
| 28 | + aboutToDisappear(): void { | ||
| 29 | + | ||
| 30 | + console.error('ZZZXXXXX', '--------aboutToDisappear-----') | ||
| 31 | + } | ||
| 32 | + | ||
| 33 | + build() { | ||
| 34 | + | ||
| 35 | + Column() { | ||
| 36 | + Text(this.compDTO.matInfo.advTitle) | ||
| 37 | + .fontSize($r('app.float.font_size_17')) | ||
| 38 | + .fontColor($r('app.color.color_222222')) | ||
| 39 | + .maxLines(3) | ||
| 40 | + .textOverflow({ overflow: TextOverflow.Ellipsis })// 超出的部分显示省略号。 | ||
| 41 | + .align(Alignment.Start) | ||
| 42 | + } | ||
| 43 | + .width(CommonConstants.FULL_WIDTH) | ||
| 44 | + .padding({ | ||
| 45 | + left: $r('app.float.card_comp_pagePadding_lf'), | ||
| 46 | + right: $r('app.float.card_comp_pagePadding_lf'), | ||
| 47 | + top: $r('app.float.card_comp_pagePadding_tb'), | ||
| 48 | + bottom: $r('app.float.card_comp_pagePadding_tb') | ||
| 49 | + }) | ||
| 50 | + .onClick((event: ClickEvent) => { | ||
| 51 | + //ProcessUtils.processPage(this.contentDTO) | ||
| 52 | + }) | ||
| 53 | + } | ||
| 54 | +} | ||
| 55 | + | ||
| 56 | +@Extend(Text) | ||
| 57 | +function bottomTextStyle() { | ||
| 58 | + .fontSize(12) | ||
| 59 | + .fontColor('#B0B0B0') | ||
| 60 | +} |
| 1 | +//全标题 "appStyle":"2", | ||
| 2 | +import { CompDTO, ContentDTO } from 'wdBean'; | ||
| 3 | +import { CommonConstants } from 'wdConstant/Index'; | ||
| 4 | +import { ProcessUtils } from 'wdRouter'; | ||
| 5 | +import { CardMediaInfo } from '../cardCommon/CardMediaInfo' | ||
| 6 | +import { CardSourceInfo } from '../cardCommon/CardSourceInfo' | ||
| 7 | + | ||
| 8 | +const TAG: string = 'Card2Component'; | ||
| 9 | + | ||
| 10 | +/** | ||
| 11 | + * @Description: 广告---三图卡 | ||
| 12 | + * @Author: | ||
| 13 | + * @Email: liyubing@wondertek.com.cn | ||
| 14 | + * @CreateDate: | ||
| 15 | + * @UpdateRemark: 更新说明 | ||
| 16 | + * @Version: 1.0 | ||
| 17 | + */ | ||
| 18 | +@Component | ||
| 19 | +export struct CardAdvThreeImageComponent { | ||
| 20 | + | ||
| 21 | + @State compDTO: CompDTO = {} as CompDTO | ||
| 22 | + | ||
| 23 | + aboutToAppear(): void { | ||
| 24 | + | ||
| 25 | + console.error('ZZZXXXXX', '--------aboutToAppear-----') | ||
| 26 | + } | ||
| 27 | + | ||
| 28 | + aboutToDisappear(): void { | ||
| 29 | + | ||
| 30 | + console.error('ZZZXXXXX', '--------aboutToDisappear-----') | ||
| 31 | + } | ||
| 32 | + | ||
| 33 | + build() { | ||
| 34 | + | ||
| 35 | + Column() { | ||
| 36 | + Text(this.compDTO.matInfo.advTitle) | ||
| 37 | + .fontSize($r('app.float.font_size_17')) | ||
| 38 | + .fontColor($r('app.color.color_222222')) | ||
| 39 | + .maxLines(3) | ||
| 40 | + .textOverflow({ overflow: TextOverflow.Ellipsis })// 超出的部分显示省略号。 | ||
| 41 | + .align(Alignment.Start) | ||
| 42 | + } | ||
| 43 | + .width(CommonConstants.FULL_WIDTH) | ||
| 44 | + .padding({ | ||
| 45 | + left: $r('app.float.card_comp_pagePadding_lf'), | ||
| 46 | + right: $r('app.float.card_comp_pagePadding_lf'), | ||
| 47 | + top: $r('app.float.card_comp_pagePadding_tb'), | ||
| 48 | + bottom: $r('app.float.card_comp_pagePadding_tb') | ||
| 49 | + }) | ||
| 50 | + .onClick((event: ClickEvent) => { | ||
| 51 | + //ProcessUtils.processPage(this.contentDTO) | ||
| 52 | + }) | ||
| 53 | + } | ||
| 54 | +} | ||
| 55 | + | ||
| 56 | +@Extend(Text) | ||
| 57 | +function bottomTextStyle() { | ||
| 58 | + .fontSize(12) | ||
| 59 | + .fontColor('#B0B0B0') | ||
| 60 | +} |
sight_harmony/features/wdComponent/src/main/ets/components/cardViewAdv/CardAdvVideoComponent.ets
0 → 100644
| 1 | +//全标题 "appStyle":"2", | ||
| 2 | +import { CompDTO, ContentDTO } from 'wdBean'; | ||
| 3 | +import { CommonConstants } from 'wdConstant/Index'; | ||
| 4 | +import { ProcessUtils } from 'wdRouter'; | ||
| 5 | +import { CardMediaInfo } from '../cardCommon/CardMediaInfo' | ||
| 6 | +import { CardSourceInfo } from '../cardCommon/CardSourceInfo' | ||
| 7 | + | ||
| 8 | +const TAG: string = 'Card2Component'; | ||
| 9 | + | ||
| 10 | +/** | ||
| 11 | + * @Description: 广告---视频广告 | ||
| 12 | + * @Author: | ||
| 13 | + * @Email: liyubing@wondertek.com.cn | ||
| 14 | + * @CreateDate: | ||
| 15 | + * @UpdateRemark: 更新说明 | ||
| 16 | + * @Version: 1.0 | ||
| 17 | + */ | ||
| 18 | +@Component | ||
| 19 | +export struct CardAdvVideoComponent { | ||
| 20 | + | ||
| 21 | + @State compDTO: CompDTO = {} as CompDTO | ||
| 22 | + | ||
| 23 | + aboutToAppear(): void { | ||
| 24 | + | ||
| 25 | + console.error('ZZZXXXXX', '--------aboutToAppear-----') | ||
| 26 | + } | ||
| 27 | + | ||
| 28 | + aboutToDisappear(): void { | ||
| 29 | + | ||
| 30 | + console.error('ZZZXXXXX', '--------aboutToDisappear-----') | ||
| 31 | + } | ||
| 32 | + | ||
| 33 | + build() { | ||
| 34 | + | ||
| 35 | + Column() { | ||
| 36 | + Text(this.compDTO.matInfo.advTitle) | ||
| 37 | + .fontSize($r('app.float.font_size_17')) | ||
| 38 | + .fontColor($r('app.color.color_222222')) | ||
| 39 | + .maxLines(3) | ||
| 40 | + .textOverflow({ overflow: TextOverflow.Ellipsis })// 超出的部分显示省略号。 | ||
| 41 | + .align(Alignment.Start) | ||
| 42 | + } | ||
| 43 | + .width(CommonConstants.FULL_WIDTH) | ||
| 44 | + .padding({ | ||
| 45 | + left: $r('app.float.card_comp_pagePadding_lf'), | ||
| 46 | + right: $r('app.float.card_comp_pagePadding_lf'), | ||
| 47 | + top: $r('app.float.card_comp_pagePadding_tb'), | ||
| 48 | + bottom: $r('app.float.card_comp_pagePadding_tb') | ||
| 49 | + }) | ||
| 50 | + .onClick((event: ClickEvent) => { | ||
| 51 | + //ProcessUtils.processPage(this.contentDTO) | ||
| 52 | + }) | ||
| 53 | + } | ||
| 54 | +} | ||
| 55 | + | ||
| 56 | +@Extend(Text) | ||
| 57 | +function bottomTextStyle() { | ||
| 58 | + .fontSize(12) | ||
| 59 | + .fontColor('#B0B0B0') | ||
| 60 | +} |
sight_harmony/features/wdComponent/src/main/ets/components/cardViewAdv/CardAdvVideoExComponent.ets
0 → 100644
| 1 | +//全标题 "appStyle":"2", | ||
| 2 | +import { CompDTO, ContentDTO } from 'wdBean'; | ||
| 3 | +import { CommonConstants } from 'wdConstant/Index'; | ||
| 4 | +import { ProcessUtils } from 'wdRouter'; | ||
| 5 | +import { CardMediaInfo } from '../cardCommon/CardMediaInfo' | ||
| 6 | +import { CardSourceInfo } from '../cardCommon/CardSourceInfo' | ||
| 7 | + | ||
| 8 | +const TAG: string = 'Card2Component'; | ||
| 9 | + | ||
| 10 | +/** | ||
| 11 | + * @Description: 广告---冠名广告 | ||
| 12 | + * @Author: | ||
| 13 | + * @Email: liyubing@wondertek.com.cn | ||
| 14 | + * @CreateDate: | ||
| 15 | + * @UpdateRemark: 更新说明 | ||
| 16 | + * @Version: 1.0 | ||
| 17 | + */ | ||
| 18 | +@Component | ||
| 19 | +export struct CardAdvVideoExComponent { | ||
| 20 | + | ||
| 21 | + @State compDTO: CompDTO = {} as CompDTO | ||
| 22 | + | ||
| 23 | + aboutToAppear(): void { | ||
| 24 | + | ||
| 25 | + console.error('ZZZXXXXX', '--------aboutToAppear-----') | ||
| 26 | + } | ||
| 27 | + | ||
| 28 | + aboutToDisappear(): void { | ||
| 29 | + | ||
| 30 | + console.error('ZZZXXXXX', '--------aboutToDisappear-----') | ||
| 31 | + } | ||
| 32 | + | ||
| 33 | + build() { | ||
| 34 | + | ||
| 35 | + Column() { | ||
| 36 | + Text(this.compDTO.matInfo.advTitle) | ||
| 37 | + .fontSize($r('app.float.font_size_17')) | ||
| 38 | + .fontColor($r('app.color.color_222222')) | ||
| 39 | + .maxLines(3) | ||
| 40 | + .textOverflow({ overflow: TextOverflow.Ellipsis })// 超出的部分显示省略号。 | ||
| 41 | + .align(Alignment.Start) | ||
| 42 | + } | ||
| 43 | + .width(CommonConstants.FULL_WIDTH) | ||
| 44 | + .padding({ | ||
| 45 | + left: $r('app.float.card_comp_pagePadding_lf'), | ||
| 46 | + right: $r('app.float.card_comp_pagePadding_lf'), | ||
| 47 | + top: $r('app.float.card_comp_pagePadding_tb'), | ||
| 48 | + bottom: $r('app.float.card_comp_pagePadding_tb') | ||
| 49 | + }) | ||
| 50 | + .onClick((event: ClickEvent) => { | ||
| 51 | + //ProcessUtils.processPage(this.contentDTO) | ||
| 52 | + }) | ||
| 53 | + } | ||
| 54 | +} | ||
| 55 | + | ||
| 56 | +@Extend(Text) | ||
| 57 | +function bottomTextStyle() { | ||
| 58 | + .fontSize(12) | ||
| 59 | + .fontColor('#B0B0B0') | ||
| 60 | +} |
| @@ -149,6 +149,7 @@ export default class PageAdModel { | @@ -149,6 +149,7 @@ export default class PageAdModel { | ||
| 149 | 149 | ||
| 150 | // 按时间维度过滤出广告数据 | 150 | // 按时间维度过滤出广告数据 |
| 151 | let compAdsArray: ArrayList<CompAdvBean> = new ArrayList(); | 151 | let compAdsArray: ArrayList<CompAdvBean> = new ArrayList(); |
| 152 | + //当前日期 | ||
| 152 | let serverTimeLong: number = DateTimeUtils.getTimeStamp(); | 153 | let serverTimeLong: number = DateTimeUtils.getTimeStamp(); |
| 153 | for (let advBean of cornersAdv2) { | 154 | for (let advBean of cornersAdv2) { |
| 154 | let startLong = advBean.startTime; | 155 | let startLong = advBean.startTime; |
| @@ -5,8 +5,9 @@ import { closeRefresh } from '../utils/PullDownRefresh'; | @@ -5,8 +5,9 @@ import { closeRefresh } from '../utils/PullDownRefresh'; | ||
| 5 | import PageModel from './PageModel'; | 5 | import PageModel from './PageModel'; |
| 6 | import PageViewModel from './PageViewModel'; | 6 | import PageViewModel from './PageViewModel'; |
| 7 | import { promptAction } from '@kit.ArkUI'; | 7 | import { promptAction } from '@kit.ArkUI'; |
| 8 | -import { AdvRuleBean } from 'wdBean/src/main/ets/bean/adv/AdvsRuleBean'; | 8 | +import { AdvRuleBean, CompAdvBean } from 'wdBean/src/main/ets/bean/adv/AdvsRuleBean'; |
| 9 | import PageAdModel from './PageAdvModel'; | 9 | import PageAdModel from './PageAdvModel'; |
| 10 | +import { ArrayList } from '@kit.ArkTS'; | ||
| 10 | 11 | ||
| 11 | const TAG = 'PageHelper'; | 12 | const TAG = 'PageHelper'; |
| 12 | 13 | ||
| @@ -14,14 +15,12 @@ const TAG = 'PageHelper'; | @@ -14,14 +15,12 @@ const TAG = 'PageHelper'; | ||
| 14 | * 处理返回后的数据 | 15 | * 处理返回后的数据 |
| 15 | */ | 16 | */ |
| 16 | export class PageHelper { | 17 | export class PageHelper { |
| 17 | - | ||
| 18 | - | ||
| 19 | /** | 18 | /** |
| 20 | * 刷新数据 | 19 | * 刷新数据 |
| 21 | */ | 20 | */ |
| 22 | - async refreshUI(pageModel: PageModel,pageAdvModel:PageAdModel) { | 21 | + async refreshUI(pageModel: PageModel, pageAdvModel: PageAdModel) { |
| 23 | pageModel.loadStrategy = 2 | 22 | pageModel.loadStrategy = 2 |
| 24 | - this.getPageInfo(pageModel,pageAdvModel) | 23 | + this.getPageInfo(pageModel, pageAdvModel) |
| 25 | } | 24 | } |
| 26 | 25 | ||
| 27 | /** | 26 | /** |
| @@ -36,12 +35,12 @@ export class PageHelper { | @@ -36,12 +35,12 @@ export class PageHelper { | ||
| 36 | /** | 35 | /** |
| 37 | * 进页面请求数据 | 36 | * 进页面请求数据 |
| 38 | */ | 37 | */ |
| 39 | - async getInitData(pageModel: PageModel,pageAdvModel:PageAdModel) { | 38 | + async getInitData(pageModel: PageModel, pageAdvModel: PageAdModel) { |
| 40 | pageModel.loadStrategy = 1 | 39 | pageModel.loadStrategy = 1 |
| 41 | - this.getPageInfo(pageModel,pageAdvModel) | 40 | + this.getPageInfo(pageModel, pageAdvModel) |
| 42 | } | 41 | } |
| 43 | 42 | ||
| 44 | - async getPageInfo(pageModel: PageModel,pageAdvModel:PageAdModel) { | 43 | + async getPageInfo(pageModel: PageModel, pageAdvModel: PageAdModel) { |
| 45 | pageModel.currentPage = 1; | 44 | pageModel.currentPage = 1; |
| 46 | let pageInfo = await PageViewModel.getPageInfo(pageModel.pageId); | 45 | let pageInfo = await PageViewModel.getPageInfo(pageModel.pageId); |
| 47 | if (pageInfo == null) { | 46 | if (pageInfo == null) { |
| @@ -57,7 +56,6 @@ export class PageHelper { | @@ -57,7 +56,6 @@ export class PageHelper { | ||
| 57 | } | 56 | } |
| 58 | 57 | ||
| 59 | 58 | ||
| 60 | - | ||
| 61 | async parseGroup(pageModel: PageModel) { | 59 | async parseGroup(pageModel: PageModel) { |
| 62 | let pageInfo: PageInfoDTO = pageModel.pageInfo | 60 | let pageInfo: PageInfoDTO = pageModel.pageInfo |
| 63 | pageModel.groupList = [] | 61 | pageModel.groupList = [] |
| @@ -72,13 +70,15 @@ export class PageHelper { | @@ -72,13 +70,15 @@ export class PageHelper { | ||
| 72 | } | 70 | } |
| 73 | pageModel.groupData = group | 71 | pageModel.groupData = group |
| 74 | // await,确保groups接口顺序执行 | 72 | // await,确保groups接口顺序执行 |
| 75 | - let pageDto = await PageViewModel.getPageData(pageModel.bizCopy()) | 73 | + let pageDto = await PageViewModel.getPageData(pageModel.bizCopy()) as PageDTO |
| 76 | let index = pageInfo.groups.indexOf(group) | 74 | let index = pageInfo.groups.indexOf(group) |
| 77 | if (index == 0) { | 75 | if (index == 0) { |
| 78 | // 清空comp列表 | 76 | // 清空comp列表 |
| 79 | pageModel.compList.clear() | 77 | pageModel.compList.clear() |
| 80 | } | 78 | } |
| 81 | this.getGroupData(pageModel, pageDto, index == pageInfo.groups.length - 1) | 79 | this.getGroupData(pageModel, pageDto, index == pageInfo.groups.length - 1) |
| 80 | + | ||
| 81 | + | ||
| 82 | } | 82 | } |
| 83 | if (pageModel.compList.isEmpty()) { | 83 | if (pageModel.compList.isEmpty()) { |
| 84 | // 没数据,展示空页面 | 84 | // 没数据,展示空页面 |
| @@ -100,7 +100,8 @@ export class PageHelper { | @@ -100,7 +100,8 @@ export class PageHelper { | ||
| 100 | } | 100 | } |
| 101 | 101 | ||
| 102 | //移除音频 和 活动 | 102 | //移除音频 和 活动 |
| 103 | - this.removeComp(pageModel, pageDto) | 103 | + this.collectPageComp(pageModel, pageDto) |
| 104 | + | ||
| 104 | 105 | ||
| 105 | // pageModel.compList.push(...pageDto.compList) | 106 | // pageModel.compList.push(...pageDto.compList) |
| 106 | 107 | ||
| @@ -129,6 +130,75 @@ export class PageHelper { | @@ -129,6 +130,75 @@ export class PageHelper { | ||
| 129 | } | 130 | } |
| 130 | } | 131 | } |
| 131 | 132 | ||
| 133 | + | ||
| 134 | + /** | ||
| 135 | + * 处理页面中的广告组件信息 | ||
| 136 | + * @param pageDto | ||
| 137 | + */ | ||
| 138 | + private handlePageCompAdvPostion(pageCompList: ArrayList<CompDTO>, pageDto: PageDTO) { | ||
| 139 | + | ||
| 140 | + let compAdvList = pageDto.compAdList | ||
| 141 | + | ||
| 142 | + let flag = true; | ||
| 143 | + if (compAdvList == null) { | ||
| 144 | + flag = false | ||
| 145 | + } | ||
| 146 | + if (compAdvList.length == 0) { | ||
| 147 | + flag = false | ||
| 148 | + } | ||
| 149 | + | ||
| 150 | + let pageCompSize = pageCompList.length // 信息流组件业务数量 | ||
| 151 | + console.error("ZZZXXXXX", " start--->" + pageCompSize); | ||
| 152 | + | ||
| 153 | + if (pageCompSize == 0) { | ||
| 154 | + flag = false | ||
| 155 | + } | ||
| 156 | + | ||
| 157 | + if (flag) { | ||
| 158 | + // 升序排序 | ||
| 159 | + compAdvList.sort((a: CompAdvBean, b: CompAdvBean) => a.slotInfo.position - b.slotInfo.position) | ||
| 160 | + console.error("ZZZXXXXX", " 排序后的广告--->" + JSON.stringify(compAdvList)); | ||
| 161 | + //当前日期 | ||
| 162 | + let serverTimeLong: number = DateTimeUtils.getTimeStamp(); | ||
| 163 | + for (let advBean of compAdvList) { | ||
| 164 | + let slotInfo = advBean.slotInfo | ||
| 165 | + | ||
| 166 | + if (slotInfo != null) { | ||
| 167 | + // 广告有效日期 | ||
| 168 | + let startLong = advBean.startTime; | ||
| 169 | + let endLong = advBean.endTime; | ||
| 170 | + //符合开始时间和结束时间要求 | ||
| 171 | + if (serverTimeLong >= startLong && serverTimeLong <= endLong) { | ||
| 172 | + | ||
| 173 | + let matInfo = advBean.matInfo | ||
| 174 | + if (matInfo == null) { | ||
| 175 | + continue | ||
| 176 | + } | ||
| 177 | + | ||
| 178 | + let advSubType = matInfo.advSubType | ||
| 179 | + | ||
| 180 | + // 插入轮播组件的广告 | ||
| 181 | + if (4 == advSubType) { | ||
| 182 | + | ||
| 183 | + } else { | ||
| 184 | + let advPosition = slotInfo.position //广告位置,从1开始 | ||
| 185 | + advPosition = advPosition - 1 | ||
| 186 | + let advComp: CompDTO = { | ||
| 187 | + compStyle: CompStyle.Card_Comp_Adv, | ||
| 188 | + matInfo: matInfo | ||
| 189 | + } as CompDTO; | ||
| 190 | + pageCompList.insert(advComp, 0) | ||
| 191 | + } | ||
| 192 | + } | ||
| 193 | + } | ||
| 194 | + | ||
| 195 | + } | ||
| 196 | + | ||
| 197 | + } | ||
| 198 | + console.error("ZZZXXXXX", " end--->" + pageCompList.length); | ||
| 199 | + } | ||
| 200 | + | ||
| 201 | + | ||
| 132 | /** | 202 | /** |
| 133 | * comp加载更多,分页加载 | 203 | * comp加载更多,分页加载 |
| 134 | */ | 204 | */ |
| @@ -148,7 +218,7 @@ export class PageHelper { | @@ -148,7 +218,7 @@ export class PageHelper { | ||
| 148 | let sizeBefore: number = pageModel.compList.size(); | 218 | let sizeBefore: number = pageModel.compList.size(); |
| 149 | 219 | ||
| 150 | //移除音频 和 活动 | 220 | //移除音频 和 活动 |
| 151 | - this.removeComp(pageModel, data) | 221 | + this.collectPageComp(pageModel, data) |
| 152 | // | 222 | // |
| 153 | // pageModel.compList.push(...data.compList) | 223 | // pageModel.compList.push(...data.compList) |
| 154 | PageViewModel.getInteractData(data.compList).then((data: CompDTO[]) => { | 224 | PageViewModel.getInteractData(data.compList).then((data: CompDTO[]) => { |
| @@ -165,7 +235,10 @@ export class PageHelper { | @@ -165,7 +235,10 @@ export class PageHelper { | ||
| 165 | /** | 235 | /** |
| 166 | * 移除comp | 236 | * 移除comp |
| 167 | */ | 237 | */ |
| 168 | - private removeComp(pageModel: PageModel, pageDto: PageDTO) { | 238 | + private collectPageComp(pageModel: PageModel, pageDto: PageDTO) { |
| 239 | + | ||
| 240 | + let pageCompList: ArrayList<CompDTO> = new ArrayList() // 收集页面组件、稿件和本地组件容器 | ||
| 241 | + | ||
| 169 | let datas = pageDto.compList | 242 | let datas = pageDto.compList |
| 170 | for (let index = 0; index < datas.length; index++) { | 243 | for (let index = 0; index < datas.length; index++) { |
| 171 | const element = datas[index]; | 244 | const element = datas[index]; |
| @@ -174,9 +247,18 @@ export class PageHelper { | @@ -174,9 +247,18 @@ export class PageHelper { | ||
| 174 | if (contentInfo && (contentInfo.objectType === '13' || contentInfo.objectType === '3')) { | 247 | if (contentInfo && (contentInfo.objectType === '13' || contentInfo.objectType === '3')) { |
| 175 | Logger.debug(TAG, 'getGroupData 移除音频 和 活动'); | 248 | Logger.debug(TAG, 'getGroupData 移除音频 和 活动'); |
| 176 | } else { | 249 | } else { |
| 177 | - pageModel.compList.push(element) | 250 | + pageCompList.add(element) |
| 178 | } | 251 | } |
| 179 | } | 252 | } |
| 253 | + // 处理页面广告数据,投放到页面的位置 | ||
| 254 | + //this.handlePageCompAdvPostion(pageCompList, pageDto); | ||
| 255 | + | ||
| 256 | + //遍历所有组件和稿件数据 push到页面 | ||
| 257 | + for (let element of pageCompList) { | ||
| 258 | + pageModel.compList.push(element) | ||
| 259 | + } | ||
| 260 | + | ||
| 261 | + | ||
| 180 | } | 262 | } |
| 181 | } | 263 | } |
| 182 | 264 |
-
Please register or login to post a comment