Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool
Showing
34 changed files
with
439 additions
and
221 deletions
| @@ -98,4 +98,8 @@ export class DeviceUtil { | @@ -98,4 +98,8 @@ export class DeviceUtil { | ||
| 98 | static isTablet(): boolean { | 98 | static isTablet(): boolean { |
| 99 | return deviceInfo.deviceType == 'tablet'; | 99 | return deviceInfo.deviceType == 'tablet'; |
| 100 | } | 100 | } |
| 101 | + | ||
| 102 | + static is2in1(): boolean { | ||
| 103 | + return deviceInfo.deviceType == '2in1'; | ||
| 104 | + } | ||
| 101 | } | 105 | } |
| @@ -43,6 +43,9 @@ export class WindowModel { | @@ -43,6 +43,9 @@ export class WindowModel { | ||
| 43 | return this.windowClass as window.Window | 43 | return this.windowClass as window.Window |
| 44 | } | 44 | } |
| 45 | 45 | ||
| 46 | + /** | ||
| 47 | + * @deprecated 应用整体全屏,不需要再设置全屏与否了。 | ||
| 48 | + */ | ||
| 46 | setMainWindowFullScreen(fullScreen: boolean) { | 49 | setMainWindowFullScreen(fullScreen: boolean) { |
| 47 | if (deviceInfo.deviceType != "phone") { | 50 | if (deviceInfo.deviceType != "phone") { |
| 48 | return | 51 | return |
| @@ -140,6 +143,9 @@ export class WindowModel { | @@ -140,6 +143,9 @@ export class WindowModel { | ||
| 140 | return this.windowClass?.getWindowProperties() | 143 | return this.windowClass?.getWindowProperties() |
| 141 | } | 144 | } |
| 142 | 145 | ||
| 146 | + /** | ||
| 147 | + * @deprecated 应用整体全屏,不需要再设置全屏与否了。 | ||
| 148 | + */ | ||
| 143 | setWindowLayoutFullScreen(isFullScreen: boolean) { | 149 | setWindowLayoutFullScreen(isFullScreen: boolean) { |
| 144 | this.isFullScreen = isFullScreen | 150 | this.isFullScreen = isFullScreen |
| 145 | this.windowClass?.setWindowLayoutFullScreen(isFullScreen) | 151 | this.windowClass?.setWindowLayoutFullScreen(isFullScreen) |
| @@ -60,12 +60,12 @@ export struct CarderInteraction { | @@ -60,12 +60,12 @@ export struct CarderInteraction { | ||
| 60 | }) | 60 | }) |
| 61 | } | 61 | } |
| 62 | 62 | ||
| 63 | - if(this.contentDetailData.rmhInfo != null){ | ||
| 64 | - if(this.contentDetailData.shareInfo != null && 1 == this.contentDetailData.shareInfo.shareOpen && 1 == this.contentDetailData.rmhInfo.cnShareControl){ | ||
| 65 | - this.shareLayout() | 63 | + if(this.contentDTO.rmhInfo != null){ |
| 64 | + if(this.contentDTO.shareInfo != null && 1 == this.contentDTO.shareInfo.shareOpen && 1 == this.contentDTO.rmhInfo.cnShareControl){ | ||
| 65 | + this.commentLayout() | ||
| 66 | } | 66 | } |
| 67 | }else{ | 67 | }else{ |
| 68 | - this.shareLayout() | 68 | + this.commentLayout() |
| 69 | } | 69 | } |
| 70 | 70 | ||
| 71 | this.builderLike() | 71 | this.builderLike() |
| @@ -81,7 +81,7 @@ export struct CarderInteraction { | @@ -81,7 +81,7 @@ export struct CarderInteraction { | ||
| 81 | } | 81 | } |
| 82 | 82 | ||
| 83 | @Builder | 83 | @Builder |
| 84 | - shareLayout() { | 84 | + commentLayout() { |
| 85 | Row() { | 85 | Row() { |
| 86 | Image($r('app.media.CarderInteraction_comment')) | 86 | Image($r('app.media.CarderInteraction_comment')) |
| 87 | .width(18) | 87 | .width(18) |
| @@ -82,7 +82,6 @@ export struct CompParser { | @@ -82,7 +82,6 @@ export struct CompParser { | ||
| 82 | 82 | ||
| 83 | if (this.compDTO.operDataList[0]?.objectType !== '3' && | 83 | if (this.compDTO.operDataList[0]?.objectType !== '3' && |
| 84 | this.compDTO.operDataList[0]?.objectType !== '13') { //暂时屏蔽活动和音频详情入口 | 84 | this.compDTO.operDataList[0]?.objectType !== '13') { //暂时屏蔽活动和音频详情入口 |
| 85 | - | ||
| 86 | if (this.compDTO.compStyle === CompStyle.Label_03) { | 85 | if (this.compDTO.compStyle === CompStyle.Label_03) { |
| 87 | LabelComponent({ compDTO: this.compDTO }) | 86 | LabelComponent({ compDTO: this.compDTO }) |
| 88 | Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) | 87 | Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) |
| @@ -108,7 +107,7 @@ export struct CompParser { | @@ -108,7 +107,7 @@ export struct CompParser { | ||
| 108 | Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) | 107 | Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) |
| 109 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_03) { | 108 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_03) { |
| 110 | ZhSingleRow03({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName }) | 109 | ZhSingleRow03({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName }) |
| 111 | - Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) | 110 | + Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) |
| 112 | } else if (this.compDTO.compStyle === CompStyle.Zh_Grid_Layout_02) { //双列流小视频,一行两图卡 ->标题 | 111 | } else if (this.compDTO.compStyle === CompStyle.Zh_Grid_Layout_02) { //双列流小视频,一行两图卡 ->标题 |
| 113 | //ZhGridLayout02({ compDTO: this.compDTO }) | 112 | //ZhGridLayout02({ compDTO: this.compDTO }) |
| 114 | CompNormalTitle({ compDTO: this.compDTO }) | 113 | CompNormalTitle({ compDTO: this.compDTO }) |
| @@ -136,7 +135,7 @@ export struct CompParser { | @@ -136,7 +135,7 @@ export struct CompParser { | ||
| 136 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_03) { | 135 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_03) { |
| 137 | // 大图卡 | 136 | // 大图卡 |
| 138 | Card2Component({ compDTO: this.compDTO, contentDTO: this.compDTO.operDataList[0], pageId: this.pageId, pageName: this.pageName }) | 137 | Card2Component({ compDTO: this.compDTO, contentDTO: this.compDTO.operDataList[0], pageId: this.pageId, pageName: this.pageName }) |
| 139 | - Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) | 138 | + Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) |
| 140 | } else if (this.compDTO.compStyle === CompStyle.Card_09) { | 139 | } else if (this.compDTO.compStyle === CompStyle.Card_09) { |
| 141 | //时间链卡 | 140 | //时间链卡 |
| 142 | Card9Component({ compDTO: this.compDTO, contentDTO:this.compDTO.operDataList[0], pageId: this.pageId, pageName: this.pageName }) | 141 | Card9Component({ compDTO: this.compDTO, contentDTO:this.compDTO.operDataList[0], pageId: this.pageId, pageName: this.pageName }) |
| @@ -17,7 +17,7 @@ export struct topicInfoView { | @@ -17,7 +17,7 @@ export struct topicInfoView { | ||
| 17 | // } as FrontLinkObject | 17 | // } as FrontLinkObject |
| 18 | 18 | ||
| 19 | frontLinkObject: FrontLinkObject = {} as FrontLinkObject | 19 | frontLinkObject: FrontLinkObject = {} as FrontLinkObject |
| 20 | - | 20 | + @State isExpansion:boolean = false |
| 21 | aboutToAppear() { | 21 | aboutToAppear() { |
| 22 | } | 22 | } |
| 23 | 23 | ||
| @@ -32,10 +32,10 @@ export struct topicInfoView { | @@ -32,10 +32,10 @@ export struct topicInfoView { | ||
| 32 | }) | 32 | }) |
| 33 | .id('img_cover') | 33 | .id('img_cover') |
| 34 | 34 | ||
| 35 | - if (this.frontLinkObject.linkUrl.length > 0) { | 35 | + if (this.frontLinkObject.linkUrl.length > 0 || this.frontLinkObject?.newsId.length > 0) { |
| 36 | Row() { | 36 | Row() { |
| 37 | Text("查看详情") | 37 | Text("查看详情") |
| 38 | - .fontSize(14) | 38 | + .fontSize(12) |
| 39 | .fontColor($r('app.color.white')) | 39 | .fontColor($r('app.color.white')) |
| 40 | .maxLines(1) | 40 | .maxLines(1) |
| 41 | .borderRadius(2) | 41 | .borderRadius(2) |
| @@ -54,10 +54,12 @@ export struct topicInfoView { | @@ -54,10 +54,12 @@ export struct topicInfoView { | ||
| 54 | contentDTO.objectType = this.frontLinkObject?.newsType.toString() | 54 | contentDTO.objectType = this.frontLinkObject?.newsType.toString() |
| 55 | contentDTO.objectId = this.frontLinkObject?.newsId | 55 | contentDTO.objectId = this.frontLinkObject?.newsId |
| 56 | contentDTO.linkUrl = this.frontLinkObject?.linkUrl | 56 | contentDTO.linkUrl = this.frontLinkObject?.linkUrl |
| 57 | + contentDTO.relId = this.frontLinkObject?.newsRelId.toString() | ||
| 58 | + contentDTO.relType = this.frontLinkObject?.newsType.toString() | ||
| 57 | ProcessUtils.processPage(contentDTO) | 59 | ProcessUtils.processPage(contentDTO) |
| 58 | 60 | ||
| 59 | }) | 61 | }) |
| 60 | - .width(80) | 62 | + .width(70) |
| 61 | .alignRules({ | 63 | .alignRules({ |
| 62 | left: { anchor: "__container__", align: HorizontalAlign.Start }, | 64 | left: { anchor: "__container__", align: HorizontalAlign.Start }, |
| 63 | bottom: { anchor: "__container__", align: VerticalAlign.Bottom } | 65 | bottom: { anchor: "__container__", align: VerticalAlign.Bottom } |
| @@ -65,17 +67,25 @@ export struct topicInfoView { | @@ -65,17 +67,25 @@ export struct topicInfoView { | ||
| 65 | .id('row_detail') | 67 | .id('row_detail') |
| 66 | } | 68 | } |
| 67 | 69 | ||
| 70 | + | ||
| 71 | + Row(){ | ||
| 68 | Text(this.frontLinkObject?.summary ?? "") | 72 | Text(this.frontLinkObject?.summary ?? "") |
| 69 | - .margin({ top: 10 }) | ||
| 70 | .fontSize(14) | 73 | .fontSize(14) |
| 71 | - .fontColor($r('app.color.white')) | ||
| 72 | - .maxLines(3) | 74 | + .fontColor('#CCFFFFFF') |
| 75 | + .maxLines(this.isExpansion?999:3) | ||
| 73 | .textOverflow({ overflow: TextOverflow.Ellipsis }) | 76 | .textOverflow({ overflow: TextOverflow.Ellipsis }) |
| 77 | + | ||
| 78 | + Text(this.isExpansion?'收起':'展开').onClick(()=>{ | ||
| 79 | + this.isExpansion = !this.isExpansion | ||
| 80 | + }) | ||
| 81 | + .fontSize(14) | ||
| 82 | + .fontColor($r('app.color.white')) | ||
| 83 | + }.alignItems(VerticalAlign.Bottom) | ||
| 74 | .alignRules({ | 84 | .alignRules({ |
| 75 | left: { anchor: "__container__", align: HorizontalAlign.Start }, | 85 | left: { anchor: "__container__", align: HorizontalAlign.Start }, |
| 76 | - bottom: this.frontLinkObject.linkUrl.length > 0?{ anchor: "row_detail", align: VerticalAlign.Top }:{ anchor: "__container__", align: VerticalAlign.Bottom } | 86 | + bottom: this.frontLinkObject.linkUrl.length > 0 || this.frontLinkObject?.newsId.length > 0 ?{ anchor: "row_detail", align: VerticalAlign.Top }:{ anchor: "__container__", align: VerticalAlign.Bottom } |
| 77 | }) | 87 | }) |
| 78 | - .margin({ left: 16, right: 16, bottom: this.frontLinkObject.linkUrl.length > 0?0:16}) | 88 | + .margin({top: 10 , left: 16, right: 16, bottom: this.frontLinkObject.linkUrl.length > 0 || this.frontLinkObject?.newsId.length > 0 ?10:16}) |
| 79 | .id('txt_summary') | 89 | .id('txt_summary') |
| 80 | 90 | ||
| 81 | Text(this.frontLinkObject?.title ?? "") | 91 | Text(this.frontLinkObject?.title ?? "") |
| @@ -53,7 +53,7 @@ export struct Card5Component { | @@ -53,7 +53,7 @@ export struct Card5Component { | ||
| 53 | } | 53 | } |
| 54 | ) | 54 | ) |
| 55 | .aspectRatio(343 / 225) | 55 | .aspectRatio(343 / 225) |
| 56 | - if (this.titleShowPolicy === 1 || this.titleShowPolicy === null || this.titleShowPolicy === '') { | 56 | + if (!!this.titleShowPolicy) { |
| 57 | Row() | 57 | Row() |
| 58 | .borderRadius( | 58 | .borderRadius( |
| 59 | { | 59 | { |
| @@ -88,7 +88,7 @@ export struct Card6Component { | @@ -88,7 +88,7 @@ export struct Card6Component { | ||
| 88 | .fontSize(18) | 88 | .fontSize(18) |
| 89 | .lineHeight(27) | 89 | .lineHeight(27) |
| 90 | .fontWeight(FontWeight.Normal) | 90 | .fontWeight(FontWeight.Normal) |
| 91 | - .maxLines(this.contentDTO.appStyle === '6' ? 4 : 2) | 91 | + .maxLines(this.contentDTO.appStyle === '6' ? 4 : 3) |
| 92 | .alignSelf(ItemAlign.Start) | 92 | .alignSelf(ItemAlign.Start) |
| 93 | .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。 | 93 | .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。 |
| 94 | .textIndent((this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 && | 94 | .textIndent((this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 && |
| @@ -107,7 +107,7 @@ export struct Card6Component { | @@ -107,7 +107,7 @@ export struct Card6Component { | ||
| 107 | } | 107 | } |
| 108 | 108 | ||
| 109 | .alignItems(HorizontalAlign.Start) | 109 | .alignItems(HorizontalAlign.Start) |
| 110 | - .height(this.contentDTO.appStyle === CompStyle.Card_13 ? 78 : 156) | 110 | + .height(this.contentDTO.appStyle === CompStyle.Card_13 ? '' : 156) |
| 111 | 111 | ||
| 112 | 112 | ||
| 113 | .justifyContent(FlexAlign.SpaceBetween) | 113 | .justifyContent(FlexAlign.SpaceBetween) |
| @@ -138,7 +138,8 @@ export struct Card6Component { | @@ -138,7 +138,8 @@ export struct Card6Component { | ||
| 138 | }) | 138 | }) |
| 139 | 139 | ||
| 140 | .width(CommonConstants.FULL_WIDTH) | 140 | .width(CommonConstants.FULL_WIDTH) |
| 141 | - .height(this.contentDTO.appStyle === CompStyle.Card_13 ? 106 : 184) .justifyContent(FlexAlign.SpaceBetween) | 141 | + .height(this.contentDTO.appStyle === CompStyle.Card_13 ? '' : 184) |
| 142 | + .justifyContent(FlexAlign.SpaceBetween) | ||
| 142 | .alignItems(VerticalAlign.Top) | 143 | .alignItems(VerticalAlign.Top) |
| 143 | } | 144 | } |
| 144 | } | 145 | } |
| @@ -44,10 +44,14 @@ export struct ZhSingleRow04 { | @@ -44,10 +44,14 @@ export struct ZhSingleRow04 { | ||
| 44 | .onClick(() => { | 44 | .onClick(() => { |
| 45 | if (this.compDTO?.objectType === '11') { | 45 | if (this.compDTO?.objectType === '11') { |
| 46 | ProcessUtils.jumpChannelTab(this.compDTO.objectId, this.compDTO.pageId as string, this.compDTO.objectTitle) | 46 | ProcessUtils.jumpChannelTab(this.compDTO.objectId, this.compDTO.pageId as string, this.compDTO.objectTitle) |
| 47 | - } else if (this.compDTO?.objectType === '5') { | ||
| 48 | - ProcessUtils._gotoSpecialTopic(this.compDTO.linkUrl) | ||
| 49 | - } else if (this.compDTO?.objectType === '6') { | ||
| 50 | - ProcessUtils._gotoDefaultWeb(this.compDTO.linkUrl) | 47 | + } else { |
| 48 | + const contentDTO: ContentDTO = { | ||
| 49 | + objectId: this.compDTO.objectId, | ||
| 50 | + objectType: this.compDTO.objectType, | ||
| 51 | + linkUrl: this.compDTO.linkUrl, | ||
| 52 | + pageId: this.compDTO.pageId | ||
| 53 | + } as ContentDTO | ||
| 54 | + ProcessUtils.processPage(contentDTO) | ||
| 51 | } | 55 | } |
| 52 | }) | 56 | }) |
| 53 | } | 57 | } |
| @@ -84,6 +88,7 @@ export struct ZhSingleRow04 { | @@ -84,6 +88,7 @@ export struct ZhSingleRow04 { | ||
| 84 | .scrollBar(BarState.Off) | 88 | .scrollBar(BarState.Off) |
| 85 | .width(CommonConstants.FULL_PARENT) | 89 | .width(CommonConstants.FULL_PARENT) |
| 86 | .height(166) | 90 | .height(166) |
| 91 | + .edgeEffect(EdgeEffect.None) | ||
| 87 | } | 92 | } |
| 88 | .width(CommonConstants.FULL_WIDTH) | 93 | .width(CommonConstants.FULL_WIDTH) |
| 89 | .backgroundColor($r("app.color.white")) | 94 | .backgroundColor($r("app.color.white")) |
| @@ -19,6 +19,7 @@ const TAG = 'MinePageComponent'; | @@ -19,6 +19,7 @@ const TAG = 'MinePageComponent'; | ||
| 19 | */ | 19 | */ |
| 20 | @Component | 20 | @Component |
| 21 | export struct MinePageComponent { | 21 | export struct MinePageComponent { |
| 22 | + private topRectHeight: string = AppStorage.get<number>('topSafeHeight') + 'px'; | ||
| 22 | //是否是创作者 | 23 | //是否是创作者 |
| 23 | @State isCreator:boolean = false | 24 | @State isCreator:boolean = false |
| 24 | @State isLogin:boolean = false //默认 false 测试放开 | 25 | @State isLogin:boolean = false //默认 false 测试放开 |
| @@ -167,6 +168,8 @@ export struct MinePageComponent { | @@ -167,6 +168,8 @@ export struct MinePageComponent { | ||
| 167 | .backgroundColor($r('app.color.color_F9F9F9')) | 168 | .backgroundColor($r('app.color.color_F9F9F9')) |
| 168 | .scrollable(ScrollDirection.Vertical) | 169 | .scrollable(ScrollDirection.Vertical) |
| 169 | .scrollBar(BarState.Off) | 170 | .scrollBar(BarState.Off) |
| 171 | + // 预留状态栏、导航栏高度 | ||
| 172 | + .margin({ top: this.topRectHeight}) | ||
| 170 | } | 173 | } |
| 171 | 174 | ||
| 172 | 175 |
| @@ -22,6 +22,7 @@ const storage = LocalStorage.getShared(); | @@ -22,6 +22,7 @@ const storage = LocalStorage.getShared(); | ||
| 22 | @Entry(storage) | 22 | @Entry(storage) |
| 23 | @Component | 23 | @Component |
| 24 | export struct TopNavigationComponentNew { | 24 | export struct TopNavigationComponentNew { |
| 25 | + private topRectHeight: string = AppStorage.get<number>('topSafeHeight') + 'px'; | ||
| 25 | /** | 26 | /** |
| 26 | * @deprecated | 27 | * @deprecated |
| 27 | */ | 28 | */ |
| @@ -85,6 +86,7 @@ export struct TopNavigationComponentNew { | @@ -85,6 +86,7 @@ export struct TopNavigationComponentNew { | ||
| 85 | navIndex: index, | 86 | navIndex: index, |
| 86 | pageId: navItem?.pageId + '', | 87 | pageId: navItem?.pageId + '', |
| 87 | channelId: navItem?.channelId + '', | 88 | channelId: navItem?.channelId + '', |
| 89 | + autoRefresh: this.autoRefresh2Page | ||
| 88 | }) | 90 | }) |
| 89 | } else | 91 | } else |
| 90 | if (!this.isBroadcast(navItem) && !this.isLayout(navItem)) { | 92 | if (!this.isBroadcast(navItem) && !this.isLayout(navItem)) { |
| @@ -137,6 +139,8 @@ export struct TopNavigationComponentNew { | @@ -137,6 +139,8 @@ export struct TopNavigationComponentNew { | ||
| 137 | .width('100%') | 139 | .width('100%') |
| 138 | .height('100%') | 140 | .height('100%') |
| 139 | } | 141 | } |
| 142 | + // 预留状态栏 | ||
| 143 | + .margin({ top: this.topRectHeight }) | ||
| 140 | } | 144 | } |
| 141 | 145 | ||
| 142 | @Builder | 146 | @Builder |
| @@ -14,7 +14,6 @@ import { | @@ -14,7 +14,6 @@ import { | ||
| 14 | import { ViewType } from 'wdConstant/src/main/ets/enum/ViewType'; | 14 | import { ViewType } from 'wdConstant/src/main/ets/enum/ViewType'; |
| 15 | import { channelSkeleton } from '../skeleton/channelSkeleton' | 15 | import { channelSkeleton } from '../skeleton/channelSkeleton' |
| 16 | import { EmptyComponent } from '../view/EmptyComponent'; | 16 | import { EmptyComponent } from '../view/EmptyComponent'; |
| 17 | -import { ErrorComponent } from '../view/ErrorComponent'; | ||
| 18 | import { WDRouterPage, WDRouterRule } from 'wdRouter/Index' | 17 | import { WDRouterPage, WDRouterRule } from 'wdRouter/Index' |
| 19 | import MinePageDatasModel from '../../model/MinePageDatasModel'; | 18 | import MinePageDatasModel from '../../model/MinePageDatasModel'; |
| 20 | import { FollowListDetailRequestItem } from '../../viewmodel/FollowListDetailRequestItem'; | 19 | import { FollowListDetailRequestItem } from '../../viewmodel/FollowListDetailRequestItem'; |
| @@ -26,13 +25,14 @@ import PageHelper from '../../viewmodel/PageHelper'; | @@ -26,13 +25,14 @@ import PageHelper from '../../viewmodel/PageHelper'; | ||
| 26 | import { PeopleShipAttentionContentListTopComponent } from './PeopleShipAttentionContentListTopComponent' | 25 | import { PeopleShipAttentionContentListTopComponent } from './PeopleShipAttentionContentListTopComponent' |
| 27 | import { CardParser } from '../CardParser' | 26 | import { CardParser } from '../CardParser' |
| 28 | import { PeopleShipNoMoreData } from '../reusable/PeopleShipNoMoreData'; | 27 | import { PeopleShipNoMoreData } from '../reusable/PeopleShipNoMoreData'; |
| 29 | - | 28 | +const TAG = 'PeopleShipMainComponent'; |
| 30 | @Preview | 29 | @Preview |
| 31 | @Component | 30 | @Component |
| 32 | export struct PeopleShipMainComponent { | 31 | export struct PeopleShipMainComponent { |
| 33 | @State private pageModel: PageModel = new PageModel(); | 32 | @State private pageModel: PageModel = new PageModel(); |
| 34 | @State private pageAdvModel: PageAdModel = new PageAdModel(); | 33 | @State private pageAdvModel: PageAdModel = new PageAdModel(); |
| 35 | - | 34 | + // 自动刷新通知 |
| 35 | + @Prop @Watch('onAutoRefresh') autoRefresh: number = 0 | ||
| 36 | navIndex: number = 0; | 36 | navIndex: number = 0; |
| 37 | pageId: string = ""; | 37 | pageId: string = ""; |
| 38 | channelId: string = ""; | 38 | channelId: string = ""; |
| @@ -416,4 +416,13 @@ export struct PeopleShipMainComponent { | @@ -416,4 +416,13 @@ export struct PeopleShipMainComponent { | ||
| 416 | } | 416 | } |
| 417 | } | 417 | } |
| 418 | 418 | ||
| 419 | + onAutoRefresh(changedPropertyName: string) { | ||
| 420 | + if (this.navIndex != this.currentTopNavSelectedIndex) { | ||
| 421 | + return | ||
| 422 | + } | ||
| 423 | + // 当前页面,自动刷新数据 | ||
| 424 | + Logger.debug(TAG, 'page onAutoRefresh ' + this.autoRefresh) | ||
| 425 | + this.currentPage = 1 | ||
| 426 | + this.getData() | ||
| 427 | + } | ||
| 419 | } | 428 | } |
| @@ -133,6 +133,7 @@ struct MineHomePage { | @@ -133,6 +133,7 @@ struct MineHomePage { | ||
| 133 | .backgroundImageSize(ImageSize.Cover) | 133 | .backgroundImageSize(ImageSize.Cover) |
| 134 | .padding({left:"17lpx",right:"8lpx"}) | 134 | .padding({left:"17lpx",right:"8lpx"}) |
| 135 | .height('35lpx') | 135 | .height('35lpx') |
| 136 | + .borderRadius({topRight:2,bottomRight:2}) | ||
| 136 | } | 137 | } |
| 137 | 138 | ||
| 138 | Blank() | 139 | Blank() |
| @@ -40,8 +40,6 @@ export struct DetailPlayLivePage { | @@ -40,8 +40,6 @@ export struct DetailPlayLivePage { | ||
| 40 | @State lastInputedLiveComment: LiveRoomItemBean = {} as LiveRoomItemBean // 上次输入的直播间消息 | 40 | @State lastInputedLiveComment: LiveRoomItemBean = {} as LiveRoomItemBean // 上次输入的直播间消息 |
| 41 | @State lastInputedChatComment: LiveRoomItemBean = {} as LiveRoomItemBean // 上次输入的大家聊消息 | 41 | @State lastInputedChatComment: LiveRoomItemBean = {} as LiveRoomItemBean // 上次输入的大家聊消息 |
| 42 | 42 | ||
| 43 | - | ||
| 44 | - | ||
| 45 | aboutToAppear(): void { | 43 | aboutToAppear(): void { |
| 46 | Logger.info(TAG, `wyj-aboutToAppear`) | 44 | Logger.info(TAG, `wyj-aboutToAppear`) |
| 47 | 45 | ||
| @@ -72,7 +70,6 @@ export struct DetailPlayLivePage { | @@ -72,7 +70,6 @@ export struct DetailPlayLivePage { | ||
| 72 | TopPlayComponent({ playerController: this.playerController }) | 70 | TopPlayComponent({ playerController: this.playerController }) |
| 73 | .height(this.displayDirection == DisplayDirection.VERTICAL ? 211 : '100%') | 71 | .height(this.displayDirection == DisplayDirection.VERTICAL ? 211 : '100%') |
| 74 | 72 | ||
| 75 | - | ||
| 76 | TabComponent({ | 73 | TabComponent({ |
| 77 | tabs: this.tabs, | 74 | tabs: this.tabs, |
| 78 | changeToTab: this.changeToTab, | 75 | changeToTab: this.changeToTab, |
| 1 | -import { LiveRoomDataBean } from 'wdBean/Index'; | 1 | +import { ContentDetailDTO, LiveRoomDataBean } from 'wdBean/Index'; |
| 2 | import { LiveViewModel } from '../viewModel/LiveViewModel'; | 2 | import { LiveViewModel } from '../viewModel/LiveViewModel'; |
| 3 | import { WindowModel } from 'wdKit/Index'; | 3 | import { WindowModel } from 'wdKit/Index'; |
| 4 | import { PlayerComponent } from '../widgets/vertical/PlayerComponent'; | 4 | import { PlayerComponent } from '../widgets/vertical/PlayerComponent'; |
| @@ -22,6 +22,7 @@ export struct DetailPlayVLivePage { | @@ -22,6 +22,7 @@ export struct DetailPlayVLivePage { | ||
| 22 | private liveViewModel: LiveViewModel = new LiveViewModel() | 22 | private liveViewModel: LiveViewModel = new LiveViewModel() |
| 23 | private playerController: WDAliPlayerController = new WDAliPlayerController(); | 23 | private playerController: WDAliPlayerController = new WDAliPlayerController(); |
| 24 | private swiperController: SwiperController = new SwiperController() | 24 | private swiperController: SwiperController = new SwiperController() |
| 25 | + @Consume contentDetailData: ContentDetailDTO | ||
| 25 | @Provide bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 | 26 | @Provide bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 |
| 26 | @Provide topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 | 27 | @Provide topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 |
| 27 | @Provide liveRoomDataBean: LiveRoomDataBean = {} as LiveRoomDataBean | 28 | @Provide liveRoomDataBean: LiveRoomDataBean = {} as LiveRoomDataBean |
| @@ -36,6 +37,9 @@ export struct DetailPlayVLivePage { | @@ -36,6 +37,9 @@ export struct DetailPlayVLivePage { | ||
| 36 | @Consume contentId: string | 37 | @Consume contentId: string |
| 37 | @State swiperIndex: number = 1 | 38 | @State swiperIndex: number = 1 |
| 38 | @Consume liveDetailPageLogic: LiveDetailPageLogic | 39 | @Consume liveDetailPageLogic: LiveDetailPageLogic |
| 40 | + //播放错误 | ||
| 41 | + @State isPlayerError: boolean = false | ||
| 42 | + @State isCanplay: boolean = false | ||
| 39 | 43 | ||
| 40 | aboutToAppear(): void { | 44 | aboutToAppear(): void { |
| 41 | this.openFullScreen() | 45 | this.openFullScreen() |
| @@ -78,28 +82,27 @@ export struct DetailPlayVLivePage { | @@ -78,28 +82,27 @@ export struct DetailPlayVLivePage { | ||
| 78 | LiveEmptyComponent({ | 82 | LiveEmptyComponent({ |
| 79 | emptyType: WDLiveViewDefaultType.WDViewDefaultType_NoLiveSuspend | 83 | emptyType: WDLiveViewDefaultType.WDViewDefaultType_NoLiveSuspend |
| 80 | }) | 84 | }) |
| 81 | - .height('30%').margin({top:this.topSafeHeight }) | 85 | + .height('40%').margin({ top: this.topSafeHeight }) |
| 82 | } else { | 86 | } else { |
| 83 | 87 | ||
| 84 | if (this.liveDetailPageLogic.showPad) { | 88 | if (this.liveDetailPageLogic.showPad) { |
| 85 | // 有垫片 | 89 | // 有垫片 |
| 86 | - if(this.liveDetailPageLogic.padImageUri.length > 0){ | 90 | + if (this.liveDetailPageLogic.padImageUri.length > 0) { |
| 87 | // 配置了垫片资源 | 91 | // 配置了垫片资源 |
| 88 | Image(this.liveDetailPageLogic.padImageUri).objectFit(ImageFit.Fill).width('100%').height('100%') | 92 | Image(this.liveDetailPageLogic.padImageUri).objectFit(ImageFit.Fill).width('100%').height('100%') |
| 89 | 93 | ||
| 90 | - }else { | 94 | + } else { |
| 91 | // 没有配置垫片资源 | 95 | // 没有配置垫片资源 |
| 92 | LiveEmptyComponent({ | 96 | LiveEmptyComponent({ |
| 93 | emptyType: WDLiveViewDefaultType.WDViewDefaultType_NoLiveSuspend | 97 | emptyType: WDLiveViewDefaultType.WDViewDefaultType_NoLiveSuspend |
| 94 | }) | 98 | }) |
| 95 | - .height('30%').margin({top:this.topSafeHeight }) | 99 | + .height('40%').margin({ top: this.topSafeHeight }) |
| 96 | } | 100 | } |
| 97 | 101 | ||
| 98 | - | ||
| 99 | } else { | 102 | } else { |
| 100 | // 播放器 | 103 | // 播放器 |
| 101 | PlayerComponent({ | 104 | PlayerComponent({ |
| 102 | - playerController: this.playerController | 105 | + playerController: this.playerController, isPlayerError: this.isPlayerError, isCanplay: this.isCanplay |
| 103 | }) | 106 | }) |
| 104 | } | 107 | } |
| 105 | } | 108 | } |
| @@ -110,6 +113,44 @@ export struct DetailPlayVLivePage { | @@ -110,6 +113,44 @@ export struct DetailPlayVLivePage { | ||
| 110 | swiperController: this.swiperController, | 113 | swiperController: this.swiperController, |
| 111 | swiperIndex: $swiperIndex | 114 | swiperIndex: $swiperIndex |
| 112 | }) | 115 | }) |
| 116 | + | ||
| 117 | + // 直播资源加载失败 | ||
| 118 | + Column() { | ||
| 119 | + Text('直播加载中,请稍候重试') | ||
| 120 | + .fontSize('20fp') | ||
| 121 | + .fontWeight(500) | ||
| 122 | + .margin({ top: 16 }) | ||
| 123 | + .fontColor(Color.White) | ||
| 124 | + | ||
| 125 | + Button('点击重试') | ||
| 126 | + .type(ButtonType.Normal) | ||
| 127 | + .width(80) | ||
| 128 | + .height(28) | ||
| 129 | + .backgroundColor(Color.Transparent) | ||
| 130 | + .fontColor('#ffcccccc') | ||
| 131 | + .border({ width: 1 }) | ||
| 132 | + .borderColor('#4dffffff') | ||
| 133 | + .borderRadius(4) | ||
| 134 | + .fontSize($r('app.float.font_size_12')) | ||
| 135 | + .margin({ top: 16 }) | ||
| 136 | + .padding(0) | ||
| 137 | + .onClick(() => { | ||
| 138 | + | ||
| 139 | + this.isCanplay = false | ||
| 140 | + this.isPlayerError = false | ||
| 141 | + this.playerController?.firstPlay(this.playUrl, TrackConstants.PageName.Live_Detail, { | ||
| 142 | + 'contentType': `${this.contentDetailData.newsType}`, | ||
| 143 | + 'contentId': `${this.contentDetailData.newsId}`, | ||
| 144 | + 'contentName': `${this.contentDetailData.newsTitle || ''}`, | ||
| 145 | + }); | ||
| 146 | + }) | ||
| 147 | + } | ||
| 148 | + .width('100%') | ||
| 149 | + .margin({ top: 195 }) | ||
| 150 | + .justifyContent(FlexAlign.Center) | ||
| 151 | + .visibility(this.isPlayerError ? Visibility.Visible : | ||
| 152 | + Visibility.None) | ||
| 153 | + | ||
| 113 | // 清屏按钮 | 154 | // 清屏按钮 |
| 114 | Image($r('app.media.icon_live_more')) | 155 | Image($r('app.media.icon_live_more')) |
| 115 | .width(40) | 156 | .width(40) |
| @@ -25,7 +25,7 @@ export struct TopPlayComponent { | @@ -25,7 +25,7 @@ export struct TopPlayComponent { | ||
| 25 | //已结束直播 | 25 | //已结束直播 |
| 26 | @State isEnd: boolean = false | 26 | @State isEnd: boolean = false |
| 27 | //播放错误 | 27 | //播放错误 |
| 28 | - @State isError: boolean = false | 28 | + @State isPlayerError: boolean = false |
| 29 | // loading 控制字段 | 29 | // loading 控制字段 |
| 30 | @State isHideLoading: boolean = false | 30 | @State isHideLoading: boolean = false |
| 31 | // 获取播放资源能播放了 | 31 | // 获取播放资源能播放了 |
| @@ -50,14 +50,14 @@ export struct TopPlayComponent { | @@ -50,14 +50,14 @@ export struct TopPlayComponent { | ||
| 50 | this.playSourceState = status | 50 | this.playSourceState = status |
| 51 | Logger.debug(TAG, 'status==>' + status) | 51 | Logger.debug(TAG, 'status==>' + status) |
| 52 | if (status === PlayerConstants.STATUS_ERROR) { | 52 | if (status === PlayerConstants.STATUS_ERROR) { |
| 53 | - this.isError = true | 53 | + this.isPlayerError = true |
| 54 | this.isHideLoading = true | 54 | this.isHideLoading = true |
| 55 | this.isCanPlay = false | 55 | this.isCanPlay = false |
| 56 | } else if (status === PlayerConstants.STATUS_COMPLETION) { | 56 | } else if (status === PlayerConstants.STATUS_COMPLETION) { |
| 57 | // 播放完成 | 57 | // 播放完成 |
| 58 | 58 | ||
| 59 | } else { | 59 | } else { |
| 60 | - this.isError = false | 60 | + this.isPlayerError = false |
| 61 | } | 61 | } |
| 62 | 62 | ||
| 63 | } | 63 | } |
| @@ -186,7 +186,7 @@ export struct TopPlayComponent { | @@ -186,7 +186,7 @@ export struct TopPlayComponent { | ||
| 186 | onLoad: async () => { | 186 | onLoad: async () => { |
| 187 | if (StringUtils.isNotEmpty(this.playUrl)) { | 187 | if (StringUtils.isNotEmpty(this.playUrl)) { |
| 188 | this.isHideLoading = false | 188 | this.isHideLoading = false |
| 189 | - this.isError = false | 189 | + this.isPlayerError = false |
| 190 | this.xComponentIsLoaded = true | 190 | this.xComponentIsLoaded = true |
| 191 | Logger.debug(TAG, `---onLoad------>`) | 191 | Logger.debug(TAG, `---onLoad------>`) |
| 192 | this.tryToPlay() | 192 | this.tryToPlay() |
| @@ -265,12 +265,12 @@ export struct TopPlayComponent { | @@ -265,12 +265,12 @@ export struct TopPlayComponent { | ||
| 265 | .padding(0) | 265 | .padding(0) |
| 266 | .onClick(() => { | 266 | .onClick(() => { |
| 267 | this.isHideLoading = false | 267 | this.isHideLoading = false |
| 268 | - this.isError = false | 268 | + this.isPlayerError = false |
| 269 | this.xComponentIsLoaded = true | 269 | this.xComponentIsLoaded = true |
| 270 | this.tryToPlay() | 270 | this.tryToPlay() |
| 271 | 271 | ||
| 272 | }) | 272 | }) |
| 273 | - }.width('100%').visibility(this.isError ? Visibility.Visible : | 273 | + }.width('100%').visibility(this.isPlayerError ? Visibility.Visible : |
| 274 | Visibility.None) | 274 | Visibility.None) |
| 275 | 275 | ||
| 276 | } | 276 | } |
| @@ -14,6 +14,7 @@ import { EmitterEventId, EmitterUtils, Logger, SPHelper, WindowModel } from 'wdK | @@ -14,6 +14,7 @@ import { EmitterEventId, EmitterUtils, Logger, SPHelper, WindowModel } from 'wdK | ||
| 14 | import { TrackConstants, TrackingContent, TrackParamConvert } from 'wdTracking/Index' | 14 | import { TrackConstants, TrackingContent, TrackParamConvert } from 'wdTracking/Index' |
| 15 | 15 | ||
| 16 | const TAG = "PlayerCommentComponent" | 16 | const TAG = "PlayerCommentComponent" |
| 17 | + | ||
| 17 | /** | 18 | /** |
| 18 | * 沉浸式直播--- 聊天区域 | 19 | * 沉浸式直播--- 聊天区域 |
| 19 | */ | 20 | */ |
| @@ -52,7 +53,7 @@ export struct PlayerCommentComponent { | @@ -52,7 +53,7 @@ export struct PlayerCommentComponent { | ||
| 52 | this.liveViewModel.getLiveCommentList( | 53 | this.liveViewModel.getLiveCommentList( |
| 53 | 1, | 54 | 1, |
| 54 | this.contentDetailData?.liveInfo?.mlive?.mliveId, | 55 | this.contentDetailData?.liveInfo?.mlive?.mliveId, |
| 55 | - this.contentDetailData?.newsId+'', | 56 | + this.contentDetailData?.newsId + '', |
| 56 | 20,) | 57 | 20,) |
| 57 | .then( | 58 | .then( |
| 58 | (data) => { | 59 | (data) => { |
| @@ -82,6 +83,7 @@ export struct PlayerCommentComponent { | @@ -82,6 +83,7 @@ export struct PlayerCommentComponent { | ||
| 82 | 83 | ||
| 83 | build() { | 84 | build() { |
| 84 | Column() { | 85 | Column() { |
| 86 | + Stack({ alignContent: Alignment.BottomStart }) { | ||
| 85 | List({ scroller: this.scroller }) { | 87 | List({ scroller: this.scroller }) { |
| 86 | // 主持人 | 88 | // 主持人 |
| 87 | if (this.contentDetailData.oldNewsId) { | 89 | if (this.contentDetailData.oldNewsId) { |
| @@ -93,10 +95,10 @@ export struct PlayerCommentComponent { | @@ -93,10 +95,10 @@ export struct PlayerCommentComponent { | ||
| 93 | } | 95 | } |
| 94 | }) | 96 | }) |
| 95 | } | 97 | } |
| 96 | - .height(280) | ||
| 97 | .width('80%') | 98 | .width('80%') |
| 98 | .scrollBar(BarState.Off) | 99 | .scrollBar(BarState.Off) |
| 99 | - .margin({ bottom: 20 }) | 100 | + |
| 101 | + }.height(280) | ||
| 100 | 102 | ||
| 101 | // 收藏、分享、点赞是否需要根据字段显隐 | 103 | // 收藏、分享、点赞是否需要根据字段显隐 |
| 102 | LiveOperRowListView({ | 104 | LiveOperRowListView({ |
| 1 | import { ContentDetailDTO } from 'wdBean/Index'; | 1 | import { ContentDetailDTO } from 'wdBean/Index'; |
| 2 | -import { AliPlayerRenderView, WDAliPlayerController, WDPlayerRenderVLiveView } from 'wdPlayer/Index'; | 2 | +import { AliPlayerRenderView, PlayerConstants, WDAliPlayerController, WDPlayerRenderVLiveView } from 'wdPlayer/Index'; |
| 3 | import { ParamType, TrackConstants } from 'wdTracking/Index'; | 3 | import { ParamType, TrackConstants } from 'wdTracking/Index'; |
| 4 | import { PictureLoading } from './PictureLoading'; | 4 | import { PictureLoading } from './PictureLoading'; |
| 5 | 5 | ||
| @@ -20,8 +20,10 @@ export struct PlayerComponent { | @@ -20,8 +20,10 @@ export struct PlayerComponent { | ||
| 20 | // 0-横屏流画面,1-竖屏幕流画面 | 20 | // 0-横屏流画面,1-竖屏幕流画面 |
| 21 | @State liveStreamType: number | null = -1 | 21 | @State liveStreamType: number | null = -1 |
| 22 | @State playUrl: string = '' | 22 | @State playUrl: string = '' |
| 23 | - @State isCanplay: boolean = false | ||
| 24 | pageParam: ParamType = {} | 23 | pageParam: ParamType = {} |
| 24 | + // 播放失败 | ||
| 25 | + @Link isPlayerError: boolean | ||
| 26 | + @Link isCanplay: boolean | ||
| 25 | 27 | ||
| 26 | pageShowChange() { | 28 | pageShowChange() { |
| 27 | this.playerController?.play() | 29 | this.playerController?.play() |
| @@ -31,10 +33,33 @@ export struct PlayerComponent { | @@ -31,10 +33,33 @@ export struct PlayerComponent { | ||
| 31 | this.playerController?.pause() | 33 | this.playerController?.pause() |
| 32 | } | 34 | } |
| 33 | 35 | ||
| 34 | - async aboutToAppear(): Promise<void> { | 36 | + aboutToAppear(){ |
| 37 | + | ||
| 38 | + if (this.playerController) { | ||
| 39 | + this.playerController.onCanplay = () => { | ||
| 40 | + this.isCanplay = true | ||
| 41 | + this.playerController?.play() | ||
| 42 | + } | ||
| 43 | + this.playerController.onStatusChange = (status: number) => { | ||
| 44 | + if (status === PlayerConstants.STATUS_ERROR) { | ||
| 45 | + this.isPlayerError = true | ||
| 46 | + this.isCanplay = true | ||
| 47 | + } else if (status === PlayerConstants.STATUS_COMPLETION) { | ||
| 48 | + // 播放完成 | ||
| 49 | + | ||
| 50 | + } else { | ||
| 51 | + //this.isPlayerError = false | ||
| 52 | + } | ||
| 53 | + | ||
| 54 | + } | ||
| 55 | + } | ||
| 56 | + | ||
| 57 | + | ||
| 35 | setTimeout(() => { | 58 | setTimeout(() => { |
| 36 | this.updateData() | 59 | this.updateData() |
| 37 | }, 10) | 60 | }, 10) |
| 61 | + | ||
| 62 | + | ||
| 38 | } | 63 | } |
| 39 | 64 | ||
| 40 | async aboutToDisappear(): Promise<void> { | 65 | async aboutToDisappear(): Promise<void> { |
| @@ -65,17 +90,16 @@ export struct PlayerComponent { | @@ -65,17 +90,16 @@ export struct PlayerComponent { | ||
| 65 | this.liveStreamType = liveStreamType | 90 | this.liveStreamType = liveStreamType |
| 66 | this.playUrl = playUrl | 91 | this.playUrl = playUrl |
| 67 | } | 92 | } |
| 68 | - console.error("XXXXZZZZ", 'updateData ----liveState==>' + this.playUrl) | ||
| 69 | } | 93 | } |
| 70 | 94 | ||
| 71 | build() { | 95 | build() { |
| 72 | - Column() { | ||
| 73 | Stack() { | 96 | Stack() { |
| 74 | // TODO:判断横竖屏,liveStreamType=1竖屏铺满屏幕,裁剪不拉伸,liveStreamType=0横屏正常展示 | 97 | // TODO:判断横竖屏,liveStreamType=1竖屏铺满屏幕,裁剪不拉伸,liveStreamType=0横屏正常展示 |
| 75 | if (this.liveStreamType == null || this.liveStreamType == 1) { | 98 | if (this.liveStreamType == null || this.liveStreamType == 1) { |
| 76 | WDPlayerRenderVLiveView({ | 99 | WDPlayerRenderVLiveView({ |
| 77 | playerController: this.playerController, | 100 | playerController: this.playerController, |
| 78 | onLoad: () => { | 101 | onLoad: () => { |
| 102 | + console.error("XXXXZZZZ", '-------------1--------' + this.playUrl) | ||
| 79 | this.isCanplay = true | 103 | this.isCanplay = true |
| 80 | this.contentTrackingDict() | 104 | this.contentTrackingDict() |
| 81 | this.playerController?.firstPlay(this.playUrl, TrackConstants.PageName.Live_Detail, this.pageParam); | 105 | this.playerController?.firstPlay(this.playUrl, TrackConstants.PageName.Live_Detail, this.pageParam); |
| @@ -94,21 +118,14 @@ export struct PlayerComponent { | @@ -94,21 +118,14 @@ export struct PlayerComponent { | ||
| 94 | 118 | ||
| 95 | PictureLoading().visibility(this.isCanplay ? Visibility.None : Visibility.Visible) | 119 | PictureLoading().visibility(this.isCanplay ? Visibility.None : Visibility.Visible) |
| 96 | 120 | ||
| 121 | + | ||
| 97 | } | 122 | } |
| 98 | .height('100%') | 123 | .height('100%') |
| 99 | .width('100%') | 124 | .width('100%') |
| 100 | .align(Alignment.Top) | 125 | .align(Alignment.Top) |
| 101 | .alignContent(Alignment.Top) | 126 | .alignContent(Alignment.Top) |
| 102 | - .onClick(() => { | ||
| 103 | - if (this.liveState === 'end') { | ||
| 104 | - this.isShowControl = !this.isShowControl | ||
| 105 | - } | ||
| 106 | - }) | ||
| 107 | 127 | ||
| 108 | } | 128 | } |
| 109 | - .height('100%') | ||
| 110 | - .width('100%') | ||
| 111 | - } | ||
| 112 | 129 | ||
| 113 | contentTrackingDict() { | 130 | contentTrackingDict() { |
| 114 | this.pageParam = { | 131 | this.pageParam = { |
| @@ -24,6 +24,8 @@ struct ChangeBindPhonePage { | @@ -24,6 +24,8 @@ struct ChangeBindPhonePage { | ||
| 24 | lastTime: number = 0 | 24 | lastTime: number = 0 |
| 25 | pageShowTime:number = 0; | 25 | pageShowTime:number = 0; |
| 26 | pageHideTime:number = 0; | 26 | pageHideTime:number = 0; |
| 27 | + @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 | ||
| 28 | + @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 | ||
| 27 | 29 | ||
| 28 | 30 | ||
| 29 | onPageShow() { | 31 | onPageShow() { |
| @@ -58,6 +60,7 @@ struct ChangeBindPhonePage { | @@ -58,6 +60,7 @@ struct ChangeBindPhonePage { | ||
| 58 | 60 | ||
| 59 | 61 | ||
| 60 | build() { | 62 | build() { |
| 63 | + Column(){ | ||
| 61 | Column() { | 64 | Column() { |
| 62 | Image($r('app.media.login_back_icon')).width(24).height(24).margin({ left: 15, top: 10 }).onClick(() => { | 65 | Image($r('app.media.login_back_icon')).width(24).height(24).margin({ left: 15, top: 10 }).onClick(() => { |
| 63 | router.back() | 66 | router.back() |
| @@ -138,15 +141,16 @@ struct ChangeBindPhonePage { | @@ -138,15 +141,16 @@ struct ChangeBindPhonePage { | ||
| 138 | Row() { | 141 | Row() { |
| 139 | Text("确认") | 142 | Text("确认") |
| 140 | .layoutWeight(1) | 143 | .layoutWeight(1) |
| 141 | - .fontColor(this.isSubmit ?"#FFFFFFFF":"#66FFFFFF") | 144 | + .fontColor("#FFFFFF") |
| 142 | .borderRadius(4) | 145 | .borderRadius(4) |
| 143 | .fontSize(18) | 146 | .fontSize(18) |
| 144 | .textAlign(TextAlign.Center) | 147 | .textAlign(TextAlign.Center) |
| 145 | .fontWeight(FontWeight.Medium) | 148 | .fontWeight(FontWeight.Medium) |
| 146 | .margin({ top: 26 }) | 149 | .margin({ top: 26 }) |
| 147 | .height(44) | 150 | .height(44) |
| 148 | - .backgroundColor(this.isSubmit ?"#ED2800":"#99ED2800") | 151 | + .backgroundColor("#ED2800") |
| 149 | .enabled(this.isSubmit ? true : false) | 152 | .enabled(this.isSubmit ? true : false) |
| 153 | + .opacity(this.isSubmit ? 1: 0.6) | ||
| 150 | .onClick(() => { | 154 | .onClick(() => { |
| 151 | TrackingButton.click("changePhoneNumberPageConfirm",TrackConstants.PageName.Change_PhoneNum,TrackConstants.PageName.Change_PhoneNum) | 155 | TrackingButton.click("changePhoneNumberPageConfirm",TrackConstants.PageName.Change_PhoneNum,TrackConstants.PageName.Change_PhoneNum) |
| 152 | this.changeBindPhone() | 156 | this.changeBindPhone() |
| @@ -155,6 +159,10 @@ struct ChangeBindPhonePage { | @@ -155,6 +159,10 @@ struct ChangeBindPhonePage { | ||
| 155 | .padding({ left: 25, right: 25 }) | 159 | .padding({ left: 25, right: 25 }) |
| 156 | 160 | ||
| 157 | }.width('100%').height('100%').alignItems(HorizontalAlign.Start) | 161 | }.width('100%').height('100%').alignItems(HorizontalAlign.Start) |
| 162 | + }.width("100%") | ||
| 163 | + .height("100%") | ||
| 164 | + .padding({top:px2vp(this.topSafeHeight),bottom:px2vp(this.bottomSafeHeight)}) | ||
| 165 | + | ||
| 158 | } | 166 | } |
| 159 | 167 | ||
| 160 | //发送验证码 | 168 | //发送验证码 |
| @@ -23,6 +23,8 @@ struct ForgetPasswordPage { | @@ -23,6 +23,8 @@ struct ForgetPasswordPage { | ||
| 23 | @State pageTitle:string = '找回密码'; | 23 | @State pageTitle:string = '找回密码'; |
| 24 | @State isForgetPassword: number = 0 //是否是登录页忘记密码过来的,标题不一样 | 24 | @State isForgetPassword: number = 0 //是否是登录页忘记密码过来的,标题不一样 |
| 25 | @State codeStateSuccess:boolean=false | 25 | @State codeStateSuccess:boolean=false |
| 26 | + @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 | ||
| 27 | + @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 | ||
| 26 | onCodeSend() { | 28 | onCodeSend() { |
| 27 | if (this.isCodeSend) { | 29 | if (this.isCodeSend) { |
| 28 | this.sendVerifyCode() | 30 | this.sendVerifyCode() |
| @@ -43,6 +45,7 @@ struct ForgetPasswordPage { | @@ -43,6 +45,7 @@ struct ForgetPasswordPage { | ||
| 43 | 45 | ||
| 44 | 46 | ||
| 45 | build() { | 47 | build() { |
| 48 | + Column(){ | ||
| 46 | Column() { | 49 | Column() { |
| 47 | Image($r('app.media.login_back_icon')).width(24).height(24).margin({ left: 15, top: 10 }).onClick(() => { | 50 | Image($r('app.media.login_back_icon')).width(24).height(24).margin({ left: 15, top: 10 }).onClick(() => { |
| 48 | router.back() | 51 | router.back() |
| @@ -60,21 +63,30 @@ struct ForgetPasswordPage { | @@ -60,21 +63,30 @@ struct ForgetPasswordPage { | ||
| 60 | Row() { | 63 | Row() { |
| 61 | Text("确认") | 64 | Text("确认") |
| 62 | .layoutWeight(1) | 65 | .layoutWeight(1) |
| 63 | - .fontColor(this.isSubmit ?"#FFFFFFFF":"#66FFFFFF") | 66 | + .fontColor("#FFFFFF") |
| 64 | .borderRadius(4) | 67 | .borderRadius(4) |
| 65 | .fontSize(18) | 68 | .fontSize(18) |
| 66 | .textAlign(TextAlign.Center) | 69 | .textAlign(TextAlign.Center) |
| 67 | .fontWeight(FontWeight.Medium) | 70 | .fontWeight(FontWeight.Medium) |
| 68 | .margin({ top: 26 }) | 71 | .margin({ top: 26 }) |
| 69 | .height(44) | 72 | .height(44) |
| 70 | - .backgroundColor(this.isSubmit ?"#ED2800":"#99ED2800") | 73 | + .backgroundColor("#ED2800") |
| 71 | .enabled(this.isSubmit ? true : false) | 74 | .enabled(this.isSubmit ? true : false) |
| 75 | + .opacity(this.isSubmit ? 1: 0.6) | ||
| 72 | .onClick(() => { | 76 | .onClick(() => { |
| 73 | this.checkVerifyCode() | 77 | this.checkVerifyCode() |
| 74 | }) | 78 | }) |
| 75 | }.padding({ left: 25, right: 25 }).width('100%') | 79 | }.padding({ left: 25, right: 25 }).width('100%') |
| 76 | 80 | ||
| 77 | - }.width('100%').height('100%').alignItems(HorizontalAlign.Start) | 81 | + }.width('100%') |
| 82 | + .height('100%') | ||
| 83 | + .alignItems(HorizontalAlign.Start) | ||
| 84 | + .backgroundColor(Color.White) | ||
| 85 | + | ||
| 86 | + }.width("100%") | ||
| 87 | + .height("100%") | ||
| 88 | + .padding({top:px2vp(this.topSafeHeight),bottom:px2vp(this.bottomSafeHeight)}) | ||
| 89 | + | ||
| 78 | } | 90 | } |
| 79 | 91 | ||
| 80 | aboutToAppear() { | 92 | aboutToAppear() { |
| @@ -27,6 +27,8 @@ const TAG = "LoginPage" | @@ -27,6 +27,8 @@ const TAG = "LoginPage" | ||
| 27 | @Entry | 27 | @Entry |
| 28 | @Component | 28 | @Component |
| 29 | struct LoginPage { | 29 | struct LoginPage { |
| 30 | + @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 | ||
| 31 | + @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 | ||
| 30 | @State codeBtnState: boolean = false | 32 | @State codeBtnState: boolean = false |
| 31 | @State timeCount: number = 60 | 33 | @State timeCount: number = 60 |
| 32 | phoneController: TextInputController = new TextInputController() | 34 | phoneController: TextInputController = new TextInputController() |
| @@ -104,6 +106,7 @@ struct LoginPage { | @@ -104,6 +106,7 @@ struct LoginPage { | ||
| 104 | } | 106 | } |
| 105 | 107 | ||
| 106 | build() { | 108 | build() { |
| 109 | + Column(){ | ||
| 107 | Stack() { | 110 | Stack() { |
| 108 | RelativeContainer() { | 111 | RelativeContainer() { |
| 109 | 112 | ||
| @@ -161,7 +164,7 @@ struct LoginPage { | @@ -161,7 +164,7 @@ struct LoginPage { | ||
| 161 | Row() { | 164 | Row() { |
| 162 | Text("登录") | 165 | Text("登录") |
| 163 | .borderRadius(4) | 166 | .borderRadius(4) |
| 164 | - .fontColor(this.isSubmit ? "#FFFFFFFF" : "#66FFFFFF") | 167 | + .fontColor("#FFFFFF") |
| 165 | .fontSize(`${this.calcHeight(31)}lpx`) | 168 | .fontSize(`${this.calcHeight(31)}lpx`) |
| 166 | .fontWeight(400) | 169 | .fontWeight(400) |
| 167 | .margin({ top: `${this.calcHeight(20)}` }) | 170 | .margin({ top: `${this.calcHeight(20)}` }) |
| @@ -169,7 +172,8 @@ struct LoginPage { | @@ -169,7 +172,8 @@ struct LoginPage { | ||
| 169 | .height(44) | 172 | .height(44) |
| 170 | .textAlign(TextAlign.Center) | 173 | .textAlign(TextAlign.Center) |
| 171 | .width("100%") | 174 | .width("100%") |
| 172 | - .backgroundColor(this.isSubmit ? "#FFED2800" : "#99ED2800") | 175 | + .backgroundColor("#ED2800") |
| 176 | + .opacity(this.isSubmit ? 1: 0.6) | ||
| 173 | .onClick(() => { | 177 | .onClick(() => { |
| 174 | if (!this.isSubmit) { | 178 | if (!this.isSubmit) { |
| 175 | return | 179 | return |
| @@ -241,7 +245,12 @@ struct LoginPage { | @@ -241,7 +245,12 @@ struct LoginPage { | ||
| 241 | .visibility(this.isProtocol ? Visibility.Visible : Visibility.None) | 245 | .visibility(this.isProtocol ? Visibility.Visible : Visibility.None) |
| 242 | 246 | ||
| 243 | }.width('100%') | 247 | }.width('100%') |
| 244 | - .height('100%').backgroundColor(Color.White) | 248 | + .height("100%") |
| 249 | + .backgroundColor(Color.White) | ||
| 250 | + }.width("100%") | ||
| 251 | + .height("100%") | ||
| 252 | + .padding({top:px2vp(this.topSafeHeight),bottom:px2vp(this.bottomSafeHeight)}) | ||
| 253 | + | ||
| 245 | } | 254 | } |
| 246 | 255 | ||
| 247 | @Builder | 256 | @Builder |
| @@ -280,6 +289,7 @@ struct LoginPage { | @@ -280,6 +289,7 @@ struct LoginPage { | ||
| 280 | .width('100%') | 289 | .width('100%') |
| 281 | }.padding({ left: 25, right: 25 }).width('100%').margin({ top: 36 }) | 290 | }.padding({ left: 25, right: 25 }).width('100%').margin({ top: 36 }) |
| 282 | .visibility(this.checkCodePage ? Visibility.None : Visibility.Visible) | 291 | .visibility(this.checkCodePage ? Visibility.None : Visibility.Visible) |
| 292 | + .backgroundColor(Color.White) | ||
| 283 | 293 | ||
| 284 | } | 294 | } |
| 285 | 295 |
| @@ -10,6 +10,8 @@ const TAG = 'LoginProtocolWebview'; | @@ -10,6 +10,8 @@ const TAG = 'LoginProtocolWebview'; | ||
| 10 | @Entry | 10 | @Entry |
| 11 | @Component | 11 | @Component |
| 12 | struct LoginProtocolWebview { | 12 | struct LoginProtocolWebview { |
| 13 | + @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 | ||
| 14 | + @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 | ||
| 13 | webUrl: string = '' | 15 | webUrl: string = '' |
| 14 | webviewController: webview.WebviewController = new webview.WebviewController() | 16 | webviewController: webview.WebviewController = new webview.WebviewController() |
| 15 | userProtocol = "https://cdnpeoplefrontuat.aikan.pdnews.cn/rmrb/rmrb-protocol-zh-web/0.0.1/app/protocol-1005.html" | 17 | userProtocol = "https://cdnpeoplefrontuat.aikan.pdnews.cn/rmrb/rmrb-protocol-zh-web/0.0.1/app/protocol-1005.html" |
| @@ -55,7 +57,7 @@ struct LoginProtocolWebview { | @@ -55,7 +57,7 @@ struct LoginProtocolWebview { | ||
| 55 | } | 57 | } |
| 56 | 58 | ||
| 57 | build() { | 59 | build() { |
| 58 | - | 60 | + Column(){ |
| 59 | Column() { | 61 | Column() { |
| 60 | Row() { | 62 | Row() { |
| 61 | Image($r("app.media.login_back_icon")) | 63 | Image($r("app.media.login_back_icon")) |
| @@ -88,5 +90,9 @@ struct LoginProtocolWebview { | @@ -88,5 +90,9 @@ struct LoginProtocolWebview { | ||
| 88 | }) | 90 | }) |
| 89 | .padding({bottom:this.contentID === "2" ? "40lpx" : 0 }) | 91 | .padding({bottom:this.contentID === "2" ? "40lpx" : 0 }) |
| 90 | } | 92 | } |
| 93 | + }.width("100%") | ||
| 94 | + .height("100%") | ||
| 95 | + .padding({top:px2vp(this.topSafeHeight),bottom:px2vp(this.bottomSafeHeight)}) | ||
| 96 | + | ||
| 91 | } | 97 | } |
| 92 | } | 98 | } |
| @@ -12,6 +12,8 @@ import { TrackingPageBrowse, TrackConstants, TrackingButton } from 'wdTracking/I | @@ -12,6 +12,8 @@ import { TrackingPageBrowse, TrackConstants, TrackingButton } from 'wdTracking/I | ||
| 12 | @Entry | 12 | @Entry |
| 13 | @Component | 13 | @Component |
| 14 | struct ModifyPasswordPage { | 14 | struct ModifyPasswordPage { |
| 15 | + @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 | ||
| 16 | + @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 | ||
| 15 | password_old: string = ''; | 17 | password_old: string = ''; |
| 16 | password_new: string = ''; | 18 | password_new: string = ''; |
| 17 | password_new_repeat: string = ''; | 19 | password_new_repeat: string = ''; |
| @@ -64,9 +66,13 @@ struct ModifyPasswordPage { | @@ -64,9 +66,13 @@ struct ModifyPasswordPage { | ||
| 64 | 66 | ||
| 65 | build() { | 67 | build() { |
| 66 | Column(){ | 68 | Column(){ |
| 69 | + Column(){ | ||
| 67 | this.TitleBackComponent('') | 70 | this.TitleBackComponent('') |
| 68 | this.ModifyPasswordLayout() | 71 | this.ModifyPasswordLayout() |
| 69 | } | 72 | } |
| 73 | + }.width("100%") | ||
| 74 | + .height("100%") | ||
| 75 | + .padding({top:px2vp(this.topSafeHeight),bottom:px2vp(this.bottomSafeHeight)}) | ||
| 70 | 76 | ||
| 71 | } | 77 | } |
| 72 | 78 | ||
| @@ -189,30 +195,30 @@ struct ModifyPasswordPage { | @@ -189,30 +195,30 @@ struct ModifyPasswordPage { | ||
| 189 | .height(`${this.calcHeight(85)}lpx`) | 195 | .height(`${this.calcHeight(85)}lpx`) |
| 190 | .alignItems(HorizontalAlign.Start) | 196 | .alignItems(HorizontalAlign.Start) |
| 191 | 197 | ||
| 198 | + | ||
| 192 | Row() { | 199 | Row() { |
| 193 | - Button( { type: ButtonType.Normal, stateEffect: true }){ | ||
| 194 | Text("确认") | 200 | Text("确认") |
| 195 | - .fontColor("#fff") | ||
| 196 | - .fontSize(`${this.calcHeight(35)}lpx`) | ||
| 197 | - .lineHeight(`${this.calcHeight(50)}lpx`) | ||
| 198 | - .opacity(this.btnStatus ?1:0.5) | ||
| 199 | - } | ||
| 200 | - .width('100%') | ||
| 201 | - .height(`${this.calcHeight(80)}lpx`) | ||
| 202 | - .backgroundColor(this.btnStatus ? '#ED2800' : '#99ED2800') | ||
| 203 | - .enabled(this.btnStatus ?true:false) | ||
| 204 | - .borderRadius('4vp') | 201 | + .layoutWeight(1) |
| 202 | + .fontColor("#FFFFFF") | ||
| 203 | + .borderRadius(4) | ||
| 204 | + .fontSize(18) | ||
| 205 | + .textAlign(TextAlign.Center) | ||
| 206 | + .fontWeight(FontWeight.Medium) | ||
| 207 | + .margin({ top: 26 }) | ||
| 208 | + .height(44) | ||
| 209 | + .backgroundColor("#ED2800") | ||
| 210 | + .enabled(this.btnStatus ? true : false) | ||
| 211 | + .opacity(this.btnStatus ? 1: 0.6) | ||
| 205 | .onClick(() => { | 212 | .onClick(() => { |
| 206 | if(this.btnStatus){ | 213 | if(this.btnStatus){ |
| 207 | TrackingButton.click("changePasswordPageConfirm",TrackConstants.PageName.Change_Passwd,TrackConstants.PageName.Change_Passwd) | 214 | TrackingButton.click("changePasswordPageConfirm",TrackConstants.PageName.Change_Passwd,TrackConstants.PageName.Change_Passwd) |
| 208 | this.submit() | 215 | this.submit() |
| 209 | } | 216 | } |
| 210 | }) | 217 | }) |
| 211 | - } | 218 | + }.width('100%') |
| 212 | .padding({top:`${this.calcHeight(25)}lpx`}) | 219 | .padding({top:`${this.calcHeight(25)}lpx`}) |
| 213 | .alignItems(VerticalAlign.Center) | 220 | .alignItems(VerticalAlign.Center) |
| 214 | .width('100%') | 221 | .width('100%') |
| 215 | - .height(`${this.calcHeight(120)}lpx`) | ||
| 216 | 222 | ||
| 217 | Column() { | 223 | Column() { |
| 218 | Text("忘记密码").fontSize(12).maxLines(3).fontColor(0x999999).padding({top:`${this.calcHeight(10)}lpx`}) | 224 | Text("忘记密码").fontSize(12).maxLines(3).fontColor(0x999999).padding({top:`${this.calcHeight(10)}lpx`}) |
| @@ -2,7 +2,7 @@ import ArrayList from '@ohos.util.ArrayList'; | @@ -2,7 +2,7 @@ import ArrayList from '@ohos.util.ArrayList'; | ||
| 2 | import { Params } from '../../../../../../../commons/wdRouter/oh_modules/wdBean/Index'; | 2 | import { Params } from '../../../../../../../commons/wdRouter/oh_modules/wdBean/Index'; |
| 3 | import router from '@ohos.router'; | 3 | import router from '@ohos.router'; |
| 4 | import { LoginViewModel } from './LoginViewModel'; | 4 | import { LoginViewModel } from './LoginViewModel'; |
| 5 | -import { CustomToast, DateTimeUtils, Logger, SPHelper, ToastUtils } from 'wdKit'; | 5 | +import { BreakpointSystem, CustomToast, DateTimeUtils, Logger, SPHelper, ToastUtils } from 'wdKit'; |
| 6 | import { | 6 | import { |
| 7 | SpConstants | 7 | SpConstants |
| 8 | } from '../../../../../../../commons/wdNetwork/oh_modules/wdConstant/src/main/ets/constants/SpConstants' | 8 | } from '../../../../../../../commons/wdNetwork/oh_modules/wdConstant/src/main/ets/constants/SpConstants' |
| @@ -74,6 +74,19 @@ export struct SettingPasswordPage { | @@ -74,6 +74,19 @@ export struct SettingPasswordPage { | ||
| 74 | pageHideResetTime:number = 0; | 74 | pageHideResetTime:number = 0; |
| 75 | pageShowSetTime:number = 0; | 75 | pageShowSetTime:number = 0; |
| 76 | pageHideSetTime:number = 0; | 76 | pageHideSetTime:number = 0; |
| 77 | + @StorageProp('currentBreakpoint') @Watch("currentChanged")currentBreakpoint: string = 'sm'; | ||
| 78 | + private breakpointSystem = new BreakpointSystem(); | ||
| 79 | + @State percent:number = 1 | ||
| 80 | + @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 | ||
| 81 | + @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 | ||
| 82 | + | ||
| 83 | + currentChanged(){ | ||
| 84 | + if(this.currentBreakpoint == "md" || this.currentBreakpoint == "lg"){ | ||
| 85 | + this.percent = 0.7 | ||
| 86 | + }else { | ||
| 87 | + this.percent = 1 | ||
| 88 | + } | ||
| 89 | + } | ||
| 77 | 90 | ||
| 78 | onPageShow(): void { | 91 | onPageShow(): void { |
| 79 | if (this.pageType === 0){//重置密码 | 92 | if (this.pageType === 0){//重置密码 |
| @@ -83,6 +96,10 @@ export struct SettingPasswordPage { | @@ -83,6 +96,10 @@ export struct SettingPasswordPage { | ||
| 83 | } | 96 | } |
| 84 | } | 97 | } |
| 85 | 98 | ||
| 99 | + calcHeight(value:number): number{ | ||
| 100 | + return value * this.percent | ||
| 101 | + } | ||
| 102 | + | ||
| 86 | onPageHide(): void { | 103 | onPageHide(): void { |
| 87 | if (this.pageType === 0){ | 104 | if (this.pageType === 0){ |
| 88 | this.pageHideResetTime = DateTimeUtils.getTimeStamp() | 105 | this.pageHideResetTime = DateTimeUtils.getTimeStamp() |
| @@ -104,7 +121,13 @@ export struct SettingPasswordPage { | @@ -104,7 +121,13 @@ export struct SettingPasswordPage { | ||
| 104 | } | 121 | } |
| 105 | } | 122 | } |
| 106 | 123 | ||
| 124 | + aboutToDisappear(): void { | ||
| 125 | + this.breakpointSystem.unregister(); | ||
| 126 | + } | ||
| 127 | + | ||
| 107 | aboutToAppear() { | 128 | aboutToAppear() { |
| 129 | + this.breakpointSystem.register(); | ||
| 130 | + this.currentChanged() | ||
| 108 | let params:SettingPasswordParams = router.getParams() as SettingPasswordParams; | 131 | let params:SettingPasswordParams = router.getParams() as SettingPasswordParams; |
| 109 | this.pageId = parseInt(params.pageID); | 132 | this.pageId = parseInt(params.pageID); |
| 110 | this.getPageListData(this.pageId) | 133 | this.getPageListData(this.pageId) |
| @@ -147,10 +170,48 @@ export struct SettingPasswordPage { | @@ -147,10 +170,48 @@ export struct SettingPasswordPage { | ||
| 147 | } | 170 | } |
| 148 | 171 | ||
| 149 | build() { | 172 | build() { |
| 150 | - Navigation() { | 173 | + Column(){ |
| 174 | + Column(){ | ||
| 175 | + this.TitleBackComponent('') | ||
| 151 | this.settingList() //滑动区域 | 176 | this.settingList() //滑动区域 |
| 152 | - }.titleMode(NavigationTitleMode.Mini) | ||
| 153 | - .title('') | 177 | + } |
| 178 | + }.width("100%") | ||
| 179 | + .height("100%") | ||
| 180 | + .padding({top:px2vp(this.topSafeHeight),bottom:px2vp(this.bottomSafeHeight)}) | ||
| 181 | + | ||
| 182 | + } | ||
| 183 | + | ||
| 184 | + @Builder TitleBackComponent(title:string){ | ||
| 185 | + RelativeContainer() { | ||
| 186 | + Text(title) | ||
| 187 | + .fontColor('#FF333333') | ||
| 188 | + .fontSize(`${this.calcHeight(18)}`) | ||
| 189 | + .textAlign(TextAlign.Center) | ||
| 190 | + .height(`${this.calcHeight(44)}`) | ||
| 191 | + .alignRules({ | ||
| 192 | + top: { anchor: "__container__", align: VerticalAlign.Top }, | ||
| 193 | + left: { anchor: "__container__", align: HorizontalAlign.Start }, | ||
| 194 | + right: { anchor: "__container__", align: HorizontalAlign.End }, | ||
| 195 | + | ||
| 196 | + }) | ||
| 197 | + .id('titleContent') | ||
| 198 | + Image($r("app.media.login_back_icon")) | ||
| 199 | + .objectFit(ImageFit.Auto) | ||
| 200 | + .height(`${this.calcHeight(24)}`) | ||
| 201 | + .width(`${this.calcHeight(24)}`) | ||
| 202 | + .margin({ | ||
| 203 | + left: `${this.calcHeight(16)}`, top: `${this.calcHeight(8)}` | ||
| 204 | + }) | ||
| 205 | + .alignRules({ | ||
| 206 | + top: { anchor: "__container__", align: VerticalAlign.Top }, | ||
| 207 | + left: { anchor: "__container__", align: HorizontalAlign.Start }, | ||
| 208 | + }) | ||
| 209 | + .onClick(() => { | ||
| 210 | + router.back() | ||
| 211 | + }) | ||
| 212 | + .id('backImage') | ||
| 213 | + | ||
| 214 | + }.height(`${this.calcHeight(44)}`) | ||
| 154 | } | 215 | } |
| 155 | 216 | ||
| 156 | // 页面布局 | 217 | // 页面布局 |
| @@ -176,7 +237,7 @@ export struct SettingPasswordPage { | @@ -176,7 +237,7 @@ export struct SettingPasswordPage { | ||
| 176 | }) | 237 | }) |
| 177 | } | 238 | } |
| 178 | }.width('100%') | 239 | }.width('100%') |
| 179 | - .padding({ left:"31lpx",right:"31lpx",top:"131lpx" }) | 240 | + .padding({ left:`${this.calcHeight(31)}lpx`,right:`${this.calcHeight(31)}lpx`,top:`${this.calcHeight(131)}lpx` }) |
| 180 | .height('100%') | 241 | .height('100%') |
| 181 | } | 242 | } |
| 182 | 243 | ||
| @@ -185,10 +246,10 @@ export struct SettingPasswordPage { | @@ -185,10 +246,10 @@ export struct SettingPasswordPage { | ||
| 185 | // 标题 | 246 | // 标题 |
| 186 | @Builder getTitleCell(item: AccoutPageDataModel, alignTitle: HorizontalAlign) { | 247 | @Builder getTitleCell(item: AccoutPageDataModel, alignTitle: HorizontalAlign) { |
| 187 | Column() { | 248 | Column() { |
| 188 | - Text(item.compTitle).fontWeight(FontWeight.Bold).fontSize(20).maxLines(1) | 249 | + Text(item.compTitle).fontWeight(FontWeight.Bold).fontSize(`${this.calcHeight(20)}`).maxLines(1) |
| 189 | } | 250 | } |
| 190 | .width('100%') | 251 | .width('100%') |
| 191 | - .height('75lpx') | 252 | + .height(`${this.calcHeight(75)}lpx`) |
| 192 | .alignItems(alignTitle) | 253 | .alignItems(alignTitle) |
| 193 | } | 254 | } |
| 194 | 255 | ||
| @@ -210,12 +271,12 @@ export struct SettingPasswordPage { | @@ -210,12 +271,12 @@ export struct SettingPasswordPage { | ||
| 210 | }) | 271 | }) |
| 211 | } | 272 | } |
| 212 | .alignItems(VerticalAlign.Center) | 273 | .alignItems(VerticalAlign.Center) |
| 213 | - .height('80lpx') | 274 | + .height(`${this.calcHeight(80)}lpx`) |
| 214 | .backgroundColor('#f5f5f5') | 275 | .backgroundColor('#f5f5f5') |
| 215 | - .borderRadius('4vp') | 276 | + .borderRadius(`${this.calcHeight(4)}`) |
| 216 | } | 277 | } |
| 217 | .width('100%') | 278 | .width('100%') |
| 218 | - .height('110lpx') | 279 | + .height(`${this.calcHeight(110)}lpx`) |
| 219 | .backgroundColor(0xffffff0) | 280 | .backgroundColor(0xffffff0) |
| 220 | .alignItems(VerticalAlign.Center) | 281 | .alignItems(VerticalAlign.Center) |
| 221 | } | 282 | } |
| @@ -235,12 +296,12 @@ export struct SettingPasswordPage { | @@ -235,12 +296,12 @@ export struct SettingPasswordPage { | ||
| 235 | }) | 296 | }) |
| 236 | } | 297 | } |
| 237 | .alignItems(VerticalAlign.Center) | 298 | .alignItems(VerticalAlign.Center) |
| 238 | - .height('80lpx') | 299 | + .height(`${this.calcHeight(80)}lpx`) |
| 239 | .backgroundColor('#f5f5f5') | 300 | .backgroundColor('#f5f5f5') |
| 240 | - .borderRadius('4vp') | 301 | + .borderRadius(`${this.calcHeight(4)}`) |
| 241 | } | 302 | } |
| 242 | .width('100%') | 303 | .width('100%') |
| 243 | - .height('110lpx') | 304 | + .height(`${this.calcHeight(110)}lpx`) |
| 244 | .backgroundColor(0xffffff0) | 305 | .backgroundColor(0xffffff0) |
| 245 | .alignItems(VerticalAlign.Center) | 306 | .alignItems(VerticalAlign.Center) |
| 246 | } | 307 | } |
| @@ -249,7 +310,7 @@ export struct SettingPasswordPage { | @@ -249,7 +310,7 @@ export struct SettingPasswordPage { | ||
| 249 | @Builder getCodeCell(item: AccoutPageDataModel) { | 310 | @Builder getCodeCell(item: AccoutPageDataModel) { |
| 250 | Row() { | 311 | Row() { |
| 251 | Stack() { | 312 | Stack() { |
| 252 | - Image($r('app.media.get_code_bg')).width('100%').borderRadius('4vp') | 313 | + Image($r('app.media.get_code_bg')).width('100%').borderRadius(`${this.calcHeight(4)}`) |
| 253 | Row() { | 314 | Row() { |
| 254 | TextInput({ placeholder: item.inputPlacholder }) | 315 | TextInput({ placeholder: item.inputPlacholder }) |
| 255 | .placeholderColor("#CCCCCC") | 316 | .placeholderColor("#CCCCCC") |
| @@ -264,10 +325,10 @@ export struct SettingPasswordPage { | @@ -264,10 +325,10 @@ export struct SettingPasswordPage { | ||
| 264 | .fontColor('#da3e22') | 325 | .fontColor('#da3e22') |
| 265 | } | 326 | } |
| 266 | .width('100%') | 327 | .width('100%') |
| 267 | - }.height('80lpx') | 328 | + }.height(`${this.calcHeight(80)}lpx`) |
| 268 | } | 329 | } |
| 269 | .width('100%') | 330 | .width('100%') |
| 270 | - .height('110lpx') | 331 | + .height(`${this.calcHeight(110)}lpx`) |
| 271 | .backgroundColor(0xffffff0) | 332 | .backgroundColor(0xffffff0) |
| 272 | .alignItems(VerticalAlign.Center) | 333 | .alignItems(VerticalAlign.Center) |
| 273 | } | 334 | } |
| @@ -275,7 +336,7 @@ export struct SettingPasswordPage { | @@ -275,7 +336,7 @@ export struct SettingPasswordPage { | ||
| 275 | // desc | 336 | // desc |
| 276 | @Builder getDescCell(item: AccoutPageDataModel, alignTitle: HorizontalAlign) { | 337 | @Builder getDescCell(item: AccoutPageDataModel, alignTitle: HorizontalAlign) { |
| 277 | Column() { | 338 | Column() { |
| 278 | - Text(item.compDesc).fontSize(12).maxLines(3).fontColor(0x999999).padding({top:'10lpx'}) | 339 | + Text(item.compDesc).fontSize(`${this.calcHeight(12)}`).maxLines(3).fontColor(0x999999).padding({top:`${this.calcHeight(10)}lpx`}) |
| 279 | .onClick(()=>{ | 340 | .onClick(()=>{ |
| 280 | if (item.compDesc == '忘记密码') { | 341 | if (item.compDesc == '忘记密码') { |
| 281 | this.showToastTip('密码不符合密码规范') | 342 | this.showToastTip('密码不符合密码规范') |
| @@ -283,37 +344,39 @@ export struct SettingPasswordPage { | @@ -283,37 +344,39 @@ export struct SettingPasswordPage { | ||
| 283 | }) | 344 | }) |
| 284 | } | 345 | } |
| 285 | .width('100%') | 346 | .width('100%') |
| 286 | - .height('85lpx') | 347 | + .height(`${this.calcHeight(85)}lpx`) |
| 287 | .alignItems(alignTitle) | 348 | .alignItems(alignTitle) |
| 288 | } | 349 | } |
| 289 | 350 | ||
| 290 | // 按钮 | 351 | // 按钮 |
| 291 | @Builder getButtonCell(item: AccoutPageDataModel) { | 352 | @Builder getButtonCell(item: AccoutPageDataModel) { |
| 292 | Row() { | 353 | Row() { |
| 293 | - Button(item.compButtonTitle, { type: ButtonType.Normal, stateEffect: true }) | ||
| 294 | - .width('100%') | ||
| 295 | - .height('80lpx') | ||
| 296 | - .backgroundColor(this.btnStatus ? '#da3e22' : '#e5856d') | ||
| 297 | - .enabled(this.btnStatus ?true:false) | ||
| 298 | - .fontColor('#fff') | ||
| 299 | - .borderRadius('4vp') | 354 | + Text(item.compButtonTitle) |
| 355 | + .layoutWeight(1) | ||
| 356 | + .fontColor("#FFFFFF") | ||
| 357 | + .borderRadius(`${this.calcHeight(4)}`) | ||
| 358 | + .fontSize(`${this.calcHeight(18)}`) | ||
| 359 | + .textAlign(TextAlign.Center) | ||
| 360 | + .fontWeight(FontWeight.Medium) | ||
| 361 | + .margin({ top: `${this.calcHeight(26)}` }) | ||
| 362 | + .height(`${this.calcHeight(44)}`) | ||
| 363 | + .backgroundColor("#ED2800") | ||
| 364 | + .enabled(this.btnStatus ? true : false) | ||
| 365 | + .opacity(this.btnStatus ? 1: 0.6) | ||
| 300 | .onClick(() => { | 366 | .onClick(() => { |
| 301 | this.buttonClick() | 367 | this.buttonClick() |
| 302 | }) | 368 | }) |
| 303 | - } | ||
| 304 | - .padding({top:'25lpx'}) | ||
| 305 | - .alignItems(VerticalAlign.Center) | 369 | + }.padding({top:`${this.calcHeight(25)}lpx`}) |
| 306 | .width('100%') | 370 | .width('100%') |
| 307 | - .height('120lpx') | ||
| 308 | } | 371 | } |
| 309 | 372 | ||
| 310 | // 标题 | 373 | // 标题 |
| 311 | @Builder getLogoCell(item: AccoutPageDataModel) { | 374 | @Builder getLogoCell(item: AccoutPageDataModel) { |
| 312 | Column() { | 375 | Column() { |
| 313 | - Image(item.compLogo).height('150lpx').width('150lpx') | 376 | + Image(item.compLogo).height(`${this.calcHeight(150)}lpx`).width(`${this.calcHeight(150)}lpx`) |
| 314 | } | 377 | } |
| 315 | .width('100%') | 378 | .width('100%') |
| 316 | - .height('200lpx') | 379 | + .height(`${this.calcHeight(200)}lpx`) |
| 317 | } | 380 | } |
| 318 | 381 | ||
| 319 | /***************************** 事件处理 ******************************************/ | 382 | /***************************** 事件处理 ******************************************/ |
| @@ -24,6 +24,8 @@ struct VerifyPhoneNumberPage { | @@ -24,6 +24,8 @@ struct VerifyPhoneNumberPage { | ||
| 24 | isFirst:boolean=true//是否第一次获取验证码 | 24 | isFirst:boolean=true//是否第一次获取验证码 |
| 25 | pageShowTime:number = 0; | 25 | pageShowTime:number = 0; |
| 26 | pageHideTime:number = 0; | 26 | pageHideTime:number = 0; |
| 27 | + @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 | ||
| 28 | + @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 | ||
| 27 | 29 | ||
| 28 | onCodeSend() { | 30 | onCodeSend() { |
| 29 | if (this.isCodeSend) { | 31 | if (this.isCodeSend) { |
| @@ -60,6 +62,7 @@ struct VerifyPhoneNumberPage { | @@ -60,6 +62,7 @@ struct VerifyPhoneNumberPage { | ||
| 60 | 62 | ||
| 61 | 63 | ||
| 62 | build() { | 64 | build() { |
| 65 | + Column(){ | ||
| 63 | Column() { | 66 | Column() { |
| 64 | Image($r('app.media.login_back_icon')).width(24).height(24).margin({ left: 15, top: 10 }).onClick(() => { | 67 | Image($r('app.media.login_back_icon')).width(24).height(24).margin({ left: 15, top: 10 }).onClick(() => { |
| 65 | router.back() | 68 | router.back() |
| @@ -155,6 +158,9 @@ struct VerifyPhoneNumberPage { | @@ -155,6 +158,9 @@ struct VerifyPhoneNumberPage { | ||
| 155 | }.padding({ left: 25, right: 25 }).width('100%') | 158 | }.padding({ left: 25, right: 25 }).width('100%') |
| 156 | 159 | ||
| 157 | }.width('100%').height('100%').alignItems(HorizontalAlign.Start) | 160 | }.width('100%').height('100%').alignItems(HorizontalAlign.Start) |
| 161 | + }.width("100%") | ||
| 162 | + .height("100%") | ||
| 163 | + .padding({top:px2vp(this.topSafeHeight),bottom:px2vp(this.bottomSafeHeight)}) | ||
| 158 | } | 164 | } |
| 159 | 165 | ||
| 160 | //发送验证码 | 166 | //发送验证码 |
| 1 | import AbilityConstant from '@ohos.app.ability.AbilityConstant'; | 1 | import AbilityConstant from '@ohos.app.ability.AbilityConstant'; |
| 2 | import app from '@system.app'; | 2 | import app from '@system.app'; |
| 3 | -import hilog from '@ohos.hilog'; | ||
| 4 | import UIAbility from '@ohos.app.ability.UIAbility'; | 3 | import UIAbility from '@ohos.app.ability.UIAbility'; |
| 5 | import Want from '@ohos.app.ability.Want'; | 4 | import Want from '@ohos.app.ability.Want'; |
| 6 | import window from '@ohos.window'; | 5 | import window from '@ohos.window'; |
| 7 | import { BusinessError } from '@ohos.base'; | 6 | import { BusinessError } from '@ohos.base'; |
| 8 | -import { DeviceUtil, EmitterEventId, EmitterUtils, WindowModel } from 'wdKit'; | 7 | +import { DeviceUtil, EmitterEventId, EmitterUtils, Logger, WindowModel } from 'wdKit'; |
| 9 | import { ConfigurationConstant } from '@kit.AbilityKit'; | 8 | import { ConfigurationConstant } from '@kit.AbilityKit'; |
| 10 | import { StartupManager } from '../startupmanager/StartupManager'; | 9 | import { StartupManager } from '../startupmanager/StartupManager'; |
| 11 | -import { UIContext } from '@ohos.arkui.UIContext'; | ||
| 12 | 10 | ||
| 13 | let floatWindowClass: window.Window | null = null; | 11 | let floatWindowClass: window.Window | null = null; |
| 12 | +const TAG = 'EntryAbility' | ||
| 14 | 13 | ||
| 15 | export default class EntryAbility extends UIAbility { | 14 | export default class EntryAbility extends UIAbility { |
| 16 | onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { | 15 | onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { |
| 17 | StartupManager.sharedInstance().appOnCreate(want, launchParam, this.context) | 16 | StartupManager.sharedInstance().appOnCreate(want, launchParam, this.context) |
| 18 | - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); | 17 | + Logger.info(TAG, 'Ability onCreate'); |
| 19 | 18 | ||
| 20 | // 还没深色模式需求,暂直接不跟随系统。 | 19 | // 还没深色模式需求,暂直接不跟随系统。 |
| 21 | this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_LIGHT); | 20 | this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_LIGHT); |
| @@ -32,13 +31,13 @@ export default class EntryAbility extends UIAbility { | @@ -32,13 +31,13 @@ export default class EntryAbility extends UIAbility { | ||
| 32 | } | 31 | } |
| 33 | 32 | ||
| 34 | onDestroy(): void { | 33 | onDestroy(): void { |
| 35 | - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy'); | 34 | + Logger.info(TAG, 'Ability onDestroy'); |
| 36 | StartupManager.sharedInstance().appOnDestory() | 35 | StartupManager.sharedInstance().appOnDestory() |
| 37 | } | 36 | } |
| 38 | 37 | ||
| 39 | onWindowStageCreate(windowStage: window.WindowStage): void { | 38 | onWindowStageCreate(windowStage: window.WindowStage): void { |
| 40 | // Main window is created, set main page for this ability | 39 | // Main window is created, set main page for this ability |
| 41 | - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); | 40 | + Logger.info(TAG, 'Ability onWindowStageCreate'); |
| 42 | WindowModel.shared.setWindowStage(windowStage); | 41 | WindowModel.shared.setWindowStage(windowStage); |
| 43 | // 2. 获取布局避让遮挡的区域 | 42 | // 2. 获取布局避让遮挡的区域 |
| 44 | const windowClass: window.Window = windowStage.getMainWindowSync(); // 获取应用主窗口 | 43 | const windowClass: window.Window = windowStage.getMainWindowSync(); // 获取应用主窗口 |
| @@ -57,72 +56,50 @@ export default class EntryAbility extends UIAbility { | @@ -57,72 +56,50 @@ export default class EntryAbility extends UIAbility { | ||
| 57 | // 音频悬浮窗初始移动位置604为ui高度 | 56 | // 音频悬浮窗初始移动位置604为ui高度 |
| 58 | let initMoveY = vp2px(604) | 57 | let initMoveY = vp2px(604) |
| 59 | 58 | ||
| 60 | - | ||
| 61 | - // 在普通phone/折叠屏/tablet设备上以沉浸式(全屏)启动 | ||
| 62 | - if (DeviceUtil.isPhone() || DeviceUtil.isTablet()) { | ||
| 63 | - // 设置窗口的布局是否为沉浸式布局 | ||
| 64 | - // 沉浸式布局是指布局不避让状态栏与导航栏,组件可能产生与其重叠的情况。 | ||
| 65 | - // 非沉浸式布局是指布局避让状态栏与导航栏,组件不会与其重叠。 | ||
| 66 | - // windowClass.setWindowLayoutFullScreen(true) | ||
| 67 | - // 设置窗口全屏模式时窗口内导航栏、状态栏的属性 | ||
| 68 | - // windowClass.setWindowSystemBarProperties({ | ||
| 69 | - // statusBarContentColor: "#FFFFFF" | ||
| 70 | - // }) | ||
| 71 | - | ||
| 72 | - // 设置启动时窗口的显示方向属性, | ||
| 73 | - // 普通phone以PORTRAIT/竖屏显示模式启动 | ||
| 74 | - // 折叠屏和tablet是以AUTO_ROTATION_RESTRICTED/受开关控制的自动旋转模式启动 | ||
| 75 | - WindowModel.shared.setPreferredOrientation(window.Orientation.PORTRAIT) | ||
| 76 | - .then(() => { | ||
| 77 | - hilog.info(0x0000, 'testTag', 'setPreferredOrientation Succeeded'); | ||
| 78 | - }) | ||
| 79 | - .catch((err: Error) => { | ||
| 80 | - hilog.error(0x0000, 'testTag', | ||
| 81 | - `setPreferredOrientation catch, error error.name : ${err.name}, error.message:${err.message}`); | ||
| 82 | - }) | ||
| 83 | - } | 59 | + this.onWindowSetup(windowClass) |
| 84 | 60 | ||
| 85 | //../../../../../../features/wdLogin/src/main/ets/pages/launchPage/LaunchPage | 61 | //../../../../../../features/wdLogin/src/main/ets/pages/launchPage/LaunchPage |
| 86 | windowStage.loadContent('pages/launchPage/LaunchPage', (err, data) => { | 62 | windowStage.loadContent('pages/launchPage/LaunchPage', (err, data) => { |
| 87 | if (err.code) { | 63 | if (err.code) { |
| 88 | - hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); | 64 | + Logger.error(TAG, 'Failed to load the content. Cause: ' + JSON.stringify(err) ?? ''); |
| 89 | return; | 65 | return; |
| 90 | } | 66 | } |
| 91 | - hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', JSON.stringify(data) ?? ''); | 67 | + Logger.info(TAG, 'Succeeded in loading the content. Data: ' + JSON.stringify(data) ?? ''); |
| 92 | }); | 68 | }); |
| 93 | // 1.创建悬浮窗 | 69 | // 1.创建悬浮窗 |
| 94 | windowStage.createSubWindow('subWindow', (err: BusinessError, data) => { | 70 | windowStage.createSubWindow('subWindow', (err: BusinessError, data) => { |
| 95 | let errCode: number = err.code; | 71 | let errCode: number = err.code; |
| 96 | if (errCode) { | 72 | if (errCode) { |
| 97 | - console.error('floatWindowClass Failed to create the subwindow. Cause: ' + JSON.stringify(err)); | 73 | + Logger.error('floatWindowClass Failed to create the subwindow. Cause: ' + JSON.stringify(err)); |
| 98 | return; | 74 | return; |
| 99 | } | 75 | } |
| 100 | - console.info('floatWindowClass Succeeded in creating the subwindow. Data: ' + JSON.stringify(data)); | 76 | + Logger.info('floatWindowClass Succeeded in creating the subwindow. Data: ' + JSON.stringify(data)); |
| 101 | floatWindowClass = data; | 77 | floatWindowClass = data; |
| 102 | AppStorage.setOrCreate('floatWindowClass', floatWindowClass); | 78 | AppStorage.setOrCreate('floatWindowClass', floatWindowClass); |
| 103 | // 2.悬浮窗窗口创建成功后,设置悬浮窗的位置、大小及相关属性等。 | 79 | // 2.悬浮窗窗口创建成功后,设置悬浮窗的位置、大小及相关属性等。 |
| 104 | floatWindowClass.moveWindowTo(0, initMoveY, (err: BusinessError) => { | 80 | floatWindowClass.moveWindowTo(0, initMoveY, (err: BusinessError) => { |
| 105 | let errCode: number = err.code; | 81 | let errCode: number = err.code; |
| 106 | if (errCode) { | 82 | if (errCode) { |
| 107 | - console.error('floatWindowClass Failed to move the window. Cause:' + JSON.stringify(err)); | 83 | + Logger.error('floatWindowClass Failed to move the window. Cause:' + JSON.stringify(err)); |
| 108 | return; | 84 | return; |
| 109 | } | 85 | } |
| 110 | - console.info('floatWindowClass Succeeded in moving the window.'); | 86 | + Logger.info('floatWindowClass Succeeded in moving the window.'); |
| 111 | }); | 87 | }); |
| 112 | // 3.为悬浮窗加载对应的目标页面。 | 88 | // 3.为悬浮窗加载对应的目标页面。 |
| 113 | floatWindowClass.setUIContent("pages/view/AudioComponent", (err: BusinessError) => { | 89 | floatWindowClass.setUIContent("pages/view/AudioComponent", (err: BusinessError) => { |
| 114 | let errCode: number = err.code; | 90 | let errCode: number = err.code; |
| 115 | if (errCode) { | 91 | if (errCode) { |
| 116 | - console.error('floatWindowClass Failed to load the content. Cause:' + JSON.stringify(err)); | 92 | + Logger.error('floatWindowClass Failed to load the content. Cause:' + JSON.stringify(err)); |
| 117 | return; | 93 | return; |
| 118 | } | 94 | } |
| 119 | - console.info('floatWindowClass Succeeded in loading the content.'); | 95 | + Logger.info('floatWindowClass Succeeded in loading the content.'); |
| 120 | let color: string = 'rgba(0,0,0,0)'; | 96 | let color: string = 'rgba(0,0,0,0)'; |
| 121 | try { | 97 | try { |
| 122 | (floatWindowClass as window.Window).setWindowBackgroundColor(color); | 98 | (floatWindowClass as window.Window).setWindowBackgroundColor(color); |
| 123 | } catch (exception) { | 99 | } catch (exception) { |
| 124 | - console.error('Failed to set the background color. Cause: ' + JSON.stringify(exception)); | ||
| 125 | - }; | 100 | + Logger.error('Failed to set the background color. Cause: ' + JSON.stringify(exception)); |
| 101 | + } | ||
| 102 | + ; | ||
| 126 | }); | 103 | }); |
| 127 | 104 | ||
| 128 | floatWindowClass.on('windowEvent', (data) => { | 105 | floatWindowClass.on('windowEvent', (data) => { |
| @@ -132,33 +109,68 @@ export default class EntryAbility extends UIAbility { | @@ -132,33 +109,68 @@ export default class EntryAbility extends UIAbility { | ||
| 132 | }); | 109 | }); |
| 133 | } | 110 | } |
| 134 | 111 | ||
| 112 | + public async onWindowSetup(mainWindow: window.Window) { | ||
| 113 | + // 在普通phone/折叠屏/tablet设备上以沉浸式(全屏)启动 | ||
| 114 | + if (DeviceUtil.isPhone() || DeviceUtil.isTablet()) { | ||
| 115 | + // 设置窗口的布局是否为沉浸式布局 | ||
| 116 | + // 沉浸式布局是指布局不避让状态栏与导航栏,组件可能产生与其重叠的情况。 | ||
| 117 | + // 非沉浸式布局是指布局避让状态栏与导航栏,,组件不会与其重叠 | ||
| 118 | + mainWindow.setWindowLayoutFullScreen(true) | ||
| 119 | + //设置窗口全屏模式时窗口内导航栏、状态栏的属性 | ||
| 120 | + mainWindow.setWindowSystemBarProperties({ | ||
| 121 | + //statusBarColor:'#000000' | ||
| 122 | + statusBarContentColor: '#FFFFFF' | ||
| 123 | + }) | ||
| 124 | + mainWindow.setSpecificSystemBarEnabled('status', true) | ||
| 125 | + | ||
| 126 | + // 设置启动时窗口的显示方向属性, | ||
| 127 | + // 普通phone以PORTRAIT/竖屏显示模式启动 | ||
| 128 | + // 折叠屏和tablet是以AUTO_ROTATION_RESTRICTED/受开关控制的自动旋转模式启动 | ||
| 129 | + WindowModel.shared.setPreferredOrientation(window.Orientation.PORTRAIT) | ||
| 130 | + .then(() => { | ||
| 131 | + Logger.info(TAG, 'setPreferredOrientation Succeeded'); | ||
| 132 | + }) | ||
| 133 | + .catch((err: Error) => { | ||
| 134 | + Logger.info(TAG, | ||
| 135 | + `setPreferredOrientation catch, error error.name : ${err.name}, error.message:${err.message}`); | ||
| 136 | + }) | ||
| 137 | + } else if (DeviceUtil.is2in1()) { | ||
| 138 | + // 2in1(PC)设备不支持旋转(无横竖屏模式),会以默认窗口(非全屏)显示模式启动Logger.info(TAG,`start at 2in1 window device ) | ||
| 139 | + Logger.info(TAG, 'start at 2in1 window device') | ||
| 140 | + } else { | ||
| 141 | + // 轻量级智能穿戴/lite wearable device | ||
| 142 | + Logger.info(TAG, 'start at other type device') | ||
| 143 | + } | ||
| 144 | + | ||
| 145 | + } | ||
| 146 | + | ||
| 135 | destroyFloatWindow() { | 147 | destroyFloatWindow() { |
| 136 | (floatWindowClass as window.Window).destroyWindow((err: BusinessError) => { | 148 | (floatWindowClass as window.Window).destroyWindow((err: BusinessError) => { |
| 137 | let errCode: number = err.code; | 149 | let errCode: number = err.code; |
| 138 | if (errCode) { | 150 | if (errCode) { |
| 139 | - console.error('floatWindowClass Failed to destroy the window. Cause: ' + JSON.stringify(err)); | 151 | + Logger.error('floatWindowClass Failed to destroy the window. Cause: ' + JSON.stringify(err)); |
| 140 | return; | 152 | return; |
| 141 | } | 153 | } |
| 142 | - console.info('floatWindowClass Succeeded in destroying the window.'); | 154 | + Logger.info('floatWindowClass Succeeded in destroying the window.'); |
| 143 | }); | 155 | }); |
| 144 | } | 156 | } |
| 145 | 157 | ||
| 146 | onWindowStageDestroy(): void { | 158 | onWindowStageDestroy(): void { |
| 147 | // Main window is destroyed, release UI related resources | 159 | // Main window is destroyed, release UI related resources |
| 148 | this.destroyFloatWindow() | 160 | this.destroyFloatWindow() |
| 149 | - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); | 161 | + Logger.info(TAG, 'Ability onWindowStageDestroy'); |
| 150 | } | 162 | } |
| 151 | 163 | ||
| 152 | onForeground(): void { | 164 | onForeground(): void { |
| 153 | // Ability has brought to foreground | 165 | // Ability has brought to foreground |
| 154 | - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground'); | 166 | + Logger.info(TAG, 'Ability onForeground'); |
| 155 | 167 | ||
| 156 | EmitterUtils.sendEmptyEvent(EmitterEventId.APP_ENTER_FOREGROUD) | 168 | EmitterUtils.sendEmptyEvent(EmitterEventId.APP_ENTER_FOREGROUD) |
| 157 | } | 169 | } |
| 158 | 170 | ||
| 159 | onBackground(): void { | 171 | onBackground(): void { |
| 160 | // Ability has back to background | 172 | // Ability has back to background |
| 161 | - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground'); | 173 | + Logger.info(TAG, 'Ability onBackground'); |
| 162 | 174 | ||
| 163 | EmitterUtils.sendEmptyEvent(EmitterEventId.APP_ENTER_BACKGROUD) | 175 | EmitterUtils.sendEmptyEvent(EmitterEventId.APP_ENTER_BACKGROUD) |
| 164 | } | 176 | } |
| @@ -23,7 +23,7 @@ struct MorningEveningPaperPage { | @@ -23,7 +23,7 @@ struct MorningEveningPaperPage { | ||
| 23 | PageTransitionEnter({ type: RouteType.Push, duration: 300 }) | 23 | PageTransitionEnter({ type: RouteType.Push, duration: 300 }) |
| 24 | .slide(SlideEffect.Bottom).onEnter((type: RouteType, progress: number) => { | 24 | .slide(SlideEffect.Bottom).onEnter((type: RouteType, progress: number) => { |
| 25 | if (progress >= 0.99) { | 25 | if (progress >= 0.99) { |
| 26 | - WindowModel.shared.setWindowLayoutFullScreen(true) | 26 | + // WindowModel.shared.setWindowLayoutFullScreen(true) |
| 27 | WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', }) | 27 | WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', }) |
| 28 | } | 28 | } |
| 29 | }) | 29 | }) |
| @@ -43,14 +43,14 @@ struct MorningEveningPaperPage { | @@ -43,14 +43,14 @@ struct MorningEveningPaperPage { | ||
| 43 | onPageShow() { | 43 | onPageShow() { |
| 44 | Logger.info(TAG, 'onPageShow'); | 44 | Logger.info(TAG, 'onPageShow'); |
| 45 | if (this.isPageShow) { | 45 | if (this.isPageShow) { |
| 46 | - WindowModel.shared.setWindowLayoutFullScreen(true) | 46 | + // WindowModel.shared.setWindowLayoutFullScreen(true) |
| 47 | WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', }) | 47 | WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', }) |
| 48 | } | 48 | } |
| 49 | this.pageShowTime = DateTimeUtils.getTimeStamp() | 49 | this.pageShowTime = DateTimeUtils.getTimeStamp() |
| 50 | } | 50 | } |
| 51 | 51 | ||
| 52 | onPageHide() { | 52 | onPageHide() { |
| 53 | - WindowModel.shared.setWindowLayoutFullScreen(false) | 53 | + // WindowModel.shared.setWindowLayoutFullScreen(false) |
| 54 | WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', }) | 54 | WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', }) |
| 55 | this.isPageShow = true | 55 | this.isPageShow = true |
| 56 | Logger.info(TAG, 'onPageHide'); | 56 | Logger.info(TAG, 'onPageHide'); |
| @@ -48,7 +48,6 @@ struct MultiPictureDetailPage { | @@ -48,7 +48,6 @@ struct MultiPictureDetailPage { | ||
| 48 | } | 48 | } |
| 49 | 49 | ||
| 50 | aboutToAppear() { | 50 | aboutToAppear() { |
| 51 | - this.openFullScreen() | ||
| 52 | 51 | ||
| 53 | Logger.info(TAG, 'aboutToDisappear'); | 52 | Logger.info(TAG, 'aboutToDisappear'); |
| 54 | 53 | ||
| @@ -68,13 +67,11 @@ struct MultiPictureDetailPage { | @@ -68,13 +67,11 @@ struct MultiPictureDetailPage { | ||
| 68 | 67 | ||
| 69 | aboutToDisappear(): void { | 68 | aboutToDisappear(): void { |
| 70 | console.log(TAG, 'aboutToDisappear') | 69 | console.log(TAG, 'aboutToDisappear') |
| 71 | - this.closeFullScreen() | ||
| 72 | } | 70 | } |
| 73 | 71 | ||
| 74 | onPageShow(): void { | 72 | onPageShow(): void { |
| 75 | console.log(TAG, 'onPageShow') | 73 | console.log(TAG, 'onPageShow') |
| 76 | this.pageShowTime = DateTimeUtils.getTimeStamp() | 74 | this.pageShowTime = DateTimeUtils.getTimeStamp() |
| 77 | - this.openFullScreen() | ||
| 78 | 75 | ||
| 79 | } | 76 | } |
| 80 | 77 | ||
| @@ -84,25 +81,7 @@ struct MultiPictureDetailPage { | @@ -84,25 +81,7 @@ struct MultiPictureDetailPage { | ||
| 84 | let duration = 0 | 81 | let duration = 0 |
| 85 | duration = Math.floor((this.pageHideTime - this.pageShowTime)/1000) | 82 | duration = Math.floor((this.pageHideTime - this.pageShowTime)/1000) |
| 86 | TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Atlas_Detail,TrackConstants.PageName.Atlas_Detail,duration) | 83 | TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Atlas_Detail,TrackConstants.PageName.Atlas_Detail,duration) |
| 87 | - this.closeFullScreen() | ||
| 88 | } | 84 | } |
| 89 | 85 | ||
| 90 | - /** | ||
| 91 | - * 开启沉浸式 | ||
| 92 | - * TODO:颜色待根据业务接口修改 | ||
| 93 | - */ | ||
| 94 | - openFullScreen() { | ||
| 95 | - WindowModel.shared.setWindowLayoutFullScreen(true) | ||
| 96 | - WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', }) | ||
| 97 | - } | ||
| 98 | - | ||
| 99 | - /** | ||
| 100 | - * 关闭沉浸式 | ||
| 101 | - * TODO:颜色待根据业务接口修改 | ||
| 102 | - */ | ||
| 103 | - closeFullScreen() { | ||
| 104 | - WindowModel.shared.setWindowLayoutFullScreen(false) | ||
| 105 | - WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', }) | ||
| 106 | - } | ||
| 107 | 86 | ||
| 108 | } | 87 | } |
| @@ -7,6 +7,7 @@ import LaunchDataModel, { defaultLaunchModel } from '../viewModel/LaunchDataMode | @@ -7,6 +7,7 @@ import LaunchDataModel, { defaultLaunchModel } from '../viewModel/LaunchDataMode | ||
| 7 | 7 | ||
| 8 | import { ParamType, TrackConstants, TrackingButton, TrackingContent } from 'wdTracking/Index'; | 8 | import { ParamType, TrackConstants, TrackingButton, TrackingContent } from 'wdTracking/Index'; |
| 9 | import { ContentDTO } from 'wdBean/Index'; | 9 | import { ContentDTO } from 'wdBean/Index'; |
| 10 | +import { Core } from '@ohos/hypium'; | ||
| 10 | 11 | ||
| 11 | 12 | ||
| 12 | @Entry | 13 | @Entry |
| @@ -62,7 +63,7 @@ struct LaunchAdvertisingPage { | @@ -62,7 +63,7 @@ struct LaunchAdvertisingPage { | ||
| 62 | }else { | 63 | }else { |
| 63 | //显示图片 | 64 | //显示图片 |
| 64 | Image(this.defaultModel.bootScreenUrl) | 65 | Image(this.defaultModel.bootScreenUrl) |
| 65 | - .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM]) | 66 | + // .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM]) |
| 66 | .width('100%') | 67 | .width('100%') |
| 67 | .height('100%') | 68 | .height('100%') |
| 68 | } | 69 | } |
| @@ -74,11 +75,10 @@ struct LaunchAdvertisingPage { | @@ -74,11 +75,10 @@ struct LaunchAdvertisingPage { | ||
| 74 | bottom: 0 | 75 | bottom: 0 |
| 75 | }) | 76 | }) |
| 76 | 77 | ||
| 77 | - | ||
| 78 | Stack(){ | 78 | Stack(){ |
| 79 | Column(){ | 79 | Column(){ |
| 80 | Row(){ | 80 | Row(){ |
| 81 | - if (this.defaultModel.isAd === '1') { | 81 | + if (this.defaultModel.isAd == '1') { |
| 82 | Text('广告') | 82 | Text('广告') |
| 83 | .fontColor(Color.White) | 83 | .fontColor(Color.White) |
| 84 | .textAlign(TextAlign.Center) | 84 | .textAlign(TextAlign.Center) |
| @@ -108,7 +108,7 @@ struct LaunchAdvertisingPage { | @@ -108,7 +108,7 @@ struct LaunchAdvertisingPage { | ||
| 108 | this.trackingLaunchJumpOver() | 108 | this.trackingLaunchJumpOver() |
| 109 | }).margin({right:16}) | 109 | }).margin({right:16}) |
| 110 | 110 | ||
| 111 | - }.margin({top:10}).width('100%').height('56lpx') | 111 | + }.margin({top:50}).width('100%').height('56lpx') |
| 112 | 112 | ||
| 113 | Blank() | 113 | Blank() |
| 114 | 114 | ||
| @@ -132,18 +132,21 @@ struct LaunchAdvertisingPage { | @@ -132,18 +132,21 @@ struct LaunchAdvertisingPage { | ||
| 132 | .margin({ | 132 | .margin({ |
| 133 | bottom: '51lpx' | 133 | bottom: '51lpx' |
| 134 | }) | 134 | }) |
| 135 | + .borderWidth(1) | ||
| 136 | + .borderColor(Color.White) | ||
| 135 | .backgroundColor('#80000000') | 137 | .backgroundColor('#80000000') |
| 136 | .onClick(()=>{ | 138 | .onClick(()=>{ |
| 137 | this.action() | 139 | this.action() |
| 138 | }) | 140 | }) |
| 139 | } | 141 | } |
| 140 | - if(this.defaultModel.screenType === '1') { | 142 | + if(this.defaultModel.screenType == '1') { |
| 141 | Column(){ | 143 | Column(){ |
| 142 | Image($r('app.media.LaunchPage_logo')) | 144 | Image($r('app.media.LaunchPage_logo')) |
| 143 | .width('278lpx') | 145 | .width('278lpx') |
| 144 | .height('154lpx') | 146 | .height('154lpx') |
| 145 | .margin({top:20}) | 147 | .margin({top:20}) |
| 146 | - }.width('100%').height('16%').backgroundColor(Color.White).expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM]) | 148 | + }.width('100%').height('16%').backgroundColor(Color.White) |
| 149 | + // .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM]) | ||
| 147 | } | 150 | } |
| 148 | } | 151 | } |
| 149 | .width('100%') | 152 | .width('100%') |
| @@ -157,7 +160,7 @@ struct LaunchAdvertisingPage { | @@ -157,7 +160,7 @@ struct LaunchAdvertisingPage { | ||
| 157 | .height('100%') | 160 | .height('100%') |
| 158 | .margin({top:'0'}) | 161 | .margin({top:'0'}) |
| 159 | } | 162 | } |
| 160 | - .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM]) | 163 | + // .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM]) |
| 161 | .width('100%') | 164 | .width('100%') |
| 162 | .height('100%') | 165 | .height('100%') |
| 163 | .backgroundColor(Color.White) | 166 | .backgroundColor(Color.White) |
| @@ -176,7 +179,7 @@ struct LaunchAdvertisingPage { | @@ -176,7 +179,7 @@ struct LaunchAdvertisingPage { | ||
| 176 | if (this.defaultModel.openType == '2') { | 179 | if (this.defaultModel.openType == '2') { |
| 177 | //端外打开 | 180 | //端外打开 |
| 178 | ProcessUtils.jumpExternalWebPage(this.defaultModel.linkUrl) | 181 | ProcessUtils.jumpExternalWebPage(this.defaultModel.linkUrl) |
| 179 | - }else { | 182 | + }else if(this.defaultModel.openType == '1'){ |
| 180 | //端内打开 | 183 | //端内打开 |
| 181 | ProcessUtils.gotoDefaultWebPage(this.defaultModel.linkUrl) | 184 | ProcessUtils.gotoDefaultWebPage(this.defaultModel.linkUrl) |
| 182 | } | 185 | } |
| @@ -212,7 +215,7 @@ struct LaunchAdvertisingPage { | @@ -212,7 +215,7 @@ struct LaunchAdvertisingPage { | ||
| 212 | this.defaultModel.screenName = dataModel.launchAdInfo[0].matInfo.advTitle | 215 | this.defaultModel.screenName = dataModel.launchAdInfo[0].matInfo.advTitle |
| 213 | this.defaultModel.durations = dataModel.launchAdInfo[0].displayDuration | 216 | this.defaultModel.durations = dataModel.launchAdInfo[0].displayDuration |
| 214 | this.defaultModel.linkUrl = dataModel.launchAdInfo[0].matInfo.linkUrl | 217 | this.defaultModel.linkUrl = dataModel.launchAdInfo[0].matInfo.linkUrl |
| 215 | - if (dataModel.launchAdInfo[0].matInfo.startStyle === '1') { | 218 | + if (dataModel.launchAdInfo[0].matInfo.startStyle == '1') { |
| 216 | this.defaultModel.screenType = '2' | 219 | this.defaultModel.screenType = '2' |
| 217 | }else { | 220 | }else { |
| 218 | this.defaultModel.screenType = '1' | 221 | this.defaultModel.screenType = '1' |
| @@ -222,6 +225,7 @@ struct LaunchAdvertisingPage { | @@ -222,6 +225,7 @@ struct LaunchAdvertisingPage { | ||
| 222 | this.defaultModel.bootVideoUrl = dataModel.launchAdInfo[0].matInfo.matVideoUrl | 225 | this.defaultModel.bootVideoUrl = dataModel.launchAdInfo[0].matInfo.matVideoUrl |
| 223 | this.defaultModel.showType = dataModel.launchAdInfo[0].matInfo.matType | 226 | this.defaultModel.showType = dataModel.launchAdInfo[0].matInfo.matType |
| 224 | this.defaultModel.isAd = '1' | 227 | this.defaultModel.isAd = '1' |
| 228 | + this.defaultModel.openType = dataModel.launchAdInfo[0].matInfo.openType | ||
| 225 | } | 229 | } |
| 226 | } | 230 | } |
| 227 | 231 |
| @@ -23,6 +23,7 @@ let storage = LocalStorage.getShared(); | @@ -23,6 +23,7 @@ let storage = LocalStorage.getShared(); | ||
| 23 | @Component | 23 | @Component |
| 24 | export struct BottomNavigationComponent { | 24 | export struct BottomNavigationComponent { |
| 25 | @Provide bottomRectHeight: number = 0 | 25 | @Provide bottomRectHeight: number = 0 |
| 26 | + private bottomRectHeight1: string = AppStorage.get<number>('bottomSafeHeight') + 'px'; | ||
| 26 | @Provide topRectHeight: number = 0 | 27 | @Provide topRectHeight: number = 0 |
| 27 | @Provide isLayoutFullScreen: boolean = false | 28 | @Provide isLayoutFullScreen: boolean = false |
| 28 | @Provide displayDirection: DisplayDirection = DisplayDirection.VERTICAL | 29 | @Provide displayDirection: DisplayDirection = DisplayDirection.VERTICAL |
| @@ -73,6 +74,7 @@ export struct BottomNavigationComponent { | @@ -73,6 +74,7 @@ export struct BottomNavigationComponent { | ||
| 73 | } | 74 | } |
| 74 | 75 | ||
| 75 | build() { | 76 | build() { |
| 77 | + Column() { | ||
| 76 | Tabs({ barPosition: BarPosition.End, index: this.currentNavIndex, controller: this.navController }) { | 78 | Tabs({ barPosition: BarPosition.End, index: this.currentNavIndex, controller: this.navController }) { |
| 77 | ForEach(this.bottomNavList, (navItem: BottomNavDTO, index: number) => { | 79 | ForEach(this.bottomNavList, (navItem: BottomNavDTO, index: number) => { |
| 78 | TabContent() { | 80 | TabContent() { |
| @@ -100,7 +102,7 @@ export struct BottomNavigationComponent { | @@ -100,7 +102,7 @@ export struct BottomNavigationComponent { | ||
| 100 | } | 102 | } |
| 101 | .tabBar(this.tabBarBuilder(navItem, index)) | 103 | .tabBar(this.tabBarBuilder(navItem, index)) |
| 102 | 104 | ||
| 103 | - .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP]) | 105 | + // .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP]) |
| 104 | }); | 106 | }); |
| 105 | 107 | ||
| 106 | } | 108 | } |
| @@ -113,10 +115,10 @@ export struct BottomNavigationComponent { | @@ -113,10 +115,10 @@ export struct BottomNavigationComponent { | ||
| 113 | .barBackgroundColor(this.barBackgroundColor) | 115 | .barBackgroundColor(this.barBackgroundColor) |
| 114 | // 备注:鸿蒙目前只有修改三线导航背景方法,对于全面屏导航条手机需要设置背景色并使其扩散到导航区域 | 116 | // 备注:鸿蒙目前只有修改三线导航背景方法,对于全面屏导航条手机需要设置背景色并使其扩散到导航区域 |
| 115 | .backgroundColor(this.barBackgroundColor) | 117 | .backgroundColor(this.barBackgroundColor) |
| 116 | - .expandSafeArea([SafeAreaType.SYSTEM]) | ||
| 117 | - | ||
| 118 | - // .padding({ bottom: this.bottomRectHeight + 'px', top: this.topRectHeight + 'px' }) // 此处margin具体数值在实际中应与导航条区域高度保持一致 | 118 | + .layoutWeight(1) |
| 119 | 119 | ||
| 120 | + Blank().width('100%').height(this.bottomRectHeight1).backgroundColor(this.barBackgroundColor) | ||
| 121 | + }.height('100%').width('100%') | ||
| 120 | } | 122 | } |
| 121 | 123 | ||
| 122 | @Builder | 124 | @Builder |
| @@ -214,6 +214,17 @@ export struct MultiPictureDetailPageComponent { | @@ -214,6 +214,17 @@ export struct MultiPictureDetailPageComponent { | ||
| 214 | left: 16, | 214 | left: 16, |
| 215 | right: 0 | 215 | right: 0 |
| 216 | }) | 216 | }) |
| 217 | + .onClick(() => { | ||
| 218 | + if (this.contentDetailData.rmhInfo?.cnMainControl === 1) { | ||
| 219 | + // 号主页 | ||
| 220 | + const params: Params = { | ||
| 221 | + creatorId: this.contentDetailData.rmhInfo.rmhId, | ||
| 222 | + pageID: '' | ||
| 223 | + } | ||
| 224 | + WDRouterRule.jumpWithPage(WDRouterPage.peopleShipHomePage, params) | ||
| 225 | + } | ||
| 226 | + | ||
| 227 | + }) | ||
| 217 | 228 | ||
| 218 | Row() { | 229 | Row() { |
| 219 | if (this.followStatus == '0') { | 230 | if (this.followStatus == '0') { |
| 1 | import { insightIntent, InsightIntentExecutor } from '@kit.AbilityKit'; | 1 | import { insightIntent, InsightIntentExecutor } from '@kit.AbilityKit'; |
| 2 | import { window } from '@kit.ArkUI'; | 2 | import { window } from '@kit.ArkUI'; |
| 3 | import { BusinessError } from '@kit.BasicServicesKit'; | 3 | import { BusinessError } from '@kit.BasicServicesKit'; |
| 4 | +import { NetworkUtil, SPHelper, ToastUtils } from 'wdKit'; | ||
| 4 | import { ProcessUtils } from 'wdRouter'; | 5 | import { ProcessUtils } from 'wdRouter'; |
| 6 | +import DailyPaperTopicModel from 'wdComponent/src/main/ets/model/DailyPaperTopicModel' | ||
| 7 | + | ||
| 5 | /** | 8 | /** |
| 6 | * 意图调用 | 9 | * 意图调用 |
| 7 | */ | 10 | */ |
| @@ -19,7 +22,7 @@ export default class InsightIntentExecutorImpl extends InsightIntentExecutor { | @@ -19,7 +22,7 @@ export default class InsightIntentExecutorImpl extends InsightIntentExecutor { | ||
| 19 | */ | 22 | */ |
| 20 | onExecuteInUIAbilityForegroundMode(name: string, param: Record<string, Object>, pageLoader: window.WindowStage): | 23 | onExecuteInUIAbilityForegroundMode(name: string, param: Record<string, Object>, pageLoader: window.WindowStage): |
| 21 | Promise<insightIntent.ExecuteResult> { | 24 | Promise<insightIntent.ExecuteResult> { |
| 22 | - console.log('yzl onExecuteInUIAbilityForegroundMode',name,JSON.stringify(param)) | 25 | + console.log('yzl onExecuteInUIAbilityForegroundMode', name, JSON.stringify(param)) |
| 23 | // 根据意图名称分发处理逻辑 | 26 | // 根据意图名称分发处理逻辑 |
| 24 | switch (name) { | 27 | switch (name) { |
| 25 | case InsightIntentExecutorImpl.ViewBlog: | 28 | case InsightIntentExecutorImpl.ViewBlog: |
| @@ -36,19 +39,19 @@ export default class InsightIntentExecutorImpl extends InsightIntentExecutor { | @@ -36,19 +39,19 @@ export default class InsightIntentExecutorImpl extends InsightIntentExecutor { | ||
| 36 | } | 39 | } |
| 37 | } as insightIntent.ExecuteResult) | 40 | } as insightIntent.ExecuteResult) |
| 38 | } | 41 | } |
| 42 | + | ||
| 39 | /** | 43 | /** |
| 40 | * 实现习惯推荐功能 | 44 | * 实现习惯推荐功能 |
| 41 | * @param param 意图参数 | 45 | * @param param 意图参数 |
| 42 | * @param pageLoader 窗口 | 46 | * @param pageLoader 窗口 |
| 43 | */ | 47 | */ |
| 44 | - private jumpToViewBlog(param: Record<string, Object>, pageLoader: window.WindowStage): Promise<insightIntent.ExecuteResult> { | ||
| 45 | - console.log('yzl jumpToView',JSON.stringify(param)) | 48 | + private jumpToViewBlog(param: Record<string, Object>, |
| 49 | + pageLoader: window.WindowStage): Promise<insightIntent.ExecuteResult> { | ||
| 50 | + console.log('yzl jumpToView', JSON.stringify(param)) | ||
| 46 | return new Promise((resolve, reject) => { | 51 | return new Promise((resolve, reject) => { |
| 47 | - // TODO 实现意图调用,loadContent的入参为歌曲落地页路径,例如:pages/SongPage | ||
| 48 | // TODO 热启动是否切到主页 | 52 | // TODO 热启动是否切到主页 |
| 49 | pageLoader.loadContent('pages/MainPage') | 53 | pageLoader.loadContent('pages/MainPage') |
| 50 | .then(() => { | 54 | .then(() => { |
| 51 | - | ||
| 52 | resolve({ | 55 | resolve({ |
| 53 | code: 0, | 56 | code: 0, |
| 54 | result: { | 57 | result: { |
| @@ -72,12 +75,26 @@ export default class InsightIntentExecutorImpl extends InsightIntentExecutor { | @@ -72,12 +75,26 @@ export default class InsightIntentExecutorImpl extends InsightIntentExecutor { | ||
| 72 | * @param param 意图参数 | 75 | * @param param 意图参数 |
| 73 | * @param pageLoader 窗口 | 76 | * @param pageLoader 窗口 |
| 74 | */ | 77 | */ |
| 75 | - private jumpToViewColumnUpdate(param: Record<string, Object>, pageLoader: window.WindowStage): Promise<insightIntent.ExecuteResult> { | ||
| 76 | - console.log('yzl jumpToViewColum',JSON.stringify(param)) | 78 | + private jumpToViewColumnUpdate(param: Record<string, Object>, |
| 79 | + pageLoader: window.WindowStage): Promise<insightIntent.ExecuteResult> { | ||
| 77 | return new Promise((resolve, reject) => { | 80 | return new Promise((resolve, reject) => { |
| 78 | pageLoader.loadContent('pages/MainPage') | 81 | pageLoader.loadContent('pages/MainPage') |
| 79 | .then(() => { | 82 | .then(() => { |
| 80 | - ProcessUtils.gotoMorningEveningPaper() | 83 | + if (NetworkUtil.isNetConnected()) { |
| 84 | + DailyPaperTopicModel.getDailyPaperTopic().then(dailyPaperTopicBean => { | ||
| 85 | + if (dailyPaperTopicBean && dailyPaperTopicBean.id > 0) { | ||
| 86 | + SPHelper.default.saveSync('dailyPaperTopicPageId', dailyPaperTopicBean.id); | ||
| 87 | + ProcessUtils.gotoMorningEveningPaper() //跳转至早晚报页面 | ||
| 88 | + } else { | ||
| 89 | + ToastUtils.showToast('暂无早晚报信息', 1000) | ||
| 90 | + } | ||
| 91 | + }).catch((err: string) => { | ||
| 92 | + console.log('yzlerr',JSON.stringify(err)) | ||
| 93 | + ToastUtils.showToast('暂无早晚报信息', 1000) | ||
| 94 | + }) | ||
| 95 | + } else { | ||
| 96 | + ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000) | ||
| 97 | + } | ||
| 81 | resolve({ | 98 | resolve({ |
| 82 | code: 0, | 99 | code: 0, |
| 83 | result: { | 100 | result: { |
-
Please register or login to post a comment