Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
wzj-java
uni-app
提交
4b4d5e1f
U
uni-app
项目概览
wzj-java
/
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,发现更多精彩内容 >>
提交
4b4d5e1f
编写于
12月 31, 2019
作者:
Q
qiang
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'dev' of github.com:dcloudio/uni-app into dev
上级
c1873b26
cd29cdb5
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
89 addition
and
29 deletion
+89
-29
packages/uni-app-plus/dist/index.v3.js
packages/uni-app-plus/dist/index.v3.js
+35
-11
packages/vue-cli-plugin-uni/packages/@vue/component-compiler-utils/dist/parseCustomBlocks.js
...s/@vue/component-compiler-utils/dist/parseCustomBlocks.js
+15
-3
src/platforms/app-plus/service/api/route/navigate-to.js
src/platforms/app-plus/service/api/route/navigate-to.js
+14
-11
src/platforms/app-plus/service/api/route/re-launch.js
src/platforms/app-plus/service/api/route/re-launch.js
+3
-0
src/platforms/app-plus/service/api/route/redirect-to.js
src/platforms/app-plus/service/api/route/redirect-to.js
+3
-0
src/platforms/app-plus/service/api/route/switch-tab.js
src/platforms/app-plus/service/api/route/switch-tab.js
+4
-1
src/platforms/app-plus/service/framework/page.js
src/platforms/app-plus/service/framework/page.js
+3
-2
src/platforms/app-plus/service/framework/webview/index.js
src/platforms/app-plus/service/framework/webview/index.js
+12
-1
未找到文件。
packages/uni-app-plus/dist/index.v3.js
浏览文件 @
4b4d5e1f
...
...
@@ -7681,7 +7681,7 @@ var serviceContext = (function () {
return
webview
}
function
initWebview
(
webview
,
routeOptions
)
{
function
initWebview
(
webview
,
routeOptions
,
url
=
''
)
{
// 首页或非 nvue 页面
if
(
webview
.
id
===
'
1
'
||
!
routeOptions
.
meta
.
isNVue
)
{
const
webviewStyle
=
parseWebviewStyle
(
...
...
@@ -7689,6 +7689,17 @@ var serviceContext = (function () {
''
,
routeOptions
);
if
(
url
)
{
const
part
=
url
.
split
(
'
?
'
);
webviewStyle
.
debugRefresh
=
{
isTab
:
routeOptions
.
meta
.
isTabBar
,
arguments
:
JSON
.
stringify
({
path
:
part
[
0
].
substr
(
1
),
query
:
part
[
1
]
||
''
})
};
}
if
(
process
.
env
.
NODE_ENV
!==
'
production
'
)
{
console
.
log
(
`[uni-app] updateWebview`
,
webviewStyle
);
}
...
...
@@ -7881,7 +7892,8 @@ var serviceContext = (function () {
/**
* 首页需要主动registerPage,二级页面路由跳转时registerPage
*/
function
registerPage
({
function
registerPage
({
url
,
path
,
query
,
openType
,
...
...
@@ -7920,7 +7932,7 @@ var serviceContext = (function () {
console
.
log
(
`[uni-app] registerPage`
,
path
,
webview
.
id
);
}
initWebview
(
webview
,
routeOptions
);
initWebview
(
webview
,
routeOptions
,
url
);
const
route
=
path
.
slice
(
1
);
...
...
@@ -7986,6 +7998,7 @@ var serviceContext = (function () {
}
function
_navigateTo
({
url
,
path
,
query
,
animationType
,
...
...
@@ -7998,6 +8011,7 @@ var serviceContext = (function () {
showWebview
(
registerPage
({
url
,
path
,
query
,
openType
:
'
navigate
'
...
...
@@ -8020,18 +8034,19 @@ var serviceContext = (function () {
animationDuration
},
callbackId
)
{
const
urls
=
url
.
split
(
'
?
'
);
const
path
=
urls
[
0
];
const
routeStyles
=
__uniRoutes
.
find
(
route
=>
route
.
path
===
path
).
window
;
const
globalStyle
=
__uniConfig
.
window
;
if
(
!
animationType
)
{
animationType
=
routeStyles
.
animationType
||
globalStyle
.
animationType
||
ANI_SHOW
;
}
if
(
!
animationDuration
)
{
animationDuration
=
routeStyles
.
animationDuration
||
globalStyle
.
animationDuration
||
ANI_DURATION
;
const
path
=
urls
[
0
];
const
routeStyles
=
__uniRoutes
.
find
(
route
=>
route
.
path
===
path
).
window
;
const
globalStyle
=
__uniConfig
.
window
;
if
(
!
animationType
)
{
animationType
=
routeStyles
.
animationType
||
globalStyle
.
animationType
||
ANI_SHOW
;
}
if
(
!
animationDuration
)
{
animationDuration
=
routeStyles
.
animationDuration
||
globalStyle
.
animationDuration
||
ANI_DURATION
;
}
const
query
=
parseQuery
(
urls
[
1
]
||
''
);
navigate
(
path
,
function
()
{
_navigateTo
({
url
,
path
,
query
,
animationType
,
...
...
@@ -8041,6 +8056,7 @@ var serviceContext = (function () {
}
function
_reLaunch
({
url
,
path
,
query
},
callbackId
)
{
...
...
@@ -8054,6 +8070,7 @@ var serviceContext = (function () {
showWebview
(
registerPage
({
url
,
path
,
query
,
openType
:
'
reLaunch
'
...
...
@@ -8082,6 +8099,7 @@ var serviceContext = (function () {
const
query
=
parseQuery
(
urls
[
1
]
||
''
);
navigate
(
path
,
function
()
{
_reLaunch
({
url
,
path
,
query
},
callbackId
);
...
...
@@ -8089,6 +8107,7 @@ var serviceContext = (function () {
}
function
_redirectTo
({
url
,
path
,
query
},
callbackId
)
{
...
...
@@ -8099,6 +8118,7 @@ var serviceContext = (function () {
showWebview
(
registerPage
({
url
,
path
,
query
,
openType
:
'
redirect
'
...
...
@@ -8123,6 +8143,7 @@ var serviceContext = (function () {
const
query
=
parseQuery
(
urls
[
1
]
||
''
);
navigate
(
path
,
function
()
{
_redirectTo
({
url
,
path
,
query
},
callbackId
);
...
...
@@ -8130,6 +8151,7 @@ var serviceContext = (function () {
}
function
_switchTab
({
url
,
path
,
from
},
callbackId
)
{
...
...
@@ -8180,6 +8202,7 @@ var serviceContext = (function () {
tabBarPage
.
$getAppWebview
().
show
(
'
none
'
);
}
else
{
return
showWebview
(
registerPage
({
url
,
path
,
query
:
{},
openType
:
'
switchTab
'
...
...
@@ -8205,6 +8228,7 @@ var serviceContext = (function () {
const
path
=
url
.
split
(
'
?
'
)[
0
];
navigate
(
path
,
function
()
{
_switchTab
({
url
,
path
,
from
},
callbackId
);
...
...
packages/vue-cli-plugin-uni/packages/@vue/component-compiler-utils/dist/parseCustomBlocks.js
浏览文件 @
4b4d5e1f
const
{
getPlatformFilterTag
,
normalizeNodeModules
normalizeNodeModules
,
jsPreprocessOptions
}
=
require
(
'
@dcloudio/uni-cli-shared/lib/platform
'
)
const
preprocessor
=
require
(
'
@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/preprocess
'
)
const
FILTER_TAG
=
getPlatformFilterTag
()
function
preprocessBlock
(
block
)
{
if
(
block
.
content
)
{
block
.
content
=
preprocessor
.
preprocess
(
block
.
content
,
jsPreprocessOptions
.
context
,
{
type
:
jsPreprocessOptions
.
type
}).
trim
()
}
return
block
}
module
.
exports
=
function
parseCustomBlocks
(
descriptor
,
options
)
{
if
(
!
descriptor
.
template
||
!
FILTER_TAG
||
options
.
isAppNVue
)
{
...
...
@@ -23,7 +35,7 @@ module.exports = function parseCustomBlocks(descriptor, options) {
block
.
attrs
.
lang
===
FILTER_TAG
)
)
{
modules
[
block
.
attrs
.
module
]
=
block
modules
[
block
.
attrs
.
module
]
=
preprocessBlock
(
block
)
return
true
}
if
(
// renderjs
...
...
@@ -33,7 +45,7 @@ module.exports = function parseCustomBlocks(descriptor, options) {
block
.
attrs
.
lang
===
'
renderjs
'
)
)
{
descriptor
.
renderjs
=
block
descriptor
.
renderjs
=
preprocessBlock
(
block
)
modules
[
block
.
attrs
.
module
]
=
Object
.
assign
({},
block
,
{
content
:
''
})
...
...
src/platforms/app-plus/service/api/route/navigate-to.js
浏览文件 @
4b4d5e1f
import
{
parseQuery
}
from
'
uni-shared
'
}
from
'
uni-shared
'
import
{
ANI_SHOW
,
ANI_DURATION
...
...
@@ -25,6 +25,7 @@ import {
}
from
'
../../framework/navigator
'
function
_navigateTo
({
url
,
path
,
query
,
animationType
,
...
...
@@ -37,6 +38,7 @@ function _navigateTo ({
showWebview
(
registerPage
({
url
,
path
,
query
,
openType
:
'
navigate
'
...
...
@@ -59,22 +61,23 @@ export function navigateTo ({
animationDuration
},
callbackId
)
{
const
urls
=
url
.
split
(
'
?
'
)
const
path
=
urls
[
0
]
const
routeStyles
=
__uniRoutes
.
find
(
route
=>
route
.
path
===
path
).
window
const
globalStyle
=
__uniConfig
.
window
if
(
!
animationType
)
{
animationType
=
routeStyles
.
animationType
||
globalStyle
.
animationType
||
ANI_SHOW
}
if
(
!
animationDuration
)
{
animationDuration
=
routeStyles
.
animationDuration
||
globalStyle
.
animationDuration
||
ANI_DURATION
const
path
=
urls
[
0
]
const
routeStyles
=
__uniRoutes
.
find
(
route
=>
route
.
path
===
path
).
window
const
globalStyle
=
__uniConfig
.
window
if
(
!
animationType
)
{
animationType
=
routeStyles
.
animationType
||
globalStyle
.
animationType
||
ANI_SHOW
}
if
(
!
animationDuration
)
{
animationDuration
=
routeStyles
.
animationDuration
||
globalStyle
.
animationDuration
||
ANI_DURATION
}
const
query
=
parseQuery
(
urls
[
1
]
||
''
)
navigate
(
path
,
function
()
{
_navigateTo
({
url
,
path
,
query
,
animationType
,
animationDuration
},
callbackId
)
},
openType
===
'
appLaunch
'
)
}
}
src/platforms/app-plus/service/api/route/re-launch.js
浏览文件 @
4b4d5e1f
...
...
@@ -22,6 +22,7 @@ import {
}
from
'
../../framework/navigator
'
function
_reLaunch
({
url
,
path
,
query
},
callbackId
)
{
...
...
@@ -35,6 +36,7 @@ function _reLaunch ({
showWebview
(
registerPage
({
url
,
path
,
query
,
openType
:
'
reLaunch
'
...
...
@@ -63,6 +65,7 @@ export function reLaunch ({
const
query
=
parseQuery
(
urls
[
1
]
||
''
)
navigate
(
path
,
function
()
{
_reLaunch
({
url
,
path
,
query
},
callbackId
)
...
...
src/platforms/app-plus/service/api/route/redirect-to.js
浏览文件 @
4b4d5e1f
...
...
@@ -20,6 +20,7 @@ import {
}
from
'
../../framework/navigator
'
function
_redirectTo
({
url
,
path
,
query
},
callbackId
)
{
...
...
@@ -30,6 +31,7 @@ function _redirectTo ({
showWebview
(
registerPage
({
url
,
path
,
query
,
openType
:
'
redirect
'
...
...
@@ -54,6 +56,7 @@ export function redirectTo ({
const
query
=
parseQuery
(
urls
[
1
]
||
''
)
navigate
(
path
,
function
()
{
_redirectTo
({
url
,
path
,
query
},
callbackId
)
...
...
src/platforms/app-plus/service/api/route/switch-tab.js
浏览文件 @
4b4d5e1f
...
...
@@ -23,6 +23,7 @@ import {
import
tabBar
from
'
../../framework/tab-bar
'
function
_switchTab
({
url
,
path
,
from
},
callbackId
)
{
...
...
@@ -73,6 +74,7 @@ function _switchTab ({
tabBarPage
.
$getAppWebview
().
show
(
'
none
'
)
}
else
{
return
showWebview
(
registerPage
({
url
,
path
,
query
:
{},
openType
:
'
switchTab
'
...
...
@@ -98,8 +100,9 @@ export function switchTab ({
const
path
=
url
.
split
(
'
?
'
)[
0
]
navigate
(
path
,
function
()
{
_switchTab
({
url
,
path
,
from
},
callbackId
)
},
openType
===
'
appLaunch
'
)
}
}
src/platforms/app-plus/service/framework/page.js
浏览文件 @
4b4d5e1f
...
...
@@ -24,7 +24,8 @@ export function getCurrentPages (returnAll) {
/**
* 首页需要主动registerPage,二级页面路由跳转时registerPage
*/
export
function
registerPage
({
export
function
registerPage
({
url
,
path
,
query
,
openType
,
...
...
@@ -63,7 +64,7 @@ export function registerPage ({
console
.
log
(
`[uni-app] registerPage`
,
path
,
webview
.
id
)
}
initWebview
(
webview
,
routeOptions
)
initWebview
(
webview
,
routeOptions
,
url
)
const
route
=
path
.
slice
(
1
)
...
...
src/platforms/app-plus/service/framework/webview/index.js
浏览文件 @
4b4d5e1f
...
...
@@ -63,7 +63,7 @@ export function createWebview (path, routeOptions) {
return
webview
}
export
function
initWebview
(
webview
,
routeOptions
)
{
export
function
initWebview
(
webview
,
routeOptions
,
url
=
''
)
{
// 首页或非 nvue 页面
if
(
webview
.
id
===
'
1
'
||
!
routeOptions
.
meta
.
isNVue
)
{
const
webviewStyle
=
parseWebviewStyle
(
...
...
@@ -71,6 +71,17 @@ export function initWebview (webview, routeOptions) {
''
,
routeOptions
)
if
(
url
)
{
const
part
=
url
.
split
(
'
?
'
)
webviewStyle
.
debugRefresh
=
{
isTab
:
routeOptions
.
meta
.
isTabBar
,
arguments
:
JSON
.
stringify
({
path
:
part
[
0
].
substr
(
1
),
query
:
part
[
1
]
||
''
})
}
}
if
(
process
.
env
.
NODE_ENV
!==
'
production
'
)
{
console
.
log
(
`[uni-app] updateWebview`
,
webviewStyle
)
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录