Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
uni-app
提交
31b1a2e9
U
uni-app
项目概览
DCloud
/
uni-app
5 个月 前同步成功
通知
748
Star
38709
Fork
3642
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
8
列表
看板
标记
里程碑
合并请求
1
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
8
Issue
8
列表
看板
标记
里程碑
合并请求
1
合并请求
1
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
31b1a2e9
编写于
10月 10, 2019
作者:
Q
qiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: 修复纯nvue模式路由API不触发回调的问题
上级
e4c0e281
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
46 addition
and
17 deletion
+46
-17
src/platforms/app-plus-nvue/service/api/route/navigate-back.js
...latforms/app-plus-nvue/service/api/route/navigate-back.js
+7
-3
src/platforms/app-plus-nvue/service/api/route/navigate-to.js
src/platforms/app-plus-nvue/service/api/route/navigate-to.js
+10
-4
src/platforms/app-plus-nvue/service/api/route/re-launch.js
src/platforms/app-plus-nvue/service/api/route/re-launch.js
+10
-4
src/platforms/app-plus-nvue/service/api/route/redirect-to.js
src/platforms/app-plus-nvue/service/api/route/redirect-to.js
+7
-3
src/platforms/app-plus-nvue/service/api/route/switch-tab.js
src/platforms/app-plus-nvue/service/api/route/switch-tab.js
+12
-3
未找到文件。
src/platforms/app-plus-nvue/service/api/route/navigate-back.js
浏览文件 @
31b1a2e9
...
@@ -79,7 +79,7 @@ export function navigateBack ({
...
@@ -79,7 +79,7 @@ export function navigateBack ({
animationType
,
animationType
,
animationDuration
animationDuration
})
{
})
{
const
pages
=
getCurrentPages
()
const
pages
=
getCurrentPages
()
const
currentPage
=
pages
[
pages
.
length
-
1
]
const
currentPage
=
pages
[
pages
.
length
-
1
]
if
(
if
(
...
@@ -91,11 +91,15 @@ export function navigateBack ({
...
@@ -91,11 +91,15 @@ export function navigateBack ({
})
})
)
{
)
{
return
return
}
}
uni
.
hideToast
()
// 后退时,关闭 toast,loading
uni
.
hideToast
()
// 后退时,关闭 toast,loading
currentPage
.
$page
.
meta
.
isQuit
currentPage
.
$page
.
meta
.
isQuit
?
quit
()
?
quit
()
:
back
(
delta
,
animationType
,
animationDuration
)
:
back
(
delta
,
animationType
,
animationDuration
)
}
return
{
errMsg
:
'
navigateBack:ok
'
}
}
src/platforms/app-plus-nvue/service/api/route/navigate-to.js
浏览文件 @
31b1a2e9
...
@@ -7,14 +7,15 @@ import {
...
@@ -7,14 +7,15 @@ import {
}
from
'
./util
'
}
from
'
./util
'
import
{
import
{
setStatusBarStyle
setStatusBarStyle
,
invoke
}
from
'
../../bridge
'
}
from
'
../../bridge
'
export
function
navigateTo
({
export
function
navigateTo
({
url
,
url
,
animationType
,
animationType
,
animationDuration
animationDuration
})
{
}
,
callbackId
)
{
const
urls
=
url
.
split
(
'
?
'
)
const
urls
=
url
.
split
(
'
?
'
)
const
path
=
urls
[
0
]
const
path
=
urls
[
0
]
...
@@ -32,8 +33,13 @@ export function navigateTo ({
...
@@ -32,8 +33,13 @@ export function navigateTo ({
openType
:
'
navigate
'
openType
:
'
navigate
'
}),
}),
animationType
,
animationType
,
animationDuration
animationDuration
,
()
=>
{
invoke
(
callbackId
,
{
errMsg
:
'
navigateTo:ok
'
})
}
)
)
setStatusBarStyle
()
setStatusBarStyle
()
}
}
src/platforms/app-plus-nvue/service/api/route/re-launch.js
浏览文件 @
31b1a2e9
...
@@ -7,14 +7,15 @@ import {
...
@@ -7,14 +7,15 @@ import {
}
from
'
./util
'
}
from
'
./util
'
import
{
import
{
setStatusBarStyle
setStatusBarStyle
,
invoke
}
from
'
../../bridge
'
}
from
'
../../bridge
'
import
tabBar
from
'
../../../../app-plus/service/framework/tab-bar
'
import
tabBar
from
'
../../../../app-plus/service/framework/tab-bar
'
export
function
reLaunch
({
export
function
reLaunch
({
url
url
})
{
}
,
callbackId
)
{
const
urls
=
url
.
split
(
'
?
'
)
const
urls
=
url
.
split
(
'
?
'
)
const
path
=
urls
[
0
]
const
path
=
urls
[
0
]
...
@@ -35,7 +36,12 @@ export function reLaunch ({
...
@@ -35,7 +36,12 @@ export function reLaunch ({
openType
:
'
reLaunch
'
openType
:
'
reLaunch
'
}),
}),
'
none
'
,
'
none
'
,
0
0
,
()
=>
{
invoke
(
callbackId
,
{
errMsg
:
'
reLaunch:ok
'
})
}
)
)
pages
.
forEach
(
page
=>
{
pages
.
forEach
(
page
=>
{
...
@@ -44,4 +50,4 @@ export function reLaunch ({
...
@@ -44,4 +50,4 @@ export function reLaunch ({
})
})
setStatusBarStyle
()
setStatusBarStyle
()
}
}
src/platforms/app-plus-nvue/service/api/route/redirect-to.js
浏览文件 @
31b1a2e9
...
@@ -7,12 +7,13 @@ import {
...
@@ -7,12 +7,13 @@ import {
}
from
'
./util
'
}
from
'
./util
'
import
{
import
{
setStatusBarStyle
setStatusBarStyle
,
invoke
}
from
'
../../bridge
'
}
from
'
../../bridge
'
export
function
redirectTo
({
export
function
redirectTo
({
url
url
})
{
}
,
callbackId
)
{
const
urls
=
url
.
split
(
'
?
'
)
const
urls
=
url
.
split
(
'
?
'
)
const
path
=
urls
[
0
]
const
path
=
urls
[
0
]
...
@@ -33,8 +34,11 @@ export function redirectTo ({
...
@@ -33,8 +34,11 @@ export function redirectTo ({
0
,
0
,
()
=>
{
()
=>
{
lastPage
&&
lastPage
.
$getAppWebview
().
close
(
'
none
'
)
lastPage
&&
lastPage
.
$getAppWebview
().
close
(
'
none
'
)
invoke
(
callbackId
,
{
errMsg
:
'
redirectTo:ok
'
})
}
}
)
)
setStatusBarStyle
()
setStatusBarStyle
()
}
}
src/platforms/app-plus-nvue/service/api/route/switch-tab.js
浏览文件 @
31b1a2e9
...
@@ -5,7 +5,8 @@ import {
...
@@ -5,7 +5,8 @@ import {
}
from
'
./util
'
}
from
'
./util
'
import
{
import
{
setStatusBarStyle
setStatusBarStyle
,
invoke
}
from
'
../../bridge
'
}
from
'
../../bridge
'
import
tabBar
from
'
../../../../app-plus/service/framework/tab-bar
'
import
tabBar
from
'
../../../../app-plus/service/framework/tab-bar
'
...
@@ -13,7 +14,7 @@ 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
({
export
function
switchTab
({
url
,
url
,
from
from
})
{
}
,
callbackId
)
{
const
path
=
url
.
split
(
'
?
'
)[
0
]
const
path
=
url
.
split
(
'
?
'
)[
0
]
tabBar
.
switchTab
(
path
.
slice
(
1
))
tabBar
.
switchTab
(
path
.
slice
(
1
))
...
@@ -66,8 +67,16 @@ export function switchTab ({
...
@@ -66,8 +67,16 @@ export function switchTab ({
path
,
path
,
query
:
{},
query
:
{},
openType
:
'
switchTab
'
openType
:
'
switchTab
'
}),
'
none
'
,
0
,
null
,
70
)
}),
'
none
'
,
0
,
()
=>
{
invoke
(
callbackId
,
{
errMsg
:
'
switchTab:ok
'
})
},
70
)
return
}
}
setStatusBarStyle
()
setStatusBarStyle
()
return
{
errMsg
:
'
switchTab:ok
'
}
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录