Commit 73295886 by Zhang Xin

完成需求168

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