-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Layout): Layout 组件支持 iphoneX 页面显示, 并且增加上拉刷新支持
- Loading branch information
1 parent
7fd313e
commit b7db916
Showing
14 changed files
with
322 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
import React from 'react' | ||
import { Layout } from 'auto-ui' | ||
|
||
class Test extends React.Component { | ||
constructor(props) { | ||
super(props) | ||
this.state = { | ||
disable: false | ||
} | ||
} | ||
render() { | ||
return ( | ||
<Layout> | ||
<Layout.Header>header</Layout.Header> | ||
|
||
<Layout.Body | ||
onReachBottom={{ | ||
handler: () => { | ||
return new Promise(resolve => { | ||
setTimeout(() => { | ||
resolve() | ||
}, 2000) | ||
}) | ||
} | ||
}} | ||
> | ||
iPhoneX | ||
取消了物理按键,改成底部小黑条,这一改动导致网页出现了比较尴尬的屏幕适配问题。对于网页而言,顶部(刘海部位)的适配问题浏览器已经做了处理,所以我们只需要关注底部与小黑条的适配问题即可(即常见的吸底导航、返回顶部等各种相对底部 | ||
fixed 定位的元素)。iPhoneX | ||
取消了物理按键,改成底部小黑条,这一改动导致网页出现了比较尴尬的屏幕适配问题。对于网页而言,顶部(刘海部位)的适配问题浏览器已经做了处理,所以我们只需要关注底部与小黑条的适配问题即可(即常见的吸底导航、返回顶部等各种相对底部 | ||
fixed 定位的元素)。iPhoneX | ||
取消了物理按键,改成底部小黑条,这一改动导致网页出现了比较尴尬的屏幕适配问题。对于网页而言,顶部(刘海部位)的适配问题浏览器已经做了处理,所以我们只需要关注底部与小黑条的适配问题即可(即常见的吸底导航、返回顶部等各种相对底部 | ||
fixed 定位的元素)。iPhoneX | ||
取消了物理按键,改成底部小黑条,这一改动导致网页出现了比较尴尬的屏幕适配问题。对于网页而言,顶部(刘海部位)的适配问题浏览器已经做了处理,所以我们只需要关注底部与小黑条的适配问题即可(即常见的吸底导航、返回顶部等各种相对底部 | ||
fixed 定位的元素)。iPhoneX | ||
取消了物理按键,改成底部小黑条,这一改动导致网页出现了比较尴尬的屏幕适配问题。对于网页而言,顶部(刘海部位)的适配问题浏览器已经做了处理,所以我们只需要关注底部与小黑条的适配问题即可(即常见的吸底导航、返回顶部等各种相对底部 | ||
fixed 定位的元素)。iPhoneX | ||
取消了物理按键,改成底部小黑条,这一改动导致网页出现了比较尴尬的屏幕适配问题。对于网页而言,顶部(刘海部位)的适配问题浏览器已经做了处理,所以我们只需要关注底部与小黑条的适配问题即可(即常见的吸底导航、返回顶部等各种相对底部 | ||
fixed 定位的元素)。iPhoneX | ||
取消了物理按键,改成底部小黑条,这一改动导致网页出现了比较尴尬的屏幕适配问题。对于网页而言,顶部(刘海部位)的适配问题浏览器已经做了处理,所以我们只需要关注底部与小黑条的适配问题即可(即常见的吸底导航、返回顶部等各种相对底部 | ||
fixed 定位的元素)。iPhoneX | ||
取消了物理按键,改成底部小黑条,这一改动导致网页出现了比较尴尬的屏幕适配问题。对于网页而言,顶部(刘海部位)的适配问题浏览器已经做了处理,所以我们只需要关注底部与小黑条的适配问题即可(即常见的吸底导航、返回顶部等各种相对底部 | ||
fixed 定位的元素)。iPhoneX | ||
取消了物理按键,改成底部小黑条,这一改动导致网页出现了比较尴尬的屏幕适配问题。对于网页而言,顶部(刘海部位)的适配问题浏览器已经做了处理,所以我们只需要关注底部与小黑条的适配问题即可(即常见的吸底导航、返回顶部等各种相对底部 | ||
fixed 定位的元素)。iPhoneX | ||
取消了物理按键,改成底部小黑条,这一改动导致网页出现了比较尴尬的屏幕适配问题。对于网页而言,顶部(刘海部位)的适配问题浏览器已经做了处理,所以我们只需要关注底部与小黑条的适配问题即可(即常见的吸底导航、返回顶部等各种相对底部 | ||
fixed 定位的元素)。iPhoneX | ||
取消了物理按键,改成底部小黑条,这一改动导致网页出现了比较尴尬的屏幕适配问题。对于网页而言,顶部(刘海部位)的适配问题浏览器已经做了处理,所以我们只需要关注底部与小黑条的适配问题即可(即常见的吸底导航、返回顶部等各种相对底部 | ||
fixed 定位的元素)。iPhoneX | ||
取消了物理按键,改成底部小黑条,这一改动导致网页出现了比较尴尬的屏幕适配问题。对于网页而言,顶部(刘海部位)的适配问题浏览器已经做了处理,所以我们只需要关注底部与小黑条的适配问题即可(即常见的吸底导航、返回顶部等各种相对底部 | ||
fixed 定位的元素)。iPhoneX | ||
取消了物理按键,改成底部小黑条,这一改动导致网页出现了比较尴尬的屏幕适配问题。对于网页而言,顶部(刘海部位)的适配问题浏览器已经做了处理,所以我们只需要关注底部与小黑条的适配问题即可(即常见的吸底导航、返回顶部等各种相对底部 | ||
fixed 定位的元素)。iPhoneX | ||
取消了物理按键,改成底部小黑条,这一改动导致网页出现了比较尴尬的屏幕适配问题。对于网页而言,顶部(刘海部位)的适配问题浏览器已经做了处理,所以我们只需要关注底部与小黑条的适配问题即可(即常见的吸底导航、返回顶部等各种相对底部 | ||
fixed 定位的元素)。iPhoneX | ||
取消了物理按键,改成底部小黑条,这一改动导致网页出现了比较尴尬的屏幕适配问题。对于网页而言,顶部(刘海部位)的适配问题浏览器已经做了处理,所以我们只需要关注底部与小黑条的适配问题即可(即常见的吸底导航、返回顶部等各种相对底部 | ||
fixed 定位的元素)。iPhoneX | ||
取消了物理按键,改成底部小黑条,这一改动导致网页出现了比较尴尬的屏幕适配问题。对于网页而言,顶部(刘海部位)的适配问题浏览器已经做了处理,所以我们只需要关注底部与小黑条的适配问题即可(即常见的吸底导航、返回顶部等各种相对底部 | ||
fixed 定位的元素)。iPhoneX | ||
取消了物理按键,改成底部小黑条,这一改动导致网页出现了比较尴尬的屏幕适配问题。对于网页而言,顶部(刘海部位)的适配问题浏览器已经做了处理,所以我们只需要关注底部与小黑条的适配问题即可(即常见的吸底导航、返回顶部等各种相对底部 | ||
fixed 定位的元素)。iPhoneX | ||
取消了物理按键,改成底部小黑条,这一改动导致网页出现了比较尴尬的屏幕适配问题。对于网页而言,顶部(刘海部位)的适配问题浏览器已经做了处理,所以我们只需要关注底部与小黑条的适配问题即可(即常见的吸底导航、返回顶部等各种相对底部 | ||
</Layout.Body> | ||
|
||
<Layout.Footer>footer</Layout.Footer> | ||
</Layout> | ||
) | ||
} | ||
} | ||
|
||
export default Test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
const Regular = { | ||
u: navigator.userAgent, | ||
|
||
isAndroid() { | ||
return this.u.indexOf('Android') > -1 || this.u.indexOf('Adr') > -1 | ||
}, | ||
|
||
isiOS() { | ||
return !!this.u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/) | ||
}, | ||
|
||
isAtzuche() { | ||
return this.u.indexOf('atzuche') > -1 | ||
}, | ||
|
||
isiPhoneX() { | ||
return this.u.indexOf('iphonex') > -1 | ||
} | ||
} | ||
|
||
export default Regular |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import './style' | ||
import React from 'react' | ||
import cn from 'classnames' | ||
|
||
const IphoneXHeader = props => { | ||
const { className } = props | ||
const composeClassName = cn('iphonex-footer', className) | ||
|
||
return <div className={composeClassName} /> | ||
} | ||
|
||
export default IphoneXHeader |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.iphonex-footer { | ||
width: 100%; | ||
height: constant(safe-area-inset-bottom); | ||
height: env(safe-area-inset-bottom); | ||
background-color: #fff; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import './style' | ||
import React from 'react' | ||
import cn from 'classnames' | ||
import reg from '../__libs/reg' | ||
|
||
const IphoneXHeader = props => { | ||
const { className } = props | ||
const composeClassName = cn(className, { | ||
isAtzucheiOSNotiPhoneX: reg.isAtzuche() && reg.isiOS() && !reg.isiPhoneX(), | ||
'iphonex-header': reg.isAtzuche() && reg.isiPhoneX() | ||
}) | ||
|
||
return <div className={composeClassName} /> | ||
} | ||
|
||
export default IphoneXHeader |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.iphonex-header { | ||
background-color: #fff; | ||
width: 100%; | ||
height: 70px; | ||
} | ||
.isAtzucheiOSNotiPhoneX { | ||
background-color: #fff; | ||
width: 100%; | ||
height: 40px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.