李志伟 3 anni fa
parent
commit
f15c548683

+ 1
- 6
src/pages/index/components/User/index.jsx Vedi File

@@ -40,10 +40,6 @@ export default (props) => {
40 40
   const goBank = () => {
41 41
     Taro.navigateTo({ url: '/pages/bankCard/index' });
42 42
   }
43
-  const signOut = () => {
44
-    setPhone()
45
-    Taro.reLaunch({ url: '/pages/login/index' });
46
-  }
47 43
   return (
48 44
     <ScrollView scrollY style={{ height: '100%' }}>
49 45
       <View className='personTip'>该账号归{person.nickName||'张三'}所属</View>
@@ -52,7 +48,7 @@ export default (props) => {
52 48
         <View className='headcontent' >
53 49
           <Image src={person.avatar||avatar} className='avatar' />
54 50
           <View>
55
-            <View>{person.nickName||'张三'}</View>
51
+            <View>{person.nickName||''}</View>
56 52
             <View>{person.phone}</View>
57 53
           </View>
58 54
         </View>
@@ -93,7 +89,6 @@ export default (props) => {
93 89
         <View className='userBox'>
94 90
           <MyCell icon={feedback} action={goto} user handleAction={handleFeedback}>意见反馈</MyCell>
95 91
         </View>
96
-        <View className='signOut' onClick={signOut}>退出登录</View>
97 92
       </View>
98 93
     </ScrollView>
99 94
   )

+ 0
- 12
src/pages/index/components/User/style.less Vedi File

@@ -45,18 +45,6 @@
45 45
     box-shadow: 0px 2px 0px 0px rgba(0, 0, 0, 0.12);
46 46
     padding: 20px 35px;
47 47
   }
48
-  .signOut{
49
-    width: 100%;
50
-    height: 98px;
51
-    background: #F8F8F8;
52
-    border-radius: 49px;
53
-    font-size: 40px;
54
-    text-align: center;
55
-    line-height: 98px;
56
-    font-weight: bold;
57
-    color: #333333;
58
-    margin: 60px 0;
59
-  }
60 48
 }
61 49
 .userCard{
62 50
   display: flex;

+ 4
- 0
src/pages/index/index.jsx Vedi File

@@ -17,6 +17,7 @@ import User from "./components/User";
17 17
 import "./index.less";
18 18
 
19 19
 export default withLayout((props) => {
20
+  const {person}=useModel('person')
20 21
   const { router } = props
21 22
   let { tab } = router.params
22 23
   const { location,setLocation } = useModel('location')
@@ -35,6 +36,9 @@ export default withLayout((props) => {
35 36
     } else {
36 37
       setAmap({params:'location='+location,path: '/v3/geocode/regeo'})
37 38
     }
39
+    if (currentTab!==0&& person.phone) {
40
+      Taro.reLaunch({ url: '/pages/login/index' });
41
+    }
38 42
     if (tab) {      
39 43
       setCurrentTab(tab - 0)
40 44
     }