Commit 4f755758 by Zhang Xin

修复开关门

parent 116fea35
...@@ -178,7 +178,6 @@ class PageContainer extends React.Component { ...@@ -178,7 +178,6 @@ class PageContainer extends React.Component {
getSocketMsg(data){ getSocketMsg(data){
let {dispatch,state} = this.props; let {dispatch,state} = this.props;
let {isSend , area} = this.state; let {isSend , area} = this.state;
data.isSend = isSend;
switch (data.type){ switch (data.type){
case 'SUCCESS_OPENDOOR': case 'SUCCESS_OPENDOOR':
//执行开门 //执行开门
...@@ -205,14 +204,16 @@ class PageContainer extends React.Component { ...@@ -205,14 +204,16 @@ class PageContainer extends React.Component {
break; break;
case 'SUCCESS_CLOSEDOOR': case 'SUCCESS_CLOSEDOOR':
if(isSend){ if(isSend){
let {info={}} = data;
let {left_tread=0,right_tread=0} = info;
if(area==="A"){ if(area==="A"){
if(data.info.left_tread === 1){ if(left_tread === 1){
this.handleCloseDoor() this.handleCloseDoor()
}else{ }else{
sendMsg(JSON.stringify({type:'WILL_CLOSEDOOR'})) sendMsg(JSON.stringify({type:'WILL_CLOSEDOOR'}))
} }
}else if(area==="B"){ }else if(area==="B"){
if(data.info.right_tread === 1){ if(right_tread === 1){
this.handleCloseDoor() this.handleCloseDoor()
}else{ }else{
sendMsg(JSON.stringify({type:'WILL_CLOSEDOOR'})) sendMsg(JSON.stringify({type:'WILL_CLOSEDOOR'}))
......
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