提交 31b1a2e9 编写于 作者: Q qiang

fix: 修复纯nvue模式路由API不触发回调的问题

上级 e4c0e281
......@@ -79,7 +79,7 @@ export function navigateBack ({
animationType,
animationDuration
}) {
const pages = getCurrentPages()
const pages = getCurrentPages()
const currentPage = pages[pages.length - 1]
if (
......@@ -91,11 +91,15 @@ export function navigateBack ({
})
) {
return
}
}
uni.hideToast() // 后退时,关闭 toast,loading
currentPage.$page.meta.isQuit
? quit()
: back(delta, animationType, animationDuration)
}
return {
errMsg: 'navigateBack:ok'
}
}
......@@ -7,14 +7,15 @@ import {
} from './util'
import {
setStatusBarStyle
setStatusBarStyle,
invoke
} from '../../bridge'
export function navigateTo ({
url,
animationType,
animationDuration
}) {
}, callbackId) {
const urls = url.split('?')
const path = urls[0]
......@@ -32,8 +33,13 @@ export function navigateTo ({
openType: 'navigate'
}),
animationType,
animationDuration
animationDuration,
() => {
invoke(callbackId, {
errMsg: 'navigateTo:ok'
})
}
)
setStatusBarStyle()
}
}
......@@ -7,14 +7,15 @@ import {
} from './util'
import {
setStatusBarStyle
setStatusBarStyle,
invoke
} from '../../bridge'
import tabBar from '../../../../app-plus/service/framework/tab-bar'
export function reLaunch ({
url
}) {
}, callbackId) {
const urls = url.split('?')
const path = urls[0]
......@@ -35,7 +36,12 @@ export function reLaunch ({
openType: 'reLaunch'
}),
'none',
0
0,
() => {
invoke(callbackId, {
errMsg: 'reLaunch:ok'
})
}
)
pages.forEach(page => {
......@@ -44,4 +50,4 @@ export function reLaunch ({
})
setStatusBarStyle()
}
}
......@@ -7,12 +7,13 @@ import {
} from './util'
import {
setStatusBarStyle
setStatusBarStyle,
invoke
} from '../../bridge'
export function redirectTo ({
url
}) {
}, callbackId) {
const urls = url.split('?')
const path = urls[0]
......@@ -33,8 +34,11 @@ export function redirectTo ({
0,
() => {
lastPage && lastPage.$getAppWebview().close('none')
invoke(callbackId, {
errMsg: 'redirectTo:ok'
})
}
)
setStatusBarStyle()
}
}
......@@ -5,7 +5,8 @@ import {
} from './util'
import {
setStatusBarStyle
setStatusBarStyle,
invoke
} from '../../bridge'
import tabBar from '../../../../app-plus/service/framework/tab-bar'
......@@ -13,7 +14,7 @@ import tabBar from '../../../../app-plus/service/framework/tab-bar'
export function switchTab ({
url,
from
}) {
}, callbackId) {
const path = url.split('?')[0]
tabBar.switchTab(path.slice(1))
......@@ -66,8 +67,16 @@ export function switchTab ({
path,
query: {},
openType: 'switchTab'
}), 'none', 0, null, 70)
}), 'none', 0, () => {
invoke(callbackId, {
errMsg: 'switchTab:ok'
})
}, 70)
return
}
setStatusBarStyle()
return {
errMsg: 'switchTab:ok'
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册