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:1)电子报-电子报最后一版进入读报纸列表后_未展示该版内容
  fix:1)电子报-电子报最后一版进入读报纸列表后_未展示该版内容
  fix(17084): UI还原问题-【生产环境】进度条上圆点与android不一致看图
  电子报newspaper_shadow优化
  fix:1)电子报-电子报最后一版进入读报纸列表后_未展示该版内容
  fix(16650): 功能缺陷--进入横屏直播页,全屏后,点击分享按钮没有反应
... ... @@ -60,10 +60,11 @@ export struct ENewspaperPageComponent {
//watch监听报纸页码回调
onCurrentPageNumUpdated(): void {
console.log("ENewspaperPageComponent-onCurrentPageNumUpdated", "currentPageNum:", this.currentPageNum)
let _swiperIndex = Number.parseInt(this.currentPageNum)
console.log("ENewspaperPageComponent-onCurrentPageNumUpdated", "_swiperIndex:", _swiperIndex)
this.swiperIndex = _swiperIndex > 0 ? _swiperIndex - 1 : _swiperIndex
// let _swiperIndex = Number.parseInt(this.currentPageNum)
// console.log("ENewspaperPageComponent-onCurrentPageNumUpdated", "_swiperIndex:", _swiperIndex)
// this.swiperIndex = _swiperIndex > 0 ? _swiperIndex - 1 : _swiperIndex
this.swiperIndex = this.newspaperListBean?.list.findIndex(_item => _item?.pageNum === this.currentPageNum)
//电子报--版面序号选择点击
TrackingContent.clickWithEvent('panel_number_selection_click', TrackConstants.PageName.NewsPaperPage,
TrackConstants.PageName.NewsPaperPage
... ... @@ -140,7 +141,8 @@ export struct ENewspaperPageComponent {
let screenHeight = this.displayTool.height;
// bottomSafeHeight 底导高度 topSafeHeight 顶导高度 44 顶部高度 60 底部高度
// newspaper_shadow 49 高度 e_newspaper_content 59 margin top
let height = screenHeight - this.bottomSafeHeight - this.topSafeHeight - vp2px(44) - vp2px(60) - vp2px(49) -vp2px(59)
let height =
screenHeight - this.bottomSafeHeight - this.topSafeHeight - vp2px(44) - vp2px(60) - vp2px(49) - vp2px(59)
this.picHeight = height
let ratio = this.ratio == '100%' ? 1 : 0.5
... ... @@ -176,6 +178,7 @@ export struct ENewspaperPageComponent {
this.resize()
});
}
resize() {
this.screenWidth = this.windowClass?.getWindowProperties()?.windowRect.width || this.displayTool.width
// 2000折叠屏 TODO DeviceUtil 方法完善了换判断条件
... ... @@ -296,13 +299,13 @@ export struct ENewspaperPageComponent {
Row() {
Image($r('app.media.newspaper_shadow'))
.height($r('app.float.vp_12'))
.width('100%')
.width(px2vp(this.picWidth))
.objectFit(ImageFit.Contain)
}.margin({ top: -1,left: 10, right: 10 }).alignRules({
}.margin({ top: -1 }).alignRules({
top: { anchor: "e_newspaper_content", align: VerticalAlign.Bottom },
// left: { anchor: 'e_newspaper_content', align: HorizontalAlign.Start },
// right: { anchor: 'e_newspaper_content', align: HorizontalAlign.End }
left: { anchor: 'e_newspaper_content', align: HorizontalAlign.Start },
right: { anchor: 'e_newspaper_content', align: HorizontalAlign.End }
})
.id('e_newspaper_shadow')
... ...
... ... @@ -122,7 +122,6 @@ export default struct TemplatePageComponent {
LazyForEach(this.templatePage.compList, (compDTO: CompDTO, index: number) => {
ListItem() {
Column() {
CompParser({
compDTO: compDTO,
nextCompDTO: index === this.templatePage.compList.getDataArray().length - 1 ? new CompDTO() : this.templatePage.compList.get(index + 1) as CompDTO,
... ...
... ... @@ -5,6 +5,8 @@ import { ENewspaperPageDialog } from '../dialog/ENewspaperPageDialog'
import { Logger } from 'wdKit';
import { font, window } from '@kit.ArkUI';
const TAG: string = 'ENewspaperListDialog';
/**
* 读报纸半屏弹窗
* 弹窗嵌套参考资料(https://developer.harmonyos.com/cn/docs/documentation/doc-references-V2/ts-methods-custom-dialog-box-0000001580345722-V2)
... ... @@ -18,13 +20,15 @@ export struct ENewspaperListDialog {
private listScroller: Scroller = new Scroller()
@State scrollOffset: number = 0
@State isCurrentViewOpen: boolean = false
@Consume bottomSafeHeight:number
@Consume bottomSafeHeight: number
//文字版选择弹框
pageListDialogController: CustomDialogController = new CustomDialogController({
builder: ENewspaperPageDialog({
dialogType: 1,
newspaperListBean: this.newspaperListBean,
dialogVisibility: (visibility: boolean) => {
console.log(TAG, "ENewspaperPageDialog visibility:", visibility)
this.isCurrentViewOpen = !visibility
}
}),
... ... @@ -38,23 +42,36 @@ export struct ENewspaperListDialog {
// 那么此处需要将指向自己的controller放在所有controller的后面
// listDialogController: CustomDialogController
public closeDialog?: () => void
// 手势滑动相关
private panOption: PanGestureOptions = new PanGestureOptions({ direction: PanDirection.Up | PanDirection.Down })
private topFixedHeight = 124
@State topHeight: number = 124
private deviceHeight: number = 0
selectPageNum : boolean = true
//watch监听报纸页码回调
onCurrentPageNumUpdated(): void {
console.log("ENewspaperListDialog-onCurrentPageNumUpdated", "currentPageNum:", this.currentPageNum)
let _scrollIndex = Number.parseInt(this.currentPageNum)
console.log("ENewspaperListDialog-onCurrentPageNumUpdated", "_scrollIndex:", _scrollIndex)
let scrollIndexEnd = _scrollIndex > 0 ? _scrollIndex - 1 : _scrollIndex
// console.log(TAG, "onCurrentPageNumUpdated currentPageNum:", this.currentPageNum)
// let _scrollIndex = Number.parseInt(this.currentPageNum)
// console.log(TAG, "onCurrentPageNumUpdated _scrollIndex:", _scrollIndex)
// let scrollIndexEnd = _scrollIndex > 0 ? _scrollIndex - 1 : _scrollIndex
if (this.newspaperListBean != undefined) {
this.selectPageNum = false
// 从业务数据中找到编号
let scrollIndexEnd = this.newspaperListBean?.list.findIndex(_item => _item?.pageNum === this.currentPageNum)
console.log(TAG, "onCurrentPageNumUpdated scrollIndexEnd:", scrollIndexEnd)
console.log(TAG, "onCurrentPageNumUpdated (!this.isCurrentViewOpen):", "" + !this.isCurrentViewOpen)
if (!this.isCurrentViewOpen) {
this.listScroller.scrollToIndex(scrollIndexEnd)
}
}
}
async aboutToAppear() {
//注册字体
... ... @@ -69,11 +86,13 @@ export struct ENewspaperListDialog {
this.deviceHeight = px2vp(windowClass.getWindowProperties().windowRect.height) - changeHeight
this.isCurrentViewOpen = true
console.log("ENewspaperListDialog-aboutToAppear", "currentPageNum:", this.currentPageNum)
let _scrollIndex = Number.parseInt(this.currentPageNum)
console.log("ENewspaperListDialog-aboutToAppear", "_scrollIndex:", _scrollIndex)
this.scrollIndex = _scrollIndex > 0 ? _scrollIndex - 1 : _scrollIndex
console.log(TAG, "aboutToAppear currentPageNum:", this.currentPageNum)
// let _scrollIndex = Number.parseInt(this.currentPageNum)
// console.log(TAG, "aboutToAppear _scrollIndex:", _scrollIndex)
// this.scrollIndex = _scrollIndex > 0 ? _scrollIndex - 1 : _scrollIndex
// this.listScroller.scrollToIndex(this.scrollIndex)
this.scrollIndex = this.newspaperListBean?.list.findIndex(_item => _item?.pageNum === this.currentPageNum)
}
aboutToDisappear() {
... ... @@ -134,7 +153,7 @@ export struct ENewspaperListDialog {
.gesture(
PanGesture(this.panOption)
.onActionStart((event: GestureEvent) => {
Logger.debug('ENewspaperListDialog','Pan start')
Logger.debug('ENewspaperListDialog', 'Pan start')
})
.onActionUpdate((event: GestureEvent) => {
if (this.topFixedHeight + event.offsetY >= this.topFixedHeight) {
... ... @@ -173,8 +192,7 @@ export struct ENewspaperListDialog {
Text(positionItem.shortTitle)
.fontSize($r('app.float.font_size_13'))
.fontColor($r('app.color.color_222222'))
.fontWeight(600)
// .maxLines(2)
.fontWeight(600)// .maxLines(2)
.margin({
bottom: 8
})
... ... @@ -278,25 +296,29 @@ export struct ENewspaperListDialog {
console.info('ENewspaperListDialog::first' + firstIndex)
console.info('ENewspaperListDialog::last' + lastIndex)
console.info('ENewspaperListDialog::center' + centerIndex)
// this.updateCurrentPageNum(firstIndex)
// const tempIndex = this.findClassIndex(firstIndex)
// if (firstIndex !== centerIndex) {
// return
// }
// console.info(`this.scrollOffset:` + this.scrollOffset)
// if (this.scrollOffset == 0) {
this.currentPageNum = `${firstIndex < 9 ? '0' + (firstIndex + 1) : firstIndex + 1}`
// }
// this.currentPageNum = `${firstIndex < 9 ? '0' + (firstIndex + 1) : firstIndex + 1}`
if(this.selectPageNum){
if (this.newspaperListBean != undefined) {
this.currentPageNum = this.newspaperListBean?.list[lastIndex].pageNum
}
}else {
this.selectPageNum = true
}
})
}
.margin({ top: this.topHeight })
.width('100%')
.backgroundColor(Color.White)
}.width('100%')
}
.width('100%')
.height('100%')
.backgroundColor('#80000000')
.margin({bottom:50})
.margin({ bottom: 50 })
.onClick(() => {
if (this.closeDialog) {
this.closeDialog()
... ... @@ -305,7 +327,7 @@ export struct ENewspaperListDialog {
.gesture(
PanGesture(this.panOption)
.onActionStart((event: GestureEvent) => {
Logger.debug('ENewspaperListDialog','Pan start')
Logger.debug('ENewspaperListDialog', 'Pan start')
})
.onActionUpdate((event: GestureEvent) => {
if (event) {
... ... @@ -322,7 +344,7 @@ export struct ENewspaperListDialog {
}
onCloseGestureDialog() {
if (this.topHeight >= this.deviceHeight ) {
if (this.topHeight >= this.deviceHeight) {
if (this.closeDialog) {
this.closeDialog()
}
... ...
... ... @@ -12,7 +12,7 @@ export struct ENewspaperPageDialog {
public dialogVisibility?: (visibility: boolean) => void
onCurrentPageNumUpdated(): void {
console.log("ENewspaperListDialog-onCurrentPageNumUpdated", "currentPageNum:", this.currentPageNum)
console.log('ENewspaperListDialog',"ENewspaperPageDialog-onCurrentPageNumUpdated", "currentPageNum:", this.currentPageNum)
}
aboutToAppear(): void {
... ...
... ... @@ -16,6 +16,7 @@
"wdConstant": "file:../../commons/wdConstant",
"wdDetailPlayApi": "file:../../features/wdDetailPlayApi",
"wdRouter": "file:../../commons/wdRouter",
"wdTracking": "file:../../features/wdTracking"
"wdTracking": "file:../../features/wdTracking",
"wdShare": "file:../../features/wdShare"
}
}
... ...
... ... @@ -6,6 +6,7 @@ import { DateFormatUtil, PlayerConstants, WDAliPlayerController } from 'wdPlayer
import { ContentDetailDTO, LiveRoomDataBean } from 'wdBean/Index';
import { DisplayDirection } from 'wdConstant/Index';
import { LiveFollowComponent, LottieView } from 'wdComponent/Index';
import { WDShare } from 'wdShare/Index';
//直播间播放器上层覆盖物
@Component
export struct PlayUIComponent {
... ... @@ -123,6 +124,9 @@ export struct PlayUIComponent {
.width(24)
.aspectRatio(1)
.visibility(this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL ? Visibility.Visible : Visibility.None)
.onClick(() => {
WDShare.shareContent(this.contentDetailData)
})
}
.width('100%')
.alignItems(VerticalAlign.Center)
... ... @@ -379,10 +383,11 @@ export struct PlayUIComponent {
step: 1,
style: SliderStyle.OutSet
})
.blockSize({
width: 18,
height: 12
})// .blockStyle({
// .blockSize({
// width: 18,
// height: 12
// })
// .blockStyle({
// type: SliderBlockType.IMAGE,
// image: $r('app.media.ic_player_block')
// })
... ... @@ -390,8 +395,14 @@ export struct PlayUIComponent {
.trackColor('#4DFFFFFF')
.selectedColor('#FFED2800')
.height(14)
.trackThickness(1)
.trackThickness(2)
.blockStyle({
type: SliderBlockType.IMAGE,
image: $r('app.media.ic_player_block')
})
.blockSize({ width: 18, height: 12 })
.layoutWeight(1)
.height(14)
.margin({
left: 8,
right: 8
... ...
... ... @@ -5,6 +5,7 @@ import { NumberFormatterUtils, WindowModel } from 'wdKit/Index'
import { window } from '@kit.ArkUI'
import { WDAliPlayerController } from 'wdPlayer/Index'
import { DisplayDirection } from 'wdConstant/Index'
import { WDShare } from 'wdShare/Index'
/**
* 沉浸式直播--- 头部标题
... ... @@ -76,6 +77,9 @@ export struct PlayerTitleComponent {
.aspectRatio(1)
.visibility((this.isLarge && this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL) ? Visibility.Visible : Visibility.None)
.margin({right:16})
.onClick(() => {
WDShare.shareContent(this.contentDetailData)
})
}.margin({ bottom: 10 })
Row() {
... ...
... ... @@ -123,10 +123,10 @@ export struct PlayerVideoControlComponent {
step: 1,
style: SliderStyle.OutSet
})
.blockSize({
width: 18,
height: 12
})
// .blockSize({
// width: 18,
// height: 12
// })
.trackColor('#4DFFFFFF')
.selectedColor('#FFED2800')
.trackThickness(2)
... ...