feat: 优化代码
This commit is contained in:
@@ -15,12 +15,12 @@ const TabbarCom = (props) => {
|
||||
{ title: "我的", iconType: "user" }, //, text: "100", max: 99
|
||||
]}
|
||||
onClick={(current) => {
|
||||
setActive(current)
|
||||
setActive(current);
|
||||
if (current === 0) {
|
||||
Taro.redirectTo({
|
||||
url: "/pages/index/index",
|
||||
});
|
||||
}else{
|
||||
} else {
|
||||
Taro.redirectTo({
|
||||
url: "/pages/my/index",
|
||||
});
|
||||
|
||||
@@ -144,29 +144,6 @@ export default function Index() {
|
||||
<AtAvatar circle image={touxiang}></AtAvatar>
|
||||
{/* color="#F00" */}
|
||||
<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>
|
||||
|
||||
{/* 省份标签 */}
|
||||
@@ -182,23 +159,6 @@ export default function Index() {
|
||||
<View className="tabbbarDiv"></View>
|
||||
</View>
|
||||
{/* 底部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} />
|
||||
</View>
|
||||
|
||||
@@ -69,24 +69,6 @@ const my = () => {
|
||||
</View>
|
||||
|
||||
{/* 底部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} />
|
||||
</View>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user