File tree Expand file tree Collapse file tree
packages/uni-app-plus/src/x/framework/app Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import type { UniDialogPage } from '@dcloudio/uni-app-x/types/page'
33import { ON_BACK_PRESS } from '@dcloudio/uni-shared'
44import {
55 getCurrentPage ,
6- getSystemDialogPages ,
6+ getLastDialogPage ,
77 invokeHook ,
88} from '@dcloudio/uni-core'
99import { backbuttonListener } from '../../../service/framework/app/utils'
@@ -16,24 +16,9 @@ export function initGlobalEvent(app: IApp) {
1616 // 目前app-ios和app-harmony均会执行此逻辑,但是app-ios理论上始终不会触发以下dialogPage逻辑
1717 const currentPage = getCurrentPage ( ) as unknown as UniPage
1818 if ( currentPage ) {
19- const systemDialogPages = getSystemDialogPages ( currentPage )
20- const dialogPages = currentPage . getDialogPages ( )
21- if ( systemDialogPages . length > 0 || dialogPages . length > 0 ) {
22- const lastSystemDialog = systemDialogPages [ systemDialogPages . length - 1 ]
23- const lastDialog = dialogPages [ dialogPages . length - 1 ]
24-
25- if ( ! systemDialogPages . length ) {
26- handleDialogPageBack ( lastDialog as UniDialogPage )
27- } else if ( ! dialogPages . length ) {
28- handleDialogPageBack ( lastSystemDialog as UniDialogPage )
29- } else {
30- handleDialogPageBack (
31- ( parseInt ( lastDialog . vm ! . $nativePage ! . pageId ) >
32- parseInt ( lastSystemDialog . vm ! . $nativePage ! . pageId )
33- ? lastDialog
34- : lastSystemDialog ) as UniDialogPage
35- )
36- }
19+ const lastDialogPage = getLastDialogPage ( currentPage )
20+ if ( lastDialogPage ) {
21+ handleDialogPageBack ( lastDialogPage )
3722 return true
3823 }
3924 }
You can’t perform that action at this time.
0 commit comments