wangliang_wd

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

* 'main' of http://192.168.1.42/developOne/harmonyPool:
  fix(18831): UI还原问题-【uat】进入竖屏直播直播间。点击会显示播放和全屏按钮---新版本3.0.025-老版本无问题
  fix: 18694 UI还原问题-【uat】新闻-健康-多图详情页,文本左右间距样式问题,看图
  fix(18875): 功能缺陷-必修-【生产】 专题页点击返回按钮,没有反应
  feat: 1)我的频道栏目,点击跳转功能,遇到特殊频道需要直接跳转
  fix: 18873 UI还原问题-【生产】进入特点,广告轮播图,显示问题,看图---新版本
  feat: 1)我的频道栏目,点击跳转功能,遇到特殊频道需要直接跳转
  feat: 1)频道编辑页面,删除的频道留存的索引值无法指引顶导频道时,使用默认频道
... ... @@ -204,14 +204,14 @@ export struct SpacialTopicPageComponent {
this.showCommentList = true
}
})
//全部评论
CommentDialogView({
index: $index,
currentIndex: $currentIndex,
showCommentList: $showCommentList,
publishCommentModel: $publishCommentModel,
interactData: $interactData,
})
// //全部评论
// CommentDialogView({
// index: $index,
// currentIndex: $currentIndex,
// showCommentList: $showCommentList,
// publishCommentModel: $publishCommentModel,
// interactData: $interactData,
// })
}
}.width(CommonConstants.FULL_WIDTH).height(CommonConstants.FULL_HEIGHT)
}
... ...
... ... @@ -8,6 +8,7 @@ import { CardMediaInfo } from '../cardCommon/CardMediaInfo';
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { Notes } from '../cardview/notes';
import { InfomationCardClick } from '../../utils/infomationCardClick'
import font from '@ohos.font';
const TAG = 'Zh_Carousel_Layout-01';
... ... @@ -67,6 +68,11 @@ export struct ZhCarouselLayout01 {
list.push(i);
}
this.data = new MyDataSource(list)
font.registerFont({
familyName: 'BebasNeue',
familySrc: $rawfile('font/BebasNeue.ttf')
})
}
isAutoPlay() {
... ...
... ... @@ -19,10 +19,15 @@ struct ChannelSubscriptionLayout {
//当前选中的频道
@Link currentTopNavSelectedIndex: number;
@Prop homeChannelList: TopNavDTO []
// 我的频道栏目的频道信息数组
@Link myChannelList: TopNavDTO []
// 更多频道栏目频道信息数组
@Link moreChannelList: TopNavDTO []
// 地方频道栏目频道信息数组
@Link localChannelList: TopNavDTO []
// 收集到的我的频道栏目中的频道id
@State channelIds: number [] = []
@State isShow: boolean = false
@State dragItem: number = -1
private dragRefOffsetX: number = 0
... ... @@ -33,12 +38,12 @@ struct ChannelSubscriptionLayout {
private FIX_VP_Y: number = 48
@State indexSettingChannelId: number = AppStorage.get<number>('indexSettingChannelId') || 2002
@State isEditIng: boolean = false
@State currentTopNavSelectedItem: TopNavDTO = {} as TopNavDTO
// @State currentTopNavSelectedItem: TopNavDTO = {} as TopNavDTO
changeTab: (index: number) => void = () => {
}
aboutToAppear() {
this.currentTopNavSelectedItem = this.myChannelList[this.currentTopNavSelectedIndex]
// this.currentTopNavSelectedItem = this.myChannelList[this.currentTopNavSelectedIndex]
this.myChannelList.forEach(item => {
if(item != undefined && item.channelId != undefined){
this.channelIds.push(item.channelId)
... ... @@ -57,15 +62,66 @@ struct ChannelSubscriptionLayout {
//删除频道
delChannelItem(index: number) {
let item = this.myChannelList.splice(index, 1)[0]
this.channelIds.splice(index, 1)
AppStorage.setOrCreate('channelIds', JSON.stringify(this.channelIds))
/*
删除的频道信息回到原栏目中去
*/
if (item.moreChannel === '1') {
this.moreChannelList.unshift(item)
}
if (item.localChannel === '1') {
this.localChannelList.unshift(item)
}
// 删除频道的索引值大于 我的栏目中频道最大索引值
if(this.currentTopNavSelectedIndex > this.channelIds.length-1){
//使用默认频道
//缓存首页频道
let index = this.myChannelList.findIndex(_item => _item?.channelId === this.indexSettingChannelId)
console.debug('TopNavigationComponent','index='+index)
if (index > -1) {
this.currentTopNavSelectedIndex = index
}
}else {
//检测删除频道后的当前频道是否是特殊频道
let item = this.myChannelList[this.currentTopNavSelectedIndex]
if(this.isBroadcast(item) || this.isLayout(item)){
this.changeTab(this.currentTopNavSelectedIndex)
this.isShow = false
let index = this.myChannelList.findIndex(_item => _item?.channelId === this.indexSettingChannelId)
console.debug('TopNavigationComponent','index='+index)
if (index > -1) {
this.currentTopNavSelectedIndex = index
this.changeTab(this.currentTopNavSelectedIndex)
}
}
}
}
/**
* 频道是播报
* @param item
* @returns
*/
private isBroadcast(item?: TopNavDTO): boolean {
return item?.channelId === 2066
}
/**
* 频道是电子报
* @param item
* @returns
*/
private isLayout(item?: TopNavDTO): boolean {
return item?.channelId === 2006
}
// 添加频道
... ...
... ... @@ -12,8 +12,6 @@ import { ParamType, TrackConstants, Tracking, TrackingButton } from 'wdTracking/
import DailyPaperTopicModel from '../../model/DailyPaperTopicModel';
import { CompUtils } from '../../utils/CompUtils';
import ChannelViewModel from '../../viewmodel/ChannelViewModel';
import { JSON } from '@kit.ArkTS';
import text from '@ohos.graphics.text';
const TAG = 'TopNavigationComponent';
... ... @@ -95,7 +93,6 @@ export struct TopNavigationComponentNew {
})
} else {
channelSkeleton()
//Text('特殊频道').fontColor(Color.Red).fontSize(20).width('100%').height('100%')
}
}
})
... ... @@ -117,17 +114,8 @@ export struct TopNavigationComponentNew {
return
}
if (this.isBroadcastByIndex(index)) {
// 跳转到播报页面
ProcessUtils.gotoBroadcastPage(this.myChannelList[index].pageId)
this.channelJumpToPage(index)
} else if (this.isLayoutByIndex(index)) {
// 跳转到电子报页面
ProcessUtils.gotoENewsPaper()
} else {
this.changePage(index)
}
})
.onAnimationEnd((index: number) => {
Logger.info(TAG, `onAnimationEnd ${index}`);
... ... @@ -153,6 +141,7 @@ export struct TopNavigationComponentNew {
// 极左极右有特殊频道,用旧值
this.changePage(this.currentTopNavSelectedIndex)
}
} else {
}
})
... ... @@ -227,7 +216,7 @@ export struct TopNavigationComponentNew {
moreChannelList: $moreChannelList,
localChannelList: $localChannelList,
changeTab: (index) => {
this.changePage(index)
this.channelJumpToPage(index)
}
})
.id('channelManageBtn')
... ... @@ -352,16 +341,27 @@ export struct TopNavigationComponentNew {
// 当前tab,单击事件
this.doAutoRefresh()
} else {
this.channelJumpToPage(index)
}
})
}
/**
* 频道信息跳转页面方法
* @param index
*/
private channelJumpToPage(index :number){
if (this.isBroadcastByIndex(index)) {
// 跳转到播报页面
ProcessUtils.gotoBroadcastPage(this.myChannelList[index].pageId)
} else if (this.isLayoutByIndex(index)) {
// 跳转到电子报页面
ProcessUtils.gotoENewsPaper()
} else {
this.changePage(index)
}
}
})
}
/**
... ... @@ -369,6 +369,7 @@ export struct TopNavigationComponentNew {
* @param index 频道所在的序列号
*/
private changePage(index: number) {
Logger.info(TAG, `修改页面 changePage index : ${index}`);
this.currentTopNavSelectedIndex = index
this.swiperController.changeIndex(index)
this.listScroller.scrollToIndex(index, true, ScrollAlign.CENTER)
... ... @@ -521,7 +522,6 @@ export struct TopNavigationComponentNew {
this.topNavListHandle()
this.changePage(this.currentTopNavSelectedIndex)
console.log('XY', '----TopNavigation-------aboutToAppear' + this.navItem.name)
this.getTopNavList(this.navItem.id)
}
... ... @@ -534,11 +534,9 @@ export struct TopNavigationComponentNew {
*
*/
updateCurrentTopNavSelectedIndex() {
console.debug(TAG, 'updateCurrentTopNavSelectedIndex=>' + this.currentTopNavSelectedIndex)
if (CompUtils.isNews(this.navItem)) {
const tab = this.myChannelList[this.currentTopNavSelectedIndex]
//Logger.info(TAG, `新闻tab埋点: ${JSON.stringify(tab)}`);
// 埋点
const params: ParamType = {
"pageName": tab.name,
... ... @@ -548,8 +546,6 @@ export struct TopNavigationComponentNew {
Tracking.event("home_page_tab_click", params)
} else if (CompUtils.isRMH(this.navItem)) {
const tab = this.topNavList[this.currentTopNavSelectedIndex]
Logger.info(TAG, `人民号tab埋点: ${JSON.stringify(tab)}`);
// 埋点
const params: ParamType = {
"pageName": tab.name,
... ... @@ -663,21 +659,6 @@ export struct TopNavigationComponentNew {
return null
}
//
// private startAnimateTo(duration: number, leftMargin: number, width: number) {
// animateTo({
// duration: duration, // 动画时长
// curve: Curve.Linear, // 动画曲线
// iterations: 1, // 播放次数
// playMode: PlayMode.Normal, // 动画模式
// onFinish: () => {
// console.info('play end')
// }
// }, () => {
// this.indicatorLeftMargin = leftMargin
// this.indicatorWidth = width
// })
// }
/**
* 进入早晚报专题
... ... @@ -725,9 +706,9 @@ export struct TopNavigationComponentNew {
async getTopNavList(id: number) {
let bottomNavDetail = await ChannelViewModel.getBottomNavDetailData(id)
let topNavList = bottomNavDetail?.topNavChannelList || []
for (let topNav of topNavList) {
console.debug(TAG, 'getTopNavList=>' + JSON.stringify(topNav))
}
// for (let topNav of topNavList) {
// console.debug(TAG, 'getTopNavList=>' + JSON.stringify(topNav))
//
// }
}
}
\ No newline at end of file
... ...
... ... @@ -44,12 +44,12 @@ export struct PlayerTitleComponent {
Image($r('app.media.icon_arrow_left_white'))
.width(24)
.aspectRatio(1)
.visibility(this.isLarge ? Visibility.Visible : Visibility.None)
.visibility((this.isLarge && this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL) ? Visibility.Visible : Visibility.None)
.margin({
right: 10
})
.onClick(() => {
WindowModel.shared.setPreferredOrientation(this.isLarge ?
WindowModel.shared.setPreferredOrientation((this.isLarge && this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL) ?
window.Orientation.PORTRAIT :
window.Orientation.LANDSCAPE_INVERTED)
WindowModel.shared.setSpecificSystemBarEnabled(true)
... ... @@ -74,7 +74,7 @@ export struct PlayerTitleComponent {
Image($r('app.media.icon_share'))
.width(24)
.aspectRatio(1)
.visibility(this.isLarge ? Visibility.Visible : Visibility.None)
.visibility((this.isLarge && this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL) ? Visibility.Visible : Visibility.None)
.margin({right:16})
}.margin({ bottom: 10 })
... ...
... ... @@ -24,17 +24,17 @@ export class Tracking {
// Logger.error('yyyy','event track failed')
// })
let publicParams = new PublicParams()
publicParams.getPublicParams().then((pubParams) => {
if (params) {
for (const obj of Object.entries(params)) {
// Logger.info(TAG, ` ${obj[0]} => ` + `${obj[1]}`);
pubParams[obj[0]] = obj[1]
}
}
sensors.track(eventId, pubParams)
})
// let publicParams = new PublicParams()
// publicParams.getPublicParams().then((pubParams) => {
//
// if (params) {
// for (const obj of Object.entries(params)) {
// // Logger.info(TAG, ` ${obj[0]} => ` + `${obj[1]}`);
// pubParams[obj[0]] = obj[1]
// }
// }
// sensors.track(eventId, pubParams)
// })
}
}
... ...
... ... @@ -394,6 +394,7 @@ export struct MultiPictureDetailPageComponent {
bottom: 4,
right: 18
})
.width('92%')
}
if (this.contentDetailData.photoList?.[this.swiperIndex].picDesc) {
Text(`${this.contentDetailData.photoList?.[this.swiperIndex].picDesc}`)
... ... @@ -405,11 +406,12 @@ export struct MultiPictureDetailPageComponent {
.textOverflow({ overflow: TextOverflow.Ellipsis })
.margin({
top: 4,
left: 0,
left: 18,
bottom: 4,
right: 18
})
.maxLines(32)
.width('92%')
}
}
}
... ...