Commit 84e2256a authored by Sky's avatar Sky

获取心率删除无用数据

parent 89a4bcf7
...@@ -211,7 +211,7 @@ export default { ...@@ -211,7 +211,7 @@ export default {
message: JSON.stringify(obj), message: JSON.stringify(obj),
success: function () { success: function () {
_this.sendFlg = false; _this.sendFlg = false;
console.log('FA has been installed.'); console.log('sendMsg success.');
}, },
fail: function (data, code) { fail: function (data, code) {
_this.sendFlg = false; _this.sendFlg = false;
...@@ -245,7 +245,6 @@ export default { ...@@ -245,7 +245,6 @@ export default {
let _this = this; let _this = this;
FeatureAbility.subscribeMsg({ FeatureAbility.subscribeMsg({
success: function (data) { success: function (data) {
_this.sendErrMsg(data.message,"手表端接收到消息数据:");
_this.start(JSON.parse(data.message)); _this.start(JSON.parse(data.message));
}, },
fail: function (data, code) { fail: function (data, code) {
...@@ -268,7 +267,7 @@ export default { ...@@ -268,7 +267,7 @@ export default {
"errCode": code, "errCode": code,
}), }),
success: function () { success: function () {
console.log('FA has been installed.'); console.log('sendErrMsg success.');
}, },
fail: function (data, code) { fail: function (data, code) {
console.log('handing fail, message: ' + data + ', code: ' + code); console.log('handing fail, message: ' + data + ', code: ' + code);
...@@ -284,13 +283,17 @@ export default { ...@@ -284,13 +283,17 @@ export default {
let _this = this; let _this = this;
sensor.subscribeHeartRate({ sensor.subscribeHeartRate({
success: function (data) { success: function (data) {
if (data.heartRate != 255) {
_this.newHeartRate = data.heartRate; _this.newHeartRate = data.heartRate;
_this.heartRateList.push(data.heartRate); _this.heartRateList.push(data.heartRate);
console.log('获取心率成功: ' + data.heartRate); console.log('获取心率成功: ' + data.heartRate);
} else {
_this.newHeartRate = "--";
}
_this.sendMsg({ _this.sendMsg({
"eventFlg": "0", "eventFlg": "0",
"rateCnt": data.heartRate "rateCnt": _this.newHeartRate
}) });
}, },
fail: function (data, code) { fail: function (data, code) {
_this.newHeartRate = "--"; _this.newHeartRate = "--";
......
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