张善主

Merge remote-tracking branch 'origin/main'

Showing 23 changed files with 224 additions and 57 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,11 +45,11 @@ export struct Card4Component { @@ -45,11 +45,11 @@ export struct Card4Component {
45 Column() { 45 Column() {
46 //body 46 //body
47 Column() { 47 Column() {
48 - //新闻标题 48 + Stack() {
49 if (this.contentDTO.newTags) { 49 if (this.contentDTO.newTags) {
50 - Notes({ newTags: this.contentDTO.newTags }) 50 + Notes({ newTags: this.contentDTO.newTags }).height(19).align(Alignment.Center)
51 } else if (this.contentDTO.objectType == '5') { 51 } else if (this.contentDTO.objectType == '5') {
52 - Notes({ objectType: this.contentDTO.objectType }) 52 + Notes({ objectType: this.contentDTO.objectType }).height(19).align(Alignment.Center)
53 } 53 }
54 Text() { 54 Text() {
55 if (this.titleMarked) { 55 if (this.titleMarked) {
@@ -68,6 +68,9 @@ export struct Card4Component { @@ -68,6 +68,9 @@ export struct Card4Component {
68 .textIndent(this.contentDTO.newTags?.length < 5 && this.contentDTO.newTags?.length > 2 ? 58 : 68 .textIndent(this.contentDTO.newTags?.length < 5 && this.contentDTO.newTags?.length > 2 ? 58 :
69 (this.contentDTO.newTags?.length != 0 && this.contentDTO.newTags?.length) || 69 (this.contentDTO.newTags?.length != 0 && this.contentDTO.newTags?.length) ||
70 this.contentDTO.objectType == '5' ? 30 : 0) 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,9 +38,40 @@ export struct AppointmentListUI { @@ -35,9 +38,40 @@ export struct AppointmentListUI {
35 } 38 }
36 39
37 } else { 40 } else {
38 - //刷新控件 TODO  
39 - //List  
40 - List({ space: '6lpx' }) { 41 +
  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()
  63 + }
  64 + }
  65 + })
  66 + }
  67 + }
  68 + .backgroundColor($r('app.color.color_F9F9F9'))
  69 + .height('100%')
  70 + .width('100%')
  71 + }
  72 +
  73 + @Builder ListLayout(){
  74 + List({ space:6,scroller: this.scroller }) {
41 LazyForEach(this.data, (item: MineAppointmentItem, index: number) => { 75 LazyForEach(this.data, (item: MineAppointmentItem, index: number) => {
42 ListItem() { 76 ListItem() {
43 AppointmentListChildComponent({ item: item }) 77 AppointmentListChildComponent({ item: item })
@@ -62,25 +96,14 @@ export struct AppointmentListUI { @@ -62,25 +96,14 @@ export struct AppointmentListUI {
62 if (!this.hasMore) { 96 if (!this.hasMore) {
63 ListItem() { 97 ListItem() {
64 ListHasNoMoreDataUI() 98 ListHasNoMoreDataUI()
65 - } 99 + }.padding({bottom:px2vp(this.bottomSafeHeight) + 20})
66 } 100 }
67 } 101 }
68 .cachedCount(4) 102 .cachedCount(4)
69 .scrollBar(BarState.Off) 103 .scrollBar(BarState.Off)
70 - .margin({ top: '23lpx', left: '23lpx', right: '23lpx' }) 104 + .edgeEffect(EdgeEffect.None)
  105 + .margin({ top: '23lpx', left: '23lpx', right: '23lpx'})
71 .layoutWeight(1) 106 .layoutWeight(1)
72 - .onReachEnd(() => {  
73 - console.log(TAG, "触底了");  
74 - if (!this.isLoading) {  
75 - //加载分页数据  
76 - this.getNewPageData()  
77 - }  
78 - })  
79 - }  
80 - }  
81 - .backgroundColor($r('app.color.color_F9F9F9'))  
82 - .height('100%')  
83 - .width('100%')  
84 } 107 }
85 108
86 getNewPageData() { 109 getNewPageData() {
@@ -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,6 +72,7 @@ export struct TopNavigationComponentNew { @@ -72,6 +72,7 @@ export struct TopNavigationComponentNew {
72 private tabsWidth: number = 0 72 private tabsWidth: number = 0
73 73
74 build() { 74 build() {
  75 + Column() {
75 // 频道分类list 76 // 频道分类list
76 RelativeContainer() { 77 RelativeContainer() {
77 this.tabBar() 78 this.tabBar()
@@ -135,6 +136,7 @@ export struct TopNavigationComponentNew { @@ -135,6 +136,7 @@ export struct TopNavigationComponentNew {
135 .width('100%') 136 .width('100%')
136 .height('100%') 137 .height('100%')
137 } 138 }
  139 + }
138 140
139 @Builder 141 @Builder
140 topBar() { 142 topBar() {
@@ -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 }
@@ -26,7 +26,6 @@ export struct CustomTitleUI { @@ -26,7 +26,6 @@ export struct CustomTitleUI {
26 } 26 }
27 27
28 Text(this.titleName) 28 Text(this.titleName)
29 - .height('42lpx')  
30 .maxLines(1) 29 .maxLines(1)
31 .id("title") 30 .id("title")
32 .fontSize('35lpx') 31 .fontSize('35lpx')
@@ -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,6 +83,17 @@ export struct BottomNavigationComponent { @@ -82,6 +83,17 @@ export struct BottomNavigationComponent {
82 autoRefresh: this.autoRefresh 83 autoRefresh: this.autoRefresh
83 }) 84 })
84 } else { 85 } else {
  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 {
85 TopNavigationComponent({ 97 TopNavigationComponent({
86 groupId: navItem.id, 98 groupId: navItem.id,
87 topNavList: navItem.topNavChannelList.filter(item => item.channelId != 2073), 99 topNavList: navItem.topNavChannelList.filter(item => item.channelId != 2073),
@@ -92,6 +104,8 @@ export struct BottomNavigationComponent { @@ -92,6 +104,8 @@ export struct BottomNavigationComponent {
92 autoRefresh: this.autoRefresh 104 autoRefresh: this.autoRefresh
93 }) 105 })
94 } 106 }
  107 +
  108 + }
95 } 109 }
96 .tabBar(this.tabBarBuilder(navItem, index)) 110 .tabBar(this.tabBarBuilder(navItem, index))
97 111