feat: ios安全区域
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -20,5 +20,4 @@ taro-button-core{position:relative;display:block;margin-left:auto;margin-right:a
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
position: fixed;
|
||||
bottom: 0rpx;
|
||||
}
|
||||
|
||||
@@ -8,6 +8,6 @@
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
position: fixed;
|
||||
bottom: 0px;
|
||||
// bottom: 0px;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
import { Button } from "@antmjs/vantui";
|
||||
import { RichText, View } from "@tarojs/components";
|
||||
import Taro from "@tarojs/taro";
|
||||
import react, { useEffect, useState } from "react";
|
||||
import { getTable } from "../../../../utils/index";
|
||||
import "./index.scss";
|
||||
|
||||
const details = () => {
|
||||
const [dataSource, setdataSource] = useState<any>([]);
|
||||
const [bottomheight,setbottomheight]=useState(0)
|
||||
|
||||
useEffect(() => {
|
||||
// 设置标题
|
||||
@@ -15,6 +17,11 @@ const details = () => {
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
const {screenHeight,safeArea={}}=Taro.getSystemInfoSync()
|
||||
// @ts-ignore
|
||||
let newBottom=screenHeight -safeArea?.bottom??0
|
||||
setbottomheight(newBottom)
|
||||
|
||||
let objParams = {
|
||||
tableName: "cityNew",
|
||||
id: "80516fb66370bcf300b8f43c5f4dd52b",
|
||||
@@ -27,6 +34,8 @@ const details = () => {
|
||||
getTable(objParams);
|
||||
}, []);
|
||||
|
||||
// console.log('SafeAreaResult',Taro.getSystemInfoSync())
|
||||
|
||||
return (
|
||||
<View className={`detailContent`}>
|
||||
{/* 富文本 */}
|
||||
@@ -35,7 +44,7 @@ const details = () => {
|
||||
<RichText nodes={dataSource?.[0]?.richText} />
|
||||
</View>
|
||||
|
||||
<View className={`detailBtn`}>
|
||||
<View className={`detailBtn`} style={{bottom:`${bottomheight??0}px`}}>
|
||||
{/* style={{width:'375px'}} */}
|
||||
<Button type="primary" block>
|
||||
立即参加
|
||||
|
||||
Reference in New Issue
Block a user