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,51 +215,46 @@ class PageContainer extends React.Component { ...@@ -214,51 +215,46 @@ 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){
//关门成功
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'}))
}
}
} }
break; 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));
this.setState({
showPage : showPage[initPage],
showClock : false,
popupInfo : defaultPopupInfo,
successCloseDoor : true,
isSend:false
});
}
componentDidMount(){ componentDidMount(){
// this.beginCountBack() // this.beginCountBack()
let {dispatch} = this.props; let {dispatch} = 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