Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
20岁爱吃必胜客
uni-app
提交
ab082993
U
uni-app
项目概览
20岁爱吃必胜客
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
1
Star
0
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,发现更多精彩内容 >>
提交
ab082993
编写于
10月 11, 2019
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
merge dev
上级
dd3f9793
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
64 addition
and
52 deletion
+64
-52
src/core/view/plugins/index.js
src/core/view/plugins/index.js
+8
-7
src/platforms/app-plus-nvue/service/api/index.js
src/platforms/app-plus-nvue/service/api/index.js
+3
-1
src/platforms/app-plus/service/api/route/navigate-to.js
src/platforms/app-plus/service/api/route/navigate-to.js
+11
-4
src/platforms/app-plus/service/api/route/switch-tab.js
src/platforms/app-plus/service/api/route/switch-tab.js
+24
-14
src/platforms/app-plus/service/api/route/util.js
src/platforms/app-plus/service/api/route/util.js
+2
-2
src/platforms/app-plus/service/constants.js
src/platforms/app-plus/service/constants.js
+3
-4
src/platforms/app-plus/service/framework/app.js
src/platforms/app-plus/service/framework/app.js
+13
-20
未找到文件。
src/core/view/plugins/index.js
浏览文件 @
ab082993
...
...
@@ -48,14 +48,16 @@ export default {
return
$event
}
Vue
.
prototype
.
$getComponentDescriptor
=
function
(
vm
,
owner
=
false
)
{
return
createComponentDescriptor
(
vm
||
this
,
owner
)
Vue
.
prototype
.
$getComponentDescriptor
=
function
(
vm
)
{
return
createComponentDescriptor
(
vm
||
this
)
}
Vue
.
prototype
.
$handleWxsEvent
=
function
(
$event
)
{
if
(
$event
instanceof
Event
)
{
// 未处理的 event 对象 需要对 target 校正及包装
const
currentTarget
=
$event
.
currentTarget
const
instance
=
currentTarget
&&
currentTarget
.
__vue__
&&
currentTarget
.
__vue__
.
$getComponentDescriptor
()
const
instance
=
currentTarget
&&
currentTarget
.
__vue__
&&
currentTarget
.
__vue__
.
$getComponentDescriptor
()
$event
=
processEvent
.
call
(
this
,
$event
.
type
,
$event
,
{},
findUniTarget
(
$event
,
this
.
$el
)
||
$event
.
target
,
$event
.
currentTarget
)
$event
.
instance
=
instance
...
...
@@ -78,13 +80,12 @@ export default {
initBehaviors
(
options
,
this
)
}
if
(
__PLATFORM__
===
'
h5
'
)
{
if
(
isPage
(
this
))
{
options
.
mounted
=
options
.
mounted
?
[].
concat
(
pageMounted
,
options
.
mounted
)
:
[
pageMounted
]
}
if
(
isPage
(
this
))
{
options
.
mounted
=
options
.
mounted
?
[].
concat
(
pageMounted
,
options
.
mounted
)
:
[
pageMounted
]
}
}
})
// TODO 跨平台时,View 层需要注入$page属性
}
}
src/platforms/app-plus-nvue/service/api/index.js
浏览文件 @
ab082993
...
...
@@ -2,4 +2,6 @@ export * from './context/live-pusher'
export
*
from
'
./context/map
'
export
*
from
'
./context/video
'
export
*
from
'
./plugin/require-native-plugin
'
export
*
from
'
./ui/create-selector-query
'
export
*
from
'
./plugin/require-native-plugin
'
src/platforms/app-plus/service/api/route/navigate-to.js
浏览文件 @
ab082993
...
...
@@ -7,7 +7,8 @@ import {
}
from
'
./util
'
import
{
setStatusBarStyle
setStatusBarStyle
,
invoke
}
from
'
../../bridge
'
import
{
...
...
@@ -23,11 +24,12 @@ function _navigateTo ({
query
,
animationType
,
animationDuration
}
)
{
}
,
callbackId
)
{
UniServiceJSBridge
.
emit
(
'
onAppRoute
'
,
{
type
:
'
navigateTo
'
,
path
})
})
showWebview
(
registerPage
({
path
,
...
...
@@ -35,7 +37,12 @@ function _navigateTo ({
openType
:
'
navigate
'
}),
animationType
,
animationDuration
animationDuration
,
()
=>
{
invoke
(
callbackId
,
{
errMsg
:
'
navigateTo:ok
'
})
}
)
setStatusBarStyle
()
}
...
...
src/platforms/app-plus/service/api/route/switch-tab.js
浏览文件 @
ab082993
...
...
@@ -5,7 +5,8 @@ import {
}
from
'
./util
'
import
{
setStatusBarStyle
setStatusBarStyle
,
invoke
}
from
'
../../bridge
'
import
{
...
...
@@ -21,7 +22,7 @@ import tabBar from '../../../../app-plus/service/framework/tab-bar'
function
_switchTab
({
path
,
from
}
)
{
}
,
callbackId
)
{
tabBar
.
switchTab
(
path
.
slice
(
1
))
const
pages
=
getCurrentPages
()
...
...
@@ -37,11 +38,14 @@ function _switchTab ({
}
})
currentPage
.
$remove
()
if
(
currentPage
.
$page
.
openType
===
'
redirect
'
)
{
currentPage
.
$getAppWebview
().
close
(
ANI_CLOSE
,
ANI_DURATION
)
}
else
{
currentPage
.
$getAppWebview
().
close
(
'
auto
'
)
}
// 延迟执行避免iOS应用退出
setTimeout
(()
=>
{
if
(
currentPage
.
$page
.
openType
===
'
redirect
'
)
{
currentPage
.
$getAppWebview
().
close
(
ANI_CLOSE
,
ANI_DURATION
)
}
else
{
currentPage
.
$getAppWebview
().
close
(
'
auto
'
)
}
},
100
)
}
else
{
// 前一个 tabBar 触发 onHide
currentPage
.
$vm
.
__call_hook
(
'
onHide
'
)
...
...
@@ -65,17 +69,23 @@ function _switchTab ({
tabBarPage
.
$vm
.
__call_hook
(
'
onShow
'
)
tabBarPage
.
$getAppWebview
().
show
(
'
none
'
)
}
else
{
showWebview
(
registerPage
({
path
,
query
:
{},
openType
:
'
switchTab
'
return
showWebview
(
registerPage
({
path
,
query
:
{},
openType
:
'
switchTab
'
}),
'
none
'
,
0
,
()
=>
{
invoke
(
callbackId
,
{
errMsg
:
'
switchTab:ok
'
})
)
},
70
)
}
setStatusBarStyle
()
}
return
{
errMsg
:
'
switchTab:ok
'
}
}
export
function
switchTab
({
url
,
from
...
...
src/platforms/app-plus/service/api/route/util.js
浏览文件 @
ab082993
...
...
@@ -6,7 +6,7 @@ export const ANI_DURATION = 300
const
ANI_SHOW
=
'
pop-in
'
export
const
ANI_CLOSE
=
'
pop-out
'
export
function
showWebview
(
webview
,
animationType
,
animationDuration
,
showCallback
)
{
export
function
showWebview
(
webview
,
animationType
,
animationDuration
,
showCallback
,
delay
=
50
)
{
animationDuration
=
typeof
animationDuration
===
'
undefined
'
?
ANI_DURATION
:
parseInt
(
animationDuration
)
setTimeout
(()
=>
{
webview
.
show
(
...
...
@@ -17,5 +17,5 @@ export function showWebview (webview, animationType, animationDuration, showCall
navigateStack
(
webview
)
}
)
},
50
)
},
delay
)
}
src/platforms/app-plus/service/constants.js
浏览文件 @
ab082993
export
const
ANI_SHOW
=
'
pop-in
'
export
const
ANI_DURATION
=
300
export
const
TABBAR_HEIGHT
=
56
export
const
TITLEBAR_HEIGHT
=
44
export
const
VIEW_WEBVIEW_PATH
=
'
__uniappview.html
'
export
const
TITLEBAR_HEIGHT
=
44
export
const
VIEW_WEBVIEW_PATH
=
'
__uniappview.html
'
src/platforms/app-plus/service/framework/app.js
浏览文件 @
ab082993
...
...
@@ -13,7 +13,6 @@ import {
}
from
'
./page
'
import
{
registerPlusMessage
,
consumePlusMessage
}
from
'
./plus-message
'
...
...
@@ -105,26 +104,20 @@ function initTabBar () {
__uniConfig
.
__ready__
=
true
const
onLaunchWebviewReady
=
function
onLaunchWebviewReady
()
{
const
tabBarView
=
tabBar
.
init
(
__uniConfig
.
tabBar
,
(
item
,
index
)
=>
{
UniServiceJSBridge
.
emit
(
'
onTabItemTap
'
,
{
index
,
text
:
item
.
text
,
pagePath
:
item
.
pagePath
})
uni
.
switchTab
({
url
:
'
/
'
+
item
.
pagePath
,
openType
:
'
switchTab
'
,
from
:
'
tabbar
'
}
)
tabBar
.
init
(
__uniConfig
.
tabBar
,
(
item
,
index
)
=>
{
uni
.
switchTab
(
{
url
:
'
/
'
+
item
.
pagePath
,
openType
:
'
switchTab
'
,
from
:
'
tabBar
'
,
success
()
{
UniServiceJSBridge
.
emit
(
'
onTabItemTap
'
,
{
index
,
text
:
item
.
text
,
pagePath
:
item
.
pagePath
})
}
})
tabBarView
&&
plus
.
webview
.
getLaunchWebview
().
append
(
tabBarView
)
}
if
(
plus
.
webview
.
getLaunchWebview
())
{
onLaunchWebviewReady
()
}
else
{
registerPlusMessage
(
'
UniWebviewReady-
'
+
plus
.
runtime
.
appid
,
onLaunchWebviewReady
,
false
)
}
})
}
export
function
registerApp
(
appVm
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录