Commit e720367d by Zhang Xin

fix 关门逻辑 方便测试

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