Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
yangkaifeng
uni-app
提交
31b94843
U
uni-app
项目概览
yangkaifeng
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
3
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,发现更多精彩内容 >>
提交
31b94843
编写于
1月 23, 2021
作者:
Q
qiang
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'dev' into alpha
上级
77e483f7
8b45e0b0
变更
17
展开全部
隐藏空白更改
内联
并排
Showing
17 changed file
with
251 addition
and
51 deletion
+251
-51
docs/api/ui/adapt.md
docs/api/ui/adapt.md
+170
-4
lib/apis.js
lib/apis.js
+3
-0
packages/uni-app-plus/dist/index.js
packages/uni-app-plus/dist/index.js
+1
-1
packages/uni-cli-shared/components/unicloud-db.vue
packages/uni-cli-shared/components/unicloud-db.vue
+25
-1
packages/uni-mp-alipay/dist/index.js
packages/uni-mp-alipay/dist/index.js
+5
-35
packages/uni-mp-baidu/dist/index.js
packages/uni-mp-baidu/dist/index.js
+1
-1
packages/uni-mp-kuaishou/dist/index.js
packages/uni-mp-kuaishou/dist/index.js
+1
-1
packages/uni-mp-qq/dist/index.js
packages/uni-mp-qq/dist/index.js
+1
-1
packages/uni-mp-toutiao/dist/index.js
packages/uni-mp-toutiao/dist/index.js
+1
-1
packages/uni-mp-weixin/dist/index.js
packages/uni-mp-weixin/dist/index.js
+1
-1
packages/uni-quickapp-native/dist/vue.dev.js
packages/uni-quickapp-native/dist/vue.dev.js
+1
-1
packages/uni-quickapp-native/dist/vue.prod.js
packages/uni-quickapp-native/dist/vue.prod.js
+1
-1
packages/uni-quickapp-webview/dist/index.js
packages/uni-quickapp-webview/dist/index.js
+1
-1
src/core/helpers/promise.js
src/core/helpers/promise.js
+1
-1
src/core/runtime/wrapper/util.js
src/core/runtime/wrapper/util.js
+4
-1
src/platforms/h5/components/app/layout.vue
src/platforms/h5/components/app/layout.vue
+7
-0
src/platforms/h5/service/api/ui/windows.js
src/platforms/h5/service/api/ui/windows.js
+27
-0
未找到文件。
docs/api/ui/adapt.md
浏览文件 @
31b94843
##
# uni.setTopWindowStyle(OBJECT)
##
窗口样式相关的 API
设置 topWindow 的样式
获取对应窗口的样式,返回一个 css 属性值对象;
设置对应窗口的样式,传入一个 css 属性值对象
> 3.0.5 新增
### uni.getTopWindowStyle()
获取 topWindow 的样式
> 未发布
**平台差异说明**
|App|H5|微信小程序|支付宝小程序|百度小程序|字节跳动小程序|QQ小程序|
|:-:|:-:|:-:|:-:|:-:|:-:|:-:|
|x|√|x|x|x|x|x|
**代码示例**
```
javascript
uni
.
getTopWindowStyle
()
```
### uni.getLeftWindowStyle()
获取 leftWindow 的样式
> 未发布
**平台差异说明**
...
...
@@ -10,6 +33,36 @@
|:-:|:-:|:-:|:-:|:-:|:-:|:-:|
|x|√|x|x|x|x|x|
**代码示例**
```
javascript
uni
.
getLeftWindowStyle
()
```
### uni.getRightWindowStyle()
获取 rightWindow 的样式
> 未发布
**平台差异说明**
|App|H5|微信小程序|支付宝小程序|百度小程序|字节跳动小程序|QQ小程序|
|:-:|:-:|:-:|:-:|:-:|:-:|:-:|
|x|√|x|x|x|x|x|
**代码示例**
```
javascript
uni
.
getRightWindowStyle
()
```
### uni.setTopWindowStyle(OBJECT)
设置 topWindow 的样式
> 3.0.5 新增
**OBJECT 参数说明**
|参数|类型|说明|
...
...
@@ -52,7 +105,6 @@ uni.setLeftWindowStyle({
})
```
### uni.setRightWindowStyle(OBJECT)
设置 rightWindow 的样式
...
...
@@ -79,3 +131,117 @@ uni.setRightWindowStyle({
backgroundColor
:
'
blue
'
})
```
<!--
## 显示或隐藏窗口的 API
显示或隐藏对应的窗口
### uni.showTopWindow()
显示 topWindow
> 3.0.5 新增
**平台差异说明**
|App|H5|微信小程序|支付宝小程序|百度小程序|字节跳动小程序|QQ小程序|
|:-:|:-:|:-:|:-:|:-:|:-:|:-:|
|x|√|x|x|x|x|x|
**代码示例**
```
javascript
uni
.
showTopWindow
()
```
### uni.showLeftWindow()
显示 leftWindow
> 3.0.5 新增
**平台差异说明**
|App|H5|微信小程序|支付宝小程序|百度小程序|字节跳动小程序|QQ小程序|
|:-:|:-:|:-:|:-:|:-:|:-:|:-:|
|x|√|x|x|x|x|x|
**代码示例**
```
javascript
uni
.
showLeftWindow
()
```
### uni.showRightWindow()
显示 rightWindow
> 3.0.5 新增
**平台差异说明**
|App|H5|微信小程序|支付宝小程序|百度小程序|字节跳动小程序|QQ小程序|
|:-:|:-:|:-:|:-:|:-:|:-:|:-:|
|x|√|x|x|x|x|x|
**代码示例**
```
javascript
uni
.
showRightWindow
()
```
### uni.hideTopWindow()
隐藏 topWindow
> 3.0.5 新增
**平台差异说明**
|App|H5|微信小程序|支付宝小程序|百度小程序|字节跳动小程序|QQ小程序|
|:-:|:-:|:-:|:-:|:-:|:-:|:-:|
|x|√|x|x|x|x|x|
**代码示例**
```
javascript
uni
.
hideTopWindow
()
```
### uni.hideLeftWindow()
隐藏 leftWindow
> 3.0.5 新增
**平台差异说明**
|App|H5|微信小程序|支付宝小程序|百度小程序|字节跳动小程序|QQ小程序|
|:-:|:-:|:-:|:-:|:-:|:-:|:-:|
|x|√|x|x|x|x|x|
**代码示例**
```
javascript
uni
.
hideLeftWindow
()
```
### uni.hideRightWindow()
隐藏 rightWindow
> 3.0.5 新增
**平台差异说明**
|App|H5|微信小程序|支付宝小程序|百度小程序|字节跳动小程序|QQ小程序|
|:-:|:-:|:-:|:-:|:-:|:-:|:-:|
|x|√|x|x|x|x|x|
**代码示例**
```
javascript
uni
.
hideRightWindow
()
```
-->
lib/apis.js
浏览文件 @
31b94843
...
...
@@ -174,6 +174,9 @@ const ui = [
'
hideTopWindow
'
,
'
hideLeftWindow
'
,
'
hideRightWindow
'
,
'
getTopWindowStyle
'
,
'
getLeftWindowStyle
'
,
'
getRightWindowStyle
'
,
'
setTopWindowStyle
'
,
'
setLeftWindowStyle
'
,
'
setRightWindowStyle
'
...
...
packages/uni-app-plus/dist/index.js
浏览文件 @
31b94843
...
...
@@ -231,7 +231,7 @@ const promiseInterceptor = {
};
const
SYNC_API_RE
=
/^
\$
|sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/
;
/^
\$
|
Window$|WindowStyle$|
sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/
;
const
CONTEXT_API_RE
=
/^create|Manager$/
;
...
...
packages/uni-cli-shared/components/unicloud-db.vue
浏览文件 @
31b94843
...
...
@@ -29,7 +29,10 @@ const attrs = [
'
field
'
,
'
getcount
'
,
'
orderby
'
,
'
where
'
'
where
'
,
'
groupby
'
,
'
groupField
'
,
'
distinct
'
]
export
default
{
...
...
@@ -96,6 +99,18 @@ export default {
manual
:
{
type
:
Boolean
,
default
:
false
},
groupby
:
{
type
:
String
,
default
:
''
},
groupField
:
{
type
:
String
,
default
:
''
},
distinct
:
{
type
:
[
Boolean
,
String
],
default
:
false
}
},
data
()
{
...
...
@@ -380,6 +395,15 @@ export default {
if
(
this
.
field
)
{
db
=
db
.
field
(
this
.
field
)
}
if
(
this
.
groupby
)
{
db
=
db
.
groupby
(
this
.
groupby
)
}
if
(
this
.
groupField
)
{
db
=
db
.
groupField
(
this
.
groupField
)
}
if
(
this
.
distinct
===
true
)
{
db
=
db
.
distinct
()
}
if
(
this
.
orderby
)
{
db
=
db
.
orderBy
(
this
.
orderby
)
}
...
...
packages/uni-mp-alipay/dist/index.js
浏览文件 @
31b94843
...
...
@@ -232,7 +232,7 @@ const promiseInterceptor = {
};
const
SYNC_API_RE
=
/^
\$
|sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/
;
/^
\$
|
Window$|WindowStyle$|
sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/
;
const
CONTEXT_API_RE
=
/^create|Manager$/
;
...
...
@@ -1549,25 +1549,9 @@ function initBehaviors (vueOptions, initBehavior) {
}
});
}
if
(
isPlainObject
(
vueExtends
)
&&
vueExtends
.
props
)
{
behaviors
.
push
(
initBehavior
({
properties
:
initProperties
(
vueExtends
.
props
,
true
)
})
);
}
if
(
Array
.
isArray
(
vueMixins
))
{
vueMixins
.
forEach
(
vueMixin
=>
{
if
(
isPlainObject
(
vueMixin
)
&&
vueMixin
.
props
)
{
behaviors
.
push
(
initBehavior
({
properties
:
initProperties
(
vueMixin
.
props
,
true
)
})
);
}
});
{
// alipay 重复定义props会报错,下边的代码对于其他平台也没有意义,保险起见,仅对alipay做处理
return
}
return
behaviors
}
function
parsePropType
(
key
,
type
,
defaultValue
,
file
)
{
...
...
@@ -2100,20 +2084,6 @@ function initRefs () {
}
function
initBehavior
({
properties
})
{
const
props
=
{};
Object
.
keys
(
properties
).
forEach
(
key
=>
{
props
[
key
]
=
properties
[
key
].
value
;
});
return
{
props
}
}
function
initRelation
(
detail
)
{
this
.
props
.
onVueInit
(
detail
);
}
...
...
@@ -2424,7 +2394,7 @@ function parsePage (vuePageOptions) {
const
[
VueComponent
,
vueOptions
]
=
initVueComponent
(
Vue
,
vuePageOptions
);
const
pageOptions
=
{
mixins
:
initBehaviors
(
vueOptions
,
initBehavior
),
mixins
:
initBehaviors
(
vueOptions
),
data
:
initData
(
vueOptions
,
Vue
.
prototype
),
onLoad
(
query
)
{
const
properties
=
this
.
props
;
...
...
@@ -2562,7 +2532,7 @@ function parseComponent (vueComponentOptions) {
});
const
componentOptions
=
{
mixins
:
initBehaviors
(
vueOptions
,
initBehavior
),
mixins
:
initBehaviors
(
vueOptions
),
data
:
initData
(
vueOptions
,
Vue
.
prototype
),
props
,
didMount
()
{
...
...
packages/uni-mp-baidu/dist/index.js
浏览文件 @
31b94843
...
...
@@ -232,7 +232,7 @@ const promiseInterceptor = {
};
const
SYNC_API_RE
=
/^
\$
|sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/
;
/^
\$
|
Window$|WindowStyle$|
sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/
;
const
CONTEXT_API_RE
=
/^create|Manager$/
;
...
...
packages/uni-mp-kuaishou/dist/index.js
浏览文件 @
31b94843
...
...
@@ -232,7 +232,7 @@ const promiseInterceptor = {
};
const
SYNC_API_RE
=
/^
\$
|sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/
;
/^
\$
|
Window$|WindowStyle$|
sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/
;
const
CONTEXT_API_RE
=
/^create|Manager$/
;
...
...
packages/uni-mp-qq/dist/index.js
浏览文件 @
31b94843
...
...
@@ -232,7 +232,7 @@ const promiseInterceptor = {
};
const
SYNC_API_RE
=
/^
\$
|sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/
;
/^
\$
|
Window$|WindowStyle$|
sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/
;
const
CONTEXT_API_RE
=
/^create|Manager$/
;
...
...
packages/uni-mp-toutiao/dist/index.js
浏览文件 @
31b94843
...
...
@@ -232,7 +232,7 @@ const promiseInterceptor = {
};
const
SYNC_API_RE
=
/^
\$
|sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/
;
/^
\$
|
Window$|WindowStyle$|
sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/
;
const
CONTEXT_API_RE
=
/^create|Manager$/
;
...
...
packages/uni-mp-weixin/dist/index.js
浏览文件 @
31b94843
...
...
@@ -232,7 +232,7 @@ const promiseInterceptor = {
};
const
SYNC_API_RE
=
/^
\$
|sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/
;
/^
\$
|
Window$|WindowStyle$|
sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/
;
const
CONTEXT_API_RE
=
/^create|Manager$/
;
...
...
packages/uni-quickapp-native/dist/vue.dev.js
浏览文件 @
31b94843
此差异已折叠。
点击以展开。
packages/uni-quickapp-native/dist/vue.prod.js
浏览文件 @
31b94843
此差异已折叠。
点击以展开。
packages/uni-quickapp-webview/dist/index.js
浏览文件 @
31b94843
...
...
@@ -231,7 +231,7 @@ const promiseInterceptor = {
};
const
SYNC_API_RE
=
/^
\$
|sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/
;
/^
\$
|
Window$|WindowStyle$|
sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/
;
const
CONTEXT_API_RE
=
/^create|Manager$/
;
...
...
src/core/helpers/promise.js
浏览文件 @
31b94843
...
...
@@ -8,7 +8,7 @@ import {
}
from
'
./interceptor
'
const
SYNC_API_RE
=
/^
\$
|sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/
/^
\$
|
Window$|WindowStyle$|
sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/
const
CONTEXT_API_RE
=
/^create|Manager$/
...
...
src/core/runtime/wrapper/util.js
浏览文件 @
31b94843
...
...
@@ -177,6 +177,9 @@ export function initBehaviors (vueOptions, initBehavior) {
}
})
}
if
(
__PLATFORM__
===
'
mp-alipay
'
)
{
// alipay 重复定义props会报错,下边的代码对于其他平台也没有意义,保险起见,仅对alipay做处理
return
}
if
(
isPlainObject
(
vueExtends
)
&&
vueExtends
.
props
)
{
behaviors
.
push
(
initBehavior
({
...
...
@@ -569,4 +572,4 @@ export function handleEvent (event) {
)
{
return
ret
[
0
]
}
}
}
src/platforms/h5/components/app/layout.vue
浏览文件 @
31b94843
...
...
@@ -274,6 +274,13 @@ export default {
}
}
},
getWindowStyle
(
type
)
{
if
(
!
this
[
type
+
'
Window
'
])
{
return
type
+
'
Window not found
'
}
const
style
=
Object
.
assign
({},
this
[
type
+
'
WindowStyle
'
])
return
style
},
setWindowStyle
(
type
,
style
)
{
if
(
!
this
[
type
+
'
Window
'
])
{
return
type
+
'
Window not found
'
...
...
src/platforms/h5/service/api/ui/windows.js
浏览文件 @
31b94843
...
...
@@ -42,6 +42,33 @@ export function hideRightWindow () {
return
showWindow
(
'
right
'
,
false
)
}
function
getWindowStyle
(
type
)
{
const
api
=
'
get
'
+
capitalize
(
type
)
+
'
WindowStyle
'
const
app
=
getApp
()
if
(
!
app
)
{
return
{
errMsg
:
`
${
api
}
:fail app not ready`
}
}
const
msg
=
app
.
$children
[
0
].
$refs
.
layout
.
getWindowStyle
(
type
)
if
(
typeof
msg
===
'
string
'
&&
msg
.
indexOf
(
'
Window not found
'
)
!==
-
1
)
{
return
{
errMsg
:
`
${
api
}
:fail
${
msg
}
`
}
}
return
msg
}
export
function
getTopWindowStyle
(
style
)
{
return
getWindowStyle
(
'
top
'
)
}
export
function
getLeftWindowStyle
(
style
)
{
return
getWindowStyle
(
'
left
'
)
}
export
function
getRightWindowStyle
(
style
)
{
return
getWindowStyle
(
'
right
'
)
}
function
setWindowStyle
(
type
,
style
)
{
const
api
=
'
set
'
+
capitalize
(
type
)
+
'
WindowStyle
'
const
app
=
getApp
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录