@@ -51,6 +51,48 @@ function invokeHook(vm, name, args) {
5151 return hooks && invokeArrayFns ( hooks , args ) ;
5252}
5353
54+ const SYSTEM_DIALOG_PAGE_PATH_STARTER = 'uni:' ;
55+ function isSystemDialogPage ( page ) {
56+ return page . route . startsWith ( SYSTEM_DIALOG_PAGE_PATH_STARTER ) ;
57+ }
58+ function getSystemDialogPages ( parentPage ) {
59+ if ( ! parentPage )
60+ return [ ] ;
61+ {
62+ // $getSystemDialogPages harmony __$$getSystemDialogPages ios
63+ return typeof parentPage . __$$getSystemDialogPages === 'undefined'
64+ ? parentPage . $getSystemDialogPages ( )
65+ : parentPage . __$$getSystemDialogPages ( ) ;
66+ }
67+ }
68+ function invokeNewDialogPageHook ( page , hook ) {
69+ let shouldInvoke = false ;
70+ const currentPage = getCurrentPage ( ) ;
71+ if ( isSystemDialogPage ( page ) ) {
72+ const systemDialogPages = getSystemDialogPages ( currentPage ) ;
73+ shouldInvoke = systemDialogPages . includes ( page ) ;
74+ }
75+ else {
76+ const dialogPages = currentPage . getDialogPages ( ) ;
77+ shouldInvoke = dialogPages . includes ( page ) ;
78+ }
79+ shouldInvoke && invokeHook ( page . vm , hook ) ;
80+ }
81+ function getPageInstanceByChild ( child ) {
82+ {
83+ // @ts -expect-error
84+ return child . ctx . $basePage ;
85+ }
86+ }
87+ function isDialogPageInstance ( vm ) {
88+ if ( ! vm )
89+ return false ;
90+ {
91+ // @ts -expect-error
92+ return vm . openType === 'openDialogPage' ;
93+ }
94+ }
95+
5496function injectLifecycleHook ( name , hook , publicThis , instance ) {
5597 if ( isFunction ( hook ) ) {
5698 injectHook ( name , hook . bind ( publicThis ) , instance ) ;
@@ -106,6 +148,15 @@ function initHooks(options, instance, publicThis) {
106148 : publicThis . $page ;
107149 if ( ! ( 'app' === 'app' && true && ( $basePage === null || $basePage === void 0 ? void 0 : $basePage . meta . isTabBar ) ) ) {
108150 if ( ( $basePage === null || $basePage === void 0 ? void 0 : $basePage . openType ) !== 'preloadPage' ) {
151+ if ( true ) {
152+ if ( isDialogPageInstance ( getPageInstanceByChild ( instance ) ) ) {
153+ invokeNewDialogPageHook ( publicThis . $page , ON_SHOW ) ;
154+ }
155+ else {
156+ invokeHook ( publicThis , ON_SHOW ) ;
157+ }
158+ return ;
159+ }
109160 invokeHook ( publicThis , ON_SHOW ) ;
110161 }
111162 }
0 commit comments