Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
uni-app
提交
64ea76e3
U
uni-app
项目概览
DCloud
/
uni-app
通知
702
Star
38703
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,发现更多精彩内容 >>
提交
64ea76e3
编写于
12月 31, 2019
作者:
fxy060608
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'dev' of
https://github.com/dcloudio/uni-app
into alpha
上级
26f19766
12978acd
变更
16
隐藏空白更改
内联
并排
Showing
16 changed file
with
161 addition
and
80 deletion
+161
-80
packages/uni-app-plus/dist/index.v3.js
packages/uni-app-plus/dist/index.v3.js
+62
-25
packages/uni-migration/lib/index.js
packages/uni-migration/lib/index.js
+1
-1
packages/vue-cli-plugin-uni/lib/app-plus/index.js
packages/vue-cli-plugin-uni/lib/app-plus/index.js
+0
-7
packages/vue-cli-plugin-uni/lib/vue-loader.js
packages/vue-cli-plugin-uni/lib/vue-loader.js
+6
-5
packages/vue-cli-plugin-uni/packages/@vue/component-compiler-utils/dist/parseCustomBlocks.js
...s/@vue/component-compiler-utils/dist/parseCustomBlocks.js
+15
-3
packages/vue-cli-plugin-uni/packages/vue-loader/lib/index.js
packages/vue-cli-plugin-uni/packages/vue-loader/lib/index.js
+1
-1
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/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/app.js
src/platforms/app-plus/service/framework/app.js
+23
-12
src/platforms/app-plus/service/framework/page.js
src/platforms/app-plus/service/framework/page.js
+3
-2
src/platforms/app-plus/service/framework/subscribe-handlers/on-webview-ready.js
.../service/framework/subscribe-handlers/on-webview-ready.js
+1
-1
src/platforms/app-plus/service/framework/webview/index.js
src/platforms/app-plus/service/framework/webview/index.js
+12
-1
src/platforms/h5/view/components/video/index.vue
src/platforms/h5/view/components/video/index.vue
+9
-8
未找到文件。
packages/uni-app-plus/dist/index.v3.js
浏览文件 @
64ea76e3
...
...
@@ -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
);
...
...
@@ -9451,10 +9475,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 +11797,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 +12029,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 +12083,7 @@ var serviceContext = (function () {
getCurrentPages
:
getCurrentPages$1
});
init
HotReload
();
init
EntryPage
();
initTabBar
();
...
...
packages/uni-migration/lib/index.js
浏览文件 @
64ea76e3
...
...
@@ -39,7 +39,7 @@ module.exports = function migrate(input, out, options = {}) {
)
)
{
options
.
silent
!==
true
&&
console
.
log
(
`copy:
${
dest
}
`
)
fs
.
copySync
(
src
,
dest
)
src
!==
dest
&&
fs
.
copySync
(
src
,
dest
)
}
}
else
{
options
.
silent
!==
true
&&
console
.
log
(
`write:
${
path
.
resolve
(
out
,
asset
.
path
)}
`
)
...
...
packages/vue-cli-plugin-uni/lib/app-plus/index.js
浏览文件 @
64ea76e3
...
...
@@ -89,13 +89,6 @@ const v3 = {
loader
:
path
.
resolve
(
__dirname
,
'
../../packages/webpack-uni-app-loader/view/script
'
)
})
// view 层 renderjs
// rules.push({
// resourceQuery: [/lang=renderjs/, /blockType=renderjs/],
// use: [{
// loader: path.resolve(__dirname, '../../packages/webpack-uni-app-loader/view/renderjs')
// }]
// })
}
scriptLoaders
.
push
({
loader
:
path
.
resolve
(
__dirname
,
...
...
packages/vue-cli-plugin-uni/lib/vue-loader.js
浏览文件 @
64ea76e3
...
...
@@ -28,6 +28,7 @@ module.exports = function modifyVueLoader (webpackConfig, compilerOptions, api)
.
use
(
'
vue-loader
'
)
.
loader
(
require
.
resolve
(
'
@dcloudio/vue-cli-plugin-uni/packages/vue-loader
'
))
.
tap
(
options
=>
Object
.
assign
(
options
,
{
isH5
:
process
.
env
.
UNI_PLATFORM
===
'
h5
'
,
compiler
:
getPlatformCompiler
(),
compilerOptions
:
Object
.
assign
({
isUnaryTag
,
...
...
@@ -35,11 +36,11 @@ module.exports = function modifyVueLoader (webpackConfig, compilerOptions, api)
},
compilerOptions
)
},
cacheConfig
))
.
end
()
// .use('uniapp-custom-block-loader')
// .loader(require.resolve('@dcloudio/vue-cli-plugin-uni/packages/webpack-custom-block-loader'))
// .options({
// compiler: getPlatformCompiler()
// })
// .use('uniapp-custom-block-loader')
// .loader(require.resolve('@dcloudio/vue-cli-plugin-uni/packages/webpack-custom-block-loader'))
// .options({
// compiler: getPlatformCompiler()
// })
// h5 框架需要使用 scoped 样式,其他平台编译时识别是否 nvue 文件且注入 flex 相关样式
if
(
process
.
env
.
UNI_PLATFORM
===
'
h5
'
)
{
...
...
packages/vue-cli-plugin-uni/packages/@vue/component-compiler-utils/dist/parseCustomBlocks.js
浏览文件 @
64ea76e3
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
:
''
})
...
...
packages/vue-cli-plugin-uni/packages/vue-loader/lib/index.js
浏览文件 @
64ea76e3
...
...
@@ -142,7 +142,7 @@ module.exports = function (source) {
}
let
renderjsImport
=
`var renderjs`
if
(
options
.
isAppView
&&
descriptor
.
renderjs
){
if
(
(
options
.
isAppView
||
options
.
isH5
)
&&
descriptor
.
renderjs
){
const
src
=
descriptor
.
renderjs
.
src
||
resourcePath
const
attrsQuery
=
attrsToQuery
(
descriptor
.
renderjs
.
attrs
,
'
js
'
)
const
query
=
`?vue&type=renderjs
${
attrsQuery
}${
inheritQuery
}
`
...
...
packages/webpack-uni-pages-loader/lib/platforms/app-plus/index.v3.js
浏览文件 @
64ea76e3
...
...
@@ -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/api/route/navigate-to.js
浏览文件 @
64ea76e3
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
浏览文件 @
64ea76e3
...
...
@@ -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
浏览文件 @
64ea76e3
...
...
@@ -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
浏览文件 @
64ea76e3
...
...
@@ -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/app.js
浏览文件 @
64ea76e3
...
...
@@ -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/page.js
浏览文件 @
64ea76e3
...
...
@@ -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/subscribe-handlers/on-webview-ready.js
浏览文件 @
64ea76e3
...
...
@@ -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
'
})
}
...
...
src/platforms/app-plus/service/framework/webview/index.js
浏览文件 @
64ea76e3
...
...
@@ -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
)
}
...
...
src/platforms/h5/view/components/video/index.vue
浏览文件 @
64ea76e3
...
...
@@ -49,7 +49,7 @@
class="uni-video-control-button"
@click.stop="trigger"
/>
<div
class=
"uni-video-current-time"
>
{{
currentTime
|
getT
ime
}}
</div>
<div
class=
"uni-video-current-time"
>
{{
currentTime
|
t
ime
}}
</div>
<div
ref=
"progress"
class=
"uni-video-progress-container"
...
...
@@ -67,7 +67,7 @@
</div>
</div>
</div>
<div
class=
"uni-video-duration"
>
{{
(
duration
||
durationTime
)
|
getT
ime
}}
</div>
<div
class=
"uni-video-duration"
>
{{
(
duration
||
durationTime
)
|
t
ime
}}
</div>
</div>
<div
v-if=
"danmuBtn"
...
...
@@ -94,7 +94,7 @@
<div
class=
"uni-video-cover-play-button"
@
click.stop=
"play"
/>
<p
class=
"uni-video-cover-duration"
>
{{
(
duration
||
durationTime
)
|
getT
ime
}}
</p>
<p
class=
"uni-video-cover-duration"
>
{{
(
duration
||
durationTime
)
|
t
ime
}}
</p>
</div>
<div
:class=
"
{'uni-video-toast-volume':gestureType==='volume'}"
...
...
@@ -129,7 +129,7 @@
<div
:class=
"
{'uni-video-toast-progress':gestureType=='progress'}"
class="uni-video-toast">
<div
class=
"uni-video-toast-title"
>
{{
currentTimeNew
|
getTime
}}
/
{{
durationTime
|
getT
ime
}}
</div>
<div
class=
"uni-video-toast-title"
>
{{
currentTimeNew
|
time
}}
/
{{
durationTime
|
t
ime
}}
</div>
</div>
</div>
<div
...
...
@@ -162,10 +162,11 @@ const GestureType = {
export
default
{
name
:
'
Video
'
,
filters
:
{
getTime
(
time
)
{
let
h
=
Math
.
floor
(
time
/
3600
)
let
m
=
Math
.
floor
(
time
%
3600
/
60
)
let
s
=
Math
.
floor
(
time
%
3600
%
60
)
time
(
val
)
{
val
=
val
>
0
&&
val
<
Infinity
?
val
:
0
let
h
=
Math
.
floor
(
val
/
3600
)
let
m
=
Math
.
floor
(
val
%
3600
/
60
)
let
s
=
Math
.
floor
(
val
%
3600
%
60
)
h
=
(
h
<
10
?
'
0
'
:
''
)
+
h
m
=
(
m
<
10
?
'
0
'
:
''
)
+
m
s
=
(
s
<
10
?
'
0
'
:
''
)
+
s
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录