|
|
@@ -58,7 +58,7 @@
|
|
|
<button>点击连接</button>
|
|
|
</div>
|
|
|
<div class="classInfo" v-if="InClass == 1 && watchState">
|
|
|
- <em><span>课程名称</span>:{{DpName}}</em>
|
|
|
+ <em><span>课程名称:</span>{{DpName}}</em>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="middle">
|
|
|
@@ -137,7 +137,7 @@
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
- runMode: '',//'' 为正常模式 mock 为模拟操作模式
|
|
|
+ runMode: 'mock',//'' 为正常模式 mock 为模拟操作模式
|
|
|
isClassTime: 5000,//上课状态检测频率
|
|
|
isAddHeartTime: 1000,//心率上报检测频率
|
|
|
dataLabels: [],
|
|
|
@@ -175,7 +175,7 @@
|
|
|
InClass: 0,//是否上课
|
|
|
DpName: '1234',//课程名称
|
|
|
HrId: '',//心率带
|
|
|
- duId: '',
|
|
|
+ duId: 0,
|
|
|
sn: '',
|
|
|
}
|
|
|
},
|
|
|
@@ -273,14 +273,13 @@
|
|
|
// 卡路里计算
|
|
|
that.calcCalorie(that.heartRate);
|
|
|
if (that.heartLine.length > 30) {
|
|
|
- that.heartLine.unshift();
|
|
|
- that.dataLabels.unshift();
|
|
|
+ that.heartLine = that.heartLine.concat();
|
|
|
+ that.dataLabels = that.dataLabels.concat();
|
|
|
} else {
|
|
|
that.heartLine.push(that.heartRate);
|
|
|
that.dataLabels.push('');
|
|
|
}
|
|
|
that.DrawHeartLine(that.heartLine, that.dataLabels);
|
|
|
- // that.AutoAddAppHeartRate();
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
@@ -324,7 +323,8 @@
|
|
|
if (json.Code == 0) {
|
|
|
that.InClass = json.InClass;//0下课,1上课
|
|
|
// 记录duid
|
|
|
- that.duid = json.DuInfo.DuId;
|
|
|
+ that.duId = parseInt(json.DuInfo.DuId);
|
|
|
+ console.log('that.duId:' + that.duId);
|
|
|
} else {
|
|
|
that.$message.error(json.Memo);
|
|
|
}
|
|
|
@@ -658,6 +658,7 @@
|
|
|
// 上报信息
|
|
|
AutoAddAppHeartRate() {
|
|
|
let that = this;
|
|
|
+ console.log('duId:' + that.duId);
|
|
|
let param = {
|
|
|
token: localStorage.token,
|
|
|
duId: that.duId,
|
|
|
@@ -665,8 +666,8 @@
|
|
|
hrId: that.HrId,
|
|
|
heartRate: that.heartRate,
|
|
|
rcvTime: new Date().getTime(),
|
|
|
- calories: parseInt(that.addCalories * 1000), //卡
|
|
|
- pureCalories: parseInt(that.addPureCalories * 1000), //卡
|
|
|
+ calories: parseInt(that.addCalories * 1000000), //卡
|
|
|
+ pureCalories: parseInt(that.addPureCalories * 1000000), //卡
|
|
|
};
|
|
|
let postdata = qs.stringify(param);
|
|
|
AddAppHeartRate(postdata).then(res => {
|
|
|
@@ -675,7 +676,8 @@
|
|
|
that.InClass = json.InClass;
|
|
|
console.log('心率数据上传成功!');
|
|
|
} else {
|
|
|
- that.Toast( '心率数据上传失败' + json.Memo);
|
|
|
+ // that.Toast( '心率数据上传失败' + json.Memo);
|
|
|
+ console.log( '心率数据上传失败' + json.Memo);
|
|
|
}
|
|
|
})
|
|
|
},
|