zhenghy

评论修改

@@ -4,4 +4,6 @@ export { DetailVideoListPage } from './src/main/ets/pages/DetailVideoListPage' @@ -4,4 +4,6 @@ export { DetailVideoListPage } from './src/main/ets/pages/DetailVideoListPage'
4 4
5 export { VideoChannelDetail } from './src/main/ets/pages/VideoChannelDetail' 5 export { VideoChannelDetail } from './src/main/ets/pages/VideoChannelDetail'
6 6
7 -export { LottieViewDemo } from './src/main/ets/pages/LottieViewDemo'  
  7 +export { LottieViewDemo } from './src/main/ets/pages/LottieViewDemo'
  8 +
  9 +export { CommentDialogView } from './src/main/ets/view/CommentDialogView'
@@ -15,8 +15,8 @@ import { HttpUtils } from 'wdNetwork/Index'; @@ -15,8 +15,8 @@ import { HttpUtils } from 'wdNetwork/Index';
15 import { DateTimeUtils, WindowModel } from 'wdKit/Index'; 15 import { DateTimeUtils, WindowModel } from 'wdKit/Index';
16 import { PlayerBottomView } from '../view/PlayerBottomView'; 16 import { PlayerBottomView } from '../view/PlayerBottomView';
17 import { PlayerRightView } from '../view/PlayerRightView'; 17 import { PlayerRightView } from '../view/PlayerRightView';
18 -import { CommentDialogView } from '../view/CommentDialogView';  
19 import { DisplayDirection } from 'wdConstant/Index'; 18 import { DisplayDirection } from 'wdConstant/Index';
  19 +import { CommentDialogView } from '../view/CommentDialogView';
