Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MuGuiLin
uni-app
提交
54053874
U
uni-app
项目概览
MuGuiLin
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
54053874
编写于
7月 23, 2019
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add route
上级
19a0fe58
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
194 addition
and
11 deletion
+194
-11
packages/uni-app-plus-nvue/dist/uni.js
packages/uni-app-plus-nvue/dist/uni.js
+88
-2
src/core/helpers/api.js
src/core/helpers/api.js
+1
-1
src/platforms/app-plus-nvue/service/api/index.js
src/platforms/app-plus-nvue/service/api/index.js
+7
-1
src/platforms/app-plus-nvue/service/api/route/navigate-back.js
...latforms/app-plus-nvue/service/api/route/navigate-back.js
+36
-0
src/platforms/app-plus-nvue/service/api/route/navigate-to.js
src/platforms/app-plus-nvue/service/api/route/navigate-to.js
+24
-0
src/platforms/app-plus-nvue/service/api/route/re-launch.js
src/platforms/app-plus-nvue/service/api/route/re-launch.js
+3
-0
src/platforms/app-plus-nvue/service/api/route/redirect-to.js
src/platforms/app-plus-nvue/service/api/route/redirect-to.js
+3
-0
src/platforms/app-plus-nvue/service/api/route/switch-tab.js
src/platforms/app-plus-nvue/service/api/route/switch-tab.js
+3
-0
src/platforms/app-plus-nvue/service/api/route/util.js
src/platforms/app-plus-nvue/service/api/route/util.js
+14
-0
src/platforms/app-plus/service/api/device/scan-code.js
src/platforms/app-plus/service/api/device/scan-code.js
+2
-2
src/platforms/app-plus/service/api/ui/popup.js
src/platforms/app-plus/service/api/ui/popup.js
+13
-5
未找到文件。
packages/uni-app-plus-nvue/dist/uni.js
浏览文件 @
54053874
...
...
@@ -1816,7 +1816,7 @@ function invokeCallbackHandler (invokeCallbackId, res) {
}
function
wrapperUnimplemented
(
name
)
{
return
function
unimplemented
(
args
)
{
return
function
todo
(
args
)
{
console
.
error
(
'
API `
'
+
name
+
'
` is not yet implemented
'
);
}
}
...
...
@@ -6806,12 +6806,98 @@ function createVideoContext$1 (id, vm) {
return
new
VideoContext
(
id
,
elm
)
}
const
ANI_DURATION$1
=
300
;
const
ANI_SHOW$1
=
'
pop-in
'
;
function
showWebview
(
webview
,
animationType
,
animationDuration
)
{
setTimeout
(()
=>
{
webview
.
show
(
animationType
||
ANI_SHOW$1
,
animationDuration
||
ANI_DURATION$1
,
()
=>
{
console
.
log
(
'
show.callback
'
);
}
);
},
50
);
}
let
firstBackTime
=
0
;
function
navigateBack$1
({
delta
,
animationType
,
animationDuration
})
{
const
pages
=
getCurrentPages
();
const
len
=
pages
.
length
-
1
;
const
page
=
pages
[
len
];
if
(
page
.
$page
.
meta
.
isQuit
)
{
if
(
!
firstBackTime
)
{
firstBackTime
=
Date
.
now
();
plus
.
nativeUI
.
toast
(
'
再按一次退出应用
'
);
setTimeout
(()
=>
{
firstBackTime
=
null
;
},
2000
);
}
else
if
(
Date
.
now
()
-
firstBackTime
<
2000
)
{
plus
.
runtime
.
quit
();
}
}
else
{
pages
.
splice
(
len
,
1
);
if
(
animationType
)
{
page
.
$getAppWebview
().
close
(
animationType
,
animationDuration
||
ANI_DURATION$1
);
}
else
{
page
.
$getAppWebview
().
close
(
'
auto
'
);
}
UniServiceJSBridge
.
emit
(
'
onAppRoute
'
,
{
type
:
'
navigateBack
'
});
}
}
function
navigateTo$1
({
url
,
animationType
,
animationDuration
})
{
const
path
=
url
.
split
(
'
?
'
)[
0
];
UniServiceJSBridge
.
emit
(
'
onAppRoute
'
,
{
type
:
'
navigateTo
'
,
path
});
showWebview
(
__registerPage
({
path
}),
animationType
,
animationDuration
);
}
function
reLaunch$1
({
path
})
{}
function
redirectTo$1
({
path
})
{}
function
switchTab$1
({
path
})
{}
var
nvueApi
=
/*#__PURE__*/
Object
.
freeze
({
createLivePusherContext
:
createLivePusherContext
,
createMapContext
:
createMapContext$1
,
createVideoContext
:
createVideoContext$1
createVideoContext
:
createVideoContext$1
,
navigateBack
:
navigateBack$1
,
navigateTo
:
navigateTo$1
,
reLaunch
:
reLaunch$1
,
redirectTo
:
redirectTo$1
,
switchTab
:
switchTab$1
});
var
platformApi
=
Object
.
assign
({},
appApi
,
nvueApi
);
...
...
src/core/helpers/api.js
浏览文件 @
54053874
...
...
@@ -234,7 +234,7 @@ export function invokeCallbackHandler (invokeCallbackId, res) {
}
export
function
wrapperUnimplemented
(
name
)
{
return
function
unimplemented
(
args
)
{
return
function
todo
(
args
)
{
console
.
error
(
'
API `
'
+
name
+
'
` is not yet implemented
'
)
}
}
...
...
src/platforms/app-plus-nvue/service/api/index.js
浏览文件 @
54053874
export
*
from
'
./context/live-pusher
'
export
*
from
'
./context/map
'
export
*
from
'
./context/video
'
export
*
from
'
./context/video
'
export
*
from
'
./route/navigate-back
'
export
*
from
'
./route/navigate-to
'
export
*
from
'
./route/re-launch
'
export
*
from
'
./route/redirect-to
'
export
*
from
'
./route/switch-tab
'
src/platforms/app-plus-nvue/service/api/route/navigate-back.js
0 → 100644
浏览文件 @
54053874
import
{
ANI_DURATION
}
from
'
./util
'
let
firstBackTime
=
0
export
function
navigateBack
({
delta
,
animationType
,
animationDuration
})
{
const
pages
=
getCurrentPages
()
const
len
=
pages
.
length
-
1
const
page
=
pages
[
len
]
if
(
page
.
$page
.
meta
.
isQuit
)
{
if
(
!
firstBackTime
)
{
firstBackTime
=
Date
.
now
()
plus
.
nativeUI
.
toast
(
'
再按一次退出应用
'
)
setTimeout
(()
=>
{
firstBackTime
=
null
},
2000
)
}
else
if
(
Date
.
now
()
-
firstBackTime
<
2000
)
{
plus
.
runtime
.
quit
()
}
}
else
{
pages
.
splice
(
len
,
1
)
if
(
animationType
)
{
page
.
$getAppWebview
().
close
(
animationType
,
animationDuration
||
ANI_DURATION
)
}
else
{
page
.
$getAppWebview
().
close
(
'
auto
'
)
}
UniServiceJSBridge
.
emit
(
'
onAppRoute
'
,
{
type
:
'
navigateBack
'
})
}
}
src/platforms/app-plus-nvue/service/api/route/navigate-to.js
0 → 100644
浏览文件 @
54053874
import
{
showWebview
}
from
'
./util
'
export
function
navigateTo
({
url
,
animationType
,
animationDuration
})
{
const
path
=
url
.
split
(
'
?
'
)[
0
]
UniServiceJSBridge
.
emit
(
'
onAppRoute
'
,
{
type
:
'
navigateTo
'
,
path
})
showWebview
(
__registerPage
({
path
}),
animationType
,
animationDuration
)
}
src/platforms/app-plus-nvue/service/api/route/re-launch.js
0 → 100644
浏览文件 @
54053874
export
function
reLaunch
({
path
})
{}
src/platforms/app-plus-nvue/service/api/route/redirect-to.js
0 → 100644
浏览文件 @
54053874
export
function
redirectTo
({
path
})
{}
src/platforms/app-plus-nvue/service/api/route/switch-tab.js
0 → 100644
浏览文件 @
54053874
export
function
switchTab
({
path
})
{}
src/platforms/app-plus-nvue/service/api/route/util.js
0 → 100644
浏览文件 @
54053874
export
const
ANI_DURATION
=
300
const
ANI_SHOW
=
'
pop-in
'
export
function
showWebview
(
webview
,
animationType
,
animationDuration
)
{
setTimeout
(()
=>
{
webview
.
show
(
animationType
||
ANI_SHOW
,
animationDuration
||
ANI_DURATION
,
()
=>
{
console
.
log
(
'
show.callback
'
)
}
)
},
50
)
}
src/platforms/app-plus/service/api/device/scan-code.js
浏览文件 @
54053874
...
...
@@ -15,8 +15,8 @@ import {
registerPlusMessage
}
from
'
../../framework/plus-message
'
const
SCAN_ID
=
'
__UNIAPP_SCAN
'
const
SCAN_PATH
=
'
_www/__uniappscan.html
'
export
const
SCAN_ID
=
'
__UNIAPP_SCAN
'
export
const
SCAN_PATH
=
'
_www/__uniappscan.html
'
const
MESSAGE_TYPE
=
'
scanCode
'
...
...
src/platforms/app-plus/service/api/ui/popup.js
浏览文件 @
54053874
...
...
@@ -7,7 +7,15 @@ let waitingTimeout
let
toast
=
false
let
toastTimeout
export
function
showToast
({
export
function
showLoading
(
args
)
{
return
showToast
(
args
).
replace
(
'
showToast
'
,
'
showLoading
'
)
}
export
function
hideLoading
()
{
return
hideToast
().
replace
(
'
hideToast
'
,
'
hideLoading
'
)
}
export
function
showToast
({
title
=
''
,
icon
=
'
success
'
,
image
=
''
,
...
...
@@ -96,7 +104,7 @@ export function showToast ({
}
}
export
function
hideToast
()
{
export
function
hideToast
()
{
if
(
toast
)
{
toastTimeout
&&
clearTimeout
(
toastTimeout
)
plus
.
nativeUI
.
closeToast
()
...
...
@@ -112,7 +120,7 @@ export function hideToast () {
errMsg
:
'
hideToast:ok
'
}
}
export
function
showModal
({
export
function
showModal
({
title
=
''
,
content
=
''
,
showCancel
=
true
,
...
...
@@ -137,7 +145,7 @@ export function showModal ({
}
},
title
,
showCancel
?
[
cancelText
,
confirmText
]
:
[
confirmText
])
}
export
function
showActionSheet
({
export
function
showActionSheet
({
itemList
=
[],
itemColor
=
'
#000000
'
,
title
=
''
...
...
@@ -167,4 +175,4 @@ export function showActionSheet ({
})
}
})
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录