巴林闲侠
3 years ago
7 changed files with 94 additions and 54 deletions
@ -1,14 +1,35 @@ |
|||||
import React from 'react' |
import React, { useEffect, useState } from 'react' |
||||
import Left from './left' |
import Left from './left' |
||||
import Right from './right' |
import Right from './right' |
||||
|
import { connect } from 'react-redux' |
||||
|
import { getdaolutongji } from '../../../actions/example' |
||||
|
|
||||
const Conserve = () => { |
|
||||
|
const Conserve = (props) => { |
||||
|
|
||||
|
const [roadData, setRoadData] = useState() |
||||
|
const [loading, setLoading] = useState(true) |
||||
|
const { dispatch } = props |
||||
|
useEffect(() => { |
||||
|
dispatch(getdaolutongji()).then(res => { |
||||
|
setLoading(false) |
||||
|
setRoadData(res.payload.data || {}) |
||||
|
}) |
||||
|
}, []) |
||||
|
|
||||
return ( |
return ( |
||||
<div style={{ display: 'flex', width: '100%', height: '100%', justifyContent: 'space-between' }}> |
<div style={{ display: 'flex', width: '100%', height: '100%', justifyContent: 'space-between' }}> |
||||
<Left /> |
<Left roadData={roadData} loading={loading} /> |
||||
<Right /> |
<Right roadData={roadData} loading={loading} /> |
||||
</div> |
</div> |
||||
) |
) |
||||
} |
} |
||||
export default Conserve |
function mapStateToProps(state) { |
||||
|
|
||||
|
// const { auth } = state;
|
||||
|
|
||||
|
return { |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
export default connect(mapStateToProps)(Conserve) |
Loading…
Reference in new issue