Commit 99b03801 authored by Sky's avatar Sky

bug修改

parent d8691416
......@@ -13,11 +13,18 @@ export default {
averHeartRate: "", //平均心率
maxHeartRate: "", //最高心率
},
onInit() {
p2pClient.setPeerPkgName("com.sportq.fit");
p2pClient.setPeerFingerPrint("B1B788A1BBD5F459BC641DA8CE690EA065C96957F58E883764982B5C46E53E06");
},
onReady() {
let _this = this;
//获取客户端信息
_this.getMsg();
},
onShow() {
let _this = this;
//更新页面数据
......@@ -34,6 +41,7 @@ export default {
}
})
},
onDestroy() {
//取消接收手机侧第三方应用发过来的消息
console.error("end--onDestroy:unregisterReceiver")
......@@ -42,9 +50,9 @@ export default {
},
});
},
start(msg) {
let _this = this;
let model = msg.acModel;
//训练完成页面,只接收重新开始训练事件
if (msg.eventFlg == "17") {
router.replace({
......
......@@ -194,11 +194,11 @@
.train-new-title {
font-size: 38px;
height: 40px;
line-height: 40px;
margin-top: 60px;
width: 350px;
color: #FFFFFF;
text-align: center;
line-hight: 40px;
}
.train-time {
justify-content: center;
......
......@@ -37,6 +37,9 @@ export default {
showPrivacy: true, //显示隐私权限页面
},
onInit() {
if (app.setSwipeToDismiss != undefined) {
app.setSwipeToDismiss(true);
}
p2pClient.setPeerPkgName("com.sportq.fit");
p2pClient.setPeerFingerPrint("B1B788A1BBD5F459BC641DA8CE690EA065C96957F58E883764982B5C46E53E06");
},
......@@ -65,7 +68,7 @@ export default {
if (_this.isJumpLoginPage) {
_this.page = "11";
}
},1500);
}, 1500);
},
onShow() {
let _this = this;
......@@ -80,7 +83,7 @@ export default {
_this.keepScreenOn();
timer = setInterval(function () {
_this.keepScreenOn();
},2 * 60 * 1000);
}, 2 * 60 * 1000);
}
}
},
......@@ -127,7 +130,7 @@ export default {
_this.keepScreenOn();
timer = setInterval(function () {
_this.keepScreenOn();
},2 * 60 * 1000);
}, 2 * 60 * 1000);
}
//数据重置
_this.initData();
......@@ -172,7 +175,7 @@ export default {
if (!_this.dataPageShow) {
_this.dataPageShow = true;
}
_this.tabIndex = 0;
_this.tabIndex = 1;
_this.stopFlg = true;
//训练数据页面显示的实际数据
if (_this.lastPage != "") { //有可能是手机离开页面的15事件,手表端没有收到,所以导致lastpage没有值,这时候按训练中的页面算
......@@ -201,111 +204,113 @@ export default {
}
switch (msg.eventFlg) {
case "0": //训练准备
_this.page = "0";
_this.tabIndex = "0";
break;
_this.page = "0";
_this.tabIndex = "0";
break;
case "1": //训练准备后的倒计时
_this.countdownT = model.countdownT;
_this.stopFlg = false;
_this.page = "1";
break;
_this.countdownT = model.countdownT;
_this.stopFlg = false;
_this.page = "1";
break;
case "2": //动作名称
_this.vibrate();
_this.acName = model.acName;
_this.isLast = model.isLast;
_this.isFirst = model.isFirst;
_this.tabIndex = 0;
_this.stopFlg = false;
_this.page = "2";
break;
_this.vibrate();
_this.acName = model.acName;
_this.isLast = model.isLast;
_this.isFirst = model.isFirst;
_this.tabIndex = 0;
_this.stopFlg = false;
_this.page = "2";
break;
case "3": //动作预览
_this.acName = model.acName;
_this.page = "3";
break;
_this.acName = model.acName;
_this.page = "3";
break;
case "4": //动作预览倒计时
_this.acName = model.acName;
_this.countdownT = model.countdownT;
_this.page = "4";
break;
case "5": //训练动作倒计时
_this.acName = model.acName;
if (model.acType == "0") {
_this.countdownT = model.acCnt + "/" + model.acTotalCnt;
} else {
_this.acName = model.acName;
_this.countdownT = model.countdownT;
}
_this.page = "5";
break;
_this.page = "4";
break;
case "5": //训练动作倒计时
_this.acName = model.acName;
if (model.acType == "0") {
_this.countdownT = model.acCnt + "/" + model.acTotalCnt;
} else {
_this.countdownT = model.countdownT;
}
_this.page = "5";
break;
case "6": //休息中
_this.acName = model.acName;
_this.countdownT = model.countdownT;
_this.page = "6";
break;
_this.acName = model.acName;
_this.countdownT = model.countdownT;
_this.page = "6";
break;
case "7": //暂停
_this.tabIndex = 1;
_this.stopFlg = true;
//如果暂停的时候,正在准备开始训练或倒计时的场合,需要隐藏这个页面
if (_this.page == "0") {
_this.page = "2";
}
break;
_this.tabIndex = 1;
_this.stopFlg = true;
//如果暂停的时候,正在准备开始训练或倒计时的场合,需要隐藏这个页面
if (_this.page == "0") {
_this.page = "2";
}
break;
case "8": //继续
_this.page = "1";
_this.tabIndex = 0;
_this.countdownT = "3";
_this.stopFlg = false;
break;
_this.page = "1";
_this.tabIndex = 0;
_this.countdownT = "3";
_this.stopFlg = false;
break;
case "9": //完成训练
_this.vibrate();
sensor.unsubscribeHeartRate();
router.replace({
uri: "pages/end/end",
params: {
endTotalTime: model.fitTotalDuration, //训练时间
endAverHeartRate: model.averHeartRate, //平均心率
endMaxHeartRate: model.maxHeartRate, //最高心率
endCalorie: model.acCalorie, //消耗心率
}
});
break;
_this.vibrate();
sensor.unsubscribeHeartRate();
router.replace({
uri: "pages/end/end",
params: {
endTotalTime: model.fitTotalDuration, //训练时间
endAverHeartRate: model.averHeartRate, //平均心率
endMaxHeartRate: model.maxHeartRate, //最高心率
endCalorie: model.acCalorie, //消耗心率
}
});
break;
case "10": //退出训练
_this.page = "10";
_this.quit();
break;
_this.page = "10";
_this.quit();
break;
case "11": //登录中
_this.page = "11";
break;
_this.page = "11";
break;
case "12": //退出登录
_this.page = "11";
_this.quit();
break;
_this.page = "11";
_this.quit();
break;
case "13": //进度条
_this.progress = ((model.acProgress / model.maxProgress) * 350);
break;
_this.progress = ((model.acProgress / model.maxProgress) * 350);
break;
case "14": //训练总时长
_this.acCalorie = model.acCalorie ? model.acCalorie : '--';
_this.fitDuration = model.fitDuration;
_this.stopFlg = model.stopFlag; //同步状态
break;
_this.acCalorie = model.acCalorie ? model.acCalorie : '--';
_this.fitDuration = model.fitDuration;
_this.stopFlg = model.stopFlag; //同步状态
_this.isLast = model.isLast;
_this.isFirst = model.isFirst;
break;
case "15": //离开或者返回训练
if (model.rollbackStop == '0') {
//获取心率
_this.getHeartRate();
} else {
_this.lastPage = _this.page;
_this.page = "15";
//移除心率监听
sensor.unsubscribeHeartRate() //取消监听心率
}
break;
if (model.rollbackStop == '0') {
//获取心率
_this.getHeartRate();
} else {
_this.lastPage = _this.page;
_this.page = "15";
//移除心率监听
sensor.unsubscribeHeartRate() //取消监听心率
}
break;
case "16": //杀掉进程
_this.page = "11";
_this.quit();
break;
_this.page = "11";
_this.quit();
break;
case "17": //播放初始化、注册心率
//获取心率
_this.getHeartRate();
break;
_this.getHeartRate();
break;
}
},
......@@ -647,7 +652,9 @@ export default {
*/
touchMove: function (e) {
if (e.direction == "right") {
app.terminate();
if (!(this.dataPageShow && !this.showPrivacy)) {
app.terminate();
}
}
}
}
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