Commit da722d12 by zeven

优化即拿迷你店屏幕唤醒时间

parent f7b12965
...@@ -180,11 +180,12 @@ class FacePage extends Component { ...@@ -180,11 +180,12 @@ class FacePage extends Component {
doorOpen = ({action, sense}) => { doorOpen = ({action, sense}) => {
this.action = action; this.action = action;
this.sense = sense; if (!this.sense && sense) this.sense = sense;
if (action === '进店') this.action = 'leave'; if (action === '进店') this.action = 'leave';
else if (action === '出店') this.action = 'enter'; else if (action === '出店') this.action = 'enter';
this.loading(false); this.loading(false);
this.wakeUp(); // 即拿迷你店,唤醒屏幕时间为1分钟
this.sense ? this.wakeUp(60000) : this.wakeUp();
if (this.sense && this.action === 'enter') this.face(); if (this.sense && this.action === 'enter') this.face();
}; };
...@@ -494,12 +495,12 @@ class FacePage extends Component { ...@@ -494,12 +495,12 @@ class FacePage extends Component {
} }
}; };
wakeUp = () => { wakeUp = (timeout = 18888) => {
this.setState({sleep: false, tipsModal: false, goTipsModal: false}); this.setState({sleep: false, tipsModal: false, goTipsModal: false});
clearTimeout(this.wakeUpTimeout); clearTimeout(this.wakeUpTimeout);
this.wakeUpTimeout = setTimeout(() => { this.wakeUpTimeout = setTimeout(() => {
this.setState({sleep: true, tipsModal: false, goTipsModal: false}); this.setState({sleep: true, tipsModal: false, goTipsModal: false});
}, 18888); }, timeout);
}; };
goTips = async () => { goTips = async () => {
......
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