From e51e450ad45e5130d9fedb3c14a8920a0ed7d07a Mon Sep 17 00:00:00 2001 From: fxy060608 Date: Thu, 26 Dec 2019 15:03:21 +0800 Subject: [PATCH] fix(v3): condition --- packages/uni-app-plus/dist/index.v3.js | 18 ++++++++++++++---- .../service/api/route/navigate-back.js | 4 +++- .../app-plus/service/framework/page.js | 4 ++-- 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/packages/uni-app-plus/dist/index.v3.js b/packages/uni-app-plus/dist/index.v3.js index fd9320e3..020b2366 100644 --- a/packages/uni-app-plus/dist/index.v3.js +++ b/packages/uni-app-plus/dist/index.v3.js @@ -7183,8 +7183,10 @@ var serviceContext = (function () { quit(); } else if (currentPage.$page.id === 1 && __uniConfig.realEntryPagePath) { // condition + __uniConfig.entryPagePath = __uniConfig.realEntryPagePath; + delete __uniConfig.realEntryPagePath; uni.reLaunch({ - url: '/' + __uniConfig.realEntryPagePath + url: '/' + __uniConfig.entryPagePath }); } else { back(delta, animationType, animationDuration); @@ -7890,9 +7892,9 @@ var serviceContext = (function () { if ( openType === 'reLaunch' || ( - openType === 'redirect' && + !__uniConfig.realEntryPagePath && pages.length === 0 - ) // 首页 redirect + ) ) { routeOptions.meta.isQuit = true; } else if (!routeOptions.meta.isTabBar) { @@ -8018,7 +8020,15 @@ var serviceContext = (function () { animationDuration }, callbackId) { const urls = url.split('?'); - const path = urls[0]; + const path = urls[0]; + const routeStyles = __uniRoutes.find(route => route.path === path).window; + const globalStyle = __uniConfig.window; + if (!animationType) { + animationType = routeStyles.animationType || globalStyle.animationType || ANI_SHOW; + } + if (!animationDuration) { + animationDuration = routeStyles.animationDuration || globalStyle.animationDuration || ANI_DURATION; + } const query = parseQuery(urls[1] || ''); navigate(path, function () { _navigateTo({ diff --git a/src/platforms/app-plus/service/api/route/navigate-back.js b/src/platforms/app-plus/service/api/route/navigate-back.js index b4904272..53aed3cb 100644 --- a/src/platforms/app-plus/service/api/route/navigate-back.js +++ b/src/platforms/app-plus/service/api/route/navigate-back.js @@ -104,8 +104,10 @@ export function navigateBack ({ quit() } else if (currentPage.$page.id === 1 && __uniConfig.realEntryPagePath) { // condition + __uniConfig.entryPagePath = __uniConfig.realEntryPagePath + delete __uniConfig.realEntryPagePath uni.reLaunch({ - url: '/' + __uniConfig.realEntryPagePath + url: '/' + __uniConfig.entryPagePath }) } else { back(delta, animationType, animationDuration) diff --git a/src/platforms/app-plus/service/framework/page.js b/src/platforms/app-plus/service/framework/page.js index 9e571e82..f1fbe5a3 100644 --- a/src/platforms/app-plus/service/framework/page.js +++ b/src/platforms/app-plus/service/framework/page.js @@ -35,9 +35,9 @@ export function registerPage ({ if ( openType === 'reLaunch' || ( - openType === 'redirect' && + !__uniConfig.realEntryPagePath && pages.length === 0 - ) // 首页 redirect + ) ) { routeOptions.meta.isQuit = true } else if (!routeOptions.meta.isTabBar) { -- GitLab