张善主

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 +}
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)
@@ -219,8 +219,7 @@ struct createImg { @@ -219,8 +219,7 @@ struct createImg {
219 }) { 219 }) {
220 Image(this.loadImg ? item.fullUrl : '') 220 Image(this.loadImg ? item.fullUrl : '')
221 .backgroundColor(0xf5f5f5) 221 .backgroundColor(0xf5f5f5)
222 - .width(113)  
223 - .height(113) 222 + .aspectRatio(item.landscape === 1 ? 343 / 172 : 228 / 305)
224 .autoResize(true) 223 .autoResize(true)
225 .borderRadius(this.caclImageRadius(index)) 224 .borderRadius(this.caclImageRadius(index))
226 .opacity(!item.weight && !item.height ? 0 : 1) 225 .opacity(!item.weight && !item.height ? 0 : 1)
@@ -88,7 +88,7 @@ export struct Card6Component { @@ -88,7 +88,7 @@ export struct Card6Component {
88 .fontSize(18) 88 .fontSize(18)
89 .lineHeight(27) 89 .lineHeight(27)
90 .fontWeight(FontWeight.Normal) 90 .fontWeight(FontWeight.Normal)
91 - .maxLines(this.contentDTO.appStyle === '6' ? 5 : 2) 91 + .maxLines(this.contentDTO.appStyle === '6' ? 4 : 2)
92 .alignSelf(ItemAlign.Start) 92 .alignSelf(ItemAlign.Start)
93 .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。 93 .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。
94 .textIndent((this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 && 94 .textIndent((this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 &&
@@ -107,7 +107,7 @@ export struct Card6Component { @@ -107,7 +107,7 @@ export struct Card6Component {
107 } 107 }
108 108
109 .alignItems(HorizontalAlign.Start) 109 .alignItems(HorizontalAlign.Start)
110 - .height(78) 110 + .height(this.contentDTO.appStyle === CompStyle.Card_13 ? 78 : 156)
111 111
112 112
113 .justifyContent(FlexAlign.SpaceBetween) 113 .justifyContent(FlexAlign.SpaceBetween)
@@ -119,7 +119,7 @@ export struct Card6Component { @@ -119,7 +119,7 @@ export struct Card6Component {
119 .backgroundColor(this.loadImg ? $r('app.color.color_B0B0B0') : 0xf5f5f5) 119 .backgroundColor(this.loadImg ? $r('app.color.color_B0B0B0') : 0xf5f5f5)
120 .borderRadius(5) 120 .borderRadius(5)
121 .aspectRatio(this.contentDTO.appStyle === CompStyle.Card_13 ? 3 / 2 : 3 / 4) 121 .aspectRatio(this.contentDTO.appStyle === CompStyle.Card_13 ? 3 / 2 : 3 / 4)
122 - .height(78) 122 + .height(this.contentDTO.appStyle === CompStyle.Card_13 ? 78 : 156)
123 CardMediaInfo({ contentDTO: this.contentDTO }) 123 CardMediaInfo({ contentDTO: this.contentDTO })
124 } 124 }
125 125
@@ -138,8 +138,7 @@ export struct Card6Component { @@ -138,8 +138,7 @@ export struct Card6Component {
138 }) 138 })
139 139
140 .width(CommonConstants.FULL_WIDTH) 140 .width(CommonConstants.FULL_WIDTH)
141 - .height(106)  
142 - .justifyContent(FlexAlign.SpaceBetween) 141 + .height(this.contentDTO.appStyle === CompStyle.Card_13 ? 106 : 184) .justifyContent(FlexAlign.SpaceBetween)
143 .alignItems(VerticalAlign.Top) 142 .alignItems(VerticalAlign.Top)
144 } 143 }
145 } 144 }
@@ -4,7 +4,7 @@ import PageModel from '../../viewmodel/PageModel'; @@ -4,7 +4,7 @@ import PageModel from '../../viewmodel/PageModel';
4 import { CommonConstants, ViewType } from 'wdConstant' 4 import { CommonConstants, ViewType } from 'wdConstant'
5 import { EmptyComponent,WDViewDefaultType } from '../view/EmptyComponent' 5 import { EmptyComponent,WDViewDefaultType } from '../view/EmptyComponent'
6 import { ErrorComponent } from '../view/ErrorComponent' 6 import { ErrorComponent } from '../view/ErrorComponent'
7 -import { CompDTO, ContentDTO } from 'wdBean' 7 +import { CompDTO, ContentDTO, contentListParams,contentListItem } from 'wdBean'
8 import NoMoreLayout from './NoMoreLayout' 8 import NoMoreLayout from './NoMoreLayout'
9 import { CustomSelectUI } from '../view/CustomSelectUI'; 9 import { CustomSelectUI } from '../view/CustomSelectUI';
10 import { CustomBottomFuctionUI } from '../view/CustomBottomFuctionUI'; 10 import { CustomBottomFuctionUI } from '../view/CustomBottomFuctionUI';
@@ -149,16 +149,13 @@ struct MyCollectionListPage { @@ -149,16 +149,13 @@ struct MyCollectionListPage {
149 .margin({left:16}) 149 .margin({left:16})
150 } 150 }
151 Column() { 151 Column() {
152 - BigPicCardComponent({compDTO:new CompDTO,contentDTO:compDTO}) 152 + BigPicCardComponent({compDTO:new CompDTO,contentDTO:compDTO,pageId:TrackConstants.PageName.My_Collect,pageName:TrackConstants.PageName.My_Collect})
153 } 153 }
154 }.onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => { 154 }.onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => {
155 if (isVisible) { 155 if (isVisible) {
156 TrackingContent.common(TrackConstants.EventType.Show, TrackConstants.PageName.My_Collect,TrackConstants.PageName.My_Collect, TrackParamConvert.program(compDTO)) 156 TrackingContent.common(TrackConstants.EventType.Show, TrackConstants.PageName.My_Collect,TrackConstants.PageName.My_Collect, TrackParamConvert.program(compDTO))
157 } 157 }
158 }) 158 })
159 - // .onClick(()=>{  
160 - // TrackingContent.common(TrackConstants.EventType.Click, TrackConstants.PageName.My_Collect,TrackConstants.PageName.My_Collect, TrackParamConvert.program(compDTO))  
161 - // })  
162 } 159 }
163 160
164 161
@@ -262,4 +259,12 @@ struct MyCollectionListPage { @@ -262,4 +259,12 @@ struct MyCollectionListPage {
262 } 259 }
263 } 260 }
264 261
  262 + getContentData(){
  263 + for (let index = 0; index < this.allDatas.length; index++) {
  264 + const compDTO = this.allDatas[index];
  265 + compDTO.isCollection = true ///用于时间展示
  266 + this.allDatas.push(compDTO)
  267 + }
  268 + }
  269 +
