Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
uni-app
提交
a918dcc5
U
uni-app
项目概览
DCloud
/
uni-app
29 天 前同步成功
通知
702
Star
38704
Fork
3642
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
7
列表
看板
标记
里程碑
合并请求
1
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
7
Issue
7
列表
看板
标记
里程碑
合并请求
1
合并请求
1
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a918dcc5
编写于
12月 31, 2019
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(v3): plus.runtime.arguments => entryPagePath
上级
152a6858
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
55 addition
and
29 deletion
+55
-29
packages/uni-app-plus/dist/index.v3.js
packages/uni-app-plus/dist/index.v3.js
+27
-14
packages/webpack-uni-pages-loader/lib/platforms/app-plus/index.v3.js
...bpack-uni-pages-loader/lib/platforms/app-plus/index.v3.js
+4
-2
src/platforms/app-plus/service/framework/app.js
src/platforms/app-plus/service/framework/app.js
+23
-12
src/platforms/app-plus/service/framework/subscribe-handlers/on-webview-ready.js
.../service/framework/subscribe-handlers/on-webview-ready.js
+1
-1
未找到文件。
packages/uni-app-plus/dist/index.v3.js
浏览文件 @
a918dcc5
...
...
@@ -9451,10 +9451,12 @@ var serviceContext = (function () {
];
var
tempCanvas
;
function
getTempCanvas
()
{
function
getTempCanvas
(
width
=
0
,
height
=
0
)
{
if
(
!
tempCanvas
)
{
tempCanvas
=
document
.
createElement
(
'
canvas
'
);
}
tempCanvas
.
width
=
width
;
tempCanvas
.
height
=
height
;
return
tempCanvas
}
...
...
@@ -11771,7 +11773,7 @@ var serviceContext = (function () {
const
navigateType
=
routeOptions
.
meta
.
isTabBar
?
'
switchTab
'
:
'
navigateTo
'
;
process
.
env
.
NODE_ENV
!==
'
production
'
&&
perf
(
`
${
entryPagePath
}
navigateTo`
);
return
uni
[
navigateType
]({
url
:
entryPagePath
,
url
:
entryPagePath
+
(
__uniConfig
.
entryPageQuery
||
''
)
,
openType
:
'
appLaunch
'
})
}
...
...
@@ -12003,28 +12005,39 @@ var serviceContext = (function () {
});
}
function
init
HotReload
()
{
const
reloadUrl
=
weex
.
config
.
reloadUrl
;
if
(
!
reloadUrl
)
{
function
init
EntryPage
()
{
const
argsJsonStr
=
plus
.
runtime
.
arguments
;
if
(
!
argsJsonStr
)
{
return
}
if
(
reloadUrl
===
__uniConfig
.
entryPagePath
)
{
let
entryPagePath
;
let
entryPageQuery
;
try
{
const
args
=
JSON
.
parse
(
argsJsonStr
);
entryPagePath
=
args
.
path
||
args
.
pathName
;
entryPageQuery
=
(
args
.
query
?
(
'
?
'
+
args
.
query
)
:
''
);
}
catch
(
e
)
{}
if
(
!
entryPagePath
||
entryPagePath
===
__uniConfig
.
entryPagePath
)
{
return
}
const
reloadPath
=
'
/
'
+
reloadUrl
;
const
routeOptions
=
__uniRoutes
.
find
(
route
=>
route
.
path
===
reloadPath
);
const
entryRoute
=
'
/
'
+
entryPagePath
;
const
routeOptions
=
__uniRoutes
.
find
(
route
=>
route
.
path
===
entryRoute
);
if
(
!
routeOptions
)
{
return
}
if
(
routeOptions
.
meta
.
isNVue
)
{
// 暂不处理 nvue
return
}
if
(
!
routeOptions
.
meta
.
isTabBar
)
{
__uniConfig
.
realEntryPagePath
=
__uniConfig
.
realEntryPagePath
||
__uniConfig
.
entryPagePath
;
}
__uniConfig
.
entryPagePath
=
reloadUrl
;
__uniConfig
.
entryPagePath
=
entryPagePath
;
__uniConfig
.
entryPageQuery
=
entryPageQuery
;
if
(
process
.
env
.
NODE_ENV
!==
'
production
'
)
{
console
.
log
(
`[uni-app]
reloadUrl(
${
reloadUrl
}
)`
);
console
.
log
(
`[uni-app]
entryPagePath(
${
entryPagePath
+
entryPageQuery
}
)`
);
}
}
...
...
@@ -12046,7 +12059,7 @@ var serviceContext = (function () {
getCurrentPages
:
getCurrentPages$1
});
init
HotReload
();
init
EntryPage
();
initTabBar
();
...
...
packages/webpack-uni-pages-loader/lib/platforms/app-plus/index.v3.js
浏览文件 @
a918dcc5
...
...
@@ -33,8 +33,10 @@ function parseEntryPagePath (appJson, manifestJson) {
try
{
const
args
=
JSON
.
parse
(
argsJsonStr
)
const
pathName
=
args
.
path
||
args
.
pathName
const
entryPageQuery
=
(
args
.
query
?
(
'
?
'
+
args
.
query
)
:
''
)
if
(
pathName
&&
appJson
.
pages
[
0
]
!==
pathName
)
{
appJson
.
entryPagePath
=
pathName
appJson
.
entryPageQuery
=
entryPageQuery
if
(
!
isTabBarPage
(
pathName
,
getTabBarPages
(
appJson
)))
{
appJson
.
realEntryPagePath
=
appJson
.
pages
[
0
]
}
...
...
@@ -83,7 +85,7 @@ module.exports = function (appJson, manifestJson, {
if
(
appJson
.
page
[
appJson
.
entryPagePath
].
nvue
)
{
// 首页是 nvue
manifestJson
.
launch_path
=
''
// 首页地址为空
manifestJson
.
plus
.
launchwebview
.
uniNView
=
{
path
:
appJson
.
entryPagePath
path
:
appJson
.
entryPagePath
+
'
.js
'
+
(
appJson
.
entryPageQuery
||
''
)
}
if
(
manifestJson
.
plus
.
tabBar
)
{
manifestJson
.
plus
.
tabBar
.
child
=
[
'
lauchwebview
'
]
...
...
@@ -100,4 +102,4 @@ module.exports = function (appJson, manifestJson, {
manifest
.
content
=
JSON
.
stringify
(
manifest
.
content
)
delete
appJson
.
nvue
return
[
manifest
,
definePages
(
appJson
),
appConfigService
(
appJson
)]
}
}
src/platforms/app-plus/service/framework/app.js
浏览文件 @
a918dcc5
...
...
@@ -140,28 +140,39 @@ function initTabBar () {
})
}
function
init
HotReload
()
{
const
reloadUrl
=
weex
.
config
.
reloadUrl
if
(
!
reloadUrl
)
{
function
init
EntryPage
()
{
const
argsJsonStr
=
plus
.
runtime
.
arguments
if
(
!
argsJsonStr
)
{
return
}
if
(
reloadUrl
===
__uniConfig
.
entryPagePath
)
{
let
entryPagePath
let
entryPageQuery
try
{
const
args
=
JSON
.
parse
(
argsJsonStr
)
entryPagePath
=
args
.
path
||
args
.
pathName
entryPageQuery
=
(
args
.
query
?
(
'
?
'
+
args
.
query
)
:
''
)
}
catch
(
e
)
{}
if
(
!
entryPagePath
||
entryPagePath
===
__uniConfig
.
entryPagePath
)
{
return
}
const
reloadPath
=
'
/
'
+
reloadUrl
const
routeOptions
=
__uniRoutes
.
find
(
route
=>
route
.
path
===
reloadPath
)
const
entryRoute
=
'
/
'
+
entryPagePath
const
routeOptions
=
__uniRoutes
.
find
(
route
=>
route
.
path
===
entryRoute
)
if
(
!
routeOptions
)
{
return
}
if
(
routeOptions
.
meta
.
isNVue
)
{
// 暂不处理 nvue
return
}
if
(
!
routeOptions
.
meta
.
isTabBar
)
{
__uniConfig
.
realEntryPagePath
=
__uniConfig
.
realEntryPagePath
||
__uniConfig
.
entryPagePath
}
__uniConfig
.
entryPagePath
=
reloadUrl
__uniConfig
.
entryPagePath
=
entryPagePath
__uniConfig
.
entryPageQuery
=
entryPageQuery
if
(
process
.
env
.
NODE_ENV
!==
'
production
'
)
{
console
.
log
(
`[uni-app]
reloadUrl(
${
reloadUrl
}
)`
)
console
.
log
(
`[uni-app]
entryPagePath(
${
entryPagePath
+
entryPageQuery
}
)`
)
}
}
...
...
@@ -183,7 +194,7 @@ export function registerApp (appVm) {
getCurrentPages
})
init
HotReload
()
init
EntryPage
()
initTabBar
()
...
...
src/platforms/app-plus/service/framework/subscribe-handlers/on-webview-ready.js
浏览文件 @
a918dcc5
...
...
@@ -38,7 +38,7 @@ export default function onWebviewReady (data, pageId) {
const
navigateType
=
routeOptions
.
meta
.
isTabBar
?
'
switchTab
'
:
'
navigateTo
'
process
.
env
.
NODE_ENV
!==
'
production
'
&&
perf
(
`
${
entryPagePath
}
navigateTo`
)
return
uni
[
navigateType
]({
url
:
entryPagePath
,
url
:
entryPagePath
+
(
__uniConfig
.
entryPageQuery
||
''
)
,
openType
:
'
appLaunch
'
})
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录