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,6 +204,7 @@ class PageContainer extends React.Component { ...@@ -195,6 +204,7 @@ class PageContainer extends React.Component {
break; break;
case 'SUCCESS_CLOSEDOOR': case 'SUCCESS_CLOSEDOOR':
//关门成功 //关门成功
if(isSend){
console.log("closedoor"); console.log("closedoor");
dispatch(logout()); dispatch(logout());
// this.endCountBack(); // this.endCountBack();
...@@ -205,8 +215,10 @@ class PageContainer extends React.Component { ...@@ -205,8 +215,10 @@ class PageContainer extends React.Component {
showPage : showPage[initPage], showPage : showPage[initPage],
showClock : false, showClock : false,
popupInfo : defaultPopupInfo, popupInfo : defaultPopupInfo,
successCloseDoor : true 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);
} }
...@@ -94,6 +95,9 @@ export default class TroubleContainer extends React.Component{ ...@@ -94,6 +95,9 @@ export default class TroubleContainer extends React.Component{
// } // }
} }
updateImg(info){ updateImg(info){
let {emptyImg} = this.props; let {emptyImg} = this.props;
let id = info.errorId; let id = info.errorId;
......
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