张善主

fix(图集):沉浸式/加v

import { NetworkUtil, Logger, NetworkType, SPHelper, WindowModel} from 'wdKit';
import { NetworkUtil, Logger, NetworkType, SPHelper, WindowModel, StringUtils} from 'wdKit';
import { ResponseDTO } from 'wdNetwork';
import {
ContentDetailDTO,
... ... @@ -102,25 +102,41 @@ export struct MultiPictureDetailPageComponent {
Row({ space: 8 }) {
if (this.getImgUrl()){
Row() {
Image(this.getImgUrl())
.borderRadius(24)
.aspectRatio(1)
.border({ width: 1, color: Color.White, style: BorderStyle.Solid })
.width(36)
.height(36)
.objectFit(ImageFit.Fill)
.interpolation(ImageInterpolation.High)
.onClick(() => {
if (this.contentDetailData.rmhInfo?.cnMainControl === 1) {
// 号主页
const params: Params = {
creatorId: this.contentDetailData.rmhInfo.rmhId,
pageID: ''
}
WDRouterRule.jumpWithPage(WDRouterPage.peopleShipHomePage, params)
Stack() {
Image(this.getImgUrl())
.borderRadius(24)
.aspectRatio(1)
.border({ width: 1, color: Color.White, style: BorderStyle.Solid })
.width(36)
.height(36)
.objectFit(ImageFit.Fill)
.interpolation(ImageInterpolation.High)
if(!StringUtils.isEmpty(this.contentDetailData.rmhInfo?.authIcon)){
Stack() {
Image(this.contentDetailData.rmhInfo?.authIcon)
.width($r('app.float.vp_13'))
.height($r('app.float.vp_13'))
.objectFit(ImageFit.Cover)
}
.width(36)
.height(36)
.alignContent(Alignment.BottomEnd)
}
}
.width(36)
.height(36)
.alignContent(Alignment.Center)
.onClick(() => {
if (this.contentDetailData.rmhInfo?.cnMainControl === 1) {
// 号主页
const params: Params = {
creatorId: this.contentDetailData.rmhInfo.rmhId,
pageID: ''
}
WDRouterRule.jumpWithPage(WDRouterPage.peopleShipHomePage, params)
}
})
})
}
.width('13%')
.height('100%')
... ... @@ -380,11 +396,11 @@ export struct MultiPictureDetailPageComponent {
}
this.netStatus = undefined
this.contentDetailData = resDTO.data?.[0];
if (this.contentDetailData.rmhPlatform == 1) {
WindowModel.shared.setWindowSystemBarProperties({
statusBarContentColor: '#ffffff',
})
}
// if (this.contentDetailData.rmhPlatform == 1) {
// WindowModel.shared.setWindowSystemBarProperties({
// statusBarContentColor: '#ffffff',
// })
// }
if (this.contentDetailData?.openComment) {
this.publishCommentModel.targetId = String(this.contentDetailData?.newsId || '')
this.publishCommentModel.targetRelId = String(this.contentDetailData?.reLInfo?.relId)
... ...
... ... @@ -2,7 +2,7 @@ import { Logger } from 'wdKit';
import { MultiPictureDetailPageComponent } from 'wdComponent';
import router from '@ohos.router';
import { Params, Action } from 'wdBean';
import { WindowModel } from 'wdKit/Index';
const TAG = 'MultiPictureDetailPage';
/**
... ... @@ -26,6 +26,8 @@ struct MultiPictureDetailPage {
})
}
}
.padding({top:44})
.backgroundColor(Color.Black)
}
pageTransition(){
... ... @@ -38,6 +40,10 @@ struct MultiPictureDetailPage {
}
aboutToAppear() {
this.openFullScreen()
Logger.info(TAG, 'aboutToDisappear');
let par:Action = router.getParams() as Action;
let params = par?.params;
this.relId = params?.extra?.relId || '';
... ... @@ -47,11 +53,33 @@ struct MultiPictureDetailPage {
Logger.info(TAG, 'params', JSON.stringify(params));
}
aboutToDisappear() {
Logger.info(TAG, 'aboutToDisappear');
}
onBackPress() {
Logger.info(TAG, 'onBackPress');
}
/**
* 开启沉浸式
* TODO:颜色待根据业务接口修改
*/
openFullScreen() {
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', })
WindowModel.shared.setWindowLayoutFullScreen(true)
// WindowModel.shared.setWindowSystemBarEnable([])
}
aboutToDisappear(): void {
console.log(TAG, 'aboutToDisappear')
this.closeFullScreen()
}
/**
* 关闭沉浸式
* TODO:颜色待根据业务接口修改
*/
closeFullScreen() {
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', })
WindowModel.shared.setWindowLayoutFullScreen(false)
// WindowModel.shared.setWindowSystemBarEnable(['status', 'navigation'])
}
}
\ No newline at end of file
... ...