Commit 183e350f by zhanghaozhe

Merge branch '11-11' into dev

parents c1fa1bf5 1213ac7e
...@@ -45,6 +45,10 @@ function ClosablePopup({ ...@@ -45,6 +45,10 @@ function ClosablePopup({
ReactDOM.render(closablePopup, div) ReactDOM.render(closablePopup, div)
return {
close: _close
}
} }
export default ClosablePopup export default ClosablePopup
...@@ -131,7 +131,7 @@ class Live extends Component { ...@@ -131,7 +131,7 @@ class Live extends Component {
<div key={index}> <div key={index}>
{ {
preheatLives.map((item, index) => { preheatLives.map((item, index) => {
return <LiveContent key={index} item={item} makeSubscribe={this.makeSubscribe}/> return <LiveContent key={index} item={item} makeSubscribe={this.makeSubscribe} toLiveRoom={this.toLiveRoom}/>
}) })
} }
</div> </div>
...@@ -147,7 +147,7 @@ class Live extends Component { ...@@ -147,7 +147,7 @@ class Live extends Component {
} }
} }
function LiveContent({item, makeSubscribe}) { function LiveContent({item, makeSubscribe, toLiveRoom}) {
return ( return (
<div className="content"> <div className="content">
{ {
...@@ -181,7 +181,7 @@ function LiveContent({item, makeSubscribe}) { ...@@ -181,7 +181,7 @@ function LiveContent({item, makeSubscribe}) {
</div> </div>
{ {
item['on_live'] item['on_live']
? <button className={'on-living'} onClick={this.toLiveRoom.bind(this, item['live_id'])}>正在直播</button> ? <button className={'on-living'} onClick={() => {toLiveRoom(item['live_id'])}}>正在直播</button>
: :
item['is_end'] item['is_end']
? <button className={'subscribed'}>已结束</button> ? <button className={'subscribed'}>已结束</button>
......
...@@ -11,6 +11,7 @@ import './index.scss' ...@@ -11,6 +11,7 @@ import './index.scss'
} }
)) ))
class BlessingRank extends Component { class BlessingRank extends Component {
popupInstance = null
constructor(props) { constructor(props) {
super(props) super(props)
this.state = { this.state = {
...@@ -44,10 +45,15 @@ class BlessingRank extends Component { ...@@ -44,10 +45,15 @@ class BlessingRank extends Component {
if (bool && !uid) { if (bool && !uid) {
history.push('/passport') history.push('/passport')
} else { } else {
Popup({ if (bool && !this.popupInstance) {
title: '收货信息', this.popupInstance = Popup({
content: <AddressPopup handleToHide={() => this.handleToSwitch(false)}/> title: '收货信息',
}) content: <AddressPopup handleToHide={() => this.handleToSwitch(false)}/>
})
} else {
this.popupInstance.close()
this.popupInstance = null
}
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment