diff --git a/src/core/service/api/route.js b/src/core/service/api/route.js index 380e97d32aa22f7eff17d3836f481072b31276a6..4f44348aa48df4cec48c4ad3378b61f867123940 100644 --- a/src/core/service/api/route.js +++ b/src/core/service/api/route.js @@ -5,7 +5,8 @@ import { function onAppRoute (type, { url, delta, - from = 'navigateBack' + from = 'navigateBack', + detail } = {}) { const router = getApp().$router switch (type) { @@ -45,7 +46,10 @@ function onAppRoute (type, { case 'switchTab': router.replace({ type, - path: url + path: url, + params: { + detail + } }) break } diff --git a/src/core/service/plugins/util.js b/src/core/service/plugins/util.js index 705d2de504e4ecbe75616cc20dd1b7b7bad25e65..55819da95ec37d670efd5db59ffa61c6b1443db2 100644 --- a/src/core/service/plugins/util.js +++ b/src/core/service/plugins/util.js @@ -20,7 +20,13 @@ export function callPageHook (vm, hook, ...params) { vm.$mp.query = params[0] UniServiceJSBridge.publishHandler('onPageLoad', vm, vm.$page.id) } - if (hook === 'onShow') { + if (hook === 'onShow') { + if ( + vm.$route.meta.isTabBar && + vm.$route.params.detail + ) { + UniServiceJSBridge.emit('onTabItemTap', vm.$route.params.detail) + } UniServiceJSBridge.publishHandler('onPageShow', vm, vm.$page.id) } }