Commit 1e7f4b7b authored by Sky's avatar Sky

本地图片压缩,添加定时启动亮屏方法

parent 737cb018
......@@ -14,7 +14,7 @@
<!--训练切出end-->
<!--准备开始-->
<div class="start" if="page == '0'">
<text class="start-text">{{title}}
<text class="start-text">准备开始
</text>
</div>
<!--准备开始end-->
......
......@@ -2,11 +2,11 @@ import sensor from '@system.sensor'; //传感器
import vibrator from '@system.vibrator'; //震动
import brightness from '@system.brightness' //保持屏幕常亮
//import {P2pClient, Message, Builder} from '../wearengine'
var timer;
export default {
data: {
page: "", //显示页面
title: "准备开始", //页面标题
acName: "", //动作名称
progress: "", //进度条
acType: "", //次/秒 (0:次,1:秒)
......@@ -31,7 +31,7 @@ export default {
isJumpLoginPage: true, //是否跳转到未登录提示页
dataPageShow: false, //训练数据页面是否显示
canReceiveMessage: true, //是否可以接收手机端其他事件(手表端主动暂停或训练结束后,不再接收除17外的其他事件)
installText: "请在手机上下载\nFit App",
installText: "",
},
onReady() {
let _this = this;
......@@ -53,8 +53,12 @@ export default {
},1500);
},
onShow() {
let _this = this;
//保持屏幕常亮
this.keepScreenOn();
timer = setInterval(function () {
_this.keepScreenOn();
},4 * 60 * 1000);
},
onDestroy() {
//发送页面销毁时间
......@@ -121,7 +125,6 @@ export default {
switch (msg.eventFlg) {
case "0": //训练准备
_this.page = "0";
_this.title = "准备开始";
break;
case "1": //训练准备后的倒计时
_this.page = "1";
......@@ -251,6 +254,7 @@ export default {
// //对端应用未安装,提示安装
// _this.isJumpLoginPage = false;
// _this.page = "999";
// _this.installText = "请在手机上下载\nFit App";
// }
// console.log(resultCode.data + resultCode.code);
// },
......@@ -490,6 +494,9 @@ export default {
this.stopFlg = false;
this.heartRateList = [];
sensor.unsubscribeHeartRate() //取消监听心率
if (timer != null) {
clearInterval(timer);
}
}
,
......
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