wangliang_wd

Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool into main

* 'main' of http://192.168.1.42/developOne/harmonyPool:
  js 注入时序问题修复
  desc:隐藏 控件
  通用跳转方法挪至 common
  直播列表item跳图文详情页,其他bug修复
  视频频道修改
  解决频道切换页面销毁
... ... @@ -22,3 +22,6 @@ export { ScreenType } from './src/main/ets/enum/ScreenType';
export { SpConstants } from './src/main/ets/constants/SpConstants';
export { DisplayDirection } from './src/main/ets/constants/VideoConstants';
export { ContentConstants } from './src/main/ets/constants/ContentConstants';
... ...
export class ContentConstants {
/* content#objectType,跳转类型:0:不跳转 1:点播,2:直播,3:活动,4:广告,5:专题,6:链接,7:榜单,8:图文,9:组图,10:H5新闻,11:频道,12:组件,13:音频,14动态图文,15动态视频 */
/**
* 0:不跳转
*/
static readonly TYPE_NONE: string = "0";
/**
* 1:点播
*/
static readonly TYPE_VOD: string = "1";
/**
* 2:直播
*/
static readonly TYPE_LIVE: string = "2";
/**
* 5:专题详情
*/
static readonly TYPE_SPECIAL_TOPIC: string = "5";
/**
* 6:链接
*/
static readonly TYPE_LINK: string = "6";
/**
* 8:图文详情,这里是h5页面
*/
static readonly TYPE_TELETEXT: string = "8";
/**
* 9:图集
*/
static readonly TYPE_NINE: string = "9";
/**
* 13:音频详情
*/
static readonly TYPE_AUDIO: string = "13";
/**
* 14:动态图文
*/
static readonly TYPE_FOURTEEN: string = "14";
/**
* 15:动态视频
*/
static readonly TYPE_FIFTEEN: string = "15";
}
\ No newline at end of file
... ...
... ... @@ -132,6 +132,10 @@ export class WindowModel {
})
}
setWindowSystemBarEnable(names: Array<'status' | 'navigation'>) {
this.windowClass?.setWindowSystemBarEnable(names)
}
setWindowLayoutFullScreen(isFullScreen: boolean) {
this.isFullScreen = isFullScreen
this.windowClass?.setWindowLayoutFullScreen(isFullScreen)
... ...
... ... @@ -3,3 +3,5 @@ export { WDRouterRule } from './src/main/ets/router/WDRouterRule'
export { WDRouterPage } from './src/main/ets/router/WDRouterPage'
export { registerRouter } from './src/main/ets/router/Action2Page'
export { ProcessUtils } from './src/main/ets/utils/ProcessUtils'
... ...
... ... @@ -9,6 +9,7 @@
"dependencies": {
"wdKit": "file:../wdKit",
"wdBean": "file:../../features/wdBean",
"wdNetwork": "file:../../commons/wdNetwork"
"wdNetwork": "file:../../commons/wdNetwork",
"wdConstant": "file:../../commons/wdConstant"
}
}
\ No newline at end of file
... ...
import { Action, ContentDTO, Params } from 'wdBean';
import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO';
import { Logger } from 'wdKit';
import { StringUtils } from 'wdKit/src/main/ets/utils/StringUtils';
import { WDRouterRule } from '../router/WDRouterRule';
import { ContentConstants } from 'wdConstant';
// import { LiveModel } from '../viewmodel/LiveModel';
const TAG = 'ProcessUtils';
/**
* 页面跳转业务封装
*/
export class ProcessUtils {
/**
* 页面跳转
*/
static processPage(content: ContentDTO) {
if (content == null) {
Logger.error(TAG, "processPage, content is null");
return;
}
if (StringUtils.isEmpty(content.objectType)) {
Logger.error(TAG, "processPage, objectType is empty");
return;
}
let type = content.objectType;
console.log(TAG,'objectType',`${JSON.stringify(content)}`);
switch (type) {
case ContentConstants.TYPE_NONE:
Logger.debug(TAG, "processPage, do nothing");
break;
case ContentConstants.TYPE_VOD:
Logger.debug(TAG, "processPage, nonsupport!!!");
ProcessUtils.gotoVod(content)
break;
case ContentConstants.TYPE_LIVE:
ProcessUtils.gotoLive(content)
break
case ContentConstants.TYPE_AUDIO:
ProcessUtils.gotoAudio(content)
break;
case ContentConstants.TYPE_TELETEXT:
// 图文详情,跳转h5
ProcessUtils.gotoWeb(content);
break;
case ContentConstants.TYPE_LINK:
ProcessUtils.gotoDefaultWeb(content);
break;
//图集详情页
case ContentConstants.TYPE_NINE:
ProcessUtils.gotoAtlasDetailPage(content);
break;
case ContentConstants.TYPE_SPECIAL_TOPIC:
// 专题详情,跳转h5
ProcessUtils.gotoSpecialTopic(content);
break;
//动态详情页(动态图文)
case ContentConstants.TYPE_FOURTEEN:
break;
//动态详情页(动态视频)
case ContentConstants.TYPE_FIFTEEN:
ProcessUtils.gotoWeb(content);
break;
default:
break;
}
}
/**
* 动态详情页(动态视频/动态图片)
* @param content
* */
private static gotoDynamicDetailPage(content: ContentDTO) {
let taskAction: Action = {
type: 'JUMP_DETAIL_PAGE',
params: {
detailPageType: 14,
contentID: content?.objectId,
extra: {
relType: content?.relType,
relId: content?.relId,
} as ExtraDTO
} as Params,
};
WDRouterRule.jumpWithAction(taskAction)
Logger.debug(TAG, `gotoDynamicDetailPage, ${content.objectId}`);
}
/**
* 图集详情页
* @param content
* */
private static gotoAtlasDetailPage(content: ContentDTO) {
let taskAction: Action = {
type: 'JUMP_DETAIL_PAGE',
params: {
detailPageType: 17,
contentID: content?.objectId,
extra: {
relType: content?.relType,
relId: content?.relId,
} as ExtraDTO
} as Params,
};
WDRouterRule.jumpWithAction(taskAction)
Logger.debug(TAG, `gotoAtlasDetailPage, ${content.objectId}`);
}
private static gotoSpecialTopic(content: ContentDTO) {
let taskAction: Action = {
type: 'JUMP_INNER_NEW_PAGE',
params: {
url: content.linkUrl,
pageID: 'SPACIAL_TOPIC_PAGE',
} as Params,
};
WDRouterRule.jumpWithAction(taskAction)
}
private static gotoDefaultWeb(content: ContentDTO) {
let taskAction: Action = {
type: 'JUMP_H5_BY_WEB_VIEW',
params: {
url: content.linkUrl,
} as Params,
};
WDRouterRule.jumpWithAction(taskAction)
Logger.debug(TAG, `gotoWeb, ${content.objectId}`);
}
private static gotoWeb(content: ContentDTO) {
let taskAction: Action = {
type: 'JUMP_INNER_NEW_PAGE',
params: {
contentID: content?.objectId,
pageID: 'IMAGE_TEXT_DETAIL',
extra: {
relType: content?.relType,
relId: content?.relId,
channelId: content?.channelId,
sourcePage: '5'
} as ExtraDTO
} as Params,
};
WDRouterRule.jumpWithAction(taskAction)
Logger.debug(TAG, `gotoWeb, ${content.objectId}`);
}
private static gotoVod(content: ContentDTO) {
let taskAction: Action = {
type: 'JUMP_DETAIL_PAGE',
params: {
detailPageType: 7,
contentID: content?.objectId,
extra: {
relType: content?.relType,
relId: content?.relId,
} as ExtraDTO
} as Params,
};
WDRouterRule.jumpWithAction(taskAction)
Logger.debug(TAG, `gotoVod, ${content.objectId}`);
}
private static async gotoLive(content: ContentDTO) {
// const liveDetail = await LiveModel.getLiveDetails(content?.objectId || '', content?.relId || '', content?.relType || '')
// const liveStyle = liveDetail[0].liveInfo.liveStyle
// const liveState = liveDetail[0].liveInfo.liveState
let taskAction: Action = {
type: 'JUMP_DETAIL_PAGE',
params: {
detailPageType: 2,
contentID: content?.objectId,
// liveStyle: liveState === 'wait' ? 0 : liveStyle,
liveStyle: 0 ,
extra: {
relType: content?.relType,
relId: content?.relId,
} as ExtraDTO
} as Params,
};
WDRouterRule.jumpWithAction(taskAction)
Logger.debug(TAG, `gotoLive, ${content.objectId}`);
}
private static gotoAudio(content: ContentDTO) {
let taskAction: Action = {
type: 'JUMP_DETAIL_PAGE',
params: {
detailPageType: 13,
contentID: content?.objectId,
extra: {
relType: content?.relType,
relId: content?.relId,
} as ExtraDTO
} as Params,
};
WDRouterRule.jumpWithAction(taskAction)
Logger.debug(TAG, `gotoAudio, ${content.objectId}`);
}
}
\ No newline at end of file
... ...
... ... @@ -7,7 +7,7 @@ import { performJSCallNative } from './JsBridgeBiz';
import { H5CallNativeType } from './H5CallNativeType';
import { Message } from 'wdJsBridge/src/main/ets/bean/Message';
const TAG = 'WdWebLocalComponent';
const TAG = 'WdWebComponent';
@Component
export struct WdWebComponent {
... ... @@ -85,9 +85,10 @@ export struct WdWebComponent {
onPageBegin: (url?: string) => void = () => {
Logger.debug(TAG, 'onPageBegin');
this.registerHandlers();
// setTimeout(() => {
//有时序问题 必须延时执行
setTimeout(() => {
BridgeUtil.webViewLoadLocalJs(getContext(this), this.webviewControl)
// }, 100)
}, 200)
}
onPageEnd: (url?: string) => void = () => {
Logger.debug(TAG, 'onPageEnd');
... ...
... ... @@ -102,9 +102,10 @@ export struct WdWebLocalComponent {
onPageBegin: (url?: string) => void = () => {
Logger.debug(TAG, 'onPageBegin');
this.registerHandlers();
// setTimeout(() => {
//有时序问题 必须延时执行
setTimeout(() => {
BridgeUtil.webViewLoadLocalJs(getContext(this), this.webviewControl)
// }, 100)
}, 200)
}
onPageEnd: (url?: string) => void = () => {
Logger.debug(TAG, 'onPageEnd');
... ...
... ... @@ -83,9 +83,11 @@ export default struct MinePagePersonFunctionUI {
.height('117lpx')
})
}
.rowsTemplate('1fr 1fr')
// .rowsTemplate('1fr 1fr')
.rowsTemplate('1fr')
.columnsTemplate('1fr 1fr 1fr 1fr')
.height('234lpx')
// .height('234lpx')
.height('167lpx')
.margin({top:'31lpx',left:'23lpx',right:'23lpx' })
}
}
\ No newline at end of file
... ...
... ... @@ -119,6 +119,7 @@ export default struct MinePageUserSimpleInfoUI {
.width('50lpx')
.height('50lpx')
}.width('131lpx')
.visibility(Visibility.Hidden)
}.backgroundColor($r('app.color.white'))
.setFullWidth()
.padding({top:'31lpx',left:'46lpx'})
... ...
... ... @@ -68,6 +68,7 @@ export struct BottomNavigationComponent {
groupId: navItem.id,
topNavList: navItem.topNavChannelList.filter(item => item.channelId != 2073),
_currentNavIndex: this.currentNavIndex,
currentBottomNavName: navItem.name,
changeBarBackgroundColor: (color: Color) => {
this.barBackgroundColor = color
}
... ... @@ -80,6 +81,7 @@ export struct BottomNavigationComponent {
});
}
.animationDuration(0)
.barHeight($r('app.float.bottom_navigation_barHeight'))
.barMode(BarMode.Fixed)
// TODO:更详细的判断是视频频道
... ...
... ... @@ -86,9 +86,8 @@ struct ReserveMorePage {
// .title('直播列表')
Column() {
Column() {
this.TabbarNormal()
Column() {
this.ListLayout()
}
.padding({
... ...
... ... @@ -22,6 +22,7 @@ const storage = LocalStorage.getShared();
@Component
export struct TopNavigationComponent {
private groupId: number = 0
private currentBottomNavName: string = ''
private tabsController: TabsController = new TabsController()
private changeBarBackgroundColor: (color: Color) => void = () => {
}
... ... @@ -156,20 +157,20 @@ export struct TopNavigationComponent {
if (this._currentNavIndex === 2 && this.currentTopNavSelectedIndex == 0) {
this.barBackgroundColor = Color.Black
this.changeBarBackgroundColor && this.changeBarBackgroundColor(this.barBackgroundColor)
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', })
WindowModel.shared.setWindowLayoutFullScreen(true)
this.isLayoutFullScreen = true
this.bottomRectHeight = this.bottomSafeHeight
this.topRectHeight = this.topSafeHeight
// WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', })
// WindowModel.shared.setWindowLayoutFullScreen(true)
// this.isLayoutFullScreen = true
// this.bottomRectHeight = this.bottomSafeHeight
// this.topRectHeight = this.topSafeHeight
} else {
this.barBackgroundColor = Color.Transparent
this.changeBarBackgroundColor && this.changeBarBackgroundColor(this.barBackgroundColor)
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', })
WindowModel.shared.setWindowLayoutFullScreen(false)
this.isLayoutFullScreen = false
this.bottomRectHeight = 0
this.topRectHeight = 0
// WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', })
// WindowModel.shared.setWindowLayoutFullScreen(false)
// this.isLayoutFullScreen = false
// this.bottomRectHeight = 0
// this.topRectHeight = 0
}
}
... ... @@ -225,9 +226,9 @@ export struct TopNavigationComponent {
// 频道分类list
Stack({ alignContent: Alignment.TopEnd }) {
Tabs({ index: this.currentTopNavSelectedIndex, controller: this.tabsController }) {
ForEach(this._currentNavIndex === 0 ? this.myChannelList : this.topNavList, (navItem: TopNavDTO, index: number) => {
ForEach(this.currentBottomNavName === '新闻' ? this.myChannelList : this.topNavList, (navItem: TopNavDTO, index: number) => {
TabContent() {
if (this._currentNavIndex === 2 && navItem.name === '视频') {
if (this.currentBottomNavName === '视频' && navItem.name === '视频') {
VideoChannelDetail({
bottomNavIndex: this._currentNavIndex,
topNavIndex: this.currentTopNavSelectedIndex,
... ...
... ... @@ -6,6 +6,8 @@ import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'
import { CardMediaInfo } from '../cardCommon/CardMediaInfo'
import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO'
import { LiveModel } from '../../viewmodel/LiveModel'
import { ContentConstants } from '../../constants/ContentConstants'
import { ProcessUtils } from '../../utils/ProcessUtils'
@Component
export struct LiveHorizontalCardComponent {
... ... @@ -25,7 +27,7 @@ export struct LiveHorizontalCardComponent {
.fontWeight(600)
}
if (this.compDTO.operDataList.length > 2) {
if (this.compDTO.dataSourceType === 'LIVE_HORIZONTAL_CARD' || this.compDTO.dataSourceType === 'LIVE_MONTHLY_RANKING') {
Row() {
Text("更多")
.fontSize($r("app.float.font_size_14"))
... ... @@ -118,13 +120,14 @@ export struct LiveHorizontalCardComponent {
async gotoLive(content: ContentDTO) {
const liveDetail = await LiveModel.getLiveDetails(content?.objectId || '', content?.relId || '', content?.relType || '')
if (content && content.objectType) {
if (content.objectType === ContentConstants.TYPE_LIVE) {
if (liveDetail && liveDetail[0] && liveDetail[0].liveInfo) {
const liveStyle = liveDetail[0].liveInfo.liveStyle
const liveState = liveDetail[0].liveInfo.liveState
console.error('liveDetail===', liveDetail)
let taskAction: Action = {
type: 'JUMP_DETAIL_PAGE',
params: {
... ... @@ -140,4 +143,11 @@ export struct LiveHorizontalCardComponent {
WDRouterRule.jumpWithAction(taskAction)
// Logger.debug(TAG, `gotoLive, ${content.objectId}`);
}
} else if (content.objectType === ContentConstants.TYPE_TELETEXT) {
ProcessUtils.processPage(content)
}
}
}
}
\ No newline at end of file
... ...
... ... @@ -26,7 +26,7 @@ export struct LiveHorizontalReservationComponent {
.fontWeight(600)
}
if (this.compDTO.operDataList.length > 2) {
if (this.compDTO.dataSourceType === 'LIVE_RESERVATION') {
Row() {
Text("更多")
.fontSize($r("app.float.font_size_14"))
... ...
... ... @@ -62,10 +62,10 @@ class MinePageDatasModel{
this.personalData.push(new MinePagePersonalFunctionsItem("评论",$r('app.media.mine_comment_icon')))
this.personalData.push(new MinePagePersonalFunctionsItem("关注",$r('app.media.mine_follow_icon')))
this.personalData.push(new MinePagePersonalFunctionsItem("收藏",$r('app.media.mine_collect_icon')))
this.personalData.push(new MinePagePersonalFunctionsItem("历史",$r('app.media.mine_history_icon')))
this.personalData.push(new MinePagePersonalFunctionsItem("消息",$r('app.media.mine_msg_icon')))
this.personalData.push(new MinePagePersonalFunctionsItem("留言板",$r('app.media.mine_msgboard_icon')))
this.personalData.push(new MinePagePersonalFunctionsItem("预约",$r('app.media.mine_order_icon')))
// this.personalData.push(new MinePagePersonalFunctionsItem("历史",$r('app.media.mine_history_icon')))
// this.personalData.push(new MinePagePersonalFunctionsItem("消息",$r('app.media.mine_msg_icon')))
// this.personalData.push(new MinePagePersonalFunctionsItem("留言板",$r('app.media.mine_msgboard_icon')))
// this.personalData.push(new MinePagePersonalFunctionsItem("预约",$r('app.media.mine_order_icon')))
return this.personalData
}
... ... @@ -93,9 +93,9 @@ class MinePageDatasModel{
if(this.moreData.length === 5){
return this.moreData
}
this.moreData.push(new MinePageMoreFunctionModel("扫一扫",$r('app.media.mine_scan')))
this.moreData.push(new MinePageMoreFunctionModel("我的奖品",$r('app.media.mine_mygift')))
this.moreData.push(new MinePageMoreFunctionModel("意见反馈",$r('app.media.mine_suggest')))
// this.moreData.push(new MinePageMoreFunctionModel("扫一扫",$r('app.media.mine_scan')))
// this.moreData.push(new MinePageMoreFunctionModel("我的奖品",$r('app.media.mine_mygift')))
// this.moreData.push(new MinePageMoreFunctionModel("意见反馈",$r('app.media.mine_suggest')))
this.moreData.push(new MinePageMoreFunctionModel("设置",$r('app.media.mine_setting')))
this.moreData.push(new MinePageMoreFunctionModel("关于",$r('app.media.mine_about')))
return this.moreData
... ...
... ... @@ -2,7 +2,7 @@ import { Action, ContentDetailDTO, InteractDataDTO } from 'wdBean/Index';
import { ContentDetailRequest } from 'wdDetailPlayApi/Index'
import { ResponseDTO } from 'wdNetwork/Index';
import { DetailPlayShortVideoPage } from './DetailPlayShortVideoPage'
import { Test } from './Test'
// import { Test } from './Test'
import router from '@ohos.router';
import window from '@ohos.window';
import {
... ... @@ -12,7 +12,7 @@ import {
contentsItem,
getRecCompInfoParams
} from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest';
import { WindowModel } from 'wdKit/Index';
import { Logger, WindowModel } from 'wdKit/Index';
import { BusinessError } from '@kit.BasicServicesKit';
interface loadMoreData {
... ... @@ -21,6 +21,9 @@ interface loadMoreData {
loadStrategy: string;
}
const TAG = 'VideoChannelDetail'
let timer: number = -1
@Entry
@Component
export struct VideoChannelDetail {
... ... @@ -48,33 +51,49 @@ export struct VideoChannelDetail {
* 监听视频频道激活或失活
*/
navIndexChange() {
if (timer) clearTimeout(timer)
timer = setTimeout(() => {
if (this.bottomNavIndex === 2 && this.topNavIndex === 0) {
// 如果视频在暂停则播放视频
this.switchVideoStatus = true
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', statusBarColor: '#000000' })
} else {
// 如果视频在播放则暂停视频
this.switchVideoStatus = false
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', statusBarColor: '#ffffff' })
// WindowModel.shared.setWindowLayoutFullScreen(false)
}
timer = -1
}, 100)
}
async aboutToAppear(): Promise<void> {
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', })
aboutToAppear() {
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', statusBarColor: '#000000' })
// WindowModel.shared.setWindowLayoutFullScreen(true)
// 根据视频频道传参查询视频楼层信息
this.getRecCompInfo()
Logger.info(TAG, 'aboutToAppear');
}
aboutToDisappear(): void {
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', })
console.error('aboutToDisappear videoChanel')
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', statusBarColor: '#ffffff' })
// WindowModel.shared.setWindowLayoutFullScreen(false)
Logger.info(TAG, 'aboutToDisappear');
}
onPageHide(): void {
console.error('onPageHide videoChanel')
onPageShow(): void {
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', statusBarColor: '#000000' })
// WindowModel.shared.setWindowLayoutFullScreen(true)
Logger.info(TAG, 'onPageShow');
}
onPageShow(): void {
console.error('onPageShow videoChanel')
onPageHide(): void {
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', statusBarColor: '#ffffff' })
// WindowModel.shared.setWindowLayoutFullScreen(false)
Logger.info(TAG, 'onPageHide');
}
/**
... ...