|
@@ -37,12 +37,8 @@ export default withLayout((props) => {
|
37
|
37
|
|
38
|
38
|
|
39
|
39
|
console.log("🚀 ~ file: index.jsx ~ line 24 ~ withLayout ~ tab", tab)
|
40
|
|
-
|
41
|
40
|
const [currentTab, setCurrentTab] = useState(0)
|
42
|
|
-
|
43
|
41
|
const [isDidShow, setIsDidShow] = useState(0)
|
44
|
|
-
|
45
|
|
-
|
46
|
42
|
const [tabsIndex, setTabsIndex] = useState(0)
|
47
|
43
|
|
48
|
44
|
|
|
@@ -51,44 +47,33 @@ export default withLayout((props) => {
|
51
|
47
|
|
52
|
48
|
|
53
|
49
|
useDidShow(() => {
|
54
|
|
- setIsDidShow(isDidShow + 1)
|
|
50
|
+ console.log('useDidShow',);
|
|
51
|
+
|
55
|
52
|
if (!person?.phone) {
|
56
|
53
|
console.log('还是未登录',);
|
57
|
54
|
setCurrentTab(0)
|
58
|
|
-
|
59
|
|
-
|
60
|
|
- } else {
|
61
|
|
- setCurrentTab(tabsIndex)
|
62
|
|
- // handleTabChange(tabsIndex)
|
63
|
|
-
|
64
|
|
- console.log('已登陆',);
|
65
|
|
-
|
66
|
55
|
}
|
67
|
56
|
})
|
68
|
57
|
|
69
|
58
|
useEffect(() => {
|
|
59
|
+ // setCurrentTab(index)
|
|
60
|
+
|
70
|
61
|
if (tab) {
|
71
|
62
|
setCurrentTab(tab - 0)
|
72
|
|
-
|
73
|
|
-
|
74
|
63
|
}
|
75
|
64
|
// setIsShow(true)
|
76
|
65
|
}, [tab,])
|
77
|
66
|
|
78
|
|
-
|
79
|
67
|
const handleClick = (index) => {
|
80
|
68
|
// Taro.switchTab({
|
81
|
69
|
// url: '/pages/InformationPage/index'
|
82
|
70
|
// })
|
83
|
|
-
|
84
|
|
-
|
85
|
71
|
if (!person?.phone) {
|
86
|
|
- setTabsIndex(index)
|
87
|
|
- Taro.navigateTo({ url: `/pages/LoginPage/index?login=true` })
|
|
72
|
+ Taro.navigateTo({ url: `/pages/LoginPage/index?login=true&tab=${index}` })
|
88
|
73
|
// setIsShow(true)
|
89
|
74
|
} else {
|
90
|
|
- setCurrentTab(index)
|
91
|
|
-
|
|
75
|
+ Taro.redirectTo({ url: `/pages/index/index?tab=${index}` });
|
|
76
|
+ // setCurrentTab(index)
|
92
|
77
|
}
|
93
|
78
|
}
|
94
|
79
|
|
|
@@ -106,7 +91,7 @@ export default withLayout((props) => {
|
106
|
91
|
{currentTab === 1 && <Orders router={router} />}
|
107
|
92
|
{currentTab === 2 && <Information router={router} />}
|
108
|
93
|
|
109
|
|
- {currentTab === 3 && <Mine isDidShow={isDidShow} router={router} />}
|
|
94
|
+ {currentTab === 3 && <Mine router={router} />}
|
110
|
95
|
</view>
|
111
|
96
|
<view className='index-tabbar'>
|
112
|
97
|
<View
|