陈剑华

Merge remote-tracking branch 'origin/main'

  1 +import { ContentDetailDTO, InteractDataDTO, PageInfoDTO } from 'wdBean/Index'
  2 +
  3 +import { CommentListDialogView, publishCommentModel } from '../../../../Index'
  4 +
  5 +@Component
  6 +export struct CommentDialogView {
  7 + @Link @Watch('showCommentListChange') showCommentList: boolean
  8 + @Link index: number
  9 + @Link currentIndex: number
  10 + @Link publishCommentModel: publishCommentModel
  11 + @Consume contentDetailData: ContentDetailDTO
  12 + @Link interactData: InteractDataDTO
  13 + @State fakePageInfo: PageInfoDTO = {} as PageInfoDTO
  14 + @State dialogOffsetY: number = 0 // (this.windowHeight - this.windowWidth * 9 / 16)
  15 +
  16 + @State @Watch("innerShowCommentChange") innerShowComment: boolean = false
  17 +
  18 + showCommentListChange(val: boolean) {
  19 + if (this.showCommentList && this.index === this.currentIndex) {
  20 + this.innerShowComment = true
  21 + } else {
  22 + this.innerShowComment = false
  23 + }
  24 + }
  25 +
  26 + innerShowCommentChange() {
  27 + this.showCommentList = this.innerShowComment
  28 + }
  29 +
  30 + build() {
  31 + CommentListDialogView({
  32 + showCommentList: this.innerShowComment,
  33 + contentDetailData: this.contentDetailData,
  34 + publishCommentModel: this.publishCommentModel,
  35 + pageInfo: this.fakePageInfo,
  36 + onClose: () => {
  37 + this.showCommentList = false
  38 + if (Number.parseInt(this.publishCommentModel.totalCommentNumer) > Number.parseInt(this.interactData.commentNum + "")) {
  39 + this.interactData.commentNum = Number.parseInt(this.publishCommentModel.totalCommentNumer)
  40 + }
  41 + }
  42 + })
  43 + }
  44 +}
