zhenghy

图集添加评论弹窗

@@ -24,6 +24,7 @@ import { SpConstants } from 'wdConstant/Index'; @@ -24,6 +24,7 @@ import { SpConstants } from 'wdConstant/Index';
24 import { router } from '@kit.ArkUI'; 24 import { router } from '@kit.ArkUI';
25 import { viewBlogItemInsightIntentShare } from '../utils/InsightIntentShare' 25 import { viewBlogItemInsightIntentShare } from '../utils/InsightIntentShare'
26 import { common } from '@kit.AbilityKit'; 26 import { common } from '@kit.AbilityKit';
  27 +import { CommentDialogView } from 'wdDetailPlayShortVideo/Index';
27 28
28 const TAG = 'MultiPictureDetailPageComponent'; 29 const TAG = 'MultiPictureDetailPageComponent';
29 30
@@ -37,20 +38,24 @@ export struct MultiPictureDetailPageComponent { @@ -37,20 +38,24 @@ export struct MultiPictureDetailPageComponent {
37 private picWidth: number = 0 38 private picWidth: number = 0
38 @State picHeight: number = 0 39 @State picHeight: number = 0
39 @State titleHeight: number = 0 40 @State titleHeight: number = 0
  41 + @State index: number = 0
  42 + @State currentIndex: number = 0
40 @Provide contentDetailData: ContentDetailDTO = {} as ContentDetailDTO 43 @Provide contentDetailData: ContentDetailDTO = {} as ContentDetailDTO
  44 + @Provide windowWidth: number = AppStorage.get<number>('windowWidth') || 0
  45 + @Provide windowHeight: number = AppStorage.get<number>('windowHeight') || 0
  46 + @Provide bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
  47 + @Provide topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
41 @Provide @Watch('onCurrentPageNumUpdated') currentPageNum: string = '01' 48 @Provide @Watch('onCurrentPageNumUpdated') currentPageNum: string = '01'
42 private swiperController: SwiperController = new SwiperController() 49 private swiperController: SwiperController = new SwiperController()
43 private swiperControllerItem: SwiperController = new SwiperController() 50 private swiperControllerItem: SwiperController = new SwiperController()
44 @State swiperIndex: number = 0; 51 @State swiperIndex: number = 0;
45 @Provide followStatus: string | undefined = undefined // 关注状态 52 @Provide followStatus: string | undefined = undefined // 关注状态
  53 + @Provide showCommentList: boolean = false
46 private scroller: Scroller = new Scroller() 54 private scroller: Scroller = new Scroller()
47 @State netStatus: number | undefined = undefined // 存储网络状态用来展示缺省图 55 @State netStatus: number | undefined = undefined // 存储网络状态用来展示缺省图
48 @State showDownload: Boolean = false // 控制是否显示下载默认隐藏 56 @State showDownload: Boolean = false // 控制是否显示下载默认隐藏
49 @State publishCommentModel: publishCommentModel = new publishCommentModel() 57 @State publishCommentModel: publishCommentModel = new publishCommentModel()
50 @State operationButtonList: string[] = ['comment', 'like', 'collect', 'share'] 58 @State operationButtonList: string[] = ['comment', 'like', 'collect', 'share']
51 - @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') as number;  
52 - @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') as number;  
53 - @State windowHeight: number = AppStorage.get<number>('windowHeight') as number;  
54 @State currentOffset: number = 0 59 @State currentOffset: number = 0
55 @State duration: number = 0 60 @State duration: number = 0
56 61
@@ -92,6 +97,13 @@ export struct MultiPictureDetailPageComponent { @@ -92,6 +97,13 @@ export struct MultiPictureDetailPageComponent {
92 build() { 97 build() {
93 RelativeContainer() { 98 RelativeContainer() {
94 this.init() 99 this.init()
  100 + CommentDialogView({
  101 + index: $index,
  102 + currentIndex: $currentIndex,
  103 + showCommentList: $showCommentList,
  104 + publishCommentModel: $publishCommentModel
  105 + })
  106 +
95 } 107 }
96 .width('100%') 108 .width('100%')
97 .height('100%') 109 .height('100%')
@@ -369,8 +381,12 @@ export struct MultiPictureDetailPageComponent { @@ -369,8 +381,12 @@ export struct MultiPictureDetailPageComponent {
369 operationButtonList: this.operationButtonList, 381 operationButtonList: this.operationButtonList,
370 styleType: 2, 382 styleType: 2,
371 componentType: 5, 383 componentType: 5,
372 - pageComponentType: 3 384 + pageComponentType: 3,
  385 + onCommentIconClick: () => {
  386 + this.showCommentList = true
  387 + }
373 }) 388 })
  389 +
374 } 390 }
375 .transition(TransitionEffect.OPACITY.animation({ duration: this.duration, curve: Curve.Ease }).combine( 391 .transition(TransitionEffect.OPACITY.animation({ duration: this.duration, curve: Curve.Ease }).combine(
376 TransitionEffect.translate({ x: 0, y: `-${this.bottomSafeHeight}px` }) 392 TransitionEffect.translate({ x: 0, y: `-${this.bottomSafeHeight}px` })
@@ -551,8 +567,8 @@ export struct MultiPictureDetailPageComponent { @@ -551,8 +567,8 @@ export struct MultiPictureDetailPageComponent {
551 /** 567 /**
552 * 意图上报 568 * 意图上报
553 */ 569 */
554 - private viewBlogInsightIntentShare(){ 570 + private viewBlogInsightIntentShare() {
555 let context = getContext(this) as common.UIAbilityContext; 571 let context = getContext(this) as common.UIAbilityContext;
556 - viewBlogItemInsightIntentShare(context,this.contentDetailData) 572 + viewBlogItemInsightIntentShare(context, this.contentDetailData)
557 } 573 }
558 } 574 }
@@ -180,6 +180,7 @@ export struct DetailPlayShortVideoPage { @@ -180,6 +180,7 @@ export struct DetailPlayShortVideoPage {
180 CommentDialogView({ 180 CommentDialogView({
181 index: $index, 181 index: $index,
182 currentIndex: $currentIndex, 182 currentIndex: $currentIndex,
  183 + showCommentList: $showCommentList,
183 publishCommentModel: $publishCommentModel 184 publishCommentModel: $publishCommentModel
184 }) 185 })
185 this.playerViewBuilder() 186 this.playerViewBuilder()
@@ -10,7 +10,7 @@ import { OperRowListView } from '../../../../../wdComponent/src/main/ets/compone @@ -10,7 +10,7 @@ import { OperRowListView } from '../../../../../wdComponent/src/main/ets/compone
10 @Component 10 @Component
11 export struct CommentDialogView { 11 export struct CommentDialogView {
12 @Link publishCommentModel: publishCommentModel 12 @Link publishCommentModel: publishCommentModel
13 - @Consume @Watch('showCommentListChange') showCommentList: boolean 13 + @Link @Watch('showCommentListChange') showCommentList: boolean
14 @Link index: number 14 @Link index: number
15 @Link currentIndex: number 15 @Link currentIndex: number
16 @Consume windowWidth: number 16 @Consume windowWidth: number