提交 41a9f2df 编写于 作者: Q qiang

Merge branch 'dev' into alpha

...@@ -52,18 +52,12 @@ export default function initOn (on, { ...@@ -52,18 +52,12 @@ export default function initOn (on, {
callCurrentPageHook('onHide') callCurrentPageHook('onHide')
} }
function onAppEnterForeground () { function onAppEnterForeground (enterOptions) {
const pages = getCurrentPages() callAppHook(getApp(), 'onShow', enterOptions)
if (pages.length === 0) { const pages = getCurrentPages()
return if (pages.length === 0) {
} return
const page = pages[pages.length - 1] }
const args = {
path: page.route,
query: page.options
}
callAppHook(getApp(), 'onShow', args)
callCurrentPageHook('onShow') callCurrentPageHook('onShow')
} }
...@@ -105,4 +99,4 @@ export default function initOn (on, { ...@@ -105,4 +99,4 @@ export default function initOn (on, {
on('onNavigationBarSearchInputFocusChanged', createCallCurrentPageHook('onNavigationBarSearchInputFocusChanged')) on('onNavigationBarSearchInputFocusChanged', createCallCurrentPageHook('onNavigationBarSearchInputFocusChanged'))
on('onWebInvokeAppService', onWebInvokeAppService) on('onWebInvokeAppService', onWebInvokeAppService)
} }
...@@ -46,7 +46,10 @@ import { ...@@ -46,7 +46,10 @@ import {
} from './backbutton' } from './backbutton'
import { import {
initLaunchOptions getEnterOptions,
initEnterOptions,
initLaunchOptions,
parseRedirectInfo
} from './utils' } from './utils'
let appCtx let appCtx
...@@ -90,7 +93,11 @@ function initGlobalListeners () { ...@@ -90,7 +93,11 @@ function initGlobalListeners () {
}) })
plus.globalEvent.addEventListener('resume', () => { plus.globalEvent.addEventListener('resume', () => {
emit('onAppEnterForeground') const info = parseRedirectInfo()
if (info && info.userAction) {
initEnterOptions(info)
}
emit('onAppEnterForeground', getEnterOptions())
}) })
plus.globalEvent.addEventListener('netchange', () => { plus.globalEvent.addEventListener('netchange', () => {
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
ref="layout" ref="layout"
:router-key="key" :router-key="key"
:keep-alive-include="keepAliveInclude" :keep-alive-include="keepAliveInclude"
@maxWidth="onMaxWidth" @maxWidth="onMaxWidth"
@layout="onLayout" @layout="onLayout"
/> />
<tab-bar <tab-bar
...@@ -126,7 +126,7 @@ export default { ...@@ -126,7 +126,7 @@ export default {
}) })
document.addEventListener('visibilitychange', function () { document.addEventListener('visibilitychange', function () {
if (document.visibilityState === 'visible') { if (document.visibilityState === 'visible') {
UniServiceJSBridge.emit('onAppEnterForeground') UniServiceJSBridge.emit('onAppEnterForeground', {})
} else { } else {
UniServiceJSBridge.emit('onAppEnterBackground') UniServiceJSBridge.emit('onAppEnterBackground')
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册