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;
|
justify-content: center;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
bottom: 0rpx;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,6 @@
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
bottom: 0px;
|
// bottom: 0px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
import { Button } from "@antmjs/vantui";
|
import { Button } from "@antmjs/vantui";
|
||||||
import { RichText, View } from "@tarojs/components";
|
import { RichText, View } from "@tarojs/components";
|
||||||
|
import Taro from "@tarojs/taro";
|
||||||
import react, { useEffect, useState } from "react";
|
import react, { useEffect, useState } from "react";
|
||||||
import { getTable } from "../../../../utils/index";
|
import { getTable } from "../../../../utils/index";
|
||||||
import "./index.scss";
|
import "./index.scss";
|
||||||
|
|
||||||
const details = () => {
|
const details = () => {
|
||||||
const [dataSource, setdataSource] = useState<any>([]);
|
const [dataSource, setdataSource] = useState<any>([]);
|
||||||
|
const [bottomheight,setbottomheight]=useState(0)
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// 设置标题
|
// 设置标题
|
||||||
@@ -15,6 +17,11 @@ const details = () => {
|
|||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
const {screenHeight,safeArea={}}=Taro.getSystemInfoSync()
|
||||||
|
// @ts-ignore
|
||||||
|
let newBottom=screenHeight -safeArea?.bottom??0
|
||||||
|
setbottomheight(newBottom)
|
||||||
|
|
||||||
let objParams = {
|
let objParams = {
|
||||||
tableName: "cityNew",
|
tableName: "cityNew",
|
||||||
id: "80516fb66370bcf300b8f43c5f4dd52b",
|
id: "80516fb66370bcf300b8f43c5f4dd52b",
|
||||||
@@ -27,6 +34,8 @@ const details = () => {
|
|||||||
getTable(objParams);
|
getTable(objParams);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
// console.log('SafeAreaResult',Taro.getSystemInfoSync())
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View className={`detailContent`}>
|
<View className={`detailContent`}>
|
||||||
{/* 富文本 */}
|
{/* 富文本 */}
|
||||||
@@ -35,7 +44,7 @@ const details = () => {
|
|||||||
<RichText nodes={dataSource?.[0]?.richText} />
|
<RichText nodes={dataSource?.[0]?.richText} />
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
<View className={`detailBtn`}>
|
<View className={`detailBtn`} style={{bottom:`${bottomheight??0}px`}}>
|
||||||
{/* style={{width:'375px'}} */}
|
{/* style={{width:'375px'}} */}
|
||||||
<Button type="primary" block>
|
<Button type="primary" block>
|
||||||
立即参加
|
立即参加
|
||||||
|
|||||||
Reference in New Issue
Block a user