feat: 离我最近/天气/-信息流

This commit is contained in:
huxiaoshuang
2022-11-22 18:59:53 +08:00
parent fda468d7a9
commit dc1a0e579b
4 changed files with 45 additions and 35 deletions

View File

@@ -1,12 +1,19 @@
import { Button, Checkbox, Form, FormItem, Icon, Image } from "@antmjs/vantui";
import { Input, View, Text } from "@tarojs/components";
import react from "react";
import react, { useEffect } from "react";
import "./index.scss";
const Certified = () => {
const formIt = Form.useForm();
const [state, setState] = react.useState({});
const [value, setValue] = react.useState(true);
useEffect(()=>{
// 设置标题
definePageConfig({
navigationBarTitleText: "认证",
});
},[])
return (
<View className="Certified">
<Form

View File

@@ -33,11 +33,11 @@ const Home = () => {
const [show, setShow] = react.useState(false);
const [value, setValue] = react.useState("");
const [SearchValue, setSearchValue] = useState<any>('');
const [SearchValue, setSearchValue] = useState<any>("");
const [details,setdetails]=useState<any>([]) //活动详情
const [details, setdetails] = useState<any>([]); //活动详情
// 系统配置
const [systemConfig,setsystemConfig]=useState<any>({})
const [systemConfig, setsystemConfig] = useState<any>({});
const onChange = (e) => {};
@@ -56,34 +56,33 @@ const Home = () => {
success() {},
});
getdetails() //获取活动详情
getsystemConfig() //获取系统配置
getdetails(); //获取活动详情
getsystemConfig(); //获取系统配置
}, []);
const getdetails=()=>{
const getdetails = () => {
let objParams = {
tableName: "details",
// id: "80516fb66370bcf300b8f43c5f4dd52b",
okFun: (res:any) => {
okFun: (res: any) => {
console.log("details--", res);
setdetails(res?.data??[])
setdetails(res?.data ?? []);
},
};
getTable(objParams);
}
};
const getsystemConfig=()=>{
const getsystemConfig = () => {
let objParams = {
tableName: "systemConfig",
// id: "80516fb66370bcf300b8f43c5f4dd52b",
okFun: (res:any) => {
okFun: (res: any) => {
console.log("systemConfig--", res);
setsystemConfig(res?.data??[])
setsystemConfig(res?.data ?? []);
},
};
getTable(objParams);
}
};
const uploadTaro = (tempFilePaths: any) => {
// 云开发存储文件 [/自动创建文件路径]
@@ -126,7 +125,7 @@ const Home = () => {
};
// 获取地理位置
const getLocation = async() => {
const getLocation = async () => {
// 获取地理位置
Taro.getLocation({
type: "wgs84",
@@ -203,11 +202,13 @@ const Home = () => {
</View>
{/* 通知条 */}
{ !systemConfig?.[0]?.notice?.isHidden && <NoticeBar
leftIcon="volume-o"
// text="疫情期间,请留意各个景区的开放状态以及时间"
text={systemConfig?.[0]?.notice?.text}
/>}
{!systemConfig?.[0]?.notice?.isHidden && (
<NoticeBar
leftIcon="volume-o"
// text="疫情期间,请留意各个景区的开放状态以及时间"
text={systemConfig?.[0]?.notice?.text}
/>
)}
{/* 顶部 */}
{/* <View>
<Row>
@@ -247,7 +248,7 @@ const Home = () => {
paginationVisible
onChange={onChange}
>
{(systemConfig?.[0]?.imagesArr??[]).map((item:any, index:any) => (
{(systemConfig?.[0]?.imagesArr ?? []).map((item: any, index: any) => (
<SwiperItem key={`swiper#demo1${index}`}>
<Image src={item?.url} fit="cover" width="100%" height="200px" />
</SwiperItem>
@@ -319,8 +320,19 @@ const Home = () => {
<Divider />
</View> */}
<View>
<Tag plain={true} type="success">
(5km)
</Tag>
<View>
<View>{`天气晴雨[动画效果]`}</View>
<View></View>
<View></View>
</View>
</View>
{/* 截取数组2个活动 */}
{details.splice(0, 2).map((item: any,index:any) => {
{details.splice(0, 2).map((item: any, index: any) => {
return (
<View
onClick={() => {
@@ -336,16 +348,7 @@ const Home = () => {
);
})}
{/* <Tabbar
active={active}
safeAreaInsetBottom={false}
>
<TabbarItem icon="home-o">首页</TabbarItem>
<TabbarItem icon="friends-o">活动</TabbarItem>
<TabbarItem icon="setting-o">我的</TabbarItem>
</Tabbar> */}
<View> </View>
<Toast id="vanToast-demo2" />