|
@@ -1,15 +1,25 @@
|
|
|
-import Taro from '@tarojs/taro'
|
|
|
-import { View, Image } from '@tarojs/components'
|
|
|
-import React from 'react'
|
|
|
+import Taro, { useLoad } from '@tarojs/taro'
|
|
|
+import { useState } from 'react'
|
|
|
+import { getTopSafeHeight } from '@/hooks/useGetCustomClient'
|
|
|
+import { View } from '@tarojs/components'
|
|
|
import './index.less'
|
|
|
-import { useDidShow } from '@tarojs/taro'
|
|
|
|
|
|
-const H5: React.FC = () => {
|
|
|
+function CustomPage() {
|
|
|
+ const [isCustom, setIsCustom] = useState(false)
|
|
|
+ useLoad(() => {
|
|
|
+ const spaceHeight = getTopSafeHeight()
|
|
|
+ const { screenHeight, windowHeight } = Taro.getSystemInfoSync()
|
|
|
+ setIsCustom(spaceHeight + windowHeight > screenHeight)
|
|
|
+
|
|
|
+ })
|
|
|
+
|
|
|
return (
|
|
|
<View>
|
|
|
- H5
|
|
|
+ {isCustom && <View>isCustom</View>}
|
|
|
+
|
|
|
+ CustomPage
|
|
|
</View>
|
|
|
)
|
|
|
}
|
|
|
|
|
|
-export default H5
|
|
|
+export default CustomPage
|