Commit bbeac87c by wujiabao

关门

parent 0ae81e68
...@@ -27,6 +27,7 @@ export default class ChooseTaskContainer extends React.Component{ ...@@ -27,6 +27,7 @@ export default class ChooseTaskContainer extends React.Component{
this.props.willCloseDoor(); this.props.willCloseDoor();
let msg={type:'WILL_CLOSEDOOR'} let msg={type:'WILL_CLOSEDOOR'}
sendMsg(JSON.stringify(msg)) sendMsg(JSON.stringify(msg))
this.props.changeIsSend(true)
} }
showLogoutPopup(){ showLogoutPopup(){
......
...@@ -74,7 +74,9 @@ class PageContainer extends React.Component { ...@@ -74,7 +74,9 @@ class PageContainer extends React.Component {
headerInfo : {}, headerInfo : {},
pageStyle : {}, pageStyle : {},
successCloseDoor : false, successCloseDoor : false,
showClassify : false //显示右侧菜单栏,默认不显示,目前没用 showClassify : false, //显示右侧菜单栏,默认不显示,目前没用
isSend:false
}; };
this.getPages = this.getPages.bind(this); //获取当前页面 this.getPages = this.getPages.bind(this); //获取当前页面
this.showPopup = this.showPopup.bind(this); //显示弹窗 this.showPopup = this.showPopup.bind(this); //显示弹窗
...@@ -165,9 +167,16 @@ class PageContainer extends React.Component { ...@@ -165,9 +167,16 @@ class PageContainer extends React.Component {
let {dispatch} = this.props; let {dispatch} = this.props;
dispatch(logout()); dispatch(logout());
} }
//判断是否向服务端发起请求
changeIsSend(bool){
this.setState({
isSend:bool
})
}
getSocketMsg(data){ getSocketMsg(data){
let {dispatch,state} = this.props; let {dispatch,state} = this.props;
let {isSend} = this.state;
switch (data.type){ switch (data.type){
case 'SUCCESS_OPENDOOR': case 'SUCCESS_OPENDOOR':
//执行开门 //执行开门
...@@ -195,18 +204,21 @@ class PageContainer extends React.Component { ...@@ -195,18 +204,21 @@ class PageContainer extends React.Component {
break; break;
case 'SUCCESS_CLOSEDOOR': case 'SUCCESS_CLOSEDOOR':
//关门成功 //关门成功
console.log("closedoor"); if(isSend){
dispatch(logout()); console.log("closedoor");
// this.endCountBack(); dispatch(logout());
// remove(CONFIG.socketType.GETSTOREINFO,this) // this.endCountBack();
// remove(CONFIG.socketType.GETSOCKETMSG,this) // remove(CONFIG.socketType.GETSTOREINFO,this)
dispatch(closeDoorSuccess(state.commonInfo)) // remove(CONFIG.socketType.GETSOCKETMSG,this)
this.setState({ dispatch(closeDoorSuccess(state.commonInfo))
showPage : showPage[initPage], this.setState({
showClock : false, showPage : showPage[initPage],
popupInfo : defaultPopupInfo, showClock : false,
successCloseDoor : true popupInfo : defaultPopupInfo,
}); successCloseDoor : true,
isSend:false
});
}
break; break;
} }
} }
...@@ -676,6 +688,7 @@ class PageContainer extends React.Component { ...@@ -676,6 +688,7 @@ class PageContainer extends React.Component {
hidePopup={()=>this.hidePopup()} hidePopup={()=>this.hidePopup()}
// tempLogout={()=>this.tempLogout.bind(this)()} // tempLogout={()=>this.tempLogout.bind(this)()}
willCloseDoor={()=>{dispatch(willCloseDoor(commonInfo))}} willCloseDoor={()=>{dispatch(willCloseDoor(commonInfo))}}
changeIsSend ={this.changeIsSend.bind(this)}
/>; />;
break; break;
/*以下是二期页面 start*/ /*以下是二期页面 start*/
......
...@@ -42,6 +42,7 @@ export default class TroubleContainer extends React.Component{ ...@@ -42,6 +42,7 @@ export default class TroubleContainer extends React.Component{
this.setStyle = this.setStyle.bind(this); this.setStyle = this.setStyle.bind(this);
this.onSlideChangeEnd = this.onSlideChangeEnd.bind(this); this.onSlideChangeEnd = this.onSlideChangeEnd.bind(this);
this.abandonSaveText = this.abandonSaveText.bind(this); this.abandonSaveText = this.abandonSaveText.bind(this);
this.changeIsSend =this.changeIsSend.bind(this);
} }
...@@ -93,6 +94,9 @@ export default class TroubleContainer extends React.Component{ ...@@ -93,6 +94,9 @@ export default class TroubleContainer extends React.Component{
// this.updateImg(refreshImg); // this.updateImg(refreshImg);
// } // }
} }
updateImg(info){ updateImg(info){
let {emptyImg} = this.props; let {emptyImg} = this.props;
......
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