Showing
46 changed files
with
765 additions
and
306 deletions
47.6 KB
| @@ -163,7 +163,7 @@ function buildErrorMsg(httpStatus: number): string { | @@ -163,7 +163,7 @@ function buildErrorMsg(httpStatus: number): string { | ||
| 163 | if(httpStatus != undefined){ | 163 | if(httpStatus != undefined){ |
| 164 | message = `连接出错(${httpStatus})!`; | 164 | message = `连接出错(${httpStatus})!`; |
| 165 | }else{ | 165 | }else{ |
| 166 | - message = `连接出错!`; | 166 | + message = `网络出小差了,请检查网络后重试`; |
| 167 | } | 167 | } |
| 168 | } | 168 | } |
| 169 | 169 |
| @@ -15,3 +15,5 @@ export { AssignChannelParam } from './src/main/ets/utils/HomeChannelUtils'; | @@ -15,3 +15,5 @@ export { AssignChannelParam } from './src/main/ets/utils/HomeChannelUtils'; | ||
| 15 | export { RouterJumpInterceptor, JumpInterceptorAction } from './src/main/ets/router/RouterJumpInterceptor' | 15 | export { RouterJumpInterceptor, JumpInterceptorAction } from './src/main/ets/router/RouterJumpInterceptor' |
| 16 | 16 | ||
| 17 | export { AppInnerLink } from './src/main/ets/utils/AppInnerLink' | 17 | export { AppInnerLink } from './src/main/ets/utils/AppInnerLink' |
| 18 | + | ||
| 19 | +export { ContentType } from './src/main/ets/common/ContentType' |
| 1 | +export enum ContentType { | ||
| 2 | + | ||
| 3 | + /// 不跳转 | ||
| 4 | + Unknown = 0, | ||
| 5 | + ///点播 | ||
| 6 | + Video = 1, | ||
| 7 | + | ||
| 8 | + ///直播 | ||
| 9 | + Live = 2, | ||
| 10 | + | ||
| 11 | + ///活动 | ||
| 12 | + Activity = 3, | ||
| 13 | + | ||
| 14 | + ///信息流广告 | ||
| 15 | + InfoflowAD = 4, | ||
| 16 | + | ||
| 17 | + ///专题 | ||
| 18 | + Subject = 5, | ||
| 19 | + | ||
| 20 | + ///链接 | ||
| 21 | + Link = 6, | ||
| 22 | + | ||
| 23 | + ///榜单 | ||
| 24 | + RankList = 7, | ||
| 25 | + | ||
| 26 | + /// 图文 | ||
| 27 | + ImageText = 8, | ||
| 28 | + /// 组图 | ||
| 29 | + Pictures = 9, | ||
| 30 | + | ||
| 31 | + /// H5新闻 (仅海外版存在,视界和中文端无此类型。中文端按照图文8类型+link) | ||
| 32 | + H5News = 10, | ||
| 33 | + /// 频道 | ||
| 34 | + Channel = 11, | ||
| 35 | + ///组件 | ||
| 36 | + Module = 12, | ||
| 37 | + ///音频 | ||
| 38 | + Audio = 13, | ||
| 39 | + ///动态图文 | ||
| 40 | + DynamicImageText = 14, | ||
| 41 | + | ||
| 42 | + ///动态视频 | ||
| 43 | + DynamicVideo = 15, | ||
| 44 | + | ||
| 45 | + ///问政留言 | ||
| 46 | + Ask = 16, | ||
| 47 | + | ||
| 48 | + /// 金刚位 | ||
| 49 | + KeyPosition = 30, | ||
| 50 | + | ||
| 51 | + /// 合集 | ||
| 52 | + Serials = 101, | ||
| 53 | + | ||
| 54 | + | ||
| 55 | + | ||
| 56 | +} |
| @@ -39,6 +39,8 @@ export interface ShareContentLink { | @@ -39,6 +39,8 @@ export interface ShareContentLink { | ||
| 39 | desc?: string | 39 | desc?: string |
| 40 | link: string | 40 | link: string |
| 41 | icon?: string | 41 | icon?: string |
| 42 | + deeplink: string // 根据内容详情,生成的深度链接 如:rmrbapp://rmrb.app/openwith?type=article&subType=h5_template_article&contentId=30000762651&relId=500000038702&skipType=1&relType=1 | ||
| 43 | + | ||
| 42 | } | 44 | } |
| 43 | 45 | ||
| 44 | export type ShareContent = ShareContentText | ShareContentImageAndText | ShareContentLink | 46 | export type ShareContent = ShareContentText | ShareContentImageAndText | ShareContentLink |
| @@ -6,6 +6,9 @@ import { AsyncCallback } from '@kit.BasicServicesKit'; | @@ -6,6 +6,9 @@ import { AsyncCallback } from '@kit.BasicServicesKit'; | ||
| 6 | import { common } from '@kit.AbilityKit'; | 6 | import { common } from '@kit.AbilityKit'; |
| 7 | import { systemShare } from '@kit.ShareKit'; | 7 | import { systemShare } from '@kit.ShareKit'; |
| 8 | import { uniformTypeDescriptor as utd } from '@kit.ArkData'; | 8 | import { uniformTypeDescriptor as utd } from '@kit.ArkData'; |
| 9 | +import { JSON } from '@kit.ArkTS'; | ||
| 10 | + | ||
| 11 | +const TAG = "WDSystemShare" | ||
| 9 | 12 | ||
| 10 | export class WDSystemShare implements WDShareInterface { | 13 | export class WDSystemShare implements WDShareInterface { |
| 11 | 14 | ||
| @@ -14,7 +17,8 @@ export class WDSystemShare implements WDShareInterface { | @@ -14,7 +17,8 @@ export class WDSystemShare implements WDShareInterface { | ||
| 14 | return new Promise((resolve, fail) => { | 17 | return new Promise((resolve, fail) => { |
| 15 | try { | 18 | try { |
| 16 | 19 | ||
| 17 | - let controller: systemShare.ShareController = new systemShare.ShareController(this.getShareData(content, contentType)); | 20 | + let data = this.getShareData(content, contentType) |
| 21 | + let controller: systemShare.ShareController = new systemShare.ShareController(data); | ||
| 18 | let context: common.UIAbilityContext = getContext(this) as common.UIAbilityContext | 22 | let context: common.UIAbilityContext = getContext(this) as common.UIAbilityContext |
| 19 | 23 | ||
| 20 | controller.on('dismiss', () => { | 24 | controller.on('dismiss', () => { |
| @@ -53,7 +57,7 @@ export class WDSystemShare implements WDShareInterface { | @@ -53,7 +57,7 @@ export class WDSystemShare implements WDShareInterface { | ||
| 53 | }); | 57 | }); |
| 54 | data.addRecord({ | 58 | data.addRecord({ |
| 55 | utd: utd.UniformDataType.PNG, | 59 | utd: utd.UniformDataType.PNG, |
| 56 | - uri: imageAndText.imgURI | 60 | + uri: imageAndText.imgURI // 这里必须为本地连接 |
| 57 | }); | 61 | }); |
| 58 | return data | 62 | return data |
| 59 | } | 63 | } |
| @@ -64,12 +68,35 @@ export class WDSystemShare implements WDShareInterface { | @@ -64,12 +68,35 @@ export class WDSystemShare implements WDShareInterface { | ||
| 64 | utd: utd.UniformDataType.PLAIN_TEXT, | 68 | utd: utd.UniformDataType.PLAIN_TEXT, |
| 65 | content: link.title | 69 | content: link.title |
| 66 | }); | 70 | }); |
| 71 | + let shareLink = this.generateShareLink(link) | ||
| 72 | + console.log("分享 shareLink ==> " + shareLink) | ||
| 67 | data.addRecord({ | 73 | data.addRecord({ |
| 68 | utd: utd.UniformDataType.HYPERLINK, | 74 | utd: utd.UniformDataType.HYPERLINK, |
| 69 | - uri: link.link | 75 | + // uri: link.link // SDK 设计 不能传这里 |
| 76 | + content: link.link | ||
| 70 | }); | 77 | }); |
| 71 | return data | 78 | return data |
| 72 | } | 79 | } |
| 73 | 80 | ||
| 81 | + generateShareLink(shareContent: ShareContentLink) { | ||
| 82 | + let link = "https://peopledailychinahosactivity.drcn.agconnect.link?deeplink=" + encodeURIComponent(shareContent.deeplink) | ||
| 83 | + | ||
| 84 | + link += "&harmonyos_deeplink=" + encodeURIComponent(shareContent.deeplink) | ||
| 85 | + link += "&harmonyos_package_name=com.peopledailychina.hosactivity" | ||
| 86 | + link += "&harmonyos_fallback_url=" + encodeURIComponent(shareContent.link) | ||
| 74 | 87 | ||
| 88 | + // link += "&android_deeplink=" + encodeURIComponent(shareContent.deeplink) | ||
| 89 | + // link += "&android_fallback_url=" + encodeURIComponent(shareContent.link) | ||
| 90 | + // | ||
| 91 | + // link += "&ios_link=" + encodeURIComponent(shareContent.deeplink) | ||
| 92 | + // link += "&ios_fallback_url=" + encodeURIComponent(shareContent.link) | ||
| 93 | + | ||
| 94 | + link += "&preview_type=1" | ||
| 95 | + link += "&landing_page_type=1" | ||
| 96 | + // link += "&social_desc=" + encodeURIComponent(shareContent.desc || " ") | ||
| 97 | + // link += "&social_image=" + encodeURIComponent(shareContent.icon || " ") | ||
| 98 | + // link += "&social_title=" + encodeURIComponent(shareContent.title) | ||
| 99 | + link += "®ion_id=0" | ||
| 100 | + return link | ||
| 101 | + } | ||
| 75 | } | 102 | } |
| 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 |
| @@ -32,29 +32,29 @@ export struct ENewspaperPageComponent { | @@ -32,29 +32,29 @@ export struct ENewspaperPageComponent { | ||
| 32 | @State swiperIndex: number = 0; | 32 | @State swiperIndex: number = 0; |
| 33 | //当前选择的日期标记 | 33 | //当前选择的日期标记 |
| 34 | @State selectDate: Date = new Date() | 34 | @State selectDate: Date = new Date() |
| 35 | - @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 | 35 | + @Provide 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) |
| @@ -277,17 +280,18 @@ export struct ENewspaperPageComponent { | @@ -277,17 +280,18 @@ export struct ENewspaperPageComponent { | ||
| 277 | this.swiperIndex = index | 280 | this.swiperIndex = index |
| 278 | }) | 281 | }) |
| 279 | 282 | ||
| 280 | - Image($r('app.media.newspaper_shadow')) | ||
| 281 | - .height($r('app.float.vp_12')) | ||
| 282 | - .width('100%') | ||
| 283 | - .margin({ left: 10, right: 10, top: -1 }) | ||
| 284 | - .objectFit(ImageFit.Contain) | ||
| 285 | - .alignRules({ | ||
| 286 | - top: { anchor: "e_newspaper_content", align: VerticalAlign.Bottom }, | ||
| 287 | - // left: { anchor: 'e_newspaper_content', align: HorizontalAlign.Start }, | ||
| 288 | - // right: { anchor: 'e_newspaper_content', align: HorizontalAlign.End } | ||
| 289 | - }) | ||
| 290 | - .id('e_newspaper_shadow') | 283 | + Row() { |
| 284 | + Image($r('app.media.newspaper_shadow')) | ||
| 285 | + .height($r('app.float.vp_12')) | ||
| 286 | + .width('100%') | ||
| 287 | + .objectFit(ImageFit.Contain) | ||
| 288 | + | ||
| 289 | + }.margin({ top: -1,left: 10, right: 10 }).alignRules({ | ||
| 290 | + top: { anchor: "e_newspaper_content", align: VerticalAlign.Bottom }, | ||
| 291 | + // left: { anchor: 'e_newspaper_content', align: HorizontalAlign.Start }, | ||
| 292 | + // right: { anchor: 'e_newspaper_content', align: HorizontalAlign.End } | ||
| 293 | + }) | ||
| 294 | + .id('e_newspaper_shadow') | ||
| 291 | 295 | ||
| 292 | Row() { | 296 | Row() { |
| 293 | Text(this.swiperIndex + 1 == this.newspaperListBean?.list?.length ? '已到底部,可以选择其他日期' : | 297 | Text(this.swiperIndex + 1 == this.newspaperListBean?.list?.length ? '已到底部,可以选择其他日期' : |
| @@ -310,10 +314,11 @@ export struct ENewspaperPageComponent { | @@ -310,10 +314,11 @@ export struct ENewspaperPageComponent { | ||
| 310 | .onClick((event: ClickEvent) => { | 314 | .onClick((event: ClickEvent) => { |
| 311 | this.swiperController.showNext() | 315 | this.swiperController.showNext() |
| 312 | // 电子报--滑动查看下一版 | 316 | // 电子报--滑动查看下一版 |
| 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, | 317 | + TrackingButton.click('panelPageViewNextPanel', TrackConstants.PageName.NewsPaperPage, |
| 318 | + TrackConstants.PageName.NewsPaperPage | ||
| 319 | + , { | ||
| 320 | + 'panelNumber': this.newspaperListBean?.list[this.swiperIndex].pageNum, | ||
| 321 | + 'panelName': this.newspaperListBean?.list[this.swiperIndex].pageName, | ||
| 317 | }) | 322 | }) |
| 318 | }) | 323 | }) |
| 319 | } | 324 | } |
| @@ -341,7 +346,7 @@ export struct ENewspaperPageComponent { | @@ -341,7 +346,7 @@ export struct ENewspaperPageComponent { | ||
| 341 | }) | 346 | }) |
| 342 | .id('e_newspaper_page_num') | 347 | .id('e_newspaper_page_num') |
| 343 | .onClick((event: ClickEvent) => { | 348 | .onClick((event: ClickEvent) => { |
| 344 | - if(!NetworkUtil.isNetConnected()){ | 349 | + if (!NetworkUtil.isNetConnected()) { |
| 345 | this.showToastTip('网络出小差了,请检查网络后重试') | 350 | this.showToastTip('网络出小差了,请检查网络后重试') |
| 346 | return | 351 | return |
| 347 | } | 352 | } |
| @@ -352,7 +357,7 @@ export struct ENewspaperPageComponent { | @@ -352,7 +357,7 @@ export struct ENewspaperPageComponent { | ||
| 352 | } else { | 357 | } else { |
| 353 | this.pageDialogController.close() | 358 | this.pageDialogController.close() |
| 354 | } | 359 | } |
| 355 | - }else { | 360 | + } else { |
| 356 | this.showToastTip('暂无数据') | 361 | this.showToastTip('暂无数据') |
| 357 | } | 362 | } |
| 358 | }) | 363 | }) |
| @@ -380,21 +385,22 @@ export struct ENewspaperPageComponent { | @@ -380,21 +385,22 @@ export struct ENewspaperPageComponent { | ||
| 380 | }) | 385 | }) |
| 381 | .id('e_newspaper_read') | 386 | .id('e_newspaper_read') |
| 382 | .onClick((event: ClickEvent) => { | 387 | .onClick((event: ClickEvent) => { |
| 383 | - if(!NetworkUtil.isNetConnected()){ | 388 | + if (!NetworkUtil.isNetConnected()) { |
| 384 | this.showToastTip('网络出小差了,请检查网络后重试') | 389 | this.showToastTip('网络出小差了,请检查网络后重试') |
| 385 | return | 390 | return |
| 386 | } | 391 | } |
| 387 | if (this.newspaperListBean.list && this.newspaperListBean.list.length > 0) { | 392 | if (this.newspaperListBean.list && this.newspaperListBean.list.length > 0) { |
| 388 | this.isOpenListDialog = true | 393 | this.isOpenListDialog = true |
| 389 | //电子报--读报纸点击 | 394 | //电子报--读报纸点击 |
| 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, | 395 | + TrackingContent.clickWithEvent('read_newspaper_click', TrackConstants.PageName.NewsPaperPage, |
| 396 | + TrackConstants.PageName.NewsPaperPage | ||
| 397 | + , { | ||
| 398 | + 'panelNumber': this.newspaperListBean?.list[this.swiperIndex].pageNum, | ||
| 399 | + 'panelName': this.newspaperListBean?.list[this.swiperIndex].pageName, | ||
| 400 | + 'currentPanelDate': this.selectDate.toDateString(), | ||
| 401 | + 'currentNumber': this.swiperIndex, | ||
| 396 | }) | 402 | }) |
| 397 | - }else { | 403 | + } else { |
| 398 | this.showToastTip('暂无数据') | 404 | this.showToastTip('暂无数据') |
| 399 | } | 405 | } |
| 400 | }) | 406 | }) |
| @@ -402,7 +408,7 @@ export struct ENewspaperPageComponent { | @@ -402,7 +408,7 @@ export struct ENewspaperPageComponent { | ||
| 402 | .width('100%') | 408 | .width('100%') |
| 403 | .height('100%') | 409 | .height('100%') |
| 404 | .backgroundColor($r('app.color.color_80000000')) | 410 | .backgroundColor($r('app.color.color_80000000')) |
| 405 | - .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM]) | 411 | + // .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM]) |
| 406 | .id('e_newspaper_container') | 412 | .id('e_newspaper_container') |
| 407 | 413 | ||
| 408 | if (this.isOpenListDialog) { | 414 | if (this.isOpenListDialog) { |
| @@ -430,7 +436,8 @@ export struct ENewspaperPageComponent { | @@ -430,7 +436,8 @@ export struct ENewspaperPageComponent { | ||
| 430 | private async getNewspaperList() { | 436 | private async getNewspaperList() { |
| 431 | try { | 437 | try { |
| 432 | if (NetworkUtil.isNetConnected()) { | 438 | if (NetworkUtil.isNetConnected()) { |
| 433 | - let listBean = await NewspaperViewModel.getNewspaperList(this.calendarDate, this.picWidth + 'x' + this.picHeight) | 439 | + let listBean = |
| 440 | + await NewspaperViewModel.getNewspaperList(this.calendarDate, this.picWidth + 'x' + this.picHeight) | ||
| 434 | this.newspaperListBean = listBean; | 441 | this.newspaperListBean = listBean; |
| 435 | } else { | 442 | } else { |
| 436 | this.showToastTip('网络出小差了,请检查网络后重试') | 443 | this.showToastTip('网络出小差了,请检查网络后重试') |
| @@ -442,21 +449,22 @@ export struct ENewspaperPageComponent { | @@ -442,21 +449,22 @@ export struct ENewspaperPageComponent { | ||
| 442 | 449 | ||
| 443 | share() { | 450 | share() { |
| 444 | let contentDetailData: ContentDetailDTO = { | 451 | 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, | 452 | + shareInfo: { |
| 453 | + shareTitle: this.newspaperListBean?.list[this.swiperIndex].pageName, | ||
| 454 | + appCustomPublishTime: this.newspaperListBean?.list[this.swiperIndex].periodNum, | ||
| 455 | + appCustomImageUrl: this.newspaperListBean?.list[this.swiperIndex].pagePic, | ||
| 456 | + shareUrl: this.newspaperListBean?.list[this.swiperIndex].sharePagePic.shareUrl, | ||
| 457 | + sharePosterCoverUrl: this.newspaperListBean?.list[this.swiperIndex].sharePagePic.sharePosterCoverUrl, | ||
| 458 | + appCustomShowReport: false, | ||
| 459 | + appCustomShowLike: -1, | ||
| 460 | + shareOpen: 1, | ||
| 461 | + sharePosterOpen: 1, | ||
| 462 | + appCustomPosterShareControl: '-1', | ||
| 463 | + appCustomShowPoster: -1, | ||
| 464 | + appCustomShowPosterType: 4, | ||
| 458 | } | 465 | } |
| 459 | } as ContentDetailDTO | 466 | } as ContentDetailDTO |
| 460 | - WDShare.shareContent(contentDetailData,TrackConstants.PageName.NewsPaperPage,TrackConstants.PageName.NewsPaperPage) | 467 | + WDShare.shareContent(contentDetailData, TrackConstants.PageName.NewsPaperPage, |
| 468 | + TrackConstants.PageName.NewsPaperPage) | ||
| 461 | } | 469 | } |
| 462 | } | 470 | } |
| @@ -61,6 +61,7 @@ export struct ImageAndTextPageComponent { | @@ -61,6 +61,7 @@ export struct ImageAndTextPageComponent { | ||
| 61 | @State likeNum: number = 0 | 61 | @State likeNum: number = 0 |
| 62 | @State reachEndIncreament: number = 0 | 62 | @State reachEndIncreament: number = 0 |
| 63 | @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 | 63 | @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 |
| 64 | + @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 | ||
| 64 | @State isScrollTop: boolean = true | 65 | @State isScrollTop: boolean = true |
| 65 | @State offsetY: number = 0 | 66 | @State offsetY: number = 0 |
| 66 | pageShowTime:number = 0; | 67 | pageShowTime:number = 0; |
| @@ -88,7 +89,7 @@ export struct ImageAndTextPageComponent { | @@ -88,7 +89,7 @@ export struct ImageAndTextPageComponent { | ||
| 88 | action: this.action, | 89 | action: this.action, |
| 89 | isPageEnd: $isPageEnd | 90 | isPageEnd: $isPageEnd |
| 90 | }) | 91 | }) |
| 91 | - .padding({ top: 15, bottom: 10 }) | 92 | + .padding({ bottom: 10 }) |
| 92 | Column() { | 93 | Column() { |
| 93 | // 点赞 | 94 | // 点赞 |
| 94 | if (this.contentDetailData?.openLikes && this.contentDetailData?.likesStyle !== 4) { | 95 | if (this.contentDetailData?.openLikes && this.contentDetailData?.likesStyle !== 4) { |
| @@ -159,8 +160,8 @@ export struct ImageAndTextPageComponent { | @@ -159,8 +160,8 @@ export struct ImageAndTextPageComponent { | ||
| 159 | } | 160 | } |
| 160 | .id('imgTextContainer') | 161 | .id('imgTextContainer') |
| 161 | } | 162 | } |
| 163 | + .padding({bottom: 44}) | ||
| 162 | .width(CommonConstants.FULL_WIDTH) | 164 | .width(CommonConstants.FULL_WIDTH) |
| 163 | - .height(CommonConstants.FULL_HEIGHT) | ||
| 164 | .scrollBar(BarState.Off) | 165 | .scrollBar(BarState.Off) |
| 165 | .align(Alignment.Top) | 166 | .align(Alignment.Top) |
| 166 | .onReachEnd(() => { | 167 | .onReachEnd(() => { |
| @@ -174,10 +175,10 @@ export struct ImageAndTextPageComponent { | @@ -174,10 +175,10 @@ export struct ImageAndTextPageComponent { | ||
| 174 | retry: () => { | 175 | retry: () => { |
| 175 | this.getDetail() | 176 | this.getDetail() |
| 176 | } | 177 | } |
| 177 | - }).padding({ bottom: 200 }) | 178 | + }).padding({ bottom: 44 }) |
| 178 | } else { | 179 | } else { |
| 179 | if (!this.isPageEnd) { | 180 | if (!this.isPageEnd) { |
| 180 | - detailedSkeleton().padding({ bottom: this.bottomSafeHeight }) | 181 | + detailedSkeleton().padding({ bottom: 44 }) |
| 181 | } | 182 | } |
| 182 | } | 183 | } |
| 183 | // 底部交互区 | 184 | // 底部交互区 |
| @@ -206,12 +207,10 @@ export struct ImageAndTextPageComponent { | @@ -206,12 +207,10 @@ export struct ImageAndTextPageComponent { | ||
| 206 | this.isScrollTop = !this.isScrollTop | 207 | this.isScrollTop = !this.isScrollTop |
| 207 | } | 208 | } |
| 208 | }) | 209 | }) |
| 209 | - .position({ y: '100%' }) | ||
| 210 | } | 210 | } |
| 211 | + .margin({top: `${this.topSafeHeight}px`, bottom: `${this.bottomSafeHeight}px`}) | ||
| 211 | .width(CommonConstants.FULL_WIDTH) | 212 | .width(CommonConstants.FULL_WIDTH) |
| 212 | - .height(CommonConstants.FULL_HEIGHT) | ||
| 213 | - .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM]) | ||
| 214 | - .padding({ top: 38 }) | 213 | + // .height(CommonConstants.FULL_HEIGHT) |
| 215 | 214 | ||
| 216 | // 发布时间 | 215 | // 发布时间 |
| 217 | Column() { | 216 | Column() { |
| @@ -242,6 +241,7 @@ export struct ImageAndTextPageComponent { | @@ -242,6 +241,7 @@ export struct ImageAndTextPageComponent { | ||
| 242 | .backgroundColor(Color.White) | 241 | .backgroundColor(Color.White) |
| 243 | }.backgroundColor(Color.White) | 242 | }.backgroundColor(Color.White) |
| 244 | } | 243 | } |
| 244 | + .margin({top: `${this.topSafeHeight}px`, bottom: `${this.bottomSafeHeight}px`}) | ||
| 245 | .width(CommonConstants.FULL_WIDTH) | 245 | .width(CommonConstants.FULL_WIDTH) |
| 246 | .height(CommonConstants.FULL_HEIGHT) | 246 | .height(CommonConstants.FULL_HEIGHT) |
| 247 | .backgroundColor(Color.White) | 247 | .backgroundColor(Color.White) |
| @@ -86,7 +86,7 @@ export struct MorningEveningPaperComponent { | @@ -86,7 +86,7 @@ export struct MorningEveningPaperComponent { | ||
| 86 | offset: { dx: 12, dy: -150 }, | 86 | offset: { dx: 12, dy: -150 }, |
| 87 | 87 | ||
| 88 | }) | 88 | }) |
| 89 | - // private AudioSuspension = new AudioSuspensionModel() | 89 | + private AudioSuspension = new AudioSuspensionModel() |
| 90 | 90 | ||
| 91 | onCancel() { | 91 | onCancel() { |
| 92 | Logger.info(TAG, "cj2024 onCancel = ") | 92 | Logger.info(TAG, "cj2024 onCancel = ") |
| @@ -149,19 +149,22 @@ export struct MorningEveningPaperComponent { | @@ -149,19 +149,22 @@ export struct MorningEveningPaperComponent { | ||
| 149 | Logger.info(TAG, "pageInfoBean dateTime = " + dateTime) | 149 | Logger.info(TAG, "pageInfoBean dateTime = " + dateTime) |
| 150 | Logger.info(TAG, "pageInfoBean subTitle = " + this.subTitle) | 150 | Logger.info(TAG, "pageInfoBean subTitle = " + this.subTitle) |
| 151 | 151 | ||
| 152 | + Logger.info(TAG, "this.pageInfoBean = " + JSON.stringify(this.pageInfoBean)) | ||
| 153 | + | ||
| 152 | this.isHasTopView = this.pageInfoBean?.topicInfo?.frontLinkObject?true:false | 154 | this.isHasTopView = this.pageInfoBean?.topicInfo?.frontLinkObject?true:false |
| 153 | let coverUrl = this.isHasTopView?this.pageInfoBean?.topicInfo?.frontLinkObject?.coverUrl as string :'' | 155 | let coverUrl = this.isHasTopView?this.pageInfoBean?.topicInfo?.frontLinkObject?.coverUrl as string :'' |
| 154 | this.setComponentBgColor(coverUrl) | 156 | this.setComponentBgColor(coverUrl) |
| 155 | 157 | ||
| 156 | let compInfoBean = await MorningEveningViewModel.getMorningEveningCompInfo(pageInfoBean?.id, pageInfoBean?.groups[0]?.id, currentTime + "", pageInfoBean?.topicInfo?.topicId) | 158 | let compInfoBean = await MorningEveningViewModel.getMorningEveningCompInfo(pageInfoBean?.id, pageInfoBean?.groups[0]?.id, currentTime + "", pageInfoBean?.topicInfo?.topicId) |
| 157 | // this.compInfoBean = compInfoBean | 159 | // this.compInfoBean = compInfoBean |
| 160 | + Logger.info(TAG, "compInfoBean = " + JSON.stringify(compInfoBean)) | ||
| 158 | if (compInfoBean?.compList[0]) { | 161 | if (compInfoBean?.compList[0]) { |
| 159 | this.compListItem = compInfoBean?.compList[0] | 162 | this.compListItem = compInfoBean?.compList[0] |
| 160 | Logger.debug(TAG, '获取评论数据' + `${this.compListItem.operDataList.length}`) | 163 | Logger.debug(TAG, '获取评论数据' + `${this.compListItem.operDataList.length}`) |
| 161 | if (this.compListItem.operDataList && this.compListItem.operDataList.length > 0) { | 164 | if (this.compListItem.operDataList && this.compListItem.operDataList.length > 0) { |
| 162 | this.getAllContentInteractData(this.compListItem.operDataList) | 165 | this.getAllContentInteractData(this.compListItem.operDataList) |
| 163 | } | 166 | } |
| 164 | - Logger.debug('compInfoBean?.compList[0].audioDataList', JSON.stringify(compInfoBean?.compList[0].audioDataList)) | 167 | + Logger.debug(TAG, 'compInfoBean?.compList[0].audioDataList', JSON.stringify(compInfoBean?.compList[0].audioDataList)) |
| 165 | if (compInfoBean?.compList[0].audioDataList) { | 168 | if (compInfoBean?.compList[0].audioDataList) { |
| 166 | this.audioPlayUrl = compInfoBean?.compList[0].audioDataList[0].audioUrl | 169 | this.audioPlayUrl = compInfoBean?.compList[0].audioDataList[0].audioUrl |
| 167 | this.audioTitle = compInfoBean?.compList[0].audioDataList[0].title | 170 | this.audioTitle = compInfoBean?.compList[0].audioDataList[0].title |
| @@ -258,12 +261,11 @@ export struct MorningEveningPaperComponent { | @@ -258,12 +261,11 @@ export struct MorningEveningPaperComponent { | ||
| 258 | topicInfoView({ frontLinkObject: this.pageInfoBean?.topicInfo?.frontLinkObject }) | 261 | topicInfoView({ frontLinkObject: this.pageInfoBean?.topicInfo?.frontLinkObject }) |
| 259 | } | 262 | } |
| 260 | 263 | ||
| 261 | - //暂时不展示音频播报 | ||
| 262 | - // if (this.audioPlayUrl.length > 0){ | ||
| 263 | - // ListItem() { | ||
| 264 | - // this.AudioBarView(this.simpleAudioDialog) | ||
| 265 | - // } | ||
| 266 | - // } | 264 | + if (this.audioPlayUrl !== ""){ |
| 265 | + ListItem() { | ||
| 266 | + this.AudioBarView() | ||
| 267 | + } | ||
| 268 | + } | ||
| 267 | } | 269 | } |
| 268 | 270 | ||
| 269 | ListItem() { | 271 | ListItem() { |
| @@ -307,7 +309,7 @@ export struct MorningEveningPaperComponent { | @@ -307,7 +309,7 @@ export struct MorningEveningPaperComponent { | ||
| 307 | } | 309 | } |
| 308 | 310 | ||
| 309 | @Builder | 311 | @Builder |
| 310 | - AudioBarView(dialog: CustomDialogController) { | 312 | + AudioBarView() { |
| 311 | Row() { | 313 | Row() { |
| 312 | Stack({ alignContent: Alignment.Start }) { | 314 | Stack({ alignContent: Alignment.Start }) { |
| 313 | Image($r('app.media.listen_left_bg')) | 315 | Image($r('app.media.listen_left_bg')) |
| @@ -320,7 +322,7 @@ export struct MorningEveningPaperComponent { | @@ -320,7 +322,7 @@ export struct MorningEveningPaperComponent { | ||
| 320 | .margin({ left: 10 }) | 322 | .margin({ left: 10 }) |
| 321 | .alignSelf(ItemAlign.Start) | 323 | .alignSelf(ItemAlign.Start) |
| 322 | 324 | ||
| 323 | - Text('晚上好, 请收听今日新闻播报') | 325 | + Text(`${this.pageInfoBean.topicInfo.topicPattern === 1 ? '早上好' : this.pageInfoBean.topicInfo.topicPattern === 2 ? '中午好' : '晚上好'}, 请收听今日新闻播报`) |
| 324 | .fontSize(14) | 326 | .fontSize(14) |
| 325 | .margin({ left: 50 }) | 327 | .margin({ left: 50 }) |
| 326 | .fontColor(Color.Black) | 328 | .fontColor(Color.Black) |
| @@ -345,7 +347,7 @@ export struct MorningEveningPaperComponent { | @@ -345,7 +347,7 @@ export struct MorningEveningPaperComponent { | ||
| 345 | Logger.info("TAG", "cj compInfoBean onClick1 = " + this.isAudioPlaying) | 347 | Logger.info("TAG", "cj compInfoBean onClick1 = " + this.isAudioPlaying) |
| 346 | // dialog.open() | 348 | // dialog.open() |
| 347 | // this.playerController.firstPlay(this.audioPlayUrl, this.audioTitle) | 349 | // this.playerController.firstPlay(this.audioPlayUrl, this.audioTitle) |
| 348 | - // this.AudioSuspension.setPlayerUrl(this.audioPlayUrl, this.audioTitle) | 350 | + this.AudioSuspension.setPlayerUrl(this.audioPlayUrl, this.audioTitle) |
| 349 | Logger.info(TAG, "this.audioPlayUrl = " + this.audioPlayUrl) | 351 | Logger.info(TAG, "this.audioPlayUrl = " + this.audioPlayUrl) |
| 350 | Logger.info("TAG", "cj compInfoBean onClick2 = " + this.isAudioPlaying) | 352 | Logger.info("TAG", "cj compInfoBean onClick2 = " + this.isAudioPlaying) |
| 351 | }) | 353 | }) |
| @@ -216,7 +216,7 @@ export struct SpacialTopicPageComponent { | @@ -216,7 +216,7 @@ export struct SpacialTopicPageComponent { | ||
| 216 | 216 | ||
| 217 | aboutToAppear() { | 217 | aboutToAppear() { |
| 218 | if (!this.action?.params?.backVisibility) { | 218 | if (!this.action?.params?.backVisibility) { |
| 219 | - WindowModel.shared.setWindowLayoutFullScreen(true) | 219 | + // WindowModel.shared.setWindowLayoutFullScreen(true) |
| 220 | } | 220 | } |
| 221 | this.webUrl = this.action?.params?.url || '' | 221 | this.webUrl = this.action?.params?.url || '' |
| 222 | this.getDetail() | 222 | this.getDetail() |
| @@ -224,7 +224,7 @@ export struct SpacialTopicPageComponent { | @@ -224,7 +224,7 @@ export struct SpacialTopicPageComponent { | ||
| 224 | 224 | ||
| 225 | aboutToDisappear() { | 225 | aboutToDisappear() { |
| 226 | if (!this.action?.params?.backVisibility) { | 226 | if (!this.action?.params?.backVisibility) { |
| 227 | - WindowModel.shared.setWindowLayoutFullScreen(false) | 227 | + // WindowModel.shared.setWindowLayoutFullScreen(false) |
| 228 | } | 228 | } |
| 229 | } | 229 | } |
| 230 | } | 230 | } |
sight_harmony/features/wdComponent/src/main/ets/components/comment/view/QualityCommentsComponent.ets
| @@ -112,13 +112,12 @@ export struct QualityCommentsComponent { | @@ -112,13 +112,12 @@ export struct QualityCommentsComponent { | ||
| 112 | Image($r('app.media.comment_img_banner')).width('100%') | 112 | Image($r('app.media.comment_img_banner')).width('100%') |
| 113 | .height(283) | 113 | .height(283) |
| 114 | // .aspectRatio(375 / 283); | 114 | // .aspectRatio(375 / 283); |
| 115 | - .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP]) | ||
| 116 | } | 115 | } |
| 117 | .onAreaChange((oldValue: Area, newValue: Area) => { | 116 | .onAreaChange((oldValue: Area, newValue: Area) => { |
| 118 | - if (Number(oldValue.globalPosition.y) == 0 && Number(newValue.globalPosition.y) > 30) { | ||
| 119 | - this.firstPositionY = Number(newValue.globalPosition.y) | ||
| 120 | - return | ||
| 121 | - } | 117 | + // if (Number(oldValue.globalPosition.y) == 0 && Number(newValue.globalPosition.y) > 30) { |
| 118 | + // this.firstPositionY = Number(newValue.globalPosition.y) | ||
| 119 | + // return | ||
| 120 | + // } | ||
| 122 | Logger.debug(TAG, "oldValue.globalPosition.y : " + oldValue.globalPosition.y) | 121 | Logger.debug(TAG, "oldValue.globalPosition.y : " + oldValue.globalPosition.y) |
| 123 | Logger.debug(TAG, | 122 | Logger.debug(TAG, |
| 124 | "newValue.globalPosition.y : " + newValue.globalPosition.y + `,this.topSafeHeight : ` + this.topSafeHeight) | 123 | "newValue.globalPosition.y : " + newValue.globalPosition.y + `,this.topSafeHeight : ` + this.topSafeHeight) |
| @@ -128,9 +127,16 @@ export struct QualityCommentsComponent { | @@ -128,9 +127,16 @@ export struct QualityCommentsComponent { | ||
| 128 | persent = 1 | 127 | persent = 1 |
| 129 | } | 128 | } |
| 130 | this.tileOpacity = persent | 129 | this.tileOpacity = persent |
| 131 | - | 130 | + this.topOpacityChange() |
| 132 | }) | 131 | }) |
| 133 | } | 132 | } |
| 133 | + topOpacityChange(){ | ||
| 134 | + if(this.tileOpacity > 0.8){ | ||
| 135 | + WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', }) | ||
| 136 | + }else{ | ||
| 137 | + WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff'}) | ||
| 138 | + } | ||
| 139 | + } | ||
| 134 | 140 | ||
| 135 | /*透明导航栏*/ | 141 | /*透明导航栏*/ |
| 136 | @Builder | 142 | @Builder |
| @@ -164,16 +170,20 @@ export struct QualityCommentsComponent { | @@ -164,16 +170,20 @@ export struct QualityCommentsComponent { | ||
| 164 | @Builder | 170 | @Builder |
| 165 | TabbarNormal() { | 171 | TabbarNormal() { |
| 166 | Stack({ alignContent: Alignment.Top }) { | 172 | Stack({ alignContent: Alignment.Top }) { |
| 173 | + //// 默认显示的白色返回按钮 | ||
| 167 | Row() { | 174 | Row() { |
| 168 | - } | ||
| 169 | - .width('100%') | ||
| 170 | - .height(px2vp(this.topSafeHeight)) | ||
| 171 | - .backgroundColor($r('app.color.white')) | ||
| 172 | - .opacity(this.tileOpacity) | ||
| 173 | - .visibility(this.tileOpacity > 0 ? 0 : 1) | ||
| 174 | - .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP]) | 175 | + Image($r('app.media.icon_arrow_left_white')) |
| 176 | + .width(24).height(24) | ||
| 177 | + .objectFit(ImageFit.Auto) | ||
| 178 | + .margin({ left: 16, top: px2vp(this.topSafeHeight) + (44 - 24)/2}) | ||
| 179 | + .onClick(() => { | ||
| 180 | + router.back() | ||
| 181 | + }) | ||
| 182 | + }.width('100%').height(px2vp(this.topSafeHeight) + 44) | ||
| 183 | + .opacity(1- this.tileOpacity) | ||
| 175 | 184 | ||
| 176 | - Stack({ alignContent: Alignment.Start }) { | 185 | + //// 上滑显示的黑色按钮和标题 |
| 186 | + Stack({ alignContent: Alignment.Top }) { | ||
| 177 | Row() { | 187 | Row() { |
| 178 | Text('精选评论')// .height('42lpx') | 188 | Text('精选评论')// .height('42lpx') |
| 179 | .maxLines(1) | 189 | .maxLines(1) |
| @@ -182,25 +192,25 @@ export struct QualityCommentsComponent { | @@ -182,25 +192,25 @@ export struct QualityCommentsComponent { | ||
| 182 | .fontWeight(400) | 192 | .fontWeight(400) |
| 183 | .fontColor($r('app.color.color_222222')) | 193 | .fontColor($r('app.color.color_222222')) |
| 184 | .lineHeight('42lpx') | 194 | .lineHeight('42lpx') |
| 185 | - .visibility(this.tileOpacity < 0.8 ? 1 : 0) | ||
| 186 | } | 195 | } |
| 187 | - .height(44) | ||
| 188 | - .width('100%') | 196 | + .height(44).width('100%') |
| 189 | .justifyContent(FlexAlign.Center) | 197 | .justifyContent(FlexAlign.Center) |
| 190 | .alignItems(VerticalAlign.Center) | 198 | .alignItems(VerticalAlign.Center) |
| 191 | - .opacity(this.tileOpacity) | ||
| 192 | - .backgroundColor($r('app.color.white')) | ||
| 193 | - | ||
| 194 | - Image(this.tileOpacity < 0.8 ? $r('app.media.icon_arrow_left_white') : $r('app.media.icon_arrow_left')) | ||
| 195 | - .width(24) | ||
| 196 | - .height(24) | ||
| 197 | - .objectFit(ImageFit.Auto) | ||
| 198 | - .margin({ left: 16 }) | ||
| 199 | - .onClick(() => { | ||
| 200 | - router.back() | ||
| 201 | - }) | ||
| 202 | 199 | ||
| 200 | + Row() { | ||
| 201 | + Image($r('app.media.icon_arrow_left')) | ||
| 202 | + .width(24).height(24) | ||
| 203 | + .objectFit(ImageFit.Auto) | ||
| 204 | + .margin({ left: 16, top: (44-24)/2}) | ||
| 205 | + .onClick(() => { | ||
| 206 | + router.back() | ||
| 207 | + }) | ||
| 208 | + }.height(44).width('100%') | ||
| 203 | } | 209 | } |
| 210 | + .width('100%').height(px2vp(this.topSafeHeight) + 44) | ||
| 211 | + .backgroundColor($r('app.color.white')) | ||
| 212 | + .opacity(this.tileOpacity) | ||
| 213 | + .padding({top:px2vp(this.topSafeHeight)}) | ||
| 204 | } | 214 | } |
| 205 | 215 | ||
| 206 | } | 216 | } |
| @@ -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 | } |
| @@ -113,9 +113,11 @@ export struct TopNavigationComponentNew { | @@ -113,9 +113,11 @@ export struct TopNavigationComponentNew { | ||
| 113 | 'middle': { 'anchor': '__container__', 'align': HorizontalAlign.Center }, | 113 | 'middle': { 'anchor': '__container__', 'align': HorizontalAlign.Center }, |
| 114 | 'bottom': { 'anchor': '__container__', 'align': VerticalAlign.Bottom } | 114 | 'bottom': { 'anchor': '__container__', 'align': VerticalAlign.Bottom } |
| 115 | }) | 115 | }) |
| 116 | - .onChange((index) => { | ||
| 117 | - Logger.info(TAG, `onChange index : ${index}`); | ||
| 118 | - | 116 | + .onAnimationStart((curIndex: number, index: number)=>{ |
| 117 | + Logger.info(TAG, `onAnimationStart ${curIndex} ${index}`); | ||
| 118 | + if (curIndex === index) { | ||
| 119 | + return | ||
| 120 | + } | ||
| 119 | if (this.isBroadcastByIndex(index)) { | 121 | if (this.isBroadcastByIndex(index)) { |
| 120 | // 跳转到播报页面 | 122 | // 跳转到播报页面 |
| 121 | ProcessUtils.gotoBroadcastPage(this.myChannelList[index].pageId) | 123 | ProcessUtils.gotoBroadcastPage(this.myChannelList[index].pageId) |
| @@ -133,7 +135,12 @@ export struct TopNavigationComponentNew { | @@ -133,7 +135,12 @@ export struct TopNavigationComponentNew { | ||
| 133 | this.currentTopNavSelectedIndex = index; | 135 | this.currentTopNavSelectedIndex = index; |
| 134 | this.changePage(this.currentTopNavSelectedIndex) | 136 | this.changePage(this.currentTopNavSelectedIndex) |
| 135 | } | 137 | } |
| 136 | - | 138 | + }) |
| 139 | + // .onAnimationEnd((index: number)=>{ | ||
| 140 | + // Logger.info(TAG, `onAnimationEnd ${index}`); | ||
| 141 | + // }) | ||
| 142 | + .onChange((index) => { | ||
| 143 | + Logger.info(TAG, `onChange index : ${index}`); | ||
| 137 | }) | 144 | }) |
| 138 | } | 145 | } |
| 139 | .width('100%') | 146 | .width('100%') |
| 1 | import router from '@ohos.router' | 1 | import router from '@ohos.router' |
| 2 | -import { BreakpointSystem, NetworkUtil, StringUtils, ToastUtils } from 'wdKit' | 2 | +import { BreakpointSystem, DateTimeUtils, NetworkUtil, StringUtils, ToastUtils } from 'wdKit' |
| 3 | import { ParamType, TrackConstants, Tracking } from 'wdTracking/Index' | 3 | import { ParamType, TrackConstants, Tracking } from 'wdTracking/Index' |
| 4 | import SearcherAboutDataModel from '../../model/SearcherAboutDataModel' | 4 | import SearcherAboutDataModel from '../../model/SearcherAboutDataModel' |
| 5 | import { SearchHistoryItem } from '../../viewmodel/SearchHistoryItem' | 5 | import { SearchHistoryItem } from '../../viewmodel/SearchHistoryItem' |
| @@ -32,6 +32,7 @@ export struct SearchComponent { | @@ -32,6 +32,7 @@ export struct SearchComponent { | ||
| 32 | @State count:string[] = [] | 32 | @State count:string[] = [] |
| 33 | @State isGetRequest:boolean = false | 33 | @State isGetRequest:boolean = false |
| 34 | @Link fromTabName: string | 34 | @Link fromTabName: string |
| 35 | + @State sameSearch:number = 0 //再次搜索 | ||
| 35 | 36 | ||
| 36 | @StorageProp('currentBreakpoint') @Watch("currentChanged")currentBreakpoint: string = 'sm'; | 37 | @StorageProp('currentBreakpoint') @Watch("currentChanged")currentBreakpoint: string = 'sm'; |
| 37 | private breakpointSystem = new BreakpointSystem(); | 38 | private breakpointSystem = new BreakpointSystem(); |
| @@ -175,7 +176,7 @@ export struct SearchComponent { | @@ -175,7 +176,7 @@ export struct SearchComponent { | ||
| 175 | this.getSearchHistoryData() | 176 | this.getSearchHistoryData() |
| 176 | this.getSearchInputResData(this.searchText) | 177 | this.getSearchInputResData(this.searchText) |
| 177 | } | 178 | } |
| 178 | - },percent:this.percent}) | 179 | + },percent:this.percent,sameSearch:this.sameSearch}) |
| 179 | } else { | 180 | } else { |
| 180 | //联想搜索 | 181 | //联想搜索 |
| 181 | SearchRelatedComponent({relatedSearchContentData:$relatedSearchContentsData,onGetSearchRes: (item): void => this.getSearchRelatedResData(item),searchText:this.searchText,percent:this.percent}) | 182 | SearchRelatedComponent({relatedSearchContentData:$relatedSearchContentsData,onGetSearchRes: (item): void => this.getSearchRelatedResData(item),searchText:this.searchText,percent:this.percent}) |
| @@ -402,6 +403,7 @@ export struct SearchComponent { | @@ -402,6 +403,7 @@ export struct SearchComponent { | ||
| 402 | } | 403 | } |
| 403 | this.isGetRequest = true | 404 | this.isGetRequest = true |
| 404 | this.resetSearch() | 405 | this.resetSearch() |
| 406 | + this.sameSearch = DateTimeUtils.getTimeStamp() | ||
| 405 | }).catch((err: Error) => { | 407 | }).catch((err: Error) => { |
| 406 | console.log(TAG, JSON.stringify(err)) | 408 | console.log(TAG, JSON.stringify(err)) |
| 407 | this.isGetRequest = true | 409 | this.isGetRequest = true |
| @@ -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) |
| @@ -29,6 +29,8 @@ export struct SearchResultComponent { | @@ -29,6 +29,8 @@ export struct SearchResultComponent { | ||
| 29 | onClickTryAgain?: () => void; | 29 | onClickTryAgain?: () => void; |
| 30 | @State isConnectNetwork : boolean = NetworkUtil.isNetConnected() | 30 | @State isConnectNetwork : boolean = NetworkUtil.isNetConnected() |
| 31 | @Prop percent:number = 1 | 31 | @Prop percent:number = 1 |
| 32 | + @Prop sameSearch:number = 0 | ||
| 33 | + | ||
| 32 | 34 | ||
| 33 | aboutToAppear(): void { | 35 | aboutToAppear(): void { |
| 34 | if (this.count.length === 0 && this.isGetRequest == true) { | 36 | if (this.count.length === 0 && this.isGetRequest == true) { |
| @@ -137,7 +139,7 @@ export struct SearchResultComponent { | @@ -137,7 +139,7 @@ export struct SearchResultComponent { | ||
| 137 | Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { | 139 | Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { |
| 138 | ForEach(this.count, (item: string, index: number) => { | 140 | ForEach(this.count, (item: string, index: number) => { |
| 139 | TabContent() { | 141 | TabContent() { |
| 140 | - SearchResultContentComponent({ keywords: this.searchText, searchType: item }) | 142 | + SearchResultContentComponent({ keywords: this.searchText, searchType: item ,sameSearch:this.sameSearch,isCurrentShow:this.currentIndex === index}) |
| 141 | }.tabBar(this.TabBuilder(index, item)) | 143 | }.tabBar(this.TabBuilder(index, item)) |
| 142 | .layoutWeight(1) | 144 | .layoutWeight(1) |
| 143 | }, (item: string, index: number) => index.toString()) | 145 | }, (item: string, index: number) => index.toString()) |
| @@ -51,7 +51,22 @@ export struct SearchResultContentComponent { | @@ -51,7 +51,22 @@ export struct SearchResultContentComponent { | ||
| 51 | @State moreWidth:number = 20 | 51 | @State moreWidth:number = 20 |
| 52 | @State listLeft: number = 0 | 52 | @State listLeft: number = 0 |
| 53 | @State isEnd: boolean = false | 53 | @State isEnd: boolean = false |
| 54 | + @Watch('updateData') @Prop sameSearch:number = 0 | ||
| 55 | + @Prop isCurrentShow:boolean = false; | ||
| 54 | 56 | ||
| 57 | + updateData(){ | ||
| 58 | + if(this.isCurrentShow){ | ||
| 59 | + this.data_rmh = [] | ||
| 60 | + | ||
| 61 | + this.data.clearAllData() | ||
| 62 | + | ||
| 63 | + this.curPageNum = 1 | ||
| 64 | + this.hasMore = true | ||
| 65 | + this.isLoading = false | ||
| 66 | + this.getNewSearchResultData() | ||
| 67 | + } | ||
| 68 | + | ||
| 69 | + } | ||
| 55 | 70 | ||
| 56 | aboutToAppear(): void { | 71 | aboutToAppear(): void { |
| 57 | if (this.searchType == "全部") { | 72 | if (this.searchType == "全部") { |
| @@ -241,7 +241,7 @@ export struct OperRowListView { | @@ -241,7 +241,7 @@ export struct OperRowListView { | ||
| 241 | .padding({ | 241 | .padding({ |
| 242 | top: 10, | 242 | top: 10, |
| 243 | // bottom: 10 | 243 | // bottom: 10 |
| 244 | - bottom: `${this.bottomSafeHeight}px` | 244 | + bottom: px2vp(this.bottomSafeHeight) |
| 245 | // bottom: 50 | 245 | // bottom: 50 |
| 246 | }) | 246 | }) |
| 247 | } | 247 | } |
| @@ -18,6 +18,7 @@ export struct ENewspaperListDialog { | @@ -18,6 +18,7 @@ export struct ENewspaperListDialog { | ||
| 18 | private listScroller: Scroller = new Scroller() | 18 | private listScroller: Scroller = new Scroller() |
| 19 | @State scrollOffset: number = 0 | 19 | @State scrollOffset: number = 0 |
| 20 | @State isCurrentViewOpen: boolean = false | 20 | @State isCurrentViewOpen: boolean = false |
| 21 | + @Consume bottomSafeHeight:number | ||
| 21 | //文字版选择弹框 | 22 | //文字版选择弹框 |
| 22 | pageListDialogController: CustomDialogController = new CustomDialogController({ | 23 | pageListDialogController: CustomDialogController = new CustomDialogController({ |
| 23 | builder: ENewspaperPageDialog({ | 24 | builder: ENewspaperPageDialog({ |
| @@ -266,13 +267,13 @@ export struct ENewspaperListDialog { | @@ -266,13 +267,13 @@ export struct ENewspaperListDialog { | ||
| 266 | left: 15, | 267 | left: 15, |
| 267 | right: 15, | 268 | right: 15, |
| 268 | // top: 16, | 269 | // top: 16, |
| 269 | - bottom: 16 | 270 | + // bottom: 16 |
| 270 | }) | 271 | }) |
| 271 | .margin({ | 272 | .margin({ |
| 272 | bottom: 85 | 273 | bottom: 85 |
| 273 | }) | 274 | }) |
| 274 | .scrollBar(BarState.Off) | 275 | .scrollBar(BarState.Off) |
| 275 | - .edgeEffect(EdgeEffect.None) | 276 | + .edgeEffect(EdgeEffect.Spring) |
| 276 | .onScrollIndex((firstIndex: number, lastIndex: number, centerIndex: number) => { | 277 | .onScrollIndex((firstIndex: number, lastIndex: number, centerIndex: number) => { |
| 277 | console.info('ENewspaperListDialog::first' + firstIndex) | 278 | console.info('ENewspaperListDialog::first' + firstIndex) |
| 278 | console.info('ENewspaperListDialog::last' + lastIndex) | 279 | console.info('ENewspaperListDialog::last' + lastIndex) |
| @@ -288,19 +289,14 @@ export struct ENewspaperListDialog { | @@ -288,19 +289,14 @@ export struct ENewspaperListDialog { | ||
| 288 | // } | 289 | // } |
| 289 | }) | 290 | }) |
| 290 | } | 291 | } |
| 291 | - // .margin({ top: 124 }) | ||
| 292 | .margin({ top: this.topHeight }) | 292 | .margin({ top: this.topHeight }) |
| 293 | - | ||
| 294 | .width('100%') | 293 | .width('100%') |
| 295 | .backgroundColor(Color.White) | 294 | .backgroundColor(Color.White) |
| 296 | - .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM]) | ||
| 297 | - .onClick(() => { | ||
| 298 | 295 | ||
| 299 | - }) | ||
| 300 | }.width('100%') | 296 | }.width('100%') |
| 301 | .height('100%') | 297 | .height('100%') |
| 302 | .backgroundColor('#80000000') | 298 | .backgroundColor('#80000000') |
| 303 | - .margin({bottom:44}) | 299 | + .margin({bottom:50}) |
| 304 | .onClick(() => { | 300 | .onClick(() => { |
| 305 | if (this.closeDialog) { | 301 | if (this.closeDialog) { |
| 306 | this.closeDialog() | 302 | this.closeDialog() |
| @@ -214,12 +214,7 @@ struct MineHomePage { | @@ -214,12 +214,7 @@ struct MineHomePage { | ||
| 214 | .fontWeight('400lpx') | 214 | .fontWeight('400lpx') |
| 215 | .fontColor(this.isHasIntroduction?$r('app.color.color_222222'):$r('app.color.color_999999')) | 215 | .fontColor(this.isHasIntroduction?$r('app.color.color_222222'):$r('app.color.color_999999')) |
| 216 | .textAlign(TextAlign.Start) | 216 | .textAlign(TextAlign.Start) |
| 217 | - .onClick(()=>{ | ||
| 218 | - let params: editModelParams = { | ||
| 219 | - editContent: this.isHasIntroduction?this.desc:'' | ||
| 220 | - } | ||
| 221 | - WDRouterRule.jumpWithPage(WDRouterPage.editUserIntroductionPage,params) | ||
| 222 | - }) | 217 | + |
| 223 | if(!this.isHasIntroduction){ | 218 | if(!this.isHasIntroduction){ |
| 224 | Image($r('app.media.user_info_edit_icon')) | 219 | Image($r('app.media.user_info_edit_icon')) |
| 225 | .width('27lpx') | 220 | .width('27lpx') |
| @@ -227,7 +222,12 @@ struct MineHomePage { | @@ -227,7 +222,12 @@ struct MineHomePage { | ||
| 227 | .interpolation(ImageInterpolation.High) | 222 | .interpolation(ImageInterpolation.High) |
| 228 | .objectFit(ImageFit.Auto) | 223 | .objectFit(ImageFit.Auto) |
| 229 | } | 224 | } |
| 230 | - } | 225 | + }.onClick(()=>{ |
| 226 | + let params: editModelParams = { | ||
| 227 | + editContent: this.isHasIntroduction?this.desc:'' | ||
| 228 | + } | ||
| 229 | + WDRouterRule.jumpWithPage(WDRouterPage.editUserIntroductionPage,params) | ||
| 230 | + }) | ||
| 231 | 231 | ||
| 232 | 232 | ||
| 233 | Text(`来到人民日报${this.registerTimeForDay}天`) | 233 | Text(`来到人民日报${this.registerTimeForDay}天`) |
| @@ -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 |
| @@ -7,10 +7,9 @@ import mediaquery from '@ohos.mediaquery'; | @@ -7,10 +7,9 @@ import mediaquery from '@ohos.mediaquery'; | ||
| 7 | import { Logger, WindowModel } from 'wdKit/Index'; | 7 | import { Logger, WindowModel } from 'wdKit/Index'; |
| 8 | import { router, window } from '@kit.ArkUI'; | 8 | import { router, window } from '@kit.ArkUI'; |
| 9 | import { WDAliPlayerController } from 'wdPlayer/Index'; | 9 | import { WDAliPlayerController } from 'wdPlayer/Index'; |
| 10 | -import { LiveEmptyComponent, LiveOperRowListView } from 'wdComponent'; | 10 | +import { LiveOperRowListView } from 'wdComponent'; |
| 11 | import { publishCommentModel } from 'wdComponent/src/main/ets/components/comment/model/PublishCommentModel'; | 11 | import { publishCommentModel } from 'wdComponent/src/main/ets/components/comment/model/PublishCommentModel'; |
| 12 | import { TrackConstants, TrackingContent, TrackParamConvert } from 'wdTracking/Index'; | 12 | import { TrackConstants, TrackingContent, TrackParamConvert } from 'wdTracking/Index'; |
| 13 | -import { LiveDetailPageLogic } from '../viewModel/LiveDetailPageLogic'; | ||
| 14 | 13 | ||
| 15 | let TAG: string = 'DetailPlayLivePage'; | 14 | let TAG: string = 'DetailPlayLivePage'; |
| 16 | 15 | ||
| @@ -57,7 +56,6 @@ export struct DetailPlayLivePage { | @@ -57,7 +56,6 @@ export struct DetailPlayLivePage { | ||
| 57 | this.getLiveDetails() | 56 | this.getLiveDetails() |
| 58 | this.getLiveRoomData() | 57 | this.getLiveRoomData() |
| 59 | 58 | ||
| 60 | - console.error(TAG, 'this.publishCommentModel', this.publishCommentModel.targetId) | ||
| 61 | } | 59 | } |
| 62 | 60 | ||
| 63 | async aboutToDisappear() { | 61 | async aboutToDisappear() { |
| @@ -306,12 +306,13 @@ export struct PlayUIComponent { | @@ -306,12 +306,13 @@ export struct PlayUIComponent { | ||
| 306 | .width(24) | 306 | .width(24) |
| 307 | .height(24) | 307 | .height(24) |
| 308 | .onClick(() => { | 308 | .onClick(() => { |
| 309 | + | ||
| 310 | + WindowModel.shared.setSpecificSystemBarEnabled(false) | ||
| 311 | + | ||
| 309 | this.displayDirection = | 312 | this.displayDirection = |
| 310 | this.displayDirection == DisplayDirection.VERTICAL ? DisplayDirection.VIDEO_HORIZONTAL : | 313 | this.displayDirection == DisplayDirection.VERTICAL ? DisplayDirection.VIDEO_HORIZONTAL : |
| 311 | DisplayDirection.VERTICAL | 314 | DisplayDirection.VERTICAL |
| 312 | 315 | ||
| 313 | - WindowModel.shared.setSpecificSystemBarEnabled(false) | ||
| 314 | - | ||
| 315 | WindowModel.shared.setPreferredOrientation(this.displayDirection == DisplayDirection.VERTICAL ? | 316 | WindowModel.shared.setPreferredOrientation(this.displayDirection == DisplayDirection.VERTICAL ? |
| 316 | window.Orientation.PORTRAIT : | 317 | window.Orientation.PORTRAIT : |
| 317 | window.Orientation.LANDSCAPE_INVERTED) | 318 | window.Orientation.LANDSCAPE_INVERTED) |
| @@ -35,6 +35,17 @@ export struct TopPlayComponent { | @@ -35,6 +35,17 @@ export struct TopPlayComponent { | ||
| 35 | private playUrl: string = "" | 35 | private playUrl: string = "" |
| 36 | private xComponentIsLoaded: boolean = false | 36 | private xComponentIsLoaded: boolean = false |
| 37 | @Consume liveDetailPageLogic: LiveDetailPageLogic | 37 | @Consume liveDetailPageLogic: LiveDetailPageLogic |
| 38 | + @Consume @Watch('pageShowChange') pageShow: number | ||
| 39 | + @Consume @Watch('pageHideChange') pageHide: number | ||
| 40 | + init: boolean = false | ||
| 41 | + | ||
| 42 | + pageShowChange() { | ||
| 43 | + this.playerController?.play() | ||
| 44 | + } | ||
| 45 | + | ||
| 46 | + pageHideChange() { | ||
| 47 | + this.playerController?.pause() | ||
| 48 | + } | ||
| 38 | 49 | ||
| 39 | aboutToAppear(): void { | 50 | aboutToAppear(): void { |
| 40 | if (this.playerController) { | 51 | if (this.playerController) { |
| @@ -71,7 +82,7 @@ export struct TopPlayComponent { | @@ -71,7 +82,7 @@ export struct TopPlayComponent { | ||
| 71 | updateData() { | 82 | updateData() { |
| 72 | 83 | ||
| 73 | // 检测垫片 | 84 | // 检测垫片 |
| 74 | - if (this.liveDetailPageLogic.showPad){ | 85 | + if (this.liveDetailPageLogic.showPad) { |
| 75 | this.isHideLoading = true | 86 | this.isHideLoading = true |
| 76 | this.isWait = true | 87 | this.isWait = true |
| 77 | this.previewUrl = this.liveDetailPageLogic.imgUrl | 88 | this.previewUrl = this.liveDetailPageLogic.imgUrl |
| @@ -281,7 +281,7 @@ export struct DetailPlayShortVideoPage { | @@ -281,7 +281,7 @@ export struct DetailPlayShortVideoPage { | ||
| 281 | publishCommentModel: this.publishCommentModel, | 281 | publishCommentModel: this.publishCommentModel, |
| 282 | showCommentIcon: false, | 282 | showCommentIcon: false, |
| 283 | onBack: () => { | 283 | onBack: () => { |
| 284 | - WindowModel.shared.setWindowLayoutFullScreen(false) | 284 | + // WindowModel.shared.setWindowLayoutFullScreen(false) |
| 285 | WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', }) | 285 | WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', }) |
| 286 | } | 286 | } |
| 287 | }) | 287 | }) |
| @@ -96,7 +96,7 @@ export struct DetailVideoListPage { | @@ -96,7 +96,7 @@ export struct DetailVideoListPage { | ||
| 96 | */ | 96 | */ |
| 97 | openFullScreen() { | 97 | openFullScreen() { |
| 98 | WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', }) | 98 | WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', }) |
| 99 | - WindowModel.shared.setWindowLayoutFullScreen(true) | 99 | + // WindowModel.shared.setWindowLayoutFullScreen(true) |
| 100 | // WindowModel.shared.setWindowSystemBarEnable([]) | 100 | // WindowModel.shared.setWindowSystemBarEnable([]) |
| 101 | } | 101 | } |
| 102 | 102 | ||
| @@ -106,7 +106,7 @@ export struct DetailVideoListPage { | @@ -106,7 +106,7 @@ export struct DetailVideoListPage { | ||
| 106 | */ | 106 | */ |
| 107 | closeFullScreen() { | 107 | closeFullScreen() { |
| 108 | WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', }) | 108 | WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', }) |
| 109 | - WindowModel.shared.setWindowLayoutFullScreen(false) | 109 | + // WindowModel.shared.setWindowLayoutFullScreen(false) |
| 110 | // WindowModel.shared.setWindowSystemBarEnable(['status', 'navigation']) | 110 | // WindowModel.shared.setWindowSystemBarEnable(['status', 'navigation']) |
| 111 | } | 111 | } |
| 112 | 112 |
| @@ -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%") |
| @@ -13,6 +13,7 @@ const TAG = "OneKeyLoginPage" | @@ -13,6 +13,7 @@ const TAG = "OneKeyLoginPage" | ||
| 13 | @Entry | 13 | @Entry |
| 14 | @Component | 14 | @Component |
| 15 | struct OneKeyLoginPage { | 15 | struct OneKeyLoginPage { |
| 16 | + @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 | ||
| 16 | anonymousPhone: string = '' | 17 | anonymousPhone: string = '' |
| 17 | @State agreeProtocol: boolean = false | 18 | @State agreeProtocol: boolean = false |
| 18 | viewModel: LoginViewModel = new LoginViewModel() | 19 | viewModel: LoginViewModel = new LoginViewModel() |
| @@ -121,6 +122,7 @@ struct OneKeyLoginPage { | @@ -121,6 +122,7 @@ struct OneKeyLoginPage { | ||
| 121 | }) | 122 | }) |
| 122 | } | 123 | } |
| 123 | .backgroundColor("#FFFFFF") | 124 | .backgroundColor("#FFFFFF") |
| 125 | + .padding({top: `${this.topSafeHeight}px`}) | ||
| 124 | } | 126 | } |
| 125 | 127 | ||
| 126 | @Builder ProtocolRow() { | 128 | @Builder ProtocolRow() { |
| @@ -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 |
| @@ -43,22 +43,26 @@ export struct WDPlayerRenderLiveView { | @@ -43,22 +43,26 @@ export struct WDPlayerRenderLiveView { | ||
| 43 | private playerController?: WDAliPlayerController; | 43 | private playerController?: WDAliPlayerController; |
| 44 | private xComponentController: XComponentController = new XComponentController(); | 44 | private xComponentController: XComponentController = new XComponentController(); |
| 45 | onLoad?: ((event?: object) => void); | 45 | onLoad?: ((event?: object) => void); |
| 46 | - videoWidth: number = 0 | ||
| 47 | - videoHeight: number = 0 | 46 | + @State videoWidth: number = 0 |
| 47 | + @State videoHeight: number = 0 | ||
| 48 | + @State videoRatio: number = 16 / 9 | ||
| 48 | @State selfSize: Size = new Size('100%', '100%'); | 49 | @State selfSize: Size = new Size('100%', '100%'); |
| 49 | private insId: string = "WDPlayerRenderLiveView" + insIndex; | 50 | private insId: string = "WDPlayerRenderLiveView" + insIndex; |
| 50 | 51 | ||
| 52 | + | ||
| 53 | + | ||
| 51 | aboutToAppear() { | 54 | aboutToAppear() { |
| 52 | MGPlayRenderViewIns.add(); | 55 | MGPlayRenderViewIns.add(); |
| 53 | insIndex++; | 56 | insIndex++; |
| 54 | if (!this.playerController) { | 57 | if (!this.playerController) { |
| 55 | return | 58 | return |
| 56 | } | 59 | } |
| 57 | - | 60 | + //this.init = true |
| 58 | this.playerController.onVideoSizeChange = (width: number, height: number) => { | 61 | this.playerController.onVideoSizeChange = (width: number, height: number) => { |
| 59 | // console.log(`WDPlayerRenderView onVideoSizeChange width:${width} videoTop:${height}`) | 62 | // console.log(`WDPlayerRenderView onVideoSizeChange width:${width} videoTop:${height}`) |
| 60 | this.videoWidth = width; | 63 | this.videoWidth = width; |
| 61 | this.videoHeight = height; | 64 | this.videoHeight = height; |
| 65 | + this.videoRatio = width / height | ||
| 62 | this.updateLayout() | 66 | this.updateLayout() |
| 63 | } | 67 | } |
| 64 | } | 68 | } |
| @@ -80,9 +84,9 @@ export struct WDPlayerRenderLiveView { | @@ -80,9 +84,9 @@ export struct WDPlayerRenderLiveView { | ||
| 80 | .onLoad(async (event) => { | 84 | .onLoad(async (event) => { |
| 81 | Logger.info(TAG, 'onLoad') | 85 | Logger.info(TAG, 'onLoad') |
| 82 | let surfaceId = this.xComponentController.getXComponentSurfaceId() | 86 | let surfaceId = this.xComponentController.getXComponentSurfaceId() |
| 83 | - this.xComponentController.setXComponentSurfaceSize({ | ||
| 84 | - surfaceWidth: 1920, | ||
| 85 | - surfaceHeight: 720 | 87 | + this.xComponentController.setXComponentSurfaceRect({ |
| 88 | + surfaceWidth: this.videoWidth, | ||
| 89 | + surfaceHeight: this.videoHeight | ||
| 86 | }); | 90 | }); |
| 87 | if (enableAliPlayer) { | 91 | if (enableAliPlayer) { |
| 88 | this.playerController?.setSurfaceId(this.insId) | 92 | this.playerController?.setSurfaceId(this.insId) |
| @@ -93,8 +97,8 @@ export struct WDPlayerRenderLiveView { | @@ -93,8 +97,8 @@ export struct WDPlayerRenderLiveView { | ||
| 93 | this.onLoad(event) | 97 | this.onLoad(event) |
| 94 | } | 98 | } |
| 95 | }) | 99 | }) |
| 96 | - .width(this.selfSize.width) | ||
| 97 | - .height(this.selfSize.height) | 100 | + // .width(this.selfSize.width) |
| 101 | + // .height(this.selfSize.height) | ||
| 98 | } | 102 | } |
| 99 | .id(this.insId) | 103 | .id(this.insId) |
| 100 | .onAreaChange(() => { | 104 | .onAreaChange(() => { |
| @@ -107,15 +111,40 @@ export struct WDPlayerRenderLiveView { | @@ -107,15 +111,40 @@ export struct WDPlayerRenderLiveView { | ||
| 107 | } | 111 | } |
| 108 | 112 | ||
| 109 | updateLayout() { | 113 | updateLayout() { |
| 114 | + | ||
| 110 | let info = componentUtils.getRectangleById(this.insId); | 115 | let info = componentUtils.getRectangleById(this.insId); |
| 111 | - if (info.size.width > 0 && info.size.height > 0 && this.videoHeight > 0 && this.videoWidth > 0) { | ||
| 112 | - if (info.size.width / info.size.height > this.videoWidth / this.videoHeight) { | ||
| 113 | - let scale = info.size.height / this.videoHeight; | ||
| 114 | - this.selfSize = new Size((this.videoWidth * scale / info.size.width) * 100 + "%", '100%'); | ||
| 115 | - } else { | ||
| 116 | - let scale = info.size.width / this.videoWidth; | ||
| 117 | - this.selfSize = new Size('100%', (this.videoHeight * scale / info.size.height) * 100 + "%"); | 116 | + Logger.debug(TAG, "播放器区域变化: " + JSON.stringify(info)) |
| 117 | + | ||
| 118 | + Logger.debug(TAG, "xComponent rect: " + JSON.stringify(this.xComponentController.getXComponentSurfaceRect())) | ||
| 119 | + | ||
| 120 | + if (info.size.width > 0 && info.size.height > 0) { | ||
| 121 | + | ||
| 122 | + // 竖屏 | ||
| 123 | + if (this.videoHeight > 0 && this.videoWidth > 0 && this.videoWidth < this.videoHeight) { | ||
| 124 | + let ratio = this.videoWidth / this.videoHeight | ||
| 125 | + const height = info.size.width / ratio | ||
| 126 | + | ||
| 127 | + // 竖屏,缩放高度大于 视频区域高度 | ||
| 128 | + if (height > info.size.height) { | ||
| 129 | + | ||
| 130 | + Logger.debug(TAG, "ratio = " + ratio + " ==> new height = " + height) | ||
| 131 | + | ||
| 132 | + Logger.debug(TAG, "高度固定,求宽度: " + info.size.height * ratio) | ||
| 133 | + | ||
| 134 | + this.xComponentController.setXComponentSurfaceRect({ | ||
| 135 | + surfaceWidth: info.size.height * ratio, | ||
| 136 | + surfaceHeight: info.size.height | ||
| 137 | + }); | ||
| 138 | + return | ||
| 139 | + } | ||
| 118 | } | 140 | } |
| 141 | + | ||
| 142 | + this.xComponentController.setXComponentSurfaceRect({ | ||
| 143 | + surfaceWidth: info.size.width, | ||
| 144 | + surfaceHeight: info.size.height | ||
| 145 | + }); | ||
| 119 | } | 146 | } |
| 120 | } | 147 | } |
| 148 | + | ||
| 149 | + | ||
| 121 | } | 150 | } |
| @@ -2,6 +2,7 @@ import { ContentDetailDTO, ContentDTO, PageInfoDTO, ShareInfoDTO, TopicInfo } fr | @@ -2,6 +2,7 @@ import { ContentDetailDTO, ContentDTO, PageInfoDTO, ShareInfoDTO, TopicInfo } fr | ||
| 2 | import { SharePosterItemBean } from 'wdBean/src/main/ets/bean/detail/SharePosterItemBean'; | 2 | import { SharePosterItemBean } from 'wdBean/src/main/ets/bean/detail/SharePosterItemBean'; |
| 3 | import { ShareScene, ShareType, WDShareBase } from 'wdShareBase/Index'; | 3 | import { ShareScene, ShareType, WDShareBase } from 'wdShareBase/Index'; |
| 4 | import { ShareContentType } from 'wdShareBase/src/main/ets/Constant'; | 4 | import { ShareContentType } from 'wdShareBase/src/main/ets/Constant'; |
| 5 | +import { DeepLinkUtil } from './utils/DeepLinkUtil'; | ||
| 5 | 6 | ||
| 6 | export class WDShare { | 7 | export class WDShare { |
| 7 | 8 | ||
| @@ -17,6 +18,7 @@ export class WDShare { | @@ -17,6 +18,7 @@ export class WDShare { | ||
| 17 | title: content.shareInfo.shareTitle, | 18 | title: content.shareInfo.shareTitle, |
| 18 | desc: content.shareInfo.shareSummary, | 19 | desc: content.shareInfo.shareSummary, |
| 19 | link: content.shareInfo.shareUrl, | 20 | link: content.shareInfo.shareUrl, |
| 21 | + deeplink:DeepLinkUtil.generateDeepLinkWithConent(content), | ||
| 20 | } | 22 | } |
| 21 | }) | 23 | }) |
| 22 | } | 24 | } |
| @@ -32,6 +34,7 @@ export class WDShare { | @@ -32,6 +34,7 @@ export class WDShare { | ||
| 32 | title: program.shareInfo.shareTitle, | 34 | title: program.shareInfo.shareTitle, |
| 33 | desc: program.shareInfo.shareSummary, | 35 | desc: program.shareInfo.shareSummary, |
| 34 | link: program.shareInfo.shareUrl, | 36 | link: program.shareInfo.shareUrl, |
| 37 | + deeplink:DeepLinkUtil.generateDeepLinkWithProgram(program), | ||
| 35 | } | 38 | } |
| 36 | }) | 39 | }) |
| 37 | } | 40 | } |
| 1 | +import { ContentDetailDTO, ContentDTO } from 'wdBean/Index'; | ||
| 2 | +import { BreakpointSystem } from 'wdKit/Index'; | ||
| 3 | +import { ContentType } from 'wdRouter/Index'; | ||
| 4 | + | ||
| 5 | +export class DeepLinkUtil { | ||
| 6 | + | ||
| 7 | + private static DEEP_LINK_PREFIX = "rmrbapp:rmrb.app/openwith" | ||
| 8 | + | ||
| 9 | + static generateDeepLinkWithConent(content: ContentDetailDTO): string { | ||
| 10 | + | ||
| 11 | + return DeepLinkUtil.generate(content.newsType, content.newsId +'', content.reLInfo?.relId, content.newsLinkUrl) | ||
| 12 | + } | ||
| 13 | + | ||
| 14 | + static generateDeepLinkWithProgram(content: ContentDTO) { | ||
| 15 | + | ||
| 16 | + return DeepLinkUtil.generate(Number(content.objectType), content.objectId +'', content.relId, content.linkUrl) | ||
| 17 | + } | ||
| 18 | + | ||
| 19 | + private static generate(contentType: number, contentId?: string, relId?: string, link?: string): string { | ||
| 20 | + let deeplink = DeepLinkUtil.DEEP_LINK_PREFIX | ||
| 21 | + | ||
| 22 | + let pubParam = `&contentId=${contentId}}&relId=${relId}&skipType=1` | ||
| 23 | + | ||
| 24 | + let type: ContentType = Number(contentType) | ||
| 25 | + switch (type) { | ||
| 26 | + case ContentType.Video: | ||
| 27 | + deeplink += "?type=video&subType=vod_video" | ||
| 28 | + break | ||
| 29 | + case ContentType.Live: | ||
| 30 | + deeplink += "?type=live" | ||
| 31 | + break | ||
| 32 | + case ContentType.ImageText: | ||
| 33 | + if (link && link.length) { | ||
| 34 | + deeplink += "?type=article&subType=h5" | ||
| 35 | + deeplink += "&url=" + encodeURIComponent(link) | ||
| 36 | + } else { | ||
| 37 | + deeplink += "type=article&subType=h5_template_article" | ||
| 38 | + } | ||
| 39 | + break | ||
| 40 | + case ContentType.DynamicImageText: | ||
| 41 | + deeplink += "?type=dynamic" | ||
| 42 | + break | ||
| 43 | + case ContentType.DynamicVideo: | ||
| 44 | + deeplink += "?type=dynamic" | ||
| 45 | + break | ||
| 46 | + case ContentType.Pictures: | ||
| 47 | + deeplink += "?type=picture" | ||
| 48 | + break | ||
| 49 | + case ContentType.Audio: | ||
| 50 | + deeplink += "?type=audio" | ||
| 51 | + break | ||
| 52 | + case ContentType.Ask: | ||
| 53 | + deeplink += "?type=ask" | ||
| 54 | + break | ||
| 55 | + default: | ||
| 56 | + pubParam = "" | ||
| 57 | + break; | ||
| 58 | + } | ||
| 59 | + | ||
| 60 | + deeplink += pubParam | ||
| 61 | + return deeplink | ||
| 62 | + } | ||
| 63 | + | ||
| 64 | + | ||
| 65 | +} |
| @@ -32,7 +32,6 @@ struct MultiPictureDetailPage { | @@ -32,7 +32,6 @@ struct MultiPictureDetailPage { | ||
| 32 | relType: this.relType | 32 | relType: this.relType |
| 33 | }) | 33 | }) |
| 34 | } | 34 | } |
| 35 | - .padding({top: `${this.topSafeHeight}px`,bottom:`${this.bottomSafeHeight}px`}) | ||
| 36 | 35 | ||
| 37 | } | 36 | } |
| 38 | .backgroundColor(Color.Black) | 37 | .backgroundColor(Color.Black) |
| @@ -115,7 +115,7 @@ struct LaunchAdvertisingPage { | @@ -115,7 +115,7 @@ struct LaunchAdvertisingPage { | ||
| 115 | if (this.defaultModel.linkUrl.length > 0 || this.defaultModel.objectId.length > 0){ | 115 | if (this.defaultModel.linkUrl.length > 0 || this.defaultModel.objectId.length > 0){ |
| 116 | Button(){ | 116 | Button(){ |
| 117 | Row(){ | 117 | Row(){ |
| 118 | - Text('点击跳转至详情') | 118 | + Text(this.defaultModel.isAd == '1'?'点击跳转至详情或第三方应用':'点击跳转至详情') |
| 119 | .fontSize('31lpx') | 119 | .fontSize('31lpx') |
| 120 | .fontColor(Color.White) | 120 | .fontColor(Color.White) |
| 121 | .margin({ | 121 | .margin({ |
| @@ -3,9 +3,10 @@ import { WDRouterRule } from 'wdRouter'; | @@ -3,9 +3,10 @@ import { WDRouterRule } from 'wdRouter'; | ||
| 3 | import { WDRouterPage } from 'wdRouter'; | 3 | import { WDRouterPage } from 'wdRouter'; |
| 4 | import { SPHelper } from 'wdKit/Index'; | 4 | import { SPHelper } from 'wdKit/Index'; |
| 5 | import { SpConstants } from 'wdConstant/Index'; | 5 | import { SpConstants } from 'wdConstant/Index'; |
| 6 | +import { CustomToast} from 'wdKit' | ||
| 6 | import { ButtonOptions, promptAction, window } from '@kit.ArkUI'; | 7 | import { ButtonOptions, promptAction, window } from '@kit.ArkUI'; |
| 7 | import { ParamType, TrackConstants, TrackingContent } from 'wdTracking/Index'; | 8 | import { ParamType, TrackConstants, TrackingContent } from 'wdTracking/Index'; |
| 8 | -import { ImageKnifeComponent } from '@ohos/imageknife'; | 9 | +import { ImageKnifeComponent,ScaleType } from '@ohos/imageknife'; |
| 9 | 10 | ||
| 10 | @Entry | 11 | @Entry |
| 11 | @Component | 12 | @Component |
| @@ -13,6 +14,18 @@ struct LaunchInterestsHobbiesPage { | @@ -13,6 +14,18 @@ struct LaunchInterestsHobbiesPage { | ||
| 13 | @State message: string = 'Hello World' | 14 | @State message: string = 'Hello World' |
| 14 | @State selectCount: number = 0 | 15 | @State selectCount: number = 0 |
| 15 | @State interestsArray: InterestsList[] = [] | 16 | @State interestsArray: InterestsList[] = [] |
| 17 | + @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 | ||
| 18 | + @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 | ||
| 19 | + | ||
| 20 | + dialogToast: CustomDialogController = new CustomDialogController({ | ||
| 21 | + builder: CustomToast({ | ||
| 22 | + msg: '请先选择您感兴趣的内容哦', | ||
| 23 | + }), | ||
| 24 | + autoCancel: false, | ||
| 25 | + alignment: DialogAlignment.Center, | ||
| 26 | + customStyle: true, | ||
| 27 | + maskColor:"#00000000" | ||
| 28 | + }) | ||
| 16 | 29 | ||
| 17 | aboutToAppear(){ | 30 | aboutToAppear(){ |
| 18 | //请求接口,获取兴趣偏好数据 | 31 | //请求接口,获取兴趣偏好数据 |
| @@ -39,6 +52,7 @@ struct LaunchInterestsHobbiesPage { | @@ -39,6 +52,7 @@ struct LaunchInterestsHobbiesPage { | ||
| 39 | this.trackingLaunchJumpOver(false) | 52 | this.trackingLaunchJumpOver(false) |
| 40 | }) | 53 | }) |
| 41 | } | 54 | } |
| 55 | + .margin({top:px2vp(this.topSafeHeight)}) | ||
| 42 | .width('100%') | 56 | .width('100%') |
| 43 | .justifyContent(FlexAlign.End) | 57 | .justifyContent(FlexAlign.End) |
| 44 | 58 | ||
| @@ -62,7 +76,7 @@ struct LaunchInterestsHobbiesPage { | @@ -62,7 +76,7 @@ struct LaunchInterestsHobbiesPage { | ||
| 62 | ForEach(this.interestsArray,(item:InterestsList,index:number)=>{ | 76 | ForEach(this.interestsArray,(item:InterestsList,index:number)=>{ |
| 63 | GridItem(){ | 77 | GridItem(){ |
| 64 | Stack({alignContent:Alignment.TopStart}){ | 78 | Stack({alignContent:Alignment.TopStart}){ |
| 65 | - ImageKnifeComponent({imageKnifeOption:{loadSrc:item.pic}}) | 79 | + ImageKnifeComponent({imageKnifeOption:{loadSrc:item.pic?item.pic:'',mainScaleType:ScaleType.FIT_XY}}) |
| 66 | .width('100%') | 80 | .width('100%') |
| 67 | .height('100%') | 81 | .height('100%') |
| 68 | .backgroundColor(Color.White) | 82 | .backgroundColor(Color.White) |
| @@ -98,7 +112,7 @@ struct LaunchInterestsHobbiesPage { | @@ -98,7 +112,7 @@ struct LaunchInterestsHobbiesPage { | ||
| 98 | Image(item.choose ? $r('app.media.interestsSelected') : $r('app.media.interestsSelectNot')) | 112 | Image(item.choose ? $r('app.media.interestsSelected') : $r('app.media.interestsSelectNot')) |
| 99 | .height('32lpx') | 113 | .height('32lpx') |
| 100 | .width('32lpx') | 114 | .width('32lpx') |
| 101 | - .margin({top:'80lpx',left:'110lpx'}) | 115 | + .margin({top:'80lpx',left:'120lpx'}) |
| 102 | 116 | ||
| 103 | }.justifyContent(FlexAlign.Start) | 117 | }.justifyContent(FlexAlign.Start) |
| 104 | } | 118 | } |
| @@ -118,8 +132,7 @@ struct LaunchInterestsHobbiesPage { | @@ -118,8 +132,7 @@ struct LaunchInterestsHobbiesPage { | ||
| 118 | }) | 132 | }) |
| 119 | } | 133 | } |
| 120 | .width('90%') | 134 | .width('90%') |
| 121 | - // .height('70%') | ||
| 122 | - .margin({top:'61lpx',bottom:'240lpx'}) | 135 | + .margin({top:'61lpx',bottom:'300lpx'}) |
| 123 | .columnsTemplate('1fr 1fr 1fr') | 136 | .columnsTemplate('1fr 1fr 1fr') |
| 124 | .columnsGap('23lpx') | 137 | .columnsGap('23lpx') |
| 125 | .rowsGap('23lpx') | 138 | .rowsGap('23lpx') |
| @@ -129,7 +142,7 @@ struct LaunchInterestsHobbiesPage { | @@ -129,7 +142,7 @@ struct LaunchInterestsHobbiesPage { | ||
| 129 | .height('100%') | 142 | .height('100%') |
| 130 | } | 143 | } |
| 131 | .width('100%') | 144 | .width('100%') |
| 132 | - .height(`calc(100% - ${108 + 'lpx'})`) | 145 | + .height(`calc(100% - ${158 + 'lpx'})`) |
| 133 | // .backgroundColor(Color.Red) | 146 | // .backgroundColor(Color.Red) |
| 134 | 147 | ||
| 135 | Stack({alignContent:Alignment.Center}){ | 148 | Stack({alignContent:Alignment.Center}){ |
| @@ -151,11 +164,7 @@ struct LaunchInterestsHobbiesPage { | @@ -151,11 +164,7 @@ struct LaunchInterestsHobbiesPage { | ||
| 151 | .borderRadius('10lpx') | 164 | .borderRadius('10lpx') |
| 152 | .onClick(()=>{ | 165 | .onClick(()=>{ |
| 153 | if (this.selectCount == 0) { | 166 | if (this.selectCount == 0) { |
| 154 | - promptAction.showToast({ | ||
| 155 | - message : '请先选择您感兴趣的内容哦', | ||
| 156 | - duration: 2000, | ||
| 157 | - bottom: '50%', | ||
| 158 | - }) | 167 | + this.dialogToast.open() |
| 159 | return | 168 | return |
| 160 | } | 169 | } |
| 161 | this.saveTagIds() | 170 | this.saveTagIds() |
| @@ -123,30 +123,16 @@ export struct BottomNavigationComponent { | @@ -123,30 +123,16 @@ export struct BottomNavigationComponent { | ||
| 123 | 123 | ||
| 124 | @Builder | 124 | @Builder |
| 125 | tabBarBuilder(navItem: BottomNavDTO, index: number) { | 125 | tabBarBuilder(navItem: BottomNavDTO, index: number) { |
| 126 | - Stack({ alignContent: Alignment.Bottom }) { | ||
| 127 | - // Image(this.getBottomIcon(navItem, this.currentNavIndex === index)) | ||
| 128 | - // .height(CommonConstants.FULL_PARENT) | ||
| 129 | - // .padding({ | ||
| 130 | - // bottom: 15, | ||
| 131 | - // left: 10, | ||
| 132 | - // right: 10, | ||
| 133 | - // top: 2 | ||
| 134 | - // }) | ||
| 135 | - // .aspectRatio(this.ASPECT_RATIO_1_1) | ||
| 136 | - // .alt(this.getBottomLocalIcon(navItem, this.currentNavIndex === index)) | 126 | + Column() { |
| 137 | ImageKnifeComponent({ imageKnifeOption: this.getBottomImageKnifeOption(navItem, this.currentNavIndex === index) }) | 127 | ImageKnifeComponent({ imageKnifeOption: this.getBottomImageKnifeOption(navItem, this.currentNavIndex === index) }) |
| 138 | - .padding({ | ||
| 139 | - bottom: 15, | ||
| 140 | - left: 10, | ||
| 141 | - right: 10, | ||
| 142 | - top: 2 | ||
| 143 | - }) | ||
| 144 | - .width('100%') | ||
| 145 | - .height('100%') | 128 | + .padding(1) |
| 129 | + .margin({ top: 2 }) | ||
| 130 | + .width(32) | ||
| 131 | + .height(32) | ||
| 146 | .enabled(false) | 132 | .enabled(false) |
| 147 | 133 | ||
| 148 | Text(navItem.name) | 134 | Text(navItem.name) |
| 149 | - .margin({ bottom: $r('app.float.bottom_navigation_margin_bottom') }) | 135 | + .margin({ top: 2 }) |
| 150 | .fontWeight(this.currentNavIndex === index ? FontWeight.Bold : FontWeight.Normal) | 136 | .fontWeight(this.currentNavIndex === index ? FontWeight.Bold : FontWeight.Normal) |
| 151 | .textAlign(TextAlign.Center) | 137 | .textAlign(TextAlign.Center) |
| 152 | .fontSize($r('app.float.font_size_10'))// .fontColor(this.currentNavIndex === index ? Color.Red : Color.Gray) | 138 | .fontSize($r('app.float.font_size_10'))// .fontColor(this.currentNavIndex === index ? Color.Red : Color.Gray) |
| @@ -154,6 +140,7 @@ export struct BottomNavigationComponent { | @@ -154,6 +140,7 @@ export struct BottomNavigationComponent { | ||
| 154 | .opacity(this.currentNavIndex === index ? this.FULL_OPACITY : this.SIXTY_OPACITY) | 140 | .opacity(this.currentNavIndex === index ? this.FULL_OPACITY : this.SIXTY_OPACITY) |
| 155 | } | 141 | } |
| 156 | .zIndex(10) | 142 | .zIndex(10) |
| 143 | + .width('100%') | ||
| 157 | .height($r('app.float.bottom_navigation_barHeight')) | 144 | .height($r('app.float.bottom_navigation_barHeight')) |
| 158 | .hoverEffect(HoverEffect.Highlight) | 145 | .hoverEffect(HoverEffect.Highlight) |
| 159 | .visibility(this.displayDirection === DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None) | 146 | .visibility(this.displayDirection === DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None) |
| @@ -45,8 +45,8 @@ export struct MultiPictureDetailPageComponent { | @@ -45,8 +45,8 @@ export struct MultiPictureDetailPageComponent { | ||
| 45 | @Provide contentDetailData: ContentDetailDTO = {} as ContentDetailDTO | 45 | @Provide contentDetailData: ContentDetailDTO = {} as ContentDetailDTO |
| 46 | @Provide windowWidth: number = AppStorage.get<number>('windowWidth') || 0 | 46 | @Provide windowWidth: number = AppStorage.get<number>('windowWidth') || 0 |
| 47 | @Provide windowHeight: number = AppStorage.get<number>('windowHeight') || 0 | 47 | @Provide windowHeight: number = AppStorage.get<number>('windowHeight') || 0 |
| 48 | - @Provide bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 | ||
| 49 | - @Provide topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 | 48 | + @Consume bottomSafeHeight: number |
| 49 | + @Consume topSafeHeight: number | ||
| 50 | @Provide @Watch('onCurrentPageNumUpdated') currentPageNum: string = '01' | 50 | @Provide @Watch('onCurrentPageNumUpdated') currentPageNum: string = '01' |
| 51 | private swiperController: SwiperController = new SwiperController() | 51 | private swiperController: SwiperController = new SwiperController() |
| 52 | private swiperControllerItem: SwiperController = new SwiperController() | 52 | private swiperControllerItem: SwiperController = new SwiperController() |
| @@ -119,7 +119,7 @@ export struct MultiPictureDetailPageComponent { | @@ -119,7 +119,7 @@ export struct MultiPictureDetailPageComponent { | ||
| 119 | currentIndex: $currentIndex, | 119 | currentIndex: $currentIndex, |
| 120 | showCommentList: $showCommentList, | 120 | showCommentList: $showCommentList, |
| 121 | publishCommentModel: $publishCommentModel, | 121 | publishCommentModel: $publishCommentModel, |
| 122 | - interactData:$interactData | 122 | + interactData: this.interactData |
| 123 | }) | 123 | }) |
| 124 | 124 | ||
| 125 | } | 125 | } |
-
Please register or login to post a comment