Commit e720367d by Zhang Xin

fix 关门逻辑 方便测试

parent 8d07e6b2
......@@ -106,6 +106,7 @@ class PageContainer extends React.Component {
this.toggleOrders = this.toggleOrders.bind(this); //二期显示菜单栏
this.goBackTask = this.goBackTask.bind(this); //二期显示菜单栏
this.showSecondTroubelPage = this.showSecondTroubelPage.bind(this); //根据用户的type判断显示的页面
this.handleCloseDoor = this.handleCloseDoor.bind(this); //监听到关门回调
/*以下是二期方法 end*/
......@@ -214,34 +215,37 @@ class PageContainer extends React.Component {
break;
case 'SUCCESS_CLOSEDOOR':
if(isSend){
if(area==="A"){
if(data.info.left_tread===1){
//关门成功
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
});
}else{
sendMsg(JSON.stringify({type:'WILL_CLOSEDOOR'}))
// if(area==="A"){
// if(data.info.left_tread===1){
// //关门成功
// this.handleCloseDoor()
// }else{
// sendMsg(JSON.stringify({type:'WILL_CLOSEDOOR'}))
// }
// }else if(area==="B"){
// if(data.info.right_tread===1){
// //关门成功
// this.handleCloseDoor()
// }else{
// sendMsg(JSON.stringify({type:'WILL_CLOSEDOOR'}))
// }
// }
this.handleCloseDoor()
}
}else if(area==="B"){
if(data.info.right_tread===1){
//关门成功
break;
}
}
handleCloseDoor(){
let {dispatch,state} = this.props;
console.log("closedoor");
dispatch(logout());
// this.endCountBack();
// remove(CONFIG.socketType.GETSTOREINFO,this)
// remove(CONFIG.socketType.GETSOCKETMSG,this)
dispatch(closeDoorSuccess(state.commonInfo))
dispatch(closeDoorSuccess(state.commonInfo));
this.setState({
showPage : showPage[initPage],
showClock : false,
......@@ -249,14 +253,6 @@ class PageContainer extends React.Component {
successCloseDoor : true,
isSend:false
});
}else{
sendMsg(JSON.stringify({type:'WILL_CLOSEDOOR'}))
}
}
}
break;
}
}
componentDidMount(){
......
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