陈剑华

Merge remote-tracking branch 'origin/main'

@@ -9,7 +9,7 @@ import font from '@ohos.font'; @@ -9,7 +9,7 @@ import font from '@ohos.font';
9 import { ENewspaperPageDialog } from '../dialog/ENewspaperPageDialog'; 9 import { ENewspaperPageDialog } from '../dialog/ENewspaperPageDialog';
10 import { RMCalendarBean } from './calendar/RMCalendarBean'; 10 import { RMCalendarBean } from './calendar/RMCalendarBean';
11 import { newsSkeleton } from './skeleton/newsSkeleton'; 11 import { newsSkeleton } from './skeleton/newsSkeleton';
12 -import { Logger, ToastUtils, NetworkUtil, CustomToast } from 'wdKit/Index'; 12 +import { Logger, ToastUtils, NetworkUtil, CustomToast, DisplayUtils } from 'wdKit/Index';
13 import { TrackingContent, TrackConstants, TrackingButton } from 'wdTracking/Index'; 13 import { TrackingContent, TrackConstants, TrackingButton } from 'wdTracking/Index';
14 import { WDShare } from 'wdShare/Index'; 14 import { WDShare } from 'wdShare/Index';
15 import { window } from '@kit.ArkUI'; 15 import { window } from '@kit.ArkUI';
@@ -25,6 +25,9 @@ export struct ENewspaperPageComponent { @@ -25,6 +25,9 @@ export struct ENewspaperPageComponent {
25 @State picHeight: number = 0 25 @State picHeight: number = 0
26 @Provide itemPicWidth: number = 0 26 @Provide itemPicWidth: number = 0
27 @Provide itemPicHeight: number = 0 27 @Provide itemPicHeight: number = 0
  28 +
  29 + @Provide topMargin: number = DisplayUtils.getDeviceHeight()
  30 +
28 @State newspaperListBean: NewspaperListBean = {} as NewspaperListBean 31 @State newspaperListBean: NewspaperListBean = {} as NewspaperListBean
29 @Provide @Watch('onCurrentPageNumUpdated') currentPageNum: string = '01' 32 @Provide @Watch('onCurrentPageNumUpdated') currentPageNum: string = '01'
30 @State pageDialogShow: boolean = false 33 @State pageDialogShow: boolean = false
@@ -404,6 +407,14 @@ export struct ENewspaperPageComponent { @@ -404,6 +407,14 @@ export struct ENewspaperPageComponent {
404 } 407 }
405 if (this.newspaperListBean.list && this.newspaperListBean.list.length > 0) { 408 if (this.newspaperListBean.list && this.newspaperListBean.list.length > 0) {
406 this.isOpenListDialog = true 409 this.isOpenListDialog = true
  410 + animateTo({
  411 + duration: 300,
  412 + onFinish: () => {
  413 + }
  414 + }, () => {
  415 + this.topMargin = 0;
  416 + })
  417 +
407 //电子报--读报纸点击 418 //电子报--读报纸点击
408 TrackingContent.clickWithEvent('read_newspaper_click', TrackConstants.PageName.NewsPaperPage, 419 TrackingContent.clickWithEvent('read_newspaper_click', TrackConstants.PageName.NewsPaperPage,
409 TrackConstants.PageName.NewsPaperPage 420 TrackConstants.PageName.NewsPaperPage
@@ -429,7 +440,15 @@ export struct ENewspaperPageComponent { @@ -429,7 +440,15 @@ export struct ENewspaperPageComponent {
429 newspaperListBean: this.newspaperListBean, 440 newspaperListBean: this.newspaperListBean,
430 scrollIndex: this.swiperIndex, 441 scrollIndex: this.swiperIndex,
431 closeDialog: () => { 442 closeDialog: () => {
432 - this.isOpenListDialog = false 443 + animateTo({
  444 + duration: 300,
  445 + onFinish: () => {
  446 + this.isOpenListDialog = false
  447 + }
  448 + }, () => {
  449 + this.topMargin = DisplayUtils.getDeviceHeight();
  450 + })
  451 +
433 } 452 }
434 }) 453 })
435 } 454 }
@@ -451,6 +470,7 @@ export struct ENewspaperPageComponent { @@ -451,6 +470,7 @@ export struct ENewspaperPageComponent {
451 // 计算图片的内容宽高 470 // 计算图片的内容宽高
452 this.itemPicWidth = this.picWidth - vp2px(20) 471 this.itemPicWidth = this.picWidth - vp2px(20)
453 this.itemPicHeight = this.picHeight - vp2px(28) 472 this.itemPicHeight = this.picHeight - vp2px(28)
  473 +
454 try { 474 try {
455 if (NetworkUtil.isNetConnected()) { 475 if (NetworkUtil.isNetConnected()) {
456 let listBean = 476 let listBean =
@@ -248,34 +248,36 @@ export struct ImageAndTextPageComponent { @@ -248,34 +248,36 @@ export struct ImageAndTextPageComponent {
248 console.log(TAG, "点击滑动页面", JSON.stringify(info)) 248 console.log(TAG, "点击滑动页面", JSON.stringify(info))
249 249
250 //评论区当前位置 250 //评论区当前位置
251 - let currentCommonentOffSetY = this.info?.globalPosition.y as number  
252 - let offSetY = 0  
253 - if (currentCommonentOffSetY >= (this.screenHeight-this.bottomHeight) ) {  
254 - offSetY = currentCommonentOffSetY-200  
255 - this.showMainText = true  
256 - }else {  
257 - this.showMainText = false  
258 - }  
259 - this.scroller.scrollTo({  
260 - yOffset: offSetY,  
261 - xOffset: 0,  
262 - animation: { duration: 1000, curve: Curve.Ease }  
263 - })  
264 -  
265 - // if (!this.offsetY) {  
266 - // this.offsetY = componentUtils.getRectangleById('comment').windowOffset.y  
267 - // }  
268 - // // 定位到评论区域  
269 - // if (this.isScrollTop) {  
270 - // this.scroller.scrollTo({  
271 - // xOffset: 0,  
272 - // yOffset: this.offsetY,  
273 - // animation: true  
274 - // })  
275 - // } else {  
276 - // this.scroller.scrollEdge(Edge.Top) 251 + // let currentCommonentOffSetY = this.info?.globalPosition.y as number
  252 + // let offSetY = 0
  253 + // if (currentCommonentOffSetY >= (this.screenHeight-this.bottomHeight) ) {
  254 + // offSetY = currentCommonentOffSetY-200
  255 + // this.showMainText = true
  256 + // }else {
  257 + // this.showMainText = false
277 // } 258 // }
278 - // this.isScrollTop = !this.isScrollTop 259 + // this.scroller.scrollTo({
  260 + // yOffset: offSetY,
  261 + // xOffset: 0,
  262 + // animation: { duration: 1000, curve: Curve.Ease }
  263 + // })
  264 +
  265 + if (!this.offsetY) {
  266 + this.offsetY = componentUtils.getRectangleById('comment').windowOffset.y
  267 + }
  268 + // 定位到评论区域
  269 + if (this.isScrollTop) {
  270 + this.scroller.scrollTo({
  271 + xOffset: 0,
  272 + yOffset: this.offsetY,
  273 + animation: { duration: 1000, curve: Curve.Ease }
  274 + })
  275 + // this.showMainText = true
  276 + } else {
  277 + this.scroller.scrollEdge(Edge.Top)
  278 + // this.showMainText = false
  279 + }
  280 + this.isScrollTop = !this.isScrollTop
279 } 281 }
280 }) 282 })
281 } 283 }
@@ -357,7 +359,6 @@ export struct ImageAndTextPageComponent { @@ -357,7 +359,6 @@ export struct ImageAndTextPageComponent {
357 if (this.detailContentEmpty) { 359 if (this.detailContentEmpty) {
358 this.emptyType = 18 360 this.emptyType = 18
359 } 361 }
360 - console.log(TAG, "dl1111111111", JSON.stringify(detailBeans[0]))  
361 if (detailBeans && detailBeans.length > 0) { 362 if (detailBeans && detailBeans.length > 0) {
362 this.contentDetailData = detailBeans[0]; 363 this.contentDetailData = detailBeans[0];
363 let dateTime = 364 let dateTime =
@@ -560,21 +561,22 @@ export struct ImageAndTextPageComponent { @@ -560,21 +561,22 @@ export struct ImageAndTextPageComponent {
560 // 需要评论区位置,调用前 请确保它有值 561 // 需要评论区位置,调用前 请确保它有值
561 return 562 return
562 } 563 }
  564 + let offSetY = this.info?.globalPosition.y as number -60
  565 + Logger.debug(TAG, "即将滚动至yOffset: " + offSetY)
  566 + if (offSetY >= (this.screenHeight-this.bottomHeight) ) {
  567 + this.showMainText = false
  568 + }else {
  569 + this.showMainText = true
  570 + }
  571 +
563 if (this.action.params?.targetLayout && this.action.params.targetLayout == "comment") { 572 if (this.action.params?.targetLayout && this.action.params.targetLayout == "comment") {
564 if (this.lastTimeoutId) { 573 if (this.lastTimeoutId) {
565 clearTimeout(this.lastTimeoutId) 574 clearTimeout(this.lastTimeoutId)
566 } 575 }
567 this.lastTimeoutId = setTimeout(() => { 576 this.lastTimeoutId = setTimeout(() => {
568 - let offSetY = this.info?.globalPosition.y as number  
569 - Logger.debug(TAG, "即将滚动至yOffset: " + (offSetY - 100))  
570 - if (offSetY >= (this.screenHeight-this.bottomHeight) ) {  
571 - this.showMainText = true  
572 - }else {  
573 - this.showMainText = false  
574 - }  
575 //头部距离48 577 //头部距离48
576 this.scroller.scrollTo({ 578 this.scroller.scrollTo({
577 - yOffset: offSetY - 100, 579 + yOffset: offSetY,
578 xOffset: 0, 580 xOffset: 0,
579 animation: { duration: 1000, curve: Curve.Ease } 581 animation: { duration: 1000, curve: Curve.Ease }
580 }) 582 })
@@ -102,6 +102,7 @@ export struct ImageAndTextWebComponent { @@ -102,6 +102,7 @@ export struct ImageAndTextWebComponent {
102 onWebPrepared: this.onWebPrepared.bind(this), 102 onWebPrepared: this.onWebPrepared.bind(this),
103 isPageEnd: $isPageEnd 103 isPageEnd: $isPageEnd
104 }) 104 })
  105 + .padding({top:10})
105 } 106 }
106 } 107 }
107 108
  1 +import { ImageKnifeComponent } from '@ohos/imageknife';
1 import { ContentDTO, FrontLinkObject } from 'wdBean'; 2 import { ContentDTO, FrontLinkObject } from 'wdBean';
2 import { Logger } from 'wdKit/Index'; 3 import { Logger } from 'wdKit/Index';
3 import { ProcessUtils } from 'wdRouter/Index'; 4 import { ProcessUtils } from 'wdRouter/Index';
@@ -28,9 +29,12 @@ export struct topicInfoView { @@ -28,9 +29,12 @@ export struct topicInfoView {
28 build() { 29 build() {
29 RelativeContainer() { 30 RelativeContainer() {
30 Stack(){ 31 Stack(){
31 - Image(this.frontLinkObject?.coverUrl)  
32 - .width("100%")  
33 - .height("100%") 32 + ImageKnifeComponent({imageKnifeOption:{loadSrc:this.frontLinkObject?.coverUrl,isCacheable:true}})
  33 + .width('100%')
  34 + .height('100%')
  35 + // Image(this.frontLinkObject?.coverUrl)
  36 + // .width("100%")
  37 + // .height("100%")
34 Stack(){ 38 Stack(){
35 Image('') 39 Image('')
36 .width("100%") 40 .width("100%")
@@ -233,7 +233,7 @@ export struct HomePageBottomFollowComponent { @@ -233,7 +233,7 @@ export struct HomePageBottomFollowComponent {
233 this.hasMore = false 233 this.hasMore = false
234 } 234 }
235 } 235 }
236 - this.bottomCompH = DisplayUtils.getDeviceHeight() - this.data_follow.totalCount()*100 236 + this.bottomCompH = DisplayUtils.getDeviceHeight() - this.data_follow.totalCount()*101
237 console.log(TAG, `${this.bottomCompH}`); 237 console.log(TAG, `${this.bottomCompH}`);
238 this.isLoading = false 238 this.isLoading = false
239 this.isGetRequest = true 239 this.isGetRequest = true
@@ -7,7 +7,7 @@ @@ -7,7 +7,7 @@
7 export struct newsSkeleton { 7 export struct newsSkeleton {
8 @State quantity: Array<number> = [1, 2, 3,] 8 @State quantity: Array<number> = [1, 2, 3,]
9 @State showBottom: boolean = true 9 @State showBottom: boolean = true
10 - 10 + @Consume itemPicHeight: number
11 build() { 11 build() {
12 Row() { 12 Row() {
13 Column() { 13 Column() {
@@ -17,12 +17,12 @@ export struct newsSkeleton { @@ -17,12 +17,12 @@ export struct newsSkeleton {
17 Column() { 17 Column() {
18 Image($r('app.media.peopleSeleton')) 18 Image($r('app.media.peopleSeleton'))
19 .width('100%') 19 .width('100%')
20 - .height(47)// 后缀名不能省略 20 + .height(this.getCompHeight(47))// 后缀名不能省略
21 .interpolation(ImageInterpolation.High) 21 .interpolation(ImageInterpolation.High)
22 .margin({ 22 .margin({
23 bottom: 6 23 bottom: 6
24 }) 24 })
25 - textArea('100%', 8) 25 + textArea('100%', this.getCompHeight(8),this.getCompHeight(5))
26 } 26 }
27 .margin({ 27 .margin({
28 right: '2%' 28 right: '2%'
@@ -33,20 +33,17 @@ export struct newsSkeleton { @@ -33,20 +33,17 @@ export struct newsSkeleton {
33 Column() { 33 Column() {
34 Row() 34 Row()
35 .width(`100%`) 35 .width(`100%`)
36 - .height(25) 36 + .height(this.getCompHeight(25))
37 .backgroundColor('#FFF5F5F5') 37 .backgroundColor('#FFF5F5F5')
38 Row() 38 Row()
39 .width(`100%`) 39 .width(`100%`)
40 - .height(4) 40 + .height(this.getCompHeight(4))
41 .backgroundColor('#FFF5F5F5') 41 .backgroundColor('#FFF5F5F5')
42 - .margin({ top: 3, bottom: 3 }) 42 + .margin({ top: this.getCompHeight(3), bottom: this.getCompHeight(3) })
43 Row() 43 Row()
44 .width(`100%`) 44 .width(`100%`)
45 - .height(20) 45 + .height(this.getCompHeight(20))
46 .backgroundColor('#FFF5F5F5') 46 .backgroundColor('#FFF5F5F5')
47 - // textArea(27, 25)  
48 - // textArea(27, 4)  
49 - // textArea(27, 20)  
50 } 47 }
51 .width(`22%`) 48 .width(`22%`)
52 .border({ width: 1 }) 49 .border({ width: 1 })
@@ -63,59 +60,59 @@ export struct newsSkeleton { @@ -63,59 +60,59 @@ export struct newsSkeleton {
63 .width('100%') 60 .width('100%')
64 61
65 BoxAndLine().width('100%') 62 BoxAndLine().width('100%')
66 - BoxAndBox({ firstBoxNumber: '65%', boxHeight: 100 }) 63 + BoxAndBox({ firstBoxNumber: '65%', boxHeight: this.getCompHeight(100) })
67 Column() { 64 Column() {
68 - textArea('100%', 79) 65 + textArea('100%', this.getCompHeight(79),this.getCompHeight(5))
69 } 66 }
70 67
71 - BoxAndBox({ firstBoxNumber: '30%', boxHeight: 51 }) 68 + BoxAndBox({ firstBoxNumber: '30%', boxHeight: this.getCompHeight(48) })
72 69
73 } 70 }
74 - .width('50%') 71 + .width('49%')
75 .margin({ right: 5 }) 72 .margin({ right: 5 })
76 73
77 Column() { 74 Column() {
78 Column() { 75 Column() {
79 - textArea('100%', 13) 76 + textArea('100%', this.getCompHeight(13),this.getCompHeight(0))
80 }.width('100%') 77 }.width('100%')
81 78
82 Column() { 79 Column() {
83 - textArea('100%', 136)  
84 - textArea('100%', 13)  
85 - textArea('80%', 13) 80 + textArea('100%', this.getCompHeight(136),this.getCompHeight(5))
  81 + textArea('100%', this.getCompHeight(13),this.getCompHeight(5))
  82 + textArea('80%', this.getCompHeight(13),this.getCompHeight(5))
86 }.width('100%').alignItems(HorizontalAlign.Start) 83 }.width('100%').alignItems(HorizontalAlign.Start)
87 84
88 Column() { 85 Column() {
89 - textArea('100%', 126) 86 + textArea('100%', this.getCompHeight(126),this.getCompHeight(5))
90 } 87 }
91 88
92 Column() { 89 Column() {
93 - textArea('100%', 13) 90 + textArea('100%', this.getCompHeight(13),this.getCompHeight(5))
94 } 91 }
95 92
96 Row() { 93 Row() {
97 Column() { 94 Column() {
98 - textArea('100%', 30) 95 + textArea('100%', this.getCompHeight(30),this.getCompHeight(5))
99 }.width('50%').margin({ right: 5 }) 96 }.width('50%').margin({ right: 5 })
100 97
101 Column() { 98 Column() {
102 - textArea('100%', 30) 99 + textArea('100%', this.getCompHeight(30),this.getCompHeight(5))
103 }.layoutWeight(1) 100 }.layoutWeight(1)
104 }.width('100%').justifyContent(FlexAlign.SpaceBetween) 101 }.width('100%').justifyContent(FlexAlign.SpaceBetween)
105 102
106 Column() { 103 Column() {
107 - textArea('100%', 100) 104 + textArea('100%', this.getCompHeight(100),this.getCompHeight(5))
108 } 105 }
109 } 106 }
110 - .width('50%') 107 + .width('49%')
111 } 108 }
112 .justifyContent(FlexAlign.SpaceBetween) 109 .justifyContent(FlexAlign.SpaceBetween)
113 .backgroundColor(Color.White) 110 .backgroundColor(Color.White)
114 .padding({ 111 .padding({
115 - top: 15,  
116 - bottom: 15,  
117 - right: 15,  
118 - left: 15 112 + top: 14,
  113 + right: 10,
  114 + bottom: 14,
  115 + left: 10
119 }) 116 })
120 if (this.showBottom) { 117 if (this.showBottom) {
121 // Column().backgroundColor('#CBCBCB').height(5).width(339) 118 // Column().backgroundColor('#CBCBCB').height(5).width(339)
@@ -133,17 +130,31 @@ export struct newsSkeleton { @@ -133,17 +130,31 @@ export struct newsSkeleton {
133 .width('100%') 130 .width('100%')
134 131
135 } 132 }
  133 +
  134 + getCompHeight(height: number): number{
  135 + //设计图高度 478
  136 + let compH:number = height*px2vp(this.itemPicHeight)/478
  137 + return compH;
  138 +}
  139 +
136 } 140 }
137 141
138 @Component 142 @Component
139 struct BoxAndLine { 143 struct BoxAndLine {
  144 + @Consume itemPicHeight: number
140 build() { 145 build() {
141 Column() { 146 Column() {
142 - textArea('100%', 130)  
143 - textArea('100%', 13)  
144 - textArea('80%', 13) 147 + textArea('100%', this.getCompHeight(130),this.getCompHeight(5))
  148 + textArea('100%', this.getCompHeight(13),this.getCompHeight(5))
  149 + textArea('80%', this.getCompHeight(13),this.getCompHeight(5))
145 }.alignItems(HorizontalAlign.Start) 150 }.alignItems(HorizontalAlign.Start)
146 } 151 }
  152 +
  153 + getCompHeight(height: number): number{
  154 + //设计图高度 478
  155 + let compH:number = height*px2vp(this.itemPicHeight)/478
  156 + return compH;
  157 + }
147 } 158 }
148 159
149 160
@@ -151,29 +162,37 @@ struct BoxAndLine { @@ -151,29 +162,37 @@ struct BoxAndLine {
151 struct BoxAndBox { 162 struct BoxAndBox {
152 @Prop firstBoxNumber: number | Resource | string 163 @Prop firstBoxNumber: number | Resource | string
153 @Prop boxHeight: number | Resource | string 164 @Prop boxHeight: number | Resource | string
154 - 165 + @Consume itemPicHeight: number
155 build() { 166 build() {
156 Row() { 167 Row() {
157 Column() { 168 Column() {
158 - textArea('100%', this.boxHeight) 169 + textArea('100%', this.boxHeight,this.getCompHeight(5))
159 }.width(this.firstBoxNumber).margin({ right: 5 }) 170 }.width(this.firstBoxNumber).margin({ right: 5 })
160 171
161 Column() { 172 Column() {
162 - textArea('100%', this.boxHeight) 173 + textArea('100%', this.boxHeight,this.getCompHeight(5))
163 }.layoutWeight(1) 174 }.layoutWeight(1)
164 }.width('100%').justifyContent(FlexAlign.SpaceBetween) 175 }.width('100%').justifyContent(FlexAlign.SpaceBetween)
165 } 176 }
  177 +
  178 + getCompHeight(height: number): number{
  179 + //设计图高度 478
  180 + let compH:number = height*px2vp(this.itemPicHeight)/478
  181 + return compH;
  182 + }
166 } 183 }
167 184
168 @Builder 185 @Builder
169 -function textArea(width: number | Resource | string = '100%', height: number | Resource | string = '100%') { 186 +function textArea(width: number | Resource | string = '100%', height: number | Resource | string = '100%',topM:number) {
170 Row() 187 Row()
171 .width(width) 188 .width(width)
172 .height(height) 189 .height(height)
173 - .backgroundColor('#FFF5F5F5')  
174 - .margin({ top: 5 }) 190 + .backgroundColor(height === 13?Color.Red:'#FFF5F5F5')
  191 + .margin({ top: topM })
175 // .borderRadius(5) 192 // .borderRadius(5)
176 } 193 }
177 194
178 195
179 196
  197 +
  198 +
@@ -21,6 +21,7 @@ export struct ENewspaperListDialog { @@ -21,6 +21,7 @@ export struct ENewspaperListDialog {
21 @State scrollOffset: number = 0 21 @State scrollOffset: number = 0
22 @State isCurrentViewOpen: boolean = false 22 @State isCurrentViewOpen: boolean = false
23 @Consume bottomSafeHeight: number 23 @Consume bottomSafeHeight: number
  24 + @Consume topMargin:number
24 //文字版选择弹框 25 //文字版选择弹框
25 pageListDialogController: CustomDialogController = new CustomDialogController({ 26 pageListDialogController: CustomDialogController = new CustomDialogController({
26 builder: ENewspaperPageDialog({ 27 builder: ENewspaperPageDialog({
@@ -292,7 +293,7 @@ export struct ENewspaperListDialog { @@ -292,7 +293,7 @@ export struct ENewspaperListDialog {
292 left: 15, 293 left: 15,
293 right: 15, 294 right: 15,
294 // top: 16, 295 // top: 16,
295 - // bottom: 16 296 + bottom: 25
296 }) 297 })
297 .margin({ 298 .margin({
298 bottom: 85 299 bottom: 85
@@ -317,15 +318,13 @@ export struct ENewspaperListDialog { @@ -317,15 +318,13 @@ export struct ENewspaperListDialog {
317 318
318 }) 319 })
319 } 320 }
320 - .margin({ top: this.topHeight }) 321 + .margin({ top: this.topHeight + this.topMargin})
321 .width('100%') 322 .width('100%')
322 .backgroundColor(Color.White) 323 .backgroundColor(Color.White)
323 -  
324 } 324 }
325 .width('100%') 325 .width('100%')
326 .height('100%') 326 .height('100%')
327 .backgroundColor('#80000000') 327 .backgroundColor('#80000000')
328 - .margin({ bottom: 50 })  
329 .onClick(() => { 328 .onClick(() => {
330 if (this.closeDialog) { 329 if (this.closeDialog) {
331 this.closeDialog() 330 this.closeDialog()
  1 +import { AuthorListDTO, FullColumnImgUrlDTO, ReLInfoDTO, RmhInfoDTO, ShareInfoDTO,
  2 + UserInfoDTO,
  3 + VideoInfoDTO } from 'wdBean';
  4 +
  5 +@Observed
  6 +export class ContentDetailModel{
  7 + newsId: number = 0;
  8 + newsTitle: string = "";
  9 + newsShortTitle: string= "";
  10 + newsDownTitle: string= "";
  11 + newsBodyTitle: string= "";
  12 + publishTime: string= "";
  13 + appstyle: number= 0;
  14 + newsType: number= 0;
  15 + newsSummary: string= "";
  16 + newsSource: string= "";
  17 + newsSourceName: string= "";
  18 + newsContent: string= "";
  19 + newsContentBak: string= "";
  20 + newsLinkUrl: string="";
  21 + bestNoticer: number= 0;
  22 + // newLinkObject?: any = null;
  23 + newIntroduction: string= "";
  24 + authorList: AuthorListDTO[]=[];
  25 + editorName: string="";
  26 + openAudio: number= 0;
  27 + // audioList: any[];
  28 + // hasPopUp?: any;
  29 + // popUps?: any[];
  30 + firstFrameImageUri: string= "";
  31 + reLInfo?: ReLInfoDTO | null = null;
  32 + fullColumnImgUrls: FullColumnImgUrlDTO[]=[];
  33 + shareInfo?: ShareInfoDTO | null = null;
  34 + // photoList: any[];
  35 + videoInfo: VideoInfoDTO[]=[];
  36 + // liveInfo?: any ;
  37 + // voteInfo?: any;
  38 + rmhInfo?: RmhInfoDTO | null = null;
  39 + userInfo?: UserInfoDTO | null = null;
  40 + openLikes: number= 0;
  41 + openComment: number= 0;
  42 + likesStyle: number= 0;
  43 + preCommentFlag: number= 0;
  44 + commentDisplay: number= 0;
  45 + keyArticle: number= 0;
  46 + rmhPlatform: number= 0;
  47 + readFlag?: number= 0;
  48 + // topicInfo?: any;
  49 + traceId: string= "";
  50 + itemId: string= "";
  51 + sceneId: string= "";
  52 + subSceneId: string= "";
  53 + // activityInfos: any[]=[];
  54 + recommendShow: number= 0;
  55 + visitorComment: number= 0;
  56 + itemTypeCode: string= "";
  57 + menuShow: number= 0;
  58 + newsTags: string= "";
  59 + // specialColumnId?: any;
  60 + specialColumnName: string= "";
  61 + // timeline?: any;
  62 +
  63 + constructor(newsId: number, newsTitle: string, newsShortTitle: string, newsDownTitle: string, newsBodyTitle: string,
  64 + publishTime: string, appstyle: number, newsType: number, newsSummary: string, newsSource: string,
  65 + newsSourceName: string, newsContent: string, newsContentBak: string, newsLinkUrl: string, bestNoticer: number,
  66 + newIntroduction: string, authorList: AuthorListDTO[], editorName: string, openAudio: number,
  67 + firstFrameImageUri: string,fullColumnImgUrls: FullColumnImgUrlDTO[], videoInfo: VideoInfoDTO[],
  68 + openLikes: number, openComment: number, likesStyle: number, preCommentFlag: number,
  69 + commentDisplay: number, keyArticle: number, rmhPlatform: number, readFlag: number, traceId: string,
  70 + itemId: string, sceneId: string, subSceneId: string, recommendShow: number,
  71 + visitorComment: number, itemTypeCode: string, menuShow: number, newsTags: string,
  72 + specialColumnName: string, traceInfo: string, viewCount: number, isNewspaper: boolean, oldNewsId: string,
  73 + showTime: boolean, isLogin: string) {
  74 + this.newsId = newsId;
  75 + this.newsTitle = newsTitle;
  76 + this.newsShortTitle = newsShortTitle;
  77 + this.newsDownTitle = newsDownTitle;
  78 + this.newsBodyTitle = newsBodyTitle;
  79 + this.publishTime = publishTime;
  80 + this.appstyle = appstyle;
  81 + this.newsType = newsType;
  82 + this.newsSummary = newsSummary;
  83 + this.newsSource = newsSource;
  84 + this.newsSourceName = newsSourceName;
  85 + this.newsContent = newsContent;
  86 + this.newsContentBak = newsContentBak;
  87 + this.newsLinkUrl = newsLinkUrl;
  88 + this.bestNoticer = bestNoticer;
  89 + this.newIntroduction = newIntroduction;
  90 + this.authorList = authorList;
  91 + this.editorName = editorName;
  92 + this.openAudio = openAudio;
  93 + this.firstFrameImageUri = firstFrameImageUri;
  94 + this.fullColumnImgUrls = fullColumnImgUrls;
  95 + this.videoInfo = videoInfo;
  96 + this.openLikes = openLikes;
  97 + this.openComment = openComment;
  98 + this.likesStyle = likesStyle;
  99 + this.preCommentFlag = preCommentFlag;
  100 + this.commentDisplay = commentDisplay;
  101 + this.keyArticle = keyArticle;
  102 + this.rmhPlatform = rmhPlatform;
  103 + this.readFlag = readFlag;
  104 + this.traceId = traceId;
  105 + this.itemId = itemId;
  106 + this.sceneId = sceneId;
  107 + this.subSceneId = subSceneId;
  108 + this.recommendShow = recommendShow;
  109 + this.visitorComment = visitorComment;
  110 + this.itemTypeCode = itemTypeCode;
  111 + this.menuShow = menuShow;
  112 + this.newsTags = newsTags;
  113 + this.specialColumnName = specialColumnName;
  114 + this.traceInfo = traceInfo;
  115 + this.viewCount = viewCount;
  116 + this.isNewspaper = isNewspaper;
  117 + this.oldNewsId = oldNewsId;
  118 + this.showTime = showTime;
  119 + this.isLogin = isLogin;
  120 + }
  121 + traceInfo: string= "";
  122 + viewCount: number= 0;
  123 + isNewspaper: boolean = false;
  124 + oldNewsId: string= "";
  125 +
  126 +
  127 + // 本地字段
  128 + showTime:boolean = false;
  129 + isLogin?:string = ""
  130 +}
@@ -9,7 +9,7 @@ import { @@ -9,7 +9,7 @@ import {
9 contentListParams, 9 contentListParams,
10 getRecCompInfoParams 10 getRecCompInfoParams
11 } from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest'; 11 } from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest';
12 -import { NetworkUtil, Logger, WindowModel, DateTimeUtils } from 'wdKit/Index'; 12 +import { NetworkUtil, Logger, WindowModel, DateTimeUtils, LazyDataSource } from 'wdKit/Index';
13 import { PictureLoading } from './PictureLoading'; 13 import { PictureLoading } from './PictureLoading';
14 import { DisplayDirection } from 'wdConstant/Index'; 14 import { DisplayDirection } from 'wdConstant/Index';
15 import { window } from '@kit.ArkUI'; 15 import { window } from '@kit.ArkUI';
@@ -57,6 +57,7 @@ export struct VideoChannelDetail { @@ -57,6 +57,7 @@ export struct VideoChannelDetail {
57 @Consume displayDirection: DisplayDirection 57 @Consume displayDirection: DisplayDirection
58 @Provide showCommentList: boolean = false 58 @Provide showCommentList: boolean = false
59 @State data: ContentDetailDTO[] = [] 59 @State data: ContentDetailDTO[] = []
  60 + @State dataContentDetail: LazyDataSource<ContentDetailDTO> = new LazyDataSource();
60 @State currentIndex: number = 0 61 @State currentIndex: number = 0
61 @State interactDataList: InteractDataDTO[] = [] 62 @State interactDataList: InteractDataDTO[] = []
62 @State totalCount: number = 0 63 @State totalCount: number = 0
@@ -256,6 +257,7 @@ export struct VideoChannelDetail { @@ -256,6 +257,7 @@ export struct VideoChannelDetail {
256 if (res.data) { 257 if (res.data) {
257 await this.getContentInteract(list2) 258 await this.getContentInteract(list2)
258 this.data = this.data.concat(res.data) 259 this.data = this.data.concat(res.data)
  260 + this.dataContentDetail.addItems(res.data)
259 } 261 }
260 console.log('根据视频楼层信息批量查询视频列表', JSON.stringify(res.data)) 262 console.log('根据视频楼层信息批量查询视频列表', JSON.stringify(res.data))
261 }).finally(() => { 263 }).finally(() => {
@@ -304,7 +306,8 @@ export struct VideoChannelDetail { @@ -304,7 +306,8 @@ export struct VideoChannelDetail {
304 .visibility(this.isMouted ? Visibility.None : Visibility.Visible) 306 .visibility(this.isMouted ? Visibility.None : Visibility.Visible)
305 307
306 Swiper(this.swiperController) { 308 Swiper(this.swiperController) {
307 - ForEach(this.data, (item: ContentDetailDTO, index: number) => { 309 + // LazyForEach(this.data, (item: ContentDetailDTO, index: number) => {
  310 + LazyForEach(this.dataContentDetail, (item: ContentDetailDTO, index: number) => {
308 DetailPlayShortVideoPage({ 311 DetailPlayShortVideoPage({
309 contentDetailData: item, 312 contentDetailData: item,
310 currentIndex: this.currentIndex, 313 currentIndex: this.currentIndex,
@@ -314,6 +317,7 @@ export struct VideoChannelDetail { @@ -314,6 +317,7 @@ export struct VideoChannelDetail {
314 }, (item: ContentDetailDTO) => item.newsId + '') 317 }, (item: ContentDetailDTO) => item.newsId + '')
315 } 318 }
316 .displayCount(1, true) 319 .displayCount(1, true)
  320 + .cachedCount(3)
317 .disableSwipe(this.displayDirection === DisplayDirection.VERTICAL || this.showCommentList ? false : true) 321 .disableSwipe(this.displayDirection === DisplayDirection.VERTICAL || this.showCommentList ? false : true)
318 .visibility(this.isMouted ? Visibility.Visible : Visibility.Hidden) 322 .visibility(this.isMouted ? Visibility.Visible : Visibility.Hidden)
319 .indicator(false) 323 .indicator(false)
@@ -35,5 +35,6 @@ export enum Events { @@ -35,5 +35,6 @@ export enum Events {
35 STATE_CHANGE = 'stateChange', 35 STATE_CHANGE = 'stateChange',
36 VIDEO_SIZE_CHANGE = "videoSizeChange", 36 VIDEO_SIZE_CHANGE = "videoSizeChange",
37 TIME_UPDATE = 'timeUpdate', 37 TIME_UPDATE = 'timeUpdate',
38 - ERROR = 'error' 38 + ERROR = 'error',
  39 + AUDIOINTERRUPT = 'audioInterrupt'
39 } 40 }
@@ -85,6 +85,7 @@ export class WDPlayerController { @@ -85,6 +85,7 @@ export class WDPlayerController {
85 */ 85 */
86 private bindState() { 86 private bindState() {
87 this.avPlayer?.on(Events.STATE_CHANGE, async (state) => { 87 this.avPlayer?.on(Events.STATE_CHANGE, async (state) => {
  88 + //console.info(TAG,`cj2024 state = ${state}`)
88 if (this.avPlayer == null) { 89 if (this.avPlayer == null) {
89 return 90 return
90 } 91 }
@@ -179,6 +180,49 @@ export class WDPlayerController { @@ -179,6 +180,49 @@ export class WDPlayerController {
179 this.videoWidth = width 180 this.videoWidth = width
180 this.videoHeight = height 181 this.videoHeight = height
181 }) 182 })
  183 + this.avPlayer?.on(Events.AUDIOINTERRUPT, async(interruptEvent: audio.InterruptEvent) => {
  184 + //https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/media/audio/audio-playback-concurrency.md#%E5%A4%84%E7%90%86%E9%9F%B3%E9%A2%91%E7%84%A6%E7%82%B9%E4%BA%8B%E4%BB%B6
  185 + if (interruptEvent.forceType === audio.InterruptForceType.INTERRUPT_FORCE) {
  186 + switch (interruptEvent.hintType) {
  187 + case audio.InterruptHint.INTERRUPT_HINT_RESUME:
  188 + await this.play()
  189 + break;
  190 + case audio.InterruptHint.INTERRUPT_HINT_PAUSE:
  191 + // 此分支表示系统已将音频流暂停(临时失去焦点),为保持状态一致,应用需切换至音频暂停状态
  192 + // 临时失去焦点:待其他音频流释放音频焦点后,本音频流会收到resume对应的音频打断事件,到时可自行继续播放
  193 + case audio.InterruptHint.INTERRUPT_HINT_STOP:
  194 + // 此分支表示系统已将音频流停止(永久失去焦点),为保持状态一致,应用需切换至音频暂停状态
  195 + // 永久失去焦点:后续不会再收到任何音频打断事件,若想恢复播放,需要用户主动触发。
  196 + // this.avPlayer?.play()
  197 + await this.pause()
  198 + break;
  199 + }
  200 + }else if (interruptEvent.forceType === audio.InterruptForceType.INTERRUPT_SHARE) {
  201 + // 共享打断类型(INTERRUPT_SHARE):应用可自主选择执行相关操作或忽略音频打断事件
  202 + switch (interruptEvent.hintType) {
  203 + case audio.InterruptHint.INTERRUPT_HINT_PAUSE:
  204 + case audio.InterruptHint.INTERRUPT_HINT_RESUME:
  205 + // 此分支表示临时失去焦点后被暂停的音频流此时可以继续播放,建议应用继续播放,切换至音频播放状态
  206 + // 若应用此时不想继续播放,可以忽略此音频打断事件,不进行处理即可
  207 + // 继续播放,此处主动执行start(),以标识符变量started记录start()的执行结果
  208 + // await audioRenderer.start().then(() => {
  209 + // started = true; // start()执行成功
  210 + // }).catch((err: BusinessError) => {
  211 + // started = false; // start()执行失败
  212 + // });
  213 + // // 若start()执行成功,则切换至音频播放状态
  214 + // if (started) {
  215 + // isPlay = true; // 此句为简化处理,代表应用切换至音频播放状态的若干操作
  216 + // } else {
  217 + // // 音频继续播放执行失败
  218 + // }
  219 + this.avPlayer?.play()
  220 + break;
  221 + default:
  222 + break;
  223 + }
  224 + }
  225 + })
182 } 226 }
183 227
184 public setXComponentController(controller: XComponentController) { 228 public setXComponentController(controller: XComponentController) {
@@ -271,10 +315,12 @@ export class WDPlayerController { @@ -271,10 +315,12 @@ export class WDPlayerController {
271 // if (this.avPlayer == null) { 315 // if (this.avPlayer == null) {
272 // return 316 // return
273 // } 317 // }
  318 + //Logger.debug(TAG, "start play")
274 this.avPlayer?.prepare().then(() => { 319 this.avPlayer?.prepare().then(() => {
275 this.avPlayer?.play() 320 this.avPlayer?.play()
276 }, (err: BusinessError) => { 321 }, (err: BusinessError) => {
277 - console.error('Failed to prepare,error message is :' + err.message) 322 + console.error(TAG,'Failed to prepare,error message is :' + err.message)
  323 + //this.avPlayer?.stop()
278 }) 324 })
279 } 325 }
280 326
@@ -20,7 +20,7 @@ struct MorningEveningPaperPage { @@ -20,7 +20,7 @@ struct MorningEveningPaperPage {
20 20
21 pageTransition() { 21 pageTransition() {
22 // 定义页面进入时的效果,从底侧滑入 22 // 定义页面进入时的效果,从底侧滑入
23 - PageTransitionEnter({ type: RouteType.Push, duration: 200 }) 23 + PageTransitionEnter({ type: RouteType.Push, duration: 300 })
24 .slide(SlideEffect.Bottom).onEnter((type: RouteType, progress: number) => { 24 .slide(SlideEffect.Bottom).onEnter((type: RouteType, progress: number) => {
25 if (progress >= 0.99) { 25 if (progress >= 0.99) {
26 // WindowModel.shared.setWindowLayoutFullScreen(true) 26 // WindowModel.shared.setWindowLayoutFullScreen(true)
@@ -207,7 +207,11 @@ export struct VideoChannelPage { @@ -207,7 +207,11 @@ export struct VideoChannelPage {
207 top: px2vp(this.topSafeHeight) 207 top: px2vp(this.topSafeHeight)
208 }) 208 })
209 .visibility(this.displayDirection === DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None) 209 .visibility(this.displayDirection === DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None)
210 - 210 + .linearGradient({
  211 + colors: [
  212 + ['rgba(18, 18, 18, 0.5)', 0.0], ['rgba(18, 18, 18, 0.0)', 1.0]
  213 + ]
  214 + })
211 } 215 }
212 216
213 /** 217 /**