王士厅
... ... @@ -135,6 +135,13 @@ export class WindowModel {
})
}
/**
* 状态栏显示设置
*/
setSpecificSystemBarEnabled(visible: boolean) {
this.windowClass?.setSpecificSystemBarEnabled('status', visible)
}
setWindowSystemBarEnable(names: Array<'status' | 'navigation'>) {
this.windowClass?.setWindowSystemBarEnable(names)
}
... ...
... ... @@ -7,6 +7,7 @@ import { TrackConstants,
TrackingButton,
TrackingContent, TrackingPageBrowse, TrackParamConvert } from 'wdTracking/Index';
import { WDShare } from 'wdShare/Index';
import { hasClicked, persistentStorage } from '../../utils/persistentStorage';
const TAG: string = 'CardView';
... ... @@ -393,6 +394,7 @@ export struct MasonryLayout01CardView {
export struct PaperSingleColumn999CardView {
private item: ContentDTO = new ContentDTO();
private index: number = -1;
@State isRead: boolean = false;//已读状态
@State interactData: InteractDataDTO = {} as InteractDataDTO;
@Consume @Watch('onChangeCommentList') commentList: InteractDataDTO[]
... ... @@ -533,7 +535,7 @@ export struct PaperSingleColumn999CardView {
}
if (this.item?.newsSummary) {
Text(this.item?.newsSummary)
.fontColor('#6666666')
.fontColor(this.isRead ? 0x848484 : '#222222')
.fontSize(14)
.padding({ top: 10 })
.alignSelf(ItemAlign.Start)
... ... @@ -599,6 +601,8 @@ export struct PaperSingleColumn999CardView {
.margin({ bottom: 10, left: 12, right: 12 })
.borderRadius(4)
.onClick(() => {
this.isRead = true
persistentStorage(this.item.objectId);
ProcessUtils.processPage(this.item)
TrackingContent.common(TrackConstants.EventType.Click,TrackConstants.SummaryType.MorningAndEveningNews,TrackConstants.SummaryType.MorningAndEveningNews,TrackParamConvert.program(this.item))
}).onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => {
... ... @@ -610,6 +614,7 @@ export struct PaperSingleColumn999CardView {
aboutToAppear(): void {
this.onChangeCommentList()
this.isRead = hasClicked(this.item.objectId)
}
onChangeCommentList() {
... ...
... ... @@ -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)
}
... ...
... ... @@ -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()
... ...