Merge remote-tracking branch 'origin/main'
# Conflicts: # sight_harmony/features/wdComponent/src/main/ets/components/CompParser.ets
Showing
4 changed files
with
73 additions
and
23 deletions
| @@ -49,6 +49,7 @@ export struct CompParser { | @@ -49,6 +49,7 @@ export struct CompParser { | ||
| 49 | 49 | ||
| 50 | build() { | 50 | build() { |
| 51 | Column() { | 51 | Column() { |
| 52 | + | ||
| 52 | this.componentBuilder(); | 53 | this.componentBuilder(); |
| 53 | } | 54 | } |
| 54 | } | 55 | } |
| @@ -60,78 +61,79 @@ export struct CompParser { | @@ -60,78 +61,79 @@ export struct CompParser { | ||
| 60 | 61 | ||
| 61 | if (this.compDTO.operDataList[0]?.objectType !== '3' && | 62 | if (this.compDTO.operDataList[0]?.objectType !== '3' && |
| 62 | this.compDTO.operDataList[0]?.objectType !== '13') { //暂时屏蔽活动和音频详情入口 | 63 | this.compDTO.operDataList[0]?.objectType !== '13') { //暂时屏蔽活动和音频详情入口 |
| 64 | + | ||
| 63 | if (this.compDTO.compStyle === CompStyle.Label_03) { | 65 | if (this.compDTO.compStyle === CompStyle.Label_03) { |
| 64 | LabelComponent({ compDTO: this.compDTO }) | 66 | LabelComponent({ compDTO: this.compDTO }) |
| 65 | - Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) | 67 | + Divider().strokeWidth(8).color('#f5f5f5').padding({ left: 0, right: 0 }) |
| 66 | } else if (this.compDTO.compStyle === CompStyle.Zh_Carousel_Layout_01) { | 68 | } else if (this.compDTO.compStyle === CompStyle.Zh_Carousel_Layout_01) { |
| 67 | if (this.compDTO.operDataList.length > this.audioItems.length) { | 69 | if (this.compDTO.operDataList.length > this.audioItems.length) { |
| 68 | ZhCarouselLayout01({ compDTO: this.compDTO }) | 70 | ZhCarouselLayout01({ compDTO: this.compDTO }) |
| 69 | - Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) | 71 | + Divider().strokeWidth(8).color('#f5f5f5').padding({ left: 0, right: 0 }) |
| 70 | } | 72 | } |
| 71 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_01 && | 73 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_01 && |
| 72 | this.compDTO.imageScale === 2) { // && compDTO.name ==="横划卡" | 74 | this.compDTO.imageScale === 2) { // && compDTO.name ==="横划卡" |
| 73 | 75 | ||
| 74 | LiveHorizontalCardComponent({ compDTO: this.compDTO }) | 76 | LiveHorizontalCardComponent({ compDTO: this.compDTO }) |
| 75 | - Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) | 77 | + Divider().strokeWidth(8).color('#f5f5f5').padding({ left: 0, right: 0 }) |
| 76 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_01 && this.compDTO.imageScale === 3) { | 78 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_01 && this.compDTO.imageScale === 3) { |
| 77 | if (this.compDTO.operDataList.length > 1) { | 79 | if (this.compDTO.operDataList.length > 1) { |
| 78 | HorizontalStrokeCardThreeTwoRadioForMoreComponent({ compDTO: this.compDTO }) | 80 | HorizontalStrokeCardThreeTwoRadioForMoreComponent({ compDTO: this.compDTO }) |
| 79 | } else { | 81 | } else { |
| 80 | HorizontalStrokeCardThreeTwoRadioForOneComponent({ compDTO: this.compDTO }) | 82 | HorizontalStrokeCardThreeTwoRadioForOneComponent({ compDTO: this.compDTO }) |
| 81 | } | 83 | } |
| 82 | - Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) | 84 | + Divider().strokeWidth(8).color('#f5f5f5').padding({ left: 0, right: 0 }) |
| 83 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_02) { | 85 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_02) { |
| 84 | ZhSingleRow02({ compDTO: this.compDTO }) | 86 | ZhSingleRow02({ compDTO: this.compDTO }) |
| 85 | - Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) | 87 | + Divider().strokeWidth(8).color('#f5f5f5').padding({ left: 0, right: 0 }) |
| 86 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_03) { | 88 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_03) { |
| 87 | ZhSingleRow03({ compDTO: this.compDTO }) | 89 | ZhSingleRow03({ compDTO: this.compDTO }) |
| 88 | - Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) | 90 | + Divider().strokeWidth(8).color('#f5f5f5').padding({ left: 0, right: 0 }) |
| 89 | } else if (this.compDTO.compStyle === CompStyle.Zh_Grid_Layout_02) { //双列流小视频,一行两图卡 ->标题 | 91 | } else if (this.compDTO.compStyle === CompStyle.Zh_Grid_Layout_02) { //双列流小视频,一行两图卡 ->标题 |
| 90 | //ZhGridLayout02({ compDTO: this.compDTO }) | 92 | //ZhGridLayout02({ compDTO: this.compDTO }) |
| 91 | CompNormalTitle({ compDTO: this.compDTO }) | 93 | CompNormalTitle({ compDTO: this.compDTO }) |
| 92 | - // Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) | 94 | + // Divider().strokeWidth(8).color('#f5f5f5').padding({ left: 0, right: 0 }) |
| 93 | } else if (this.compDTO.compStyle === CompStyle.Card_Comp_Zh_Grid_Layout_02) { //双列流小视频,一行两图卡 | 95 | } else if (this.compDTO.compStyle === CompStyle.Card_Comp_Zh_Grid_Layout_02) { //双列流小视频,一行两图卡 |
| 94 | 96 | ||
| 95 | ZhGridLayout02NewsContent({ compDTO: this.compDTO, operDataList: this.compDTO.operDataList }) | 97 | ZhGridLayout02NewsContent({ compDTO: this.compDTO, operDataList: this.compDTO.operDataList }) |
| 96 | 98 | ||
| 97 | } else if (this.compDTO.compStyle === CompStyle.Zh_Grid_Layout_03) { | 99 | } else if (this.compDTO.compStyle === CompStyle.Zh_Grid_Layout_03) { |
| 98 | ZhGridLayout03({ compDTO: this.compDTO }) | 100 | ZhGridLayout03({ compDTO: this.compDTO }) |
| 99 | - Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) | 101 | + Divider().strokeWidth(8).color('#f5f5f5').padding({ left: 0, right: 0 }) |
| 100 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_04) { | 102 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_04) { |
| 101 | ZhSingleRow04({ compDTO: this.compDTO }) | 103 | ZhSingleRow04({ compDTO: this.compDTO }) |
| 102 | - Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) | 104 | + Divider().strokeWidth(8).color('#f5f5f5').padding({ left: 0, right: 0 }) |
| 103 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_05) { | 105 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_05) { |
| 104 | // ZhSingleRow05({ compDTO }) | 106 | // ZhSingleRow05({ compDTO }) |
| 105 | - // Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) | 107 | + // Divider().strokeWidth(8).color('#f5f5f5').padding({ left: 0, right: 0 }) |
| 106 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_06) { | 108 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_06) { |
| 107 | ZhSingleRow06({ compDTO: this.compDTO }) | 109 | ZhSingleRow06({ compDTO: this.compDTO }) |
| 108 | - Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) | 110 | + Divider().strokeWidth(8).color('#f5f5f5').padding({ left: 0, right: 0 }) |
| 109 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_02) { | 111 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_02) { |
| 110 | //头图卡 和comStyle 2相同, | 112 | //头图卡 和comStyle 2相同, |
| 111 | Card5Component({ contentDTO: this.compDTO.operDataList[0], titleShowPolicy: this.compDTO.titleShowPolicy }) | 113 | Card5Component({ contentDTO: this.compDTO.operDataList[0], titleShowPolicy: this.compDTO.titleShowPolicy }) |
| 112 | - Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) | 114 | + Divider().strokeWidth(8).color('#f5f5f5').padding({ left: 0, right: 0 }) |
| 113 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_03) { | 115 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_03) { |
| 114 | // 大图卡 | 116 | // 大图卡 |
| 115 | Card2Component({ compDTO: this.compDTO, contentDTO: this.compDTO.operDataList[0] }) | 117 | Card2Component({ compDTO: this.compDTO, contentDTO: this.compDTO.operDataList[0] }) |
| 116 | - Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) | 118 | + Divider().strokeWidth(8).color('#f5f5f5').padding({ left: 0, right: 0 }) |
| 117 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_04) { | 119 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_04) { |
| 118 | ZhSingleColumn04({ compDTO: this.compDTO }) | 120 | ZhSingleColumn04({ compDTO: this.compDTO }) |
| 119 | - Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) | 121 | + Divider().strokeWidth(8).color('#f5f5f5').padding({ left: 0, right: 0 }) |
| 120 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_05) { | 122 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_05) { |
| 121 | // ZhSingleColumn05({ compDTO: compDTO }) | 123 | // ZhSingleColumn05({ compDTO: compDTO }) |
| 122 | - // Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) | 124 | + // Divider().strokeWidth(8).color('#f5f5f5').padding({ left: 0, right: 0 }) |
| 123 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_09) { | 125 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_09) { |
| 124 | - Divider().strokeWidth(3).color('#ffffff').padding({ left: 16, right: 16 }).margin({ top: -3 }) | 126 | + Divider().strokeWidth(3).color('#ffffff').padding({ left: 0, right: 0 }).margin({ top: -3 }) |
| 125 | Divider().strokeWidth(6).color('#f5f5f5') | 127 | Divider().strokeWidth(6).color('#f5f5f5') |
| 126 | ZhSingleColumn09({ compDTO: this.compDTO }) | 128 | ZhSingleColumn09({ compDTO: this.compDTO }) |
| 127 | Divider().strokeWidth(6).color('#f5f5f5') | 129 | Divider().strokeWidth(6).color('#f5f5f5') |
| 128 | } else if (this.compDTO.compStyle === CompStyle.Card_Comp_Adv) { // 广告 | 130 | } else if (this.compDTO.compStyle === CompStyle.Card_Comp_Adv) { // 广告 |
| 129 | AdvCardParser({ pageModel: this.pageModel, compDTO: this.compDTO }) | 131 | AdvCardParser({ pageModel: this.pageModel, compDTO: this.compDTO }) |
| 130 | - //Text(`compIndex = ${compIndex}`).width('100%').fontSize('12fp').fontColor(Color.Red).padding({ left: 16, right: 16 }) | ||
| 131 | - Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) | 132 | + //Text(`compIndex = ${compIndex}`).width('100%').fontSize('12fp').fontColor(Color.Red).padding({ left: 0, right: 0 }) |
| 133 | + Divider().strokeWidth(8).color('#f5f5f5').padding({ left: 0, right: 0 }) | ||
| 132 | } else if (!Number.isNaN(Number(this.compDTO.compStyle))) { | 134 | } else if (!Number.isNaN(Number(this.compDTO.compStyle))) { |
| 133 | CardParser({ contentDTO: this.compDTO.operDataList[0], compDTO: this.compDTO }); | 135 | CardParser({ contentDTO: this.compDTO.operDataList[0], compDTO: this.compDTO }); |
| 134 | - Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) | 136 | + Divider().strokeWidth(8).color('#f5f5f5').padding({ left: 0, right: 0 }) |
| 135 | } else { | 137 | } else { |
| 136 | // Text(this.compDTO.compStyle) | 138 | // Text(this.compDTO.compStyle) |
| 137 | // .width(CommonConstants.FULL_PARENT) | 139 | // .width(CommonConstants.FULL_PARENT) |
| @@ -141,7 +143,7 @@ export struct CompParser { | @@ -141,7 +143,7 @@ export struct CompParser { | ||
| 141 | // WDRouterRule.jumpWithPage(WDRouterPage.QualityCommentsPage) | 143 | // WDRouterRule.jumpWithPage(WDRouterPage.QualityCommentsPage) |
| 142 | // } | 144 | // } |
| 143 | // }) | 145 | // }) |
| 144 | - // Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) | 146 | + // Divider().strokeWidth(8).color('#f5f5f5').padding({ left: 0, right: 0 }) |
| 145 | } | 147 | } |
| 146 | } | 148 | } |
| 147 | 149 |
| @@ -154,7 +154,12 @@ export struct FollowListDetailUI { | @@ -154,7 +154,12 @@ export struct FollowListDetailUI { | ||
| 154 | } else { | 154 | } else { |
| 155 | fansNumString = fansNum + "" | 155 | fansNumString = fansNum + "" |
| 156 | } | 156 | } |
| 157 | - this.data.push(new FollowListDetailItem(value.attentionHeadPhotoUrl, value.attentionUserName, fansNumString, value.introduction, value.attentionCreatorId, "1", value.attentionUserId, value.attentionUserType, value.attentionUserId, value.mainControl, value.banControl, value.authIcon)) | 157 | + let introduction = value.introduction |
| 158 | + if(value.introduction.indexOf("\n") != -1){ | ||
| 159 | + let regex:RegExp = new RegExp('\n','g') | ||
| 160 | + introduction = value.introduction.replace(regex,'') | ||
| 161 | + } | ||
| 162 | + this.data.push(new FollowListDetailItem(value.attentionHeadPhotoUrl, value.attentionUserName, fansNumString, introduction, value.attentionCreatorId, "1", value.attentionUserId, value.attentionUserType, value.attentionUserId, value.mainControl, value.banControl, value.authIcon)) | ||
| 158 | }) | 163 | }) |
| 159 | this.data.notifyDataReload() | 164 | this.data.notifyDataReload() |
| 160 | this.count = this.data.totalCount() | 165 | this.count = this.data.totalCount() |
| @@ -272,7 +277,12 @@ export struct FollowListDetailUI { | @@ -272,7 +277,12 @@ export struct FollowListDetailUI { | ||
| 272 | }) | 277 | }) |
| 273 | 278 | ||
| 274 | result.forEach((item) => { | 279 | result.forEach((item) => { |
| 275 | - this.data.push(new FollowListDetailItem(item.headPhotoUrl, item.cnUserName, item.cnFansNum, item.introduction, item.creatorId, item.status, item.attentionUserId, item.cnUserType, item.cnUserId, item.mainControl, item.banControl, item.authIcon)) | 280 | + let introduction = item.introduction |
| 281 | + if(item.introduction.indexOf("\n") != -1){ | ||
| 282 | + let regex:RegExp = new RegExp('\n','g') | ||
| 283 | + introduction = item.introduction.replace(regex,'') | ||
| 284 | + } | ||
| 285 | + this.data.push(new FollowListDetailItem(item.headPhotoUrl, item.cnUserName, item.cnFansNum, introduction, item.creatorId, item.status, item.attentionUserId, item.cnUserType, item.cnUserId, item.mainControl, item.banControl, item.authIcon)) | ||
| 276 | }) | 286 | }) |
| 277 | 287 | ||
| 278 | this.data.notifyDataReload() | 288 | this.data.notifyDataReload() |
| @@ -34,6 +34,7 @@ export struct PageComponent { | @@ -34,6 +34,7 @@ export struct PageComponent { | ||
| 34 | needload: boolean = true; | 34 | needload: boolean = true; |
| 35 | build() { | 35 | build() { |
| 36 | Column() { | 36 | Column() { |
| 37 | + Divider().strokeWidth(8).color('#f5f5f5').padding({ left: 0, right: 0 }) | ||
| 37 | if (this.pageModel.viewType == ViewType.LOADING) { | 38 | if (this.pageModel.viewType == ViewType.LOADING) { |
| 38 | this.LoadingLayout() | 39 | this.LoadingLayout() |
| 39 | } else if (this.pageModel.viewType == ViewType.LOADED) { | 40 | } else if (this.pageModel.viewType == ViewType.LOADED) { |
| @@ -25,6 +25,7 @@ const Normal_Page_Size = 20 // 常规每页数量 | @@ -25,6 +25,7 @@ const Normal_Page_Size = 20 // 常规每页数量 | ||
| 25 | 25 | ||
| 26 | const Rec_Page_Size = 10 // 推荐每页数量 | 26 | const Rec_Page_Size = 10 // 推荐每页数量 |
| 27 | 27 | ||
| 28 | +const SpecialComp: string[] = [CompStyle.Zh_Single_Column_03.toString()] | ||
| 28 | 29 | ||
| 29 | /** | 30 | /** |
| 30 | * 处理返回后的数据 | 31 | * 处理返回后的数据 |
| @@ -379,7 +380,8 @@ export class PageHelper { | @@ -379,7 +380,8 @@ export class PageHelper { | ||
| 379 | */ | 380 | */ |
| 380 | private factoryCompArray(compList: CompDTO[]): ArrayList<CompDTO> { | 381 | private factoryCompArray(compList: CompDTO[]): ArrayList<CompDTO> { |
| 381 | let pageCompList: ArrayList<CompDTO> = new ArrayList() // 收集页面组件、稿件和本地组件容器 | 382 | let pageCompList: ArrayList<CompDTO> = new ArrayList() // 收集页面组件、稿件和本地组件容器 |
| 382 | - compList.forEach((element: CompDTO) => { | 383 | + let newCompList = this.createSpecialComp(compList) |
| 384 | + newCompList.forEach((element: CompDTO) => { | ||
| 383 | let contentInfo: ContentDTO = CollectionUtils.getElement(element.operDataList, 0); | 385 | let contentInfo: ContentDTO = CollectionUtils.getElement(element.operDataList, 0); |
| 384 | //移除音频 和 活动 | 386 | //移除音频 和 活动 |
| 385 | if (contentInfo && (contentInfo.objectType === '13' || contentInfo.objectType === '3')) { | 387 | if (contentInfo && (contentInfo.objectType === '13' || contentInfo.objectType === '3')) { |
| @@ -402,6 +404,41 @@ export class PageHelper { | @@ -402,6 +404,41 @@ export class PageHelper { | ||
| 402 | } | 404 | } |
| 403 | 405 | ||
| 404 | /** | 406 | /** |
| 407 | + * 竖直方向list,将数据拆出来,组装成comp | ||
| 408 | + */ | ||
| 409 | + private createSpecialComp(compList: CompDTO[]): CompDTO[]{ | ||
| 410 | + if (!compList) { | ||
| 411 | + return compList | ||
| 412 | + } | ||
| 413 | + let tmpList: CompDTO[] = [] | ||
| 414 | + compList.forEach((value, index) => { | ||
| 415 | + if (SpecialComp.includes(value.compStyle)) { | ||
| 416 | + let list = value.operDataList | ||
| 417 | + if (list) { | ||
| 418 | + if (list.length == 1) { | ||
| 419 | + tmpList.push(value) | ||
| 420 | + } else { | ||
| 421 | + list.forEach((content) => { | ||
| 422 | + let newComp = CompDTO.createNewsBean(value) | ||
| 423 | + newComp.operDataList = [] | ||
| 424 | + // 特殊样式,comp只保留一个content,多余的一一拆成新的comp | ||
| 425 | + newComp.operDataList.push(content) | ||
| 426 | + tmpList.push(newComp) | ||
| 427 | + }) | ||
| 428 | + } | ||
| 429 | + } else { | ||
| 430 | + tmpList.push(value) | ||
| 431 | + } | ||
| 432 | + } else { | ||
| 433 | + tmpList.push(value) | ||
| 434 | + } | ||
| 435 | + }) | ||
| 436 | + | ||
| 437 | + // 重新赋值,将contentList拆出来了。 | ||
| 438 | + return tmpList | ||
| 439 | + } | ||
| 440 | + | ||
| 441 | + /** | ||
| 405 | * 信息流页面,所有稿件需要参与批查,如 批查评论、批查关注状态等接口 | 442 | * 信息流页面,所有稿件需要参与批查,如 批查评论、批查关注状态等接口 |
| 406 | * @param compList | 443 | * @param compList |
| 407 | * @param pageModel | 444 | * @param pageModel |
-
Please register or login to post a comment