265 } 270 }
@@ -15,6 +15,8 @@ const TAG: string = 'BigPicCardComponent'; @@ -15,6 +15,8 @@ const TAG: string = 'BigPicCardComponent';
15 @Component 15 @Component
16 export struct BigPicCardComponent { 16 export struct BigPicCardComponent {
17 @ObjectLink compDTO: CompDTO 17 @ObjectLink compDTO: CompDTO
  18 + @State pageId: string = '';
  19 + @State pageName: string = '';
18 contentDTO: ContentDTO = new ContentDTO(); 20 contentDTO: ContentDTO = new ContentDTO();
19 21
20 aboutToAppear() { 22 aboutToAppear() {
@@ -110,7 +112,7 @@ export struct BigPicCardComponent { @@ -110,7 +112,7 @@ export struct BigPicCardComponent {
110 112
111 @Builder 113 @Builder
112 cardBuild() { 114 cardBuild() {
113 - CardParser({ compDTO: this.compDTO, contentDTO: this.contentDTO }); 115 + CardParser({ compDTO: this.compDTO, contentDTO: this.contentDTO,pageId:this.pageId,pageName:this.pageName});
114 } 116 }
115 } 117 }
116 118
@@ -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()
@@ -66,7 +66,7 @@ export struct TopPlayComponent { @@ -66,7 +66,7 @@ export struct TopPlayComponent {
66 * 更新直播播放数据 66 * 更新直播播放数据
67 */ 67 */
68 updateData() { 68 updateData() {
69 - // 检测等待中的直播预告是否视频资源 69 + // 检测直播等待状态的直播预告是否视频资源
70 if (this.contentDetailData.liveInfo && this.contentDetailData.liveInfo.previewType === 1 70 if (this.contentDetailData.liveInfo && this.contentDetailData.liveInfo.previewType === 1
71 && this.contentDetailData?.liveInfo?.liveState == 'wait' 71 && this.contentDetailData?.liveInfo?.liveState == 'wait'
72 && this.contentDetailData.liveInfo.previewUrl && 72 && this.contentDetailData.liveInfo.previewUrl &&
@@ -79,7 +79,6 @@ export struct TopPlayComponent { @@ -79,7 +79,6 @@ export struct TopPlayComponent {
79 if (this.contentDetailData.liveInfo && this.contentDetailData.liveInfo.previewUrl && 79 if (this.contentDetailData.liveInfo && this.contentDetailData.liveInfo.previewUrl &&
80 this.contentDetailData.liveInfo.previewUrl.length > 0) { 80 this.contentDetailData.liveInfo.previewUrl.length > 0) {
81 this.previewUrl = this.contentDetailData.liveInfo.previewUrl 81 this.previewUrl = this.contentDetailData.liveInfo.previewUrl
82 -  
83 } else if (this.contentDetailData.fullColumnImgUrls && this.contentDetailData.fullColumnImgUrls.length > 0) { 82 } else if (this.contentDetailData.fullColumnImgUrls && this.contentDetailData.fullColumnImgUrls.length > 0) {
84 this.previewUrl = this.contentDetailData.fullColumnImgUrls[0].url 83 this.previewUrl = this.contentDetailData.fullColumnImgUrls[0].url
85 } 84 }
@@ -126,8 +125,8 @@ export struct TopPlayComponent { @@ -126,8 +125,8 @@ export struct TopPlayComponent {
126 } 125 }
127 // 直播结束 126 // 直播结束
128 if (this.contentDetailData?.liveInfo?.liveState === 'end') { 127 if (this.contentDetailData?.liveInfo?.liveState === 'end') {
129 - this.isHideLoading = true  
130 - this.isWait = StringUtils.isNotEmpty(this.playUrl) 128 + this.isHideLoading = !StringUtils.isNotEmpty(this.playUrl)
  129 + this.isWait = !StringUtils.isNotEmpty(this.playUrl)
131 } 130 }
132 131
133 132
@@ -141,7 +140,7 @@ export struct TopPlayComponent { @@ -141,7 +140,7 @@ export struct TopPlayComponent {
141 this.previewUrl = '' 140 this.previewUrl = ''
142 } 141 }
143 } 142 }
144 - //Logger.debug(TAG, `---0------>` + this.isWait + ' ->' + this.isHideLoading + ' ->' + this.isEnd+' -->'+this.isVideoSource) 143 + // Logger.debug(TAG, `---0------>` + this.isWait + ' ->' + this.isHideLoading + ' ->' + this.isEnd+' -->'+this.isVideoSource)
145 } 144 }
146 145
147 tryToPlay() { 146 tryToPlay() {
@@ -74,6 +74,22 @@ struct LaunchAdvertisingPage { @@ -74,6 +74,22 @@ struct LaunchAdvertisingPage {
74 bottom: 0 74 bottom: 0
75 }) 75 })
76 76
  77 + if (this.defaultModel.isAd === '1'){
  78 + Stack({alignContent:Alignment.TopStart}){
  79 + Text('广告')
  80 + .fontColor(Color.White)
  81 + .textAlign(TextAlign.Center)
  82 + .fontSize('24lpx')
  83 + .width('72lpx')
  84 + .height('36lpx')
  85 + .borderRadius(2)
  86 + .margin({top:'15lpx',left:'19lpx'})
  87 + .backgroundColor('#80000000')
  88 + }
  89 + .width('100%')
  90 + .height('100%')
  91 + }
  92 +
77 Stack({alignContent:Alignment.TopEnd}){ 93 Stack({alignContent:Alignment.TopEnd}){
78 Button(){ 94 Button(){
79 Text(this.time + 's 跳过') 95 Text(this.time + 's 跳过')
@@ -95,22 +111,6 @@ struct LaunchAdvertisingPage { @@ -95,22 +111,6 @@ struct LaunchAdvertisingPage {
95 .width('100%') 111 .width('100%')
96 .height('100%') 112 .height('100%')
97 113
98 - if (this.defaultModel.isAd === '1'){  
99 - Stack({alignContent:Alignment.TopStart}){  
100 - Text('广告')  
101 - .fontColor(Color.White)  
102 - .textAlign(TextAlign.Center)  
103 - .fontSize('24lpx')  
104 - .width('72lpx')  
105 - .height('36lpx')  
106 - .borderRadius(2)  
107 - .margin({top:'15lpx',left:'19lpx'})  
108 - .backgroundColor('#80000000')  
109 - }  
110 - .width('100%')  
111 - .height('100%')  
112 - }  
113 -  
114 if(this.defaultModel.screenType != '2'){ 114 if(this.defaultModel.screenType != '2'){
115 //底部logo样式 按钮加载在背景展示图上 115 //底部logo样式 按钮加载在背景展示图上
116 Button(){ 116 Button(){
@@ -179,7 +179,7 @@ export struct VideoChannelPage { @@ -179,7 +179,7 @@ export struct VideoChannelPage {
179 channelId: item.channelId + '', 179 channelId: item.channelId + '',
180 autoRefresh: this.autoRefresh 180 autoRefresh: this.autoRefresh
181 }) 181 })
182 - .padding({ top: 40 }) 182 + .padding({ top: 55 })
183 .backgroundColor(Color.White) 183 .backgroundColor(Color.White)
184 } 184 }
185 }, (item: TopNavDTO) => item.channelId + '') 185 }, (item: TopNavDTO) => item.channelId + '')