|
@@ -1,4 +1,5 @@
|
1
|
1
|
import { useState,useEffect } from "react"
|
|
2
|
+import { useModel } from '@/store'
|
2
|
3
|
import Taro from "@tarojs/taro"
|
3
|
4
|
import { View, Image, ScrollView } from "@tarojs/components"
|
4
|
5
|
import userBgi from '@/assets/user/userBgi.png'
|
|
@@ -16,7 +17,8 @@ import banner1 from '@/assets/banner/1.jpg'
|
16
|
17
|
import './style.less'
|
17
|
18
|
|
18
|
19
|
export default (props) => {
|
19
|
|
- const { isLogin } = props
|
|
20
|
+ const { phone,setPhone } = useModel('phone')
|
|
21
|
+
|
20
|
22
|
const handleAccount = () => {
|
21
|
23
|
Taro.navigateTo({ url: '/pages/userInfo/index' });
|
22
|
24
|
}
|
|
@@ -42,28 +44,29 @@ export default (props) => {
|
42
|
44
|
Taro.navigateTo({ url: '/pages/bankCard/index' });
|
43
|
45
|
}
|
44
|
46
|
const signOut = () => {
|
|
47
|
+ setPhone()
|
45
|
48
|
Taro.reLaunch({ url: '/pages/index/index?tab=2' });
|
46
|
49
|
}
|
47
|
50
|
return (
|
48
|
51
|
<ScrollView scrollY style={{ height: '100%' }}>
|
49
|
52
|
{
|
50
|
|
- isLogin &&
|
|
53
|
+ phone &&
|
51
|
54
|
<View className='personTip'>该账号归张三所属</View>
|
52
|
55
|
}
|
53
|
56
|
<View className='userHead'>
|
54
|
57
|
<Image src={userBgi} className='userBgi' />
|
55
|
|
- <View className='headcontent' onClick={handleLogin}>
|
56
|
|
- <Image src={isLogin ? banner1 : avatar} className='avatar' />
|
|
58
|
+ <View className='headcontent' onClick={phone?'':handleLogin}>
|
|
59
|
+ <Image src={phone ? banner1 : avatar} className='avatar' />
|
57
|
60
|
{
|
58
|
|
- isLogin ? <View>
|
|
61
|
+ phone ? <View>
|
59
|
62
|
<View>张三</View>
|
60
|
|
- <View>13612345678</View>
|
|
63
|
+ <View>{phone}</View>
|
61
|
64
|
</View> : <View>点击登录</View>
|
62
|
65
|
}
|
63
|
66
|
</View>
|
64
|
67
|
</View>
|
65
|
68
|
{
|
66
|
|
- isLogin &&
|
|
69
|
+ phone &&
|
67
|
70
|
<View className='userCard'>
|
68
|
71
|
<View
|
69
|
72
|
className='cardItem'
|
|
@@ -103,7 +106,7 @@ export default (props) => {
|
103
|
106
|
<MyCell icon={feedback} action={goto} user handleAction={handleFeedback}>意见反馈</MyCell>
|
104
|
107
|
</View>
|
105
|
108
|
{
|
106
|
|
- isLogin && <View className='signOut' onClick={signOut}>退出登录</View>
|
|
109
|
+ phone && <View className='signOut' onClick={signOut}>退出登录</View>
|
107
|
110
|
}
|
108
|
111
|
</View>
|
109
|
112
|
|