Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_38335589
uni-app
提交
a918dcc5
U
uni-app
项目概览
weixin_38335589
/
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,发现更多精彩内容 >>
提交
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 () {
...
@@ -9451,10 +9451,12 @@ var serviceContext = (function () {
];
];
var
tempCanvas
;
var
tempCanvas
;
function
getTempCanvas
()
{
function
getTempCanvas
(
width
=
0
,
height
=
0
)
{
if
(
!
tempCanvas
)
{
if
(
!
tempCanvas
)
{
tempCanvas
=
document
.
createElement
(
'
canvas
'
);
tempCanvas
=
document
.
createElement
(
'
canvas
'
);
}
}
tempCanvas
.
width
=
width
;
tempCanvas
.
height
=
height
;
return
tempCanvas
return
tempCanvas
}
}
...
@@ -11771,7 +11773,7 @@ var serviceContext = (function () {
...
@@ -11771,7 +11773,7 @@ var serviceContext = (function () {
const
navigateType
=
routeOptions
.
meta
.
isTabBar
?
'
switchTab
'
:
'
navigateTo
'
;
const
navigateType
=
routeOptions
.
meta
.
isTabBar
?
'
switchTab
'
:
'
navigateTo
'
;
process
.
env
.
NODE_ENV
!==
'
production
'
&&
perf
(
`
${
entryPagePath
}
navigateTo`
);
process
.
env
.
NODE_ENV
!==
'
production
'
&&
perf
(
`
${
entryPagePath
}
navigateTo`
);
return
uni
[
navigateType
]({
return
uni
[
navigateType
]({
url
:
entryPagePath
,
url
:
entryPagePath
+
(
__uniConfig
.
entryPageQuery
||
''
)
,
openType
:
'
appLaunch
'
openType
:
'
appLaunch
'
})
})
}
}
...
@@ -12003,28 +12005,39 @@ var serviceContext = (function () {
...
@@ -12003,28 +12005,39 @@ var serviceContext = (function () {
});
});
}
}
function
init
HotReload
()
{
function
init
EntryPage
()
{
const
reloadUrl
=
weex
.
config
.
reloadUrl
;
const
argsJsonStr
=
plus
.
runtime
.
arguments
;
if
(
!
reloadUrl
)
{
if
(
!
argsJsonStr
)
{
return
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
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
)
{
if
(
!
routeOptions
)
{
return
return
}
}
if
(
routeOptions
.
meta
.
isNVue
)
{
// 暂不处理 nvue
return
}
if
(
!
routeOptions
.
meta
.
isTabBar
)
{
if
(
!
routeOptions
.
meta
.
isTabBar
)
{
__uniConfig
.
realEntryPagePath
=
__uniConfig
.
realEntryPagePath
||
__uniConfig
.
entryPagePath
;
__uniConfig
.
realEntryPagePath
=
__uniConfig
.
realEntryPagePath
||
__uniConfig
.
entryPagePath
;
}
}
__uniConfig
.
entryPagePath
=
reloadUrl
;
__uniConfig
.
entryPagePath
=
entryPagePath
;
__uniConfig
.
entryPageQuery
=
entryPageQuery
;
if
(
process
.
env
.
NODE_ENV
!==
'
production
'
)
{
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 () {
...
@@ -12046,7 +12059,7 @@ var serviceContext = (function () {
getCurrentPages
:
getCurrentPages$1
getCurrentPages
:
getCurrentPages$1
});
});
init
HotReload
();
init
EntryPage
();
initTabBar
();
initTabBar
();
...
...
packages/webpack-uni-pages-loader/lib/platforms/app-plus/index.v3.js
浏览文件 @
a918dcc5
...
@@ -33,8 +33,10 @@ function parseEntryPagePath (appJson, manifestJson) {
...
@@ -33,8 +33,10 @@ function parseEntryPagePath (appJson, manifestJson) {
try
{
try
{
const
args
=
JSON
.
parse
(
argsJsonStr
)
const
args
=
JSON
.
parse
(
argsJsonStr
)
const
pathName
=
args
.
path
||
args
.
pathName
const
pathName
=
args
.
path
||
args
.
pathName
const
entryPageQuery
=
(
args
.
query
?
(
'
?
'
+
args
.
query
)
:
''
)
if
(
pathName
&&
appJson
.
pages
[
0
]
!==
pathName
)
{
if
(
pathName
&&
appJson
.
pages
[
0
]
!==
pathName
)
{
appJson
.
entryPagePath
=
pathName
appJson
.
entryPagePath
=
pathName
appJson
.
entryPageQuery
=
entryPageQuery
if
(
!
isTabBarPage
(
pathName
,
getTabBarPages
(
appJson
)))
{
if
(
!
isTabBarPage
(
pathName
,
getTabBarPages
(
appJson
)))
{
appJson
.
realEntryPagePath
=
appJson
.
pages
[
0
]
appJson
.
realEntryPagePath
=
appJson
.
pages
[
0
]
}
}
...
@@ -83,7 +85,7 @@ module.exports = function (appJson, manifestJson, {
...
@@ -83,7 +85,7 @@ module.exports = function (appJson, manifestJson, {
if
(
appJson
.
page
[
appJson
.
entryPagePath
].
nvue
)
{
// 首页是 nvue
if
(
appJson
.
page
[
appJson
.
entryPagePath
].
nvue
)
{
// 首页是 nvue
manifestJson
.
launch_path
=
''
// 首页地址为空
manifestJson
.
launch_path
=
''
// 首页地址为空
manifestJson
.
plus
.
launchwebview
.
uniNView
=
{
manifestJson
.
plus
.
launchwebview
.
uniNView
=
{
path
:
appJson
.
entryPagePath
path
:
appJson
.
entryPagePath
+
'
.js
'
+
(
appJson
.
entryPageQuery
||
''
)
}
}
if
(
manifestJson
.
plus
.
tabBar
)
{
if
(
manifestJson
.
plus
.
tabBar
)
{
manifestJson
.
plus
.
tabBar
.
child
=
[
'
lauchwebview
'
]
manifestJson
.
plus
.
tabBar
.
child
=
[
'
lauchwebview
'
]
...
...
src/platforms/app-plus/service/framework/app.js
浏览文件 @
a918dcc5
...
@@ -140,28 +140,39 @@ function initTabBar () {
...
@@ -140,28 +140,39 @@ function initTabBar () {
})
})
}
}
function
init
HotReload
()
{
function
init
EntryPage
()
{
const
reloadUrl
=
weex
.
config
.
reloadUrl
const
argsJsonStr
=
plus
.
runtime
.
arguments
if
(
!
reloadUrl
)
{
if
(
!
argsJsonStr
)
{
return
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
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
)
{
if
(
!
routeOptions
)
{
return
return
}
}
if
(
routeOptions
.
meta
.
isNVue
)
{
// 暂不处理 nvue
return
}
if
(
!
routeOptions
.
meta
.
isTabBar
)
{
if
(
!
routeOptions
.
meta
.
isTabBar
)
{
__uniConfig
.
realEntryPagePath
=
__uniConfig
.
realEntryPagePath
||
__uniConfig
.
entryPagePath
__uniConfig
.
realEntryPagePath
=
__uniConfig
.
realEntryPagePath
||
__uniConfig
.
entryPagePath
}
}
__uniConfig
.
entryPagePath
=
reloadUrl
__uniConfig
.
entryPagePath
=
entryPagePath
__uniConfig
.
entryPageQuery
=
entryPageQuery
if
(
process
.
env
.
NODE_ENV
!==
'
production
'
)
{
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) {
...
@@ -183,7 +194,7 @@ export function registerApp (appVm) {
getCurrentPages
getCurrentPages
})
})
init
HotReload
()
init
EntryPage
()
initTabBar
()
initTabBar
()
...
...
src/platforms/app-plus/service/framework/subscribe-handlers/on-webview-ready.js
浏览文件 @
a918dcc5
...
@@ -38,7 +38,7 @@ export default function onWebviewReady (data, pageId) {
...
@@ -38,7 +38,7 @@ export default function onWebviewReady (data, pageId) {
const
navigateType
=
routeOptions
.
meta
.
isTabBar
?
'
switchTab
'
:
'
navigateTo
'
const
navigateType
=
routeOptions
.
meta
.
isTabBar
?
'
switchTab
'
:
'
navigateTo
'
process
.
env
.
NODE_ENV
!==
'
production
'
&&
perf
(
`
${
entryPagePath
}
navigateTo`
)
process
.
env
.
NODE_ENV
!==
'
production
'
&&
perf
(
`
${
entryPagePath
}
navigateTo`
)
return
uni
[
navigateType
]({
return
uni
[
navigateType
]({
url
:
entryPagePath
,
url
:
entryPagePath
+
(
__uniConfig
.
entryPageQuery
||
''
)
,
openType
:
'
appLaunch
'
openType
:
'
appLaunch
'
})
})
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录