feat: 离我最近/天气/-信息流
This commit is contained in:
2
dist/app.js
vendored
2
dist/app.js
vendored
File diff suppressed because one or more lines are too long
2
dist/pages/home/index.js
vendored
2
dist/pages/home/index.js
vendored
File diff suppressed because one or more lines are too long
@@ -1,12 +1,19 @@
|
|||||||
import { Button, Checkbox, Form, FormItem, Icon, Image } from "@antmjs/vantui";
|
import { Button, Checkbox, Form, FormItem, Icon, Image } from "@antmjs/vantui";
|
||||||
import { Input, View, Text } from "@tarojs/components";
|
import { Input, View, Text } from "@tarojs/components";
|
||||||
import react from "react";
|
import react, { useEffect } from "react";
|
||||||
import "./index.scss";
|
import "./index.scss";
|
||||||
|
|
||||||
const Certified = () => {
|
const Certified = () => {
|
||||||
const formIt = Form.useForm();
|
const formIt = Form.useForm();
|
||||||
const [state, setState] = react.useState({});
|
const [state, setState] = react.useState({});
|
||||||
const [value, setValue] = react.useState(true);
|
const [value, setValue] = react.useState(true);
|
||||||
|
|
||||||
|
useEffect(()=>{
|
||||||
|
// 设置标题
|
||||||
|
definePageConfig({
|
||||||
|
navigationBarTitleText: "认证",
|
||||||
|
});
|
||||||
|
},[])
|
||||||
return (
|
return (
|
||||||
<View className="Certified">
|
<View className="Certified">
|
||||||
<Form
|
<Form
|
||||||
|
|||||||
@@ -33,11 +33,11 @@ const Home = () => {
|
|||||||
const [show, setShow] = react.useState(false);
|
const [show, setShow] = react.useState(false);
|
||||||
const [value, setValue] = react.useState("");
|
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) => {};
|
const onChange = (e) => {};
|
||||||
|
|
||||||
@@ -56,34 +56,33 @@ const Home = () => {
|
|||||||
success() {},
|
success() {},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
getdetails(); //获取活动详情
|
||||||
getdetails() //获取活动详情
|
getsystemConfig(); //获取系统配置
|
||||||
getsystemConfig() //获取系统配置
|
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const getdetails=()=>{
|
const getdetails = () => {
|
||||||
let objParams = {
|
let objParams = {
|
||||||
tableName: "details",
|
tableName: "details",
|
||||||
// id: "80516fb66370bcf300b8f43c5f4dd52b",
|
// id: "80516fb66370bcf300b8f43c5f4dd52b",
|
||||||
okFun: (res:any) => {
|
okFun: (res: any) => {
|
||||||
console.log("details--", res);
|
console.log("details--", res);
|
||||||
setdetails(res?.data??[])
|
setdetails(res?.data ?? []);
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
getTable(objParams);
|
getTable(objParams);
|
||||||
}
|
};
|
||||||
|
|
||||||
const getsystemConfig=()=>{
|
const getsystemConfig = () => {
|
||||||
let objParams = {
|
let objParams = {
|
||||||
tableName: "systemConfig",
|
tableName: "systemConfig",
|
||||||
// id: "80516fb66370bcf300b8f43c5f4dd52b",
|
// id: "80516fb66370bcf300b8f43c5f4dd52b",
|
||||||
okFun: (res:any) => {
|
okFun: (res: any) => {
|
||||||
console.log("systemConfig--", res);
|
console.log("systemConfig--", res);
|
||||||
setsystemConfig(res?.data??[])
|
setsystemConfig(res?.data ?? []);
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
getTable(objParams);
|
getTable(objParams);
|
||||||
}
|
};
|
||||||
|
|
||||||
const uploadTaro = (tempFilePaths: any) => {
|
const uploadTaro = (tempFilePaths: any) => {
|
||||||
// 云开发存储文件 [/自动创建文件路径]
|
// 云开发存储文件 [/自动创建文件路径]
|
||||||
@@ -126,7 +125,7 @@ const Home = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// 获取地理位置
|
// 获取地理位置
|
||||||
const getLocation = async() => {
|
const getLocation = async () => {
|
||||||
// 获取地理位置
|
// 获取地理位置
|
||||||
Taro.getLocation({
|
Taro.getLocation({
|
||||||
type: "wgs84",
|
type: "wgs84",
|
||||||
@@ -203,11 +202,13 @@ const Home = () => {
|
|||||||
</View>
|
</View>
|
||||||
|
|
||||||
{/* 通知条 */}
|
{/* 通知条 */}
|
||||||
{ !systemConfig?.[0]?.notice?.isHidden && <NoticeBar
|
{!systemConfig?.[0]?.notice?.isHidden && (
|
||||||
leftIcon="volume-o"
|
<NoticeBar
|
||||||
// text="疫情期间,请留意各个景区的开放状态以及时间"
|
leftIcon="volume-o"
|
||||||
text={systemConfig?.[0]?.notice?.text}
|
// text="疫情期间,请留意各个景区的开放状态以及时间"
|
||||||
/>}
|
text={systemConfig?.[0]?.notice?.text}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
{/* 顶部 */}
|
{/* 顶部 */}
|
||||||
{/* <View>
|
{/* <View>
|
||||||
<Row>
|
<Row>
|
||||||
@@ -247,7 +248,7 @@ const Home = () => {
|
|||||||
paginationVisible
|
paginationVisible
|
||||||
onChange={onChange}
|
onChange={onChange}
|
||||||
>
|
>
|
||||||
{(systemConfig?.[0]?.imagesArr??[]).map((item:any, index:any) => (
|
{(systemConfig?.[0]?.imagesArr ?? []).map((item: any, index: any) => (
|
||||||
<SwiperItem key={`swiper#demo1${index}`}>
|
<SwiperItem key={`swiper#demo1${index}`}>
|
||||||
<Image src={item?.url} fit="cover" width="100%" height="200px" />
|
<Image src={item?.url} fit="cover" width="100%" height="200px" />
|
||||||
</SwiperItem>
|
</SwiperItem>
|
||||||
@@ -319,8 +320,19 @@ const Home = () => {
|
|||||||
<Divider />
|
<Divider />
|
||||||
</View> */}
|
</View> */}
|
||||||
|
|
||||||
|
<View>
|
||||||
|
<Tag plain={true} type="success">
|
||||||
|
离你最近 (5km)
|
||||||
|
</Tag>
|
||||||
|
<View>
|
||||||
|
<View>{`天气晴雨[动画效果]`}</View>
|
||||||
|
<View>温度</View>
|
||||||
|
<View>是否开放</View>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
|
||||||
{/* 截取数组2个活动 */}
|
{/* 截取数组2个活动 */}
|
||||||
{details.splice(0, 2).map((item: any,index:any) => {
|
{details.splice(0, 2).map((item: any, index: any) => {
|
||||||
return (
|
return (
|
||||||
<View
|
<View
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
@@ -336,16 +348,7 @@ const Home = () => {
|
|||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
|
|
||||||
{/* <Tabbar
|
<View> 打开信息流</View>
|
||||||
active={active}
|
|
||||||
safeAreaInsetBottom={false}
|
|
||||||
|
|
||||||
|
|
||||||
>
|
|
||||||
<TabbarItem icon="home-o">首页</TabbarItem>
|
|
||||||
<TabbarItem icon="friends-o">活动</TabbarItem>
|
|
||||||
<TabbarItem icon="setting-o">我的</TabbarItem>
|
|
||||||
</Tabbar> */}
|
|
||||||
|
|
||||||
<Toast id="vanToast-demo2" />
|
<Toast id="vanToast-demo2" />
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user