liyubing

Merge remote-tracking branch 'origin/main'

... ... @@ -3,7 +3,6 @@ import { display, router } from '@kit.ArkUI';
import { ImageItemView } from '../components/view/ImageItemView';
import { ImageDownloadComponent } from '../components/ImageDownloadComponent';
import { Action } from 'wdBean';
import { WindowModel } from 'wdKit/Index';
const TAG = 'MultiPictureListPage';
... ... @@ -20,11 +19,11 @@ export struct MultiPictureListPage {
@State picHeight: number = 0
@State isEnableSwipe: boolean = true;
@State currentUrl: string = ''
@Provide bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
@Provide topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
// @Provide bgc: Color = Color.White;
aboutToAppear(): void {
this.openFullScreen()
//获取宽高尺寸
this.screenWidth = this.displayTool.width
// this.picWidth = this.screenWidth - vp2px(52)
... ... @@ -57,7 +56,6 @@ export struct MultiPictureListPage {
if (this.photoList && this.photoList?.length > 0) {
Swiper(this.swiperController) {
ForEach(this.photoList, (item: PhotoListBean) => {
// MultiPictureDetailItemComponent({ MultiPictureDetailItem: item })
ImageItemView({ MultiPictureDetailItem: item, isEnableSwipe: this.isEnableSwipe })
})
}
... ... @@ -135,36 +133,13 @@ export struct MultiPictureListPage {
}
.width('100%')
.height('100%')
// .padding({top:$r('app.float.margin_44')})
.padding({top: `${this.topSafeHeight}px`,bottom:`${this.bottomSafeHeight}px`})
.backgroundColor(Color.Black)
.id('e_picture_container')
// 设置顶部绘制延伸到状态栏
// 设置底部绘制延伸到导航条
}
/**
* 开启沉浸式
* 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'])
}
onBackPress(): boolean | void {
... ... @@ -172,7 +147,5 @@ export struct MultiPictureListPage {
}
private onBack() {
// 提前设置,否则返回的页面展示有问题(有时延)
this.closeFullScreen()
}
}
\ No newline at end of file
... ...
... ... @@ -4,7 +4,7 @@ import UIAbility from '@ohos.app.ability.UIAbility';
import Want from '@ohos.app.ability.Want';
import window from '@ohos.window';
import { BusinessError } from '@ohos.base';
import { DeviceUtil, EmitterEventId, EmitterUtils, Logger, WindowModel } from 'wdKit';
import { DeviceUtil, EmitterEventId, EmitterUtils, Logger, SPHelper, WindowModel } from 'wdKit';
import { ConfigurationConstant } from '@kit.AbilityKit';
import { StartupManager } from '../startupmanager/StartupManager';
... ... @@ -14,6 +14,10 @@ const TAG = 'EntryAbility'
export default class EntryAbility extends UIAbility {
onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void {
StartupManager.sharedInstance().appOnCreate(want, launchParam, this.context)
if (SPHelper.default.getSync('isPrivacy', true)) {
// 同意隐私协议,这里直接初始化。TODO 耗时梳理
StartupManager.sharedInstance().appAgreedProtocol()
}
Logger.info(TAG, 'Ability onCreate');
// 还没深色模式需求,暂直接不跟随系统。
... ...
... ... @@ -21,7 +21,8 @@ struct MultiPictureDetailPage {
pageHideTime:number = 0;
@Provide pageId: string = TrackConstants.PageName.Atlas_Detail
@Provide pageName: string = TrackConstants.PageName.Atlas_Detail
@Provide bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
@Provide topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
build() {
Row() {
Column() {
... ... @@ -31,6 +32,8 @@ struct MultiPictureDetailPage {
relType: this.relType
})
}
.padding({top: `${this.topSafeHeight}px`,bottom:`${this.bottomSafeHeight}px`})
}
.backgroundColor(Color.Black)
}
... ... @@ -72,18 +75,12 @@ struct MultiPictureDetailPage {
onPageShow(): void {
console.log(TAG, 'onPageShow')
this.pageShowTime = DateTimeUtils.getTimeStamp()
/*// 获取当前应用窗口
let windowClass: window.Window = window.getLastWindow(this.context)
// 将状态栏和导航栏的背景色设置为跟应用窗口相同的颜色
windowClass.setWindowSystemBarProperties({
navigationBarColor: color,
statusBarColor: barColor,
statusBarContentColor: barContentColor,
})*/
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff'})
}
onPageHide(): void {
console.log(TAG, 'onPageHide')
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000'})
this.pageHideTime = DateTimeUtils.getTimeStamp()
let duration = 0
duration = Math.floor((this.pageHideTime - this.pageShowTime)/1000)
... ...
... ... @@ -97,8 +97,8 @@ struct LaunchPage {
this.dialogController.open();
// }
} else {
StartupManager.sharedInstance().appAgreedProtocol()
// 挪到ability里处理了。
// StartupManager.sharedInstance().appAgreedProtocol()
//需要根据请求数据判断是否需要进入广告页,广告数据为nil则直接跳转到首页
//获取本地存储的启动页数据
... ...
... ... @@ -90,13 +90,14 @@ export class StartupManager {
Logger.debug(TAG, "App 已同意隐私等协议,开始必要初始化")
this.initCheckDeviceId()
this.initNetwork()
this.initMpaas()
this.initSensorData()
this.initTingyun()
this.initNetwork()
this.initGeTuiPush()
this.initUmengStat()
... ...