Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool
Showing
14 changed files
with
274 additions
and
108 deletions
| 1 | -import { CompDTO } from 'wdBean'; | 1 | +import { CompDTO, ContentDTO } from 'wdBean'; |
| 2 | import { CommonConstants, CompStyle } from 'wdConstant/Index'; | 2 | import { CommonConstants, CompStyle } from 'wdConstant/Index'; |
| 3 | import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; | 3 | import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; |
| 4 | import PageModel from '../viewmodel/PageModel'; | 4 | import PageModel from '../viewmodel/PageModel'; |
| @@ -35,10 +35,20 @@ export struct CompParser { | @@ -35,10 +35,20 @@ export struct CompParser { | ||
| 35 | @ObjectLink compDTO: CompDTO | 35 | @ObjectLink compDTO: CompDTO |
| 36 | @State compIndex: number = 0; | 36 | @State compIndex: number = 0; |
| 37 | @State private pageModel: PageModel = new PageModel(); | 37 | @State private pageModel: PageModel = new PageModel(); |
| 38 | + @State audioItems: ContentDTO[] = []; | ||
| 39 | + @State noneAudioItems: ContentDTO[] = []; | ||
| 40 | + | ||
| 41 | + aboutToAppear(): void { | ||
| 42 | + // 轮播图屏蔽音频类型稿件 | ||
| 43 | + if (this.compDTO.compStyle === CompStyle.Zh_Carousel_Layout_01) { | ||
| 44 | + this.audioItems = this.compDTO.operDataList.filter(item => item.appStyle === '13') | ||
| 45 | + this.noneAudioItems = this.compDTO.operDataList.filter(item => item.appStyle !== '13') | ||
| 46 | + this.compDTO.operDataList = this.noneAudioItems; | ||
| 47 | + } | ||
| 48 | + } | ||
| 38 | 49 | ||
| 39 | build() { | 50 | build() { |
| 40 | Column() { | 51 | Column() { |
| 41 | - | ||
| 42 | this.componentBuilder(); | 52 | this.componentBuilder(); |
| 43 | } | 53 | } |
| 44 | } | 54 | } |
| @@ -50,76 +60,79 @@ export struct CompParser { | @@ -50,76 +60,79 @@ export struct CompParser { | ||
| 50 | 60 | ||
| 51 | if (this.compDTO.operDataList[0]?.objectType !== '3' && | 61 | if (this.compDTO.operDataList[0]?.objectType !== '3' && |
| 52 | this.compDTO.operDataList[0]?.objectType !== '13') { //暂时屏蔽活动和音频详情入口 | 62 | this.compDTO.operDataList[0]?.objectType !== '13') { //暂时屏蔽活动和音频详情入口 |
| 63 | + | ||
| 53 | if (this.compDTO.compStyle === CompStyle.Label_03) { | 64 | if (this.compDTO.compStyle === CompStyle.Label_03) { |
| 54 | LabelComponent({ compDTO: this.compDTO }) | 65 | LabelComponent({ compDTO: this.compDTO }) |
| 55 | - Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) | 66 | + Divider().strokeWidth(8).color('#f5f5f5').padding({ left: 0, right: 0 }) |
| 56 | } else if (this.compDTO.compStyle === CompStyle.Zh_Carousel_Layout_01) { | 67 | } else if (this.compDTO.compStyle === CompStyle.Zh_Carousel_Layout_01) { |
| 68 | + if (this.compDTO.operDataList.length > this.audioItems.length) { | ||
| 57 | ZhCarouselLayout01({ compDTO: this.compDTO }) | 69 | ZhCarouselLayout01({ compDTO: this.compDTO }) |
| 58 | - Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) | 70 | + Divider().strokeWidth(8).color('#f5f5f5').padding({ left: 0, right: 0 }) |
| 71 | + } | ||
| 59 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_01 && | 72 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_01 && |
| 60 | this.compDTO.imageScale === 2) { // && compDTO.name ==="横划卡" | 73 | this.compDTO.imageScale === 2) { // && compDTO.name ==="横划卡" |
| 61 | 74 | ||
| 62 | LiveHorizontalCardComponent({ compDTO: this.compDTO }) | 75 | LiveHorizontalCardComponent({ compDTO: this.compDTO }) |
| 63 | - Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) | 76 | + Divider().strokeWidth(8).color('#f5f5f5').padding({ left: 0, right: 0 }) |
| 64 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_01 && this.compDTO.imageScale === 3) { | 77 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_01 && this.compDTO.imageScale === 3) { |
| 65 | if (this.compDTO.operDataList.length > 1) { | 78 | if (this.compDTO.operDataList.length > 1) { |
| 66 | HorizontalStrokeCardThreeTwoRadioForMoreComponent({ compDTO: this.compDTO }) | 79 | HorizontalStrokeCardThreeTwoRadioForMoreComponent({ compDTO: this.compDTO }) |
| 67 | } else { | 80 | } else { |
| 68 | HorizontalStrokeCardThreeTwoRadioForOneComponent({ compDTO: this.compDTO }) | 81 | HorizontalStrokeCardThreeTwoRadioForOneComponent({ compDTO: this.compDTO }) |
| 69 | } | 82 | } |
| 70 | - Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) | 83 | + Divider().strokeWidth(8).color('#f5f5f5').padding({ left: 0, right: 0 }) |
| 71 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_02) { | 84 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_02) { |
| 72 | ZhSingleRow02({ compDTO: this.compDTO }) | 85 | ZhSingleRow02({ compDTO: this.compDTO }) |
| 73 | - Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) | 86 | + Divider().strokeWidth(8).color('#f5f5f5').padding({ left: 0, right: 0 }) |
| 74 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_03) { | 87 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_03) { |
| 75 | ZhSingleRow03({ compDTO: this.compDTO }) | 88 | ZhSingleRow03({ compDTO: this.compDTO }) |
| 76 | - Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) | 89 | + Divider().strokeWidth(8).color('#f5f5f5').padding({ left: 0, right: 0 }) |
| 77 | } else if (this.compDTO.compStyle === CompStyle.Zh_Grid_Layout_02) { //双列流小视频,一行两图卡 ->标题 | 90 | } else if (this.compDTO.compStyle === CompStyle.Zh_Grid_Layout_02) { //双列流小视频,一行两图卡 ->标题 |
| 78 | //ZhGridLayout02({ compDTO: this.compDTO }) | 91 | //ZhGridLayout02({ compDTO: this.compDTO }) |
| 79 | CompNormalTitle({ compDTO: this.compDTO }) | 92 | CompNormalTitle({ compDTO: this.compDTO }) |
| 80 | - // Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) | 93 | + // Divider().strokeWidth(8).color('#f5f5f5').padding({ left: 0, right: 0 }) |
| 81 | } else if (this.compDTO.compStyle === CompStyle.Card_Comp_Zh_Grid_Layout_02) { //双列流小视频,一行两图卡 | 94 | } else if (this.compDTO.compStyle === CompStyle.Card_Comp_Zh_Grid_Layout_02) { //双列流小视频,一行两图卡 |
| 82 | 95 | ||
| 83 | ZhGridLayout02NewsContent({ compDTO: this.compDTO, operDataList: this.compDTO.operDataList }) | 96 | ZhGridLayout02NewsContent({ compDTO: this.compDTO, operDataList: this.compDTO.operDataList }) |
| 84 | 97 | ||
| 85 | } else if (this.compDTO.compStyle === CompStyle.Zh_Grid_Layout_03) { | 98 | } else if (this.compDTO.compStyle === CompStyle.Zh_Grid_Layout_03) { |
| 86 | ZhGridLayout03({ compDTO: this.compDTO }) | 99 | ZhGridLayout03({ compDTO: this.compDTO }) |
| 87 | - Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) | 100 | + Divider().strokeWidth(8).color('#f5f5f5').padding({ left: 0, right: 0 }) |
| 88 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_04) { | 101 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_04) { |
| 89 | ZhSingleRow04({ compDTO: this.compDTO }) | 102 | ZhSingleRow04({ compDTO: this.compDTO }) |
| 90 | - Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) | 103 | + Divider().strokeWidth(8).color('#f5f5f5').padding({ left: 0, right: 0 }) |
| 91 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_05) { | 104 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_05) { |
| 92 | // ZhSingleRow05({ compDTO }) | 105 | // ZhSingleRow05({ compDTO }) |
| 93 | - // Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) | 106 | + // Divider().strokeWidth(8).color('#f5f5f5').padding({ left: 0, right: 0 }) |
| 94 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_06) { | 107 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_06) { |
| 95 | ZhSingleRow06({ compDTO: this.compDTO }) | 108 | ZhSingleRow06({ compDTO: this.compDTO }) |
| 96 | - Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) | 109 | + Divider().strokeWidth(8).color('#f5f5f5').padding({ left: 0, right: 0 }) |
| 97 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_02) { | 110 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_02) { |
| 98 | //头图卡 和comStyle 2相同, | 111 | //头图卡 和comStyle 2相同, |
| 99 | Card5Component({ contentDTO: this.compDTO.operDataList[0], titleShowPolicy: this.compDTO.titleShowPolicy }) | 112 | Card5Component({ contentDTO: this.compDTO.operDataList[0], titleShowPolicy: this.compDTO.titleShowPolicy }) |
| 100 | - Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) | 113 | + Divider().strokeWidth(8).color('#f5f5f5').padding({ left: 0, right: 0 }) |
| 101 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_03) { | 114 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_03) { |
| 102 | // 大图卡 | 115 | // 大图卡 |
| 103 | Card2Component({ compDTO: this.compDTO, contentDTO: this.compDTO.operDataList[0] }) | 116 | Card2Component({ compDTO: this.compDTO, contentDTO: this.compDTO.operDataList[0] }) |
| 104 | - Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) | 117 | + Divider().strokeWidth(8).color('#f5f5f5').padding({ left: 0, right: 0 }) |
| 105 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_04) { | 118 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_04) { |
| 106 | ZhSingleColumn04({ compDTO: this.compDTO }) | 119 | ZhSingleColumn04({ compDTO: this.compDTO }) |
| 107 | - Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) | 120 | + Divider().strokeWidth(8).color('#f5f5f5').padding({ left: 0, right: 0 }) |
| 108 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_05) { | 121 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_05) { |
| 109 | // ZhSingleColumn05({ compDTO: compDTO }) | 122 | // ZhSingleColumn05({ compDTO: compDTO }) |
| 110 | - // Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) | 123 | + // Divider().strokeWidth(8).color('#f5f5f5').padding({ left: 0, right: 0 }) |
| 111 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_09) { | 124 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_09) { |
| 112 | - Divider().strokeWidth(3).color('#ffffff').padding({ left: 16, right: 16 }).margin({ top: -3 }) | 125 | + Divider().strokeWidth(3).color('#ffffff').padding({ left: 0, right: 0 }).margin({ top: -3 }) |
| 113 | Divider().strokeWidth(6).color('#f5f5f5') | 126 | Divider().strokeWidth(6).color('#f5f5f5') |
| 114 | ZhSingleColumn09({ compDTO: this.compDTO }) | 127 | ZhSingleColumn09({ compDTO: this.compDTO }) |
| 115 | Divider().strokeWidth(6).color('#f5f5f5') | 128 | Divider().strokeWidth(6).color('#f5f5f5') |
| 116 | } else if (this.compDTO.compStyle === CompStyle.Card_Comp_Adv) { // 广告 | 129 | } else if (this.compDTO.compStyle === CompStyle.Card_Comp_Adv) { // 广告 |
| 117 | AdvCardParser({ pageModel: this.pageModel, compDTO: this.compDTO }) | 130 | AdvCardParser({ pageModel: this.pageModel, compDTO: this.compDTO }) |
| 118 | - //Text(`compIndex = ${compIndex}`).width('100%').fontSize('12fp').fontColor(Color.Red).padding({ left: 16, right: 16 }) | ||
| 119 | - Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) | 131 | + //Text(`compIndex = ${compIndex}`).width('100%').fontSize('12fp').fontColor(Color.Red).padding({ left: 0, right: 0 }) |
| 132 | + Divider().strokeWidth(8).color('#f5f5f5').padding({ left: 0, right: 0 }) | ||
| 120 | } else if (!Number.isNaN(Number(this.compDTO.compStyle))) { | 133 | } else if (!Number.isNaN(Number(this.compDTO.compStyle))) { |
| 121 | CardParser({ contentDTO: this.compDTO.operDataList[0], compDTO: this.compDTO }); | 134 | CardParser({ contentDTO: this.compDTO.operDataList[0], compDTO: this.compDTO }); |
| 122 | - Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) | 135 | + Divider().strokeWidth(8).color('#f5f5f5').padding({ left: 0, right: 0 }) |
| 123 | } else { | 136 | } else { |
| 124 | // Text(this.compDTO.compStyle) | 137 | // Text(this.compDTO.compStyle) |
| 125 | // .width(CommonConstants.FULL_PARENT) | 138 | // .width(CommonConstants.FULL_PARENT) |
| @@ -129,7 +142,7 @@ export struct CompParser { | @@ -129,7 +142,7 @@ export struct CompParser { | ||
| 129 | // WDRouterRule.jumpWithPage(WDRouterPage.QualityCommentsPage) | 142 | // WDRouterRule.jumpWithPage(WDRouterPage.QualityCommentsPage) |
| 130 | // } | 143 | // } |
| 131 | // }) | 144 | // }) |
| 132 | - // Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) | 145 | + // Divider().strokeWidth(8).color('#f5f5f5').padding({ left: 0, right: 0 }) |
| 133 | } | 146 | } |
| 134 | } | 147 | } |
| 135 | 148 |
| @@ -547,7 +547,7 @@ export struct DynamicDetailComponent { | @@ -547,7 +547,7 @@ export struct DynamicDetailComponent { | ||
| 547 | } | 547 | } |
| 548 | .width(CommonConstants.FULL_WIDTH) | 548 | .width(CommonConstants.FULL_WIDTH) |
| 549 | .height(CommonConstants.FULL_HEIGHT) | 549 | .height(CommonConstants.FULL_HEIGHT) |
| 550 | - .padding({ bottom: 76 }) | 550 | + .padding({ bottom: 100 }) |
| 551 | .scrollBar(BarState.Off) | 551 | .scrollBar(BarState.Off) |
| 552 | .alignSelf(ItemAlign.Start) | 552 | .alignSelf(ItemAlign.Start) |
| 553 | } | 553 | } |
| @@ -559,7 +559,7 @@ export struct DynamicDetailComponent { | @@ -559,7 +559,7 @@ export struct DynamicDetailComponent { | ||
| 559 | operationButtonList: this.operationButtonList, | 559 | operationButtonList: this.operationButtonList, |
| 560 | styleType: 1, | 560 | styleType: 1, |
| 561 | }) | 561 | }) |
| 562 | - | 562 | + .height(100) |
| 563 | } | 563 | } |
| 564 | } | 564 | } |
| 565 | .alignSelf(ItemAlign.Start) | 565 | .alignSelf(ItemAlign.Start) |
| @@ -37,7 +37,9 @@ import { componentUtils, window } from '@kit.ArkUI'; | @@ -37,7 +37,9 @@ import { componentUtils, window } from '@kit.ArkUI'; | ||
| 37 | const PATTERN_DATE_CN_RN: string = 'yyyy年MM月dd日 HH:mm'; | 37 | const PATTERN_DATE_CN_RN: string = 'yyyy年MM月dd日 HH:mm'; |
| 38 | 38 | ||
| 39 | const TAG: string = 'ImageAndTextPageComponent' | 39 | const TAG: string = 'ImageAndTextPageComponent' |
| 40 | - | 40 | +/** |
| 41 | + * 图文详情页 | ||
| 42 | + * */ | ||
| 41 | @Component | 43 | @Component |
| 42 | export struct ImageAndTextPageComponent { | 44 | export struct ImageAndTextPageComponent { |
| 43 | scroller: Scroller = new Scroller(); | 45 | scroller: Scroller = new Scroller(); |
| 1 | import { CompDTO, ContentDTO } from 'wdBean' | 1 | import { CompDTO, ContentDTO } from 'wdBean' |
| 2 | import { CommonConstants } from 'wdConstant/Index'; | 2 | import { CommonConstants } from 'wdConstant/Index'; |
| 3 | import { DateTimeUtils } from 'wdKit/Index'; | 3 | import { DateTimeUtils } from 'wdKit/Index'; |
| 4 | +import { JSON } from '@kit.ArkTS'; | ||
| 5 | +import router from '@ohos.router' | ||
| 4 | 6 | ||
| 5 | @Component | 7 | @Component |
| 6 | export struct CardSourceInfo { | 8 | export struct CardSourceInfo { |
| 7 | @State contentDTO: ContentDTO = new ContentDTO(); | 9 | @State contentDTO: ContentDTO = new ContentDTO(); |
| 8 | @ObjectLink compDTO: CompDTO | 10 | @ObjectLink compDTO: CompDTO |
| 9 | 11 | ||
| 12 | + handleTimeStr() { | ||
| 13 | + return DateTimeUtils.getCommentTime( | ||
| 14 | + this.contentDTO.publishTime.includes(' ') | ||
| 15 | + ? Number.parseFloat(new Date(this.contentDTO.publishTime).getTime().toString()) | ||
| 16 | + : Number.parseFloat(this.contentDTO.publishTime) | ||
| 17 | + ) | ||
| 18 | + } | ||
| 19 | + | ||
| 20 | + showTime() { | ||
| 21 | + console.log('curRouter', this.contentDTO.publishTime) | ||
| 22 | + const curRouter = router.getState().name; | ||
| 23 | + const publishTime = this.contentDTO.publishTime.includes(' ') | ||
| 24 | + ? new Date(this.contentDTO.publishTime).getTime().toString() | ||
| 25 | + : this.contentDTO.publishTime | ||
| 26 | + let flag: boolean = false; | ||
| 27 | + if (curRouter === 'MainPage') { | ||
| 28 | + if (this.isTwoDaysAgo(publishTime)) { | ||
| 29 | + console.log('curRouter 01') | ||
| 30 | + flag = false | ||
| 31 | + } else { | ||
| 32 | + console.log('curRouter 02') | ||
| 33 | + flag = true; | ||
| 34 | + } | ||
| 35 | + } else { | ||
| 36 | + console.log('curRouter 03') | ||
| 37 | + flag = true; | ||
| 38 | + } | ||
| 39 | + return flag; | ||
| 40 | + } | ||
| 41 | + | ||
| 42 | + isTwoDaysAgo(date: string) { | ||
| 43 | + const twoDaysAgo = new Date(); | ||
| 44 | + twoDaysAgo.setDate(twoDaysAgo.getDate() - 2); | ||
| 45 | + console.log('curRouter', date) | ||
| 46 | + return parseInt(date) < twoDaysAgo.getTime() | ||
| 47 | + } | ||
| 48 | + | ||
| 10 | build() { | 49 | build() { |
| 11 | Flex({ alignItems: ItemAlign.Center }) { | 50 | Flex({ alignItems: ItemAlign.Center }) { |
| 12 | if (this.contentDTO.corner) { | 51 | if (this.contentDTO.corner) { |
| @@ -52,11 +91,12 @@ export struct CardSourceInfo { | @@ -52,11 +91,12 @@ export struct CardSourceInfo { | ||
| 52 | // .fontColor($r("app.color.color_B0B0B0")) | 91 | // .fontColor($r("app.color.color_B0B0B0")) |
| 53 | // .flexShrink(0); | 92 | // .flexShrink(0); |
| 54 | // } | 93 | // } |
| 55 | - if (this.contentDTO.source) { | ||
| 56 | - Text(DateTimeUtils.getCommentTime(Number.parseFloat(new Date(this.contentDTO.publishTime).getTime().toString()))) | 94 | + if (this.contentDTO.source && this.showTime()) { |
| 95 | + Text(this.handleTimeStr()) | ||
| 57 | .fontSize($r("app.float.font_size_11")) | 96 | .fontSize($r("app.float.font_size_11")) |
| 58 | .fontColor($r("app.color.color_B0B0B0")) | 97 | .fontColor($r("app.color.color_B0B0B0")) |
| 59 | - .flexShrink(0); | 98 | + .flexShrink(0) |
| 99 | + .margin({right: 4}) | ||
| 60 | } | 100 | } |
| 61 | 101 | ||
| 62 | if (this.getContentDtoBean()?.interactData?.commentNum && this.contentDTO.source) { | 102 | if (this.getContentDtoBean()?.interactData?.commentNum && this.contentDTO.source) { |
| @@ -64,7 +104,6 @@ export struct CardSourceInfo { | @@ -64,7 +104,6 @@ export struct CardSourceInfo { | ||
| 64 | .fontSize($r("app.float.font_size_11")) | 104 | .fontSize($r("app.float.font_size_11")) |
| 65 | .fontColor($r("app.color.color_B0B0B0")) | 105 | .fontColor($r("app.color.color_B0B0B0")) |
| 66 | .flexShrink(0) | 106 | .flexShrink(0) |
| 67 | - .margin({ left: 6 }) | ||
| 68 | .visibility(Number(this.getContentDtoBean()?.interactData?.commentNum) === 0 ? Visibility.None : | 107 | .visibility(Number(this.getContentDtoBean()?.interactData?.commentNum) === 0 ? Visibility.None : |
| 69 | Visibility.Visible) | 108 | Visibility.Visible) |
| 70 | } | 109 | } |
| @@ -75,7 +75,7 @@ export struct Card4Component { | @@ -75,7 +75,7 @@ export struct Card4Component { | ||
| 75 | ForEach(this.contentDTO.fullColumnImgUrls, (item: FullColumnImgUrlDTO, index: number) => { | 75 | ForEach(this.contentDTO.fullColumnImgUrls, (item: FullColumnImgUrlDTO, index: number) => { |
| 76 | if (index < 3) { | 76 | if (index < 3) { |
| 77 | GridCol({ span: { xs: 4 } }) { | 77 | GridCol({ span: { xs: 4 } }) { |
| 78 | - Image(this.loadImg ? item.url : '') | 78 | + Image(this.loadImg ? item.url || item.fullUrl : '') |
| 79 | .backgroundColor(0xf5f5f5) | 79 | .backgroundColor(0xf5f5f5) |
| 80 | .width('100%') | 80 | .width('100%') |
| 81 | .aspectRatio(113 / 75) | 81 | .aspectRatio(113 / 75) |
| @@ -114,7 +114,7 @@ export class commentItemModel { | @@ -114,7 +114,7 @@ export class commentItemModel { | ||
| 114 | /*评论点赞状态 0-未点赞 1-已点赞*/ | 114 | /*评论点赞状态 0-未点赞 1-已点赞*/ |
| 115 | api_status: boolean = false; | 115 | api_status: boolean = false; |
| 116 | api_level: string = ''; | 116 | api_level: string = ''; |
| 117 | - api_levelHead: string = 'http'; | 117 | + api_levelHead: string = ''; |
| 118 | api_userId: string = ''; | 118 | api_userId: string = ''; |
| 119 | api_creatorId: string = ''; | 119 | api_creatorId: string = ''; |
| 120 | api_userType: string = ''; | 120 | api_userType: string = ''; |
| 1 | -import { DateTimeUtils, EmitterEventId, EmitterUtils, LazyDataSource } from 'wdKit/Index'; | 1 | +import { DateTimeUtils, EmitterEventId, EmitterUtils, LazyDataSource, StringUtils } from 'wdKit/Index'; |
| 2 | import { commentItemModel, WDPublicUserType } from '../model/CommentModel'; | 2 | import { commentItemModel, WDPublicUserType } from '../model/CommentModel'; |
| 3 | import commentViewModel from '../viewmodel/CommentViewModel'; | 3 | import commentViewModel from '../viewmodel/CommentViewModel'; |
| 4 | import { CommentText } from './CommentText'; | 4 | import { CommentText } from './CommentText'; |
| @@ -303,34 +303,7 @@ struct ChildCommentItem { | @@ -303,34 +303,7 @@ struct ChildCommentItem { | ||
| 303 | Column() { | 303 | Column() { |
| 304 | Row() { | 304 | Row() { |
| 305 | //头像 | 305 | //头像 |
| 306 | - Stack() { | ||
| 307 | - Image(this.item.fromUserHeader) | ||
| 308 | - .alt($r('app.media.default_head')) | ||
| 309 | - .width('24') | ||
| 310 | - .height('24') | ||
| 311 | - .objectFit(ImageFit.Cover) | ||
| 312 | - .borderRadius(16) | ||
| 313 | - Image(this.item.api_levelHead) | ||
| 314 | - .width('36') | ||
| 315 | - .height('36') | ||
| 316 | - .objectFit(ImageFit.Cover) | ||
| 317 | - .borderRadius(24) | ||
| 318 | - } | ||
| 319 | - .width(48) | ||
| 320 | - .height(48) | ||
| 321 | - .margin({ left: 47 }) | ||
| 322 | - .alignContent(Alignment.Center) | ||
| 323 | - .onClick(() => { | ||
| 324 | - // TODO 跳转个人详情 | ||
| 325 | - // 跳转到号主页 | ||
| 326 | - if (this.contentDetailData.rmhInfo?.cnMainControl === 1) { | ||
| 327 | - const params: Params = { | ||
| 328 | - creatorId: this.contentDetailData.rmhInfo.rmhId, | ||
| 329 | - pageID: '' | ||
| 330 | - } | ||
| 331 | - WDRouterRule.jumpWithPage(WDRouterPage.peopleShipHomePage, params) | ||
| 332 | - } | ||
| 333 | - }) | 306 | + this.headerView() |
| 334 | 307 | ||
| 335 | //昵称 | 308 | //昵称 |
| 336 | Text() { | 309 | Text() { |
| @@ -354,7 +327,7 @@ struct ChildCommentItem { | @@ -354,7 +327,7 @@ struct ChildCommentItem { | ||
| 354 | /// 人民号>置顶>作者 | 327 | /// 人民号>置顶>作者 |
| 355 | 328 | ||
| 356 | //人民号 | 329 | //人民号 |
| 357 | - if (this.item.fromUserType === WDPublicUserType.WDPublicUserType_Matrix) { | 330 | + if (this.item.fromUserType !== 1) { |
| 358 | Image($r('app.media.comment_rmh_tag')).width(20).height(20).margin({ left: 5 }); | 331 | Image($r('app.media.comment_rmh_tag')).width(20).height(20).margin({ left: 5 }); |
| 359 | } | 332 | } |
| 360 | //置顶 | 333 | //置顶 |
| @@ -400,6 +373,53 @@ struct ChildCommentItem { | @@ -400,6 +373,53 @@ struct ChildCommentItem { | ||
| 400 | .width('100%') | 373 | .width('100%') |
| 401 | } | 374 | } |
| 402 | 375 | ||
| 376 | + @Builder headerView() { | ||
| 377 | + Stack() { | ||
| 378 | + Stack() { | ||
| 379 | + Image(this.item.fromUserHeader) | ||
| 380 | + .alt($r('app.media.default_head')) | ||
| 381 | + .width(24) | ||
| 382 | + .height(24) | ||
| 383 | + .objectFit(ImageFit.Cover) | ||
| 384 | + .borderRadius(16) | ||
| 385 | + | ||
| 386 | + if (this.item.api_authIcon && this.item.api_authIcon.length) { | ||
| 387 | + Image(this.item.api_authIcon) // 加v | ||
| 388 | + .width(14).height(14) | ||
| 389 | + .objectFit(ImageFit.Cover) | ||
| 390 | + } | ||
| 391 | + }.width(24).height(24) | ||
| 392 | + .alignContent(Alignment.BottomEnd) | ||
| 393 | + | ||
| 394 | + if ((!this.item.api_authIcon || this.item.api_authIcon.length == 0) | ||
| 395 | + && this.item.fromUserType === 1 | ||
| 396 | + && ((this.item.api_levelHead && this.item.api_levelHead.length > 0) | ||
| 397 | + || (this.item.avatarFrame && this.item.avatarFrame.length > 0))) { | ||
| 398 | + Image(this.customBorderIconURL()) | ||
| 399 | + .width('36') | ||
| 400 | + .height('36') | ||
| 401 | + .objectFit(ImageFit.Cover) | ||
| 402 | + .borderRadius(24) | ||
| 403 | + } | ||
| 404 | + } | ||
| 405 | + .width(48).height(48) | ||
| 406 | + .margin({ left: 47 }) | ||
| 407 | + .alignContent(Alignment.Center) | ||
| 408 | + .onClick(() => { | ||
| 409 | + commentViewModel.jumpToAccountPage(this.item) | ||
| 410 | + }) | ||
| 411 | + } | ||
| 412 | + | ||
| 413 | + customBorderIconURL() : string { | ||
| 414 | + if (this.item.avatarFrame.length > 0) { | ||
| 415 | + return this.item.avatarFrame | ||
| 416 | + } | ||
| 417 | + if (this.item.fromUserType === 1) { | ||
| 418 | + return this.item.api_levelHead | ||
| 419 | + } | ||
| 420 | + return "" | ||
| 421 | + } | ||
| 422 | + | ||
| 403 | replyComment() { | 423 | replyComment() { |
| 404 | if (this.item.id && this.item.checkStatus == '2') { // 审核通过的才显示回复 | 424 | if (this.item.id && this.item.checkStatus == '2') { // 审核通过的才显示回复 |
| 405 | this.publishCommentModel.rootCommentId = this.item.rootCommentId | 425 | this.publishCommentModel.rootCommentId = this.item.rootCommentId |
| @@ -498,26 +518,7 @@ struct commentHeaderView { | @@ -498,26 +518,7 @@ struct commentHeaderView { | ||
| 498 | Column() { | 518 | Column() { |
| 499 | Row() { | 519 | Row() { |
| 500 | //头像 | 520 | //头像 |
| 501 | - Stack() { | ||
| 502 | - Image(this.item.fromUserHeader) | ||
| 503 | - .alt($r('app.media.default_head')) | ||
| 504 | - .width('32') | ||
| 505 | - .height('32') | ||
| 506 | - .objectFit(ImageFit.Cover) | ||
| 507 | - .borderRadius(16) | ||
| 508 | - Image(this.item.api_levelHead) | ||
| 509 | - .width('48') | ||
| 510 | - .height('48') | ||
| 511 | - .objectFit(ImageFit.Cover) | ||
| 512 | - .borderRadius(24) | ||
| 513 | - } | ||
| 514 | - .width(48) | ||
| 515 | - .height(48) | ||
| 516 | - .margin({ left: 8 }) | ||
| 517 | - .alignContent(Alignment.Center) | ||
| 518 | - .onClick(() => { | ||
| 519 | - commentViewModel.jumpToAccountPage(this.item) | ||
| 520 | - }) | 521 | + this.headerView() |
| 521 | 522 | ||
| 522 | //昵称 | 523 | //昵称 |
| 523 | Text(this.item.fromUserName) | 524 | Text(this.item.fromUserName) |
| @@ -531,7 +532,7 @@ struct commentHeaderView { | @@ -531,7 +532,7 @@ struct commentHeaderView { | ||
| 531 | /// 人民号>置顶>作者 | 532 | /// 人民号>置顶>作者 |
| 532 | 533 | ||
| 533 | //人民号 | 534 | //人民号 |
| 534 | - if (this.item.fromUserType === WDPublicUserType.WDPublicUserType_Matrix) { | 535 | + if (this.item.fromUserType !== 1) { |
| 535 | Image($r('app.media.comment_rmh_tag')).width(20).height(20).margin({ left: 5 }); | 536 | Image($r('app.media.comment_rmh_tag')).width(20).height(20).margin({ left: 5 }); |
| 536 | } | 537 | } |
| 537 | //置顶 | 538 | //置顶 |
| @@ -573,6 +574,53 @@ struct commentHeaderView { | @@ -573,6 +574,53 @@ struct commentHeaderView { | ||
| 573 | .padding({bottom: 8}) | 574 | .padding({bottom: 8}) |
| 574 | } | 575 | } |
| 575 | 576 | ||
| 577 | + @Builder headerView() { | ||
| 578 | + Stack() { | ||
| 579 | + Stack() { | ||
| 580 | + Image(this.item.fromUserHeader) | ||
| 581 | + .alt($r('app.media.default_head')) | ||
| 582 | + .width(32) | ||
| 583 | + .height(32) | ||
| 584 | + .objectFit(ImageFit.Cover) | ||
| 585 | + .borderRadius(16) | ||
| 586 | + | ||
| 587 | + if (this.item.api_authIcon && this.item.api_authIcon.length > 0) { | ||
| 588 | + Image(this.item.api_authIcon) // 加v | ||
| 589 | + .width(14).height(14) | ||
| 590 | + .objectFit(ImageFit.Cover) | ||
| 591 | + } | ||
| 592 | + }.width(32).height(32) | ||
| 593 | + .alignContent(Alignment.BottomEnd) | ||
| 594 | + | ||
| 595 | + if ((!this.item.api_authIcon || this.item.api_authIcon.length == 0) | ||
| 596 | + && this.item.fromUserType === 1 | ||
| 597 | + && ((this.item.api_levelHead && this.item.api_levelHead.length > 0) | ||
| 598 | + || (this.item.avatarFrame && this.item.avatarFrame.length > 0))) { | ||
| 599 | + Image(this.customBorderIconURL()) | ||
| 600 | + .width(48) | ||
| 601 | + .height(48) | ||
| 602 | + .objectFit(ImageFit.Cover) | ||
| 603 | + .borderRadius(24) | ||
| 604 | + } | ||
| 605 | + } | ||
| 606 | + .width(48).height(48) | ||
| 607 | + .margin({ left: 8 }) | ||
| 608 | + .alignContent(Alignment.Center) | ||
| 609 | + .onClick(() => { | ||
| 610 | + commentViewModel.jumpToAccountPage(this.item) | ||
| 611 | + }) | ||
| 612 | + } | ||
| 613 | + | ||
| 614 | + customBorderIconURL() : string { | ||
| 615 | + if (this.item.avatarFrame.length > 0) { | ||
| 616 | + return this.item.avatarFrame | ||
| 617 | + } | ||
| 618 | + if (this.item.fromUserType === 1) { | ||
| 619 | + return this.item.api_levelHead | ||
| 620 | + } | ||
| 621 | + return "" | ||
| 622 | + } | ||
| 623 | + | ||
| 576 | replyComment() { | 624 | replyComment() { |
| 577 | if (this.item.id && this.item.checkStatus == '2') { // 审核通过的才显示回复 | 625 | if (this.item.id && this.item.checkStatus == '2') { // 审核通过的才显示回复 |
| 578 | this.publishCommentModel.rootCommentId = this.item.rootCommentId | 626 | this.publishCommentModel.rootCommentId = this.item.rootCommentId |
| @@ -596,7 +644,7 @@ struct commentFooterView { | @@ -596,7 +644,7 @@ struct commentFooterView { | ||
| 596 | Row() { | 644 | Row() { |
| 597 | 645 | ||
| 598 | Row({ space: 6 }) { | 646 | Row({ space: 6 }) { |
| 599 | - Text(this.item.region ? (this.item.region + '网友') : '人民日报客户端网友') | 647 | + Text(this.item.region.length > 0 ? (this.item.region + '网友') : '人民日报客户端网友') |
| 600 | .fontColor($r('app.color.color_B0B0B0')) | 648 | .fontColor($r('app.color.color_B0B0B0')) |
| 601 | .fontSize(12); | 649 | .fontSize(12); |
| 602 | Image($r('app.media.comment_hyphen')) | 650 | Image($r('app.media.comment_hyphen')) |
| @@ -419,7 +419,7 @@ class CommentViewModel { | @@ -419,7 +419,7 @@ class CommentViewModel { | ||
| 419 | newModel.fromUserHeader = model.fromUserHeader | 419 | newModel.fromUserHeader = model.fromUserHeader |
| 420 | newModel.fromUserId = model.fromUserId | 420 | newModel.fromUserId = model.fromUserId |
| 421 | newModel.fromUserName = model.fromUserName | 421 | newModel.fromUserName = model.fromUserName |
| 422 | - if (model.toUserType != null) { | 422 | + if (model.fromUserType) { |
| 423 | newModel.fromUserType = model.fromUserType | 423 | newModel.fromUserType = model.fromUserType |
| 424 | } | 424 | } |
| 425 | newModel.id = model.id | 425 | newModel.id = model.id |
| @@ -443,7 +443,7 @@ class CommentViewModel { | @@ -443,7 +443,7 @@ class CommentViewModel { | ||
| 443 | // newModel.isLoading = model.isLoading | 443 | // newModel.isLoading = model.isLoading |
| 444 | 444 | ||
| 445 | 445 | ||
| 446 | - if (model.toUserType != null) { | 446 | + if (model.toUserType) { |
| 447 | newModel.toUserType = model.toUserType.toString() | 447 | newModel.toUserType = model.toUserType.toString() |
| 448 | } | 448 | } |
| 449 | newModel.topFlag = model.topFlag | 449 | newModel.topFlag = model.topFlag |
| @@ -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() |
| @@ -81,7 +81,6 @@ export struct SubscribeMessageComponent{ | @@ -81,7 +81,6 @@ export struct SubscribeMessageComponent{ | ||
| 81 | } | 81 | } |
| 82 | }) | 82 | }) |
| 83 | .width('100%') | 83 | .width('100%') |
| 84 | - .margin({bottom:px2vp(this.bottomSafeHeight)}) | ||
| 85 | } | 84 | } |
| 86 | } | 85 | } |
| 87 | .backgroundColor($r('app.color.color_F9F9F9')) | 86 | .backgroundColor($r('app.color.color_F9F9F9')) |
| @@ -113,12 +112,12 @@ export struct SubscribeMessageComponent{ | @@ -113,12 +112,12 @@ export struct SubscribeMessageComponent{ | ||
| 113 | if (!this.hasMore) { | 112 | if (!this.hasMore) { |
| 114 | ListItem() { | 113 | ListItem() { |
| 115 | ListHasNoMoreDataUI() | 114 | ListHasNoMoreDataUI() |
| 116 | - } | 115 | + }.padding({bottom:px2vp(this.bottomSafeHeight) + 10}) |
| 117 | } | 116 | } |
| 118 | }.width('100%') | 117 | }.width('100%') |
| 118 | + .edgeEffect(EdgeEffect.None) | ||
| 119 | .height("100%") | 119 | .height("100%") |
| 120 | .scrollBar(BarState.Off) | 120 | .scrollBar(BarState.Off) |
| 121 | - .layoutWeight(1) | ||
| 122 | } | 121 | } |
| 123 | 122 | ||
| 124 | getNewPageData() { | 123 | getNewPageData() { |
| @@ -63,14 +63,23 @@ export struct PeopleShipMainComponent { | @@ -63,14 +63,23 @@ export struct PeopleShipMainComponent { | ||
| 63 | if (this.viewType == ViewType.LOADING) { | 63 | if (this.viewType == ViewType.LOADING) { |
| 64 | this.LoadingLayout() | 64 | this.LoadingLayout() |
| 65 | } else if (this.viewType == ViewType.ERROR) { | 65 | } else if (this.viewType == ViewType.ERROR) { |
| 66 | - ErrorComponent() | ||
| 67 | - .onTouch(() => { | ||
| 68 | - if (this.viewType === ViewType.ERROR) { | 66 | + //缺省页 |
| 67 | + EmptyComponent({ | ||
| 68 | + emptyType: this.pageModel.emptyType, | ||
| 69 | + emptyButton: true, | ||
| 70 | + retry: () => { | ||
| 69 | this.getData() | 71 | this.getData() |
| 70 | } | 72 | } |
| 71 | }) | 73 | }) |
| 72 | } else if (this.viewType == ViewType.EMPTY) { | 74 | } else if (this.viewType == ViewType.EMPTY) { |
| 73 | - EmptyComponent() | 75 | + //缺省页 |
| 76 | + EmptyComponent({ | ||
| 77 | + emptyType: this.pageModel.emptyType, | ||
| 78 | + emptyButton: true, | ||
| 79 | + retry: () => { | ||
| 80 | + this.getData() | ||
| 81 | + } | ||
| 82 | + }) | ||
| 74 | } else { | 83 | } else { |
| 75 | if (this.followList.length == 0) { | 84 | if (this.followList.length == 0) { |
| 76 | CustomPullToRefresh({ | 85 | CustomPullToRefresh({ |
| @@ -52,9 +52,9 @@ class MineSettingDatasModel{ | @@ -52,9 +52,9 @@ class MineSettingDatasModel{ | ||
| 52 | this.mainSettingData.push(new MineMainSettingFunctionItem(null, 'wifi网络情况下自动播放视频', null, 1, videoState,"video_switch")) | 52 | this.mainSettingData.push(new MineMainSettingFunctionItem(null, 'wifi网络情况下自动播放视频', null, 1, videoState,"video_switch")) |
| 53 | let suspensionState=SPHelper.default.getSync(SpConstants.SETTING_SUSPENSION_SWITCH,false) as boolean | 53 | let suspensionState=SPHelper.default.getSync(SpConstants.SETTING_SUSPENSION_SWITCH,false) as boolean |
| 54 | this.mainSettingData.push(new MineMainSettingFunctionItem(null, '开启播放器悬浮窗', null, 1, suspensionState,"suspensionState_switch")) | 54 | this.mainSettingData.push(new MineMainSettingFunctionItem(null, '开启播放器悬浮窗', null, 1, suspensionState,"suspensionState_switch")) |
| 55 | - this.mainSettingData.push(new MineMainSettingFunctionItem(null, null, null, 2, null,"")) | 55 | + // this.mainSettingData.push(new MineMainSettingFunctionItem(null, null, null, 2, null,"")) |
| 56 | this.mainSettingData.push(new MineMainSettingFunctionItem(null, '清理缓存', '32MB', 0, false,"clear_cache")) | 56 | this.mainSettingData.push(new MineMainSettingFunctionItem(null, '清理缓存', '32MB', 0, false,"clear_cache")) |
| 57 | - this.mainSettingData.push(new MineMainSettingFunctionItem(null, '评价我们', null, 0, false,"")) | 57 | + // this.mainSettingData.push(new MineMainSettingFunctionItem(null, '评价我们', null, 0, false,"")) |
| 58 | 58 | ||
| 59 | return this.mainSettingData | 59 | return this.mainSettingData |
| 60 | } | 60 | } |
| @@ -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 |
| @@ -289,12 +289,10 @@ struct LoginPage { | @@ -289,12 +289,10 @@ struct LoginPage { | ||
| 289 | }.width('100%') | 289 | }.width('100%') |
| 290 | 290 | ||
| 291 | Row() { | 291 | Row() { |
| 292 | - Row() { | 292 | + /*Row() { |
| 293 | Image($r('app.media.login_wx')) | 293 | Image($r('app.media.login_wx')) |
| 294 | .width(20).height(20).onClick(()=>{ | 294 | .width(20).height(20).onClick(()=>{ |
| 295 | - Logger.debug("测试",'开始'+Logger.isDebug) | ||
| 296 | ErrorToastUtils.ErrorToast.showToast(ErrorToastUtils.ErrorType.NET_CORE_NO_NETWORK) | 295 | ErrorToastUtils.ErrorToast.showToast(ErrorToastUtils.ErrorType.NET_CORE_NO_NETWORK) |
| 297 | - Logger.debug("测试",'开始2'+Logger.isDebug) | ||
| 298 | }) | 296 | }) |
| 299 | }.backgroundImage($r('app.media.login_other_left'), ImageRepeat.NoRepeat) | 297 | }.backgroundImage($r('app.media.login_other_left'), ImageRepeat.NoRepeat) |
| 300 | .otherStyle() | 298 | .otherStyle() |
| @@ -307,25 +305,36 @@ struct LoginPage { | @@ -307,25 +305,36 @@ struct LoginPage { | ||
| 307 | Row() { | 305 | Row() { |
| 308 | Image($r('app.media.login_wb')).size({ width: 20, height: 20 }) | 306 | Image($r('app.media.login_wb')).size({ width: 20, height: 20 }) |
| 309 | }.backgroundImage($r('app.media.login_other_middle'), ImageRepeat.NoRepeat) | 307 | }.backgroundImage($r('app.media.login_other_middle'), ImageRepeat.NoRepeat) |
| 310 | - .otherStyle() | 308 | + .otherStyle()*/ |
| 311 | 309 | ||
| 312 | Row() { | 310 | Row() { |
| 313 | Image(this.checkCodePage ? $r('app.media.login_qt') : $r('app.media.login_other_password')) | 311 | Image(this.checkCodePage ? $r('app.media.login_qt') : $r('app.media.login_other_password')) |
| 314 | - .size({ width: 20, height: 20 }) | ||
| 315 | - }.backgroundImage($r('app.media.login_other_right'), ImageRepeat.NoRepeat) | ||
| 316 | - .otherStyle().onClick(() => { | 312 | + .size({ width: "35lpx", height: "35lpx" }) |
| 313 | + .margin({right:"8lpx"}) | ||
| 314 | + .height("38lpx") | ||
| 315 | + .width("38lpx") | ||
| 316 | + Text(this.checkCodePage ? "密码登录" : "手机号登录") | ||
| 317 | + .fontWeight(400) | ||
| 318 | + .fontColor("#3D3D3D") | ||
| 319 | + .fontSize("23lpx") | ||
| 320 | + .lineHeight("38lpx") | ||
| 321 | + } | ||
| 322 | + .onClick(() => { | ||
| 317 | this.updateAccount() | 323 | this.updateAccount() |
| 318 | this.checkCodePage = !this.checkCodePage; | 324 | this.checkCodePage = !this.checkCodePage; |
| 319 | this.passwordSwitch = true | 325 | this.passwordSwitch = true |
| 320 | this.isSubmit = false | 326 | this.isSubmit = false |
| 321 | - }) | 327 | + }).width('100%') |
| 328 | + .alignItems(VerticalAlign.Center) | ||
| 329 | + .justifyContent(FlexAlign.Center) | ||
| 322 | 330 | ||
| 323 | }.height(36) | 331 | }.height(36) |
| 324 | .width('100%') | 332 | .width('100%') |
| 325 | .padding({ left: 25, right: 25 }) | 333 | .padding({ left: 25, right: 25 }) |
| 326 | - // .justifyContent(FlexAlign.SpaceEvenly) | ||
| 327 | - .margin({ top: 24 }) | ||
| 328 | - }.width('100%').margin({ bottom: 40 }) | 334 | + .margin({ top: "46lpx" }) |
| 335 | + } | ||
| 336 | + .width('100%') | ||
| 337 | + .margin({ bottom: 40 }) | ||
| 329 | } | 338 | } |
| 330 | 339 | ||
| 331 | updateAccount(){ | 340 | updateAccount(){ |
-
Please register or login to post a comment