Showing
17 changed files
with
250 additions
and
150 deletions
| @@ -222,7 +222,7 @@ export class ProcessUtils { | @@ -222,7 +222,7 @@ export class ProcessUtils { | ||
| 222 | ProcessUtils.gotoThemeListPage(content) | 222 | ProcessUtils.gotoThemeListPage(content) |
| 223 | break; | 223 | break; |
| 224 | default: | 224 | default: |
| 225 | - ToastUtils.shortToast('敬请期待') | 225 | + ToastUtils.shortToast('敬请期待') |
| 226 | break; | 226 | break; |
| 227 | } | 227 | } |
| 228 | } | 228 | } |
| @@ -372,6 +372,8 @@ export class ProcessUtils { | @@ -372,6 +372,8 @@ export class ProcessUtils { | ||
| 372 | type: 'JUMP_INNER_NEW_PAGE', | 372 | type: 'JUMP_INNER_NEW_PAGE', |
| 373 | params: { | 373 | params: { |
| 374 | contentID: content?.objectId, | 374 | contentID: content?.objectId, |
| 375 | + //fixme 图文外链,需要单独处理 | ||
| 376 | + url:content?.linkUrl, | ||
| 375 | pageID: 'IMAGE_TEXT_DETAIL', | 377 | pageID: 'IMAGE_TEXT_DETAIL', |
| 376 | extra: { | 378 | extra: { |
| 377 | relType: content?.relType, | 379 | relType: content?.relType, |
| @@ -96,7 +96,7 @@ export struct ENewspaperItemComponent { | @@ -96,7 +96,7 @@ export struct ENewspaperItemComponent { | ||
| 96 | } | 96 | } |
| 97 | if (event.type === TouchType.Up) { | 97 | if (event.type === TouchType.Up) { |
| 98 | this.context.clearRect(0, 0, this.context.width, this.context.height) | 98 | this.context.clearRect(0, 0, this.context.width, this.context.height) |
| 99 | - if (this.itemBeanClicked != null && this.itemBeanClicked.newsId != 0) { | 99 | + if (this.itemBeanClicked != null && this.itemBeanClicked.newsId != 0 && this.itemBeanClicked.newsType ) { |
| 100 | //公共跳转 | 100 | //公共跳转 |
| 101 | let content: ContentDTO = { | 101 | let content: ContentDTO = { |
| 102 | objectId: this.itemBeanClicked.newsId + '', | 102 | objectId: this.itemBeanClicked.newsId + '', |
| @@ -4,6 +4,8 @@ import { SPHelper, StringUtils, UserDataLocal } from 'wdKit' | @@ -4,6 +4,8 @@ import { SPHelper, StringUtils, UserDataLocal } from 'wdKit' | ||
| 4 | import { WDRouterPage, WDRouterRule } from 'wdRouter' | 4 | import { WDRouterPage, WDRouterRule } from 'wdRouter' |
| 5 | import { TrackingButton, TrackConstants } from 'wdTracking/Index' | 5 | import { TrackingButton, TrackConstants } from 'wdTracking/Index' |
| 6 | import MinePageDatasModel from '../../model/MinePageDatasModel' | 6 | import MinePageDatasModel from '../../model/MinePageDatasModel' |
| 7 | +import { ColorUtils } from '../../utils/ColorUtils' | ||
| 8 | + | ||
| 7 | const TAG = "MinePageUserSimpleInfoUI" | 9 | const TAG = "MinePageUserSimpleInfoUI" |
| 8 | 10 | ||
| 9 | 11 | ||
| @@ -39,20 +41,20 @@ export default struct MinePageUserSimpleInfoUI { | @@ -39,20 +41,20 @@ export default struct MinePageUserSimpleInfoUI { | ||
| 39 | 41 | ||
| 40 | Image(this.isLogin?(this.headPhotoUrl?this.headPhotoUrl:this.userType === "1"?$r('app.media.default_head'):$r('app.media.AccountOwner_DefaultIcon')):$r('app.media.default_head')) | 42 | Image(this.isLogin?(this.headPhotoUrl?this.headPhotoUrl:this.userType === "1"?$r('app.media.default_head'):$r('app.media.AccountOwner_DefaultIcon')):$r('app.media.default_head')) |
| 41 | .alt($r('app.media.default_head')) | 43 | .alt($r('app.media.default_head')) |
| 42 | - .width(`${this.calcHeight(110)}lpx`) | ||
| 43 | - .height(`${this.calcHeight(110)}lpx`) | 44 | + .width(`${this.calcHeight(120)}lpx`) |
| 45 | + .height(`${this.calcHeight(120)}lpx`) | ||
| 44 | .objectFit(ImageFit.Cover) | 46 | .objectFit(ImageFit.Cover) |
| 45 | .borderRadius(50) | 47 | .borderRadius(50) |
| 46 | 48 | ||
| 47 | if(StringUtils.isNotEmpty(this.levelHead)){ | 49 | if(StringUtils.isNotEmpty(this.levelHead)){ |
| 48 | Image(this.levelHead) | 50 | Image(this.levelHead) |
| 49 | - .width(`${this.calcHeight(140)}lpx`) | ||
| 50 | - .height(`${this.calcHeight(140)}lpx`) | 51 | + .width(`${this.calcHeight(155)}lpx`) |
| 52 | + .height(`${this.calcHeight(155)}lpx`) | ||
| 51 | .objectFit(ImageFit.Cover) | 53 | .objectFit(ImageFit.Cover) |
| 52 | .borderRadius(50) | 54 | .borderRadius(50) |
| 53 | } | 55 | } |
| 54 | - }.width(`${this.calcHeight(130)}lpx`) | ||
| 55 | - .height(`${this.calcHeight(130)}lpx`) | 56 | + }.width(`${this.calcHeight(140)}lpx`) |
| 57 | + .height(`${this.calcHeight(140)}lpx`) | ||
| 56 | .alignContent(Alignment.Center) | 58 | .alignContent(Alignment.Center) |
| 57 | .onClick(()=>{ | 59 | .onClick(()=>{ |
| 58 | this.jumpLogin() | 60 | this.jumpLogin() |
| @@ -74,7 +76,7 @@ export default struct MinePageUserSimpleInfoUI { | @@ -74,7 +76,7 @@ export default struct MinePageUserSimpleInfoUI { | ||
| 74 | Image($r('app.media.mine_user_edit')) | 76 | Image($r('app.media.mine_user_edit')) |
| 75 | .width(`${this.calcHeight(27)}lpx`) | 77 | .width(`${this.calcHeight(27)}lpx`) |
| 76 | .height(`${this.calcHeight(27)}lpx`) | 78 | .height(`${this.calcHeight(27)}lpx`) |
| 77 | - .colorBlend(this.navItem?.homePageColor.length > 0?this.navItem?.homePageColor:null) | 79 | + .colorFilter(ColorUtils.getDrawingColorFilter(this.navItem?.homePageColor.length > 0?this.navItem?.homePageColor:'')) |
| 78 | .margin({left:`${this.calcHeight(15)}lpx`}) | 80 | .margin({left:`${this.calcHeight(15)}lpx`}) |
| 79 | .objectFit(ImageFit.Cover) | 81 | .objectFit(ImageFit.Cover) |
| 80 | Blank() | 82 | Blank() |
| @@ -96,10 +98,10 @@ export default struct MinePageUserSimpleInfoUI { | @@ -96,10 +98,10 @@ export default struct MinePageUserSimpleInfoUI { | ||
| 96 | .fontSize(`${this.calcHeight(19)}lpx`) | 98 | .fontSize(`${this.calcHeight(19)}lpx`) |
| 97 | .width(this.levelId>9?`${this.calcHeight(69)}lpx`:`${this.calcHeight(50)}lpx`) | 99 | .width(this.levelId>9?`${this.calcHeight(69)}lpx`:`${this.calcHeight(50)}lpx`) |
| 98 | .height(`${this.calcHeight(29)}lpx`) | 100 | .height(`${this.calcHeight(29)}lpx`) |
| 99 | - }.margin({top:'`${this.calcHeight(15)}lpx`'}) | 101 | + }.margin({top:`${this.calcHeight(15)}lpx`}) |
| 100 | } | 102 | } |
| 101 | }.alignItems(HorizontalAlign.Start) | 103 | }.alignItems(HorizontalAlign.Start) |
| 102 | - .margin({top:`${this.calcHeight(12)}lpx`,left:`${this.calcHeight(4)}lpx`}) | 104 | + .margin({top:`${this.calcHeight(5)}lpx`,left:`${this.calcHeight(4)}lpx`}) |
| 103 | .width(`${this.calcHeight(352)}lpx`) | 105 | .width(`${this.calcHeight(352)}lpx`) |
| 104 | }else{ | 106 | }else{ |
| 105 | Row(){ | 107 | Row(){ |
| 1 | import { BottomNavDTO } from 'wdBean/Index' | 1 | import { BottomNavDTO } from 'wdBean/Index' |
| 2 | +import { ColorUtils } from '../../utils/ColorUtils' | ||
| 2 | import MinePagePersonalFunctionsItem from '../../viewmodel/MinePagePersonalFunctionsItem' | 3 | import MinePagePersonalFunctionsItem from '../../viewmodel/MinePagePersonalFunctionsItem' |
| 3 | 4 | ||
| 4 | @Component | 5 | @Component |
| @@ -12,7 +13,7 @@ export struct PagePersonFunction{ | @@ -12,7 +13,7 @@ export struct PagePersonFunction{ | ||
| 12 | Column(){ | 13 | Column(){ |
| 13 | Stack({ alignContent: Alignment.TopEnd }){ | 14 | Stack({ alignContent: Alignment.TopEnd }){ |
| 14 | Image(this.item.imgSrc) | 15 | Image(this.item.imgSrc) |
| 15 | - .colorBlend(this.navItem?.homePageColor.length > 0?this.navItem.homePageColor:null) | 16 | + .colorFilter(ColorUtils.getDrawingColorFilter(this.navItem?.homePageColor.length > 0?this.navItem?.homePageColor:'')) |
| 16 | .objectFit(ImageFit.Auto) | 17 | .objectFit(ImageFit.Auto) |
| 17 | .interpolation(ImageInterpolation.High) | 18 | .interpolation(ImageInterpolation.High) |
| 18 | if (this.item.isShowRedPoint) { | 19 | if (this.item.isShowRedPoint) { |
| @@ -20,7 +21,7 @@ export struct PagePersonFunction{ | @@ -20,7 +21,7 @@ export struct PagePersonFunction{ | ||
| 20 | .type(ButtonType.Circle) | 21 | .type(ButtonType.Circle) |
| 21 | .width(`${this.calcHeight(12)}lpx`) | 22 | .width(`${this.calcHeight(12)}lpx`) |
| 22 | .height(`${this.calcHeight(12)}lpx`) | 23 | .height(`${this.calcHeight(12)}lpx`) |
| 23 | - .backgroundColor($r('app.color.color_ED2800')) | 24 | + .backgroundColor(this.navItem?.noticeColor.length > 0?this.navItem?.noticeColor:$r('app.color.color_ED2800')) |
| 24 | } | 25 | } |
| 25 | }.width(`${this.calcHeight(46)}lpx`) | 26 | }.width(`${this.calcHeight(46)}lpx`) |
| 26 | .height(`${this.calcHeight(46)}lpx`) | 27 | .height(`${this.calcHeight(46)}lpx`) |
| @@ -29,7 +30,6 @@ export struct PagePersonFunction{ | @@ -29,7 +30,6 @@ export struct PagePersonFunction{ | ||
| 29 | .margin({top:`${this.calcHeight(8)}lpx`}) | 30 | .margin({top:`${this.calcHeight(8)}lpx`}) |
| 30 | .height(`${this.calcHeight(23)}lpx`) | 31 | .height(`${this.calcHeight(23)}lpx`) |
| 31 | .fontColor(this.navItem?.homePageColor.length > 0?this.navItem.homePageColor:$r('app.color.color_222222')) | 32 | .fontColor(this.navItem?.homePageColor.length > 0?this.navItem.homePageColor:$r('app.color.color_222222')) |
| 32 | - .fontColor($r('app.color.color_222222')) | ||
| 33 | .fontSize(`${this.calcHeight(23)}lpx`) | 33 | .fontSize(`${this.calcHeight(23)}lpx`) |
| 34 | } | 34 | } |
| 35 | .alignItems(HorizontalAlign.Center) | 35 | .alignItems(HorizontalAlign.Center) |
| @@ -199,20 +199,22 @@ struct EditUserInfoPage { | @@ -199,20 +199,22 @@ struct EditUserInfoPage { | ||
| 199 | if (backParams) { | 199 | if (backParams) { |
| 200 | let userName = backParams.userName as string ///昵称 | 200 | let userName = backParams.userName as string ///昵称 |
| 201 | let introduction = backParams.introduction as string ///简介 | 201 | let introduction = backParams.introduction as string ///简介 |
| 202 | - | 202 | + this.listData = [] |
| 203 | if (userName) { | 203 | if (userName) { |
| 204 | if (userName != this.currentUserInfo.userName) { | 204 | if (userName != this.currentUserInfo.userName) { |
| 205 | - // this.currentUserInfo.userName = userName; | ||
| 206 | - // this.currentUserInfo.editDataType = WDEditDataModelType.WDEditDataModelType_nickname | 205 | + this.currentUserInfo.userName = userName; |
| 206 | + this.currentUserInfo.editDataType = WDEditDataModelType.WDEditDataModelType_nickname | ||
| 207 | + this.listData.push(...EditInfoViewModel.getEditListInfo(this.currentUserInfo)) | ||
| 207 | // this.updateEditModel() | 208 | // this.updateEditModel() |
| 208 | - this.getAccountOwnerInfo() | 209 | + // this.getAccountOwnerInfo() |
| 209 | } | 210 | } |
| 210 | } else if (introduction){ | 211 | } else if (introduction){ |
| 211 | if (introduction != this.currentUserInfo.userExtend.introduction ) { | 212 | if (introduction != this.currentUserInfo.userExtend.introduction ) { |
| 212 | - // this.currentUserInfo.userExtend.introduction = introduction; | ||
| 213 | - // this.currentUserInfo.editDataType = WDEditDataModelType.WDEditDataModelType_intro | 213 | + this.currentUserInfo.userExtend.introduction = introduction; |
| 214 | + this.currentUserInfo.editDataType = WDEditDataModelType.WDEditDataModelType_intro | ||
| 215 | + this.listData.push(...EditInfoViewModel.getEditListInfo(this.currentUserInfo)) | ||
| 214 | // this.updateEditModel() | 216 | // this.updateEditModel() |
| 215 | - this.getAccountOwnerInfo() | 217 | + // this.getAccountOwnerInfo() |
| 216 | } | 218 | } |
| 217 | } | 219 | } |
| 218 | } | 220 | } |
| @@ -5,7 +5,7 @@ import MinePageDatasModel from '../../model/MinePageDatasModel' | @@ -5,7 +5,7 @@ import MinePageDatasModel from '../../model/MinePageDatasModel' | ||
| 5 | import MinePageUserSimpleInfoUI from '../mine/MinePageUserSimpleInfoUI' | 5 | import MinePageUserSimpleInfoUI from '../mine/MinePageUserSimpleInfoUI' |
| 6 | import MinePagePersonFunctionUI from '../mine/MinePagePersonFunctionUI' | 6 | import MinePagePersonFunctionUI from '../mine/MinePagePersonFunctionUI' |
| 7 | import MinePageMoreFunctionUI from '../mine/MinePageMoreFunctionUI' | 7 | import MinePageMoreFunctionUI from '../mine/MinePageMoreFunctionUI' |
| 8 | -import { BreakpointSystem, DateTimeUtils, SPHelper, StringUtils } from 'wdKit' | 8 | +import { BreakpointSystem, DateTimeUtils, SPHelper, StringUtils, WindowModel } from 'wdKit' |
| 9 | import { SpConstants } from 'wdConstant' | 9 | import { SpConstants } from 'wdConstant' |
| 10 | import dataPreferences from '@ohos.data.preferences'; | 10 | import dataPreferences from '@ohos.data.preferences'; |
| 11 | import { MergeRecordDialog } from '../../dialog/MergeRecordDialog' | 11 | import { MergeRecordDialog } from '../../dialog/MergeRecordDialog' |
| @@ -92,7 +92,30 @@ export struct MinePageComponent { | @@ -92,7 +92,30 @@ export struct MinePageComponent { | ||
| 92 | 92 | ||
| 93 | this.pageShowTime = DateTimeUtils.getTimeStamp() | 93 | this.pageShowTime = DateTimeUtils.getTimeStamp() |
| 94 | } | 94 | } |
| 95 | + | ||
| 96 | + this.changeTopStatusBarColor(this.navItem.statusBarColor) | ||
| 95 | } | 97 | } |
| 98 | + | ||
| 99 | + /** | ||
| 100 | + * 修改手机顶部状态栏颜色 | ||
| 101 | + * @param statusValue | ||
| 102 | + */ | ||
| 103 | + changeTopStatusBarColor(statusValue: number) { | ||
| 104 | + if (statusValue === 0) {//白色状态栏 | ||
| 105 | + WindowModel.shared.setWindowSystemBarProperties({ | ||
| 106 | + statusBarContentColor: '#ffffff', | ||
| 107 | + }) | ||
| 108 | + } else if (statusValue === 1) { // 黑色状态栏 | ||
| 109 | + WindowModel.shared.setWindowSystemBarProperties({ | ||
| 110 | + statusBarContentColor: '#000000', | ||
| 111 | + }) | ||
| 112 | + }else { | ||
| 113 | + WindowModel.shared.setWindowSystemBarProperties({ | ||
| 114 | + statusBarContentColor: '#000000', | ||
| 115 | + }) | ||
| 116 | + } | ||
| 117 | + } | ||
| 118 | + | ||
| 96 | pageHideForUpdateData(){ | 119 | pageHideForUpdateData(){ |
| 97 | if(this.isMinePage){ | 120 | if(this.isMinePage){ |
| 98 | this.pageHideTime = DateTimeUtils.getTimeStamp() | 121 | this.pageHideTime = DateTimeUtils.getTimeStamp() |
| @@ -104,6 +127,10 @@ export struct MinePageComponent { | @@ -104,6 +127,10 @@ export struct MinePageComponent { | ||
| 104 | } | 127 | } |
| 105 | TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.My,TrackConstants.PageName.My,Math.floor(duration)) | 128 | TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.My,TrackConstants.PageName.My,Math.floor(duration)) |
| 106 | } | 129 | } |
| 130 | + | ||
| 131 | + WindowModel.shared.setWindowSystemBarProperties({ | ||
| 132 | + statusBarContentColor: '#000000', | ||
| 133 | + }) | ||
| 107 | } | 134 | } |
| 108 | 135 | ||
| 109 | aboutToAppear(){ | 136 | aboutToAppear(){ |
| @@ -115,6 +142,8 @@ export struct MinePageComponent { | @@ -115,6 +142,8 @@ export struct MinePageComponent { | ||
| 115 | this.addLoginStatusObserver() | 142 | this.addLoginStatusObserver() |
| 116 | console.log(TAG,"currentBreakpoint==>"+this.currentBreakpoint) | 143 | console.log(TAG,"currentBreakpoint==>"+this.currentBreakpoint) |
| 117 | this.currentChanged() | 144 | this.currentChanged() |
| 145 | + | ||
| 146 | + this.changeTopStatusBarColor(this.navItem.statusBarColor) | ||
| 118 | } | 147 | } |
| 119 | 148 | ||
| 120 | getMessageData(){ | 149 | getMessageData(){ |
| 1 | import { BottomNavDTO, NavigationDetailDTO, TopNavDTO } from 'wdBean'; | 1 | import { BottomNavDTO, NavigationDetailDTO, TopNavDTO } from 'wdBean'; |
| 2 | -import { Logger, NetworkUtil, SPHelper, ToastUtils, WindowModel } from 'wdKit'; | 2 | +import { Logger, NetworkUtil, SPHelper, ToastUtils } from 'wdKit'; |
| 3 | import { ProcessUtils, WDRouterPage, WDRouterRule } from 'wdRouter'; | 3 | import { ProcessUtils, WDRouterPage, WDRouterRule } from 'wdRouter'; |
| 4 | import { PageComponent } from './PageComponent'; | 4 | import { PageComponent } from './PageComponent'; |
| 5 | import { ChannelSubscriptionLayout } from './ChannelSubscriptionLayout'; | 5 | import { ChannelSubscriptionLayout } from './ChannelSubscriptionLayout'; |
| @@ -11,8 +11,9 @@ import { ParamType, TrackConstants, Tracking, TrackingButton } from 'wdTracking/ | @@ -11,8 +11,9 @@ import { ParamType, TrackConstants, Tracking, TrackingButton } from 'wdTracking/ | ||
| 11 | import DailyPaperTopicModel from '../../model/DailyPaperTopicModel'; | 11 | import DailyPaperTopicModel from '../../model/DailyPaperTopicModel'; |
| 12 | import { CompUtils } from '../../utils/CompUtils'; | 12 | import { CompUtils } from '../../utils/CompUtils'; |
| 13 | import ChannelViewModel from '../../viewmodel/ChannelViewModel'; | 13 | import ChannelViewModel from '../../viewmodel/ChannelViewModel'; |
| 14 | -import { common2D, drawing } from '@kit.ArkGraphics2D'; | ||
| 15 | import { ColorUtils } from '../../utils/ColorUtils'; | 14 | import { ColorUtils } from '../../utils/ColorUtils'; |
| 15 | +import { ImageKnifeComponent } from '@ohos/imageknife'; | ||
| 16 | +import { CommonUtils } from '../../utils/CommonUtils'; | ||
| 16 | 17 | ||
| 17 | const TAG = 'TopNavigationComponent'; | 18 | const TAG = 'TopNavigationComponent'; |
| 18 | 19 | ||
| @@ -35,8 +36,7 @@ export struct TopNavigationComponentNew { | @@ -35,8 +36,7 @@ export struct TopNavigationComponentNew { | ||
| 35 | */ | 36 | */ |
| 36 | navItem: BottomNavDTO = {} as BottomNavDTO | 37 | navItem: BottomNavDTO = {} as BottomNavDTO |
| 37 | // 首页当前正在哪个tab的索引值 | 38 | // 首页当前正在哪个tab的索引值 |
| 38 | - @Link @Watch('setBarBackgroundColor') _currentNavIndex?: number; | ||
| 39 | - | 39 | + @Link @Watch('setBarBackgroundColor') _currentNavIndex?: number; |
| 40 | @Consume @Watch('pageShowChange') pageShow: number | 40 | @Consume @Watch('pageShowChange') pageShow: number |
| 41 | // 记录首页底部tab 的索引值 | 41 | // 记录首页底部tab 的索引值 |
| 42 | @State bottomNavIndex: number = 0 | 42 | @State bottomNavIndex: number = 0 |
| @@ -44,7 +44,8 @@ export struct TopNavigationComponentNew { | @@ -44,7 +44,8 @@ export struct TopNavigationComponentNew { | ||
| 44 | @State @Watch('updateCurrentTopNavSelectedIndex') currentTopNavSelectedIndex: number = 0; | 44 | @State @Watch('updateCurrentTopNavSelectedIndex') currentTopNavSelectedIndex: number = 0; |
| 45 | // 顶导数据 | 45 | // 顶导数据 |
| 46 | @State @Watch('onTopNavigationDataUpdated') topNavList: TopNavDTO[] = [] | 46 | @State @Watch('onTopNavigationDataUpdated') topNavList: TopNavDTO[] = [] |
| 47 | - | 47 | + @Consume barBackgroundColor: Color |
| 48 | + @Consume isImmersive: boolean | ||
| 48 | // | 49 | // |
| 49 | @State indexSettingChannelId: number = AppStorage.get<number>('indexSettingChannelId') || 2002 | 50 | @State indexSettingChannelId: number = AppStorage.get<number>('indexSettingChannelId') || 2002 |
| 50 | //本地缓存频道id列表 | 51 | //本地缓存频道id列表 |
| @@ -328,36 +329,33 @@ export struct TopNavigationComponentNew { | @@ -328,36 +329,33 @@ export struct TopNavigationComponentNew { | ||
| 328 | @Builder | 329 | @Builder |
| 329 | tabBarBuilder(item: TopNavDTO, index: number) { | 330 | tabBarBuilder(item: TopNavDTO, index: number) { |
| 330 | Column() { | 331 | Column() { |
| 331 | - Text(item?.name) | ||
| 332 | - .fontSize($r('app.float.selected_text_size')) | ||
| 333 | - .fontWeight(this.currentTopNavSelectedIndex === index ? FontWeight.Bold : FontWeight.Normal) | ||
| 334 | - .fontColor(this.tabSelectedColor(this.currentTopNavSelectedIndex === index)) | ||
| 335 | - .padding({ top: $r('app.float.top_tab_item_padding_top'), bottom: $r('app.float.top_tab_item_padding_bottom') }) | ||
| 336 | - .maxLines(this.MAX_LINE) | ||
| 337 | - .id(index.toString()) | ||
| 338 | - // .onAreaChange((oldValue: Area, newValue: Area) => { | ||
| 339 | - // if (this.currentTopNavSelectedIndex === index && | ||
| 340 | - // (this.indicatorLeftMargin === 0 || this.indicatorWidth === 0)) { | ||
| 341 | - // if (newValue.position.x != undefined) { | ||
| 342 | - // let positionX = Number.parseFloat(newValue.position.x.toString()) | ||
| 343 | - // this.indicatorLeftMargin = Number.isNaN(positionX) ? 0 : positionX | ||
| 344 | - // } | ||
| 345 | - // let width = Number.parseFloat(newValue.width.toString()) | ||
| 346 | - // this.indicatorWidth = Number.isNaN(width) ? 0 : width | ||
| 347 | - // } | ||
| 348 | - // }) | ||
| 349 | - if (this.currentTopNavSelectedIndex === index) { | ||
| 350 | 332 | ||
| 351 | - Image($r('app.media.icon_channel_active')) | ||
| 352 | - .colorFilter(ColorUtils.getDrawingColorFilter(this.getBothColor(""))) | ||
| 353 | - .width(20) | ||
| 354 | - .height(3) | ||
| 355 | - // Row() | ||
| 356 | - // .width(20) | ||
| 357 | - // .height(3) | ||
| 358 | - // .backgroundImage($r('app.media.icon_channel_active'), ImageRepeat.NoRepeat) | ||
| 359 | - // .backgroundImageSize(ImageSize.Contain) | 333 | + if (item.iconUrl && item.iconCUrl) { |
| 334 | + // 有图 | ||
| 335 | + ImageKnifeComponent({ imageKnifeOption: CommonUtils.getTopImageKnifeOption(item, this.currentTopNavSelectedIndex === index) }) | ||
| 336 | + .height(36) | ||
| 337 | + .width(CommonUtils.calTopTabWidth(36,item.iconUrlSize)) | ||
| 338 | + .enabled(false) | ||
| 339 | + } else { | ||
| 340 | + // 无图 | ||
| 341 | + Text(item?.name) | ||
| 342 | + .fontSize($r('app.float.selected_text_size')) | ||
| 343 | + .fontWeight(this.currentTopNavSelectedIndex === index ? FontWeight.Bold : FontWeight.Normal) | ||
| 344 | + .fontColor(this.tabSelectedColor(this.currentTopNavSelectedIndex === index)) | ||
| 345 | + .padding({ | ||
| 346 | + top: $r('app.float.top_tab_item_padding_top'), | ||
| 347 | + bottom: $r('app.float.top_tab_item_padding_bottom') | ||
| 348 | + }) | ||
| 349 | + .maxLines(this.MAX_LINE) | ||
| 350 | + .id(index.toString()) | ||
| 351 | + if (this.currentTopNavSelectedIndex === index) { | ||
| 352 | + Image($r('app.media.icon_channel_active'))//.colorFilter(ColorUtils.getDrawingColorFilter(this.getBothColor(""))) | ||
| 353 | + .width(20) | ||
| 354 | + .height(3) | ||
| 355 | + | ||
| 356 | + } | ||
| 360 | } | 357 | } |
| 358 | + | ||
| 361 | } | 359 | } |
| 362 | .hoverEffect(HoverEffect.Highlight) | 360 | .hoverEffect(HoverEffect.Highlight) |
| 363 | .constraintSize({ | 361 | .constraintSize({ |
| @@ -367,8 +365,8 @@ export struct TopNavigationComponentNew { | @@ -367,8 +365,8 @@ export struct TopNavigationComponentNew { | ||
| 367 | .height('100%') | 365 | .height('100%') |
| 368 | // .backgroundColor(Color.Transparent) | 366 | // .backgroundColor(Color.Transparent) |
| 369 | .padding({ | 367 | .padding({ |
| 370 | - left: $r('app.float.top_tab_item_padding_horizontal'), | ||
| 371 | - right: $r('app.float.top_tab_item_padding_horizontal'), | 368 | + left: item.iconUrl && item.iconCUrl ? 0 : $r('app.float.top_tab_item_padding_horizontal'), |
| 369 | + right: item.iconUrl && item.iconCUrl ? 0 : $r('app.float.top_tab_item_padding_horizontal'), | ||
| 372 | }) | 370 | }) |
| 373 | .justifyContent(FlexAlign.Center) | 371 | .justifyContent(FlexAlign.Center) |
| 374 | .id(`col_tabBar${index}`) | 372 | .id(`col_tabBar${index}`) |
| @@ -384,6 +382,8 @@ export struct TopNavigationComponentNew { | @@ -384,6 +382,8 @@ export struct TopNavigationComponentNew { | ||
| 384 | }) | 382 | }) |
| 385 | } | 383 | } |
| 386 | 384 | ||
| 385 | + | ||
| 386 | + | ||
| 387 | /** | 387 | /** |
| 388 | * 频道文字颜色 | 388 | * 频道文字颜色 |
| 389 | * @returns | 389 | * @returns |
| @@ -469,9 +469,6 @@ export struct TopNavigationComponentNew { | @@ -469,9 +469,6 @@ export struct TopNavigationComponentNew { | ||
| 469 | return item?.channelType === 3 | 469 | return item?.channelType === 3 |
| 470 | } | 470 | } |
| 471 | 471 | ||
| 472 | - @Consume barBackgroundColor: Color | ||
| 473 | - @Consume isImmersive: boolean | ||
| 474 | - | ||
| 475 | async aboutToAppear() { | 472 | async aboutToAppear() { |
| 476 | 473 | ||
| 477 | if (CompUtils.isNews(this.navItem)) { | 474 | if (CompUtils.isNews(this.navItem)) { |
| @@ -484,43 +481,29 @@ export struct TopNavigationComponentNew { | @@ -484,43 +481,29 @@ export struct TopNavigationComponentNew { | ||
| 484 | this.backgroundImageH = px2vp(this.topRectHeight) + 44 | 481 | this.backgroundImageH = px2vp(this.topRectHeight) + 44 |
| 485 | } | 482 | } |
| 486 | 483 | ||
| 487 | - this.changeTopStatusBarColor(this.navItem.statusBarColor) | 484 | + ColorUtils.changeTopStatusBarColor(this.navItem.statusBarColor, 1) |
| 488 | 485 | ||
| 489 | } | 486 | } |
| 490 | 487 | ||
| 491 | pageShowChange() { | 488 | pageShowChange() { |
| 492 | - this.changeTopStatusBarColor(this.navItem.statusBarColor) | 489 | + ColorUtils.changeTopStatusBarColor(this.navItem.statusBarColor, 1) |
| 493 | } | 490 | } |
| 494 | 491 | ||
| 495 | - | ||
| 496 | - | ||
| 497 | /** | 492 | /** |
| 498 | * 修改手机顶部状态栏颜色 | 493 | * 修改手机顶部状态栏颜色 |
| 499 | */ | 494 | */ |
| 500 | setBarBackgroundColor() { | 495 | setBarBackgroundColor() { |
| 501 | 496 | ||
| 502 | - Logger.debug('setBarBackgroundColor','setBarBackgroundColor '+this.navItem.name+' '+this._currentNavIndex +' '+this.bottomNavIndex) | ||
| 503 | 497 | ||
| 504 | - if(this._currentNavIndex == this.bottomNavIndex){ | ||
| 505 | - this.changeTopStatusBarColor(this.navItem.statusBarColor) | ||
| 506 | - } | 498 | + if (this._currentNavIndex == this.bottomNavIndex) { |
| 499 | + ColorUtils.changeTopStatusBarColor(this.navItem.statusBarColor, 1) | ||
| 507 | 500 | ||
| 508 | - } | ||
| 509 | - /** | ||
| 510 | - * 修改手机顶部状态栏颜色 | ||
| 511 | - * @param statusValue | ||
| 512 | - */ | ||
| 513 | - changeTopStatusBarColor(statusValue: number) { | ||
| 514 | - if (statusValue === 1) { // 黑色状态栏 | ||
| 515 | - WindowModel.shared.setWindowSystemBarProperties({ | ||
| 516 | - statusBarContentColor: '#000000', | ||
| 517 | - }) | ||
| 518 | - } else { //白色状态栏 | ||
| 519 | - WindowModel.shared.setWindowSystemBarProperties({ | ||
| 520 | - statusBarContentColor: '#ffffff', | ||
| 521 | - }) | 501 | + this.isImmersive = false |
| 502 | + this.barBackgroundColor = Color.White | ||
| 522 | } | 503 | } |
| 504 | + | ||
| 523 | } | 505 | } |
| 506 | + | ||
| 524 | onTopNavigationDataUpdated() { | 507 | onTopNavigationDataUpdated() { |
| 525 | Logger.info(TAG, | 508 | Logger.info(TAG, |
| 526 | `onTopNavigationDataUpdated currentTopNavIndex: ${this.currentTopNavSelectedIndex},topNavList.length:${this.topNavList.length}`); | 509 | `onTopNavigationDataUpdated currentTopNavIndex: ${this.currentTopNavSelectedIndex},topNavList.length:${this.topNavList.length}`); |
| @@ -660,7 +643,6 @@ export struct TopNavigationComponentNew { | @@ -660,7 +643,6 @@ export struct TopNavigationComponentNew { | ||
| 660 | return null | 643 | return null |
| 661 | } | 644 | } |
| 662 | 645 | ||
| 663 | - | ||
| 664 | /** | 646 | /** |
| 665 | * 进入早晚报专题 | 647 | * 进入早晚报专题 |
| 666 | */ | 648 | */ |
| @@ -44,7 +44,7 @@ export struct CustomTitleAndEditUI { | @@ -44,7 +44,7 @@ export struct CustomTitleAndEditUI { | ||
| 44 | if (this.isDisplayButton){ | 44 | if (this.isDisplayButton){ |
| 45 | Button(this.isEditState === true?'取消':'编辑') | 45 | Button(this.isEditState === true?'取消':'编辑') |
| 46 | .type(ButtonType.Normal) | 46 | .type(ButtonType.Normal) |
| 47 | - .fontColor($r('app.color.color_222222')) | 47 | + .fontColor($r('app.color.color_B0B0B0')) |
| 48 | .backgroundColor(Color.White) | 48 | .backgroundColor(Color.White) |
| 49 | .id("edit_Button") | 49 | .id("edit_Button") |
| 50 | .alignRules({ | 50 | .alignRules({ |
| @@ -78,7 +78,7 @@ export struct EmptyComponent { | @@ -78,7 +78,7 @@ export struct EmptyComponent { | ||
| 78 | /** | 78 | /** |
| 79 | * The empty data text opacity. | 79 | * The empty data text opacity. |
| 80 | */ | 80 | */ |
| 81 | - readonly TEXT_OPACITY: number = 0.4; | 81 | + readonly TEXT_OPACITY: number = 1.0; |
| 82 | private timer: number = -1 | 82 | private timer: number = -1 |
| 83 | retry: () => void = () => { | 83 | retry: () => void = () => { |
| 84 | } | 84 | } |
| @@ -113,6 +113,7 @@ export struct LiveLikeComponent { | @@ -113,6 +113,7 @@ export struct LiveLikeComponent { | ||
| 113 | .width(36) | 113 | .width(36) |
| 114 | .height(36) | 114 | .height(36) |
| 115 | .borderRadius(18) | 115 | .borderRadius(18) |
| 116 | + .margin({top:6}) | ||
| 116 | .backgroundColor((this.pageComponentType === 4 || this.pageComponentType === 2) ? '#4D000000' : | 117 | .backgroundColor((this.pageComponentType === 4 || this.pageComponentType === 2) ? '#4D000000' : |
| 117 | this.pageComponentType === 8 ? Color.Transparent : '#FFF5F5F5') | 118 | this.pageComponentType === 8 ? Color.Transparent : '#FFF5F5F5') |
| 118 | 119 | ||
| @@ -120,6 +121,7 @@ export struct LiveLikeComponent { | @@ -120,6 +121,7 @@ export struct LiveLikeComponent { | ||
| 120 | RelativeContainer() { | 121 | RelativeContainer() { |
| 121 | Image(this.styleType == 1 ? $r('app.media.comment_icon_number_bg') : $r('app.media.ic_like_back_Select')) | 122 | Image(this.styleType == 1 ? $r('app.media.comment_icon_number_bg') : $r('app.media.ic_like_back_Select')) |
| 122 | .objectFit(ImageFit.Fill) | 123 | .objectFit(ImageFit.Fill) |
| 124 | + .height(10) | ||
| 123 | .resizable({ | 125 | .resizable({ |
| 124 | slice: { | 126 | slice: { |
| 125 | top: 1, | 127 | top: 1, |
| @@ -144,14 +146,15 @@ export struct LiveLikeComponent { | @@ -144,14 +146,15 @@ export struct LiveLikeComponent { | ||
| 144 | .alignRules({ | 146 | .alignRules({ |
| 145 | top: { anchor: "__container__", align: VerticalAlign.Top }, | 147 | top: { anchor: "__container__", align: VerticalAlign.Top }, |
| 146 | left: { anchor: "__container__", align: HorizontalAlign.Start } | 148 | left: { anchor: "__container__", align: HorizontalAlign.Start } |
| 147 | - })// .margin({left: 4,right:4 | ||
| 148 | - // }) | 149 | + }) |
| 149 | /*动态计算文字宽度*/ | 150 | /*动态计算文字宽度*/ |
| 150 | .width(this.getMeasureText(NumberFormatterUtils.formatNumberWithWan(this.likeCount || '')) + | 151 | .width(this.getMeasureText(NumberFormatterUtils.formatNumberWithWan(this.likeCount || '')) + |
| 151 | - 12)// .backgroundColor(Color.Green) | 152 | + 8)// .backgroundColor(Color.Green) |
| 153 | + .padding({left:2}) | ||
| 152 | .id("Text") | 154 | .id("Text") |
| 153 | .visibility(this.likeCount > 0 ? Visibility.Visible : Visibility.Hidden) | 155 | .visibility(this.likeCount > 0 ? Visibility.Visible : Visibility.Hidden) |
| 154 | } | 156 | } |
| 157 | + .margin({left:10,top:3}) | ||
| 155 | .offset({ | 158 | .offset({ |
| 156 | x: 18 | 159 | x: 18 |
| 157 | }) | 160 | }) |
| @@ -20,6 +20,7 @@ import { EmitterEventId, EmitterUtils } from 'wdKit/Index' | @@ -20,6 +20,7 @@ import { EmitterEventId, EmitterUtils } from 'wdKit/Index' | ||
| 20 | import { ParamType, TrackConstants, TrackingContent } from 'wdTracking/Index'; | 20 | import { ParamType, TrackConstants, TrackingContent } from 'wdTracking/Index'; |
| 21 | import { CommentCustomDialog, CommentDialogInputContent } from '../comment/view/CommentCustomDialog'; | 21 | import { CommentCustomDialog, CommentDialogInputContent } from '../comment/view/CommentCustomDialog'; |
| 22 | import { HttpUtils } from 'wdNetwork/Index'; | 22 | import { HttpUtils } from 'wdNetwork/Index'; |
| 23 | +import { faceDetector } from '@kit.CoreVisionKit'; | ||
| 23 | 24 | ||
| 24 | const TAG = 'LiveOperRowListView'; | 25 | const TAG = 'LiveOperRowListView'; |
| 25 | 26 | ||
| @@ -68,7 +69,8 @@ export struct LiveOperRowListView { | @@ -68,7 +69,8 @@ export struct LiveOperRowListView { | ||
| 68 | @Consume pageId: string | 69 | @Consume pageId: string |
| 69 | @State likesStyle: number | string = "love" // 点赞样式 love爱心型 thumb点赞手势 mourning 蜡烛(默哀) pray 祈福 | 70 | @State likesStyle: number | string = "love" // 点赞样式 love爱心型 thumb点赞手势 mourning 蜡烛(默哀) pray 祈福 |
| 70 | @State openLikes: boolean = false // 是否可以点赞 1:可以 0:不可以 | 71 | @State openLikes: boolean = false // 是否可以点赞 1:可以 0:不可以 |
| 71 | - | 72 | + //非沉浸式 |
| 73 | + private isLlive = false | ||
| 72 | /// comment | 74 | /// comment |
| 73 | @State showCommentInput: boolean = false | 75 | @State showCommentInput: boolean = false |
| 74 | private banComment: boolean = true // 是否已禁言 | 76 | private banComment: boolean = true // 是否已禁言 |
| @@ -138,6 +140,7 @@ export struct LiveOperRowListView { | @@ -138,6 +140,7 @@ export struct LiveOperRowListView { | ||
| 138 | .interpolation(ImageInterpolation.High) | 140 | .interpolation(ImageInterpolation.High) |
| 139 | } | 141 | } |
| 140 | .width(48) | 142 | .width(48) |
| 143 | + .padding({top:10}) | ||
| 141 | .hoverEffect(HoverEffect.Scale) | 144 | .hoverEffect(HoverEffect.Scale) |
| 142 | .visibility(this.showBackIcon ? Visibility.Visible : Visibility.None) | 145 | .visibility(this.showBackIcon ? Visibility.Visible : Visibility.None) |
| 143 | .onClick(() => { | 146 | .onClick(() => { |
| @@ -169,10 +172,11 @@ export struct LiveOperRowListView { | @@ -169,10 +172,11 @@ export struct LiveOperRowListView { | ||
| 169 | .width('100%') | 172 | .width('100%') |
| 170 | .backgroundColor(this.bgColor) | 173 | .backgroundColor(this.bgColor) |
| 171 | .padding({ | 174 | .padding({ |
| 172 | - top: 10, | 175 | + // top: 10, |
| 173 | // bottom: 10 | 176 | // bottom: 10 |
| 174 | - bottom: `${this.bottomSafeHeight}px` | 177 | + bottom: `${this.bottomSafeHeight}px`, |
| 175 | // bottom: 50 | 178 | // bottom: 50 |
| 179 | + right:20 | ||
| 176 | }) | 180 | }) |
| 177 | } | 181 | } |
| 178 | 182 | ||
| @@ -230,6 +234,7 @@ export struct LiveOperRowListView { | @@ -230,6 +234,7 @@ export struct LiveOperRowListView { | ||
| 230 | Blank() | 234 | Blank() |
| 231 | } | 235 | } |
| 232 | } | 236 | } |
| 237 | + .padding({top:10}) | ||
| 233 | .layoutWeight(1) | 238 | .layoutWeight(1) |
| 234 | .margin({ left: 16 }) | 239 | .margin({ left: 16 }) |
| 235 | } | 240 | } |
| @@ -247,6 +252,7 @@ export struct LiveOperRowListView { | @@ -247,6 +252,7 @@ export struct LiveOperRowListView { | ||
| 247 | }) | 252 | }) |
| 248 | } | 253 | } |
| 249 | .width(48) | 254 | .width(48) |
| 255 | + .margin({left:this.isLlive?0:10}) | ||
| 250 | .visibility(this.likesStyle == 4 || this.likesStyle == 'empty' || !this.openLikes ? Visibility.None : Visibility.Visible) | 256 | .visibility(this.likesStyle == 4 || this.likesStyle == 'empty' || !this.openLikes ? Visibility.None : Visibility.Visible) |
| 251 | } | 257 | } |
| 252 | 258 | ||
| @@ -274,8 +280,9 @@ export struct LiveOperRowListView { | @@ -274,8 +280,9 @@ export struct LiveOperRowListView { | ||
| 274 | })*/ | 280 | })*/ |
| 275 | } | 281 | } |
| 276 | .height(36) | 282 | .height(36) |
| 277 | - .width(48) | 283 | + .width(this.isLlive?48:36) |
| 278 | .borderRadius(18) | 284 | .borderRadius(18) |
| 285 | + .margin({top:10,left:this.isLlive?0:10}) | ||
| 279 | .backgroundColor(this.pageComponentType === 2 ? '#4D000000' : Color.Transparent) | 286 | .backgroundColor(this.pageComponentType === 2 ? '#4D000000' : Color.Transparent) |
| 280 | .onClick(() => { | 287 | .onClick(() => { |
| 281 | this.toggleCollectStatus() | 288 | this.toggleCollectStatus() |
| @@ -299,9 +306,10 @@ export struct LiveOperRowListView { | @@ -299,9 +306,10 @@ export struct LiveOperRowListView { | ||
| 299 | this.share() | 306 | this.share() |
| 300 | }) | 307 | }) |
| 301 | } | 308 | } |
| 309 | + .margin({top:10,left:this.isLlive?0:10}) | ||
| 302 | .justifyContent(FlexAlign.Center) | 310 | .justifyContent(FlexAlign.Center) |
| 303 | .height(36) | 311 | .height(36) |
| 304 | - .width(48) | 312 | + .width(this.isLlive?48:36) |
| 305 | .borderRadius(18) | 313 | .borderRadius(18) |
| 306 | .backgroundColor(this.pageComponentType === 2 ? '#4D000000' : Color.Transparent) | 314 | .backgroundColor(this.pageComponentType === 2 ? '#4D000000' : Color.Transparent) |
| 307 | } | 315 | } |
| @@ -13,6 +13,7 @@ | @@ -13,6 +13,7 @@ | ||
| 13 | * limitations under the License. | 13 | * limitations under the License. |
| 14 | */ | 14 | */ |
| 15 | import { common2D, drawing } from '@kit.ArkGraphics2D'; | 15 | import { common2D, drawing } from '@kit.ArkGraphics2D'; |
| 16 | +import { WindowModel } from 'wdKit/Index'; | ||
| 16 | 17 | ||
| 17 | /** | 18 | /** |
| 18 | * RGB颜色类型 | 19 | * RGB颜色类型 |
| @@ -241,7 +242,7 @@ export class ColorUtils { | @@ -241,7 +242,7 @@ export class ColorUtils { | ||
| 241 | /** | 242 | /** |
| 242 | * 获取图片填充的ColorFilter | 243 | * 获取图片填充的ColorFilter |
| 243 | * @param hex 十六进制颜色值 | 244 | * @param hex 十六进制颜色值 |
| 244 | - * @returns undefined:无填充颜色 | 245 | + * @returns undefined:无填充颜色 |
| 245 | */ | 246 | */ |
| 246 | public static getDrawingColorFilter(hex: string): ColorFilter | undefined { | 247 | public static getDrawingColorFilter(hex: string): ColorFilter | undefined { |
| 247 | 248 | ||
| @@ -265,4 +266,28 @@ export class ColorUtils { | @@ -265,4 +266,28 @@ export class ColorUtils { | ||
| 265 | 266 | ||
| 266 | return drawColorFilter | 267 | return drawColorFilter |
| 267 | } | 268 | } |
| 269 | + | ||
| 270 | + | ||
| 271 | + /** | ||
| 272 | + * 修改手机顶部状态栏颜色 | ||
| 273 | + * @param statusValue 动态修改值 | ||
| 274 | + * @param defaultValue 页面默认值:statusValue== null 就按此值走 | ||
| 275 | + */ | ||
| 276 | + public static changeTopStatusBarColor(statusValue: number, defaultValue: number) { | ||
| 277 | + if (statusValue == null) { | ||
| 278 | + statusValue = defaultValue | ||
| 279 | + } else { //白色状态栏 | ||
| 280 | + } | ||
| 281 | + | ||
| 282 | + if (statusValue === 1 || statusValue == null) { // 黑色状态栏 | ||
| 283 | + WindowModel.shared.setWindowSystemBarProperties({ | ||
| 284 | + statusBarContentColor: '#000000', | ||
| 285 | + | ||
| 286 | + }) | ||
| 287 | + } else { //白色状态栏 | ||
| 288 | + WindowModel.shared.setWindowSystemBarProperties({ | ||
| 289 | + statusBarContentColor: '#ffffff', | ||
| 290 | + }) | ||
| 291 | + } | ||
| 292 | + } | ||
| 268 | } | 293 | } |
| 1 | +import { ALL, ImageKnifeOption } from '@ohos/imageknife'; | ||
| 2 | +import { TopNavDTO } from 'wdBean/Index'; | ||
| 3 | + | ||
| 4 | +/** | ||
| 5 | + * 通用工具类,只记录处理build里面组件业务计算逻辑 | ||
| 6 | + */ | ||
| 7 | +export class CommonUtils{ | ||
| 8 | + | ||
| 9 | + | ||
| 10 | + /** | ||
| 11 | + * 获取顶部导航栏的频道option | ||
| 12 | + * @param item | ||
| 13 | + * @param isSelect | ||
| 14 | + * @returns | ||
| 15 | + */ | ||
| 16 | + public static getTopImageKnifeOption(item: TopNavDTO, isSelect: boolean): ImageKnifeOption { | ||
| 17 | + // let defaultIcon = this.getBottomLocalIcon(navItem, isSelect) | ||
| 18 | + let url = isSelect ? item.iconCUrl:item.iconUrl // this.getBottomIcon(navItem, isSelect) | ||
| 19 | + | ||
| 20 | + let imageKnifeOption: ImageKnifeOption = { | ||
| 21 | + loadSrc: url, | ||
| 22 | + // // 占位图使用本地资源 | ||
| 23 | + // placeholderSrc: defaultIcon, | ||
| 24 | + // // 失败占位图使用本地资源 | ||
| 25 | + // errorholderSrc: defaultIcon, | ||
| 26 | + // 是否开启一级内存缓存 | ||
| 27 | + isCacheable: true, | ||
| 28 | + // 磁盘缓存 | ||
| 29 | + strategy: new ALL(), | ||
| 30 | + gif: { | ||
| 31 | + playTimes: 1 | ||
| 32 | + } | ||
| 33 | + }; | ||
| 34 | + return imageKnifeOption | ||
| 35 | + } | ||
| 36 | + | ||
| 37 | + /** | ||
| 38 | + * 计算 频道tab 宽度 | ||
| 39 | + * @param height 已知高度 | ||
| 40 | + * @returns | ||
| 41 | + */ | ||
| 42 | + public static calTopTabWidth(height:number,scale:string):number{ | ||
| 43 | + if(scale){ | ||
| 44 | + | ||
| 45 | + if(scale.includes('*')){ | ||
| 46 | + let scaleArray = scale.split('*'); | ||
| 47 | + return height*Number.parseInt(scaleArray[0])/parseInt(scaleArray[1]) | ||
| 48 | + } | ||
| 49 | + } | ||
| 50 | + return height*210/60 | ||
| 51 | + | ||
| 52 | + } | ||
| 53 | + | ||
| 54 | +} |
| @@ -109,6 +109,7 @@ export struct DetailPlayLivePage { | @@ -109,6 +109,7 @@ export struct DetailPlayLivePage { | ||
| 109 | LiveOperRowListView({ | 109 | LiveOperRowListView({ |
| 110 | operationButtonList: ['comment', 'collect', 'share', 'like'], | 110 | operationButtonList: ['comment', 'collect', 'share', 'like'], |
| 111 | styleType: 1, | 111 | styleType: 1, |
| 112 | + isLlive:this.displayDirection == DisplayDirection.VERTICAL, | ||
| 112 | contentDetailData: this.contentDetailData, | 113 | contentDetailData: this.contentDetailData, |
| 113 | onCommentInputFocus: () => { | 114 | onCommentInputFocus: () => { |
| 114 | // 切换到大家聊 | 115 | // 切换到大家聊 |
| @@ -160,13 +160,13 @@ export struct PlayUIComponent { | @@ -160,13 +160,13 @@ export struct PlayUIComponent { | ||
| 160 | rmhInfo: this.contentDetailData.rmhInfo | 160 | rmhInfo: this.contentDetailData.rmhInfo |
| 161 | }) | 161 | }) |
| 162 | .margin({ | 162 | .margin({ |
| 163 | - top:-7, | 163 | + // top:-7, |
| 164 | right: 10 | 164 | right: 10 |
| 165 | }) | 165 | }) |
| 166 | } | 166 | } |
| 167 | //第二行右边直播状态参与人数 | 167 | //第二行右边直播状态参与人数 |
| 168 | this.getLiveStatusView() | 168 | this.getLiveStatusView() |
| 169 | - } | 169 | + }.margin({top:-7}) |
| 170 | } | 170 | } |
| 171 | .width('100%') | 171 | .width('100%') |
| 172 | // .width(this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL ? 'calc(100% - 80vp)' : 'calc(100% - 32vp)') | 172 | // .width(this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL ? 'calc(100% - 80vp)' : 'calc(100% - 32vp)') |
| @@ -35,11 +35,9 @@ export struct BottomNavigationComponent { | @@ -35,11 +35,9 @@ export struct BottomNavigationComponent { | ||
| 35 | @Provide currentBottomNavInfo: BottomNavDTO = {} as BottomNavDTO; // 当前底导信息 | 35 | @Provide currentBottomNavInfo: BottomNavDTO = {} as BottomNavDTO; // 当前底导信息 |
| 36 | @Provide currentTopNavInfo: TopNavDTO = {} as TopNavDTO; // 当前顶导信息 | 36 | @Provide currentTopNavInfo: TopNavDTO = {} as TopNavDTO; // 当前顶导信息 |
| 37 | @Provide barBackgroundColor: Color = Color.Transparent | 37 | @Provide barBackgroundColor: Color = Color.Transparent |
| 38 | - // @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 | ||
| 39 | @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 | 38 | @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 |
| 40 | @State @Watch('onBottomNavigationDataUpdated') bottomNavList: BottomNavDTO[] = [] // 底导/顶导全部数据 | 39 | @State @Watch('onBottomNavigationDataUpdated') bottomNavList: BottomNavDTO[] = [] // 底导/顶导全部数据 |
| 41 | @State currentNavIndex: number = BottomNavi.NEWS; // 底导当前选中/焦点下标 | 40 | @State currentNavIndex: number = BottomNavi.NEWS; // 底导当前选中/焦点下标 |
| 42 | - // @State topNavList: TopNavDTO[] = [] | ||
| 43 | // 底导TabsController | 41 | // 底导TabsController |
| 44 | private navController: TabsController = new TabsController(); | 42 | private navController: TabsController = new TabsController(); |
| 45 | readonly ASPECT_RATIO_1_1: number = 1 / 1; // 底导图片宽高比 | 43 | readonly ASPECT_RATIO_1_1: number = 1 / 1; // 底导图片宽高比 |
| @@ -281,7 +279,6 @@ export struct BottomNavigationComponent { | @@ -281,7 +279,6 @@ export struct BottomNavigationComponent { | ||
| 281 | 279 | ||
| 282 | onBottomNavigationDataUpdated() { | 280 | onBottomNavigationDataUpdated() { |
| 283 | Logger.error('yyyy', 'onBottomNavigationDataUpdated ' + JSON.stringify(this.bottomNavList)) | 281 | Logger.error('yyyy', 'onBottomNavigationDataUpdated ' + JSON.stringify(this.bottomNavList)) |
| 284 | - // Logger.info(TAG, `onBottomNavigationDataUpdated currentNavIndex: ${this.currentNavIndex},length:${this.bottomNavItemList.length}`); | ||
| 285 | } | 282 | } |
| 286 | 283 | ||
| 287 | /** | 284 | /** |
| @@ -2,15 +2,16 @@ | @@ -2,15 +2,16 @@ | ||
| 2 | * 视频频道,包含视频和直播 | 2 | * 视频频道,包含视频和直播 |
| 3 | * 视频为沉浸式,直播同新闻页面 | 3 | * 视频为沉浸式,直播同新闻页面 |
| 4 | */ | 4 | */ |
| 5 | -import { BottomNavDTO, TopNavDTO } from 'wdBean/Index' | 5 | +import { BottomNavDTO, TopNavDTO } from 'wdBean/Index'; |
| 6 | import { VideoChannelDetail } from 'wdDetailPlayShortVideo/Index'; | 6 | import { VideoChannelDetail } from 'wdDetailPlayShortVideo/Index'; |
| 7 | import { WDRouterPage, WDRouterRule } from 'wdRouter'; | 7 | import { WDRouterPage, WDRouterRule } from 'wdRouter'; |
| 8 | import { DisplayDirection } from 'wdConstant/Index'; | 8 | import { DisplayDirection } from 'wdConstant/Index'; |
| 9 | import { CompUtils, PageComponent } from 'wdComponent/Index'; | 9 | import { CompUtils, PageComponent } from 'wdComponent/Index'; |
| 10 | -import { TrackingButton, TrackConstants } from 'wdTracking/Index'; | ||
| 11 | -import { Logger, WindowModel } from 'wdKit'; | ||
| 12 | -import { ParamType, Tracking } from 'wdTracking/Index'; | 10 | +import { ParamType, TrackConstants, Tracking, TrackingButton } from 'wdTracking/Index'; |
| 11 | +import { Logger } from 'wdKit'; | ||
| 13 | import { ColorUtils } from 'wdComponent/src/main/ets/utils/ColorUtils'; | 12 | import { ColorUtils } from 'wdComponent/src/main/ets/utils/ColorUtils'; |
| 13 | +import { ImageKnifeComponent } from '@ohos/imageknife'; | ||
| 14 | +import { CommonUtils } from 'wdComponent/src/main/ets/utils/CommonUtils'; | ||
| 14 | 15 | ||
| 15 | const TAG = 'VideoChannelPage' | 16 | const TAG = 'VideoChannelPage' |
| 16 | 17 | ||
| @@ -39,7 +40,6 @@ export struct VideoChannelPage { | @@ -39,7 +40,6 @@ export struct VideoChannelPage { | ||
| 39 | navItem: BottomNavDTO = {} as BottomNavDTO | 40 | navItem: BottomNavDTO = {} as BottomNavDTO |
| 40 | // 背景高度 | 41 | // 背景高度 |
| 41 | @State backgroundImageH: number = 0 | 42 | @State backgroundImageH: number = 0 |
| 42 | - | ||
| 43 | @Consume @Watch('setBarBackgroundColor') pageShow: number | 43 | @Consume @Watch('setBarBackgroundColor') pageShow: number |
| 44 | 44 | ||
| 45 | async aboutToAppear() { | 45 | async aboutToAppear() { |
| @@ -48,44 +48,24 @@ export struct VideoChannelPage { | @@ -48,44 +48,24 @@ export struct VideoChannelPage { | ||
| 48 | this.setBarBackgroundColor() | 48 | this.setBarBackgroundColor() |
| 49 | } | 49 | } |
| 50 | 50 | ||
| 51 | - | ||
| 52 | /** | 51 | /** |
| 53 | * 顶导、底导切换下标都到改变背景色,进入或退出沉浸式 | 52 | * 顶导、底导切换下标都到改变背景色,进入或退出沉浸式 |
| 54 | */ | 53 | */ |
| 55 | setBarBackgroundColor() { | 54 | setBarBackgroundColor() { |
| 56 | 55 | ||
| 57 | - Logger.debug('setBarBackgroundColor','setBarBackgroundColor '+this.navItem.name+' '+this.navItem.statusBarColor) | ||
| 58 | - | ||
| 59 | - if (this.currentTopNavSelectedIndex === 0 && CompUtils.isVideo(this.currentBottomNavInfo)) { | 56 | + if (this.isImmerseChannel() && CompUtils.isVideo(this.currentBottomNavInfo)) { |
| 60 | this.barBackgroundColor = Color.Black | 57 | this.barBackgroundColor = Color.Black |
| 61 | this.isImmersive = true | 58 | this.isImmersive = true |
| 62 | - this.changeTopStatusBarColor(0) | 59 | + ColorUtils.changeTopStatusBarColor(0, 0) // 沉浸页面顶部导航栏颜色固定黑色 |
| 63 | } else { | 60 | } else { |
| 64 | this.isImmersive = false | 61 | this.isImmersive = false |
| 65 | this.barBackgroundColor = Color.White | 62 | this.barBackgroundColor = Color.White |
| 66 | - this.changeTopStatusBarColor(this.navItem.statusBarColor) | 63 | + ColorUtils.changeTopStatusBarColor(this.navItem.statusBarColor, 1) |
| 67 | } | 64 | } |
| 68 | 65 | ||
| 69 | } | 66 | } |
| 70 | 67 | ||
| 71 | /** | 68 | /** |
| 72 | - * 修改手机顶部状态栏颜色 | ||
| 73 | - * @param statusValue | ||
| 74 | - */ | ||
| 75 | - changeTopStatusBarColor(statusValue: number) { | ||
| 76 | - if (statusValue === 1) { // 黑色状态栏 | ||
| 77 | - WindowModel.shared.setWindowSystemBarProperties({ | ||
| 78 | - statusBarContentColor: '#000000', | ||
| 79 | - | ||
| 80 | - }) | ||
| 81 | - } else { //白色状态栏 | ||
| 82 | - WindowModel.shared.setWindowSystemBarProperties({ | ||
| 83 | - statusBarContentColor: '#ffffff', | ||
| 84 | - }) | ||
| 85 | - } | ||
| 86 | - } | ||
| 87 | - | ||
| 88 | - /** | ||
| 89 | * 得到顶导文字颜色 | 69 | * 得到顶导文字颜色 |
| 90 | * @param item | 70 | * @param item |
| 91 | * @param index | 71 | * @param index |
| @@ -132,28 +112,35 @@ export struct VideoChannelPage { | @@ -132,28 +112,35 @@ export struct VideoChannelPage { | ||
| 132 | Row() { | 112 | Row() { |
| 133 | ForEach(this.topNavList, (item: TopNavDTO, index: number) => { | 113 | ForEach(this.topNavList, (item: TopNavDTO, index: number) => { |
| 134 | Column() { | 114 | Column() { |
| 135 | - | ||
| 136 | - Text(item.name) | ||
| 137 | - .fontSize($r('app.float.selected_text_size')) | ||
| 138 | - .fontWeight(this.currentTopNavSelectedIndex === index ? FontWeight.Bold : FontWeight.Normal) | ||
| 139 | - .fontColor(this.getTopNavFontColor(item, index)) | ||
| 140 | - .padding({ | ||
| 141 | - top: $r('app.float.top_tab_item_padding_top'), | ||
| 142 | - bottom: $r('app.float.top_tab_item_padding_bottom') | 115 | + if (item.iconUrl && item.iconCUrl) { |
| 116 | + // 有图 | ||
| 117 | + ImageKnifeComponent({ | ||
| 118 | + imageKnifeOption: CommonUtils.getTopImageKnifeOption(item, this.currentTopNavSelectedIndex === index) | ||
| 143 | }) | 119 | }) |
| 144 | - .maxLines(this.MAX_LINE) | ||
| 145 | - | ||
| 146 | - | ||
| 147 | - Image($r('app.media.icon_channel_active')) | ||
| 148 | - .colorFilter(ColorUtils.getDrawingColorFilter(this.getBothColor(""))) | ||
| 149 | - .width(20) | ||
| 150 | - .height(3).visibility(this.currentTopNavSelectedIndex === index ? Visibility.Visible : Visibility.Hidden) | ||
| 151 | - | 120 | + .height(36) |
| 121 | + .width(CommonUtils.calTopTabWidth(36, item.iconUrlSize)) | ||
| 122 | + .enabled(false) | ||
| 123 | + } else { | ||
| 124 | + Text(item.name) | ||
| 125 | + .fontSize($r('app.float.selected_text_size')) | ||
| 126 | + .fontWeight(this.currentTopNavSelectedIndex === index ? FontWeight.Bold : FontWeight.Normal) | ||
| 127 | + .fontColor(this.getTopNavFontColor(item, index)) | ||
| 128 | + .padding({ | ||
| 129 | + top: $r('app.float.top_tab_item_padding_top'), | ||
| 130 | + bottom: $r('app.float.top_tab_item_padding_bottom') | ||
| 131 | + }) | ||
| 132 | + .maxLines(this.MAX_LINE) | ||
| 133 | + | ||
| 134 | + Image($r('app.media.icon_channel_active'))// .colorFilter(ColorUtils.getDrawingColorFilter(this.getBothColor(""))) | ||
| 135 | + .width(20) | ||
| 136 | + .height(3) | ||
| 137 | + .visibility(this.currentTopNavSelectedIndex === index ? Visibility.Visible : Visibility.Hidden) | ||
| 152 | 138 | ||
| 139 | + } | ||
| 153 | } | 140 | } |
| 154 | .padding({ | 141 | .padding({ |
| 155 | - left: $r('app.float.top_tab_item_padding_horizontal'), | ||
| 156 | - right: $r('app.float.top_tab_item_padding_horizontal'), | 142 | + left: item.iconUrl && item.iconCUrl ? 0 : $r('app.float.top_tab_item_padding_horizontal'), |
| 143 | + right: item.iconUrl && item.iconCUrl ? 0 : $r('app.float.top_tab_item_padding_horizontal'), | ||
| 157 | }) | 144 | }) |
| 158 | .onClick(() => { | 145 | .onClick(() => { |
| 159 | // 视频tab埋点 | 146 | // 视频tab埋点 |
| @@ -180,9 +167,9 @@ export struct VideoChannelPage { | @@ -180,9 +167,9 @@ export struct VideoChannelPage { | ||
| 180 | 167 | ||
| 181 | // 搜索按钮 | 168 | // 搜索按钮 |
| 182 | Row() { | 169 | Row() { |
| 183 | - Image($r(this.currentTopNavSelectedIndex === 0 ? 'app.media.icon_search_gray_svg' : | 170 | + Image($r(this.isImmerseChannel() ? 'app.media.icon_search_gray_svg' : |
| 184 | 'app.media.icon_search')) | 171 | 'app.media.icon_search')) |
| 185 | - .colorFilter(this.currentTopNavSelectedIndex === 0 ? undefined : | 172 | + .colorFilter(this.isImmerseChannel() ? undefined : |
| 186 | ColorUtils.getDrawingColorFilter(this.getBothColor(""))) | 173 | ColorUtils.getDrawingColorFilter(this.getBothColor(""))) |
| 187 | .width('24vp') | 174 | .width('24vp') |
| 188 | .height('24vp') | 175 | .height('24vp') |
| @@ -212,6 +199,15 @@ export struct VideoChannelPage { | @@ -212,6 +199,15 @@ export struct VideoChannelPage { | ||
| 212 | } | 199 | } |
| 213 | 200 | ||
| 214 | /** | 201 | /** |
| 202 | + * 检测是否是沉浸式频道 | ||
| 203 | + * @returns | ||
| 204 | + */ | ||
| 205 | + isImmerseChannel(): boolean { | ||
| 206 | + | ||
| 207 | + return this.navItem.topNavChannelList[this.currentTopNavSelectedIndex].channelStyle === 1; | ||
| 208 | + } | ||
| 209 | + | ||
| 210 | + /** | ||
| 215 | * 两侧文字图标颜色,搜索图标颜色 | 211 | * 两侧文字图标颜色,搜索图标颜色 |
| 216 | * @returns | 212 | * @returns |
| 217 | */ | 213 | */ |
| @@ -224,7 +220,7 @@ export struct VideoChannelPage { | @@ -224,7 +220,7 @@ export struct VideoChannelPage { | ||
| 224 | pageSwiperView() { | 220 | pageSwiperView() { |
| 225 | Swiper(this.swiperController) { | 221 | Swiper(this.swiperController) { |
| 226 | ForEach(this.topNavList, (item: TopNavDTO, index: number) => { | 222 | ForEach(this.topNavList, (item: TopNavDTO, index: number) => { |
| 227 | - if (index == 0) { | 223 | + if (item.channelStyle === 1) { |
| 228 | // 视频 | 224 | // 视频 |
| 229 | VideoChannelDetail({ | 225 | VideoChannelDetail({ |
| 230 | bottomNavIndex: $_currentNavIndex, | 226 | bottomNavIndex: $_currentNavIndex, |
| @@ -246,8 +242,7 @@ export struct VideoChannelPage { | @@ -246,8 +242,7 @@ export struct VideoChannelPage { | ||
| 246 | pageId: item.pageId + '', | 242 | pageId: item.pageId + '', |
| 247 | channelId: item.channelId + '', | 243 | channelId: item.channelId + '', |
| 248 | autoRefresh: this.autoRefresh | 244 | autoRefresh: this.autoRefresh |
| 249 | - })// .padding({ top: px2vp(this.topSafeHeight) + 44 }) | ||
| 250 | - .backgroundColor(Color.White) | 245 | + }).backgroundColor(Color.White) |
| 251 | } | 246 | } |
| 252 | 247 | ||
| 253 | } | 248 | } |
-
Please register or login to post a comment