Skip to content

Commit

Permalink
🎨 修改 src\modules\PROPERTY\containers\details\Contract\ContractDetail.jsx
Browse files Browse the repository at this point in the history
  • Loading branch information
didilinkin committed Sep 22, 2017
1 parent 27bcc9d commit 3424b50
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
6 changes: 4 additions & 2 deletions src/common/containers/Layout/TabsContainers.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ class TabsContainers extends React.Component {
// console.log('activeObj')
// console.dir(activeObj)

this.props.tabsProps.history.push(activeObj.path) // 如果是详情, 只跳转; 内容无更新
this.setActivePane(activeObj) // 修改 redux activePane; 检查是否二次渲染

this.setActivePane(activeObj)
this.props.tabsProps.history.push(activeObj.path) // 如果是详情, 只跳转; 内容无更新
// location.href = activeObj.path // 会导致丢失 redux数据
}

Expand Down Expand Up @@ -140,6 +140,8 @@ class TabsContainers extends React.Component {
}

render () {
console.log('标签渲染')

return (
<div>
<Tabs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,17 @@ class ContractDetail extends React.Component {
ListSublet: contract.data.subletInfoList,
contract: contract.data.contract
})
console.log(contract.data.contract)
console.log(contract.data.subletInfoList)
}
componentWillMount () {
this.initialRemarks()
}


// 新加入 监听 props
componentWillReceiveProps = (nextProps) => {
this.initialRemarks()
}

SubletOpen = (id) => {
if (id > 0) {
this.setState({
Expand Down Expand Up @@ -67,9 +72,10 @@ class ContractDetail extends React.Component {
}
refresh = async () => {
let contract = await apiPost(
'/contract/getcontract',
{'id': this.props.match.params.id,
type: 1}
'/contract/getcontract', {
'id': this.props.match.params.id,
type: 1
}
)
this.setState({
ListSublet: contract.data.subletInfoList,
Expand All @@ -87,6 +93,8 @@ class ContractDetail extends React.Component {
})
}
render () {
console.log('详情页渲染次数')

return (
<div className="contract">
<h2>房源信息</h2>
Expand Down

0 comments on commit 3424b50

Please sign in to comment.