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-05-23 15:47:08 +0800
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
923409f94235b8ef2bf20fd7f2d6f2d7b56b1918
923409f9
2 parents
6f241157
62a2bfdd
Merge remote-tracking branch 'origin/main'
Hide whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
321 additions
and
154 deletions
sight_harmony/commons/wdConstant/src/main/ets/constants/ContentConstants.ets
sight_harmony/commons/wdRouter/src/main/ets/utils/ProcessUtils.ets
sight_harmony/features/wdBean/src/main/ets/bean/morningevening/TopicInfo.ets
sight_harmony/features/wdComponent/Index.ets
sight_harmony/features/wdComponent/src/main/ets/components/MorningEveningPaper/MorningEveningPaperComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/MorningEveningPaper/topicInfoView.ets
sight_harmony/features/wdComponent/src/main/ets/components/SpacialTopicPageComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card11Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card2Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card4Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/mine/appointment/AppointmentListChildComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/mine/appointment/AppointmentListUI.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/TopNavigationComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/TopNavigationComponentNew.ets
sight_harmony/features/wdComponent/src/main/ets/components/reusable/CustomTitleUI.ets
sight_harmony/features/wdComponent/src/main/ets/components/view/OperRowListView.ets
sight_harmony/features/wdComponent/src/main/ets/utils/ColorUtils.ets
sight_harmony/features/wdComponent/src/main/resources/base/media/play_status_history_icon.png
sight_harmony/features/wdComponent/src/main/resources/base/media/play_status_icon.png
sight_harmony/features/wdComponent/src/main/resources/base/media/reserve_icon.png
sight_harmony/features/wdDetailPlayLive/src/main/ets/pages/DetailPlayLivePage.ets
sight_harmony/products/phone/src/main/ets/pages/launchPage/LaunchAdvertisingPage.ets
sight_harmony/products/phone/src/main/ets/pages/view/BottomNavigationComponent.ets
sight_harmony/commons/wdConstant/src/main/ets/constants/ContentConstants.ets
View file @
923409f
...
...
@@ -13,6 +13,11 @@ export class ContentConstants {
*/
static readonly TYPE_LIVE: string = "2";
/**
* 3:活动
*/
static readonly TYPE_Activity: string = "3";
static readonly TYPE_FOUR: string = "4";
/**
* 5:专题详情
...
...
sight_harmony/commons/wdRouter/src/main/ets/utils/ProcessUtils.ets
View file @
923409f
...
...
@@ -106,7 +106,7 @@ export class ProcessUtils {
case ContentConstants.TYPE_AUDIO:
ProcessUtils.gotoAudio(content)
break;
case ContentConstants.TYPE_TELETEXT:
case ContentConstants.TYPE_TELETEXT:
case ContentConstants.TYPE_Activity:
// 图文详情,跳转h5
if (content?.linkUrl) { //有 linkUrl 走专题页展示逻辑
ProcessUtils.gotoSpecialTopic(content,true)
...
...
sight_harmony/features/wdBean/src/main/ets/bean/morningevening/TopicInfo.ets
View file @
923409f
...
...
@@ -6,7 +6,7 @@ export interface TopicInfo {
commentFlag: number;
commentPreviewFlag: number;
commentShowFlag: number;
// frontFlag?: any
;
frontFlag: number
;
frontLinkObject?: FrontLinkObject;
posterFlag: number;
posterUrl: string;
...
...
sight_harmony/features/wdComponent/Index.ets
View file @
923409f
...
...
@@ -16,6 +16,8 @@ export { LikeComponent } from "./src/main/ets/components/view/LikeComponent"
export { TopNavigationComponent } from "./src/main/ets/components/page/TopNavigationComponent"
export { TopNavigationComponentNew } from "./src/main/ets/components/page/TopNavigationComponentNew"
export { LabelComponent } from "./src/main/ets/components/view/LabelComponent"
export { BannerComponent } from "./src/main/ets/components/view/BannerComponent"
...
...
sight_harmony/features/wdComponent/src/main/ets/components/MorningEveningPaper/MorningEveningPaperComponent.ets
View file @
923409f
...
...
@@ -23,6 +23,9 @@ import { PeopleShipMainViewModel } from '../../viewmodel/PeopleShipMainViewModel
import { AudioSuspensionModel } from '../../viewmodel/AudioSuspensionModel'
import { viewColumInsightIntentShare } from '../../utils/InsightIntentShare'
import { common } from '@kit.AbilityKit';
import TrackingPageBrowseUtils from '../../utils/TrackingPageBrowseUtils'
import {TrackConstants,TrackParamConvert}from 'wdTracking/Index'
import { ColorUtils } from '../../utils/ColorUtils';
const TAG = 'MorningEveningPaperComponent';
...
...
@@ -200,13 +203,18 @@ export struct MorningEveningPaperComponent {
const imageSource: image.ImageSource | undefined = await getPicture(imageUrl)
if (imageSource) {
if (imageSource
&& this.pageInfoBean.topicInfo.frontFlag === 1
) {
this.pickColor(imageSource)
} else {
this.mixedBgColor = this.pageInfoBean.backgroundColor
if (this.pageInfoBean.topicInfo.topicPattern === 1) {
this.mixedBgColor = '#66BDBD'
}else if(this.pageInfoBean.topicInfo.topicPattern === 2){
this.mixedBgColor = '#E78E17'
}else {
this.mixedBgColor = '#2F2170'
}
}
}
private async pickColor(imageSource: image.ImageSource | undefined) {
...
...
@@ -216,6 +224,7 @@ export struct MorningEveningPaperComponent {
let color = colorPicker.getMainColorSync();
Logger.debug(TAG, "compInfoBean compStyle = " + color)
color = ColorUtils.getMorningEveningPaperRgb({red:color.red,green:color.green,blue:color.blue,alpha:color.alpha})
// 将取色器选取的color示例转换为十六进制颜色代码
this.mixedBgColor = "#" + color.alpha.toString(16) + color.red.toString(16) + color.green.toString(16) + color.blue.toString(16);
Logger.debug(TAG, "compInfoBean compStyle = " + this.mixedBgColor)
...
...
@@ -230,9 +239,15 @@ export struct MorningEveningPaperComponent {
// WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', })
}
onPageShow(){
TrackingPageBrowseUtils.TrackingPageBrowseExposureStart()
}
onPageHide() {
this.status = PlayerConstants.STATUS_PAUSE;
this.playerController?.pause();
TrackingPageBrowseUtils.TrackingPageBrowseExposureEnd('','',TrackParamConvert.pageInfoBean_ParamType(this.pageInfoBean))
}
build() {
...
...
sight_harmony/features/wdComponent/src/main/ets/components/MorningEveningPaper/topicInfoView.ets
View file @
923409f
import { FrontLinkObject } from 'wdBean';
import { ContentDTO, FrontLinkObject } from 'wdBean';
import { ProcessUtils } from 'wdRouter/Index';
/**
* 早晚报,topic
...
...
@@ -47,7 +48,15 @@ export struct topicInfoView {
.backgroundColor($r('app.color.color_99636363'))
.margin({ top: 8, left: 16, right: 16, bottom: 16 })
.borderRadius(2)
// .backgroundColor(Color.Red)
.onClick(()=>{
if (this.frontLinkObject) {
let contentDTO :ContentDTO = new ContentDTO();
contentDTO.objectType = this.frontLinkObject?.newsType.toString()
contentDTO.objectId = this.frontLinkObject?.newsId
contentDTO.linkUrl = this.frontLinkObject?.linkUrl
ProcessUtils.processPage(contentDTO)
}
})
.alignRules({
left: { anchor: "__container__", align: HorizontalAlign.Start },
bottom: { anchor: "__container__", align: VerticalAlign.Bottom }
...
...
sight_harmony/features/wdComponent/src/main/ets/components/SpacialTopicPageComponent.ets
View file @
923409f
...
...
@@ -138,6 +138,7 @@ export struct SpacialTopicPageComponent {
contentDetailData: this.contentDetailData,
publishCommentModel: this.publishCommentModel,
operationButtonList: this.operationButtonList,
styleType: 1,
})
}
}.width(CommonConstants.FULL_WIDTH).height(CommonConstants.FULL_HEIGHT)
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card11Component.ets
View file @
923409f
...
...
@@ -40,9 +40,9 @@ export struct Card11Component {
Column() {
Stack() {
if (this.contentDTO.newTags) {
Notes({ newTags: this.contentDTO.newTags }).height(
27
).align(Alignment.Center)
Notes({ newTags: this.contentDTO.newTags }).height(
30
).align(Alignment.Center)
} else if (this.contentDTO.objectType == '5') {
Notes({ objectType: this.contentDTO.objectType }).height(
27
).align(Alignment.Center)
Notes({ objectType: this.contentDTO.objectType }).height(
30
).align(Alignment.Center)
}
Text() {
if (this.titleMarked) {
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card2Component.ets
View file @
923409f
...
...
@@ -49,9 +49,11 @@ export struct Card2Component {
Stack() {
//新闻标题
if (this.contentDTO.newTags) {
Notes({ newTags: this.contentDTO.newTags })
Notes({ newTags: this.contentDTO.newTags }).height(30).align(Alignment.Center)
//Notes({ newTags: this.contentDTO.newTags })
} else if (this.contentDTO.objectType == '5') {
Notes({ objectType: this.contentDTO.objectType })
Notes({ objectType: this.contentDTO.objectType }).height(30).align(Alignment.Center)
//Notes({ objectType: this.contentDTO.objectType })
}
Text() {
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card4Component.ets
View file @
923409f
...
...
@@ -45,29 +45,32 @@ export struct Card4Component {
Column() {
//body
Column() {
//新闻标题
if (this.contentDTO.newTags) {
Notes({ newTags: this.contentDTO.newTags })
} else if (this.contentDTO.objectType == '5') {
Notes({ objectType: this.contentDTO.objectType })
}
Text() {
if (this.titleMarked) {
Span(this.str01)
Span(this.str02)
.fontColor(0xED2800)
Span(this.str03)
} else {
Span(this.contentDTO.newsTitle)
Stack() {
if (this.contentDTO.newTags) {
Notes({ newTags: this.contentDTO.newTags }).height(19).align(Alignment.Center)
} else if (this.contentDTO.objectType == '5') {
Notes({ objectType: this.contentDTO.objectType }).height(19).align(Alignment.Center)
}
Text() {
if (this.titleMarked) {
Span(this.str01)
Span(this.str02)
.fontColor(0xED2800)
Span(this.str03)
} else {
Span(this.contentDTO.newsTitle)
}
}
}
.fontSize($r('app.float.font_size_18'))
.fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222'))
.maxLines(3)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.textIndent(this.contentDTO.newTags?.length < 5 && this.contentDTO.newTags?.length > 2 ? 58 :
(this.contentDTO.newTags?.length != 0 && this.contentDTO.newTags?.length) ||
this.contentDTO.objectType == '5' ? 30 : 0)
.textIndent(this.contentDTO.newTags?.length < 5 && this.contentDTO.newTags?.length > 2 ? 58 :
(this.contentDTO.newTags?.length != 0 && this.contentDTO.newTags?.length) ||
this.contentDTO.objectType == '5' ? 30 : 0)
}.alignContent(Alignment.TopStart)
//新闻标题
//三图
Stack(){
Row() {
...
...
sight_harmony/features/wdComponent/src/main/ets/components/mine/appointment/AppointmentListChildComponent.ets
View file @
923409f
...
...
@@ -38,25 +38,32 @@ export struct AppointmentListChildComponent {
.interpolation(ImageInterpolation.High)
if (this.item.
relType === 1
) {
if (this.item.
status == "wait"
) {
Row() {
Row() {
Image($r('app.media.reserve_icon'))
.width('42lpx')
.height('35lpx')
.width('27lpx')
.height('27lpx')
.objectFit(ImageFit.Auto)
.interpolation(ImageInterpolation.High)
.margin({right:"6lpx"})
Text("预约")
.fontWeight(400)
.fontSize('21lpx')
.backgroundColor($r('app.color.color_4D000000'))
.fontSize('23lpx')
.textShadow({
radius: 2,
color: `rgba(0,0,0,0.3)`,
offsetY:2,
offsetX:0
})
.fontColor($r('app.color.white'))
.lineHeight('31lpx')
.layoutWeight(1)
.textAlign(TextAlign.
Center
)
.textAlign(TextAlign.
Start
)
}.width('94lpx')
.margin({ bottom: '15lpx', right: '15lpx' })
.alignItems(VerticalAlign.Center)
}.width('100%')
.height('100%')
.alignItems(VerticalAlign.Bottom)
...
...
@@ -78,7 +85,7 @@ export struct AppointmentListChildComponent {
.width('100%')
Row() {
Row() {
if (this.item.
relType === 2
) {
if (this.item.
status == "end"
) {
Image($r('app.media.play_status_history_icon'))
.objectFit(ImageFit.Auto)
.interpolation(ImageInterpolation.High)
...
...
@@ -88,6 +95,16 @@ export struct AppointmentListChildComponent {
Text('已结束').fontColor($r('app.color.color_999999'))
.fontWeight('500lpx')
.fontSize('23lpx')
}else if(this.item.status == "running"){
Image($r('app.media.play_status_icon'))
.objectFit(ImageFit.Auto)
.interpolation(ImageInterpolation.High)
.width('38lpx')
.height('38lpx')
.margin({ right: '12lpx' })
Text('已开始').fontColor($r('app.color.color_999999'))
.fontWeight('500lpx')
.fontSize('23lpx')
} else {
Image($r('app.media.play_status_icon'))
.objectFit(ImageFit.Auto)
...
...
@@ -118,7 +135,7 @@ export struct AppointmentListChildComponent {
Blank()
.layoutWeight(1)
if (this.item.
relType === 1
) {
if (this.item.
status === "wait"
) {
Text(this.item.isAppointment ? "已预约" : "预约")
.fontWeight(400)
.fontSize('23lpx')
...
...
@@ -132,8 +149,19 @@ export struct AppointmentListChildComponent {
.onClick(() => {
this.dialogController.open()
})
}else if(this.item.status == "running"){
Text("去观看" )
.fontWeight(400)
.fontSize('23lpx')
.backgroundColor($r('app.color.color_ED2800'))
.fontColor($r('app.color.white'))
.lineHeight('31lpx')
.textAlign(TextAlign.Center)
.width('100lpx')
.height('46lpx')
.borderRadius('6lpx')
} else {
Text(
this.item.relType === 2 ? "去观看" :
"看回放")
Text("看回放")
.fontWeight(400)
.fontSize('23lpx')
.backgroundColor($r('app.color.color_ED2800'))
...
...
sight_harmony/features/wdComponent/src/main/ets/components/mine/appointment/AppointmentListUI.ets
View file @
923409f
...
...
@@ -7,17 +7,20 @@ import MinePageDatasModel from '../../../model/MinePageDatasModel';
import { EmptyComponent } from '../../view/EmptyComponent';
import { Action } from 'wdBean/Index';
import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
import { CustomPullToRefresh } from '../../reusable/CustomPullToRefresh';
const TAG = "AppointmentListUI"
@Component
export struct AppointmentListUI {
@State data: LazyDataSource<MineAppointmentItem> = new LazyDataSource();
@State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
@State count: number = 0;
@State isLoading: boolean = false
@State hasMore: boolean = true
curPageNum: number = 1;
@State isGetRequest: boolean = false
private scroller: Scroller = new Scroller();
aboutToAppear() {
this.getNewPageData()
...
...
@@ -26,7 +29,7 @@ export struct AppointmentListUI {
build() {
Column() {
//标题栏目
CustomTitleUI({ titleName: "
预约列表
" })
CustomTitleUI({ titleName: "
我的预约
" })
if (this.count == 0) {
if (this.isGetRequest == true) {
EmptyComponent({ emptyType: 10 })
...
...
@@ -35,45 +38,29 @@ export struct AppointmentListUI {
}
} else {
//刷新控件 TODO
//List
List({ space: '6lpx' }) {
LazyForEach(this.data, (item: MineAppointmentItem, index: number) => {
ListItem() {
AppointmentListChildComponent({ item: item })
}
.onClick(() => {
//TODO 跳转
let action = {
type:"2",
params:{
extra:{
relId:item.relId,
relType:item.relType.toString()
},
contentID:item.liveId.toString()
}
} as Action
WDRouterRule.jumpWithPage(WDRouterPage.detailPlayLiveCommon, action)
})
}, (item: MineAppointmentItem, index: number) => index.toString())
//没有更多数据 显示提示
if (!this.hasMore) {
ListItem() {
ListHasNoMoreDataUI()
CustomPullToRefresh({
alldata:this.data,
scroller:this.scroller,
customList:()=>{
this.ListLayout()
},
onRefresh:(resolve)=>{
this.curPageNum = 1;
this.hasMore = true
this.isGetRequest = false
this.data.clear()
if (!this.isLoading){
this.getNewPageData()
if(resolve) resolve('刷新成功')
}
},
onLoadMore:(resolve)=> {
if (!this.isLoading) {
this.isLoading = true
this.getNewPageData()
}
}
}
.cachedCount(4)
.scrollBar(BarState.Off)
.margin({ top: '23lpx', left: '23lpx', right: '23lpx' })
.layoutWeight(1)
.onReachEnd(() => {
console.log(TAG, "触底了");
if (!this.isLoading) {
//加载分页数据
this.getNewPageData()
}
})
}
...
...
@@ -83,6 +70,42 @@ export struct AppointmentListUI {
.width('100%')
}
@Builder ListLayout(){
List({ space:6,scroller: this.scroller }) {
LazyForEach(this.data, (item: MineAppointmentItem, index: number) => {
ListItem() {
AppointmentListChildComponent({ item: item })
}
.onClick(() => {
//TODO 跳转
let action = {
type:"2",
params:{
extra:{
relId:item.relId,
relType:item.relType.toString()
},
contentID:item.liveId.toString()
}
} as Action
WDRouterRule.jumpWithPage(WDRouterPage.detailPlayLiveCommon, action)
})
}, (item: MineAppointmentItem, index: number) => index.toString())
//没有更多数据 显示提示
if (!this.hasMore) {
ListItem() {
ListHasNoMoreDataUI()
}.padding({bottom:px2vp(this.bottomSafeHeight) + 20})
}
}
.cachedCount(4)
.scrollBar(BarState.Off)
.edgeEffect(EdgeEffect.None)
.margin({ top: '23lpx', left: '23lpx', right: '23lpx'})
.layoutWeight(1)
}
getNewPageData() {
this.isLoading = true
if (this.hasMore) {
...
...
sight_harmony/features/wdComponent/src/main/ets/components/page/TopNavigationComponent.ets
View file @
923409f
...
...
@@ -460,9 +460,19 @@ export struct TopNavigationComponent {
}
/**
* 判断是否当前页面处理逻辑,如消息通知,只需要切换到当前底导的处理,过滤掉非当前。
*/
private isCurrentPage(): boolean {
return this._currentNavIndex === this.navIndex
}
/**
* 频道id变化,即指定频道跳转场景
*/
onAssignChannelChange() {
if (!this.isCurrentPage()) {
return
}
let channelId = this.assignChannel.channelId
let index = -1
if (this._currentNavIndex === 0) {
...
...
sight_harmony/features/wdComponent/src/main/ets/components/page/TopNavigationComponentNew.ets
View file @
923409f
...
...
@@ -72,68 +72,70 @@ export struct TopNavigationComponentNew {
private tabsWidth: number = 0
build() {
// 频道分类list
RelativeContainer() {
this.tabBar()
Swiper(this.swiperController) {
ForEach(this.currentBottomNavName === '新闻' ? this.myChannelList : this.topNavList,
(navItem: TopNavDTO, index: number) => {
if (this.currentBottomNavName === '人民号' && navItem.name === '关注') {
PeopleShipMainComponent({
currentTopNavSelectedIndex: $currentTopNavSelectedIndex,
navIndex: index,
pageId: navItem.pageId + '',
channelId: navItem.channelId + '',
})
} else
if (!this.isBroadcast(navItem) && !this.isLayout(navItem)) {
PageComponent({
Column() {
// 频道分类list
RelativeContainer() {
this.tabBar()
Swiper(this.swiperController) {
ForEach(this.currentBottomNavName === '新闻' ? this.myChannelList : this.topNavList,
(navItem: TopNavDTO, index: number) => {
if (this.currentBottomNavName === '人民号' && navItem.name === '关注') {
PeopleShipMainComponent({
currentTopNavSelectedIndex: $currentTopNavSelectedIndex,
navIndex: index,
pageId: navItem.pageId + '',
channelId: navItem.channelId + '',
autoRefresh: this.autoRefresh2Page
})
} else {
channelSkeleton()
} else
if (!this.isBroadcast(navItem) && !this.isLayout(navItem)) {
PageComponent({
currentTopNavSelectedIndex: $currentTopNavSelectedIndex,
navIndex: index,
pageId: navItem.pageId + '',
channelId: navItem.channelId + '',
autoRefresh: this.autoRefresh2Page
})
} else {
channelSkeleton()
}
})
}
.loop(false)
.indicator(false)
.effectMode(EdgeEffect.None)
.index(this.currentTopNavSelectedIndex)
.cachedCount(0)
.id('pageContent')
.alignRules({
'top': { 'anchor': 'tabList', 'align': VerticalAlign.Bottom },
'middle': { 'anchor': '__container__', 'align': HorizontalAlign.Center },
'bottom': { 'anchor': '__container__', 'align': VerticalAlign.Bottom }
})
.onChange((index) => {
Logger.info(TAG, `onChange index : ${index}`);
if (this.isBroadcastByIndex(index)) {
// 跳转到播报页面
ProcessUtils.gotoBroadcastPage(this.myChannelList[index].pageId)
let nextIndex = this.currentTopNavSelectedIndex > index ? index - 1 : index + 1
if (nextIndex < this.myChannelList.length) {
this.changePage(nextIndex)
}
})
}
.loop(false)
.indicator(false)
.effectMode(EdgeEffect.None)
.index(this.currentTopNavSelectedIndex)
.cachedCount(0)
.id('pageContent')
.alignRules({
'top': { 'anchor': 'tabList', 'align': VerticalAlign.Bottom },
'middle': { 'anchor': '__container__', 'align': HorizontalAlign.Center },
'bottom': { 'anchor': '__container__', 'align': VerticalAlign.Bottom }
})
.onChange((index) => {
Logger.info(TAG, `onChange index : ${index}`);
if (this.isBroadcastByIndex(index)) {
// 跳转到播报页面
ProcessUtils.gotoBroadcastPage(this.myChannelList[index].pageId)
let nextIndex = this.currentTopNavSelectedIndex > index ? index - 1 : index + 1
if (nextIndex < this.myChannelList.length) {
this.changePage(nextIndex)
}
} else if (this.isLayoutByIndex(index)) {
ProcessUtils.gotoENewsPaper()
let nextIndex = this.currentTopNavSelectedIndex > index ? index - 1 : index + 1
if (nextIndex < this.myChannelList.length) {
this.changePage(nextIndex)
} else if (this.isLayoutByIndex(index)) {
ProcessUtils.gotoENewsPaper()
let nextIndex = this.currentTopNavSelectedIndex > index ? index - 1 : index + 1
if (nextIndex < this.myChannelList.length) {
this.changePage(nextIndex)
}
} else {
this.currentTopNavSelectedIndex = index;
this.changePage(this.currentTopNavSelectedIndex)
}
} else {
this.currentTopNavSelectedIndex = index;
this.changePage(this.currentTopNavSelectedIndex)
}
})
})
}
.width('100%')
.height('100%')
}
.width('100%')
.height('100%')
}
@Builder
...
...
@@ -316,7 +318,7 @@ export struct TopNavigationComponentNew {
bottom: 2,
})
.id(`col_tabBar${index}`)
.margin({ right: this.myChannelList.length === index + 1 ? 36 : 0 })
//
.margin({ right: this.myChannelList.length === index + 1 ? 36 : 0 })
.onClick(() => {
Logger.debug(TAG, `onClick, index: ${index}`);
if (this.currentTopNavSelectedIndex === index) {
...
...
@@ -487,9 +489,19 @@ export struct TopNavigationComponentNew {
}
/**
* 判断是否当前页面处理逻辑,如消息通知,只需要切换到当前底导的处理,过滤掉非当前。
*/
private isCurrentPage(): boolean {
return this._currentNavIndex === this.bottomNavIndex
}
/**
* 频道id变化,即指定频道跳转场景
*/
onAssignChannelChange() {
if (!this.isCurrentPage()) {
return
}
let channelId = this.assignChannel.channelId
let index = -1
if (this._currentNavIndex === 0) {
...
...
@@ -537,7 +549,7 @@ export struct TopNavigationComponentNew {
private getChannelByMine(channelId: string) {
for (let i = 0; i < this.myChannelList.length; i++) {
let topNavDTO: TopNavDTO = this.myChannelList[i]
if (topNavDTO.channelId?.toString() === channelId) {
if (topNavDTO
?
.channelId?.toString() === channelId) {
return i
}
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/reusable/CustomTitleUI.ets
View file @
923409f
...
...
@@ -26,7 +26,6 @@ export struct CustomTitleUI {
}
Text(this.titleName)
.height('42lpx')
.maxLines(1)
.id("title")
.fontSize('35lpx')
...
...
sight_harmony/features/wdComponent/src/main/ets/components/view/OperRowListView.ets
View file @
923409f
...
...
@@ -199,7 +199,7 @@ export struct OperRowListView {
.padding({
top: 10,
// bottom: 10
bottom:
`${this.bottomSafeHeight}px`
bottom:
px2vp(this.bottomSafeHeight)
// bottom: 50
})
}
...
...
sight_harmony/features/wdComponent/src/main/ets/utils/ColorUtils.ets
View file @
923409f
...
...
@@ -173,4 +173,47 @@ export class ColorUtils {
alpha: (color & 0xFF000000) >> 24
}
}
public static getMorningEveningPaperRgb(color: ColorRgb): ColorRgb{
// RGB颜色取值范围是0~255,需要转换为0~1的浮点数
const red: number = color.red / MAX_RGB_VALUE;
const green: number = color.green / MAX_RGB_VALUE;
const blue: number = color.blue / MAX_RGB_VALUE;
const max: number = Math.max(red, green, blue);
const min: number = Math.min(red, green, blue);
const delta: number = max - min;
// 色调
let hue: number = 0;
// 饱和度
let saturation: number = 0;
// 明度
let value: number = 0;
// 计算hue值
if (max === min) {
hue = 0;
} else if (Math.abs(max - red) < Number.EPSILON) {
hue = (green >= blue ? ((green - blue) / delta) * 60 : ((green - blue) / delta) * 60 + 360);
} else if (Math.abs(max - green) < Number.EPSILON) {
hue = (((blue - red) / delta) + 2) * 60;
} else if (Math.abs(max - blue) < Number.EPSILON) {
hue = (((red - green) / delta) + 4) * 60;
}
// 计算saturation值
saturation = 0.9;
// 计算value值
value = 0.3;
return ColorUtils.hsv2rgb({
hue: hue,
saturation: saturation,
value: value,
alpha: color.alpha
})
}
}
\ No newline at end of file
...
...
sight_harmony/features/wdComponent/src/main/resources/base/media/play_status_history_icon.png
View file @
923409f
342 Bytes
|
W:
|
H:
488 Bytes
|
W:
|
H:
2-up
Swipe
Onion skin
sight_harmony/features/wdComponent/src/main/resources/base/media/play_status_icon.png
View file @
923409f
342 Bytes
|
W:
|
H:
492 Bytes
|
W:
|
H:
2-up
Swipe
Onion skin
sight_harmony/features/wdComponent/src/main/resources/base/media/reserve_icon.png
View file @
923409f
605 Bytes
|
W:
|
H:
1.14 KB
|
W:
|
H:
2-up
Swipe
Onion skin
sight_harmony/features/wdDetailPlayLive/src/main/ets/pages/DetailPlayLivePage.ets
View file @
923409f
...
...
@@ -53,17 +53,23 @@ export struct DetailPlayLivePage {
console.error(TAG, 'this.publishCommentModel', this.publishCommentModel.targetId)
}
async aboutToDisappear() {
Logger.info(TAG, `wyj-aboutToDisappear`)
await this.playerController?.stop()
await this.playerController?.release()
}
build() {
Column() {
TopPlayComponent({ playerController: this.playerController })
.
layoutW
eight(211)
.
h
eight(211)
TabComponent({ tabs: this.tabs, changeToTab: this.changeToTab })
.layoutWeight(
503
)
.layoutWeight(
1
)
.visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None)
OperRowListView({
componentType: 4,
operationButtonList: ['comment', 'collect', 'share', 'like'],
styleType: 1,
contentDetailData: this.contentDetailData,
publishCommentModel: this.publishCommentModel,
showCommentIcon: false,
...
...
@@ -79,12 +85,7 @@ export struct DetailPlayLivePage {
}
.height('100%')
.width('100%')
}
async aboutToDisappear() {
Logger.info(TAG, `wyj-aboutToDisappear`)
await this.playerController?.stop()
await this.playerController?.release()
// 设置底部绘制延伸到导航条
}
onPageShowCus(): void {
...
...
sight_harmony/products/phone/src/main/ets/pages/launchPage/LaunchAdvertisingPage.ets
View file @
923409f
...
...
@@ -196,8 +196,8 @@ struct LaunchAdvertisingPage {
contentTrackingDict(){
this.pageParam = {
'adType':'0',
'adId':this.model.launchAdInfo[0].matInfo.id.toString(),
'adName':this.model.launchAdInfo[0].matInfo.advTitle,
'adId':this.model.launchAdInfo[0]?.matInfo.id.toString(),
'adName':this.model.launchAdInfo[0]?.matInfo.advTitle,
'regionName':'0'
}
}
...
...
sight_harmony/products/phone/src/main/ets/pages/view/BottomNavigationComponent.ets
View file @
923409f
...
...
@@ -4,7 +4,7 @@ import { EmitterEventId, EmitterUtils, Logger, StringUtils } from 'wdKit';
import { HttpUtils } from 'wdNetwork/Index';
import HomeChannelUtils, { AssignChannelParam } from 'wdRouter/Index';
import { MinePageComponent } from 'wdComponent/src/main/ets/components/page/MinePageComponent';
import { CompUtils, TopNavigationComponent } from 'wdComponent/Index';
import { CompUtils, TopNavigationComponent
, TopNavigationComponentNew
} from 'wdComponent/Index';
import { VideoChannelPage } from './VideoChannelPage';
import ChannelViewModel from 'wdComponent/src/main/ets/viewmodel/ChannelViewModel';
...
...
@@ -17,6 +17,7 @@ let storage = LocalStorage.getShared();
@Entry(storage)
@Component
export struct BottomNavigationComponent {
private isNewTopPage = true // TODO 顶导重构页面开关,false,则用原来的顶导
@Provide bottomRectHeight: number = 0
@Provide topRectHeight: number = 0
@Provide isLayoutFullScreen: boolean = false
...
...
@@ -82,15 +83,28 @@ export struct BottomNavigationComponent {
autoRefresh: this.autoRefresh
})
} else {
TopNavigationComponent({
groupId: navItem.id,
topNavList: navItem.topNavChannelList.filter(item => item.channelId != 2073),
_currentNavIndex: $currentNavIndex,
navIndex: index,
currentBottomNavName: navItem.name,
assignChannel: this.assignChannel,
autoRefresh: this.autoRefresh
})
if (this.isNewTopPage) {
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
})
} else {
TopNavigationComponent({
groupId: navItem.id,
topNavList: navItem.topNavChannelList.filter(item => item.channelId != 2073),
_currentNavIndex: $currentNavIndex,
navIndex: index,
currentBottomNavName: navItem.name,
assignChannel: this.assignChannel,
autoRefresh: this.autoRefresh
})
}
}
}
.tabBar(this.tabBarBuilder(navItem, index))
...
...
Please
register
or
login
to post a comment