提交 6493eb94 编写于 作者: DCloud-WZF's avatar DCloud-WZF 💬

wip(x-ios): 移除 navigateTo 自定义路由逻辑

上级 6ca8a51d
......@@ -21,7 +21,7 @@ export const $navigateTo: DefineAsyncApiFn<API_TYPE_NAVIGATE_TO> = (
args,
{ resolve, reject }
) => {
const { url, events, animationType, animationDuration, dialog } = args
const { url, events, animationType, animationDuration } = args
const { path, query } = parseUrl(url)
const [aniType, aniDuration] = initAnimation(
path,
......@@ -35,7 +35,6 @@ export const $navigateTo: DefineAsyncApiFn<API_TYPE_NAVIGATE_TO> = (
events,
aniType,
aniDuration,
dialog,
})
.then(resolve)
.catch(reject)
......@@ -52,7 +51,6 @@ interface NavigateToOptions extends RouteOptions {
events: Record<string, any>
aniType: string
aniDuration: number
dialog?: Map<string, any>
}
function _navigateTo({
......@@ -62,16 +60,12 @@ function _navigateTo({
events,
aniType,
aniDuration,
dialog,
}: NavigateToOptions): Promise<void | { eventChannel: EventChannel }> {
invokeBeforeRouteHooks(API_NAVIGATE_TO)
// 当前页面触发 onHide
invokeHook(ON_HIDE)
const eventChannel = new EventChannel(getWebviewId() + 1, events)
return new Promise((resolve) => {
if (dialog && aniType === 'pop-in') {
aniType = 'none'
}
const noAnimation = aniType === 'none' || aniDuration === 0
function callback(page: IPage) {
invokeAfterRouteHooks(API_NAVIGATE_TO)
......@@ -82,7 +76,7 @@ function _navigateTo({
}
// 有动画时先执行 show
const page = registerPage(
{ url, path, query, openType: 'navigateTo', eventChannel, dialog },
{ url, path, query, openType: 'navigateTo', eventChannel },
noAnimation ? undefined : callback,
// 有动画时延迟创建 vm
noAnimation ? 0 : 1
......
......@@ -37,7 +37,6 @@ export interface RegisterPageOptions {
webview?: IPage
nvuePageVm?: ComponentPublicInstance
eventChannel?: EventChannel
dialog?: Map<string, any>
}
// parsePageStyle
......@@ -116,19 +115,13 @@ export function registerPage(
webview,
nvuePageVm,
eventChannel,
dialog,
}: RegisterPageOptions,
onCreated?: (page: IPage) => void,
delay = 0
) {
const id = genWebviewId()
const routeOptions = initRouteOptions(path, openType)
const pageStyle = dialog
? new Map([
['navigationStyle', 'custom'],
['backgroundColor', 'transparent'],
])
: parsePageStyle(routeOptions)
const pageStyle = parsePageStyle(routeOptions)
const nativePage = getPageManager().createPage(url, id.toString(), pageStyle)
if (onCreated) {
onCreated(nativePage)
......
......@@ -33,6 +33,6 @@
"@vue/shared": "3.4.21"
},
"peerDependencies": {
"@dcloudio/types": "^3.4.10"
"@dcloudio/types": "^3.4.11"
}
}
lockfileVersion: '6.0'
lockfileVersion: '6.1'
settings:
autoInstallPeers: true
excludeLinksFromLockfile: false
overrides:
'@babel/plugin-transform-block-scoping': 7.19.4
......@@ -14,8 +18,8 @@ importers:
specifier: ^7.20.2
version: 7.24.4(@babel/core@7.24.4)
'@dcloudio/types':
specifier: 3.4.10
version: 3.4.10
specifier: 3.4.11
version: 3.4.11
'@dcloudio/uni-api':
specifier: 3.0.0-alpha-4010920240605001
version: link:packages/uni-api
......@@ -428,8 +432,8 @@ importers:
packages/uni-app:
dependencies:
'@dcloudio/types':
specifier: ^3.4.10
version: 3.4.10
specifier: ^3.4.11
version: 3.4.11
'@dcloudio/uni-cloud':
specifier: 3.0.0-alpha-4010920240605001
version: link:../uni-cloud
......@@ -3063,8 +3067,8 @@ packages:
resolution: {integrity: sha512-mrCMwcINy1IFjU9VUqLeWBkj404yWs5paLDttBcA+eqUjanuUQbBcTVPqlrGgkyzLXDcV2oDDZRSNxNpXi4kMQ==}
dev: true
/@dcloudio/types@3.4.10:
resolution: {integrity: sha512-WAD6B3b2kgUQ/NMM8eaYu3KNrz/JFyGcGEhZ2eg6u2pnjxmqU2O+N1vAg9nPzezf3hh7IOCCvvDPSNEIUHd0CQ==}
/@dcloudio/types@3.4.11:
resolution: {integrity: sha512-vRmcqV/OQF8r4QQgIz+iHuuBirw7Y+0MeN/QgeEZtcKGUqyMSGDJW4gF8jLJaEtGSZ3dBZslupRXQKZhUBGTpw==}
/@dcloudio/uni-app-x@0.7.15:
resolution: {integrity: sha512-wBV+O523MNrP2M28cwn3YWqFVZRtj7KGVSdRKbTgm5k8P6UBZImFWg7LY4hLg/+CtbTV95hQazpTtJEHbwL3Qg==}
......@@ -11658,7 +11662,3 @@ packages:
optionalDependencies:
commander: 9.5.0
dev: true
settings:
autoInstallPeers: true
excludeLinksFromLockfile: false
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册