20 20
21 const TAG = 'DetailPlayShortVideoPage'; 21 const TAG = 'DetailPlayShortVideoPage';
22 22
@@ -28,6 +28,7 @@ const TAG = 'DetailPlayShortVideoPage'; @@ -28,6 +28,7 @@ const TAG = 'DetailPlayShortVideoPage';
28 export struct DetailPlayShortVideoPage { 28 export struct DetailPlayShortVideoPage {
29 @Prop index: number = 0 29 @Prop index: number = 0
30 @Prop @Watch('currentIndexChange') currentIndex: number = 0 30 @Prop @Watch('currentIndexChange') currentIndex: number = 0
  31 + @Provide publishCommentModel: publishCommentModel = new publishCommentModel()
31 @State playerController: WDPlayerController = new WDPlayerController(); 32 @State playerController: WDPlayerController = new WDPlayerController();
32 @Provide contentDetailData: ContentDetailDTO = {} as ContentDetailDTO 33 @Provide contentDetailData: ContentDetailDTO = {} as ContentDetailDTO
33 @Provide interactData: InteractDataDTO = {} as InteractDataDTO 34 @Provide interactData: InteractDataDTO = {} as InteractDataDTO
@@ -47,7 +48,6 @@ export struct DetailPlayShortVideoPage { @@ -47,7 +48,6 @@ export struct DetailPlayShortVideoPage {
47 @Consume topSafeHeight: number 48 @Consume topSafeHeight: number
48 @Consume showComment: boolean // 是否显示底部评论,首页视频频道传false 49 @Consume showComment: boolean // 是否显示底部评论,首页视频频道传false
49 @State imageVisible: boolean = true 50 @State imageVisible: boolean = true
50 - @State publishCommentModel: publishCommentModel = new publishCommentModel()  
51 @State ratio: number = 16 / 9 51 @State ratio: number = 16 / 9
52 52
53 /** 53 /**
@@ -164,15 +164,6 @@ export struct DetailPlayShortVideoPage { @@ -164,15 +164,6 @@ export struct DetailPlayShortVideoPage {
164 } 164 }
165 this.queryNewsInfoOfUser() 165 this.queryNewsInfoOfUser()
166 166
167 - this.publishCommentModel.targetId = String(this.contentDetailData?.newsId || '')  
168 - this.publishCommentModel.targetRelId = String(this.contentDetailData?.reLInfo?.relId || '')  
169 - this.publishCommentModel.targetTitle = this.contentDetailData?.newsTitle  
170 - this.publishCommentModel.targetRelType = String(this.contentDetailData?.reLInfo?.relType || '')  
171 - this.publishCommentModel.targetRelObjectId = String(this.contentDetailData?.reLInfo?.relObjectId || '')  
172 - this.publishCommentModel.keyArticle = String(this.contentDetailData?.keyArticle || '')  
173 - this.publishCommentModel.targetType = String(this.contentDetailData?.newsType || '')  
174 - this.publishCommentModel.visitorComment = String(this.contentDetailData?.visitorComment || '')  
175 - this.publishCommentModel.commentContent = ''  
176 167
177 } 168 }
178 169
@@ -186,7 +177,11 @@ export struct DetailPlayShortVideoPage { @@ -186,7 +177,11 @@ export struct DetailPlayShortVideoPage {
186 Stack({ alignContent: Alignment.Top }) { 177 Stack({ alignContent: Alignment.Top }) {
187 Column() { 178 Column() {
188 Stack() { 179 Stack() {
189 - 180 + CommentDialogView({
  181 + index: $index,
  182 + currentIndex: $currentIndex,
  183 + publishCommentModel: $publishCommentModel
  184 + })
190 this.playerViewBuilder() 185 this.playerViewBuilder()
191 186
192 PlayerBottomView({ 187 PlayerBottomView({
@@ -224,7 +219,6 @@ export struct DetailPlayShortVideoPage { @@ -224,7 +219,6 @@ export struct DetailPlayShortVideoPage {
224 .height('100%') 219 .height('100%')
225 .width('100%') 220 .width('100%')
226 221
227 - CommentDialogView({ publishCommentModel: this.publishCommentModel })  
228 } 222 }
229 .height('100%') 223 .height('100%')
230 .width('100%') 224 .width('100%')
@@ -9,19 +9,25 @@ import { OperRowListView } from '../../../../../wdComponent/src/main/ets/compone @@ -9,19 +9,25 @@ import { OperRowListView } from '../../../../../wdComponent/src/main/ets/compone
9 9
10 @Component 10 @Component
11 export struct CommentDialogView { 11 export struct CommentDialogView {
12 - @Prop publishCommentModel: publishCommentModel 12 + @Link publishCommentModel: publishCommentModel
  13 + @Consume @Watch('showCommentListChange') showCommentList: boolean
  14 + @Link index: number
  15 + @Link currentIndex: number
13 @Consume windowWidth: number 16 @Consume windowWidth: number
14 @Consume windowHeight: number 17 @Consume windowHeight: number
15 @Consume bottomSafeHeight: number 18 @Consume bottomSafeHeight: number
16 @Consume topSafeHeight: number 19 @Consume topSafeHeight: number
17 @Consume contentDetailData: ContentDetailDTO 20 @Consume contentDetailData: ContentDetailDTO
18 - @Consume @Watch('showCommentListChange') showCommentList: boolean  
19 @State dialogOffsetY: number = 0 // (this.windowHeight - this.windowWidth * 9 / 16) 21 @State dialogOffsetY: number = 0 // (this.windowHeight - this.windowWidth * 9 / 16)
20 - @State modifier: DrawModifier = new DrawModifier();  
21 - private dialogController: CustomDialogController = new CustomDialogController({ 22 + // @State modifier: DrawModifier = new DrawModifier();
  23 + dialogController: CustomDialogController = new CustomDialogController({
22 builder: DetailDialog({ 24 builder: DetailDialog({
23 - publishCommentModel: this.publishCommentModel,  
24 - dialogOffsetY: $dialogOffsetY 25 + publishCommentModel: $publishCommentModel,
  26 + contentDetailData: $contentDetailData,
  27 + dialogOffsetY: $dialogOffsetY,
  28 + showCommentList: $showCommentList,
  29 + windowWidth: this.windowWidth,
  30 + windowHeight: this.windowHeight
25 }), 31 }),
26 autoCancel: false, 32 autoCancel: false,
27 customStyle: true, 33 customStyle: true,
@@ -30,8 +36,8 @@ export struct CommentDialogView { @@ -30,8 +36,8 @@ export struct CommentDialogView {
30 // this.showCommentList = false 36 // this.showCommentList = false
31 // dismissDialogAction.dismiss() 37 // dismissDialogAction.dismiss()
32 // }, 38 // },
33 - openAnimation: { duration: 0 },  
34 - closeAnimation: { duration: 0 }, 39 + // openAnimation: { duration: 0 },
  40 + // closeAnimation: { duration: 0 },
35 }) 41 })
36 42
37 /** 43 /**
@@ -39,7 +45,7 @@ export struct CommentDialogView { @@ -39,7 +45,7 @@ export struct CommentDialogView {
39 */ 45 */
40 46
41 showCommentListChange(val: boolean) { 47 showCommentListChange(val: boolean) {
42 - if (this.showCommentList) { 48 + if (this.showCommentList && this.index === this.currentIndex) {
43 this.dialogController.open() 49 this.dialogController.open()
44 console.log('open') 50 console.log('open')
45 // animateTo({ duration: 10000, expectedFrameRateRange: { min: 60, max: 60, expected: 60 } }, () => { 51 // animateTo({ duration: 10000, expectedFrameRateRange: { min: 60, max: 60, expected: 60 } }, () => {
@@ -59,25 +65,32 @@ export struct CommentDialogView { @@ -59,25 +65,32 @@ export struct CommentDialogView {
59 @CustomDialog 65 @CustomDialog
60 export struct DetailDialog { 66 export struct DetailDialog {
61 controller: CustomDialogController 67 controller: CustomDialogController
62 - @Prop publishCommentModel: publishCommentModel 68 + @Link publishCommentModel: publishCommentModel
63 @Link dialogOffsetY: number 69 @Link dialogOffsetY: number
64 - @Consume contentDetailData: ContentDetailDTO  
65 - @Consume showCommentList: boolean  
66 - @Consume windowWidth: number  
67 - @Consume windowHeight: number 70 + @Link contentDetailData: ContentDetailDTO
  71 + @Link showCommentList: boolean
  72 + @Prop windowWidth: number
  73 + @Prop windowHeight: number
68 74
69 build() { 75 build() {
70 Column() { 76 Column() {
71 - CommentComponent({  
72 - publishCommentModel: this.publishCommentModel,  
73 - showCloseIcon: true,  
74 - onCloseClick: () => {  
75 - console.log('onCloseClick')  
76 - this.showCommentList = false  
77 - this.controller.close()  
78 - }  
79 - })  
80 - .layoutWeight(1) 77 + Scroll() {
  78 + CommentComponent({
  79 + publishCommentModel: this.publishCommentModel,
  80 + showCloseIcon: true,
  81 + onCloseClick: () => {
  82 + console.log('onCloseClick')
  83 + this.showCommentList = false
  84 + this.controller.close()
  85 + // setTimeout(() => {
  86 + //
  87 + // }, 1000)
  88 +
  89 + }
  90 + }).height('100%')
  91 + }
  92 + .layoutWeight(1)
  93 +
81 OperRowListView({ 94 OperRowListView({
82 componentType: 1, 95 componentType: 1,
83 showBackIcon: false, 96 showBackIcon: false,
@@ -69,7 +69,6 @@ export struct PlayerProgressView { @@ -69,7 +69,6 @@ export struct PlayerProgressView {
69 69
70 }) 70 })
71 } 71 }
72 - .margin({ top: 40 })  
73 .visibility(this.isOpenDetail ? Visibility.None : Visibility.Visible) 72 .visibility(this.isOpenDetail ? Visibility.None : Visibility.Visible)
74 } 73 }
75 } 74 }
@@ -7,6 +7,9 @@ import { @@ -7,6 +7,9 @@ import {
7 postExecuteLikeParams, 7 postExecuteLikeParams,
8 postInteractAccentionOperateParams 8 postInteractAccentionOperateParams
9 } from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest'; 9 } from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest';
  10 +import {
  11 + publishCommentModel
  12 +} from '../../../../../wdComponent/src/main/ets/components/comment/model/PublishCommentModel'
10 import { SPHelper, ToastUtils, NumberFormatterUtils } from 'wdKit'; 13 import { SPHelper, ToastUtils, NumberFormatterUtils } from 'wdKit';
11 import { WDPlayerController } from 'wdPlayer/Index'; 14 import { WDPlayerController } from 'wdPlayer/Index';
12 import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; 15 import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
@@ -34,6 +37,7 @@ export struct PlayerRightView { @@ -34,6 +37,7 @@ export struct PlayerRightView {
34 @Consume showComment?: boolean 37 @Consume showComment?: boolean
35 @Consume showCommentList: boolean 38 @Consume showCommentList: boolean
36 @Consume displayDirection: DisplayDirection 39 @Consume displayDirection: DisplayDirection
  40 + @Consume publishCommentModel: publishCommentModel
37 @State likesStyle: number = this.contentDetailData.likesStyle // 赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空 41 @State likesStyle: number = this.contentDetailData.likesStyle // 赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空
38 42
39 aboutToAppear() { 43 aboutToAppear() {
@@ -346,6 +350,16 @@ export struct PlayerRightView { @@ -346,6 +350,16 @@ export struct PlayerRightView {
346 } 350 }
347 .margin({ bottom: 20 }) 351 .margin({ bottom: 20 })
348 .onClick((event: ClickEvent) => { 352 .onClick((event: ClickEvent) => {
  353 + this.publishCommentModel.targetId = String(this.contentDetailData?.newsId || '')
  354 + this.publishCommentModel.targetRelId = String(this.contentDetailData?.reLInfo?.relId || '')
  355 + this.publishCommentModel.targetTitle = this.contentDetailData?.newsTitle
  356 + this.publishCommentModel.targetRelType = String(this.contentDetailData?.reLInfo?.relType || '')
  357 + this.publishCommentModel.targetRelObjectId = String(this.contentDetailData?.reLInfo?.relObjectId || '')
  358 + this.publishCommentModel.keyArticle = String(this.contentDetailData?.keyArticle || '')
  359 + this.publishCommentModel.targetType = String(this.contentDetailData?.newsType || '')
  360 + this.publishCommentModel.visitorComment = String(this.contentDetailData?.visitorComment || '')
  361 + this.publishCommentModel.commentContent = ''
  362 +
349 // ToastUtils.showToast('评论为公共方法,待开发', 1000); 363 // ToastUtils.showToast('评论为公共方法,待开发', 1000);
350 this.showCommentList = true 364 this.showCommentList = true
351 }) 365 })