陈剑华

fix: 16979 UI还原问题--人民号图集中的文字详情在超长文字描述时鸿蒙版上拉位置与安卓不一致

... ... @@ -53,6 +53,8 @@ export struct MultiPictureDetailPageComponent {
@Provide showCommentList: boolean = false
private subScroller: Scroller = new Scroller()
private scroller: Scroller = new Scroller()
private listScroller: ListScroller = new ListScroller()
@State contentStartOffset: number = 0;
@State netStatus: number | undefined = undefined // 存储网络状态用来展示缺省图
@State isOffLine: boolean = false // 存储视频下线状态用来展示缺省图
@State showDownload: Boolean = false // 控制是否显示下载默认隐藏
... ... @@ -73,6 +75,8 @@ export struct MultiPictureDetailPageComponent {
let _swiperIndex = Number.parseInt(this.currentPageNum)
Logger.info(TAG, `_swiperIndex:${_swiperIndex}`)
this.swiperIndex = _swiperIndex > 0 ? _swiperIndex - 1 : _swiperIndex
this.scroller.scrollEdge(Edge.Top)
this.listScroller.scrollEdge(Edge.Top)
}
async aboutToAppear() {
... ... @@ -348,6 +352,8 @@ export struct MultiPictureDetailPageComponent {
.zIndex(1)
.onAnimationStart((index: number, targetIndex: number, extraInfo: SwiperAnimationEvent) => {
this.swiperIndex = targetIndex
this.scroller.scrollEdge(Edge.Top)
this.listScroller.scrollEdge(Edge.Top)
})
.onClick(() => {
this.showDownload = !this.showDownload
... ... @@ -355,13 +361,7 @@ export struct MultiPictureDetailPageComponent {
}
@Builder
NShowDownload() {
Column() {
Scroll(this.scroller) {
Flex({
direction: FlexDirection.Column,
justifyContent: FlexAlign.Start
}) {
ListItemHeader() {
if (this.contentDetailData?.photoList?.length) {
Text() {
Span(`${this.swiperIndex + 1}`)
... ... @@ -382,9 +382,12 @@ export struct MultiPictureDetailPageComponent {
bottom: 4,
right: 4
})
.width('100%')
}
}
List() {
ListItem(){
@Builder
ListItemTitle() {
if (this.contentDetailData.newsTitle) {
Text(`${this.contentDetailData.newsTitle}`)
.fontColor(Color.White)
... ... @@ -401,7 +404,9 @@ export struct MultiPictureDetailPageComponent {
.width('92%')
}
}
ListItem(){
@Builder
ListItemDescription() {
if (this.contentDetailData.photoList?.[this.swiperIndex].picDesc) {
Text(`${this.contentDetailData.photoList?.[this.swiperIndex].picDesc}`)
.fontColor(Color.White)
... ... @@ -420,31 +425,41 @@ export struct MultiPictureDetailPageComponent {
.width('92%')
}
}
@Builder
NShowDownload() {
Column() {
Scroll(this.scroller) {
Column() {
Row()
.width("100%")
.height(this.contentDetailData.photoList?.[this.swiperIndex].picDesc ? 90 : 130)
Flex({
direction: FlexDirection.Column
}) {
this.ListItemHeader();
List({ scroller: this.listScroller }) {
ListItem() {
this.ListItemTitle()
}
ListItem() {
this.ListItemDescription()
}
.nestedScroll(
{
}
.edgeEffect(EdgeEffect.None)
.nestedScroll({
scrollForward: NestedScrollMode.PARENT_FIRST,
scrollBackward: NestedScrollMode.SELF_FIRST
})
}
)
.constraintSize (
{
maxHeight: px2vp(this.titleHeight)
.height('100%')
}
)
}
.width('100%')
}
.scrollable(ScrollDirection.Vertical)
.height(230)
.edgeEffect(EdgeEffect.None)
.scrollBarWidth(0)
.constraintSize (
{
maxHeight: px2vp(this.nShowDownloadTitleHeight)
}
)
// .initialOffset({
// yOffset: px2vp(this.titleHeight)/2
// })
.scrollBar(BarState.Off)
OperRowListView({
contentDetailData: this.contentDetailData,
... ...