Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool
Showing
8 changed files
with
30 additions
and
37 deletions
| @@ -135,6 +135,13 @@ export class WindowModel { | @@ -135,6 +135,13 @@ export class WindowModel { | ||
| 135 | }) | 135 | }) |
| 136 | } | 136 | } |
| 137 | 137 | ||
| 138 | + /** | ||
| 139 | + * 状态栏显示设置 | ||
| 140 | + */ | ||
| 141 | + setSpecificSystemBarEnabled(visible: boolean) { | ||
| 142 | + this.windowClass?.setSpecificSystemBarEnabled('status', visible) | ||
| 143 | + } | ||
| 144 | + | ||
| 138 | setWindowSystemBarEnable(names: Array<'status' | 'navigation'>) { | 145 | setWindowSystemBarEnable(names: Array<'status' | 'navigation'>) { |
| 139 | this.windowClass?.setWindowSystemBarEnable(names) | 146 | this.windowClass?.setWindowSystemBarEnable(names) |
| 140 | } | 147 | } |
| @@ -7,6 +7,7 @@ import { TrackConstants, | @@ -7,6 +7,7 @@ import { TrackConstants, | ||
| 7 | TrackingButton, | 7 | TrackingButton, |
| 8 | TrackingContent, TrackingPageBrowse, TrackParamConvert } from 'wdTracking/Index'; | 8 | TrackingContent, TrackingPageBrowse, TrackParamConvert } from 'wdTracking/Index'; |
| 9 | import { WDShare } from 'wdShare/Index'; | 9 | import { WDShare } from 'wdShare/Index'; |
| 10 | +import { hasClicked, persistentStorage } from '../../utils/persistentStorage'; | ||
| 10 | 11 | ||
| 11 | const TAG: string = 'CardView'; | 12 | const TAG: string = 'CardView'; |
| 12 | 13 | ||
| @@ -393,6 +394,7 @@ export struct MasonryLayout01CardView { | @@ -393,6 +394,7 @@ export struct MasonryLayout01CardView { | ||
| 393 | export struct PaperSingleColumn999CardView { | 394 | export struct PaperSingleColumn999CardView { |
| 394 | private item: ContentDTO = new ContentDTO(); | 395 | private item: ContentDTO = new ContentDTO(); |
| 395 | private index: number = -1; | 396 | private index: number = -1; |
| 397 | + @State isRead: boolean = false;//已读状态 | ||
| 396 | @State interactData: InteractDataDTO = {} as InteractDataDTO; | 398 | @State interactData: InteractDataDTO = {} as InteractDataDTO; |
| 397 | @Consume @Watch('onChangeCommentList') commentList: InteractDataDTO[] | 399 | @Consume @Watch('onChangeCommentList') commentList: InteractDataDTO[] |
| 398 | 400 | ||
| @@ -533,7 +535,7 @@ export struct PaperSingleColumn999CardView { | @@ -533,7 +535,7 @@ export struct PaperSingleColumn999CardView { | ||
| 533 | } | 535 | } |
| 534 | if (this.item?.newsSummary) { | 536 | if (this.item?.newsSummary) { |
| 535 | Text(this.item?.newsSummary) | 537 | Text(this.item?.newsSummary) |
| 536 | - .fontColor('#6666666') | 538 | + .fontColor(this.isRead ? 0x848484 : '#222222') |
| 537 | .fontSize(14) | 539 | .fontSize(14) |
| 538 | .padding({ top: 10 }) | 540 | .padding({ top: 10 }) |
| 539 | .alignSelf(ItemAlign.Start) | 541 | .alignSelf(ItemAlign.Start) |
| @@ -599,6 +601,8 @@ export struct PaperSingleColumn999CardView { | @@ -599,6 +601,8 @@ export struct PaperSingleColumn999CardView { | ||
| 599 | .margin({ bottom: 10, left: 12, right: 12 }) | 601 | .margin({ bottom: 10, left: 12, right: 12 }) |
| 600 | .borderRadius(4) | 602 | .borderRadius(4) |
| 601 | .onClick(() => { | 603 | .onClick(() => { |
| 604 | + this.isRead = true | ||
| 605 | + persistentStorage(this.item.objectId); | ||
| 602 | ProcessUtils.processPage(this.item) | 606 | ProcessUtils.processPage(this.item) |
| 603 | TrackingContent.common(TrackConstants.EventType.Click,TrackConstants.SummaryType.MorningAndEveningNews,TrackConstants.SummaryType.MorningAndEveningNews,TrackParamConvert.program(this.item)) | 607 | TrackingContent.common(TrackConstants.EventType.Click,TrackConstants.SummaryType.MorningAndEveningNews,TrackConstants.SummaryType.MorningAndEveningNews,TrackParamConvert.program(this.item)) |
| 604 | }).onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => { | 608 | }).onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => { |
| @@ -610,6 +614,7 @@ export struct PaperSingleColumn999CardView { | @@ -610,6 +614,7 @@ export struct PaperSingleColumn999CardView { | ||
| 610 | 614 | ||
| 611 | aboutToAppear(): void { | 615 | aboutToAppear(): void { |
| 612 | this.onChangeCommentList() | 616 | this.onChangeCommentList() |
| 617 | + this.isRead = hasClicked(this.item.objectId) | ||
| 613 | } | 618 | } |
| 614 | 619 | ||
| 615 | onChangeCommentList() { | 620 | onChangeCommentList() { |
| @@ -3,7 +3,6 @@ import { display, router } from '@kit.ArkUI'; | @@ -3,7 +3,6 @@ import { display, router } from '@kit.ArkUI'; | ||
| 3 | import { ImageItemView } from '../components/view/ImageItemView'; | 3 | import { ImageItemView } from '../components/view/ImageItemView'; |
| 4 | import { ImageDownloadComponent } from '../components/ImageDownloadComponent'; | 4 | import { ImageDownloadComponent } from '../components/ImageDownloadComponent'; |
| 5 | import { Action } from 'wdBean'; | 5 | import { Action } from 'wdBean'; |
| 6 | -import { WindowModel } from 'wdKit/Index'; | ||
| 7 | 6 | ||
| 8 | const TAG = 'MultiPictureListPage'; | 7 | const TAG = 'MultiPictureListPage'; |
| 9 | 8 | ||
| @@ -20,11 +19,11 @@ export struct MultiPictureListPage { | @@ -20,11 +19,11 @@ export struct MultiPictureListPage { | ||
| 20 | @State picHeight: number = 0 | 19 | @State picHeight: number = 0 |
| 21 | @State isEnableSwipe: boolean = true; | 20 | @State isEnableSwipe: boolean = true; |
| 22 | @State currentUrl: string = '' | 21 | @State currentUrl: string = '' |
| 23 | - | 22 | + @Provide bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 |
| 23 | + @Provide topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 | ||
| 24 | // @Provide bgc: Color = Color.White; | 24 | // @Provide bgc: Color = Color.White; |
| 25 | 25 | ||
| 26 | aboutToAppear(): void { | 26 | aboutToAppear(): void { |
| 27 | - this.openFullScreen() | ||
| 28 | //获取宽高尺寸 | 27 | //获取宽高尺寸 |
| 29 | this.screenWidth = this.displayTool.width | 28 | this.screenWidth = this.displayTool.width |
| 30 | // this.picWidth = this.screenWidth - vp2px(52) | 29 | // this.picWidth = this.screenWidth - vp2px(52) |
| @@ -57,7 +56,6 @@ export struct MultiPictureListPage { | @@ -57,7 +56,6 @@ export struct MultiPictureListPage { | ||
| 57 | if (this.photoList && this.photoList?.length > 0) { | 56 | if (this.photoList && this.photoList?.length > 0) { |
| 58 | Swiper(this.swiperController) { | 57 | Swiper(this.swiperController) { |
| 59 | ForEach(this.photoList, (item: PhotoListBean) => { | 58 | ForEach(this.photoList, (item: PhotoListBean) => { |
| 60 | - // MultiPictureDetailItemComponent({ MultiPictureDetailItem: item }) | ||
| 61 | ImageItemView({ MultiPictureDetailItem: item, isEnableSwipe: this.isEnableSwipe }) | 59 | ImageItemView({ MultiPictureDetailItem: item, isEnableSwipe: this.isEnableSwipe }) |
| 62 | }) | 60 | }) |
| 63 | } | 61 | } |
| @@ -135,36 +133,13 @@ export struct MultiPictureListPage { | @@ -135,36 +133,13 @@ export struct MultiPictureListPage { | ||
| 135 | } | 133 | } |
| 136 | .width('100%') | 134 | .width('100%') |
| 137 | .height('100%') | 135 | .height('100%') |
| 138 | - // .padding({top:$r('app.float.margin_44')}) | 136 | + .padding({top: `${this.topSafeHeight}px`,bottom:`${this.bottomSafeHeight}px`}) |
| 139 | .backgroundColor(Color.Black) | 137 | .backgroundColor(Color.Black) |
| 140 | .id('e_picture_container') | 138 | .id('e_picture_container') |
| 141 | - // 设置顶部绘制延伸到状态栏 | ||
| 142 | - // 设置底部绘制延伸到导航条 | ||
| 143 | - } | ||
| 144 | - | ||
| 145 | - /** | ||
| 146 | - * 开启沉浸式 | ||
| 147 | - * TODO:颜色待根据业务接口修改 | ||
| 148 | - */ | ||
| 149 | - openFullScreen() { | ||
| 150 | - WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', }) | ||
| 151 | - // WindowModel.shared.setWindowLayoutFullScreen(true) | ||
| 152 | - // WindowModel.shared.setWindowSystemBarEnable([]) | ||
| 153 | } | 139 | } |
| 154 | 140 | ||
| 155 | aboutToDisappear(): void { | 141 | aboutToDisappear(): void { |
| 156 | console.log(TAG, 'aboutToDisappear') | 142 | console.log(TAG, 'aboutToDisappear') |
| 157 | - this.closeFullScreen() | ||
| 158 | - } | ||
| 159 | - | ||
| 160 | - /** | ||
| 161 | - * 关闭沉浸式 | ||
| 162 | - * TODO:颜色待根据业务接口修改 | ||
| 163 | - */ | ||
| 164 | - closeFullScreen() { | ||
| 165 | - WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', }) | ||
| 166 | - // WindowModel.shared.setWindowLayoutFullScreen(false) | ||
| 167 | - // WindowModel.shared.setWindowSystemBarEnable(['status', 'navigation']) | ||
| 168 | } | 143 | } |
| 169 | 144 | ||
| 170 | onBackPress(): boolean | void { | 145 | onBackPress(): boolean | void { |
| @@ -172,7 +147,5 @@ export struct MultiPictureListPage { | @@ -172,7 +147,5 @@ export struct MultiPictureListPage { | ||
| 172 | } | 147 | } |
| 173 | 148 | ||
| 174 | private onBack() { | 149 | private onBack() { |
| 175 | - // 提前设置,否则返回的页面展示有问题(有时延) | ||
| 176 | - this.closeFullScreen() | ||
| 177 | } | 150 | } |
| 178 | } | 151 | } |
| @@ -4,7 +4,7 @@ import UIAbility from '@ohos.app.ability.UIAbility'; | @@ -4,7 +4,7 @@ import UIAbility from '@ohos.app.ability.UIAbility'; | ||
| 4 | import Want from '@ohos.app.ability.Want'; | 4 | import Want from '@ohos.app.ability.Want'; |
| 5 | import window from '@ohos.window'; | 5 | import window from '@ohos.window'; |
| 6 | import { BusinessError } from '@ohos.base'; | 6 | import { BusinessError } from '@ohos.base'; |
| 7 | -import { DeviceUtil, EmitterEventId, EmitterUtils, Logger, WindowModel } from 'wdKit'; | 7 | +import { DeviceUtil, EmitterEventId, EmitterUtils, Logger, SPHelper, WindowModel } from 'wdKit'; |
| 8 | import { ConfigurationConstant } from '@kit.AbilityKit'; | 8 | import { ConfigurationConstant } from '@kit.AbilityKit'; |
| 9 | import { StartupManager } from '../startupmanager/StartupManager'; | 9 | import { StartupManager } from '../startupmanager/StartupManager'; |
| 10 | 10 | ||
| @@ -14,6 +14,10 @@ const TAG = 'EntryAbility' | @@ -14,6 +14,10 @@ const TAG = 'EntryAbility' | ||
| 14 | export default class EntryAbility extends UIAbility { | 14 | export default class EntryAbility extends UIAbility { |
| 15 | onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { | 15 | onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { |
| 16 | StartupManager.sharedInstance().appOnCreate(want, launchParam, this.context) | 16 | StartupManager.sharedInstance().appOnCreate(want, launchParam, this.context) |
| 17 | + if (SPHelper.default.getSync('isPrivacy', true)) { | ||
| 18 | + // 同意隐私协议,这里直接初始化。TODO 耗时梳理 | ||
| 19 | + StartupManager.sharedInstance().appAgreedProtocol() | ||
| 20 | + } | ||
| 17 | Logger.info(TAG, 'Ability onCreate'); | 21 | Logger.info(TAG, 'Ability onCreate'); |
| 18 | 22 | ||
| 19 | // 还没深色模式需求,暂直接不跟随系统。 | 23 | // 还没深色模式需求,暂直接不跟随系统。 |
| @@ -21,7 +21,8 @@ struct MultiPictureDetailPage { | @@ -21,7 +21,8 @@ struct MultiPictureDetailPage { | ||
| 21 | pageHideTime:number = 0; | 21 | pageHideTime:number = 0; |
| 22 | @Provide pageId: string = TrackConstants.PageName.Atlas_Detail | 22 | @Provide pageId: string = TrackConstants.PageName.Atlas_Detail |
| 23 | @Provide pageName: string = TrackConstants.PageName.Atlas_Detail | 23 | @Provide pageName: string = TrackConstants.PageName.Atlas_Detail |
| 24 | - | 24 | + @Provide bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 |
| 25 | + @Provide topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 | ||
| 25 | build() { | 26 | build() { |
| 26 | Row() { | 27 | Row() { |
| 27 | Column() { | 28 | Column() { |
| @@ -31,6 +32,8 @@ struct MultiPictureDetailPage { | @@ -31,6 +32,8 @@ struct MultiPictureDetailPage { | ||
| 31 | relType: this.relType | 32 | relType: this.relType |
| 32 | }) | 33 | }) |
| 33 | } | 34 | } |
| 35 | + .padding({top: `${this.topSafeHeight}px`,bottom:`${this.bottomSafeHeight}px`}) | ||
| 36 | + | ||
| 34 | } | 37 | } |
| 35 | .backgroundColor(Color.Black) | 38 | .backgroundColor(Color.Black) |
| 36 | } | 39 | } |
| @@ -97,8 +97,8 @@ struct LaunchPage { | @@ -97,8 +97,8 @@ struct LaunchPage { | ||
| 97 | this.dialogController.open(); | 97 | this.dialogController.open(); |
| 98 | // } | 98 | // } |
| 99 | } else { | 99 | } else { |
| 100 | - | ||
| 101 | - StartupManager.sharedInstance().appAgreedProtocol() | 100 | + // 挪到ability里处理了。 |
| 101 | + // StartupManager.sharedInstance().appAgreedProtocol() | ||
| 102 | 102 | ||
| 103 | //需要根据请求数据判断是否需要进入广告页,广告数据为nil则直接跳转到首页 | 103 | //需要根据请求数据判断是否需要进入广告页,广告数据为nil则直接跳转到首页 |
| 104 | //获取本地存储的启动页数据 | 104 | //获取本地存储的启动页数据 |
| @@ -90,13 +90,14 @@ export class StartupManager { | @@ -90,13 +90,14 @@ export class StartupManager { | ||
| 90 | Logger.debug(TAG, "App 已同意隐私等协议,开始必要初始化") | 90 | Logger.debug(TAG, "App 已同意隐私等协议,开始必要初始化") |
| 91 | this.initCheckDeviceId() | 91 | this.initCheckDeviceId() |
| 92 | 92 | ||
| 93 | + this.initNetwork() | ||
| 94 | + | ||
| 93 | this.initMpaas() | 95 | this.initMpaas() |
| 96 | + | ||
| 94 | this.initSensorData() | 97 | this.initSensorData() |
| 95 | 98 | ||
| 96 | this.initTingyun() | 99 | this.initTingyun() |
| 97 | 100 | ||
| 98 | - this.initNetwork() | ||
| 99 | - | ||
| 100 | this.initGeTuiPush() | 101 | this.initGeTuiPush() |
| 101 | 102 | ||
| 102 | this.initUmengStat() | 103 | this.initUmengStat() |
-
Please register or login to post a comment