feat: 轮播图配置

This commit is contained in:
huxiaoshuang
2022-11-22 17:49:20 +08:00
parent 29a5ddbeae
commit f09e20e55e
2 changed files with 21 additions and 4 deletions

File diff suppressed because one or more lines are too long

View File

@@ -57,16 +57,33 @@ const Home = () => {
}); });
getdetails() //获取活动详情
getsystemConfig() //获取系统配置
}, []);
const getdetails=()=>{
let objParams = { let objParams = {
tableName: "details", tableName: "details",
// id: "80516fb66370bcf300b8f43c5f4dd52b", // id: "80516fb66370bcf300b8f43c5f4dd52b",
okFun: (res) => { okFun: (res:any) => {
console.log("details--", res); console.log("details--", res);
setdetails(res?.data??[]) setdetails(res?.data??[])
}, },
}; };
getTable(objParams); getTable(objParams);
}, []); }
const getsystemConfig=()=>{
let objParams = {
tableName: "systemConfig",
// id: "80516fb66370bcf300b8f43c5f4dd52b",
okFun: (res:any) => {
console.log("systemConfig--", res);
setsystemConfig(res?.data??[])
},
};
getTable(objParams);
}
const uploadTaro = (tempFilePaths: any) => { const uploadTaro = (tempFilePaths: any) => {
// 云开发存储文件 [/自动创建文件路径] // 云开发存储文件 [/自动创建文件路径]
@@ -229,7 +246,7 @@ const Home = () => {
paginationVisible paginationVisible
onChange={onChange} onChange={onChange}
> >
{(systemConfig?.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>