Commit 79c7247b authored by Sky's avatar Sky

onshow时同步数据及状态

parent 9f2e686d
...@@ -62,14 +62,18 @@ export default { ...@@ -62,14 +62,18 @@ export default {
timer = setInterval(function () { timer = setInterval(function () {
_this.keepScreenOn(); _this.keepScreenOn();
},2 * 60 * 1000); },2 * 60 * 1000);
//重新回到训练界面时,同步一下训练数据及暂停播放状态
_this.sendMsg({
"eventFlg": "8",
});
}, },
onHide() { onHide() {
this.stopFlg = true; this.stopFlg = true;
this.tabIndex = 1; this.tabIndex = 1;
//消息发送时,手机端可能无法接受消息,所以在onShow时,需要重新同步
this.sendMsg({ this.sendMsg({
"eventFlg": "3", "eventFlg": "3",
}) })
console.log('index page onHide()');
}, },
onDestroy() { onDestroy() {
//发送页面销毁时间 //发送页面销毁时间
...@@ -238,6 +242,7 @@ export default { ...@@ -238,6 +242,7 @@ export default {
case "14": //训练总时长 case "14": //训练总时长
_this.acCalorie = model.acCalorie ? model.acCalorie : '--'; _this.acCalorie = model.acCalorie ? model.acCalorie : '--';
_this.fitDuration = model.fitDuration; _this.fitDuration = model.fitDuration;
_this.stopFlg = model.stopFlag; //同步状态
break; break;
case "15": //离开或者返回训练 case "15": //离开或者返回训练
if (model.rollbackStop == '0') { if (model.rollbackStop == '0') {
......
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