Commit 116fea35 by Zhang Xin

修复开关门

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