liyubing

Merge remote-tracking branch 'origin/main'

@@ -53,6 +53,8 @@ export struct MultiPictureDetailPageComponent { @@ -53,6 +53,8 @@ export struct MultiPictureDetailPageComponent {
53 @Provide showCommentList: boolean = false 53 @Provide showCommentList: boolean = false
54 private subScroller: Scroller = new Scroller() 54 private subScroller: Scroller = new Scroller()
55 private scroller: Scroller = new Scroller() 55 private scroller: Scroller = new Scroller()
  56 + private listScroller: ListScroller = new ListScroller()
  57 + @State contentStartOffset: number = 0;
56 @State netStatus: number | undefined = undefined // 存储网络状态用来展示缺省图 58 @State netStatus: number | undefined = undefined // 存储网络状态用来展示缺省图
57 @State isOffLine: boolean = false // 存储视频下线状态用来展示缺省图 59 @State isOffLine: boolean = false // 存储视频下线状态用来展示缺省图
58 @State showDownload: Boolean = false // 控制是否显示下载默认隐藏 60 @State showDownload: Boolean = false // 控制是否显示下载默认隐藏
@@ -73,6 +75,8 @@ export struct MultiPictureDetailPageComponent { @@ -73,6 +75,8 @@ export struct MultiPictureDetailPageComponent {
73 let _swiperIndex = Number.parseInt(this.currentPageNum) 75 let _swiperIndex = Number.parseInt(this.currentPageNum)
74 Logger.info(TAG, `_swiperIndex:${_swiperIndex}`) 76 Logger.info(TAG, `_swiperIndex:${_swiperIndex}`)
75 this.swiperIndex = _swiperIndex > 0 ? _swiperIndex - 1 : _swiperIndex 77 this.swiperIndex = _swiperIndex > 0 ? _swiperIndex - 1 : _swiperIndex
  78 + this.scroller.scrollEdge(Edge.Top)
  79 + this.listScroller.scrollEdge(Edge.Top)
76 } 80 }
77 81
78 async aboutToAppear() { 82 async aboutToAppear() {
@@ -348,6 +352,8 @@ export struct MultiPictureDetailPageComponent { @@ -348,6 +352,8 @@ export struct MultiPictureDetailPageComponent {
348 .zIndex(1) 352 .zIndex(1)
349 .onAnimationStart((index: number, targetIndex: number, extraInfo: SwiperAnimationEvent) => { 353 .onAnimationStart((index: number, targetIndex: number, extraInfo: SwiperAnimationEvent) => {
350 this.swiperIndex = targetIndex 354 this.swiperIndex = targetIndex
  355 + this.scroller.scrollEdge(Edge.Top)
  356 + this.listScroller.scrollEdge(Edge.Top)
351 }) 357 })
352 .onClick(() => { 358 .onClick(() => {
353 this.showDownload = !this.showDownload 359 this.showDownload = !this.showDownload
@@ -355,13 +361,7 @@ export struct MultiPictureDetailPageComponent { @@ -355,13 +361,7 @@ export struct MultiPictureDetailPageComponent {
355 } 361 }
356 362
357 @Builder 363 @Builder
358 - NShowDownload() {  
359 - Column() {  
360 - Scroll(this.scroller) {  
361 - Flex({  
362 - direction: FlexDirection.Column,  
363 - justifyContent: FlexAlign.Start  
364 - }) { 364 + ListItemHeader() {
365 if (this.contentDetailData?.photoList?.length) { 365 if (this.contentDetailData?.photoList?.length) {
366 Text() { 366 Text() {
367 Span(`${this.swiperIndex + 1}`) 367 Span(`${this.swiperIndex + 1}`)
@@ -382,9 +382,12 @@ export struct MultiPictureDetailPageComponent { @@ -382,9 +382,12 @@ export struct MultiPictureDetailPageComponent {
382 bottom: 4, 382 bottom: 4,
383 right: 4 383 right: 4
384 }) 384 })
  385 + .width('100%')
  386 + }
385 } 387 }
386 - List() {  
387 - ListItem(){ 388 +
  389 + @Builder
  390 + ListItemTitle() {
388 if (this.contentDetailData.newsTitle) { 391 if (this.contentDetailData.newsTitle) {
389 Text(`${this.contentDetailData.newsTitle}`) 392 Text(`${this.contentDetailData.newsTitle}`)
390 .fontColor(Color.White) 393 .fontColor(Color.White)
@@ -401,7 +404,9 @@ export struct MultiPictureDetailPageComponent { @@ -401,7 +404,9 @@ export struct MultiPictureDetailPageComponent {
401 .width('92%') 404 .width('92%')
402 } 405 }
403 } 406 }
404 - ListItem(){ 407 +
  408 + @Builder
  409 + ListItemDescription() {
405 if (this.contentDetailData.photoList?.[this.swiperIndex].picDesc) { 410 if (this.contentDetailData.photoList?.[this.swiperIndex].picDesc) {
406 Text(`${this.contentDetailData.photoList?.[this.swiperIndex].picDesc}`) 411 Text(`${this.contentDetailData.photoList?.[this.swiperIndex].picDesc}`)
407 .fontColor(Color.White) 412 .fontColor(Color.White)
@@ -420,31 +425,43 @@ export struct MultiPictureDetailPageComponent { @@ -420,31 +425,43 @@ export struct MultiPictureDetailPageComponent {
420 .width('92%') 425 .width('92%')
421 } 426 }
422 } 427 }
  428 +
  429 + @Builder
  430 + NShowDownload() {
  431 + Column() {
  432 +
  433 + Scroll(this.scroller) {
  434 + Column() {
  435 + Row()
  436 + .width("100%")
  437 + .height(this.contentDetailData.photoList?.[this.swiperIndex].picDesc ? 90 : 130)
  438 + Flex({
  439 + direction: FlexDirection.Column
  440 + }) {
  441 + this.ListItemHeader();
  442 + List({ scroller: this.listScroller }) {
  443 + ListItem() {
  444 + this.ListItemTitle()
  445 + }
  446 + ListItem() {
  447 + this.ListItemDescription()
423 } 448 }
424 - .nestedScroll(  
425 - { 449 + }
  450 + .edgeEffect(EdgeEffect.None)
  451 + .nestedScroll({
426 scrollForward: NestedScrollMode.PARENT_FIRST, 452 scrollForward: NestedScrollMode.PARENT_FIRST,
427 scrollBackward: NestedScrollMode.SELF_FIRST 453 scrollBackward: NestedScrollMode.SELF_FIRST
  454 + })
428 } 455 }
429 - )  
430 - .constraintSize (  
431 - {  
432 - maxHeight: px2vp(this.titleHeight) 456 + .constraintSize({
  457 + minHeight: 1
  458 + })
433 } 459 }
434 - )  
435 } 460 }
436 - .width('100%')  
437 - }  
438 - .scrollable(ScrollDirection.Vertical) 461 + .height(230)
  462 + .edgeEffect(EdgeEffect.None)
439 .scrollBarWidth(0) 463 .scrollBarWidth(0)
440 - .constraintSize (  
441 - {  
442 - maxHeight: px2vp(this.nShowDownloadTitleHeight)  
443 - }  
444 - )  
445 - // .initialOffset({  
446 - // yOffset: px2vp(this.titleHeight)/2  
447 - // }) 464 + .scrollBar(BarState.Off)
448 465
449 OperRowListView({ 466 OperRowListView({
450 contentDetailData: this.contentDetailData, 467 contentDetailData: this.contentDetailData,