提交 d5c2d0da 编写于 作者: fxy060608's avatar fxy060608

feat(app): update enter options when resume

上级 bacae9c8
......@@ -2736,6 +2736,13 @@ var serviceContext = (function (vue) {
function getEnterOptions() {
return enterOptions;
}
function initEnterOptions({ path, query, referrerInfo, }) {
extend(enterOptions, {
path,
query: query ? parseQuery(query) : {},
referrerInfo: referrerInfo || {},
});
}
function initLaunchOptions({ path, query, referrerInfo, }) {
extend(launchOptions, {
path,
......@@ -18611,12 +18618,10 @@ var serviceContext = (function (vue) {
emit(ON_APP_ENTER_BACKGROUND);
});
plusGlobalEvent.addEventListener('resume', () => {
// TODO 暂时不用
// const info = parseRedirectInfo()
// if (info && info.userAction && info.path) {
// initEnterOptions(info)
// initEnterReLaunch(info)
// }
const info = parseRedirectInfo();
if (info && info.userAction) {
initEnterOptions(info);
}
emit(ON_APP_ENTER_FOREGROUND, getEnterOptions());
});
weexGlobalEvent.addEventListener('uistylechange', function (event) {
......
......@@ -12,6 +12,8 @@ import {
backbuttonListener,
getEnterOptions,
RedirectInfo,
parseRedirectInfo,
initEnterOptions,
} from './utils'
export function initGlobalEvent() {
......@@ -32,12 +34,10 @@ export function initGlobalEvent() {
})
plusGlobalEvent.addEventListener('resume', () => {
// TODO 暂时不用
// const info = parseRedirectInfo()
// if (info && info.userAction && info.path) {
// initEnterOptions(info)
// initEnterReLaunch(info)
// }
const info = parseRedirectInfo()
if (info && info.userAction) {
initEnterOptions(info)
}
emit(ON_APP_ENTER_FOREGROUND, getEnterOptions())
})
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册