Showing
23 changed files
with
321 additions
and
154 deletions
| @@ -13,6 +13,11 @@ export class ContentConstants { | @@ -13,6 +13,11 @@ export class ContentConstants { | ||
| 13 | */ | 13 | */ |
| 14 | static readonly TYPE_LIVE: string = "2"; | 14 | static readonly TYPE_LIVE: string = "2"; |
| 15 | 15 | ||
| 16 | + /** | ||
| 17 | + * 3:活动 | ||
| 18 | + */ | ||
| 19 | + static readonly TYPE_Activity: string = "3"; | ||
| 20 | + | ||
| 16 | static readonly TYPE_FOUR: string = "4"; | 21 | static readonly TYPE_FOUR: string = "4"; |
| 17 | /** | 22 | /** |
| 18 | * 5:专题详情 | 23 | * 5:专题详情 |
| @@ -106,7 +106,7 @@ export class ProcessUtils { | @@ -106,7 +106,7 @@ export class ProcessUtils { | ||
| 106 | case ContentConstants.TYPE_AUDIO: | 106 | case ContentConstants.TYPE_AUDIO: |
| 107 | ProcessUtils.gotoAudio(content) | 107 | ProcessUtils.gotoAudio(content) |
| 108 | break; | 108 | break; |
| 109 | - case ContentConstants.TYPE_TELETEXT: | 109 | + case ContentConstants.TYPE_TELETEXT:case ContentConstants.TYPE_Activity: |
| 110 | // 图文详情,跳转h5 | 110 | // 图文详情,跳转h5 |
| 111 | if (content?.linkUrl) { //有 linkUrl 走专题页展示逻辑 | 111 | if (content?.linkUrl) { //有 linkUrl 走专题页展示逻辑 |
| 112 | ProcessUtils.gotoSpecialTopic(content,true) | 112 | ProcessUtils.gotoSpecialTopic(content,true) |
| @@ -6,7 +6,7 @@ export interface TopicInfo { | @@ -6,7 +6,7 @@ export interface TopicInfo { | ||
| 6 | commentFlag: number; | 6 | commentFlag: number; |
| 7 | commentPreviewFlag: number; | 7 | commentPreviewFlag: number; |
| 8 | commentShowFlag: number; | 8 | commentShowFlag: number; |
| 9 | - // frontFlag?: any; | 9 | + frontFlag: number; |
| 10 | frontLinkObject?: FrontLinkObject; | 10 | frontLinkObject?: FrontLinkObject; |
| 11 | posterFlag: number; | 11 | posterFlag: number; |
| 12 | posterUrl: string; | 12 | posterUrl: string; |
| @@ -16,6 +16,8 @@ export { LikeComponent } from "./src/main/ets/components/view/LikeComponent" | @@ -16,6 +16,8 @@ export { LikeComponent } from "./src/main/ets/components/view/LikeComponent" | ||
| 16 | 16 | ||
| 17 | export { TopNavigationComponent } from "./src/main/ets/components/page/TopNavigationComponent" | 17 | export { TopNavigationComponent } from "./src/main/ets/components/page/TopNavigationComponent" |
| 18 | 18 | ||
| 19 | +export { TopNavigationComponentNew } from "./src/main/ets/components/page/TopNavigationComponentNew" | ||
| 20 | + | ||
| 19 | export { LabelComponent } from "./src/main/ets/components/view/LabelComponent" | 21 | export { LabelComponent } from "./src/main/ets/components/view/LabelComponent" |
| 20 | 22 | ||
| 21 | export { BannerComponent } from "./src/main/ets/components/view/BannerComponent" | 23 | export { BannerComponent } from "./src/main/ets/components/view/BannerComponent" |
| @@ -23,6 +23,9 @@ import { PeopleShipMainViewModel } from '../../viewmodel/PeopleShipMainViewModel | @@ -23,6 +23,9 @@ import { PeopleShipMainViewModel } from '../../viewmodel/PeopleShipMainViewModel | ||
| 23 | import { AudioSuspensionModel } from '../../viewmodel/AudioSuspensionModel' | 23 | import { AudioSuspensionModel } from '../../viewmodel/AudioSuspensionModel' |
| 24 | import { viewColumInsightIntentShare } from '../../utils/InsightIntentShare' | 24 | import { viewColumInsightIntentShare } from '../../utils/InsightIntentShare' |
| 25 | import { common } from '@kit.AbilityKit'; | 25 | import { common } from '@kit.AbilityKit'; |
| 26 | +import TrackingPageBrowseUtils from '../../utils/TrackingPageBrowseUtils' | ||
| 27 | +import {TrackConstants,TrackParamConvert}from 'wdTracking/Index' | ||
| 28 | +import { ColorUtils } from '../../utils/ColorUtils'; | ||
| 26 | 29 | ||
| 27 | const TAG = 'MorningEveningPaperComponent'; | 30 | const TAG = 'MorningEveningPaperComponent'; |
| 28 | 31 | ||
| @@ -200,13 +203,18 @@ export struct MorningEveningPaperComponent { | @@ -200,13 +203,18 @@ export struct MorningEveningPaperComponent { | ||
| 200 | 203 | ||
| 201 | const imageSource: image.ImageSource | undefined = await getPicture(imageUrl) | 204 | const imageSource: image.ImageSource | undefined = await getPicture(imageUrl) |
| 202 | 205 | ||
| 203 | - if (imageSource) { | 206 | + if (imageSource && this.pageInfoBean.topicInfo.frontFlag === 1) { |
| 204 | this.pickColor(imageSource) | 207 | this.pickColor(imageSource) |
| 205 | 208 | ||
| 206 | } else { | 209 | } else { |
| 207 | - this.mixedBgColor = this.pageInfoBean.backgroundColor | 210 | + if (this.pageInfoBean.topicInfo.topicPattern === 1) { |
| 211 | + this.mixedBgColor = '#66BDBD' | ||
| 212 | + }else if(this.pageInfoBean.topicInfo.topicPattern === 2){ | ||
| 213 | + this.mixedBgColor = '#E78E17' | ||
| 214 | + }else { | ||
| 215 | + this.mixedBgColor = '#2F2170' | ||
| 216 | + } | ||
| 208 | } | 217 | } |
| 209 | - | ||
| 210 | } | 218 | } |
| 211 | 219 | ||
| 212 | private async pickColor(imageSource: image.ImageSource | undefined) { | 220 | private async pickColor(imageSource: image.ImageSource | undefined) { |
| @@ -216,6 +224,7 @@ export struct MorningEveningPaperComponent { | @@ -216,6 +224,7 @@ export struct MorningEveningPaperComponent { | ||
| 216 | let color = colorPicker.getMainColorSync(); | 224 | let color = colorPicker.getMainColorSync(); |
| 217 | Logger.debug(TAG, "compInfoBean compStyle = " + color) | 225 | Logger.debug(TAG, "compInfoBean compStyle = " + color) |
| 218 | 226 | ||
| 227 | + color = ColorUtils.getMorningEveningPaperRgb({red:color.red,green:color.green,blue:color.blue,alpha:color.alpha}) | ||
| 219 | // 将取色器选取的color示例转换为十六进制颜色代码 | 228 | // 将取色器选取的color示例转换为十六进制颜色代码 |
| 220 | this.mixedBgColor = "#" + color.alpha.toString(16) + color.red.toString(16) + color.green.toString(16) + color.blue.toString(16); | 229 | this.mixedBgColor = "#" + color.alpha.toString(16) + color.red.toString(16) + color.green.toString(16) + color.blue.toString(16); |
| 221 | Logger.debug(TAG, "compInfoBean compStyle = " + this.mixedBgColor) | 230 | Logger.debug(TAG, "compInfoBean compStyle = " + this.mixedBgColor) |
| @@ -230,9 +239,15 @@ export struct MorningEveningPaperComponent { | @@ -230,9 +239,15 @@ export struct MorningEveningPaperComponent { | ||
| 230 | // WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', }) | 239 | // WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', }) |
| 231 | } | 240 | } |
| 232 | 241 | ||
| 242 | + onPageShow(){ | ||
| 243 | + TrackingPageBrowseUtils.TrackingPageBrowseExposureStart() | ||
| 244 | + } | ||
| 245 | + | ||
| 233 | onPageHide() { | 246 | onPageHide() { |
| 234 | this.status = PlayerConstants.STATUS_PAUSE; | 247 | this.status = PlayerConstants.STATUS_PAUSE; |
| 235 | this.playerController?.pause(); | 248 | this.playerController?.pause(); |
| 249 | + | ||
| 250 | + TrackingPageBrowseUtils.TrackingPageBrowseExposureEnd('','',TrackParamConvert.pageInfoBean_ParamType(this.pageInfoBean)) | ||
| 236 | } | 251 | } |
| 237 | 252 | ||
| 238 | build() { | 253 | build() { |
| 1 | -import { FrontLinkObject } from 'wdBean'; | 1 | +import { ContentDTO, FrontLinkObject } from 'wdBean'; |
| 2 | +import { ProcessUtils } from 'wdRouter/Index'; | ||
| 2 | 3 | ||
| 3 | /** | 4 | /** |
| 4 | * 早晚报,topic | 5 | * 早晚报,topic |
| @@ -47,7 +48,15 @@ export struct topicInfoView { | @@ -47,7 +48,15 @@ export struct topicInfoView { | ||
| 47 | .backgroundColor($r('app.color.color_99636363')) | 48 | .backgroundColor($r('app.color.color_99636363')) |
| 48 | .margin({ top: 8, left: 16, right: 16, bottom: 16 }) | 49 | .margin({ top: 8, left: 16, right: 16, bottom: 16 }) |
| 49 | .borderRadius(2) | 50 | .borderRadius(2) |
| 50 | - // .backgroundColor(Color.Red) | 51 | + .onClick(()=>{ |
| 52 | + if (this.frontLinkObject) { | ||
| 53 | + let contentDTO :ContentDTO = new ContentDTO(); | ||
| 54 | + contentDTO.objectType = this.frontLinkObject?.newsType.toString() | ||
| 55 | + contentDTO.objectId = this.frontLinkObject?.newsId | ||
| 56 | + contentDTO.linkUrl = this.frontLinkObject?.linkUrl | ||
| 57 | + ProcessUtils.processPage(contentDTO) | ||
| 58 | + } | ||
| 59 | + }) | ||
| 51 | .alignRules({ | 60 | .alignRules({ |
| 52 | left: { anchor: "__container__", align: HorizontalAlign.Start }, | 61 | left: { anchor: "__container__", align: HorizontalAlign.Start }, |
| 53 | bottom: { anchor: "__container__", align: VerticalAlign.Bottom } | 62 | bottom: { anchor: "__container__", align: VerticalAlign.Bottom } |
| @@ -138,6 +138,7 @@ export struct SpacialTopicPageComponent { | @@ -138,6 +138,7 @@ export struct SpacialTopicPageComponent { | ||
| 138 | contentDetailData: this.contentDetailData, | 138 | contentDetailData: this.contentDetailData, |
| 139 | publishCommentModel: this.publishCommentModel, | 139 | publishCommentModel: this.publishCommentModel, |
| 140 | operationButtonList: this.operationButtonList, | 140 | operationButtonList: this.operationButtonList, |
| 141 | + styleType: 1, | ||
| 141 | }) | 142 | }) |
| 142 | } | 143 | } |
| 143 | }.width(CommonConstants.FULL_WIDTH).height(CommonConstants.FULL_HEIGHT) | 144 | }.width(CommonConstants.FULL_WIDTH).height(CommonConstants.FULL_HEIGHT) |
| @@ -40,9 +40,9 @@ export struct Card11Component { | @@ -40,9 +40,9 @@ export struct Card11Component { | ||
| 40 | Column() { | 40 | Column() { |
| 41 | Stack() { | 41 | Stack() { |
| 42 | if (this.contentDTO.newTags) { | 42 | if (this.contentDTO.newTags) { |
| 43 | - Notes({ newTags: this.contentDTO.newTags }).height(27).align(Alignment.Center) | 43 | + Notes({ newTags: this.contentDTO.newTags }).height(30).align(Alignment.Center) |
| 44 | } else if (this.contentDTO.objectType == '5') { | 44 | } else if (this.contentDTO.objectType == '5') { |
| 45 | - Notes({ objectType: this.contentDTO.objectType }).height(27).align(Alignment.Center) | 45 | + Notes({ objectType: this.contentDTO.objectType }).height(30).align(Alignment.Center) |
| 46 | } | 46 | } |
| 47 | Text() { | 47 | Text() { |
| 48 | if (this.titleMarked) { | 48 | if (this.titleMarked) { |
| @@ -49,9 +49,11 @@ export struct Card2Component { | @@ -49,9 +49,11 @@ export struct Card2Component { | ||
| 49 | Stack() { | 49 | Stack() { |
| 50 | //新闻标题 | 50 | //新闻标题 |
| 51 | if (this.contentDTO.newTags) { | 51 | if (this.contentDTO.newTags) { |
| 52 | - Notes({ newTags: this.contentDTO.newTags }) | 52 | + Notes({ newTags: this.contentDTO.newTags }).height(30).align(Alignment.Center) |
| 53 | + //Notes({ newTags: this.contentDTO.newTags }) | ||
| 53 | } else if (this.contentDTO.objectType == '5') { | 54 | } else if (this.contentDTO.objectType == '5') { |
| 54 | - Notes({ objectType: this.contentDTO.objectType }) | 55 | + Notes({ objectType: this.contentDTO.objectType }).height(30).align(Alignment.Center) |
| 56 | + //Notes({ objectType: this.contentDTO.objectType }) | ||
| 55 | } | 57 | } |
| 56 | 58 | ||
| 57 | Text() { | 59 | Text() { |
| @@ -45,29 +45,32 @@ export struct Card4Component { | @@ -45,29 +45,32 @@ export struct Card4Component { | ||
| 45 | Column() { | 45 | Column() { |
| 46 | //body | 46 | //body |
| 47 | Column() { | 47 | Column() { |
| 48 | - //新闻标题 | ||
| 49 | - if (this.contentDTO.newTags) { | ||
| 50 | - Notes({ newTags: this.contentDTO.newTags }) | ||
| 51 | - } else if (this.contentDTO.objectType == '5') { | ||
| 52 | - Notes({ objectType: this.contentDTO.objectType }) | ||
| 53 | - } | ||
| 54 | - Text() { | ||
| 55 | - if (this.titleMarked) { | ||
| 56 | - Span(this.str01) | ||
| 57 | - Span(this.str02) | ||
| 58 | - .fontColor(0xED2800) | ||
| 59 | - Span(this.str03) | ||
| 60 | - } else { | ||
| 61 | - Span(this.contentDTO.newsTitle) | 48 | + Stack() { |
| 49 | + if (this.contentDTO.newTags) { | ||
| 50 | + Notes({ newTags: this.contentDTO.newTags }).height(19).align(Alignment.Center) | ||
| 51 | + } else if (this.contentDTO.objectType == '5') { | ||
| 52 | + Notes({ objectType: this.contentDTO.objectType }).height(19).align(Alignment.Center) | ||
| 53 | + } | ||
| 54 | + Text() { | ||
| 55 | + if (this.titleMarked) { | ||
| 56 | + Span(this.str01) | ||
| 57 | + Span(this.str02) | ||
| 58 | + .fontColor(0xED2800) | ||
| 59 | + Span(this.str03) | ||
| 60 | + } else { | ||
| 61 | + Span(this.contentDTO.newsTitle) | ||
| 62 | + } | ||
| 62 | } | 63 | } |
| 63 | - } | ||
| 64 | .fontSize($r('app.float.font_size_18')) | 64 | .fontSize($r('app.float.font_size_18')) |
| 65 | .fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222')) | 65 | .fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222')) |
| 66 | .maxLines(3) | 66 | .maxLines(3) |
| 67 | .textOverflow({ overflow: TextOverflow.Ellipsis }) | 67 | .textOverflow({ overflow: TextOverflow.Ellipsis }) |
| 68 | - .textIndent(this.contentDTO.newTags?.length < 5 && this.contentDTO.newTags?.length > 2 ? 58 : | ||
| 69 | - (this.contentDTO.newTags?.length != 0 && this.contentDTO.newTags?.length) || | ||
| 70 | - this.contentDTO.objectType == '5' ? 30 : 0) | 68 | + .textIndent(this.contentDTO.newTags?.length < 5 && this.contentDTO.newTags?.length > 2 ? 58 : |
| 69 | + (this.contentDTO.newTags?.length != 0 && this.contentDTO.newTags?.length) || | ||
| 70 | + this.contentDTO.objectType == '5' ? 30 : 0) | ||
| 71 | + }.alignContent(Alignment.TopStart) | ||
| 72 | + //新闻标题 | ||
| 73 | + | ||
| 71 | //三图 | 74 | //三图 |
| 72 | Stack(){ | 75 | Stack(){ |
| 73 | Row() { | 76 | Row() { |
| @@ -38,25 +38,32 @@ export struct AppointmentListChildComponent { | @@ -38,25 +38,32 @@ export struct AppointmentListChildComponent { | ||
| 38 | .interpolation(ImageInterpolation.High) | 38 | .interpolation(ImageInterpolation.High) |
| 39 | 39 | ||
| 40 | 40 | ||
| 41 | - if (this.item.relType === 1) { | 41 | + if (this.item.status == "wait") { |
| 42 | Row() { | 42 | Row() { |
| 43 | Row() { | 43 | Row() { |
| 44 | Image($r('app.media.reserve_icon')) | 44 | Image($r('app.media.reserve_icon')) |
| 45 | - .width('42lpx') | ||
| 46 | - .height('35lpx') | 45 | + .width('27lpx') |
| 46 | + .height('27lpx') | ||
| 47 | .objectFit(ImageFit.Auto) | 47 | .objectFit(ImageFit.Auto) |
| 48 | .interpolation(ImageInterpolation.High) | 48 | .interpolation(ImageInterpolation.High) |
| 49 | + .margin({right:"6lpx"}) | ||
| 49 | 50 | ||
| 50 | Text("预约") | 51 | Text("预约") |
| 51 | .fontWeight(400) | 52 | .fontWeight(400) |
| 52 | - .fontSize('21lpx') | ||
| 53 | - .backgroundColor($r('app.color.color_4D000000')) | 53 | + .fontSize('23lpx') |
| 54 | + .textShadow({ | ||
| 55 | + radius: 2, | ||
| 56 | + color: `rgba(0,0,0,0.3)`, | ||
| 57 | + offsetY:2, | ||
| 58 | + offsetX:0 | ||
| 59 | + }) | ||
| 54 | .fontColor($r('app.color.white')) | 60 | .fontColor($r('app.color.white')) |
| 55 | .lineHeight('31lpx') | 61 | .lineHeight('31lpx') |
| 56 | .layoutWeight(1) | 62 | .layoutWeight(1) |
| 57 | - .textAlign(TextAlign.Center) | 63 | + .textAlign(TextAlign.Start) |
| 58 | }.width('94lpx') | 64 | }.width('94lpx') |
| 59 | .margin({ bottom: '15lpx', right: '15lpx' }) | 65 | .margin({ bottom: '15lpx', right: '15lpx' }) |
| 66 | + .alignItems(VerticalAlign.Center) | ||
| 60 | }.width('100%') | 67 | }.width('100%') |
| 61 | .height('100%') | 68 | .height('100%') |
| 62 | .alignItems(VerticalAlign.Bottom) | 69 | .alignItems(VerticalAlign.Bottom) |
| @@ -78,7 +85,7 @@ export struct AppointmentListChildComponent { | @@ -78,7 +85,7 @@ export struct AppointmentListChildComponent { | ||
| 78 | .width('100%') | 85 | .width('100%') |
| 79 | Row() { | 86 | Row() { |
| 80 | Row() { | 87 | Row() { |
| 81 | - if (this.item.relType === 2) { | 88 | + if (this.item.status == "end") { |
| 82 | Image($r('app.media.play_status_history_icon')) | 89 | Image($r('app.media.play_status_history_icon')) |
| 83 | .objectFit(ImageFit.Auto) | 90 | .objectFit(ImageFit.Auto) |
| 84 | .interpolation(ImageInterpolation.High) | 91 | .interpolation(ImageInterpolation.High) |
| @@ -88,6 +95,16 @@ export struct AppointmentListChildComponent { | @@ -88,6 +95,16 @@ export struct AppointmentListChildComponent { | ||
| 88 | Text('已结束').fontColor($r('app.color.color_999999')) | 95 | Text('已结束').fontColor($r('app.color.color_999999')) |
| 89 | .fontWeight('500lpx') | 96 | .fontWeight('500lpx') |
| 90 | .fontSize('23lpx') | 97 | .fontSize('23lpx') |
| 98 | + }else if(this.item.status == "running"){ | ||
| 99 | + Image($r('app.media.play_status_icon')) | ||
| 100 | + .objectFit(ImageFit.Auto) | ||
| 101 | + .interpolation(ImageInterpolation.High) | ||
| 102 | + .width('38lpx') | ||
| 103 | + .height('38lpx') | ||
| 104 | + .margin({ right: '12lpx' }) | ||
| 105 | + Text('已开始').fontColor($r('app.color.color_999999')) | ||
| 106 | + .fontWeight('500lpx') | ||
| 107 | + .fontSize('23lpx') | ||
| 91 | } else { | 108 | } else { |
| 92 | Image($r('app.media.play_status_icon')) | 109 | Image($r('app.media.play_status_icon')) |
| 93 | .objectFit(ImageFit.Auto) | 110 | .objectFit(ImageFit.Auto) |
| @@ -118,7 +135,7 @@ export struct AppointmentListChildComponent { | @@ -118,7 +135,7 @@ export struct AppointmentListChildComponent { | ||
| 118 | 135 | ||
| 119 | Blank() | 136 | Blank() |
| 120 | .layoutWeight(1) | 137 | .layoutWeight(1) |
| 121 | - if (this.item.relType === 1) { | 138 | + if (this.item.status === "wait") { |
| 122 | Text(this.item.isAppointment ? "已预约" : "预约") | 139 | Text(this.item.isAppointment ? "已预约" : "预约") |
| 123 | .fontWeight(400) | 140 | .fontWeight(400) |
| 124 | .fontSize('23lpx') | 141 | .fontSize('23lpx') |
| @@ -132,8 +149,19 @@ export struct AppointmentListChildComponent { | @@ -132,8 +149,19 @@ export struct AppointmentListChildComponent { | ||
| 132 | .onClick(() => { | 149 | .onClick(() => { |
| 133 | this.dialogController.open() | 150 | this.dialogController.open() |
| 134 | }) | 151 | }) |
| 152 | + }else if(this.item.status == "running"){ | ||
| 153 | + Text("去观看" ) | ||
| 154 | + .fontWeight(400) | ||
| 155 | + .fontSize('23lpx') | ||
| 156 | + .backgroundColor($r('app.color.color_ED2800')) | ||
| 157 | + .fontColor($r('app.color.white')) | ||
| 158 | + .lineHeight('31lpx') | ||
| 159 | + .textAlign(TextAlign.Center) | ||
| 160 | + .width('100lpx') | ||
| 161 | + .height('46lpx') | ||
| 162 | + .borderRadius('6lpx') | ||
| 135 | } else { | 163 | } else { |
| 136 | - Text(this.item.relType === 2 ? "去观看" : "看回放") | 164 | + Text("看回放") |
| 137 | .fontWeight(400) | 165 | .fontWeight(400) |
| 138 | .fontSize('23lpx') | 166 | .fontSize('23lpx') |
| 139 | .backgroundColor($r('app.color.color_ED2800')) | 167 | .backgroundColor($r('app.color.color_ED2800')) |
| @@ -7,17 +7,20 @@ import MinePageDatasModel from '../../../model/MinePageDatasModel'; | @@ -7,17 +7,20 @@ import MinePageDatasModel from '../../../model/MinePageDatasModel'; | ||
| 7 | import { EmptyComponent } from '../../view/EmptyComponent'; | 7 | import { EmptyComponent } from '../../view/EmptyComponent'; |
| 8 | import { Action } from 'wdBean/Index'; | 8 | import { Action } from 'wdBean/Index'; |
| 9 | import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; | 9 | import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; |
| 10 | +import { CustomPullToRefresh } from '../../reusable/CustomPullToRefresh'; | ||
| 10 | 11 | ||
| 11 | const TAG = "AppointmentListUI" | 12 | const TAG = "AppointmentListUI" |
| 12 | 13 | ||
| 13 | @Component | 14 | @Component |
| 14 | export struct AppointmentListUI { | 15 | export struct AppointmentListUI { |
| 15 | @State data: LazyDataSource<MineAppointmentItem> = new LazyDataSource(); | 16 | @State data: LazyDataSource<MineAppointmentItem> = new LazyDataSource(); |
| 17 | + @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 | ||
| 16 | @State count: number = 0; | 18 | @State count: number = 0; |
| 17 | @State isLoading: boolean = false | 19 | @State isLoading: boolean = false |
| 18 | @State hasMore: boolean = true | 20 | @State hasMore: boolean = true |
| 19 | curPageNum: number = 1; | 21 | curPageNum: number = 1; |
| 20 | @State isGetRequest: boolean = false | 22 | @State isGetRequest: boolean = false |
| 23 | + private scroller: Scroller = new Scroller(); | ||
| 21 | 24 | ||
| 22 | aboutToAppear() { | 25 | aboutToAppear() { |
| 23 | this.getNewPageData() | 26 | this.getNewPageData() |
| @@ -26,7 +29,7 @@ export struct AppointmentListUI { | @@ -26,7 +29,7 @@ export struct AppointmentListUI { | ||
| 26 | build() { | 29 | build() { |
| 27 | Column() { | 30 | Column() { |
| 28 | //标题栏目 | 31 | //标题栏目 |
| 29 | - CustomTitleUI({ titleName: "预约列表" }) | 32 | + CustomTitleUI({ titleName: "我的预约" }) |
| 30 | if (this.count == 0) { | 33 | if (this.count == 0) { |
| 31 | if (this.isGetRequest == true) { | 34 | if (this.isGetRequest == true) { |
| 32 | EmptyComponent({ emptyType: 10 }) | 35 | EmptyComponent({ emptyType: 10 }) |
| @@ -35,45 +38,29 @@ export struct AppointmentListUI { | @@ -35,45 +38,29 @@ export struct AppointmentListUI { | ||
| 35 | } | 38 | } |
| 36 | 39 | ||
| 37 | } else { | 40 | } else { |
| 38 | - //刷新控件 TODO | ||
| 39 | - //List | ||
| 40 | - List({ space: '6lpx' }) { | ||
| 41 | - LazyForEach(this.data, (item: MineAppointmentItem, index: number) => { | ||
| 42 | - ListItem() { | ||
| 43 | - AppointmentListChildComponent({ item: item }) | ||
| 44 | - } | ||
| 45 | - .onClick(() => { | ||
| 46 | - //TODO 跳转 | ||
| 47 | - let action = { | ||
| 48 | - type:"2", | ||
| 49 | - params:{ | ||
| 50 | - extra:{ | ||
| 51 | - relId:item.relId, | ||
| 52 | - relType:item.relType.toString() | ||
| 53 | - }, | ||
| 54 | - contentID:item.liveId.toString() | ||
| 55 | - } | ||
| 56 | - } as Action | ||
| 57 | - WDRouterRule.jumpWithPage(WDRouterPage.detailPlayLiveCommon, action) | ||
| 58 | - }) | ||
| 59 | - }, (item: MineAppointmentItem, index: number) => index.toString()) | ||
| 60 | 41 | ||
| 61 | - //没有更多数据 显示提示 | ||
| 62 | - if (!this.hasMore) { | ||
| 63 | - ListItem() { | ||
| 64 | - ListHasNoMoreDataUI() | 42 | + CustomPullToRefresh({ |
| 43 | + alldata:this.data, | ||
| 44 | + scroller:this.scroller, | ||
| 45 | + customList:()=>{ | ||
| 46 | + this.ListLayout() | ||
| 47 | + }, | ||
| 48 | + onRefresh:(resolve)=>{ | ||
| 49 | + this.curPageNum = 1; | ||
| 50 | + this.hasMore = true | ||
| 51 | + this.isGetRequest = false | ||
| 52 | + this.data.clear() | ||
| 53 | + | ||
| 54 | + if (!this.isLoading){ | ||
| 55 | + this.getNewPageData() | ||
| 56 | + if(resolve) resolve('刷新成功') | ||
| 57 | + } | ||
| 58 | + }, | ||
| 59 | + onLoadMore:(resolve)=> { | ||
| 60 | + if (!this.isLoading) { | ||
| 61 | + this.isLoading = true | ||
| 62 | + this.getNewPageData() | ||
| 65 | } | 63 | } |
| 66 | - } | ||
| 67 | - } | ||
| 68 | - .cachedCount(4) | ||
| 69 | - .scrollBar(BarState.Off) | ||
| 70 | - .margin({ top: '23lpx', left: '23lpx', right: '23lpx' }) | ||
| 71 | - .layoutWeight(1) | ||
| 72 | - .onReachEnd(() => { | ||
| 73 | - console.log(TAG, "触底了"); | ||
| 74 | - if (!this.isLoading) { | ||
| 75 | - //加载分页数据 | ||
| 76 | - this.getNewPageData() | ||
| 77 | } | 64 | } |
| 78 | }) | 65 | }) |
| 79 | } | 66 | } |
| @@ -83,6 +70,42 @@ export struct AppointmentListUI { | @@ -83,6 +70,42 @@ export struct AppointmentListUI { | ||
| 83 | .width('100%') | 70 | .width('100%') |
| 84 | } | 71 | } |
| 85 | 72 | ||
| 73 | + @Builder ListLayout(){ | ||
| 74 | + List({ space:6,scroller: this.scroller }) { | ||
| 75 | + LazyForEach(this.data, (item: MineAppointmentItem, index: number) => { | ||
| 76 | + ListItem() { | ||
| 77 | + AppointmentListChildComponent({ item: item }) | ||
| 78 | + } | ||
| 79 | + .onClick(() => { | ||
| 80 | + //TODO 跳转 | ||
| 81 | + let action = { | ||
| 82 | + type:"2", | ||
| 83 | + params:{ | ||
| 84 | + extra:{ | ||
| 85 | + relId:item.relId, | ||
| 86 | + relType:item.relType.toString() | ||
| 87 | + }, | ||
| 88 | + contentID:item.liveId.toString() | ||
| 89 | + } | ||
| 90 | + } as Action | ||
| 91 | + WDRouterRule.jumpWithPage(WDRouterPage.detailPlayLiveCommon, action) | ||
| 92 | + }) | ||
| 93 | + }, (item: MineAppointmentItem, index: number) => index.toString()) | ||
| 94 | + | ||
| 95 | + //没有更多数据 显示提示 | ||
| 96 | + if (!this.hasMore) { | ||
| 97 | + ListItem() { | ||
| 98 | + ListHasNoMoreDataUI() | ||
| 99 | + }.padding({bottom:px2vp(this.bottomSafeHeight) + 20}) | ||
| 100 | + } | ||
| 101 | + } | ||
| 102 | + .cachedCount(4) | ||
| 103 | + .scrollBar(BarState.Off) | ||
| 104 | + .edgeEffect(EdgeEffect.None) | ||
| 105 | + .margin({ top: '23lpx', left: '23lpx', right: '23lpx'}) | ||
| 106 | + .layoutWeight(1) | ||
| 107 | + } | ||
| 108 | + | ||
| 86 | getNewPageData() { | 109 | getNewPageData() { |
| 87 | this.isLoading = true | 110 | this.isLoading = true |
| 88 | if (this.hasMore) { | 111 | if (this.hasMore) { |
| @@ -460,9 +460,19 @@ export struct TopNavigationComponent { | @@ -460,9 +460,19 @@ export struct TopNavigationComponent { | ||
| 460 | } | 460 | } |
| 461 | 461 | ||
| 462 | /** | 462 | /** |
| 463 | + * 判断是否当前页面处理逻辑,如消息通知,只需要切换到当前底导的处理,过滤掉非当前。 | ||
| 464 | + */ | ||
| 465 | + private isCurrentPage(): boolean { | ||
| 466 | + return this._currentNavIndex === this.navIndex | ||
| 467 | + } | ||
| 468 | + | ||
| 469 | + /** | ||
| 463 | * 频道id变化,即指定频道跳转场景 | 470 | * 频道id变化,即指定频道跳转场景 |
| 464 | */ | 471 | */ |
| 465 | onAssignChannelChange() { | 472 | onAssignChannelChange() { |
| 473 | + if (!this.isCurrentPage()) { | ||
| 474 | + return | ||
| 475 | + } | ||
| 466 | let channelId = this.assignChannel.channelId | 476 | let channelId = this.assignChannel.channelId |
| 467 | let index = -1 | 477 | let index = -1 |
| 468 | if (this._currentNavIndex === 0) { | 478 | if (this._currentNavIndex === 0) { |
| @@ -72,68 +72,70 @@ export struct TopNavigationComponentNew { | @@ -72,68 +72,70 @@ export struct TopNavigationComponentNew { | ||
| 72 | private tabsWidth: number = 0 | 72 | private tabsWidth: number = 0 |
| 73 | 73 | ||
| 74 | build() { | 74 | build() { |
| 75 | - // 频道分类list | ||
| 76 | - RelativeContainer() { | ||
| 77 | - this.tabBar() | ||
| 78 | - Swiper(this.swiperController) { | ||
| 79 | - ForEach(this.currentBottomNavName === '新闻' ? this.myChannelList : this.topNavList, | ||
| 80 | - (navItem: TopNavDTO, index: number) => { | ||
| 81 | - if (this.currentBottomNavName === '人民号' && navItem.name === '关注') { | ||
| 82 | - PeopleShipMainComponent({ | ||
| 83 | - currentTopNavSelectedIndex: $currentTopNavSelectedIndex, | ||
| 84 | - navIndex: index, | ||
| 85 | - pageId: navItem.pageId + '', | ||
| 86 | - channelId: navItem.channelId + '', | ||
| 87 | - }) | ||
| 88 | - } else | ||
| 89 | - if (!this.isBroadcast(navItem) && !this.isLayout(navItem)) { | ||
| 90 | - PageComponent({ | 75 | + Column() { |
| 76 | + // 频道分类list | ||
| 77 | + RelativeContainer() { | ||
| 78 | + this.tabBar() | ||
| 79 | + Swiper(this.swiperController) { | ||
| 80 | + ForEach(this.currentBottomNavName === '新闻' ? this.myChannelList : this.topNavList, | ||
| 81 | + (navItem: TopNavDTO, index: number) => { | ||
| 82 | + if (this.currentBottomNavName === '人民号' && navItem.name === '关注') { | ||
| 83 | + PeopleShipMainComponent({ | ||
| 91 | currentTopNavSelectedIndex: $currentTopNavSelectedIndex, | 84 | currentTopNavSelectedIndex: $currentTopNavSelectedIndex, |
| 92 | navIndex: index, | 85 | navIndex: index, |
| 93 | pageId: navItem.pageId + '', | 86 | pageId: navItem.pageId + '', |
| 94 | channelId: navItem.channelId + '', | 87 | channelId: navItem.channelId + '', |
| 95 | - autoRefresh: this.autoRefresh2Page | ||
| 96 | }) | 88 | }) |
| 97 | - } else { | ||
| 98 | - channelSkeleton() | 89 | + } else |
| 90 | + if (!this.isBroadcast(navItem) && !this.isLayout(navItem)) { | ||
| 91 | + PageComponent({ | ||
| 92 | + currentTopNavSelectedIndex: $currentTopNavSelectedIndex, | ||
| 93 | + navIndex: index, | ||
| 94 | + pageId: navItem.pageId + '', | ||
| 95 | + channelId: navItem.channelId + '', | ||
| 96 | + autoRefresh: this.autoRefresh2Page | ||
| 97 | + }) | ||
| 98 | + } else { | ||
| 99 | + channelSkeleton() | ||
| 100 | + } | ||
| 101 | + }) | ||
| 102 | + } | ||
| 103 | + .loop(false) | ||
| 104 | + .indicator(false) | ||
| 105 | + .effectMode(EdgeEffect.None) | ||
| 106 | + .index(this.currentTopNavSelectedIndex) | ||
| 107 | + .cachedCount(0) | ||
| 108 | + .id('pageContent') | ||
| 109 | + .alignRules({ | ||
| 110 | + 'top': { 'anchor': 'tabList', 'align': VerticalAlign.Bottom }, | ||
| 111 | + 'middle': { 'anchor': '__container__', 'align': HorizontalAlign.Center }, | ||
| 112 | + 'bottom': { 'anchor': '__container__', 'align': VerticalAlign.Bottom } | ||
| 113 | + }) | ||
| 114 | + .onChange((index) => { | ||
| 115 | + Logger.info(TAG, `onChange index : ${index}`); | ||
| 116 | + if (this.isBroadcastByIndex(index)) { | ||
| 117 | + // 跳转到播报页面 | ||
| 118 | + ProcessUtils.gotoBroadcastPage(this.myChannelList[index].pageId) | ||
| 119 | + let nextIndex = this.currentTopNavSelectedIndex > index ? index - 1 : index + 1 | ||
| 120 | + if (nextIndex < this.myChannelList.length) { | ||
| 121 | + this.changePage(nextIndex) | ||
| 99 | } | 122 | } |
| 100 | - }) | ||
| 101 | - } | ||
| 102 | - .loop(false) | ||
| 103 | - .indicator(false) | ||
| 104 | - .effectMode(EdgeEffect.None) | ||
| 105 | - .index(this.currentTopNavSelectedIndex) | ||
| 106 | - .cachedCount(0) | ||
| 107 | - .id('pageContent') | ||
| 108 | - .alignRules({ | ||
| 109 | - 'top': { 'anchor': 'tabList', 'align': VerticalAlign.Bottom }, | ||
| 110 | - 'middle': { 'anchor': '__container__', 'align': HorizontalAlign.Center }, | ||
| 111 | - 'bottom': { 'anchor': '__container__', 'align': VerticalAlign.Bottom } | ||
| 112 | - }) | ||
| 113 | - .onChange((index) => { | ||
| 114 | - Logger.info(TAG, `onChange index : ${index}`); | ||
| 115 | - if (this.isBroadcastByIndex(index)) { | ||
| 116 | - // 跳转到播报页面 | ||
| 117 | - ProcessUtils.gotoBroadcastPage(this.myChannelList[index].pageId) | ||
| 118 | - let nextIndex = this.currentTopNavSelectedIndex > index ? index - 1 : index + 1 | ||
| 119 | - if (nextIndex < this.myChannelList.length) { | ||
| 120 | - this.changePage(nextIndex) | ||
| 121 | - } | ||
| 122 | - } else if (this.isLayoutByIndex(index)) { | ||
| 123 | - ProcessUtils.gotoENewsPaper() | ||
| 124 | - let nextIndex = this.currentTopNavSelectedIndex > index ? index - 1 : index + 1 | ||
| 125 | - if (nextIndex < this.myChannelList.length) { | ||
| 126 | - this.changePage(nextIndex) | 123 | + } else if (this.isLayoutByIndex(index)) { |
| 124 | + ProcessUtils.gotoENewsPaper() | ||
| 125 | + let nextIndex = this.currentTopNavSelectedIndex > index ? index - 1 : index + 1 | ||
| 126 | + if (nextIndex < this.myChannelList.length) { | ||
| 127 | + this.changePage(nextIndex) | ||
| 128 | + } | ||
| 129 | + } else { | ||
| 130 | + this.currentTopNavSelectedIndex = index; | ||
| 131 | + this.changePage(this.currentTopNavSelectedIndex) | ||
| 127 | } | 132 | } |
| 128 | - } else { | ||
| 129 | - this.currentTopNavSelectedIndex = index; | ||
| 130 | - this.changePage(this.currentTopNavSelectedIndex) | ||
| 131 | - } | ||
| 132 | 133 | ||
| 133 | - }) | 134 | + }) |
| 135 | + } | ||
| 136 | + .width('100%') | ||
| 137 | + .height('100%') | ||
| 134 | } | 138 | } |
| 135 | - .width('100%') | ||
| 136 | - .height('100%') | ||
| 137 | } | 139 | } |
| 138 | 140 | ||
| 139 | @Builder | 141 | @Builder |
| @@ -316,7 +318,7 @@ export struct TopNavigationComponentNew { | @@ -316,7 +318,7 @@ export struct TopNavigationComponentNew { | ||
| 316 | bottom: 2, | 318 | bottom: 2, |
| 317 | }) | 319 | }) |
| 318 | .id(`col_tabBar${index}`) | 320 | .id(`col_tabBar${index}`) |
| 319 | - .margin({ right: this.myChannelList.length === index + 1 ? 36 : 0 }) | 321 | + // .margin({ right: this.myChannelList.length === index + 1 ? 36 : 0 }) |
| 320 | .onClick(() => { | 322 | .onClick(() => { |
| 321 | Logger.debug(TAG, `onClick, index: ${index}`); | 323 | Logger.debug(TAG, `onClick, index: ${index}`); |
| 322 | if (this.currentTopNavSelectedIndex === index) { | 324 | if (this.currentTopNavSelectedIndex === index) { |
| @@ -487,9 +489,19 @@ export struct TopNavigationComponentNew { | @@ -487,9 +489,19 @@ export struct TopNavigationComponentNew { | ||
| 487 | } | 489 | } |
| 488 | 490 | ||
| 489 | /** | 491 | /** |
| 492 | + * 判断是否当前页面处理逻辑,如消息通知,只需要切换到当前底导的处理,过滤掉非当前。 | ||
| 493 | + */ | ||
| 494 | + private isCurrentPage(): boolean { | ||
| 495 | + return this._currentNavIndex === this.bottomNavIndex | ||
| 496 | + } | ||
| 497 | + | ||
| 498 | + /** | ||
| 490 | * 频道id变化,即指定频道跳转场景 | 499 | * 频道id变化,即指定频道跳转场景 |
| 491 | */ | 500 | */ |
| 492 | onAssignChannelChange() { | 501 | onAssignChannelChange() { |
| 502 | + if (!this.isCurrentPage()) { | ||
| 503 | + return | ||
| 504 | + } | ||
| 493 | let channelId = this.assignChannel.channelId | 505 | let channelId = this.assignChannel.channelId |
| 494 | let index = -1 | 506 | let index = -1 |
| 495 | if (this._currentNavIndex === 0) { | 507 | if (this._currentNavIndex === 0) { |
| @@ -537,7 +549,7 @@ export struct TopNavigationComponentNew { | @@ -537,7 +549,7 @@ export struct TopNavigationComponentNew { | ||
| 537 | private getChannelByMine(channelId: string) { | 549 | private getChannelByMine(channelId: string) { |
| 538 | for (let i = 0; i < this.myChannelList.length; i++) { | 550 | for (let i = 0; i < this.myChannelList.length; i++) { |
| 539 | let topNavDTO: TopNavDTO = this.myChannelList[i] | 551 | let topNavDTO: TopNavDTO = this.myChannelList[i] |
| 540 | - if (topNavDTO.channelId?.toString() === channelId) { | 552 | + if (topNavDTO?.channelId?.toString() === channelId) { |
| 541 | return i | 553 | return i |
| 542 | } | 554 | } |
| 543 | } | 555 | } |
| @@ -199,7 +199,7 @@ export struct OperRowListView { | @@ -199,7 +199,7 @@ export struct OperRowListView { | ||
| 199 | .padding({ | 199 | .padding({ |
| 200 | top: 10, | 200 | top: 10, |
| 201 | // bottom: 10 | 201 | // bottom: 10 |
| 202 | - bottom: `${this.bottomSafeHeight}px` | 202 | + bottom: px2vp(this.bottomSafeHeight) |
| 203 | // bottom: 50 | 203 | // bottom: 50 |
| 204 | }) | 204 | }) |
| 205 | } | 205 | } |
| @@ -173,4 +173,47 @@ export class ColorUtils { | @@ -173,4 +173,47 @@ export class ColorUtils { | ||
| 173 | alpha: (color & 0xFF000000) >> 24 | 173 | alpha: (color & 0xFF000000) >> 24 |
| 174 | } | 174 | } |
| 175 | } | 175 | } |
| 176 | + | ||
| 177 | + | ||
| 178 | + public static getMorningEveningPaperRgb(color: ColorRgb): ColorRgb{ | ||
| 179 | + // RGB颜色取值范围是0~255,需要转换为0~1的浮点数 | ||
| 180 | + const red: number = color.red / MAX_RGB_VALUE; | ||
| 181 | + const green: number = color.green / MAX_RGB_VALUE; | ||
| 182 | + const blue: number = color.blue / MAX_RGB_VALUE; | ||
| 183 | + | ||
| 184 | + const max: number = Math.max(red, green, blue); | ||
| 185 | + const min: number = Math.min(red, green, blue); | ||
| 186 | + const delta: number = max - min; | ||
| 187 | + | ||
| 188 | + // 色调 | ||
| 189 | + let hue: number = 0; | ||
| 190 | + // 饱和度 | ||
| 191 | + let saturation: number = 0; | ||
| 192 | + // 明度 | ||
| 193 | + let value: number = 0; | ||
| 194 | + // 计算hue值 | ||
| 195 | + if (max === min) { | ||
| 196 | + hue = 0; | ||
| 197 | + } else if (Math.abs(max - red) < Number.EPSILON) { | ||
| 198 | + hue = (green >= blue ? ((green - blue) / delta) * 60 : ((green - blue) / delta) * 60 + 360); | ||
| 199 | + } else if (Math.abs(max - green) < Number.EPSILON) { | ||
| 200 | + hue = (((blue - red) / delta) + 2) * 60; | ||
| 201 | + } else if (Math.abs(max - blue) < Number.EPSILON) { | ||
| 202 | + hue = (((red - green) / delta) + 4) * 60; | ||
| 203 | + } | ||
| 204 | + | ||
| 205 | + // 计算saturation值 | ||
| 206 | + saturation = 0.9; | ||
| 207 | + // 计算value值 | ||
| 208 | + value = 0.3; | ||
| 209 | + | ||
| 210 | + return ColorUtils.hsv2rgb({ | ||
| 211 | + hue: hue, | ||
| 212 | + saturation: saturation, | ||
| 213 | + value: value, | ||
| 214 | + alpha: color.alpha | ||
| 215 | + }) | ||
| 216 | + | ||
| 217 | + } | ||
| 218 | + | ||
| 176 | } | 219 | } |
| @@ -53,17 +53,23 @@ export struct DetailPlayLivePage { | @@ -53,17 +53,23 @@ export struct DetailPlayLivePage { | ||
| 53 | console.error(TAG, 'this.publishCommentModel', this.publishCommentModel.targetId) | 53 | console.error(TAG, 'this.publishCommentModel', this.publishCommentModel.targetId) |
| 54 | } | 54 | } |
| 55 | 55 | ||
| 56 | + async aboutToDisappear() { | ||
| 57 | + Logger.info(TAG, `wyj-aboutToDisappear`) | ||
| 58 | + await this.playerController?.stop() | ||
| 59 | + await this.playerController?.release() | ||
| 60 | + } | ||
| 61 | + | ||
| 56 | build() { | 62 | build() { |
| 57 | Column() { | 63 | Column() { |
| 58 | TopPlayComponent({ playerController: this.playerController }) | 64 | TopPlayComponent({ playerController: this.playerController }) |
| 59 | - .layoutWeight(211) | 65 | + .height(211) |
| 60 | TabComponent({ tabs: this.tabs, changeToTab: this.changeToTab }) | 66 | TabComponent({ tabs: this.tabs, changeToTab: this.changeToTab }) |
| 61 | - .layoutWeight(503) | 67 | + .layoutWeight(1) |
| 62 | .visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None) | 68 | .visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None) |
| 63 | - | ||
| 64 | OperRowListView({ | 69 | OperRowListView({ |
| 65 | componentType: 4, | 70 | componentType: 4, |
| 66 | operationButtonList: ['comment', 'collect', 'share', 'like'], | 71 | operationButtonList: ['comment', 'collect', 'share', 'like'], |
| 72 | + styleType: 1, | ||
| 67 | contentDetailData: this.contentDetailData, | 73 | contentDetailData: this.contentDetailData, |
| 68 | publishCommentModel: this.publishCommentModel, | 74 | publishCommentModel: this.publishCommentModel, |
| 69 | showCommentIcon: false, | 75 | showCommentIcon: false, |
| @@ -79,12 +85,7 @@ export struct DetailPlayLivePage { | @@ -79,12 +85,7 @@ export struct DetailPlayLivePage { | ||
| 79 | } | 85 | } |
| 80 | .height('100%') | 86 | .height('100%') |
| 81 | .width('100%') | 87 | .width('100%') |
| 82 | - } | ||
| 83 | - | ||
| 84 | - async aboutToDisappear() { | ||
| 85 | - Logger.info(TAG, `wyj-aboutToDisappear`) | ||
| 86 | - await this.playerController?.stop() | ||
| 87 | - await this.playerController?.release() | 88 | + // 设置底部绘制延伸到导航条 |
| 88 | } | 89 | } |
| 89 | 90 | ||
| 90 | onPageShowCus(): void { | 91 | onPageShowCus(): void { |
| @@ -196,8 +196,8 @@ struct LaunchAdvertisingPage { | @@ -196,8 +196,8 @@ struct LaunchAdvertisingPage { | ||
| 196 | contentTrackingDict(){ | 196 | contentTrackingDict(){ |
| 197 | this.pageParam = { | 197 | this.pageParam = { |
| 198 | 'adType':'0', | 198 | 'adType':'0', |
| 199 | - 'adId':this.model.launchAdInfo[0].matInfo.id.toString(), | ||
| 200 | - 'adName':this.model.launchAdInfo[0].matInfo.advTitle, | 199 | + 'adId':this.model.launchAdInfo[0]?.matInfo.id.toString(), |
| 200 | + 'adName':this.model.launchAdInfo[0]?.matInfo.advTitle, | ||
| 201 | 'regionName':'0' | 201 | 'regionName':'0' |
| 202 | } | 202 | } |
| 203 | } | 203 | } |
| @@ -4,7 +4,7 @@ import { EmitterEventId, EmitterUtils, Logger, StringUtils } from 'wdKit'; | @@ -4,7 +4,7 @@ import { EmitterEventId, EmitterUtils, Logger, StringUtils } from 'wdKit'; | ||
| 4 | import { HttpUtils } from 'wdNetwork/Index'; | 4 | import { HttpUtils } from 'wdNetwork/Index'; |
| 5 | import HomeChannelUtils, { AssignChannelParam } from 'wdRouter/Index'; | 5 | import HomeChannelUtils, { AssignChannelParam } from 'wdRouter/Index'; |
| 6 | import { MinePageComponent } from 'wdComponent/src/main/ets/components/page/MinePageComponent'; | 6 | import { MinePageComponent } from 'wdComponent/src/main/ets/components/page/MinePageComponent'; |
| 7 | -import { CompUtils, TopNavigationComponent } from 'wdComponent/Index'; | 7 | +import { CompUtils, TopNavigationComponent, TopNavigationComponentNew } from 'wdComponent/Index'; |
| 8 | import { VideoChannelPage } from './VideoChannelPage'; | 8 | import { VideoChannelPage } from './VideoChannelPage'; |
| 9 | import ChannelViewModel from 'wdComponent/src/main/ets/viewmodel/ChannelViewModel'; | 9 | import ChannelViewModel from 'wdComponent/src/main/ets/viewmodel/ChannelViewModel'; |
| 10 | 10 | ||
| @@ -17,6 +17,7 @@ let storage = LocalStorage.getShared(); | @@ -17,6 +17,7 @@ let storage = LocalStorage.getShared(); | ||
| 17 | @Entry(storage) | 17 | @Entry(storage) |
| 18 | @Component | 18 | @Component |
| 19 | export struct BottomNavigationComponent { | 19 | export struct BottomNavigationComponent { |
| 20 | + private isNewTopPage = true // TODO 顶导重构页面开关,false,则用原来的顶导 | ||
| 20 | @Provide bottomRectHeight: number = 0 | 21 | @Provide bottomRectHeight: number = 0 |
| 21 | @Provide topRectHeight: number = 0 | 22 | @Provide topRectHeight: number = 0 |
| 22 | @Provide isLayoutFullScreen: boolean = false | 23 | @Provide isLayoutFullScreen: boolean = false |
| @@ -82,15 +83,28 @@ export struct BottomNavigationComponent { | @@ -82,15 +83,28 @@ export struct BottomNavigationComponent { | ||
| 82 | autoRefresh: this.autoRefresh | 83 | autoRefresh: this.autoRefresh |
| 83 | }) | 84 | }) |
| 84 | } else { | 85 | } else { |
| 85 | - TopNavigationComponent({ | ||
| 86 | - groupId: navItem.id, | ||
| 87 | - topNavList: navItem.topNavChannelList.filter(item => item.channelId != 2073), | ||
| 88 | - _currentNavIndex: $currentNavIndex, | ||
| 89 | - navIndex: index, | ||
| 90 | - currentBottomNavName: navItem.name, | ||
| 91 | - assignChannel: this.assignChannel, | ||
| 92 | - autoRefresh: this.autoRefresh | ||
| 93 | - }) | 86 | + if (this.isNewTopPage) { |
| 87 | + TopNavigationComponentNew({ | ||
| 88 | + groupId: navItem.id, | ||
| 89 | + topNavList: navItem.topNavChannelList.filter(item => item.channelId != 2073), | ||
| 90 | + _currentNavIndex: $currentNavIndex, | ||
| 91 | + bottomNavIndex: index, | ||
| 92 | + currentBottomNavName: navItem.name, | ||
| 93 | + assignChannel: this.assignChannel, | ||
| 94 | + autoRefresh: this.autoRefresh | ||
| 95 | + }) | ||
| 96 | + } else { | ||
| 97 | + TopNavigationComponent({ | ||
| 98 | + groupId: navItem.id, | ||
| 99 | + topNavList: navItem.topNavChannelList.filter(item => item.channelId != 2073), | ||
| 100 | + _currentNavIndex: $currentNavIndex, | ||
| 101 | + navIndex: index, | ||
| 102 | + currentBottomNavName: navItem.name, | ||
| 103 | + assignChannel: this.assignChannel, | ||
| 104 | + autoRefresh: this.autoRefresh | ||
| 105 | + }) | ||
| 106 | + } | ||
| 107 | + | ||
| 94 | } | 108 | } |
| 95 | } | 109 | } |
| 96 | .tabBar(this.tabBarBuilder(navItem, index)) | 110 | .tabBar(this.tabBarBuilder(navItem, index)) |
-
Please register or login to post a comment