王士厅
1 import { CompStyle } from 'wdConstant'; 1 import { CompStyle } from 'wdConstant';
2 import { CompDTO, ContentDTO } from 'wdBean'; 2 import { CompDTO, ContentDTO } from 'wdBean';
3 import { Card2Component } from './cardview/Card2Component'; 3 import { Card2Component } from './cardview/Card2Component';
4 -// import { Card3Component } from './cardview/Card3Component'; 4 +import { Card3Component } from './cardview/Card3Component';
5 import { Card4Component } from './cardview/Card4Component'; 5 import { Card4Component } from './cardview/Card4Component';
6 import { Card5Component } from './cardview/Card5Component'; 6 import { Card5Component } from './cardview/Card5Component';
7 import { Card6Component } from './cardview/Card6Component'; 7 import { Card6Component } from './cardview/Card6Component';
@@ -60,11 +60,13 @@ export struct CardParser { @@ -60,11 +60,13 @@ export struct CardParser {
60 } else { 60 } else {
61 if (contentDTO.appStyle === CompStyle.Card_02) { 61 if (contentDTO.appStyle === CompStyle.Card_02) {
62 Card2Component({ compDTO: this.compDTO, contentDTO, pageId: this.pageId, pageName: this.pageName }) 62 Card2Component({ compDTO: this.compDTO, contentDTO, pageId: this.pageId, pageName: this.pageName })
63 - } else if (contentDTO.appStyle === CompStyle.Card_04) { 63 + } else if (contentDTO.appStyle === CompStyle.Card_03) {
  64 + Card3Component({ compDTO: this.compDTO, contentDTO, pageId: this.pageId, pageName: this.pageName })
  65 + }else if (contentDTO.appStyle === CompStyle.Card_04) {
64 Card4Component({ compDTO: this.compDTO, contentDTO, pageId: this.pageId, pageName: this.pageName }) 66 Card4Component({ compDTO: this.compDTO, contentDTO, pageId: this.pageId, pageName: this.pageName })
65 - } else if (contentDTO.appStyle === CompStyle.Card_05) { 67 + } else if (contentDTO.appStyle === CompStyle.Card_05) {
66 Card5Component({ compDTO: this.compDTO, contentDTO, titleShowPolicy: this.compDTO.titleShowPolicy, pageId: this.pageId, pageName: this.pageName}) 68 Card5Component({ compDTO: this.compDTO, contentDTO, titleShowPolicy: this.compDTO.titleShowPolicy, pageId: this.pageId, pageName: this.pageName})
67 - } else if (contentDTO.appStyle === CompStyle.Card_06 ) { 69 + } else if (contentDTO.appStyle === CompStyle.Card_06 || contentDTO.appStyle === CompStyle.Card_13 ) {
68 Card6Component({ compDTO: this.compDTO, contentDTO: this.contentDTO, pageId: this.pageId, pageName: this.pageName }) 70 Card6Component({ compDTO: this.compDTO, contentDTO: this.contentDTO, pageId: this.pageId, pageName: this.pageName })
69 } else if (contentDTO.appStyle === CompStyle.Card_10) { 71 } else if (contentDTO.appStyle === CompStyle.Card_10) {
70 Card10Component({ compDTO: this.compDTO, contentDTO, pageId: this.pageId, pageName: this.pageName }) 72 Card10Component({ compDTO: this.compDTO, contentDTO, pageId: this.pageId, pageName: this.pageName })
@@ -442,7 +442,7 @@ export struct DynamicDetailComponent { @@ -442,7 +442,7 @@ export struct DynamicDetailComponent {
442 this.contentDetailData.fullColumnImgUrls.length > 0 && 442 this.contentDetailData.fullColumnImgUrls.length > 0 &&
443 !StringUtils.isEmpty(this.contentDetailData.fullColumnImgUrls[0].url) ? 443 !StringUtils.isEmpty(this.contentDetailData.fullColumnImgUrls[0].url) ?
444 this.contentDetailData.fullColumnImgUrls[0].url : 444 this.contentDetailData.fullColumnImgUrls[0].url :
445 - this.contentDetailData.videoInfo[0].firstFrameImageUri) 445 + this.contentDetailData.firstFrameImageUri)
446 .width(DisplayUtils.getDeviceWidth() - 32) 446 .width(DisplayUtils.getDeviceWidth() - 32)
447 .height((DisplayUtils.getDeviceWidth() - 32) * 9 / 16) 447 .height((DisplayUtils.getDeviceWidth() - 32) * 9 / 16)
448 .borderRadius($r('app.float.image_border_radius')) 448 .borderRadius($r('app.float.image_border_radius'))
@@ -460,7 +460,7 @@ export struct DynamicDetailComponent { @@ -460,7 +460,7 @@ export struct DynamicDetailComponent {
460 this.contentDetailData.fullColumnImgUrls.length > 0 && 460 this.contentDetailData.fullColumnImgUrls.length > 0 &&
461 !StringUtils.isEmpty(this.contentDetailData.fullColumnImgUrls[0].url) ? 461 !StringUtils.isEmpty(this.contentDetailData.fullColumnImgUrls[0].url) ?
462 this.contentDetailData.fullColumnImgUrls[0].url : 462 this.contentDetailData.fullColumnImgUrls[0].url :
463 - this.contentDetailData.videoInfo[0].firstFrameImageUri) 463 + this.contentDetailData.firstFrameImageUri)
464 .width(DisplayUtils.getDeviceWidth() / 2) 464 .width(DisplayUtils.getDeviceWidth() / 2)
465 .height(DisplayUtils.getDeviceWidth() / 2 * 4 / 3) 465 .height(DisplayUtils.getDeviceWidth() / 2 * 4 / 3)
466 .borderRadius($r('app.float.image_border_radius')) 466 .borderRadius($r('app.float.image_border_radius'))
@@ -10,10 +10,10 @@ import { ENewspaperPageDialog } from '../dialog/ENewspaperPageDialog'; @@ -10,10 +10,10 @@ 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 } 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';
16 -import { WindowModel } from 'wdKit'; 16 +import { WindowModel } from 'wdKit';
17 17
18 //电子报UI 18 //电子报UI
19 @Component 19 @Component
@@ -34,27 +34,27 @@ export struct ENewspaperPageComponent { @@ -34,27 +34,27 @@ export struct ENewspaperPageComponent {
34 @State selectDate: Date = new Date() 34 @State selectDate: Date = new Date()
35 @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 35 @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
36 @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 36 @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
37 - @State ratio: string = '100%'  
38 -  
39 - @State toastText:ResourceStr = "" 37 + @State ratio: string = '100%'
  38 + @State toastText: ResourceStr = ""
40 dialogToast: CustomDialogController = new CustomDialogController({ 39 dialogToast: CustomDialogController = new CustomDialogController({
41 builder: CustomToast({ 40 builder: CustomToast({
42 - bgColor:$r("app.color.color_B3000000"),  
43 - opacityValue:1,  
44 - fontSizeValue:"25lpx",  
45 - lineHeightValue:"36lpx", 41 + bgColor: $r("app.color.color_B3000000"),
  42 + opacityValue: 1,
  43 + fontSizeValue: "25lpx",
  44 + lineHeightValue: "36lpx",
46 msg: this.toastText, 45 msg: this.toastText,
47 }), 46 }),
48 autoCancel: false, 47 autoCancel: false,
49 alignment: DialogAlignment.Center, 48 alignment: DialogAlignment.Center,
50 customStyle: true, 49 customStyle: true,
51 - maskColor:"#00000000" 50 + maskColor: "#00000000"
52 }) 51 })
53 52
54 - showToastTip(msg:ResourceStr){ 53 + showToastTip(msg: ResourceStr) {
55 this.toastText = msg 54 this.toastText = msg
56 this.dialogToast.open() 55 this.dialogToast.open()
57 } 56 }
  57 +
58 //watch监听报纸页码回调 58 //watch监听报纸页码回调
59 onCurrentPageNumUpdated(): void { 59 onCurrentPageNumUpdated(): void {
60 console.log("ENewspaperPageComponent-onCurrentPageNumUpdated", "currentPageNum:", this.currentPageNum) 60 console.log("ENewspaperPageComponent-onCurrentPageNumUpdated", "currentPageNum:", this.currentPageNum)
@@ -63,12 +63,13 @@ export struct ENewspaperPageComponent { @@ -63,12 +63,13 @@ export struct ENewspaperPageComponent {
63 this.swiperIndex = _swiperIndex > 0 ? _swiperIndex - 1 : _swiperIndex 63 this.swiperIndex = _swiperIndex > 0 ? _swiperIndex - 1 : _swiperIndex
64 64
65 //电子报--版面序号选择点击 65 //电子报--版面序号选择点击
66 - TrackingContent.clickWithEvent('panel_number_selection_click',TrackConstants.PageName.NewsPaperPage,TrackConstants.PageName.NewsPaperPage  
67 - ,{  
68 - 'panelNumber':this.newspaperListBean?.list[this.swiperIndex].pageNum,  
69 - 'panelName':this.newspaperListBean?.list[this.swiperIndex].pageName,  
70 - 'currentPanelDate':this.selectDate.toDateString(),  
71 - 'currentNumber':this.swiperIndex, 66 + TrackingContent.clickWithEvent('panel_number_selection_click', TrackConstants.PageName.NewsPaperPage,
  67 + TrackConstants.PageName.NewsPaperPage
  68 + , {
  69 + 'panelNumber': this.newspaperListBean?.list[this.swiperIndex].pageNum,
  70 + 'panelName': this.newspaperListBean?.list[this.swiperIndex].pageName,
  71 + 'currentPanelDate': this.selectDate.toDateString(),
  72 + 'currentNumber': this.swiperIndex,
72 }) 73 })
73 } 74 }
74 75
@@ -88,12 +89,13 @@ export struct ENewspaperPageComponent { @@ -88,12 +89,13 @@ export struct ENewspaperPageComponent {
88 new Date(date.fullYear ? date.fullYear : 0, date.month ? date.month : 0, date.date ? date.date : 0) 89 new Date(date.fullYear ? date.fullYear : 0, date.month ? date.month : 0, date.date ? date.date : 0)
89 } 90 }
90 //日历选择点击 91 //日历选择点击
91 - TrackingContent.clickWithEvent('date_selection_click',TrackConstants.PageName.NewsPaperPage,TrackConstants.PageName.NewsPaperPage  
92 - ,{  
93 - 'panelNumber':this.newspaperListBean?.list[this.swiperIndex].pageNum,  
94 - 'panelName':this.newspaperListBean?.list[this.swiperIndex].pageName,  
95 - 'currentPanelDate':this.selectDate.toDateString(),  
96 - 'currentNumber':this.swiperIndex, 92 + TrackingContent.clickWithEvent('date_selection_click', TrackConstants.PageName.NewsPaperPage,
  93 + TrackConstants.PageName.NewsPaperPage
  94 + , {
  95 + 'panelNumber': this.newspaperListBean?.list[this.swiperIndex].pageNum,
  96 + 'panelName': this.newspaperListBean?.list[this.swiperIndex].pageName,
  97 + 'currentPanelDate': this.selectDate.toDateString(),
  98 + 'currentNumber': this.swiperIndex,
97 }) 99 })
98 } 100 }
99 }), 101 }),
@@ -134,7 +136,7 @@ export struct ENewspaperPageComponent { @@ -134,7 +136,7 @@ export struct ENewspaperPageComponent {
134 this.picWidth = this.screenWidth - vp2px(52) 136 this.picWidth = this.screenWidth - vp2px(52)
135 let screenHeight = this.displayTool.height; 137 let screenHeight = this.displayTool.height;
136 // bottomSafeHeight 底导高度 topSafeHeight 顶导高度 44 顶部高度 60 底部高度 138 // bottomSafeHeight 底导高度 topSafeHeight 顶导高度 44 顶部高度 60 底部高度
137 - let height = screenHeight -this.bottomSafeHeight - this.topSafeHeight - vp2px(44) - vp2px(60) 139 + let height = screenHeight - this.bottomSafeHeight - this.topSafeHeight - vp2px(44) - vp2px(60)
138 this.picHeight = height 140 this.picHeight = height
139 // 默认日期 141 // 默认日期
140 const date = new Date() 142 const date = new Date()
@@ -205,14 +207,15 @@ export struct ENewspaperPageComponent { @@ -205,14 +207,15 @@ export struct ENewspaperPageComponent {
205 }) 207 })
206 .id('e_newspaper_date') 208 .id('e_newspaper_date')
207 .onClick(() => { 209 .onClick(() => {
208 - this.calendarDialogShow = !this.calendarDialogShow  
209 - if (this.calendarDialogShow) { 210 + this.calendarDialogShow = !this.calendarDialogShow
  211 + if (this.calendarDialogShow) {
210 212
211 - this.calendarDialogController.open()  
212 - } else {  
213 - this.calendarDialogController.close()  
214 - } 213 + this.calendarDialogController.open()
  214 + } else {
  215 + this.calendarDialogController.close()
  216 + }
215 }) 217 })
  218 +
216 if (this.newspaperListBean && this.newspaperListBean.list && this.newspaperListBean.list.length > 0) { 219 if (this.newspaperListBean && this.newspaperListBean.list && this.newspaperListBean.list.length > 0) {
217 Image($r('app.media.icon_share')) 220 Image($r('app.media.icon_share'))
218 .height($r('app.float.top_arrow_size')) 221 .height($r('app.float.top_arrow_size'))
@@ -227,7 +230,7 @@ export struct ENewspaperPageComponent { @@ -227,7 +230,7 @@ export struct ENewspaperPageComponent {
227 }) 230 })
228 } 231 }
229 } 232 }
230 - .margin({ left: $r('app.float.margin_16'), right: $r('app.float.margin_16') }) 233 + .margin({ left: $r('app.float.margin_16'), right: $r('app.float.margin_16'), top: this.topSafeHeight + 'px' })
231 .height($r('app.float.top_bar_height')) 234 .height($r('app.float.top_bar_height'))
232 .alignRules({ 235 .alignRules({
233 top: { anchor: '__container__', align: VerticalAlign.Top }, 236 top: { anchor: '__container__', align: VerticalAlign.Top },
@@ -251,7 +254,7 @@ export struct ENewspaperPageComponent { @@ -251,7 +254,7 @@ export struct ENewspaperPageComponent {
251 if (this.newspaperListBean && this.newspaperListBean.list && this.newspaperListBean.list.length > 0) { 254 if (this.newspaperListBean && this.newspaperListBean.list && this.newspaperListBean.list.length > 0) {
252 Swiper(this.swiperController) { 255 Swiper(this.swiperController) {
253 ForEach(this.newspaperListBean?.list, (item: NewspaperListItemBean, index: number) => { 256 ForEach(this.newspaperListBean?.list, (item: NewspaperListItemBean, index: number) => {
254 - ENewspaperItemComponent({ newspaperListItemBean: item}) 257 + ENewspaperItemComponent({ newspaperListItemBean: item })
255 }) 258 })
256 } 259 }
257 .itemSpace(10) 260 .itemSpace(10)
@@ -310,10 +313,11 @@ export struct ENewspaperPageComponent { @@ -310,10 +313,11 @@ export struct ENewspaperPageComponent {
310 .onClick((event: ClickEvent) => { 313 .onClick((event: ClickEvent) => {
311 this.swiperController.showNext() 314 this.swiperController.showNext()
312 // 电子报--滑动查看下一版 315 // 电子报--滑动查看下一版
313 - TrackingButton.click('panelPageViewNextPanel',TrackConstants.PageName.NewsPaperPage,TrackConstants.PageName.NewsPaperPage  
314 - ,{  
315 - 'panelNumber':this.newspaperListBean?.list[this.swiperIndex].pageNum,  
316 - 'panelName':this.newspaperListBean?.list[this.swiperIndex].pageName, 316 + TrackingButton.click('panelPageViewNextPanel', TrackConstants.PageName.NewsPaperPage,
  317 + TrackConstants.PageName.NewsPaperPage
  318 + , {
  319 + 'panelNumber': this.newspaperListBean?.list[this.swiperIndex].pageNum,
  320 + 'panelName': this.newspaperListBean?.list[this.swiperIndex].pageName,
317 }) 321 })
318 }) 322 })
319 } 323 }
@@ -341,7 +345,7 @@ export struct ENewspaperPageComponent { @@ -341,7 +345,7 @@ export struct ENewspaperPageComponent {
341 }) 345 })
342 .id('e_newspaper_page_num') 346 .id('e_newspaper_page_num')
343 .onClick((event: ClickEvent) => { 347 .onClick((event: ClickEvent) => {
344 - if(!NetworkUtil.isNetConnected()){ 348 + if (!NetworkUtil.isNetConnected()) {
345 this.showToastTip('网络出小差了,请检查网络后重试') 349 this.showToastTip('网络出小差了,请检查网络后重试')
346 return 350 return
347 } 351 }
@@ -352,7 +356,7 @@ export struct ENewspaperPageComponent { @@ -352,7 +356,7 @@ export struct ENewspaperPageComponent {
352 } else { 356 } else {
353 this.pageDialogController.close() 357 this.pageDialogController.close()
354 } 358 }
355 - }else { 359 + } else {
356 this.showToastTip('暂无数据') 360 this.showToastTip('暂无数据')
357 } 361 }
358 }) 362 })
@@ -380,21 +384,22 @@ export struct ENewspaperPageComponent { @@ -380,21 +384,22 @@ export struct ENewspaperPageComponent {
380 }) 384 })
381 .id('e_newspaper_read') 385 .id('e_newspaper_read')
382 .onClick((event: ClickEvent) => { 386 .onClick((event: ClickEvent) => {
383 - if(!NetworkUtil.isNetConnected()){ 387 + if (!NetworkUtil.isNetConnected()) {
384 this.showToastTip('网络出小差了,请检查网络后重试') 388 this.showToastTip('网络出小差了,请检查网络后重试')
385 return 389 return
386 } 390 }
387 if (this.newspaperListBean.list && this.newspaperListBean.list.length > 0) { 391 if (this.newspaperListBean.list && this.newspaperListBean.list.length > 0) {
388 this.isOpenListDialog = true 392 this.isOpenListDialog = true
389 //电子报--读报纸点击 393 //电子报--读报纸点击
390 - TrackingContent.clickWithEvent('read_newspaper_click',TrackConstants.PageName.NewsPaperPage,TrackConstants.PageName.NewsPaperPage  
391 - ,{  
392 - 'panelNumber':this.newspaperListBean?.list[this.swiperIndex].pageNum,  
393 - 'panelName':this.newspaperListBean?.list[this.swiperIndex].pageName,  
394 - 'currentPanelDate':this.selectDate.toDateString(),  
395 - 'currentNumber':this.swiperIndex, 394 + TrackingContent.clickWithEvent('read_newspaper_click', TrackConstants.PageName.NewsPaperPage,
  395 + TrackConstants.PageName.NewsPaperPage
  396 + , {
  397 + 'panelNumber': this.newspaperListBean?.list[this.swiperIndex].pageNum,
  398 + 'panelName': this.newspaperListBean?.list[this.swiperIndex].pageName,
  399 + 'currentPanelDate': this.selectDate.toDateString(),
  400 + 'currentNumber': this.swiperIndex,
396 }) 401 })
397 - }else { 402 + } else {
398 this.showToastTip('暂无数据') 403 this.showToastTip('暂无数据')
399 } 404 }
400 }) 405 })
@@ -430,7 +435,8 @@ export struct ENewspaperPageComponent { @@ -430,7 +435,8 @@ export struct ENewspaperPageComponent {
430 private async getNewspaperList() { 435 private async getNewspaperList() {
431 try { 436 try {
432 if (NetworkUtil.isNetConnected()) { 437 if (NetworkUtil.isNetConnected()) {
433 - let listBean = await NewspaperViewModel.getNewspaperList(this.calendarDate, this.picWidth + 'x' + this.picHeight) 438 + let listBean =
  439 + await NewspaperViewModel.getNewspaperList(this.calendarDate, this.picWidth + 'x' + this.picHeight)
434 this.newspaperListBean = listBean; 440 this.newspaperListBean = listBean;
435 } else { 441 } else {
436 this.showToastTip('网络出小差了,请检查网络后重试') 442 this.showToastTip('网络出小差了,请检查网络后重试')
@@ -442,21 +448,22 @@ export struct ENewspaperPageComponent { @@ -442,21 +448,22 @@ export struct ENewspaperPageComponent {
442 448
443 share() { 449 share() {
444 let contentDetailData: ContentDetailDTO = { 450 let contentDetailData: ContentDetailDTO = {
445 - shareInfo:{  
446 - shareTitle:this.newspaperListBean?.list[this.swiperIndex].pageName,  
447 - appCustomPublishTime:this.newspaperListBean?.list[this.swiperIndex].periodNum,  
448 - appCustomImageUrl:this.newspaperListBean?.list[this.swiperIndex].pagePic,  
449 - shareUrl:this.newspaperListBean?.list[this.swiperIndex].sharePagePic.shareUrl,  
450 - sharePosterCoverUrl:this.newspaperListBean?.list[this.swiperIndex].sharePagePic.sharePosterCoverUrl,  
451 - appCustomShowReport:false,  
452 - appCustomShowLike:-1,  
453 - shareOpen:1,  
454 - sharePosterOpen:1,  
455 - appCustomPosterShareControl:'-1',  
456 - appCustomShowPoster:-1,  
457 - appCustomShowPosterType:4, 451 + shareInfo: {
  452 + shareTitle: this.newspaperListBean?.list[this.swiperIndex].pageName,
  453 + appCustomPublishTime: this.newspaperListBean?.list[this.swiperIndex].periodNum,
  454 + appCustomImageUrl: this.newspaperListBean?.list[this.swiperIndex].pagePic,
  455 + shareUrl: this.newspaperListBean?.list[this.swiperIndex].sharePagePic.shareUrl,
  456 + sharePosterCoverUrl: this.newspaperListBean?.list[this.swiperIndex].sharePagePic.sharePosterCoverUrl,
  457 + appCustomShowReport: false,
  458 + appCustomShowLike: -1,
  459 + shareOpen: 1,
  460 + sharePosterOpen: 1,
  461 + appCustomPosterShareControl: '-1',
  462 + appCustomShowPoster: -1,
  463 + appCustomShowPosterType: 4,
458 } 464 }
459 } as ContentDetailDTO 465 } as ContentDetailDTO
460 - WDShare.shareContent(contentDetailData,TrackConstants.PageName.NewsPaperPage,TrackConstants.PageName.NewsPaperPage) 466 + WDShare.shareContent(contentDetailData, TrackConstants.PageName.NewsPaperPage,
  467 + TrackConstants.PageName.NewsPaperPage)
461 } 468 }
462 } 469 }
@@ -19,7 +19,8 @@ struct EditUserInfoPage { @@ -19,7 +19,8 @@ struct EditUserInfoPage {
19 @State headerImg: string = '' 19 @State headerImg: string = ''
20 @State dataSource: AreaListModel[] = [] 20 @State dataSource: AreaListModel[] = []
21 @State currentUserInfo: editModel = new editModel() 21 @State currentUserInfo: editModel = new editModel()
22 - @State bottomSafeHeight: number = 0; 22 + @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
  23 + @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
23 24
24 dialogController: CustomDialogController = new CustomDialogController({ 25 dialogController: CustomDialogController = new CustomDialogController({
25 builder: AreaPickerDialog({dataSource:this.dataSource, 26 builder: AreaPickerDialog({dataSource:this.dataSource,
@@ -34,10 +35,7 @@ struct EditUserInfoPage { @@ -34,10 +35,7 @@ struct EditUserInfoPage {
34 }), 35 }),
35 alignment: DialogAlignment.Bottom, 36 alignment: DialogAlignment.Bottom,
36 customStyle: true, 37 customStyle: true,
37 - offset: {  
38 - dx: 0,  
39 - dy: -this.bottomSafeHeight  
40 - }, 38 + closeAnimation:{duration:0}
41 }) 39 })
42 40
43 dateDialogController: CustomDialogController = new CustomDialogController({ 41 dateDialogController: CustomDialogController = new CustomDialogController({
@@ -53,10 +51,7 @@ struct EditUserInfoPage { @@ -53,10 +51,7 @@ struct EditUserInfoPage {
53 }), 51 }),
54 alignment: DialogAlignment.Bottom, 52 alignment: DialogAlignment.Bottom,
55 customStyle: true, 53 customStyle: true,
56 - offset: {  
57 - dx: 0,  
58 - dy: -this.bottomSafeHeight  
59 - }, 54 + closeAnimation:{duration:0}
60 }) 55 })
61 56
62 sexDialogController: CustomDialogController = new CustomDialogController({ 57 sexDialogController: CustomDialogController = new CustomDialogController({
@@ -69,15 +64,10 @@ struct EditUserInfoPage { @@ -69,15 +64,10 @@ struct EditUserInfoPage {
69 }), 64 }),
70 alignment: DialogAlignment.Bottom, 65 alignment: DialogAlignment.Bottom,
71 customStyle: true, 66 customStyle: true,
72 - offset: {  
73 - dx: 0,  
74 - dy: -this.bottomSafeHeight  
75 - }, 67 + closeAnimation:{duration:0}
76 }) 68 })
77 69
78 - async aboutToAppear() {  
79 - let windowHight: window.Window = await window.getLastWindow(getContext(this));  
80 - this.bottomSafeHeight = px2vp(windowHight.getWindowAvoidArea(window.AvoidAreaType.TYPE_SYSTEM).bottomRect.height) 70 + aboutToAppear() {
81 this.getAccountOwnerInfo() 71 this.getAccountOwnerInfo()
82 this.getAreaList() 72 this.getAreaList()
83 } 73 }
@@ -142,6 +132,7 @@ struct EditUserInfoPage { @@ -142,6 +132,7 @@ struct EditUserInfoPage {
142 } 132 }
143 .width('100%') 133 .width('100%')
144 .height('100%') 134 .height('100%')
  135 + .padding({top:px2vp(this.topSafeHeight),bottom:px2vp(this.bottomSafeHeight)})
145 } 136 }
146 137
147 @Builder 138 @Builder
@@ -9,6 +9,8 @@ struct EditUserIntroductionPage { @@ -9,6 +9,8 @@ struct EditUserIntroductionPage {
9 @State textColor : string = '#222222' 9 @State textColor : string = '#222222'
10 @State introduction: string = '' 10 @State introduction: string = ''
11 @State params:editModelParams = router.getParams() as editModelParams; 11 @State params:editModelParams = router.getParams() as editModelParams;
  12 + @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
  13 + @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
12 build() { 14 build() {
13 Column(){ 15 Column(){
14 CustomTitleUI({titleName:'修改简介'}) 16 CustomTitleUI({titleName:'修改简介'})
@@ -63,6 +65,7 @@ struct EditUserIntroductionPage { @@ -63,6 +65,7 @@ struct EditUserIntroductionPage {
63 this.updateEditModel() 65 this.updateEditModel()
64 }) 66 })
65 } 67 }
  68 + .padding({top:px2vp(this.topSafeHeight),bottom:px2vp(this.bottomSafeHeight)})
66 } 69 }
67 70
68 71
@@ -12,6 +12,8 @@ struct EditUserNikeNamePage { @@ -12,6 +12,8 @@ struct EditUserNikeNamePage {
12 @State textColor : string = '#222222' 12 @State textColor : string = '#222222'
13 @State nikeName: string = '' 13 @State nikeName: string = ''
14 @State params:editModelParams = router.getParams() as editModelParams; 14 @State params:editModelParams = router.getParams() as editModelParams;
  15 + @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
  16 + @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
15 build() { 17 build() {
16 Column(){ 18 Column(){
17 CustomTitleUI({titleName:'修改昵称'}) 19 CustomTitleUI({titleName:'修改昵称'})
@@ -66,7 +68,7 @@ struct EditUserNikeNamePage { @@ -66,7 +68,7 @@ struct EditUserNikeNamePage {
66 ///内部更新 68 ///内部更新
67 this.updateEditModel() 69 this.updateEditModel()
68 }) 70 })
69 - } 71 + }.padding({top:px2vp(this.topSafeHeight),bottom:px2vp(this.bottomSafeHeight)})
70 } 72 }
71 73
72 async updateEditModel(){ 74 async updateEditModel(){
@@ -20,6 +20,8 @@ struct InteractMessagePage { @@ -20,6 +20,8 @@ struct InteractMessagePage {
20 private scroller: Scroller = new Scroller(); 20 private scroller: Scroller = new Scroller();
21 @State likeNum: number = 0 21 @State likeNum: number = 0
22 @State currentPage: number = 1; 22 @State currentPage: number = 1;
  23 + @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
  24 + @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
23 25
24 aboutToAppear(){ 26 aboutToAppear(){
25 this.getData() 27 this.getData()
@@ -58,6 +60,8 @@ struct InteractMessagePage { @@ -58,6 +60,8 @@ struct InteractMessagePage {
58 } 60 }
59 .width(CommonConstants.FULL_WIDTH) 61 .width(CommonConstants.FULL_WIDTH)
60 .height(CommonConstants.FULL_HEIGHT) 62 .height(CommonConstants.FULL_HEIGHT)
  63 + .padding({top:px2vp(this.topSafeHeight),bottom:px2vp(this.bottomSafeHeight)})
  64 +
61 } 65 }
62 66
63 @Builder ListLayout() { 67 @Builder ListLayout() {
@@ -34,6 +34,8 @@ struct MyCollectionListPage { @@ -34,6 +34,8 @@ struct MyCollectionListPage {
34 @State currentPage: number = 1; 34 @State currentPage: number = 1;
35 private scroller: Scroller = new Scroller(); 35 private scroller: Scroller = new Scroller();
36 emptyType: WDViewDefaultType = WDViewDefaultType.WDViewDefaultType_Default 36 emptyType: WDViewDefaultType = WDViewDefaultType.WDViewDefaultType_Default
  37 + @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
  38 + @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
37 39
38 dialogController: CustomDialogController = new CustomDialogController({ 40 dialogController: CustomDialogController = new CustomDialogController({
39 builder: MyCustomDialog({ 41 builder: MyCustomDialog({
@@ -120,6 +122,8 @@ struct MyCollectionListPage { @@ -120,6 +122,8 @@ struct MyCollectionListPage {
120 .backgroundColor('#FFFFFF') 122 .backgroundColor('#FFFFFF')
121 .width(CommonConstants.FULL_WIDTH) 123 .width(CommonConstants.FULL_WIDTH)
122 .height(CommonConstants.FULL_HEIGHT) 124 .height(CommonConstants.FULL_HEIGHT)
  125 + .padding({top:px2vp(this.topSafeHeight),bottom:px2vp(this.bottomSafeHeight)})
  126 +
123 } 127 }
124 128
125 @Builder ListLayout() { 129 @Builder ListLayout() {
@@ -149,16 +153,14 @@ struct MyCollectionListPage { @@ -149,16 +153,14 @@ struct MyCollectionListPage {
149 selectCallback:(isOn)=>{ 153 selectCallback:(isOn)=>{
150 this.addCompDTO(isOn,compDTO) 154 this.addCompDTO(isOn,compDTO)
151 } 155 }
152 - })  
153 - .margin({left:16})  
154 - Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }); 156 + }).margin({left:16})
155 } 157 }
156 Column() { 158 Column() {
157 BigPicCardComponent({compDTO:new CompDTO,contentDTO:compDTO,pageId:TrackConstants.PageName.My_Collect,pageName:TrackConstants.PageName.My_Collect}) 159 BigPicCardComponent({compDTO:new CompDTO,contentDTO:compDTO,pageId:TrackConstants.PageName.My_Collect,pageName:TrackConstants.PageName.My_Collect})
158 Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }); 160 Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 });
159 } 161 }
160 }.onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => { 162 }.onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => {
161 - if (isVisible) { 163 + if (isVisible && !this.isEditState) {
162 TrackingContent.common(TrackConstants.EventType.Show, TrackConstants.PageName.My_Collect,TrackConstants.PageName.My_Collect, TrackParamConvert.program(compDTO)) 164 TrackingContent.common(TrackConstants.EventType.Show, TrackConstants.PageName.My_Collect,TrackConstants.PageName.My_Collect, TrackParamConvert.program(compDTO))
163 } 165 }
164 }) 166 })
@@ -291,6 +293,7 @@ struct MyCollectionListPage { @@ -291,6 +293,7 @@ struct MyCollectionListPage {
291 compDTO.interactData = this.commentList[index] 293 compDTO.interactData = this.commentList[index]
292 datas.push(compDTO) 294 datas.push(compDTO)
293 } 295 }
  296 + this.allDatas = []
294 this.allDatas.push(...datas) 297 this.allDatas.push(...datas)
295 } catch (exception) { 298 } catch (exception) {
296 } 299 }
@@ -30,7 +30,7 @@ export struct SearchCreatorComponent{ @@ -30,7 +30,7 @@ export struct SearchCreatorComponent{
30 .fontSize('25lpx') 30 .fontSize('25lpx')
31 .fontWeight('400lpx') 31 .fontWeight('400lpx')
32 .lineHeight('35lpx') 32 .lineHeight('35lpx')
33 - .constraintSize({maxWidth:'150lpx'}) 33 + .constraintSize({maxWidth:'125lpx'})
34 .maxLines(1) 34 .maxLines(1)
35 .textOverflow({ overflow: TextOverflow.Ellipsis }) 35 .textOverflow({ overflow: TextOverflow.Ellipsis })
36 }.alignItems(HorizontalAlign.Center) 36 }.alignItems(HorizontalAlign.Center)
@@ -221,6 +221,8 @@ export class PageHelper { @@ -221,6 +221,8 @@ export class PageHelper {
221 // let pageDto = page 221 // let pageDto = page
222 let index = pageInfo.groups.indexOf(group) 222 let index = pageInfo.groups.indexOf(group)
223 223
  224 + Logger.debug(TAG, 'yyyy parseGroup print')
  225 + this.printComp(pageDto)
224 // 解析楼层组件 226 // 解析楼层组件
225 this.analysisPageGroupCompData(pageDto, pageInfo) 227 this.analysisPageGroupCompData(pageDto, pageInfo)
226 228
@@ -293,7 +295,8 @@ export class PageHelper { @@ -293,7 +295,8 @@ export class PageHelper {
293 if (pageDto.compAdList != null) { 295 if (pageDto.compAdList != null) {
294 pageInfo.pageAdList.push(...pageDto.compAdList) 296 pageInfo.pageAdList.push(...pageDto.compAdList)
295 } 297 }
296 - 298 + // TODO 待删除
  299 + Logger.debug(TAG, 'yyyy analysisPageGroupCompData size, '+pageInfo?.oneRequestPageGroupCompList?.length)
297 } 300 }
298 301
299 } 302 }
@@ -340,6 +343,8 @@ export class PageHelper { @@ -340,6 +343,8 @@ export class PageHelper {
340 pageModel.currentPage++; 343 pageModel.currentPage++;
341 pageModel.hasMore = true; 344 pageModel.hasMore = true;
342 345
  346 + Logger.debug(TAG, 'yyyy compLoadMore print')
  347 + this.printComp(data)
343 //移除音频 和 活动 348 //移除音频 和 活动
344 this.loadMorePageComp(pageModel, data) 349 this.loadMorePageComp(pageModel, data)
345 // 参与批查 350 // 参与批查
@@ -366,6 +371,8 @@ export class PageHelper { @@ -366,6 +371,8 @@ export class PageHelper {
366 pageCompList.forEach((comp: CompDTO) => { 371 pageCompList.forEach((comp: CompDTO) => {
367 pageModel.pageInfo.oneRequestPageGroupCompList.add(comp) 372 pageModel.pageInfo.oneRequestPageGroupCompList.add(comp)
368 }) 373 })
  374 + // TODO 待删除
  375 + Logger.debug(TAG, 'yyyy loadMorePageComp size, ' + pageModel.pageInfo.oneRequestPageGroupCompList?.length)
369 376
370 // 记录 377 // 记录
371 pageModel.pageTotalCompSize = pageCompList.length + pageModel.pageTotalCompSize 378 pageModel.pageTotalCompSize = pageCompList.length + pageModel.pageTotalCompSize
@@ -843,6 +850,31 @@ export class PageHelper { @@ -843,6 +850,31 @@ export class PageHelper {
843 // 从第二页开始删 850 // 从第二页开始删
844 pageModel.compList.deleteItems(pageModel.firstPageEndIndex + 1) 851 pageModel.compList.deleteItems(pageModel.firstPageEndIndex + 1)
845 } 852 }
  853 +
  854 + /**
  855 + * 临时打印comp相关信息,用于问题定位。TODO 待删除
  856 + */
  857 + private printComp(pageDto: PageDTO) {
  858 + Logger.debug(TAG, 'yyyy printComp pageDto.compList.size: ' + pageDto?.compList?.length)
  859 + new Promise<void>(() => {
  860 + let tmpCompList: CompDTO[] = Array.from(pageDto.compList)
  861 + tmpCompList.forEach((v, k) => {
  862 + if (v && v.operDataList) {
  863 + Logger.warn(TAG, 'yyyy printComp comp forEach, ' + v.compStyle)
  864 + v.operDataList.forEach((cv, ci) => {
  865 + if (cv) {
  866 + Logger.debug(TAG, 'yyyy printComp ContentDTO print, ' + v.compStyle)
  867 + Logger.debug(TAG, 'yyyy printComp ContentDTO xxxx newsTitle, ' + cv.newsTitle)
  868 + } else {
  869 + Logger.warn(TAG, 'yyyy printComp ContentDTO is null, ' + v.compStyle)
  870 + }
  871 + })
  872 + } else {
  873 + Logger.warn(TAG, 'yyyy printComp comp is null or operDataList is empty, ' + v?.compStyle)
  874 + }
  875 + })
  876 + })
  877 + }
846 } 878 }
847 879
848 880
@@ -11,7 +11,9 @@ export struct PlayerProgressView { @@ -11,7 +11,9 @@ export struct PlayerProgressView {
11 @Consume isDragging: boolean 11 @Consume isDragging: boolean
12 @Consume status: number 12 @Consume status: number
13 @State videoDuration: number = this.contentDetailData?.videoInfo?.[0]?.videoDuration || 1 13 @State videoDuration: number = this.contentDetailData?.videoInfo?.[0]?.videoDuration || 1
14 - 14 + @State loadingTop: number = 10
  15 + @State loadingWidth: number | string = 1
  16 + @State showLoading: boolean = false
15 aboutToAppear() { 17 aboutToAppear() {
16 if (this.playerController) { 18 if (this.playerController) {
17 this.playerController.onStatusChange = (status: number) => { 19 this.playerController.onStatusChange = (status: number) => {
@@ -20,55 +22,95 @@ export struct PlayerProgressView { @@ -20,55 +22,95 @@ export struct PlayerProgressView {
20 this.playerController.onSeekDone = (status: number) => { 22 this.playerController.onSeekDone = (status: number) => {
21 this.playerController?.play() 23 this.playerController?.play()
22 } 24 }
  25 +
  26 + this.playerController.onLoaded = (loaded: number) => {
  27 + if(loaded == 1) {
  28 + this.loadingWidth = '95%'
  29 + this.showLoading = true
  30 + } else {
  31 + this.loadingWidth = 1
  32 + this.showLoading = false
  33 + }
  34 + }
23 } 35 }
24 } 36 }
25 37
26 - build() {  
27 - Column() {  
28 - Text() {  
29 - Span(DateTimeUtils.secondToTime(Math.floor(this.progressVal / 100 * this.videoDuration)))  
30 - Span(' / ')  
31 - Span(DateTimeUtils.secondToTime(this.videoDuration))  
32 - }  
33 - .fontSize(24)  
34 - .fontColor(Color.White)  
35 - .fontWeight(600)  
36 - .margin({ bottom: 30 })  
37 - .visibility(this.isDragging ? Visibility.Visible : Visibility.None) 38 + /**
  39 + *
  40 + * loading 动效
  41 + */
  42 + @Builder
  43 + playerLoadingBuilder() {
38 44
39 - Slider({  
40 - value: this.progressVal,  
41 - step: 0.01,  
42 - // style: SliderStyle.OutSet  
43 - })  
44 - .blockColor(this.status === PlayerConstants.STATUS_PAUSE || this.isDragging ? $r('app.color.play_block_color') :  
45 - Color.Transparent)  
46 - .trackColor(this.status === PlayerConstants.STATUS_PAUSE || this.isDragging ?  
47 - $r('app.color.pause_track_color') : $r('app.color.play_track_color'))  
48 - .selectedColor(this.status === PlayerConstants.STATUS_PAUSE || this.isDragging ?  
49 - $r('app.color.pause_selected_color') : $r('app.color.play_selected_color'))  
50 - .trackThickness(this.status === PlayerConstants.STATUS_PAUSE || this.isDragging ? 4 : 1)  
51 - .blockStyle({  
52 - type: this.status === PlayerConstants.STATUS_PAUSE || this.isDragging ? SliderBlockType.IMAGE :  
53 - SliderBlockType.DEFAULT,  
54 - image: $r('app.media.ic_player_block')  
55 - })  
56 - .blockSize({ width: 18, height: 12 })  
57 - .width('100%')  
58 - .height(19)  
59 - .onChange((value: number, mode: SliderChangeMode) => {  
60 - this.progressVal = value  
61 - if (mode === SliderChangeMode.Moving) {  
62 - this.isDragging = true  
63 - }  
64 - if (mode === SliderChangeMode.End) {  
65 - this.isDragging = false 45 + Flex({
  46 + direction: FlexDirection.Row,
  47 + justifyContent: FlexAlign.Center,
  48 + alignItems: ItemAlign.End
  49 + }) {
  50 + Text('')
  51 + .backgroundColor(Color.Gray)
  52 + .width(this.loadingWidth)
  53 + .height(1)
  54 + .animation({ duration: 500, curve: Curve.Ease, iterations: -1, playMode: PlayMode.Normal })
  55 + }
  56 + .width('100%')
  57 + .zIndex(2000)
  58 + .visibility(this.showLoading ? Visibility.Visible: Visibility.Hidden)
  59 + .margin({ bottom: 10 })
  60 + // .markAnchor({ x: 0, y: '100%' })
  61 + }
  62 +
  63 + build() {
  64 + Stack() {
  65 + this.playerLoadingBuilder()
  66 + if(!this.showLoading) {
  67 + Column() {
  68 + Text() {
  69 + Span(DateTimeUtils.secondToTime(Math.floor(this.progressVal / 100 * this.videoDuration)))
  70 + Span(' / ')
  71 + Span(DateTimeUtils.secondToTime(this.videoDuration))
66 } 72 }
67 - this.playerController?.setSeekTime(value, mode);  
68 - console.log('slider onChange:', value, mode) 73 + .fontSize(24)
  74 + .fontColor(Color.White)
  75 + .fontWeight(600)
  76 + .margin({ bottom: 30 })
  77 + .visibility(this.isDragging ? Visibility.Visible : Visibility.None)
  78 +
  79 + Slider({
  80 + value: this.progressVal,
  81 + step: 0.01,
  82 + // style: SliderStyle.OutSet
  83 + })
  84 + .blockColor(this.status === PlayerConstants.STATUS_PAUSE || this.isDragging ? $r('app.color.play_block_color') :
  85 + Color.Transparent)
  86 + .trackColor(this.status === PlayerConstants.STATUS_PAUSE || this.isDragging ?
  87 + $r('app.color.pause_track_color') : $r('app.color.play_track_color'))
  88 + .selectedColor(this.status === PlayerConstants.STATUS_PAUSE || this.isDragging ?
  89 + $r('app.color.pause_selected_color') : $r('app.color.play_selected_color'))
  90 + .trackThickness(this.status === PlayerConstants.STATUS_PAUSE || this.isDragging ? 4 : 1)
  91 + .blockStyle({
  92 + type: this.status === PlayerConstants.STATUS_PAUSE || this.isDragging ? SliderBlockType.IMAGE :
  93 + SliderBlockType.DEFAULT,
  94 + image: $r('app.media.ic_player_block')
  95 + })
  96 + .blockSize({ width: 18, height: 12 })
  97 + .width('100%')
  98 + .height(19)
  99 + .onChange((value: number, mode: SliderChangeMode) => {
  100 + this.progressVal = value
  101 + if (mode === SliderChangeMode.Moving) {
  102 + this.isDragging = true
  103 + }
  104 + if (mode === SliderChangeMode.End) {
  105 + this.isDragging = false
  106 + }
  107 + this.playerController?.setSeekTime(value, mode);
  108 + console.log('slider onChange:', value, mode)
69 109
70 - }) 110 + })
  111 + }
  112 + .visibility(this.isOpenDetail ? Visibility.None : Visibility.Visible)
  113 + }
71 } 114 }
72 - .visibility(this.isOpenDetail ? Visibility.None : Visibility.Visible)  
73 } 115 }
74 } 116 }
  1 +import { CommonConstants } from 'wdConstant';
  2 +import { Logger } from 'wdKit';
  3 +
  4 +const TAG = 'EmptyComponent';
  5 +
  6 +/**
  7 + * WDViewDefaultType 缺省页 无网络
  8 + */
  9 +export const enum WDViewDefaultType {
  10 + /// 0.默认
  11 + WDViewDefaultType_Default,
  12 + /// 1.无网
  13 + WDViewDefaultType_NoNetwork,
  14 +}
  15 +
  16 +/**
  17 + * 空数据/无数据
  18 + */
  19 +@Preview
  20 +@Component
  21 +export struct EmptyComponent {
  22 + @State emptyWidth: string | number = CommonConstants.FULL_PARENT;
  23 + @State emptyHeight: string | number = CommonConstants.FULL_PARENT;
  24 + @State emptyType: number = WDViewDefaultType.WDViewDefaultType_NoNetwork; // 缺省图类型,传枚举
  25 + @State emptyButton: boolean = false
  26 + @State timeNum: number = 10
  27 + /**
  28 + * The empty image width percentage setting.
  29 + */
  30 + readonly EMPTY_IMAGE_WIDTH: string = '15%';
  31 + /**
  32 + * The empty image height percentage setting.
  33 + */
  34 + readonly EMPTY_IMAGE_HEIGHT: string = '15%';
  35 + /**
  36 + * The empty data text component margin top.
  37 + */
  38 + readonly EMPTY_TIP_TEXT_MARGIN_TOP: string = '10';
  39 + /**
  40 + * The empty data text opacity.
  41 + */
  42 + readonly TEXT_OPACITY: number = 0.4;
  43 + private timer: number = -1
  44 + retry: () => void = () => {
  45 + }
  46 +
  47 + build() {
  48 + this.noProgrammeData();
  49 + }
  50 +
  51 + /**
  52 + * 无数据,空白view组件
  53 + */
  54 + @Builder
  55 + noProgrammeData() {
  56 + Column() {
  57 + Image(this.buildNoDataTipImage())
  58 + .width(160)
  59 + .height(112)
  60 + .objectFit(ImageFit.Contain)
  61 +
  62 + Text(this.emptyType !== 8 ? this.buildNoDataTip() : `${this.buildNoDataTip()}(${this.timeNum}s)`)
  63 + .fontSize($r('app.float.font_size_14'))// .fontColor('#FF999999')
  64 + .fontWeight(FontWeight.Normal)
  65 + .opacity(this.TEXT_OPACITY)
  66 + .margin({ top: this.EMPTY_TIP_TEXT_MARGIN_TOP })
  67 + .onClick((event: ClickEvent) => {
  68 + Logger.info(TAG, `noProgrammeData onClick event?.source: ${event.source}`);
  69 + })
  70 +
  71 + if (this.isShowButton()) {
  72 + if (this.emptyType !== 15) {
  73 + Button('点击重试')
  74 + .type(ButtonType.Normal)
  75 + .width(80)
  76 + .height(28)
  77 + .backgroundColor('#fffffff')
  78 + .fontColor('#FF666666')
  79 + .border({ width: 1 })
  80 + .borderColor('#FFEDEDED')
  81 + .borderRadius(4)
  82 + .fontSize($r('app.float.font_size_12'))
  83 + .margin({ top: 16 })
  84 + .padding(0)
  85 + .onClick(() => {
  86 + this.retry()
  87 + })
  88 + } else {
  89 + Button('点击重试')
  90 + .type(ButtonType.Normal)
  91 + .width(80)
  92 + .height(28)
  93 + .backgroundColor(Color.Black)
  94 + .fontColor('#FFCCCCCC')
  95 + .border({ width: 1 })
  96 + .borderColor('#4DFFFFFF')
  97 + .borderRadius(4)
  98 + .fontSize($r('app.float.font_size_12'))
  99 + .margin({ top: 16 })
  100 + .padding(0)
  101 + .onClick(() => {
  102 + this.retry()
  103 + })
  104 + }
  105 + }
  106 + }
  107 + .justifyContent(FlexAlign.Center)
  108 + .width(this.emptyWidth)
  109 + .height(this.emptyHeight)
  110 + }
  111 +
  112 + buildNoDataTip(): string {
  113 + Logger.info(TAG, "buildNoDataTip");
  114 + let contentString: string = '暂无内容'
  115 + if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoNetwork) {
  116 + contentString = '网络出小差了,请检查网络后重试'
  117 + }
  118 + return contentString
  119 + }
  120 +
  121 + buildNoDataTipImage(): Resource | string {
  122 + Logger.info(TAG, "buildNoDataTip");
  123 + let imageString: Resource | string = ""
  124 + if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoNetwork) {
  125 + imageString = $r('app.media.icon_no_net1')
  126 + }
  127 + return imageString
  128 + }
  129 +
  130 + isShowButton() {
  131 + if (this.emptyType === 1 || this.emptyType === 9 || this.emptyType === 15) {
  132 + return true
  133 + } else {
  134 + return false
  135 + }
  136 + }
  137 +}
  138 +
1 import router from '@ohos.router'; 1 import router from '@ohos.router';
2 import webview from '@ohos.web.webview'; 2 import webview from '@ohos.web.webview';
3 import { SpConstants } from 'wdConstant/Index'; 3 import { SpConstants } from 'wdConstant/Index';
4 -import { Logger, SPHelper } from 'wdKit'; 4 +import { Logger, NetworkUtil, SPHelper } from 'wdKit';
5 import { Params } from '../../../../../../../commons/wdRouter/oh_modules/wdBean/src/main/ets/bean/content/Params'; 5 import { Params } from '../../../../../../../commons/wdRouter/oh_modules/wdBean/src/main/ets/bean/content/Params';
  6 +import { EmptyComponent } from './EmptyComponent';
6 7
7 8
8 const TAG = 'LoginProtocolWebview'; 9 const TAG = 'LoginProtocolWebview';
@@ -12,7 +13,7 @@ const TAG = 'LoginProtocolWebview'; @@ -12,7 +13,7 @@ const TAG = 'LoginProtocolWebview';
12 struct LoginProtocolWebview { 13 struct LoginProtocolWebview {
13 @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 14 @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
14 @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 15 @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
15 - webUrl: string = '' 16 + @State webUrl: string = ''
16 webviewController: webview.WebviewController = new webview.WebviewController() 17 webviewController: webview.WebviewController = new webview.WebviewController()
17 userProtocol = "https://cdnpeoplefrontuat.aikan.pdnews.cn/rmrb/rmrb-protocol-zh-web/0.0.1/app/protocol-1005.html" 18 userProtocol = "https://cdnpeoplefrontuat.aikan.pdnews.cn/rmrb/rmrb-protocol-zh-web/0.0.1/app/protocol-1005.html"
18 privateProtocol = 'https://cdnpeoplefrontuat.aikan.pdnews.cn/rmrb/rmrb-protocol-zh-web/0.0.1/app/protocol-1001.html' 19 privateProtocol = 'https://cdnpeoplefrontuat.aikan.pdnews.cn/rmrb/rmrb-protocol-zh-web/0.0.1/app/protocol-1001.html'
@@ -22,6 +23,7 @@ struct LoginProtocolWebview { @@ -22,6 +23,7 @@ struct LoginProtocolWebview {
22 collectionProtocol = 'https://cdnpeoplefront.aikan.pdnews.cn/rmrb/rmrb-protocol-zh-web/0.0.1/app/protocol-1002.html'//收集个人信息明示清单 23 collectionProtocol = 'https://cdnpeoplefront.aikan.pdnews.cn/rmrb/rmrb-protocol-zh-web/0.0.1/app/protocol-1002.html'//收集个人信息明示清单
23 thirdVendorProtocol = 'https://cdnpeoplefront.aikan.pdnews.cn/rmrb/rmrb-protocol-zh-web/0.0.1/app/protocol-1004.html'//第三方信息共享清单 24 thirdVendorProtocol = 'https://cdnpeoplefront.aikan.pdnews.cn/rmrb/rmrb-protocol-zh-web/0.0.1/app/protocol-1004.html'//第三方信息共享清单
24 @State contentID:string = "0" 25 @State contentID:string = "0"
  26 + @State isConnectNetwork : boolean = NetworkUtil.isNetConnected()
25 27
26 async aboutToAppear() { 28 async aboutToAppear() {
27 if (router.getParams()) { 29 if (router.getParams()) {
@@ -33,24 +35,17 @@ struct LoginProtocolWebview { @@ -33,24 +35,17 @@ struct LoginProtocolWebview {
33 if (params.contentID == "1") { //"人民日报客户端网络服务使用协议" 35 if (params.contentID == "1") { //"人民日报客户端网络服务使用协议"
34 this.webUrl = this.userProtocol 36 this.webUrl = this.userProtocol
35 this.webUrl = await SPHelper.default.get(SpConstants.NET_SERVICE_PROTOCOL, this.userProtocol) as string 37 this.webUrl = await SPHelper.default.get(SpConstants.NET_SERVICE_PROTOCOL, this.userProtocol) as string
36 - this.webviewController.loadUrl(this.webUrl)  
37 -  
38 } else if(params.contentID == "2"){ //"人民日报客户端用户隐私协议" 38 } else if(params.contentID == "2"){ //"人民日报客户端用户隐私协议"
39 this.webUrl = this.privateProtocol 39 this.webUrl = this.privateProtocol
40 this.webUrl = await SPHelper.default.get(SpConstants.PRIVATE_PROTOCOL, this.privateProtocol) as string 40 this.webUrl = await SPHelper.default.get(SpConstants.PRIVATE_PROTOCOL, this.privateProtocol) as string
41 - this.webviewController.loadUrl(this.webUrl)  
42 }else if(params.contentID == "3"){ //注销协议 41 }else if(params.contentID == "3"){ //注销协议
43 this.webUrl = await SPHelper.default.get(SpConstants.LOGOUT_PROTOCOL, this.logoutProtocol) as string 42 this.webUrl = await SPHelper.default.get(SpConstants.LOGOUT_PROTOCOL, this.logoutProtocol) as string
44 - this.webviewController.loadUrl(this.webUrl)  
45 } else if(params.contentID == "4"){ //华为用户认证协议 43 } else if(params.contentID == "4"){ //华为用户认证协议
46 this.webUrl = this.huaweiAuthProtocol 44 this.webUrl = this.huaweiAuthProtocol
47 - this.webviewController.loadUrl(this.webUrl)  
48 } else if(params.contentID == "5"){ //收集个人信息明示清单 45 } else if(params.contentID == "5"){ //收集个人信息明示清单
49 this.webUrl = this.collectionProtocol 46 this.webUrl = this.collectionProtocol
50 - this.webviewController.loadUrl(this.webUrl)  
51 } else if(params.contentID == "6"){ //第三方信息共享清单 47 } else if(params.contentID == "6"){ //第三方信息共享清单
52 this.webUrl = this.thirdVendorProtocol 48 this.webUrl = this.thirdVendorProtocol
53 - this.webviewController.loadUrl(this.webUrl)  
54 } 49 }
55 } 50 }
56 51
@@ -75,20 +70,27 @@ struct LoginProtocolWebview { @@ -75,20 +70,27 @@ struct LoginProtocolWebview {
75 .alignItems(VerticalAlign.Center) 70 .alignItems(VerticalAlign.Center)
76 .width('100%') 71 .width('100%')
77 .height(44) 72 .height(44)
78 -  
79 - Web({ src: this.webUrl, controller: this.webviewController })  
80 - .domStorageAccess(true)  
81 - .databaseAccess(true)  
82 - .javaScriptAccess(true)  
83 - .zoomAccess(false)  
84 - .horizontalScrollBarAccess(false)  
85 - .verticalScrollBarAccess(false)  
86 - .onHttpErrorReceive((event) => {  
87 - //TODO 页面加载不成功的时候处理  
88 - Logger.info(TAG, 'onHttpErrorReceive event.request.getRequestUrl:' + event?.request.getRequestUrl());  
89 - Logger.info(TAG, 'onHttpErrorReceive event.response.getResponseCode:' + event?.response.getResponseCode());  
90 - })  
91 - .padding({bottom:this.contentID === "2" ? "40lpx" : 0 }) 73 + if(this.isConnectNetwork){
  74 + Web({ src: this.webUrl, controller: this.webviewController })
  75 + .domStorageAccess(true)
  76 + .databaseAccess(true)
  77 + .javaScriptAccess(true)
  78 + .zoomAccess(false)
  79 + .horizontalScrollBarAccess(false)
  80 + .verticalScrollBarAccess(false)
  81 + .onHttpErrorReceive((event) => {
  82 + //TODO 页面加载不成功的时候处理
  83 + Logger.info(TAG, 'onHttpErrorReceive event.request.getRequestUrl:' + event?.request.getRequestUrl());
  84 + Logger.info(TAG, 'onHttpErrorReceive event.response.getResponseCode:' + event?.response.getResponseCode());
  85 + })
  86 + .padding({bottom:this.contentID === "2" ? "40lpx" : 0 })
  87 + }else{
  88 + EmptyComponent({ emptyType: 1,emptyHeight:"100%" ,retry: () => {
  89 + this.isConnectNetwork = NetworkUtil.isNetConnected()
  90 + }})
  91 + .layoutWeight(1)
  92 + .width('100%')
  93 + }
92 } 94 }
93 }.width("100%") 95 }.width("100%")
94 .height("100%") 96 .height("100%")
@@ -27,6 +27,7 @@ export class WDPlayerController { @@ -27,6 +27,7 @@ export class WDPlayerController {
27 private prepareTime:number = 0; //加载时间 27 private prepareTime:number = 0; //加载时间
28 private currentPlayTime:number = 0; //当前播放时间 28 private currentPlayTime:number = 0; //当前播放时间
29 public onVideoSizeChange?: (width: number, height: number) => void; 29 public onVideoSizeChange?: (width: number, height: number) => void;
  30 + public onLoaded?: (loaded: number) => void;
30 public onTimeUpdate?: (position: number, duration: number) => void; 31 public onTimeUpdate?: (position: number, duration: number) => void;
31 public onVolumeUpdate?: (volume: number) => void; 32 public onVolumeUpdate?: (volume: number) => void;
32 public continue?: () => void; 33 public continue?: () => void;
@@ -86,6 +87,9 @@ export class WDPlayerController { @@ -86,6 +87,9 @@ export class WDPlayerController {
86 if (this.surfaceId) { 87 if (this.surfaceId) {
87 this.avPlayer.surfaceId = this.surfaceId; 88 this.avPlayer.surfaceId = this.surfaceId;
88 } 89 }
  90 + if(this.onLoaded) {
  91 + this.onLoaded(1)
  92 + }
89 93
90 this.avPlayer?.prepare(); 94 this.avPlayer?.prepare();
91 break; 95 break;
@@ -101,6 +105,9 @@ export class WDPlayerController { @@ -101,6 +105,9 @@ export class WDPlayerController {
101 } 105 }
102 break; 106 break;
103 case AVPlayerStatus.PLAYING: 107 case AVPlayerStatus.PLAYING:
  108 + if(this.onLoaded) {
  109 + this.onLoaded(2)
  110 + }
104 this.setBright(); 111 this.setBright();
105 this.status = PlayerConstants.STATUS_START; 112 this.status = PlayerConstants.STATUS_START;
106 this.avPlayer!.videoScaleType = media.VideoScaleType.VIDEO_SCALE_TYPE_FIT 113 this.avPlayer!.videoScaleType = media.VideoScaleType.VIDEO_SCALE_TYPE_FIT