liyubing

Merge remote-tracking branch 'origin/main'

... ... @@ -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,96 +361,107 @@ export struct MultiPictureDetailPageComponent {
}
@Builder
ListItemHeader() {
if (this.contentDetailData?.photoList?.length) {
Text() {
Span(`${this.swiperIndex + 1}`)
.fontSize(24)
.fontFamily('PingFang SC-Medium')
.fontWeight(500)
.lineHeight(28)
Span(`/${this.contentDetailData?.photoList?.length}`)
.fontSize(14)
.fontFamily('PingFang SC-Medium')
.fontWeight(500)
.lineHeight(19)
}
.fontColor(Color.White)
.margin({
top: 4,
left: 18,
bottom: 4,
right: 4
})
.width('100%')
}
}
@Builder
ListItemTitle() {
if (this.contentDetailData.newsTitle) {
Text(`${this.contentDetailData.newsTitle}`)
.fontColor(Color.White)
.fontSize(16)
.fontFamily('PingFang SC-Semibold')
.fontWeight(600)
.lineHeight(24)
.margin({
top: 4,
left: 18,
bottom: 4,
right: 18
})
.width('92%')
}
}
@Builder
ListItemDescription() {
if (this.contentDetailData.photoList?.[this.swiperIndex].picDesc) {
Text(`${this.contentDetailData.photoList?.[this.swiperIndex].picDesc}`)
.fontColor(Color.White)
.fontSize(14)
.fontFamily('PingFang SC-Regular')
.fontWeight(400)
.lineHeight(22)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.margin({
top: 4,
left: 18,
bottom: 4,
right: 18
})
.maxLines(32)
.width('92%')
}
}
@Builder
NShowDownload() {
Column() {
Scroll(this.scroller) {
Flex({
direction: FlexDirection.Column,
justifyContent: FlexAlign.Start
}) {
if (this.contentDetailData?.photoList?.length) {
Text() {
Span(`${this.swiperIndex + 1}`)
.fontSize(24)
.fontFamily('PingFang SC-Medium')
.fontWeight(500)
.lineHeight(28)
Span(`/${this.contentDetailData?.photoList?.length}`)
.fontSize(14)
.fontFamily('PingFang SC-Medium')
.fontWeight(500)
.lineHeight(19)
}
.fontColor(Color.White)
.margin({
top: 4,
left: 18,
bottom: 4,
right: 4
})
}
List() {
ListItem(){
if (this.contentDetailData.newsTitle) {
Text(`${this.contentDetailData.newsTitle}`)
.fontColor(Color.White)
.fontSize(16)
.fontFamily('PingFang SC-Semibold')
.fontWeight(600)
.lineHeight(24)
.margin({
top: 4,
left: 18,
bottom: 4,
right: 18
})
.width('92%')
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(){
if (this.contentDetailData.photoList?.[this.swiperIndex].picDesc) {
Text(`${this.contentDetailData.photoList?.[this.swiperIndex].picDesc}`)
.fontColor(Color.White)
.fontSize(14)
.fontFamily('PingFang SC-Regular')
.fontWeight(400)
.lineHeight(22)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.margin({
top: 4,
left: 18,
bottom: 4,
right: 18
})
.maxLines(32)
.width('92%')
ListItem() {
this.ListItemDescription()
}
}
}
.nestedScroll(
{
.edgeEffect(EdgeEffect.None)
.nestedScroll({
scrollForward: NestedScrollMode.PARENT_FIRST,
scrollBackward: NestedScrollMode.SELF_FIRST
}
)
.constraintSize (
{
maxHeight: px2vp(this.titleHeight)
}
)
})
}
.constraintSize({
minHeight: 1
})
}
.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,
... ...