|
@@ -17,6 +17,8 @@ const index = (props) => {
|
17
|
17
|
const user = useSelector(state => state.user)
|
18
|
18
|
|
19
|
19
|
const [pageState, setPageState] = useState('3')
|
|
20
|
+ const [houseInfo, setHouseInfo] = useState()
|
|
21
|
+ const [surroundList, setSurroundList] = useState()
|
20
|
22
|
|
21
|
23
|
useEffect(() => {
|
22
|
24
|
if(props.orderId){
|
|
@@ -28,26 +30,38 @@ const index = (props) => {
|
28
|
30
|
})
|
29
|
31
|
}
|
30
|
32
|
}, [props.orderId])
|
|
33
|
+
|
|
34
|
+ useEffect(() => {
|
|
35
|
+ if(props.houseId){
|
|
36
|
+ request({url: `/taHouse/${props.houseId}`,}).then(res=>{
|
|
37
|
+ const data = res.data.data
|
|
38
|
+ setHouseInfo(data)
|
|
39
|
+ setPageState('2')
|
|
40
|
+ })
|
|
41
|
+ }
|
|
42
|
+
|
|
43
|
+ request({url:'/taHouseSurround', params:{houseId:houseId}}).then((res)=>{
|
|
44
|
+ const { records } = res.data.data
|
|
45
|
+ setSurroundList(records)
|
|
46
|
+ })
|
|
47
|
+
|
|
48
|
+ }, [props.houseId])
|
31
|
49
|
|
32
|
50
|
return (
|
33
|
51
|
<View className='index'>
|
34
|
|
- {pageState && (
|
35
|
|
- <View>
|
36
|
|
- {pageState=='1'&&<Register oderId={orderId}></Register>}
|
37
|
|
-
|
38
|
|
- <Layout>
|
39
|
|
- {pageState=='2'&&<Guide houseId={houseId}></Guide> }
|
40
|
|
- {pageState=='3'&&<Recommend houseId={houseId}></Recommend> }
|
41
|
|
- </Layout>
|
42
|
|
-
|
43
|
|
- {pageState!='1' && (
|
44
|
|
- <Tab
|
45
|
|
- value={['入住指引','房东推荐']}
|
46
|
|
- pageState={pageState}
|
47
|
|
- onClick={[(e) => setPageState('2'),(e) => setPageState('3')]} />
|
48
|
|
- )}
|
49
|
|
- </View>
|
50
|
|
- )}
|
|
52
|
+ {pageState=='1'&&<Register oderId={orderId}></Register>}
|
|
53
|
+
|
|
54
|
+ <Layout>
|
|
55
|
+ {pageState=='2'&&<Guide houseId={houseId} dataSource={houseInfo}></Guide> }
|
|
56
|
+ {pageState=='3'&&<Recommend houseId={houseId} dataSource={surroundList}></Recommend> }
|
|
57
|
+ </Layout>
|
|
58
|
+
|
|
59
|
+ {!!houseId && (
|
|
60
|
+ <Tab
|
|
61
|
+ value={['入住指引','房东推荐']}
|
|
62
|
+ pageState={pageState}
|
|
63
|
+ onClick={[(e) => setPageState('2'),(e) => setPageState('3')]} />
|
|
64
|
+ )}
|
51
|
65
|
</View>
|
52
|
66
|
)
|
53
|
67
|
|