Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Velpro187
uni-app
提交
79c041f3
U
uni-app
项目概览
Velpro187
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
79c041f3
编写于
9月 11, 2020
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(h5): topWindow
上级
71d831c3
变更
10
展开全部
隐藏空白更改
内联
并排
Showing
10 changed file
with
338 addition
and
128 deletion
+338
-128
packages/uni-app-plus/dist/index.v3.js
packages/uni-app-plus/dist/index.v3.js
+200
-104
packages/uni-cli-shared/lib/tags.js
packages/uni-cli-shared/lib/tags.js
+1
-1
packages/uni-h5/dist/index.css
packages/uni-h5/dist/index.css
+1
-1
packages/uni-h5/dist/index.umd.min.js
packages/uni-h5/dist/index.umd.min.js
+1
-1
packages/uni-h5/manifest.json
packages/uni-h5/manifest.json
+18
-2
packages/webpack-uni-pages-loader/lib/platforms/h5.js
packages/webpack-uni-pages-loader/lib/platforms/h5.js
+21
-8
src/core/helpers/tags.js
src/core/helpers/tags.js
+2
-1
src/platforms/h5/components/app/layout.vue
src/platforms/h5/components/app/layout.vue
+72
-4
src/platforms/h5/components/page/index.vue
src/platforms/h5/components/page/index.vue
+12
-2
src/platforms/h5/view/bridge/subscribe/index.js
src/platforms/h5/view/bridge/subscribe/index.js
+10
-4
未找到文件。
packages/uni-app-plus/dist/index.v3.js
浏览文件 @
79c041f3
...
@@ -120,8 +120,8 @@ var serviceContext = (function () {
...
@@ -120,8 +120,8 @@ var serviceContext = (function () {
'
getBLEDeviceServices
'
,
'
getBLEDeviceServices
'
,
'
getBLEDeviceCharacteristics
'
,
'
getBLEDeviceCharacteristics
'
,
'
createBLEConnection
'
,
'
createBLEConnection
'
,
'
closeBLEConnection
'
,
'
closeBLEConnection
'
,
'
setBLEMTU
'
,
'
setBLEMTU
'
,
'
getBLEDeviceRSSI
'
,
'
getBLEDeviceRSSI
'
,
'
onBeaconServiceChange
'
,
'
onBeaconServiceChange
'
,
'
onBeaconUpdate
'
,
'
onBeaconUpdate
'
,
...
@@ -130,14 +130,15 @@ var serviceContext = (function () {
...
@@ -130,14 +130,15 @@ var serviceContext = (function () {
'
stopBeaconDiscovery
'
,
'
stopBeaconDiscovery
'
,
'
checkIsSupportSoterAuthentication
'
,
'
checkIsSupportSoterAuthentication
'
,
'
checkIsSoterEnrolledInDevice
'
,
'
checkIsSoterEnrolledInDevice
'
,
'
startSoterAuthentication
'
,
'
startSoterAuthentication
'
,
'
onThemeChange
'
,
'
onThemeChange
'
,
'
onUIStyleChange
'
'
onUIStyleChange
'
];
];
const
keyboard
=
[
const
keyboard
=
[
'
hideKeyboard
'
,
'
hideKeyboard
'
,
'
onKeyboardHeightChange
'
'
onKeyboardHeightChange
'
,
'
getSelectedTextRange
'
];
];
const
ui
=
[
const
ui
=
[
...
@@ -171,6 +172,7 @@ var serviceContext = (function () {
...
@@ -171,6 +172,7 @@ var serviceContext = (function () {
'
stopPullDownRefresh
'
,
'
stopPullDownRefresh
'
,
'
createSelectorQuery
'
,
'
createSelectorQuery
'
,
'
createIntersectionObserver
'
,
'
createIntersectionObserver
'
,
'
createMediaQueryObserver
'
,
'
getMenuButtonBoundingClientRect
'
'
getMenuButtonBoundingClientRect
'
];
];
...
@@ -969,7 +971,7 @@ var serviceContext = (function () {
...
@@ -969,7 +971,7 @@ var serviceContext = (function () {
},
},
canvasId
:
{
canvasId
:
{
type
:
String
,
type
:
String
,
require
:
true
require
d
:
true
},
},
fileType
:
{
fileType
:
{
type
:
String
,
type
:
String
,
...
@@ -990,11 +992,11 @@ var serviceContext = (function () {
...
@@ -990,11 +992,11 @@ var serviceContext = (function () {
const
drawCanvas
=
{
const
drawCanvas
=
{
canvasId
:
{
canvasId
:
{
type
:
String
,
type
:
String
,
require
:
true
require
d
:
true
},
},
actions
:
{
actions
:
{
type
:
Array
,
type
:
Array
,
require
:
true
require
d
:
true
},
},
reserve
:
{
reserve
:
{
type
:
Boolean
,
type
:
Boolean
,
...
@@ -1108,7 +1110,7 @@ var serviceContext = (function () {
...
@@ -1108,7 +1110,7 @@ var serviceContext = (function () {
default
:
type
.
WGS84
default
:
type
.
WGS84
},
},
altitude
:
{
altitude
:
{
altitud
e
:
Boolean
,
typ
e
:
Boolean
,
default
:
false
default
:
false
}
}
};
};
...
@@ -8826,7 +8828,7 @@ var serviceContext = (function () {
...
@@ -8826,7 +8828,7 @@ var serviceContext = (function () {
return
webview
return
webview
}
}
function
_navigateTo
({
function
_navigateTo
({
url
,
url
,
path
,
path
,
query
,
query
,
...
@@ -8860,7 +8862,7 @@ var serviceContext = (function () {
...
@@ -8860,7 +8862,7 @@ var serviceContext = (function () {
setStatusBarStyle
();
setStatusBarStyle
();
}
}
function
navigateTo$1
({
function
navigateTo$1
({
url
,
url
,
events
,
events
,
openType
,
openType
,
...
@@ -8878,7 +8880,7 @@ var serviceContext = (function () {
...
@@ -8878,7 +8880,7 @@ var serviceContext = (function () {
animationDuration
=
routeStyles
.
animationDuration
||
globalStyle
.
animationDuration
||
ANI_DURATION
;
animationDuration
=
routeStyles
.
animationDuration
||
globalStyle
.
animationDuration
||
ANI_DURATION
;
}
}
const
query
=
parseQuery
(
urls
[
1
]
||
''
);
const
query
=
parseQuery
(
urls
[
1
]
||
''
);
navigate
(
path
,
function
()
{
navigate
(
path
,
function
()
{
_navigateTo
({
_navigateTo
({
url
,
url
,
path
,
path
,
...
@@ -10339,16 +10341,6 @@ var serviceContext = (function () {
...
@@ -10339,16 +10341,6 @@ var serviceContext = (function () {
const
canvasEventCallbacks
=
createCallbacks
(
'
canvasEvent
'
);
const
canvasEventCallbacks
=
createCallbacks
(
'
canvasEvent
'
);
UniServiceJSBridge
.
subscribe
(
'
onDrawCanvas
'
,
({
callbackId
,
data
})
=>
{
const
callback
=
canvasEventCallbacks
.
pop
(
callbackId
);
if
(
callback
)
{
callback
(
data
);
}
});
UniServiceJSBridge
.
subscribe
(
'
onCanvasMethodCallback
'
,
({
UniServiceJSBridge
.
subscribe
(
'
onCanvasMethodCallback
'
,
({
callbackId
,
callbackId
,
data
data
...
@@ -10589,17 +10581,6 @@ var serviceContext = (function () {
...
@@ -10589,17 +10581,6 @@ var serviceContext = (function () {
'
setTextBaseline
'
,
'
setLineDash
'
'
setTextBaseline
'
,
'
setLineDash
'
];
];
var
tempCanvas
;
function
getTempCanvas
(
width
=
0
,
height
=
0
)
{
if
(
!
tempCanvas
)
{
tempCanvas
=
document
.
createElement
(
'
canvas
'
);
}
tempCanvas
.
width
=
width
;
tempCanvas
.
height
=
height
;
return
tempCanvas
}
function
TextMetrics
(
width
)
{
function
TextMetrics
(
width
)
{
this
.
width
=
width
;
this
.
width
=
width
;
}
}
...
@@ -10664,14 +10645,23 @@ var serviceContext = (function () {
...
@@ -10664,14 +10645,23 @@ var serviceContext = (function () {
}
}
}
}
// TODO
measureText
(
text
,
callback
)
{
measureText
(
text
)
{
const
font
=
this
.
state
.
font
;
if
(
typeof
document
===
'
object
'
)
{
{
var
c2d
=
getTempCanvas
().
getContext
(
'
2d
'
);
const
textMetrics
=
new
TextMetrics
(
0
);
c2d
.
font
=
this
.
state
.
font
;
if
(
typeof
callback
===
'
function
'
)
{
return
new
TextMetrics
(
c2d
.
measureText
(
text
).
width
||
0
)
const
callbackId
=
canvasEventCallbacks
.
push
(
function
({
width
})
{
}
else
{
callback
(
new
TextMetrics
(
width
));
return
new
TextMetrics
(
0
)
});
operateCanvas
(
this
.
id
,
this
.
pageId
,
'
measureText
'
,
{
text
,
font
,
callbackId
});
}
else
{
console
.
error
(
'
warning: measureText missing required arguments: callback
'
);
}
return
textMetrics
}
}
}
}
...
@@ -11753,6 +11743,51 @@ var serviceContext = (function () {
...
@@ -11753,6 +11743,51 @@ var serviceContext = (function () {
onUIStyleChange
:
onUIStyleChange
onUIStyleChange
:
onUIStyleChange
});
});
const
getSelectedTextRangeEventCallbacks
=
createCallbacks
(
'
getSelectedTextRangeEvent
'
);
UniServiceJSBridge
.
subscribe
(
'
onGetSelectedTextRange
'
,
({
callbackId
,
data
})
=>
{
console
.
log
(
'
onGetSelectedTextRange
'
);
const
callback
=
getSelectedTextRangeEventCallbacks
.
pop
(
callbackId
);
if
(
callback
)
{
callback
(
data
);
}
});
function
getSelectedTextRange
(
_
,
callbackId
)
{
const
pageId
=
getCurrentPageId
();
UniServiceJSBridge
.
publishHandler
(
'
getSelectedTextRange
'
,
{
pageId
,
callbackId
:
getSelectedTextRangeEventCallbacks
.
push
(
function
(
res
)
{
invoke$1
(
callbackId
,
res
);
})
},
pageId
);
}
var
require_context_module_1_16
=
/*#__PURE__*/
Object
.
freeze
({
__proto__
:
null
,
getSelectedTextRange
:
getSelectedTextRange
});
let
callback$1
;
onMethod
(
'
onKeyboardHeightChange
'
,
res
=>
{
if
(
callback$1
)
{
invoke$1
(
callback$1
,
res
);
}
});
function
onKeyboardHeightChange
(
callbackId
)
{
callback$1
=
callbackId
;
}
var
require_context_module_1_17
=
/*#__PURE__*/
Object
.
freeze
({
__proto__
:
null
,
onKeyboardHeightChange
:
onKeyboardHeightChange
});
const
longPressActionsCallbackId
=
'
longPressActionsCallback
'
;
const
longPressActionsCallbackId
=
'
longPressActionsCallback
'
;
let
longPressActions
=
{};
let
longPressActions
=
{};
...
@@ -11776,7 +11811,7 @@ var serviceContext = (function () {
...
@@ -11776,7 +11811,7 @@ var serviceContext = (function () {
return
invokeMethod
(
'
previewImagePlus
'
,
args
)
return
invokeMethod
(
'
previewImagePlus
'
,
args
)
}
}
var
require_context_module_1_1
6
=
/*#__PURE__*/
Object
.
freeze
({
var
require_context_module_1_1
8
=
/*#__PURE__*/
Object
.
freeze
({
__proto__
:
null
,
__proto__
:
null
,
previewImage
:
previewImage$1
previewImage
:
previewImage$1
});
});
...
@@ -11864,7 +11899,7 @@ var serviceContext = (function () {
...
@@ -11864,7 +11899,7 @@ var serviceContext = (function () {
return
recorderManager
||
(
recorderManager
=
new
RecorderManager
())
return
recorderManager
||
(
recorderManager
=
new
RecorderManager
())
}
}
var
require_context_module_1_1
7
=
/*#__PURE__*/
Object
.
freeze
({
var
require_context_module_1_1
9
=
/*#__PURE__*/
Object
.
freeze
({
__proto__
:
null
,
__proto__
:
null
,
getRecorderManager
:
getRecorderManager
getRecorderManager
:
getRecorderManager
});
});
...
@@ -11958,7 +11993,7 @@ var serviceContext = (function () {
...
@@ -11958,7 +11993,7 @@ var serviceContext = (function () {
return
task
return
task
}
}
var
require_context_module_1_
18
=
/*#__PURE__*/
Object
.
freeze
({
var
require_context_module_1_
20
=
/*#__PURE__*/
Object
.
freeze
({
__proto__
:
null
,
__proto__
:
null
,
downloadFile
:
downloadFile$1
downloadFile
:
downloadFile$1
});
});
...
@@ -12076,7 +12111,7 @@ var serviceContext = (function () {
...
@@ -12076,7 +12111,7 @@ var serviceContext = (function () {
return
new
RequestTask
(
requestTaskId
)
return
new
RequestTask
(
requestTaskId
)
}
}
var
require_context_module_1_
19
=
/*#__PURE__*/
Object
.
freeze
({
var
require_context_module_1_
21
=
/*#__PURE__*/
Object
.
freeze
({
__proto__
:
null
,
__proto__
:
null
,
request
:
request$1
request
:
request$1
});
});
...
@@ -12258,7 +12293,7 @@ var serviceContext = (function () {
...
@@ -12258,7 +12293,7 @@ var serviceContext = (function () {
callbacks$b
.
close
=
callbackId
;
callbacks$b
.
close
=
callbackId
;
}
}
var
require_context_module_1_2
0
=
/*#__PURE__*/
Object
.
freeze
({
var
require_context_module_1_2
2
=
/*#__PURE__*/
Object
.
freeze
({
__proto__
:
null
,
__proto__
:
null
,
connectSocket
:
connectSocket$1
,
connectSocket
:
connectSocket$1
,
sendSocketMessage
:
sendSocketMessage$1
,
sendSocketMessage
:
sendSocketMessage$1
,
...
@@ -12293,7 +12328,7 @@ var serviceContext = (function () {
...
@@ -12293,7 +12328,7 @@ var serviceContext = (function () {
return
updateManager
||
(
updateManager
=
new
UpdateManager
())
return
updateManager
||
(
updateManager
=
new
UpdateManager
())
}
}
var
require_context_module_1_2
1
=
/*#__PURE__*/
Object
.
freeze
({
var
require_context_module_1_2
3
=
/*#__PURE__*/
Object
.
freeze
({
__proto__
:
null
,
__proto__
:
null
,
getUpdateManager
:
getUpdateManager
getUpdateManager
:
getUpdateManager
});
});
...
@@ -12387,7 +12422,7 @@ var serviceContext = (function () {
...
@@ -12387,7 +12422,7 @@ var serviceContext = (function () {
return
task
return
task
}
}
var
require_context_module_1_2
2
=
/*#__PURE__*/
Object
.
freeze
({
var
require_context_module_1_2
4
=
/*#__PURE__*/
Object
.
freeze
({
__proto__
:
null
,
__proto__
:
null
,
uploadFile
:
uploadFile$1
uploadFile
:
uploadFile$1
});
});
...
@@ -12476,7 +12511,7 @@ var serviceContext = (function () {
...
@@ -12476,7 +12511,7 @@ var serviceContext = (function () {
return
new
MPAnimation
(
option
)
return
new
MPAnimation
(
option
)
}
}
var
require_context_module_1_2
3
=
/*#__PURE__*/
Object
.
freeze
({
var
require_context_module_1_2
5
=
/*#__PURE__*/
Object
.
freeze
({
__proto__
:
null
,
__proto__
:
null
,
createAnimation
:
createAnimation
createAnimation
:
createAnimation
});
});
...
@@ -12546,11 +12581,58 @@ var serviceContext = (function () {
...
@@ -12546,11 +12581,58 @@ var serviceContext = (function () {
return
new
ServiceIntersectionObserver
(
getCurrentPageVm
(
'
createIntersectionObserver
'
),
options
)
return
new
ServiceIntersectionObserver
(
getCurrentPageVm
(
'
createIntersectionObserver
'
),
options
)
}
}
var
require_context_module_1_2
4
=
/*#__PURE__*/
Object
.
freeze
({
var
require_context_module_1_2
6
=
/*#__PURE__*/
Object
.
freeze
({
__proto__
:
null
,
__proto__
:
null
,
createIntersectionObserver
:
createIntersectionObserver
createIntersectionObserver
:
createIntersectionObserver
});
});
const
createMediaQueryObserverCallbacks
=
createCallbacks
(
'
requestMediaQueryObserver
'
);
class
ServiceMediaQueryObserver
{
constructor
(
component
,
options
)
{
this
.
pageId
=
component
.
$page
.
id
;
this
.
component
=
component
.
_$id
||
component
;
// app-plus 平台传输_$id
this
.
options
=
options
;
}
observe
(
options
,
callback
)
{
if
(
typeof
callback
!==
'
function
'
)
{
return
}
this
.
options
=
options
;
this
.
reqId
=
createMediaQueryObserverCallbacks
.
push
(
callback
);
UniServiceJSBridge
.
publishHandler
(
'
requestMediaQueryObserver
'
,
{
reqId
:
this
.
reqId
,
component
:
this
.
component
,
options
:
this
.
options
},
this
.
pageId
);
}
disconnect
()
{
UniServiceJSBridge
.
publishHandler
(
'
destroyMediaQueryObserver
'
,
{
reqId
:
this
.
reqId
},
this
.
pageId
);
}
}
function
createMediaQueryObserver
(
context
,
options
)
{
if
(
!
context
.
_isVue
)
{
options
=
context
;
context
=
null
;
}
if
(
context
)
{
return
new
ServiceMediaQueryObserver
(
context
,
options
)
}
return
new
ServiceMediaQueryObserver
(
getCurrentPageVm
(
'
createMediaQueryObserver
'
),
options
)
}
var
require_context_module_1_27
=
/*#__PURE__*/
Object
.
freeze
({
__proto__
:
null
,
createMediaQueryObserver
:
createMediaQueryObserver
});
const
ContextClasss
=
{
const
ContextClasss
=
{
canvas
:
CanvasContext
,
canvas
:
CanvasContext
,
map
:
MapContext
,
map
:
MapContext
,
...
@@ -12687,28 +12769,11 @@ var serviceContext = (function () {
...
@@ -12687,28 +12769,11 @@ var serviceContext = (function () {
return
new
SelectorQuery
(
getCurrentPageVm
(
'
createSelectorQuery
'
))
return
new
SelectorQuery
(
getCurrentPageVm
(
'
createSelectorQuery
'
))
}
}
var
require_context_module_1_2
5
=
/*#__PURE__*/
Object
.
freeze
({
var
require_context_module_1_2
8
=
/*#__PURE__*/
Object
.
freeze
({
__proto__
:
null
,
__proto__
:
null
,
createSelectorQuery
:
createSelectorQuery
createSelectorQuery
:
createSelectorQuery
});
});
let
callback$1
;
onMethod
(
'
onKeyboardHeightChange
'
,
res
=>
{
if
(
callback$1
)
{
invoke$1
(
callback$1
,
res
);
}
});
function
onKeyboardHeightChange
(
callbackId
)
{
callback$1
=
callbackId
;
}
var
require_context_module_1_26
=
/*#__PURE__*/
Object
.
freeze
({
__proto__
:
null
,
onKeyboardHeightChange
:
onKeyboardHeightChange
});
UniServiceJSBridge
.
subscribe
(
'
onLoadFontFaceCallback
'
,
({
UniServiceJSBridge
.
subscribe
(
'
onLoadFontFaceCallback
'
,
({
callbackId
,
callbackId
,
data
data
...
@@ -12729,7 +12794,7 @@ var serviceContext = (function () {
...
@@ -12729,7 +12794,7 @@ var serviceContext = (function () {
},
pageId
);
},
pageId
);
}
}
var
require_context_module_1_2
7
=
/*#__PURE__*/
Object
.
freeze
({
var
require_context_module_1_2
9
=
/*#__PURE__*/
Object
.
freeze
({
__proto__
:
null
,
__proto__
:
null
,
loadFontFace
:
loadFontFace$1
loadFontFace
:
loadFontFace$1
});
});
...
@@ -12742,7 +12807,7 @@ var serviceContext = (function () {
...
@@ -12742,7 +12807,7 @@ var serviceContext = (function () {
return
{}
return
{}
}
}
var
require_context_module_1_
28
=
/*#__PURE__*/
Object
.
freeze
({
var
require_context_module_1_
30
=
/*#__PURE__*/
Object
.
freeze
({
__proto__
:
null
,
__proto__
:
null
,
pageScrollTo
:
pageScrollTo$1
pageScrollTo
:
pageScrollTo$1
});
});
...
@@ -12755,7 +12820,7 @@ var serviceContext = (function () {
...
@@ -12755,7 +12820,7 @@ var serviceContext = (function () {
return
{}
return
{}
}
}
var
require_context_module_1_
29
=
/*#__PURE__*/
Object
.
freeze
({
var
require_context_module_1_
31
=
/*#__PURE__*/
Object
.
freeze
({
__proto__
:
null
,
__proto__
:
null
,
setPageMeta
:
setPageMeta
setPageMeta
:
setPageMeta
});
});
...
@@ -12792,7 +12857,7 @@ var serviceContext = (function () {
...
@@ -12792,7 +12857,7 @@ var serviceContext = (function () {
callbacks$c
.
push
(
callbackId
);
callbacks$c
.
push
(
callbackId
);
}
}
var
require_context_module_1_3
0
=
/*#__PURE__*/
Object
.
freeze
({
var
require_context_module_1_3
2
=
/*#__PURE__*/
Object
.
freeze
({
__proto__
:
null
,
__proto__
:
null
,
removeTabBarBadge
:
removeTabBarBadge$1
,
removeTabBarBadge
:
removeTabBarBadge$1
,
showTabBarRedDot
:
showTabBarRedDot$1
,
showTabBarRedDot
:
showTabBarRedDot$1
,
...
@@ -12818,7 +12883,7 @@ var serviceContext = (function () {
...
@@ -12818,7 +12883,7 @@ var serviceContext = (function () {
callbacks$d
.
splice
(
callbacks$d
.
indexOf
(
callbackId
),
1
);
callbacks$d
.
splice
(
callbacks$d
.
indexOf
(
callbackId
),
1
);
}
}
var
require_context_module_1_3
1
=
/*#__PURE__*/
Object
.
freeze
({
var
require_context_module_1_3
3
=
/*#__PURE__*/
Object
.
freeze
({
__proto__
:
null
,
__proto__
:
null
,
onWindowResize
:
onWindowResize
,
onWindowResize
:
onWindowResize
,
offWindowResize
:
offWindowResize
offWindowResize
:
offWindowResize
...
@@ -12845,22 +12910,24 @@ var serviceContext = (function () {
...
@@ -12845,22 +12910,24 @@ var serviceContext = (function () {
'
./device/compass.js
'
:
require_context_module_1_13
,
'
./device/compass.js
'
:
require_context_module_1_13
,
'
./device/network.js
'
:
require_context_module_1_14
,
'
./device/network.js
'
:
require_context_module_1_14
,
'
./device/theme.js
'
:
require_context_module_1_15
,
'
./device/theme.js
'
:
require_context_module_1_15
,
'
./media/preview-image.js
'
:
require_context_module_1_16
,
'
./keyboard/get-selected-text-range.js
'
:
require_context_module_1_16
,
'
./media/recorder.js
'
:
require_context_module_1_17
,
'
./keyboard/keyboard.js
'
:
require_context_module_1_17
,
'
./network/download-file.js
'
:
require_context_module_1_18
,
'
./media/preview-image.js
'
:
require_context_module_1_18
,
'
./network/request.js
'
:
require_context_module_1_19
,
'
./media/recorder.js
'
:
require_context_module_1_19
,
'
./network/socket.js
'
:
require_context_module_1_20
,
'
./network/download-file.js
'
:
require_context_module_1_20
,
'
./network/update.js
'
:
require_context_module_1_21
,
'
./network/request.js
'
:
require_context_module_1_21
,
'
./network/upload-file.js
'
:
require_context_module_1_22
,
'
./network/socket.js
'
:
require_context_module_1_22
,
'
./ui/create-animation.js
'
:
require_context_module_1_23
,
'
./network/update.js
'
:
require_context_module_1_23
,
'
./ui/create-intersection-observer.js
'
:
require_context_module_1_24
,
'
./network/upload-file.js
'
:
require_context_module_1_24
,
'
./ui/create-selector-query.js
'
:
require_context_module_1_25
,
'
./ui/create-animation.js
'
:
require_context_module_1_25
,
'
./ui/keyboard.js
'
:
require_context_module_1_26
,
'
./ui/create-intersection-observer.js
'
:
require_context_module_1_26
,
'
./ui/load-font-face.js
'
:
require_context_module_1_27
,
'
./ui/create-media-query-observer.js
'
:
require_context_module_1_27
,
'
./ui/page-scroll-to.js
'
:
require_context_module_1_28
,
'
./ui/create-selector-query.js
'
:
require_context_module_1_28
,
'
./ui/set-page-meta.js
'
:
require_context_module_1_29
,
'
./ui/load-font-face.js
'
:
require_context_module_1_29
,
'
./ui/tab-bar.js
'
:
require_context_module_1_30
,
'
./ui/page-scroll-to.js
'
:
require_context_module_1_30
,
'
./ui/window.js
'
:
require_context_module_1_31
,
'
./ui/set-page-meta.js
'
:
require_context_module_1_31
,
'
./ui/tab-bar.js
'
:
require_context_module_1_32
,
'
./ui/window.js
'
:
require_context_module_1_33
,
};
};
var
req
=
function
req
(
key
)
{
var
req
=
function
req
(
key
)
{
...
@@ -13013,6 +13080,9 @@ var serviceContext = (function () {
...
@@ -13013,6 +13080,9 @@ var serviceContext = (function () {
function
onAppEnterForeground
()
{
function
onAppEnterForeground
()
{
const
pages
=
getCurrentPages
();
const
pages
=
getCurrentPages
();
if
(
pages
.
length
===
0
)
{
return
}
const
page
=
pages
[
pages
.
length
-
1
];
const
page
=
pages
[
pages
.
length
-
1
];
const
args
=
{
const
args
=
{
path
:
page
.
route
,
path
:
page
.
route
,
...
@@ -13109,11 +13179,29 @@ var serviceContext = (function () {
...
@@ -13109,11 +13179,29 @@ var serviceContext = (function () {
}
}
}
}
const
requestMediaQueryObserverCallbacks
=
createCallbacks
(
'
requestMediaQueryObserver
'
);
function
onRequestMediaQueryObserver
({
reqId
,
reqEnd
,
res
})
{
const
callback
=
requestMediaQueryObserverCallbacks
.
get
(
reqId
);
if
(
callback
)
{
if
(
reqEnd
)
{
requestMediaQueryObserverCallbacks
.
pop
(
reqId
);
return
}
callback
(
res
);
}
}
subscribe
(
'
onPageScroll
'
,
createPageEvent
(
'
onPageScroll
'
));
subscribe
(
'
onPageScroll
'
,
createPageEvent
(
'
onPageScroll
'
));
subscribe
(
'
onReachBottom
'
,
createPageEvent
(
'
onReachBottom
'
));
subscribe
(
'
onReachBottom
'
,
createPageEvent
(
'
onReachBottom
'
));
subscribe
(
'
onRequestComponentInfo
'
,
onRequestComponentInfo
);
subscribe
(
'
onRequestComponentInfo
'
,
onRequestComponentInfo
);
subscribe
(
'
onRequestComponentObserver
'
,
onRequestComponentObserver
);
subscribe
(
'
onRequestComponentObserver
'
,
onRequestComponentObserver
);
subscribe
(
'
onRequestMediaQueryObserver
'
,
onRequestMediaQueryObserver
);
}
}
function
perf
(
type
,
startTime
)
{
function
perf
(
type
,
startTime
)
{
...
@@ -13523,12 +13611,12 @@ var serviceContext = (function () {
...
@@ -13523,12 +13611,12 @@ var serviceContext = (function () {
}
}
var
tags
=
[
var
tags
=
[
'
uni-app
'
,
'
uni-app
'
,
'
uni-layout
'
,
'
uni-layout
'
,
'
uni-content
'
,
'
uni-content
'
,
'
uni-main
'
,
'
uni-main
'
,
'
uni-left-window
'
,
'
uni-left-window
'
,
'
uni-right-window
'
,
'
uni-right-window
'
,
'
uni-tabbar
'
,
'
uni-tabbar
'
,
'
uni-page
'
,
'
uni-page
'
,
'
uni-page-head
'
,
'
uni-page-head
'
,
...
@@ -13538,7 +13626,7 @@ var serviceContext = (function () {
...
@@ -13538,7 +13626,7 @@ var serviceContext = (function () {
'
uni-actionsheet
'
,
'
uni-actionsheet
'
,
'
uni-modal
'
,
'
uni-modal
'
,
'
uni-toast
'
,
'
uni-toast
'
,
'
uni-resize-sensor
'
,
'
uni-resize-sensor
'
,
'
uni-shadow-root
'
,
'
uni-shadow-root
'
,
'
uni-ad
'
,
'
uni-ad
'
,
...
@@ -13581,7 +13669,8 @@ var serviceContext = (function () {
...
@@ -13581,7 +13669,8 @@ var serviceContext = (function () {
'
uni-textarea
'
,
'
uni-textarea
'
,
'
uni-video
'
,
'
uni-video
'
,
'
uni-view
'
,
'
uni-view
'
,
'
uni-web-view
'
'
uni-web-view
'
,
'
uni-match-media
'
];
];
// 使用白名单过滤(前期有一批自定义组件使用了 uni-)
// 使用白名单过滤(前期有一批自定义组件使用了 uni-)
...
@@ -13697,6 +13786,10 @@ var serviceContext = (function () {
...
@@ -13697,6 +13786,10 @@ var serviceContext = (function () {
return
uni
.
createIntersectionObserver
(
this
,
options
)
return
uni
.
createIntersectionObserver
(
this
,
options
)
};
};
Vue
.
prototype
.
createMediaQueryObserver
=
function
createMediaQueryObserver
(
options
)
{
return
uni
.
createMediaQueryObserver
(
this
,
options
)
};
Vue
.
prototype
.
selectComponent
=
function
selectComponent
(
selector
)
{
Vue
.
prototype
.
selectComponent
=
function
selectComponent
(
selector
)
{
return
querySelector
(
this
,
parseSelector
(
selector
))
return
querySelector
(
this
,
parseSelector
(
selector
))
};
};
...
@@ -14391,7 +14484,7 @@ var serviceContext = (function () {
...
@@ -14391,7 +14484,7 @@ var serviceContext = (function () {
}
}
var
vuePlugin
=
{
var
vuePlugin
=
{
install
(
Vue
,
options
)
{
install
(
Vue
,
options
)
{
initVue
(
Vue
);
initVue
(
Vue
);
initData
(
Vue
);
initData
(
Vue
);
...
@@ -14399,18 +14492,21 @@ var serviceContext = (function () {
...
@@ -14399,18 +14492,21 @@ var serviceContext = (function () {
initPolyfill
(
Vue
);
initPolyfill
(
Vue
);
Vue
.
prototype
.
getOpenerEventChannel
=
function
()
{
Vue
.
prototype
.
getOpenerEventChannel
=
function
()
{
return
this
.
$root
.
$scope
.
eventChannel
||
new
EventChannel
()
if
(
!
this
.
$root
.
$scope
.
eventChannel
)
{
this
.
$root
.
$scope
.
eventChannel
=
new
EventChannel
();
}
return
this
.
$root
.
$scope
.
eventChannel
};
};
Object
.
defineProperty
(
Vue
.
prototype
,
'
$page
'
,
{
Object
.
defineProperty
(
Vue
.
prototype
,
'
$page
'
,
{
get
()
{
get
()
{
return
this
.
$root
.
$scope
.
$page
return
this
.
$root
.
$scope
.
$page
}
}
});
});
// 兼容旧版本
// 兼容旧版本
Object
.
defineProperty
(
Vue
.
prototype
,
'
$mp
'
,
{
Object
.
defineProperty
(
Vue
.
prototype
,
'
$mp
'
,
{
get
()
{
get
()
{
return
{
return
{
page
:
this
.
$root
.
$scope
page
:
this
.
$root
.
$scope
}
}
...
@@ -14418,9 +14514,9 @@ var serviceContext = (function () {
...
@@ -14418,9 +14514,9 @@ var serviceContext = (function () {
});
});
const
oldMount
=
Vue
.
prototype
.
$mount
;
const
oldMount
=
Vue
.
prototype
.
$mount
;
Vue
.
prototype
.
$mount
=
function
mount
(
el
,
hydrating
)
{
Vue
.
prototype
.
$mount
=
function
mount
(
el
,
hydrating
)
{
if
(
this
.
mpType
===
'
app
'
)
{
if
(
this
.
mpType
===
'
app
'
)
{
this
.
$options
.
render
=
function
()
{};
this
.
$options
.
render
=
function
()
{};
if
(
weex
.
config
.
preload
)
{
// preload
if
(
weex
.
config
.
preload
)
{
// preload
if
(
process
.
env
.
NODE_ENV
!==
'
production
'
)
{
if
(
process
.
env
.
NODE_ENV
!==
'
production
'
)
{
console
.
log
(
'
[uni-app] preload app-service.js
'
);
console
.
log
(
'
[uni-app] preload app-service.js
'
);
...
@@ -14441,7 +14537,7 @@ var serviceContext = (function () {
...
@@ -14441,7 +14537,7 @@ var serviceContext = (function () {
return
oldMount
.
call
(
this
,
el
,
hydrating
)
return
oldMount
.
call
(
this
,
el
,
hydrating
)
};
};
Vue
.
prototype
.
$nextTick
=
function
nextTick
(
cb
)
{
Vue
.
prototype
.
$nextTick
=
function
nextTick
(
cb
)
{
const
renderWatcher
=
this
.
_watcher
;
const
renderWatcher
=
this
.
_watcher
;
const
callback
=
typeof
cb
===
'
function
'
;
const
callback
=
typeof
cb
===
'
function
'
;
const
result
=
new
Promise
((
resolve
)
=>
{
const
result
=
new
Promise
((
resolve
)
=>
{
...
...
packages/uni-cli-shared/lib/tags.js
浏览文件 @
79c041f3
...
@@ -41,5 +41,5 @@ module.exports = {
...
@@ -41,5 +41,5 @@ module.exports = {
video
:
[
'
app-plus
'
,
'
mp-weixin
'
,
'
h5
'
],
video
:
[
'
app-plus
'
,
'
mp-weixin
'
,
'
h5
'
],
view
:
[
'
app-plus
'
,
'
mp-weixin
'
,
'
h5
'
],
view
:
[
'
app-plus
'
,
'
mp-weixin
'
,
'
h5
'
],
'
web-view
'
:
[
'
app-plus
'
,
'
mp-weixin
'
],
'
web-view
'
:
[
'
app-plus
'
,
'
mp-weixin
'
],
'
match-media
'
:[
'
app-plus
'
,
'
mp-weixin
'
,
'
h5
'
]
'
match-media
'
:
[
'
app-plus
'
,
'
mp-weixin
'
,
'
h5
'
]
}
}
packages/uni-h5/dist/index.css
浏览文件 @
79c041f3
此差异已折叠。
点击以展开。
packages/uni-h5/dist/index.umd.min.js
浏览文件 @
79c041f3
此差异已折叠。
点击以展开。
packages/uni-h5/manifest.json
浏览文件 @
79c041f3
...
@@ -301,6 +301,14 @@
...
@@ -301,6 +301,14 @@
"/core/view/components/swiper-item/index.vue"
,
"/core/view/components/swiper-item/index.vue"
,
"SwiperItem"
"SwiperItem"
],
],
[
"/core/view/components/movable-area/index.vue"
,
"MovableArea"
],
[
"/core/view/components/movable-view/index.vue"
,
"MovableView"
],
[
[
"/platforms/h5/components/system-routes/preview-image/index.vue"
,
"/platforms/h5/components/system-routes/preview-image/index.vue"
,
"PreviewImage"
"PreviewImage"
...
@@ -460,11 +468,15 @@
...
@@ -460,11 +468,15 @@
[]
[]
],
],
"hideKeyboard"
:
[
"hideKeyboard"
:
[
"/platforms/h5/service/api/
device/hide-
keyboard.js"
,
"/platforms/h5/service/api/
keyboard/
keyboard.js"
,
[]
[]
],
],
"onKeyboardHeightChange"
:
[
"onKeyboardHeightChange"
:
[
"/core/service/api/ui/keyboard.js"
,
"/core/service/api/keyboard/keyboard.js"
,
[]
],
"getSelectedTextRange"
:
[
"/core/service/api/keyboard/get-selected-text-range.js"
,
[]
[]
],
],
"showToast"
:
[
"showToast"
:
[
...
@@ -732,6 +744,10 @@
...
@@ -732,6 +744,10 @@
]
]
]
]
],
],
"createMediaQueryObserver"
:
[
"/core/service/api/ui/create-media-query-observer.js"
,
[]
],
"$emit"
:
[
"$emit"
:
[
"/platforms/h5/service/api/base/event-bus.js"
,
"/platforms/h5/service/api/base/event-bus.js"
,
[
[
...
...
packages/webpack-uni-pages-loader/lib/platforms/h5.js
浏览文件 @
79c041f3
...
@@ -154,7 +154,10 @@ const getPageComponents = function (inputDir, pagesJson) {
...
@@ -154,7 +154,10 @@ const getPageComponents = function (inputDir, pagesJson) {
isTabBar
,
isTabBar
,
tabBarIndex
,
tabBarIndex
,
isQuit
:
isEntry
||
isTabBar
,
isQuit
:
isEntry
||
isTabBar
,
windowTop
windowTop
,
topWindow
:
pageStyle
.
topWindow
,
leftWindow
:
pageStyle
.
leftWindow
,
rightWindow
:
pageStyle
.
rightWindow
}
}
}).
filter
(
pageComponents
=>
!!
pageComponents
)
}).
filter
(
pageComponents
=>
!!
pageComponents
)
}
}
...
@@ -211,7 +214,10 @@ const genPageRoutes = function (pageComponents) {
...
@@ -211,7 +214,10 @@ const genPageRoutes = function (pageComponents) {
isEntry
,
isEntry
,
isTabBar
,
isTabBar
,
windowTop
,
windowTop
,
tabBarIndex
tabBarIndex
,
topWindow
,
leftWindow
,
rightWindow
})
=>
{
})
=>
{
return
`
return
`
{
{
...
@@ -222,9 +228,8 @@ component: {
...
@@ -222,9 +228,8 @@ component: {
'Page',
'Page',
{
{
props: Object.assign({
props: Object.assign({
${
isQuit
?
'
isQuit:true,
\n
'
:
''
}
${
isQuit
?
'
isQuit:true,
\n
'
:
''
}${
isEntry
?
'
isEntry:true,
\n
'
:
''
}${
isTabBar
?
'
isTabBar:true,
\n
'
:
''
}
${
isEntry
?
'
isEntry:true,
\n
'
:
''
}
${
topWindow
===
false
?
'
topWindow:false,
\n
'
:
''
}${
leftWindow
===
false
?
'
leftWindow:false,
\n
'
:
''
}${
rightWindow
===
false
?
'
rightWindow:false,
\n
'
:
''
}
${
isTabBar
?
'
isTabBar:true,
\n
'
:
''
}
${
isTabBar
?
(
'
tabBarIndex:
'
+
tabBarIndex
)
:
''
}
${
isTabBar
?
(
'
tabBarIndex:
'
+
tabBarIndex
)
:
''
}
},__uniConfig.globalStyle,
${
JSON
.
stringify
(
props
)}
)
},__uniConfig.globalStyle,
${
JSON
.
stringify
(
props
)}
)
},
},
...
@@ -238,7 +243,7 @@ component: {
...
@@ -238,7 +243,7 @@ component: {
},
},
meta:{
${
isQuit
?
'
\n
id:
'
+
(
id
++
)
+
'
,
'
:
''
}
meta:{
${
isQuit
?
'
\n
id:
'
+
(
id
++
)
+
'
,
'
:
''
}
name:'
${
name
}
',
name:'
${
name
}
',
isNVue:
${
isNVue
}
,
isNVue:
${
isNVue
}
,
${
topWindow
===
false
?
'
topWindow:false,
\n
'
:
''
}${
leftWindow
===
false
?
'
leftWindow:false,
\n
'
:
''
}${
rightWindow
===
false
?
'
rightWindow:false,
\n
'
:
''
}
pagePath:'
${
route
}
'
${
isQuit
?
'
,
\n
isQuit:true
'
:
''
}${
isEntry
?
'
,
\n
isEntry:true
'
:
''
}${
isTabBar
?
'
,
\n
isTabBar:true
'
:
''
}${
tabBarIndex
!==
-
1
?
(
'
,
\n
tabBarIndex:
'
+
tabBarIndex
)
:
''
}
,
pagePath:'
${
route
}
'
${
isQuit
?
'
,
\n
isQuit:true
'
:
''
}${
isEntry
?
'
,
\n
isEntry:true
'
:
''
}${
isTabBar
?
'
,
\n
isTabBar:true
'
:
''
}${
tabBarIndex
!==
-
1
?
(
'
,
\n
tabBarIndex:
'
+
tabBarIndex
)
:
''
}
,
windowTop:
${
windowTop
}
windowTop:
${
windowTop
}
}
}
...
@@ -360,12 +365,20 @@ function filterPages (pagesJson, includes) {
...
@@ -360,12 +365,20 @@ function filterPages (pagesJson, includes) {
function
genLayoutComponentsCode
(
pagesJson
)
{
function
genLayoutComponentsCode
(
pagesJson
)
{
const
code
=
[]
const
code
=
[]
const
{
const
{
topWindow
,
leftWindow
,
leftWindow
,
rightWindow
rightWindow
}
=
pagesJson
}
=
pagesJson
if
(
topWindow
&&
topWindow
.
path
)
{
code
.
push
(
`import TopWindow from './
${
topWindow
.
path
}
';
${
topWindow
.
style
?
(
'
TopWindow.style=
'
+
JSON
.
stringify
(
topWindow
.
style
))
:
''
}
Vue.component('VUniTopWindow',TopWindow);`
)
}
if
(
leftWindow
&&
leftWindow
.
path
)
{
if
(
leftWindow
&&
leftWindow
.
path
)
{
code
.
push
(
code
.
push
(
`import LeftWindow from './
${
leftWindow
.
path
}
';
`import LeftWindow from './
${
leftWindow
.
path
}
';
${
leftWindow
.
style
?
(
'
LeftWindow.style=
'
+
JSON
.
stringify
(
leftWindow
.
style
))
:
''
}
${
leftWindow
.
style
?
(
'
LeftWindow.style=
'
+
JSON
.
stringify
(
leftWindow
.
style
))
:
''
}
Vue.component('VUniLeftWindow',LeftWindow);`
Vue.component('VUniLeftWindow',LeftWindow);`
)
)
...
@@ -374,7 +387,7 @@ Vue.component('VUniLeftWindow',LeftWindow);`
...
@@ -374,7 +387,7 @@ Vue.component('VUniLeftWindow',LeftWindow);`
if
(
rightWindow
&&
rightWindow
.
path
)
{
if
(
rightWindow
&&
rightWindow
.
path
)
{
code
.
push
(
code
.
push
(
`
`
import RightWindow from './
${
rightWindow
.
path
}
';
import RightWindow from './
${
rightWindow
.
path
}
';
${
rightWindow
.
style
?
(
'
RightWindow.style=
'
+
JSON
.
stringify
(
rightWindow
.
style
))
:
''
}
${
rightWindow
.
style
?
(
'
RightWindow.style=
'
+
JSON
.
stringify
(
rightWindow
.
style
))
:
''
}
Vue.component('VUniRightWindow',RightWindow);`
Vue.component('VUniRightWindow',RightWindow);`
)
)
...
...
src/core/helpers/tags.js
浏览文件 @
79c041f3
...
@@ -2,7 +2,8 @@ module.exports = [
...
@@ -2,7 +2,8 @@ module.exports = [
'
uni-app
'
,
'
uni-app
'
,
'
uni-layout
'
,
'
uni-layout
'
,
'
uni-content
'
,
'
uni-content
'
,
'
uni-main
'
,
'
uni-main
'
,
'
uni-top-window
'
,
'
uni-left-window
'
,
'
uni-left-window
'
,
'
uni-right-window
'
,
'
uni-right-window
'
,
'
uni-tabbar
'
,
'
uni-tabbar
'
,
...
...
src/platforms/h5/components/app/layout.vue
浏览文件 @
79c041f3
...
@@ -3,15 +3,26 @@
...
@@ -3,15 +3,26 @@
v-if=
"responsive"
v-if=
"responsive"
:class=
"
{'uni-app--showlayout':showLayout}"
:class=
"
{'uni-app--showlayout':showLayout}"
>
>
<!--TODO header-->
<uni-content>
<uni-content>
<uni-main>
<uni-main>
<uni-top-window
v-if=
"topWindow"
v-show=
"showLayout&&showTopWindow"
ref=
"topWindow"
:style=
"topWindowStyle"
>
<v-uni-top-window
ref=
"top"
@
hook:mounted=
"onTopWindowInit"
/>
</uni-top-window>
<keep-alive
:include=
"keepAliveInclude"
>
<keep-alive
:include=
"keepAliveInclude"
>
<router-view
:key=
"routerKey"
/>
<router-view
:key=
"routerKey"
/>
</keep-alive>
</keep-alive>
</uni-main>
</uni-main>
<uni-left-window
<uni-left-window
v-if=
"leftWindow"
v-if=
"leftWindow"
v-show=
"showLayout&&showLeftWindow"
ref=
"leftWindow"
ref=
"leftWindow"
:style=
"leftWindowStyle"
:style=
"leftWindowStyle"
>
>
...
@@ -22,6 +33,7 @@
...
@@ -22,6 +33,7 @@
</uni-left-window>
</uni-left-window>
<uni-right-window
<uni-right-window
v-if=
"rightWindow"
v-if=
"rightWindow"
v-show=
"showLayout&&showRightWindow"
ref=
"rightWindow"
ref=
"rightWindow"
:style=
"rightWindowStyle"
:style=
"rightWindowStyle"
>
>
...
@@ -89,14 +101,46 @@ export default {
...
@@ -89,14 +101,46 @@ export default {
return
{
return
{
showLayout
:
true
,
showLayout
:
true
,
leftWindowStyle
:
''
,
leftWindowStyle
:
''
,
rightWindowStyle
:
''
rightWindowStyle
:
''
,
topWindowStyle
:
''
,
showTopWindow
:
true
,
showLeftWindow
:
true
,
showRightWindow
:
true
}
},
watch
:
{
$route
(
newRoute
,
oldRoute
)
{
this
.
initShowWindow
(
newRoute
)
},
showTopWindow
(
newVal
,
val
)
{
if
(
newVal
)
{
this
.
$nextTick
(
this
.
onTopWindowInit
)
}
else
{
updateCssVar
(
'
--window-top
'
,
'
0px
'
)
}
},
showLeftWindow
(
newVal
,
val
)
{
if
(
newVal
)
{
this
.
$nextTick
(
this
.
onLeftWindowInit
)
}
else
{
updateCssVar
(
'
--window-left
'
,
'
0px
'
)
}
},
showRightWindow
(
newVal
,
val
)
{
if
(
newVal
)
{
this
.
$nextTick
(
this
.
onRightWindowInit
)
}
else
{
updateCssVar
(
'
--window-right
'
,
'
0px
'
)
}
}
}
},
},
beforeCreate
()
{
beforeCreate
()
{
updateCssVar
(
'
--window-top
'
,
'
0px
'
)
updateCssVar
(
'
--window-left
'
,
'
0px
'
)
updateCssVar
(
'
--window-left
'
,
'
0px
'
)
updateCssVar
(
'
--window-right
'
,
'
0px
'
)
updateCssVar
(
'
--window-right
'
,
'
0px
'
)
},
},
created
()
{
created
()
{
this
.
topWindow
=
Vue
.
component
(
'
VUniTopWindow
'
)
this
.
leftWindow
=
Vue
.
component
(
'
VUniLeftWindow
'
)
this
.
leftWindow
=
Vue
.
component
(
'
VUniLeftWindow
'
)
this
.
rightWindow
=
Vue
.
component
(
'
VUniRightWindow
'
)
this
.
rightWindow
=
Vue
.
component
(
'
VUniRightWindow
'
)
if
(
// 低版本不提供 responsive 支持
if
(
// 低版本不提供 responsive 支持
...
@@ -104,7 +148,8 @@ export default {
...
@@ -104,7 +148,8 @@ export default {
uni
.
canIUse
(
'
css.var
'
)
&&
uni
.
canIUse
(
'
css.var
'
)
&&
window
.
matchMedia
window
.
matchMedia
)
{
)
{
this
.
responsive
=
Math
.
max
.
apply
(
null
,
sizes
)
>
minWidth
// 存在 topWindow 时,视为始终要支持 responsive (如 pc-admin 的情况,需要在 top 中切换 left 或 right)
this
.
responsive
=
this
.
topWindow
||
Math
.
max
.
apply
(
null
,
sizes
)
>
minWidth
if
(
this
.
responsive
)
{
if
(
this
.
responsive
)
{
if
(
this
.
leftWindow
&&
this
.
leftWindow
.
options
.
style
)
{
if
(
this
.
leftWindow
&&
this
.
leftWindow
.
options
.
style
)
{
this
.
leftWindowStyle
=
this
.
leftWindow
.
options
.
style
this
.
leftWindowStyle
=
this
.
leftWindow
.
options
.
style
...
@@ -115,8 +160,23 @@ export default {
...
@@ -115,8 +160,23 @@ export default {
this
.
initMediaQuery
()
this
.
initMediaQuery
()
}
}
}
}
this
.
initShowWindow
(
this
.
$route
)
},
},
methods
:
{
methods
:
{
initShowWindow
(
newRoute
)
{
if
(
!
this
.
responsive
)
{
return
}
if
(
this
.
topWindow
)
{
this
.
showTopWindow
=
newRoute
.
meta
.
topWindow
!==
false
}
if
(
this
.
leftWindow
)
{
this
.
showLeftWindow
=
newRoute
.
meta
.
leftWindow
!==
false
}
if
(
this
.
rightWindow
)
{
this
.
showRightWindow
=
newRoute
.
meta
.
rightWindow
!==
false
}
},
initMediaQuery
()
{
initMediaQuery
()
{
if
(
!
window
.
matchMedia
)
{
if
(
!
window
.
matchMedia
)
{
return
return
...
@@ -125,12 +185,21 @@ export default {
...
@@ -125,12 +185,21 @@ export default {
mediaQueryList
.
addListener
((
e
)
=>
{
mediaQueryList
.
addListener
((
e
)
=>
{
this
.
showLayout
=
e
.
matches
this
.
showLayout
=
e
.
matches
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
this
.
topWindow
&&
this
.
onTopWindowInit
()
this
.
leftWindow
&&
this
.
onLeftWindowInit
()
this
.
leftWindow
&&
this
.
onLeftWindowInit
()
this
.
rightWindow
&&
this
.
onRightWindowInit
()
this
.
rightWindow
&&
this
.
onRightWindowInit
()
})
})
})
})
this
.
showLayout
=
mediaQueryList
.
matches
this
.
showLayout
=
mediaQueryList
.
matches
},
},
onTopWindowInit
()
{
// TODO page header
if
(
this
.
topWindowStyle
&&
this
.
topWindowStyle
.
width
)
{
updateCssVar
(
'
--window-top
'
,
this
.
$refs
.
topWindow
.
offsetHeight
+
'
px
'
)
}
else
{
updateCssVar
(
'
--window-top
'
,
this
.
$refs
.
top
.
$el
.
offsetHeight
+
'
px
'
)
}
},
onLeftWindowInit
()
{
onLeftWindowInit
()
{
if
(
this
.
leftWindowStyle
&&
this
.
leftWindowStyle
.
width
)
{
if
(
this
.
leftWindowStyle
&&
this
.
leftWindowStyle
.
width
)
{
updateCssVar
(
'
--window-left
'
,
this
.
$refs
.
leftWindow
.
offsetWidth
+
'
px
'
)
updateCssVar
(
'
--window-left
'
,
this
.
$refs
.
leftWindow
.
offsetWidth
+
'
px
'
)
...
@@ -158,7 +227,6 @@ export default {
...
@@ -158,7 +227,6 @@ export default {
uni-main
{
uni-main
{
flex
:
1
;
flex
:
1
;
overflow
:
auto
;
}
}
uni-left-window
{
uni-left-window
{
...
...
src/platforms/h5/components/page/index.vue
浏览文件 @
79c041f3
<
template
>
<
template
>
<uni-page
:data-page=
"$route.meta.pagePath"
>
<uni-page
:data-page=
"$route.meta.pagePath"
>
<page-head
<page-head
v-if=
"navigationBar.type!=='none'"
v-if=
"
!hasTopWindow &&
navigationBar.type!=='none'"
v-bind=
"navigationBar"
v-bind=
"navigationBar"
/>
/>
<page-refresh
<page-refresh
...
@@ -32,6 +32,8 @@
...
@@ -32,6 +32,8 @@
}
}
</
style
>
</
style
>
<
script
>
<
script
>
import
Vue
from
'
vue
'
import
{
import
{
upx2px
upx2px
}
from
'
uni-helpers/index
'
}
from
'
uni-helpers/index
'
...
@@ -159,9 +161,16 @@ export default {
...
@@ -159,9 +161,16 @@ export default {
default
()
{
default
()
{
return
{}
return
{}
}
}
},
topWindow
:
{
type
:
Boolean
,
default
:
true
}
}
},
},
data
()
{
data
()
{
// 目前简单处理,存在topWindow时,始终不显示page head
const
hasTopWindow
=
this
.
topWindow
!==
false
&&
!!
Vue
.
component
(
'
VUniTopWindow
'
)
let
navigationBar
=
{}
const
titleNViewTypeList
=
{
const
titleNViewTypeList
=
{
none
:
'
default
'
,
none
:
'
default
'
,
auto
:
'
transparent
'
,
auto
:
'
transparent
'
,
...
@@ -198,7 +207,7 @@ export default {
...
@@ -198,7 +207,7 @@ export default {
NO
:
false
NO
:
false
}
}
const
navigationBar
=
mergeTitleNView
({
navigationBar
=
mergeTitleNView
({
loading
:
false
,
loading
:
false
,
backButton
:
!
this
.
isQuit
&&
!
this
.
$route
.
meta
.
isQuit
,
// redirectTo,reLaunch时可能动态修改 meta.isQuit
backButton
:
!
this
.
isQuit
&&
!
this
.
$route
.
meta
.
isQuit
,
// redirectTo,reLaunch时可能动态修改 meta.isQuit
backgroundColor
:
this
.
navigationBarBackgroundColor
,
backgroundColor
:
this
.
navigationBarBackgroundColor
,
...
@@ -231,6 +240,7 @@ export default {
...
@@ -231,6 +240,7 @@ export default {
refreshOptions
.
range
=
upx2px
(
refreshOptions
.
range
)
refreshOptions
.
range
=
upx2px
(
refreshOptions
.
range
)
return
{
return
{
hasTopWindow
,
navigationBar
,
navigationBar
,
refreshOptions
refreshOptions
}
}
...
...
src/platforms/h5/view/bridge/subscribe/index.js
浏览文件 @
79c041f3
import
Vue
from
'
vue
'
import
{
import
{
isPlainObject
,
isPlainObject
,
supportsPassive
supportsPassive
...
@@ -28,10 +30,14 @@ function updateCssVar (vm) {
...
@@ -28,10 +30,14 @@ function updateCssVar (vm) {
const
windowTopValue
=
navigationBarType
===
'
default
'
||
navigationBarType
===
'
float
'
?
NAVBAR_HEIGHT
:
0
const
windowTopValue
=
navigationBarType
===
'
default
'
||
navigationBarType
===
'
float
'
?
NAVBAR_HEIGHT
:
0
const
windowBottomValue
=
getApp
().
$children
[
0
].
showTabBar
?
TABBAR_HEIGHT
:
0
const
windowBottomValue
=
getApp
().
$children
[
0
].
showTabBar
?
TABBAR_HEIGHT
:
0
const
envMethod
=
uni
.
canIUse
(
'
css.env
'
)
?
'
env
'
:
(
uni
.
canIUse
(
'
css.constant
'
)
?
'
constant
'
:
''
)
const
envMethod
=
uni
.
canIUse
(
'
css.env
'
)
?
'
env
'
:
(
uni
.
canIUse
(
'
css.constant
'
)
?
'
constant
'
:
''
)
const
windowTop
=
windowTopValue
&&
envMethod
?
`calc(
${
windowTopValue
}
px +
${
envMethod
}
(safe-area-inset-top))`
:
`
${
windowTopValue
}
px`
const
windowTop
=
windowTopValue
&&
envMethod
?
`calc(
${
windowTopValue
}
px +
${
envMethod
}
(safe-area-inset-top))`
const
windowBottom
=
windowBottomValue
&&
envMethod
?
`calc(
${
windowBottomValue
}
px +
${
envMethod
}
(safe-area-inset-bottom))`
:
`
${
windowBottomValue
}
px`
:
`
${
windowTopValue
}
px`
const
windowBottom
=
windowBottomValue
&&
envMethod
?
`calc(
${
windowBottomValue
}
px +
${
envMethod
}
(safe-area-inset-bottom))`
:
`
${
windowBottomValue
}
px`
const
style
=
document
.
documentElement
.
style
const
style
=
document
.
documentElement
.
style
style
.
setProperty
(
'
--window-top
'
,
windowTop
)
if
(
!
Vue
.
component
(
'
VUniTopWindow
'
)
||
pageVm
.
topWindow
===
false
)
{
// TODO 目前简单处理,只要包含topWindow,则不再更新--window-top
style
.
setProperty
(
'
--window-top
'
,
windowTop
)
}
style
.
setProperty
(
'
--window-bottom
'
,
windowBottom
)
style
.
setProperty
(
'
--window-bottom
'
,
windowBottom
)
console
.
debug
(
`
${
vm
.
$page
.
route
}
[
${
vm
.
$page
.
id
}
]:--window-top=
${
windowTop
}
`
)
console
.
debug
(
`
${
vm
.
$page
.
route
}
[
${
vm
.
$page
.
id
}
]:--window-top=
${
windowTop
}
`
)
console
.
debug
(
`
${
vm
.
$page
.
route
}
[
${
vm
.
$page
.
id
}
]:--window-bottom=
${
windowBottom
}
`
)
console
.
debug
(
`
${
vm
.
$page
.
route
}
[
${
vm
.
$page
.
id
}
]:--window-bottom=
${
windowBottom
}
`
)
...
@@ -85,4 +91,4 @@ export default function initSubscribe (subscribe) {
...
@@ -85,4 +91,4 @@ export default function initSubscribe (subscribe) {
})
})
}
}
})
})
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录