diff --git a/features/noticeitem/src/main/ets/com/ohos/noticeItem/view/item/notificationItem.ets b/features/noticeitem/src/main/ets/com/ohos/noticeItem/view/item/notificationItem.ets index e6680e0..d635af6 100644 --- a/features/noticeitem/src/main/ets/com/ohos/noticeItem/view/item/notificationItem.ets +++ b/features/noticeitem/src/main/ets/com/ohos/noticeItem/view/item/notificationItem.ets @@ -75,6 +75,7 @@ export default struct NotificationItem { @Component struct FrontItem { + @Consume isClickFrontItem: boolean private itemData: any = {} private nowWant: any; private isSubItem: boolean= false; @@ -101,6 +102,7 @@ struct FrontItem { showDevicesDialog() { Log.showDebug(TAG, `showDevicesDialog isDistributed: ${this.itemData?.distributedOption?.isDistributed}`) + this.isClickFrontItem = true if (!this.itemData?.distributedOption?.isDistributed) { ViewModel.clickItem(this.itemData); return; diff --git a/product/phone/src/main/ets/pages/slidescreenlock.ets b/product/phone/src/main/ets/pages/slidescreenlock.ets index 86375f1..67cc1de 100644 --- a/product/phone/src/main/ets/pages/slidescreenlock.ets +++ b/product/phone/src/main/ets/pages/slidescreenlock.ets @@ -33,6 +33,7 @@ export default struct SlideScreenlock { @Prop @Watch("onStatusChange") pageStatus: number @StorageLink('deviceStatus') @Watch('onDeviceStatusChange') deviceStatus: string = "" @StorageLink('isWallpaperShow') isWallpaperShow: boolean = true + @Provide @Watch('unlockScreen') isClickFrontItem: boolean = false private mHeightPx : number = 48 aboutToAppear() { Log.showInfo(TAG, `aboutToAppear`) @@ -51,6 +52,14 @@ export default struct SlideScreenlock { Log.showInfo(TAG, `onPageHide`) } + unlockScreen() { + Log.showInfo(TAG, `unlockScreen in, isClickFrontItem${this.isClickFrontItem}`) + if (this.isClickFrontItem) { + this.mViewModel.unlockScreen() + } + this.isClickFrontItem = false + } + build() { Stack({ alignContent: Alignment.Bottom }) { Column() {