@@ -12,7 +12,7 @@ export struct MultiPictureDetailItemComponent { @@ -12,7 +12,7 @@ export struct MultiPictureDetailItemComponent {
12 12
13 13
14 async aboutToAppear() { 14 async aboutToAppear() {
15 - // Logger.info(TAG, 'pictures preview') 15 + // Logger.info(TAG, 'pictures preview'
16 } 16 }
17 17
18 build() { 18 build() {
1 -import { Action, H5ReceiveDetailBean, ContentDetailDTO } from 'wdBean'; 1 +import { Action, H5ReceiveDetailBean, ContentDetailDTO, InteractDataDTO } from 'wdBean';
2 import { WdWebComponent } from 'wdWebComponent'; 2 import { WdWebComponent } from 'wdWebComponent';
3 import router from '@ohos.router'; 3 import router from '@ohos.router';
4 import { CommonConstants } from 'wdConstant' 4 import { CommonConstants } from 'wdConstant'
@@ -13,6 +13,7 @@ import { NetworkUtil, WindowModel } from 'wdKit'; @@ -13,6 +13,7 @@ import { NetworkUtil, WindowModel } from 'wdKit';
13 import { viewBlogItemInsightIntentShare } from '../utils/InsightIntentShare' 13 import { viewBlogItemInsightIntentShare } from '../utils/InsightIntentShare'
14 import { common } from '@kit.AbilityKit'; 14 import { common } from '@kit.AbilityKit';
15 import { PageRepository } from '../repository/PageRepository'; 15 import { PageRepository } from '../repository/PageRepository';
  16 +import { CommentDialogView } from './CommentDialogView';
16 17
17 const TAG: string = 'SpacialTopicPageComponent' 18 const TAG: string = 'SpacialTopicPageComponent'
18 19
@@ -23,7 +24,11 @@ export struct SpacialTopicPageComponent { @@ -23,7 +24,11 @@ export struct SpacialTopicPageComponent {
23 action: Action = {} as Action 24 action: Action = {} as Action
24 @State webUrl: string = ''; 25 @State webUrl: string = '';
25 @State subjectData: string = ''; 26 @State subjectData: string = '';
  27 + @State index: number = 0
  28 + @State currentIndex: number = 0
26 @State isPageEnd: boolean = false 29 @State isPageEnd: boolean = false
  30 + @State showCommentList: boolean = false
  31 + @State interactData: InteractDataDTO = {} as InteractDataDTO
27 @Prop reload: number = 0; 32 @Prop reload: number = 0;
28 @Provide contentDetailData: ContentDetailDTO = {} as ContentDetailDTO 33 @Provide contentDetailData: ContentDetailDTO = {} as ContentDetailDTO
29 private h5ReceiveAppData: H5ReceiveDetailBean = { dataSource: '2' } as H5ReceiveDetailBean 34 private h5ReceiveAppData: H5ReceiveDetailBean = { dataSource: '2' } as H5ReceiveDetailBean
@@ -185,6 +190,16 @@ export struct SpacialTopicPageComponent { @@ -185,6 +190,16 @@ export struct SpacialTopicPageComponent {
185 publishCommentModel: this.publishCommentModel, 190 publishCommentModel: this.publishCommentModel,
186 operationButtonList: this.operationButtonList, 191 operationButtonList: this.operationButtonList,
187 styleType: 1, 192 styleType: 1,
  193 + onCommentIconClick:()=>{
  194 + this.showCommentList = true
  195 + }
  196 + })
  197 + CommentDialogView({
  198 + index: $index,
  199 + currentIndex: $currentIndex,
  200 + showCommentList: $showCommentList,
  201 + publishCommentModel: $publishCommentModel,
  202 + interactData: $interactData,
188 }) 203 })
189 } 204 }
190 }.width(CommonConstants.FULL_WIDTH).height(CommonConstants.FULL_HEIGHT) 205 }.width(CommonConstants.FULL_WIDTH).height(CommonConstants.FULL_HEIGHT)
@@ -48,6 +48,7 @@ export struct OperRowListView { @@ -48,6 +48,7 @@ export struct OperRowListView {
48 private onCommentFocus: () => void = () => { 48 private onCommentFocus: () => void = () => {
49 } 49 }
50 private onCommentIconClick: () => void = () => { 50 private onCommentIconClick: () => void = () => {
  51 +
51 } 52 }
52 53
53 @Provide inDialog: boolean = false 54 @Provide inDialog: boolean = false
@@ -252,6 +253,9 @@ export struct OperRowListView { @@ -252,6 +253,9 @@ export struct OperRowListView {
252 @Builder 253 @Builder
253 builderComment() { 254 builderComment() {
254 Column() { 255 Column() {
  256 + // Text((this.contentDetailData.openComment == 1).toString())
  257 + // Text((this.contentDetailData.commentDisplay == 1).toString())
  258 + // Text(this.publishCommentModel?.targetId.toString())
255 if (this.contentDetailData.openComment == 1 259 if (this.contentDetailData.openComment == 1
256 && this.contentDetailData.commentDisplay == 1 260 && this.contentDetailData.commentDisplay == 1
257 && this.publishCommentModel?.targetId) { 261 && this.publishCommentModel?.targetId) {
@@ -284,9 +288,10 @@ export struct OperRowListView { @@ -284,9 +288,10 @@ export struct OperRowListView {
284 contentDetail: this.contentDetailData 288 contentDetail: this.contentDetailData
285 }) 289 })
286 .onClick(() => { 290 .onClick(() => {
  291 + console.log('akdbakdbakdbaksjd')
287 this.onCommentIconClick() 292 this.onCommentIconClick()
288 293
289 - console.log(JSON.stringify(this.dialogController?.open)) 294 + // console.log('his.dialogController?.open',JSON.stringify(this.dialogController))
290 295
291 // 评论弹框内部嵌入 296 // 评论弹框内部嵌入
292 !this.showBackIcon && this.dialogController?.open() 297 !this.showBackIcon && this.dialogController?.open()
@@ -92,9 +92,8 @@ struct MultiPictureDetailPage { @@ -92,9 +92,8 @@ struct MultiPictureDetailPage {
92 * TODO:颜色待根据业务接口修改 92 * TODO:颜色待根据业务接口修改
93 */ 93 */
94 openFullScreen() { 94 openFullScreen() {
  95 + WindowModel.shared.setWindowLayoutFullScreen(true)
95 WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', }) 96 WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', })
96 - // WindowModel.shared.setWindowLayoutFullScreen(true)  
97 - // WindowModel.shared.setWindowSystemBarEnable([])  
98 } 97 }
99 98
100 /** 99 /**
@@ -102,9 +101,8 @@ struct MultiPictureDetailPage { @@ -102,9 +101,8 @@ struct MultiPictureDetailPage {
102 * TODO:颜色待根据业务接口修改 101 * TODO:颜色待根据业务接口修改
103 */ 102 */
104 closeFullScreen() { 103 closeFullScreen() {
  104 + WindowModel.shared.setWindowLayoutFullScreen(false)
105 WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', }) 105 WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', })
106 - // WindowModel.shared.setWindowLayoutFullScreen(false)  
107 - // WindowModel.shared.setWindowSystemBarEnable(['status', 'navigation'])  
108 } 106 }
109 107
110 } 108 }
@@ -353,7 +353,12 @@ export struct MultiPictureDetailPageComponent { @@ -353,7 +353,12 @@ export struct MultiPictureDetailPageComponent {
353 .lineHeight(19) 353 .lineHeight(19)
354 } 354 }
355 .fontColor(Color.White) 355 .fontColor(Color.White)
356 - .margin(4) 356 + .margin({
  357 + top: 4,
  358 + left: 18,
  359 + bottom: 4,
  360 + right: 4
  361 + })
357 } 362 }
358 if (this.contentDetailData.newsTitle) { 363 if (this.contentDetailData.newsTitle) {
359 Text(`${this.contentDetailData.newsTitle}`) 364 Text(`${this.contentDetailData.newsTitle}`)
@@ -364,9 +369,9 @@ export struct MultiPictureDetailPageComponent { @@ -364,9 +369,9 @@ export struct MultiPictureDetailPageComponent {
364 .lineHeight(24) 369 .lineHeight(24)
365 .margin({ 370 .margin({
366 top: 4, 371 top: 4,
367 - left: 0, 372 + left: 18,
368 bottom: 4, 373 bottom: 4,
369 - right: 0 374 + right: 18
370 }) 375 })
371 } 376 }
372 if (this.contentDetailData.photoList?.[this.swiperIndex].picDesc) { 377 if (this.contentDetailData.photoList?.[this.swiperIndex].picDesc) {