Commit 73295886 by Zhang Xin

完成需求168

parent 5659a5fc
......@@ -79,7 +79,8 @@ class PageContainer extends React.Component {
showClassify : false, //显示右侧菜单栏,默认不显示,目前没用
isSend:false,
area:'',//区域
maxTime : 300
maxTime : 300,
showAlarm : false // 是否已报警,已报警为true,未报警为false
};
this.getPages = this.getPages.bind(this); //获取当前页面
this.showPopup = this.showPopup.bind(this); //显示弹窗
......@@ -213,7 +214,7 @@ class PageContainer extends React.Component {
},()=>{
//开门开始倒计时
this.countBackTime = maxTime;
// this.beginCountBack()
this.beginCountBack()
});
break;
case 'SUCCESS_CLOSEDOOR':
......@@ -383,11 +384,19 @@ class PageContainer extends React.Component {
//开始倒计时,看有没有操作,只是在整个开门过程中才监听
beginCountBack(){
this.countBackTime = this.maxCountBackTime;
if(this.countbackTimer){
clearTimeout(this.countbackTimer);
this.countbackTimer = null;
}
if(!this.countbackTimer){
this.setState({
showAlarm : false
},()=>{
this.countBackTime = this.state.maxTime;
this.countBack.bind(this)();
})
}
}
endCountBack(){
......@@ -406,6 +415,7 @@ class PageContainer extends React.Component {
}
countBack(){
console.log("countBackTime ",this.countBackTime);
if(!this.countbackTimer && this.countBackTime >= 0){
this.countBackTime--;
this.countbackTimer = window.setTimeout(()=>{
......@@ -467,6 +477,15 @@ class PageContainer extends React.Component {
//TODO 上报300s无人操作
this.uploadErrs(errorType[1]);
this.setState({
showAlarm : true,
popupInfo : defaultPopupInfo
},()=>{
this.playAlarmMusic()
})
/*
let btnWidth = UTILPATH.getRemByPx(260);
let btnMarginLeft = UTILPATH.getRemByPx(30);
let btnBorderRadius = UTILPATH.getRemByPx(10);
......@@ -487,6 +506,8 @@ class PageContainer extends React.Component {
this.playAlarmMusic()
})
*/
}
//关门
......@@ -872,6 +893,13 @@ class PageContainer extends React.Component {
handleTouch(){
this.countBackTime = this.state.maxTime;
if(this.state.showAlarm){
this.setState({
showAlarm : false
},()=>{
this.beginCountBack();
})
}
}
render() {
......
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