diff --git a/src/core/service/bridge/on.js b/src/core/service/bridge/on.js index 6c9e5237ffac83fa85d31d440aa3b5848c0bed5e..cb866820db1a7a8349c91d7350c56bac129686c3 100644 --- a/src/core/service/bridge/on.js +++ b/src/core/service/bridge/on.js @@ -52,18 +52,12 @@ export default function initOn (on, { callCurrentPageHook('onHide') } - function onAppEnterForeground () { - const pages = getCurrentPages() - if (pages.length === 0) { - return - } - const page = pages[pages.length - 1] - const args = { - path: page.route, - query: page.options - } - - callAppHook(getApp(), 'onShow', args) + function onAppEnterForeground (enterOptions) { + callAppHook(getApp(), 'onShow', enterOptions) + const pages = getCurrentPages() + if (pages.length === 0) { + return + } callCurrentPageHook('onShow') } @@ -105,4 +99,4 @@ export default function initOn (on, { on('onNavigationBarSearchInputFocusChanged', createCallCurrentPageHook('onNavigationBarSearchInputFocusChanged')) on('onWebInvokeAppService', onWebInvokeAppService) -} +} diff --git a/src/platforms/app-plus/service/framework/app.js b/src/platforms/app-plus/service/framework/app.js index a36b296e3f5a9b5f44fbd70f3809519aa0fd0d19..dbe0fdb6f7ab8b2d69ec0318917b62e687cf47bb 100644 --- a/src/platforms/app-plus/service/framework/app.js +++ b/src/platforms/app-plus/service/framework/app.js @@ -46,7 +46,10 @@ import { } from './backbutton' import { - initLaunchOptions + getEnterOptions, + initEnterOptions, + initLaunchOptions, + parseRedirectInfo } from './utils' let appCtx @@ -90,7 +93,11 @@ function initGlobalListeners () { }) plus.globalEvent.addEventListener('resume', () => { - emit('onAppEnterForeground') + const info = parseRedirectInfo() + if (info && info.userAction) { + initEnterOptions(info) + } + emit('onAppEnterForeground', getEnterOptions()) }) plus.globalEvent.addEventListener('netchange', () => { diff --git a/src/platforms/h5/components/app/index.vue b/src/platforms/h5/components/app/index.vue index 3a1713a780cb8cd967ec458e9385ae860159f9f3..1cd663a6fc91bc578603e56c36d99a9799044958 100644 --- a/src/platforms/h5/components/app/index.vue +++ b/src/platforms/h5/components/app/index.vue @@ -4,7 +4,7 @@ ref="layout" :router-key="key" :keep-alive-include="keepAliveInclude" - @maxWidth="onMaxWidth" + @maxWidth="onMaxWidth" @layout="onLayout" />