Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
王士厅
2024-06-06 19:31:52 +0800
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
cc054078314aa8f1e46acdfaea388c213e93c47b
cc054078
2 parents
c5893568
bc22eca9
Merge branch 'main' of
http://192.168.1.42/developOne/harmonyPool
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
203 additions
and
66 deletions
sight_harmony/commons/wdKit/src/main/ets/reusable/CustomToast.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card16Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/TopNavigationComponentNew.ets
sight_harmony/features/wdComponent/src/main/ets/components/peopleShip/PeopleShipMainComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/view/HorizontalStrokeCardThreeTwoRadioForMoreComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/view/LiveHorizontalCardComponent.ets
sight_harmony/features/wdComponent/src/main/ets/utils/CompUtils.ets
sight_harmony/features/wdComponent/src/main/ets/utils/lazyloadImg.ets
sight_harmony/features/wdDetailPlayLive/src/main/ets/pages/DetailPlayLivePage.ets
sight_harmony/features/wdDetailPlayLive/src/main/ets/pages/DetailPlayVLivePage.ets
sight_harmony/products/phone/src/main/ets/pages/column/ColumnPage.ets
sight_harmony/products/phone/src/main/ets/pages/launchPage/LaunchInterestsHobbiesPage.ets
sight_harmony/products/phone/src/main/ets/pages/view/BottomNavigationComponent.ets
sight_harmony/products/phone/src/main/ets/pages/view/VideoChannelPage.ets
sight_harmony/commons/wdKit/src/main/ets/reusable/CustomToast.ets
View file @
cc05407
...
...
@@ -11,6 +11,7 @@ export struct CustomToast {
fontSizeValue :number | string | Resource = "27lpx"
lineHeightValue :number | string | Resource = "38lpx"
controller: CustomDialogController
marginTop :number | string | Resource = 0
dismiss: () => void = () => {
}
...
...
@@ -38,5 +39,6 @@ export struct CustomToast {
.padding({top:"23lpx",bottom:'23lpx',left:"35lpx",right:"35lpx"})
.backgroundColor(this.bgColor)
.opacity(this.opacityValue)
.margin({top:this.marginTop})
}
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card16Component.ets
View file @
cc05407
...
...
@@ -12,7 +12,8 @@ import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed
const TAG = 'Card16Component';
interface fullColumnImgUrlItem {
url: string
url: string,
fullUrl: string
}
...
...
@@ -81,16 +82,46 @@ export struct Card16Component {
.lineHeight(25)
}
if (this.contentDTO.fullColumnImgUrls?.length > 0) {
Flex() {
//三图
Stack(){
Row() {
GridRow({ gutter: 2 }) {
ForEach(this.contentDTO.fullColumnImgUrls.slice(0, 3), (item: fullColumnImgUrlItem, index: number) => {
Image(this.loadImg ? item.url : '')
if (index < 3) {
GridCol({ span: { xs: 4 } }) {
Image(this.loadImg ? item.url || item.fullUrl : '')
.backgroundColor(0xf5f5f5)
.flexBasis(113)
.height(75)
.margin({ right: index > 1 ? 0 : 2 })
.width('100%')
.aspectRatio(113 / 75)
.borderRadius({
topLeft: index === 0 ? $r('app.float.image_border_radius') : 0,
topRight: index === 2 ? $r('app.float.image_border_radius') : 0,
bottomLeft: index === 0 ? $r('app.float.image_border_radius') : 0,
bottomRight: index === 2 ? $r('app.float.image_border_radius') : 0,
})
}
}
})
}
}
.width(CommonConstants.FULL_PARENT)
.margin({ top: 8 })
CardMediaInfo({
contentDTO: this.contentDTO
})
}
.width(CommonConstants.FULL_PARENT)
.alignContent(Alignment.BottomEnd)
// Flex() {
// ForEach(this.contentDTO.fullColumnImgUrls.slice(0, 3), (item: fullColumnImgUrlItem, index: number) => {
// Image(this.loadImg ? item.url : '')
// .backgroundColor(0xf5f5f5)
// .flexBasis(113)
// .height(75)
// .margin({ right: index > 1 ? 0 : 2 })
// })
// }
}
CarderInteraction({contentDTO: this.contentDTO})
//TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/page/TopNavigationComponentNew.ets
View file @
cc05407
...
...
@@ -11,6 +11,7 @@ import { channelSkeleton } from '../skeleton/channelSkeleton';
import { TrackConstants, TrackingButton } from 'wdTracking/Index';
import DailyPaperTopicModel from '../../model/DailyPaperTopicModel'
import { ParamType, Tracking } from 'wdTracking/Index';
import { CompUtils } from '../../utils/CompUtils';
const TAG = 'TopNavigationComponent';
...
...
@@ -23,27 +24,16 @@ const storage = LocalStorage.getShared();
@Component
export struct TopNavigationComponentNew {
private topRectHeight: string = AppStorage.get<number>('topSafeHeight') + 'px';
/**
* @deprecated
*/
private groupId: number = 0
/**
* @deprecated TODO type判断
*/
private currentBottomNavName: string = ''
private pageName: string = ''
private pageId: number = 0
private swiperController: SwiperController = new SwiperController()
private listScroller: Scroller = new Scroller()
@Consume barBackgroundColor: Color
/**
*
@deprecated
*
首页 底导 某个tab 对象
*/
@State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
/**
* @deprecated
*/
@State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
navItem: BottomNavDTO = {} as BottomNavDTO
@Consume barBackgroundColor: Color
@Link _currentNavIndex?: number;
// 顶导当前选中/焦点下标
@State @Watch('updateCurrentTopNavSelectedIndex') currentTopNavSelectedIndex: number = 0;
...
...
@@ -70,7 +60,6 @@ export struct TopNavigationComponentNew {
@State animationDuration: number = 0
@State indicatorLeftMargin: number = 0
@State indicatorWidth: number = 0
private tabsWidth: number = 0
build() {
Column() {
...
...
@@ -78,9 +67,10 @@ export struct TopNavigationComponentNew {
RelativeContainer() {
this.tabBar()
Swiper(this.swiperController) {
ForEach(
this.currentBottomNavName === '新闻'
? this.myChannelList : this.topNavList,
ForEach(
CompUtils.isNews(this.navItem)
? this.myChannelList : this.topNavList,
(navItem: TopNavDTO, index: number) => {
if (this.currentBottomNavName === '人民号' && navItem.name === '关注') {
if (CompUtils.isRMH(this.navItem) && navItem.channelType === 3) {
// 人民号 -- 关注tab
PeopleShipMainComponent({
currentTopNavSelectedIndex: $currentTopNavSelectedIndex,
navIndex: index,
...
...
@@ -203,8 +193,7 @@ export struct TopNavigationComponentNew {
@Builder
tabBar() {
// TODO 判断是否新闻tab,修改方法(,_currentNavIndex==0 都不对,需要用type)(用topStyle)
if (this.currentBottomNavName === '新闻') {
if (CompUtils.isNews(this.navItem)) {
// 顶部搜索、日报logo、早晚报
this.topBar()
ChannelSubscriptionLayout({
...
...
@@ -233,13 +222,9 @@ export struct TopNavigationComponentNew {
.listDirection(Axis.Horizontal)
.scrollBar(BarState.Off)
.edgeEffect(EdgeEffect.None)
.padding({ left: 8, top:0, right: 0 })
.padding({ left: 8, top:
0, right: 0 })
.height($r('app.float.top_tab_bar_height'))
.backgroundColor(this.barBackgroundColor)
.onAreaChange((oldValue: Area, newValue: Area) => {
let width = Number.parseFloat(newValue.width.toString())
this.tabsWidth = Number.isNaN(width) ? 0 : width
})
.id('tabList')
.alignRules({
'top': { 'anchor': 'topBar', 'align': VerticalAlign.Bottom },
...
...
@@ -278,10 +263,6 @@ export struct TopNavigationComponentNew {
.listDirection(Axis.Horizontal)
.scrollBar(BarState.Off)
.edgeEffect(EdgeEffect.None)
.onAreaChange((oldValue: Area, newValue: Area) => {
let width = Number.parseFloat(newValue.width.toString())
this.tabsWidth = Number.isNaN(width) ? 0 : width
})
.height($r('app.float.top_tab_bar_height_common'))
.backgroundColor(this.barBackgroundColor)
.id('tabList')
...
...
@@ -347,14 +328,18 @@ export struct TopNavigationComponentNew {
} else if (this.isLayoutByIndex(index)) {
ProcessUtils.gotoENewsPaper()
} else {
this.currentTopNavSelectedIndex = index
this.changePage(index)
}
}
})
}
/**
* 改变频道页
* @param index 频道所在的序列号
*/
private changePage(index: number) {
this.currentTopNavSelectedIndex = index
this.swiperController.changeIndex(index)
this.listScroller.scrollToIndex(index, true, ScrollAlign.CENTER)
}
...
...
@@ -494,10 +479,9 @@ export struct TopNavigationComponentNew {
}
updateCurrentTopNavSelectedIndex() {
Logger.info(TAG, `currentTopNavSelectedIndex : ${this.currentTopNavSelectedIndex}、${this.currentBottomNavName}`);
// 顶部tab埋点
if (
this.currentBottomNavName === '新闻'
) {
if (
CompUtils.isVideo(this.navItem)
) {
const tab = this.myChannelList[this.currentTopNavSelectedIndex]
Logger.info(TAG, `新闻tab埋点: ${JSON.stringify(tab)}`);
...
...
@@ -507,7 +491,7 @@ export struct TopNavigationComponentNew {
"pageId": tab.pageId,
}
Tracking.event("home_page_tab_click ", params)
} else if (
this.currentBottomNavName === '人民号'
) {
} else if (
CompUtils.isRMH(this.navItem)
) {
const tab = this.topNavList[this.currentTopNavSelectedIndex]
Logger.info(TAG, `人民号tab埋点: ${JSON.stringify(tab)}`);
...
...
sight_harmony/features/wdComponent/src/main/ets/components/peopleShip/PeopleShipMainComponent.ets
View file @
cc05407
...
...
@@ -26,7 +26,9 @@ import { PeopleShipAttentionContentListTopComponent } from './PeopleShipAttentio
import { CardParser } from '../CardParser'
import { PeopleShipNoMoreData } from '../reusable/PeopleShipNoMoreData';
const TAG = 'PeopleShipMainComponent';
@Preview
/**
* 人民号 --- 关注
*/
@Component
export struct PeopleShipMainComponent {
@State private pageModel: PageModel = new PageModel();
...
...
@@ -422,6 +424,7 @@ export struct PeopleShipMainComponent {
}
// 当前页面,自动刷新数据
Logger.debug(TAG, 'page onAutoRefresh ' + this.autoRefresh)
this.listScroller.scrollToIndex(0)
this.currentPage = 1
this.getData()
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/view/HorizontalStrokeCardThreeTwoRadioForMoreComponent.ets
View file @
cc05407
...
...
@@ -2,6 +2,7 @@ import { CommonConstants } from 'wdConstant'
import { ContentDTO, CompDTO, Action, Params } from 'wdBean'
import { ProcessUtils, WDRouterRule, WDRouterPage } from 'wdRouter';
import { InfomationCardClick } from '../../utils/infomationCardClick';
import { CardMediaInfo } from '../cardCommon/CardMediaInfo'
@Component
export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent {
...
...
@@ -128,11 +129,18 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent {
Row() {
ForEach(this.compDTO.operDataList, (item: ContentDTO, index: number) => {
Column() {
Stack() {
Image(item.coverUrl)
.aspectRatio(1.5)
.width(this.compDTO.operDataList.length == 2 ? 210 : 150)
.borderRadius(4)
.objectFit(ImageFit.Cover)
CardMediaInfo({
livePeopleNum:false,
contentDTO: item
})
}
.align(Alignment.BottomEnd)
Text(item.newsTitle)
.fontSize($r("app.float.font_size_14"))
...
...
@@ -143,10 +151,9 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent {
.textAlign(TextAlign.Start)
.margin({ top: 8 })
.width(this.compDTO.operDataList.length == 2 ? 210 : 150)
.lineHeight(19)
.lineHeight(21)
}
.height(
134
)
.height(
this.compDTO.operDataList.length == 2 ? 190 : 150
)
.padding({ right: 16 })
// .offset({x:16})
.onClick(() => {
...
...
@@ -218,7 +225,7 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent {
left: $r('app.float.card_comp_pagePadding_lf'),
right: $r('app.float.card_comp_pagePadding_lf'),
top: $r('app.float.card_comp_pagePadding_tb'),
bottom:
$r('app.float.card_comp_pagePadding_tb')
bottom:
6
})
.backgroundColor($r("app.color.white"))
// .backgroundColor($r("app.color.color_FE4B05"))
...
...
sight_harmony/features/wdComponent/src/main/ets/components/view/LiveHorizontalCardComponent.ets
View file @
cc05407
...
...
@@ -170,7 +170,7 @@ export struct LiveHorizontalCardComponent {
.width(this.compDTO.operDataList.length == 2 ? 210 : 150)
.lineHeight(21)
}
.height(
134
)
.height(
this.compDTO.operDataList.length == 2 ? 190 : 150
)
.padding({ right: 16 })
.onClick(() => {
InfomationCardClick.track(this.compDTO, item, this.pageId, this.pageName)
...
...
@@ -243,7 +243,7 @@ export struct LiveHorizontalCardComponent {
left: $r('app.float.card_comp_pagePadding_lf'),
right: $r('app.float.card_comp_pagePadding_lf'),
top: $r('app.float.card_comp_pagePadding_tb'),
bottom:
$r('app.float.card_comp_pagePadding_tb')
bottom:
6
})
.backgroundColor($r("app.color.white"))
}
...
...
sight_harmony/features/wdComponent/src/main/ets/utils/CompUtils.ets
View file @
cc05407
...
...
@@ -32,6 +32,45 @@ export class CompUtils {
}
/**
* 是视频tab
* @param navItem
* @returns
*/
static isVideo(navItem: BottomNavDTO) : boolean{
if (navItem == null) {
return false;
}
return navItem.topStyle === '13';
}
/**
* 是新闻tab
* @param navItem
* @returns
*/
static isNews(navItem: BottomNavDTO) : boolean{
if (navItem == null) {
return false;
}
return navItem.topStyle === '11';
}
/**
* 是人民号tab
* @param navItem
* @returns
*/
static isRMH(navItem: BottomNavDTO) : boolean{
if (navItem == null) {
return false;
}
return navItem.topStyle === '12';
}
/**
* 获取Label标题
*
* @param component 组件bean
...
...
sight_harmony/features/wdComponent/src/main/ets/utils/lazyloadImg.ets
View file @
cc05407
...
...
@@ -15,4 +15,18 @@ async function onlyWifiLoadImg(): Promise<boolean> {
return false
}
export { onlyWifiLoadImg }
\ No newline at end of file
async function onlyWifiLoadVideo(): Promise<boolean> {
let loadImageOnlyWifiSwitch = await SPHelper.default.get(SpConstants.SETTING_WIFI_VIDEO_SWITCH, '') || false;
if (!loadImageOnlyWifiSwitch) {
// 开关没开,直接让加载视频
return true
}
let netWorkStatus = NetworkUtil.getNetworkType();
// 开关打开,wifi下才加载视频
if (netWorkStatus === NetworkUtil.TYPE_WIFI) {
return true
}
return false
}
export { onlyWifiLoadImg,onlyWifiLoadVideo }
\ No newline at end of file
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/pages/DetailPlayLivePage.ets
View file @
cc05407
...
...
@@ -4,12 +4,13 @@ import { TabComponent } from '../widgets/details/TabComponent';
import { TopPlayComponent } from '../widgets/details/video/TopPlayComponet';
import { DisplayDirection } from 'wdConstant/Index';
import mediaquery from '@ohos.mediaquery';
import { Logger, WindowModel } from 'wdKit/Index';
import {
CustomToast,
Logger, WindowModel } from 'wdKit/Index';
import { router, window } from '@kit.ArkUI';
import { WDAliPlayerController } from 'wdPlayer/Index';
import { LiveOperRowListView } from 'wdComponent';
import { publishCommentModel } from 'wdComponent/src/main/ets/components/comment/model/PublishCommentModel';
import { TrackConstants, TrackingContent, TrackParamConvert } from 'wdTracking/Index';
import { onlyWifiLoadVideo } from 'wdComponent/src/main/ets/utils/lazyloadImg';
let TAG: string = 'DetailPlayLivePage';
...
...
@@ -41,7 +42,28 @@ export struct DetailPlayLivePage {
// 顶部状态栏高度
@Consume topSafeHeight: number
aboutToAppear(): void {
@State toastText: ResourceStr = "这是一个非Wi-Fi环境。请注意流量消耗"
dialogToast: CustomDialogController = new CustomDialogController({
builder: CustomToast({
bgColor: 0xB3000000,
opacityValue: 1,
fontSizeValue: "25lpx",
lineHeightValue: "36lpx",
msg: this.toastText,
marginTop:211/2+px2vp(this.topSafeHeight)-px2vp(84/2)
}),
autoCancel: false,
alignment: DialogAlignment.Top,
customStyle: true,
maskColor: "#00000000"
})
showToastTip(msg: ResourceStr) {
this.toastText = msg
this.dialogToast.open()
}
async aboutToAppear(): Promise<void> {
Logger.info(TAG, `wyj-aboutToAppear`)
this.listener?.on("change", (mediaQueryResult) => {
...
...
@@ -56,6 +78,9 @@ export struct DetailPlayLivePage {
this.getLiveDetails()
this.getLiveRoomData()
if(!await onlyWifiLoadVideo()){
this.showToastTip(this.toastText)
}
}
async aboutToDisappear() {
...
...
@@ -115,7 +140,6 @@ export struct DetailPlayLivePage {
}
.height('100%')
.width('100%')
}
onPageShowCus(): void {
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/pages/DetailPlayVLivePage.ets
View file @
cc05407
import { ContentDetailDTO, LiveRoomDataBean } from 'wdBean/Index';
import { LiveViewModel } from '../viewModel/LiveViewModel';
import { WindowModel } from 'wdKit/Index';
import {
CustomToast,
WindowModel } from 'wdKit/Index';
import { PlayerComponent } from '../widgets/vertical/PlayerComponent';
import { PlayerInfoComponent } from '../widgets/vertical/PlayerInfoComponent';
import { WDAliPlayerController } from 'wdPlayer/Index';
...
...
@@ -9,6 +9,7 @@ import { LiveEmptyComponent, WDLiveViewDefaultType } from 'wdComponent/Index';
import { PlayerEndView } from '../widgets/vertical/PlayerEndView';
import { TrackConstants, TrackingButton } from 'wdTracking/Index';
import { LiveDetailPageLogic } from '../viewModel/LiveDetailPageLogic';
import { onlyWifiLoadVideo } from 'wdComponent/src/main/ets/utils/lazyloadImg';
const storage = LocalStorage.getShared();
const TAG = 'DetailPlayVLivePage'
...
...
@@ -40,11 +41,32 @@ export struct DetailPlayVLivePage {
//播放错误
@State isPlayerError: boolean = false
@State isCanplay: boolean = false
@State toastText: ResourceStr = "这是一个非Wi-Fi环境。请注意流量消耗"
dialogToast: CustomDialogController = new CustomDialogController({
builder: CustomToast({
bgColor: 0xB3000000,
opacityValue: 1,
fontSizeValue: "25lpx",
lineHeightValue: "36lpx",
msg: this.toastText,
}),
autoCancel: false,
alignment: DialogAlignment.Center,
customStyle: true,
maskColor: "#00000000"
})
showToastTip(msg: ResourceStr) {
this.toastText = msg
this.dialogToast.open()
}
a
boutToAppear(): void
{
a
sync aboutToAppear(): Promise<void>
{
this.openFullScreen()
this.getLiveRoomData()
if(!await onlyWifiLoadVideo()){
this.showToastTip(this.toastText)
}
}
aboutToDisappear(): void {
...
...
sight_harmony/products/phone/src/main/ets/pages/column/ColumnPage.ets
View file @
cc05407
...
...
@@ -17,7 +17,7 @@ export struct ColumnPage {
pageId: string = "";
channelId: string = "";
pageName: string = ''
@Provide topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
aboutToAppear() {
this.pageId = this.param.pageId
this.channelId = this.param.channelId
...
...
@@ -26,6 +26,7 @@ export struct ColumnPage {
build() {
Column() {
Blank().height(`${this.topSafeHeight}px`)
CustomTitleUI({ titleName: this.pageName })
PageComponent({
currentTopNavSelectedIndex: $currentTopNavSelectedIndex,
...
...
sight_harmony/products/phone/src/main/ets/pages/launchPage/LaunchInterestsHobbiesPage.ets
View file @
cc05407
...
...
@@ -44,7 +44,7 @@ struct LaunchInterestsHobbiesPage {
.fontColor('#333333')
.width('54lpx')
.height('35lpx')
.margin({right:'46lpx'})
.margin({
top:'30lpx',
right:'46lpx'})
.onClick(()=>{
//直接跳过到首页
//跳转首页
...
...
@@ -64,7 +64,7 @@ struct LaunchInterestsHobbiesPage {
.fontColor('#333333')
.width('100%')
.height('61lpx')
.margin({top:'
8
4lpx'})
.margin({top:'
5
4lpx'})
Text('完善信息,将为您推荐个性化的内容')
.fontSize('27lpx')
.textAlign(TextAlign.Center)
...
...
@@ -76,6 +76,7 @@ struct LaunchInterestsHobbiesPage {
if(!this.isConnectNetwork){
EmptyComponent({ emptyType: 1,emptyHeight:"60%" ,retry: () => {
this.isConnectNetwork = NetworkUtil.isNetConnected()
this.requestInterestsData()
}})
.layoutWeight(1)
.width('100%')
...
...
sight_harmony/products/phone/src/main/ets/pages/view/BottomNavigationComponent.ets
View file @
cc05407
...
...
@@ -81,7 +81,7 @@ export struct BottomNavigationComponent {
if (CompUtils.isMine(navItem)) {
// 我的页面组件数据列表
MinePageComponent({ isMinePage: this.currentNavIndex === this.bottomNavList.length - 1 })
} else if (
navItem.name === '视频'
) {
} else if (
CompUtils.isVideo(navItem)
) {
// 视频频道,包含视频和直播
VideoChannelPage({
topNavList: navItem.topNavChannelList.filter(item => item.channelId != 2073),
...
...
@@ -89,14 +89,14 @@ export struct BottomNavigationComponent {
autoRefresh: this.autoRefresh
})
} else {
// 其它带顶到的页面,如 新闻、人民号、服务
TopNavigationComponentNew({
groupId: navItem.id,
topNavList: navItem.topNavChannelList.filter(item => item.channelId != 2073),
_currentNavIndex: $currentNavIndex,
bottomNavIndex: index,
currentBottomNavName: navItem.name,
assignChannel: this.assignChannel,
autoRefresh: this.autoRefresh
autoRefresh: this.autoRefresh,
navItem: navItem
})
}
}
...
...
@@ -246,7 +246,7 @@ export struct BottomNavigationComponent {
}
onBottomNavigationDataUpdated() {
Logger.error('yyyy',
'onBottomNavigationDataUpdated '+
JSON.stringify(this.bottomNavList))
Logger.error('yyyy',
'onBottomNavigationDataUpdated ' +
JSON.stringify(this.bottomNavList))
// Logger.info(TAG, `onBottomNavigationDataUpdated currentNavIndex: ${this.currentNavIndex},length:${this.bottomNavItemList.length}`);
}
...
...
@@ -353,11 +353,20 @@ export struct BottomNavigationComponent {
list = list.filter(item => item.name !== '服务');
list.forEach(item => {
switch (item.name) {
case '新闻': item.pageName = 'NEWS'; break;
case '人民号': item.pageName = 'PEOPLE'; break;
case '视频': item.pageName = 'VIDEOS'; break;
case '我的': item.pageName = 'MY'; break;
default : item.pageName = 'NEWS'; break;
case '新闻':
item.pageName = 'NEWS';
break;
case '人民号':
item.pageName = 'PEOPLE';
break;
case '视频':
item.pageName = 'VIDEOS';
break;
case '我的':
item.pageName = 'MY';
break;
default:
item.pageName = 'NEWS'; break;
}
})
this.bottomNavList = list
...
...
sight_harmony/products/phone/src/main/ets/pages/view/VideoChannelPage.ets
View file @
cc05407
...
...
@@ -58,7 +58,7 @@ export struct VideoChannelPage {
* TODO:根据顶导配置获取颜色展示效果不对,待确认
*/
getTopNavFontColor(item: TopNavDTO, index: number): Color | string {
if (item.
name === '视频' && this.currentBottomNavInfo.name === '视频'
) {
if (item.
channelStyle === 1
) {
return this.currentTopNavSelectedIndex === index ? Color.White : '#949494'
} else {
return this.currentTopNavSelectedIndex === index ? Color.Black : "#B2B2B2"
...
...
Please
register
or
login
to post a comment