|
@@ -17,22 +17,23 @@ const index = (props) => {
|
17
|
17
|
const { houseId ,orderId} = router.params
|
18
|
18
|
const user = useSelector(state => state.user)
|
19
|
19
|
|
|
20
|
+ console.log(user)
|
|
21
|
+
|
20
|
22
|
const dispatch = useDispatch()
|
21
|
23
|
|
22
|
|
- const [userRole, setUserRole] = useState('1')
|
23
|
|
- const [pageState, SetPageState] = useState('1')
|
24
|
|
- const [list, setList] = useState([])
|
|
24
|
+ // const [userRole, setUserRole] = useState('1')
|
|
25
|
+ // const [pageState, SetPageState] = useState('1')
|
|
26
|
+ // const [list, setList] = useState([])
|
25
|
27
|
const [visible, setVisible] = useState(false)
|
26
|
28
|
|
27
|
29
|
useEffect(() => {
|
28
|
|
- console.log(user,houseId, 'indexuser')
|
29
|
30
|
if (user.personId && !user.phone) {
|
30
|
31
|
setVisible(true)
|
31
|
32
|
}
|
32
|
33
|
if (user.personId && user.phone) {
|
33
|
34
|
setVisible(false)
|
34
|
35
|
}
|
35
|
|
- }, [user.phone])
|
|
36
|
+ }, [user.phone, user.personId])
|
36
|
37
|
|
37
|
38
|
|
38
|
39
|
const onOk = (res) => {
|
|
@@ -44,14 +45,13 @@ const index = (props) => {
|
44
|
45
|
const onCancel = (e) => {
|
45
|
46
|
setVisible(false)
|
46
|
47
|
}
|
47
|
|
- console.log(user.role == roleList.landlord, 'indexuser')
|
48
|
48
|
|
49
|
49
|
return <View className='index'>
|
50
|
50
|
|
51
|
51
|
{user.personId && <View>
|
52
|
|
- {visible && <GetPhone visible={true} onOk={onOk} onCancel={onCancel} ></GetPhone>}
|
53
|
|
- {!visible && user.role == roleList.customer && <Customer houseId={houseId} orderId={orderId}></Customer>}
|
54
|
|
- {!visible && user.role == roleList.landlord && <Landlord ></Landlord>}
|
|
52
|
+ <GetPhone visible={visible} onOk={onOk} onCancel={onCancel} ></GetPhone>
|
|
53
|
+ {user.role == roleList.customer && <Customer houseId={houseId} orderId={orderId}></Customer>}
|
|
54
|
+ {user.role == roleList.landlord && <Landlord ></Landlord>}
|
55
|
55
|
</View>}
|
56
|
56
|
|
57
|
57
|
|