feat: 优化代码

This commit is contained in:
hackrobot
2024-03-19 21:27:20 +08:00
parent 448db40b87
commit f2f8056544
3 changed files with 2 additions and 60 deletions

View File

@@ -15,12 +15,12 @@ const TabbarCom = (props) => {
{ title: "我的", iconType: "user" }, //, text: "100", max: 99 { title: "我的", iconType: "user" }, //, text: "100", max: 99
]} ]}
onClick={(current) => { onClick={(current) => {
setActive(current) setActive(current);
if (current === 0) { if (current === 0) {
Taro.redirectTo({ Taro.redirectTo({
url: "/pages/index/index", url: "/pages/index/index",
}); });
}else{ } else {
Taro.redirectTo({ Taro.redirectTo({
url: "/pages/my/index", url: "/pages/my/index",
}); });

View File

@@ -144,29 +144,6 @@ export default function Index() {
<AtAvatar circle image={touxiang}></AtAvatar> <AtAvatar circle image={touxiang}></AtAvatar>
{/* color="#F00" */} {/* color="#F00" */}
<AtIcon value="chevron-down" size="30"></AtIcon> <AtIcon value="chevron-down" size="30"></AtIcon>
{/* <AtButton
type="primary"
onClick={() => {
Taro.request({
url: " http://172.19.0.1:8082/test", //仅为示例,并非真实的接口地址
method: "POST",
data: {
openid: "111",
wxid: "22",
},
header: {
"content-type": "application/json", // 默认值
},
success: function (res) {
console.log(res.data);
},
});
}}
>
发起请求
</AtButton> */}
</View> </View>
{/* 省份标签 */} {/* 省份标签 */}
@@ -182,23 +159,6 @@ export default function Index() {
<View className="tabbbarDiv"></View> <View className="tabbbarDiv"></View>
</View> </View>
{/* 底部tabbar */} {/* 底部tabbar */}
{/* <View className="tabbbar">
<AtTabBar
tabList={[
{ title: "首页", iconType: "home" }, //, text: "new"
// { title: "活动", iconType: "camera" },
{ title: "我的", iconType: "user" }, //, text: "100", max: 99
]}
onClick={(current)=>{
if (current !== 0) {
Taro.redirectTo({
url: "/pages/my/index",
});
}
}}
current={0}
/>
</View> */}
<TabbarCom active={0} /> <TabbarCom active={0} />
</View> </View>

View File

@@ -69,24 +69,6 @@ const my = () => {
</View> </View>
{/* 底部tabbar */} {/* 底部tabbar */}
{/* <View className="tabbbar">
<AtTabBar
tabList={[
{ title: "首页", iconType: "home" }, //, text: "new"
// { title: "活动", iconType: "camera" },
{ title: "我的", iconType: "user" }, //, text: "100", max: 99
]}
onClick={(current) => {
console.log("current", current);
if (current !== 1) {
Taro.redirectTo({
url: "/pages/index/index",
});
}
}}
current={1}
/>
</View> */}
<TabbarCom active={1} /> <TabbarCom active={1} />
</View> </View>
); );