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

Merge branch 'dev' into alpha

......@@ -52,18 +52,12 @@ export default function initOn (on, {
callCurrentPageHook('onHide')
}
function onAppEnterForeground () {
function onAppEnterForeground (enterOptions) {
callAppHook(getApp(), 'onShow', enterOptions)
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)
callCurrentPageHook('onShow')
}
......
......@@ -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', () => {
......
......@@ -126,7 +126,7 @@ export default {
})
document.addEventListener('visibilitychange', function () {
if (document.visibilityState === 'visible') {
UniServiceJSBridge.emit('onAppEnterForeground')
UniServiceJSBridge.emit('onAppEnterForeground', {})
} else {
UniServiceJSBridge.emit('onAppEnterBackground')
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册