Commit 116fea35 by Zhang Xin

修复开关门

parent 6cca1416
...@@ -24,25 +24,23 @@ export default class ChooseTaskContainer extends React.Component{ ...@@ -24,25 +24,23 @@ export default class ChooseTaskContainer extends React.Component{
} }
logout(){ logout(){
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) // this.props.changeIsSend(true)
} }
showLogoutPopup(){ showLogoutPopup(){
let {showPopup,hidePopup} = this.props; let {showPopup,hidePopup} = this.props;
let btnDom1 = <Button btnContainer={"headerLogoutBtn backff775c colfff font32 font32 "} key={"headerLogoutBtn1"} text={"确定退出?"} option={this.logout}/>
let btnDom2 = <Button btnContainer={"headerLogoutBtn btne5 font32"} key={"headerLogoutBtn2"} text={"取消"} option={hidePopup}/> let btnDom2 = <Button btnContainer={"headerLogoutBtn btne5 font32"} key={"headerLogoutBtn2"} text={"取消"} option={hidePopup}/>
let popDom = let popDom =
<PopModel popupTitle={"是否退出登录"} classContainer={"headerLogout"}> <PopModel popupTitle={"是否退出登录"} classContainer={"headerLogout"}>
<div className={"icon iconfont icon-exclamation font150 colf5a623"} /> <div className={"icon iconfont icon-exclamation font150 colf5a623"} />
<div className={"text font40 col000"} style={{lineHeight:'1.6'}}> <div className={"text font40 col000"} style={{lineHeight:'1.6'}}>
<p>此步临时添加,可用作测试退出登录</p> <p>请重新打开应用</p>
<p>重新扫码开门,不必重启服务</p>
</div> </div>
<div className={"btn"}> <div className={"btn"}>
{btnDom1}
{btnDom2} {btnDom2}
</div> </div>
</PopModel>; </PopModel>;
......
...@@ -41,6 +41,7 @@ export default class HomePageContainer extends React.Component{ ...@@ -41,6 +41,7 @@ export default class HomePageContainer 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)
this.props.tempLogout() this.props.tempLogout()
} }
......
...@@ -205,7 +205,19 @@ class PageContainer extends React.Component { ...@@ -205,7 +205,19 @@ class PageContainer extends React.Component {
break; break;
case 'SUCCESS_CLOSEDOOR': case 'SUCCESS_CLOSEDOOR':
if(isSend){ if(isSend){
// this.handleCloseDoor() 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'}))
}
}
} }
break; break;
...@@ -587,6 +599,9 @@ class PageContainer extends React.Component { ...@@ -587,6 +599,9 @@ class PageContainer extends React.Component {
case 'PF' : case 'PF' :
this.changePages(CONFIG.showPage[14]); this.changePages(CONFIG.showPage[14]);
break; break;
case 'ER' :
this.changePages(CONFIG.showPage[12]);
break;
} }
}else{ }else{
this.changePages(CONFIG.showPage[13]); this.changePages(CONFIG.showPage[13]);
...@@ -683,9 +698,8 @@ class PageContainer extends React.Component { ...@@ -683,9 +698,8 @@ class PageContainer extends React.Component {
showOpenDoorPage={()=>this.showOpenDoorPage.bind(this)()} showOpenDoorPage={()=>this.showOpenDoorPage.bind(this)()}
showPopup={(info)=>this.showPopup(info)} showPopup={(info)=>this.showPopup(info)}
hidePopup={()=>this.hidePopup()} hidePopup={()=>this.hidePopup()}
tempLogout={()=>this.tempLogout.bind(this)()}
willCloseDoor={()=>{dispatch(willCloseDoor(commonInfo))}} willCloseDoor={()=>{dispatch(willCloseDoor(commonInfo))}}
changeIsSend ={this.changeIsSend.bind(this)}
/>; />;
break; break;
/*以下是二期页面 start*/ /*以下是二期页面 start*/
...@@ -706,6 +720,7 @@ class PageContainer extends React.Component { ...@@ -706,6 +720,7 @@ class PageContainer extends React.Component {
willCloseDoor={()=>{dispatch(willCloseDoor(commonInfo))}} willCloseDoor={()=>{dispatch(willCloseDoor(commonInfo))}}
closeDoor={true} closeDoor={true}
tempLogout={()=>this.tempLogout.bind(this)()} tempLogout={()=>this.tempLogout.bind(this)()}
changeIsSend ={this.changeIsSend.bind(this)}
/>; />;
break; break;
case showPage[12]: case showPage[12]:
......
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