Commit bbeac87c by wujiabao

关门

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