feat: 设置tabbar

This commit is contained in:
hackrobot
2024-03-19 14:28:06 +08:00
parent ac8dec875e
commit 17271424ca
2 changed files with 22 additions and 2 deletions

View File

@@ -1,9 +1,10 @@
import { View, Text, Image } from "@tarojs/components"; import { View, Text, Image } from "@tarojs/components";
import { useLoad } from "@tarojs/taro"; import { useLoad } from "@tarojs/taro";
import { AtAvatar, AtTag, AtIcon } from "taro-ui"; import { AtAvatar, AtTag, AtIcon, AtTabBar } from "taro-ui";
import "./index.scss"; import "./index.scss";
import beijing from "@/images/city/beijing.jpg"; import beijing from "@/images/city/beijing.jpg";
import { VIEW } from "@tarojs/runtime";
// import beijing from "../../images/city/beijing.jpg"; // import beijing from "../../images/city/beijing.jpg";
export default function Index() { export default function Index() {
@@ -18,7 +19,8 @@ export default function Index() {
<View className="homeCard"> <View className="homeCard">
{/* 城市封面图片 */} {/* 城市封面图片 */}
<Image <Image
style="width: 100%;height: 100%;background: #fff;" // style="width: 100%;height: 100%;background: #fff;"
style={{ width: "100%", height: "100%", background: " #fff",borderRadius: "10px" }}
mode="scaleToFill" mode="scaleToFill"
src={beijing} src={beijing}
/> />
@@ -62,6 +64,18 @@ export default function Index() {
<View className="homeCards"> <View className="homeCards">
<HomeCardItem /> <HomeCardItem />
</View> </View>
<View className="tabbbar">
<AtTabBar
tabList={[
{ title: "首页", iconType: "bullet-list" }, //, text: "new"
{ title: "活动", iconType: "camera" },
{ title: "我的", iconType: "folder" }, //, text: "100", max: 99
]}
// onClick={this.handleClick.bind(this)}
// current={this.state.current}
/>
</View>
</View> </View>
); );
} }

View File

@@ -37,4 +37,10 @@
} }
} }
} }
.tabbbar{
position: fixed;
bottom: 0px;
width: 100%;
}
} }