Showing
2 changed files
with
72 additions
and
28 deletions
| 1 | -import { NetworkUtil, Logger, NetworkType, SPHelper, WindowModel} from 'wdKit'; | 1 | +import { NetworkUtil, Logger, NetworkType, SPHelper, WindowModel, StringUtils} from 'wdKit'; |
| 2 | import { ResponseDTO } from 'wdNetwork'; | 2 | import { ResponseDTO } from 'wdNetwork'; |
| 3 | import { | 3 | import { |
| 4 | ContentDetailDTO, | 4 | ContentDetailDTO, |
| @@ -102,25 +102,41 @@ export struct MultiPictureDetailPageComponent { | @@ -102,25 +102,41 @@ export struct MultiPictureDetailPageComponent { | ||
| 102 | Row({ space: 8 }) { | 102 | Row({ space: 8 }) { |
| 103 | if (this.getImgUrl()){ | 103 | if (this.getImgUrl()){ |
| 104 | Row() { | 104 | Row() { |
| 105 | - Image(this.getImgUrl()) | ||
| 106 | - .borderRadius(24) | ||
| 107 | - .aspectRatio(1) | ||
| 108 | - .border({ width: 1, color: Color.White, style: BorderStyle.Solid }) | ||
| 109 | - .width(36) | ||
| 110 | - .height(36) | ||
| 111 | - .objectFit(ImageFit.Fill) | ||
| 112 | - .interpolation(ImageInterpolation.High) | ||
| 113 | - .onClick(() => { | ||
| 114 | - if (this.contentDetailData.rmhInfo?.cnMainControl === 1) { | ||
| 115 | - // 号主页 | ||
| 116 | - const params: Params = { | ||
| 117 | - creatorId: this.contentDetailData.rmhInfo.rmhId, | ||
| 118 | - pageID: '' | ||
| 119 | - } | ||
| 120 | - WDRouterRule.jumpWithPage(WDRouterPage.peopleShipHomePage, params) | 105 | + Stack() { |
| 106 | + Image(this.getImgUrl()) | ||
| 107 | + .borderRadius(24) | ||
| 108 | + .aspectRatio(1) | ||
| 109 | + .border({ width: 1, color: Color.White, style: BorderStyle.Solid }) | ||
| 110 | + .width(36) | ||
| 111 | + .height(36) | ||
| 112 | + .objectFit(ImageFit.Fill) | ||
| 113 | + .interpolation(ImageInterpolation.High) | ||
| 114 | + if(!StringUtils.isEmpty(this.contentDetailData.rmhInfo?.authIcon)){ | ||
| 115 | + Stack() { | ||
| 116 | + Image(this.contentDetailData.rmhInfo?.authIcon) | ||
| 117 | + .width($r('app.float.vp_13')) | ||
| 118 | + .height($r('app.float.vp_13')) | ||
| 119 | + .objectFit(ImageFit.Cover) | ||
| 121 | } | 120 | } |
| 121 | + .width(36) | ||
| 122 | + .height(36) | ||
| 123 | + .alignContent(Alignment.BottomEnd) | ||
| 124 | + } | ||
| 125 | + } | ||
| 126 | + .width(36) | ||
| 127 | + .height(36) | ||
| 128 | + .alignContent(Alignment.Center) | ||
| 129 | + .onClick(() => { | ||
| 130 | + if (this.contentDetailData.rmhInfo?.cnMainControl === 1) { | ||
| 131 | + // 号主页 | ||
| 132 | + const params: Params = { | ||
| 133 | + creatorId: this.contentDetailData.rmhInfo.rmhId, | ||
| 134 | + pageID: '' | ||
| 135 | + } | ||
| 136 | + WDRouterRule.jumpWithPage(WDRouterPage.peopleShipHomePage, params) | ||
| 137 | + } | ||
| 122 | 138 | ||
| 123 | - }) | 139 | + }) |
| 124 | } | 140 | } |
| 125 | .width('13%') | 141 | .width('13%') |
| 126 | .height('100%') | 142 | .height('100%') |
| @@ -380,11 +396,11 @@ export struct MultiPictureDetailPageComponent { | @@ -380,11 +396,11 @@ export struct MultiPictureDetailPageComponent { | ||
| 380 | } | 396 | } |
| 381 | this.netStatus = undefined | 397 | this.netStatus = undefined |
| 382 | this.contentDetailData = resDTO.data?.[0]; | 398 | this.contentDetailData = resDTO.data?.[0]; |
| 383 | - if (this.contentDetailData.rmhPlatform == 1) { | ||
| 384 | - WindowModel.shared.setWindowSystemBarProperties({ | ||
| 385 | - statusBarContentColor: '#ffffff', | ||
| 386 | - }) | ||
| 387 | - } | 399 | + // if (this.contentDetailData.rmhPlatform == 1) { |
| 400 | + // WindowModel.shared.setWindowSystemBarProperties({ | ||
| 401 | + // statusBarContentColor: '#ffffff', | ||
| 402 | + // }) | ||
| 403 | + // } | ||
| 388 | if (this.contentDetailData?.openComment) { | 404 | if (this.contentDetailData?.openComment) { |
| 389 | this.publishCommentModel.targetId = String(this.contentDetailData?.newsId || '') | 405 | this.publishCommentModel.targetId = String(this.contentDetailData?.newsId || '') |
| 390 | this.publishCommentModel.targetRelId = String(this.contentDetailData?.reLInfo?.relId) | 406 | this.publishCommentModel.targetRelId = String(this.contentDetailData?.reLInfo?.relId) |
| @@ -2,7 +2,7 @@ import { Logger } from 'wdKit'; | @@ -2,7 +2,7 @@ import { Logger } from 'wdKit'; | ||
| 2 | import { MultiPictureDetailPageComponent } from 'wdComponent'; | 2 | import { MultiPictureDetailPageComponent } from 'wdComponent'; |
| 3 | import router from '@ohos.router'; | 3 | import router from '@ohos.router'; |
| 4 | import { Params, Action } from 'wdBean'; | 4 | import { Params, Action } from 'wdBean'; |
| 5 | - | 5 | +import { WindowModel } from 'wdKit/Index'; |
| 6 | const TAG = 'MultiPictureDetailPage'; | 6 | const TAG = 'MultiPictureDetailPage'; |
| 7 | 7 | ||
| 8 | /** | 8 | /** |
| @@ -26,6 +26,8 @@ struct MultiPictureDetailPage { | @@ -26,6 +26,8 @@ struct MultiPictureDetailPage { | ||
| 26 | }) | 26 | }) |
| 27 | } | 27 | } |
| 28 | } | 28 | } |
| 29 | + .padding({top:44}) | ||
| 30 | + .backgroundColor(Color.Black) | ||
| 29 | } | 31 | } |
| 30 | 32 | ||
| 31 | pageTransition(){ | 33 | pageTransition(){ |
| @@ -38,6 +40,10 @@ struct MultiPictureDetailPage { | @@ -38,6 +40,10 @@ struct MultiPictureDetailPage { | ||
| 38 | } | 40 | } |
| 39 | 41 | ||
| 40 | aboutToAppear() { | 42 | aboutToAppear() { |
| 43 | + this.openFullScreen() | ||
| 44 | + | ||
| 45 | + Logger.info(TAG, 'aboutToDisappear'); | ||
| 46 | + | ||
| 41 | let par:Action = router.getParams() as Action; | 47 | let par:Action = router.getParams() as Action; |
| 42 | let params = par?.params; | 48 | let params = par?.params; |
| 43 | this.relId = params?.extra?.relId || ''; | 49 | this.relId = params?.extra?.relId || ''; |
| @@ -47,11 +53,33 @@ struct MultiPictureDetailPage { | @@ -47,11 +53,33 @@ struct MultiPictureDetailPage { | ||
| 47 | Logger.info(TAG, 'params', JSON.stringify(params)); | 53 | Logger.info(TAG, 'params', JSON.stringify(params)); |
| 48 | } | 54 | } |
| 49 | 55 | ||
| 50 | - aboutToDisappear() { | ||
| 51 | - Logger.info(TAG, 'aboutToDisappear'); | ||
| 52 | - } | ||
| 53 | - | ||
| 54 | onBackPress() { | 56 | onBackPress() { |
| 55 | Logger.info(TAG, 'onBackPress'); | 57 | Logger.info(TAG, 'onBackPress'); |
| 56 | } | 58 | } |
| 59 | + | ||
| 60 | + /** | ||
| 61 | + * 开启沉浸式 | ||
| 62 | + * TODO:颜色待根据业务接口修改 | ||
| 63 | + */ | ||
| 64 | + openFullScreen() { | ||
| 65 | + WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', }) | ||
| 66 | + WindowModel.shared.setWindowLayoutFullScreen(true) | ||
| 67 | + // WindowModel.shared.setWindowSystemBarEnable([]) | ||
| 68 | + } | ||
| 69 | + | ||
| 70 | + aboutToDisappear(): void { | ||
| 71 | + console.log(TAG, 'aboutToDisappear') | ||
| 72 | + this.closeFullScreen() | ||
| 73 | + } | ||
| 74 | + | ||
| 75 | + /** | ||
| 76 | + * 关闭沉浸式 | ||
| 77 | + * TODO:颜色待根据业务接口修改 | ||
| 78 | + */ | ||
| 79 | + closeFullScreen() { | ||
| 80 | + WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', }) | ||
| 81 | + WindowModel.shared.setWindowLayoutFullScreen(false) | ||
| 82 | + // WindowModel.shared.setWindowSystemBarEnable(['status', 'navigation']) | ||
| 83 | + } | ||
| 84 | + | ||
| 57 | } | 85 | } |
-
Please register or login to post a comment