|
|
@@ -2,12 +2,13 @@
|
|
|
<div class="context bgStyle1" id="online">
|
|
|
<div class="change">
|
|
|
<div class="basicInfo">
|
|
|
- <em>课程名:{{classInfo.name}} </em>
|
|
|
- <em>学员数:{{classInfo.len}} </em>
|
|
|
- <em>(在线:{{classInfo.online}}人 离线:{{classInfo.offline}}人) </em>
|
|
|
- <em>当前时间:{{classInfo.time}} </em>
|
|
|
- <!--拿到eqsn才能获取数据-->
|
|
|
- <em>区域列表 </em>
|
|
|
+ <em>课程名:{{PlanName}} </em>
|
|
|
+ <em>学员数:{{Num}} </em>
|
|
|
+ <em>教练:{{Teacher}} </em>
|
|
|
+ <!--<em>(在线:{{classInfo.online}}人 离线:{{classInfo.offline}}人) </em>-->
|
|
|
+ <em>当前时间:{{classInfo.endTime}} </em>
|
|
|
+ <!--拿到eqsn才能获取数据-->
|
|
|
+ <em class="room">区域列表 </em>
|
|
|
<el-select v-model="VenueId" placeholder="请选择区域" @change="queryEqsnByVenueId">
|
|
|
<el-option
|
|
|
v-for="item in VenueOption"
|
|
|
@@ -27,6 +28,9 @@
|
|
|
</div>
|
|
|
<div :class="[{'userList':true},{'bigUserList':bigUserList}]">
|
|
|
<ul :class="[{'bigUserList':bigUserList}]">
|
|
|
+ <li v-if="students.length == 0">
|
|
|
+ <h5 style="color: #fff;font-size: 3rem">暂无学生加入当前课程</h5>
|
|
|
+ </li>
|
|
|
<li v-for="(s,i) in students" :class="studentsClassName[i].name" v-show="students"
|
|
|
v-if="students.length > 0">
|
|
|
<div class="centerLi">
|
|
|
@@ -129,7 +133,11 @@
|
|
|
import {
|
|
|
QueryShopVenue,
|
|
|
QueryVenueEquip,
|
|
|
+ getHello,
|
|
|
+ CalorieStatsQuery,
|
|
|
+ ClassUserRank,
|
|
|
} from "../api/getApiRes";
|
|
|
+
|
|
|
let qs = require('qs');
|
|
|
export default {
|
|
|
data() {
|
|
|
@@ -140,6 +148,7 @@
|
|
|
online: 0,
|
|
|
offline: 0,
|
|
|
time: '00:00:00',
|
|
|
+ endTime: '00:00:00',
|
|
|
},
|
|
|
VenueId: '',//所选区域
|
|
|
classState: 0,//0 下课 1上课
|
|
|
@@ -151,24 +160,100 @@
|
|
|
bigUserList: false,
|
|
|
dialogMemberVisible: false,//false
|
|
|
dialogTitle: '排行榜',
|
|
|
+ EqSn: '',
|
|
|
+ PlanName: '',
|
|
|
+ BeginTime: '',
|
|
|
+ Num: '',
|
|
|
+ Teacher: '',
|
|
|
+
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
|
- // this.getList(26);
|
|
|
- this.getVenueQuery();
|
|
|
+ this.init();
|
|
|
},
|
|
|
watch: {
|
|
|
$route(to) {
|
|
|
console.log(to);
|
|
|
if (to.name != 'online') {
|
|
|
- this.clearRem()
|
|
|
+ this.clearRem();
|
|
|
+ clearInterval(this.mainTimer);//页面销毁时清除定时器
|
|
|
} else {
|
|
|
this.setRem();
|
|
|
this.getVenueQuery();
|
|
|
}
|
|
|
},
|
|
|
+ // EqSn(to){
|
|
|
+ // console.log(to);
|
|
|
+ // clearInterval(this.mainTimer);//页面销毁时清除定时器
|
|
|
+ // if(to){
|
|
|
+ // this.mainTimer = setInterval(() => {
|
|
|
+ // this.GetgetUserList();
|
|
|
+ // }, 1000);
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ },
|
|
|
+ destroyed() {
|
|
|
+ clearInterval(this.mainTimer);//页面销毁时清除定时器
|
|
|
},
|
|
|
methods: {
|
|
|
+ init() {
|
|
|
+ // this.getList(26);
|
|
|
+ this.getVenueQuery();
|
|
|
+ },
|
|
|
+ getClassUserRank() {
|
|
|
+ let that = this;
|
|
|
+ let param = {
|
|
|
+ eqSn: localStorage.eqSn
|
|
|
+ };
|
|
|
+ let postdata = qs.stringify(param);
|
|
|
+ ClassUserRank(postdata).then(res => {
|
|
|
+ let json = res;
|
|
|
+ if (json.Code == 0) {
|
|
|
+ let totalTime = 40;
|
|
|
+ let Studenlength = 0;
|
|
|
+ let CkSort = json.Rs;
|
|
|
+ let CalSort = deepClone(json.Rs);
|
|
|
+ let Rs = json.Rs;
|
|
|
+ if (Rs != '') {
|
|
|
+ // 排序
|
|
|
+ that.students.CkSort = json.Rs.sort(function (a, b) {
|
|
|
+ return b.Ck - a.Ck;
|
|
|
+ });
|
|
|
+
|
|
|
+ that.students.CalSort = CalSort.sort(function (a, b) {
|
|
|
+ return b.Cle - a.Cle;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.students.CkSort = [];
|
|
|
+ this.students.CalSort = [];
|
|
|
+ if (json.Code == '999') {
|
|
|
+ // that.$router.push({path: '/'});
|
|
|
+ } else {
|
|
|
+ // 已出错
|
|
|
+ that.$message.error(json.Memo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 载入课程信息
|
|
|
+ ReadLessonInfo(Dp) {
|
|
|
+ this.PlanName = Dp.PlanName;
|
|
|
+ this.BeginTime = Dp.BeginTime;
|
|
|
+ this.Teacher = Dp.Teacher;
|
|
|
+ this.Num = this.students.length;
|
|
|
+ },
|
|
|
+ // 计算团队竞技课持续时间
|
|
|
+ ClacClassTime() {
|
|
|
+ let BeginTime = new Date(globalcurrent() + ' ' + this.BeginTime);//结束时间
|
|
|
+ let nowDate = new Date();
|
|
|
+ let date = new Date(nowDate - BeginTime - 8 * 60 * 60 * 1000);//减掉东八区时区问题
|
|
|
+
|
|
|
+ let h = date.getHours() < 10 ? '0' + date.getHours() + ':' : date.getHours() + ':';
|
|
|
+ let m = date.getMinutes() < 10 ? '0' + date.getMinutes() + ':' : date.getMinutes() + ':';
|
|
|
+ let s = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds();
|
|
|
+ this.classInfo.endTime = h + m + s;
|
|
|
+ },
|
|
|
clearRem() {
|
|
|
// 320 默认大小16px; 320px = 20rem ;每个元素px基础上/16
|
|
|
let htmlWidth = document.documentElement.clientWidth || document.body.clientWidth;
|
|
|
@@ -182,7 +267,7 @@
|
|
|
//得到html的Dom元素
|
|
|
let htmlDom = document.getElementsByTagName('html')[0];
|
|
|
//设置根元素字体大小
|
|
|
- htmlDom.style.fontSize = htmlWidth / 120 + 'px';
|
|
|
+ htmlDom.style.fontSize = htmlWidth / 140 + 'px';
|
|
|
},
|
|
|
// 全屏显示
|
|
|
full_screen() {
|
|
|
@@ -229,7 +314,12 @@
|
|
|
},
|
|
|
// 打开排行榜
|
|
|
showRank() {
|
|
|
- this.dialogMemberVisible = true;
|
|
|
+ if (this.rankInfo.length == 0) {
|
|
|
+ this.$message.error('暂无排名数据');
|
|
|
+ return false
|
|
|
+ } else {
|
|
|
+ this.dialogMemberVisible = true;
|
|
|
+ }
|
|
|
},
|
|
|
// 获取演示区域
|
|
|
getVenueQuery() {
|
|
|
@@ -249,7 +339,6 @@
|
|
|
} else {
|
|
|
that.VenueOption = [];
|
|
|
}
|
|
|
-
|
|
|
} else {
|
|
|
if (!localStorage.ServiceKey) {
|
|
|
that.$message.error('还未与心率系统对接,请联系管理员');
|
|
|
@@ -267,7 +356,7 @@
|
|
|
key: localStorage.ServiceKey,
|
|
|
shopId: localStorage.ServiceId,
|
|
|
svId: svId,
|
|
|
- eqType:3//设备类型 1 电视盒子 2 演示对应中间件 3 演示客户端
|
|
|
+ eqType: 3//设备类型 1 电视盒子 2 演示对应中间件 3 演示客户端
|
|
|
};
|
|
|
let postdata = qs.stringify(param);
|
|
|
QueryVenueEquip(postdata).then(res => {
|
|
|
@@ -276,15 +365,61 @@
|
|
|
that.loading = false;
|
|
|
if (json.Rs) {
|
|
|
that.EqSn = json.Rs[0].EqSn;
|
|
|
+ clearInterval(this.mainTimer);//页面销毁时清除定时器
|
|
|
+ that.GetgetUserList();
|
|
|
+ if (that.EqSn) {
|
|
|
+ this.mainTimer = setInterval(() => {
|
|
|
+ this.GetgetUserList();
|
|
|
+ }, 1000);
|
|
|
+ }
|
|
|
+
|
|
|
} else {
|
|
|
that.$message.error('当前区域没有设置显示设备');
|
|
|
- that.EqSn = '';
|
|
|
+ that.students = [];
|
|
|
+ that.rankInfo = [];
|
|
|
+ clearInterval(this.mainTimer);//页面销毁时清除定时器
|
|
|
+ return false
|
|
|
}
|
|
|
} else {
|
|
|
that.$message.error(json.Memo + ' 错误码:' + json.Code);
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ GetgetUserList() {
|
|
|
+ let that = this;
|
|
|
+ let param = {
|
|
|
+ token: localStorage.token,
|
|
|
+ eqSn: that.EqSn
|
|
|
+ };
|
|
|
+ let postdata = qs.stringify(param);
|
|
|
+ // CalorieStatsQuery(postdata).then(res => {
|
|
|
+ getHello(postdata).then(res => {
|
|
|
+ let json = res;
|
|
|
+ if (json.Code == 0) {
|
|
|
+ if (!json.Dp) {
|
|
|
+ // that.$message.error('没有获取到课程信息');
|
|
|
+ this.PlanName = '';
|
|
|
+ this.BeginTime = '';
|
|
|
+ this.Teacher = '';
|
|
|
+ } else {
|
|
|
+ that.ReadLessonInfo(json.Dp);
|
|
|
+ }
|
|
|
+ that.students = json.Rs;
|
|
|
+ that.rankInfo = json.Rs;
|
|
|
+ that.giveClassName(json.Rs);
|
|
|
+ } else {
|
|
|
+ // 已下课
|
|
|
+ if (json.Code == '999') {
|
|
|
+ that.students = "";
|
|
|
+ that.rankInfo = "";
|
|
|
+ that.getClassUserRank();
|
|
|
+ } else {
|
|
|
+ // 已出错
|
|
|
+ that.$message.error(json.Memo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
getList(len) {
|
|
|
let rs = {};
|
|
|
for (var i = 0; i < len; i++) {
|
|
|
@@ -1131,6 +1266,7 @@
|
|
|
.three .bottomLi .btck span {
|
|
|
text-indent: 1.6rem;
|
|
|
}
|
|
|
+
|
|
|
.three /deep/ .powerContainer img {
|
|
|
width: 2rem;
|
|
|
}
|
|
|
@@ -1253,7 +1389,7 @@
|
|
|
|
|
|
.six .lhj span.plus {
|
|
|
position: relative;
|
|
|
- left: 1.3rem
|
|
|
+ left: 11.3rem
|
|
|
}
|
|
|
|
|
|
.six .bottomLi .btck img {
|
|
|
@@ -2283,8 +2419,29 @@
|
|
|
background-repeat: no-repeat;
|
|
|
color: #fff;
|
|
|
}
|
|
|
+
|
|
|
/deep/ .el-dialog__title {
|
|
|
color: #fff;
|
|
|
font-size: 2rem;
|
|
|
}
|
|
|
+
|
|
|
+ /deep/ .el-input__inner {
|
|
|
+ background-color: inherit;
|
|
|
+ color: #fff;
|
|
|
+ }
|
|
|
+
|
|
|
+ .el-select-dropdown__item {
|
|
|
+ padding-left: 10px !important;
|
|
|
+ }
|
|
|
+
|
|
|
+ .el-scrollbar {
|
|
|
+ padding-left: 10px !important;
|
|
|
+ }
|
|
|
+
|
|
|
+ .selected {
|
|
|
+ padding-left: 10px !important;
|
|
|
+ }
|
|
|
+ .room {
|
|
|
+ margin-left: 10px;
|
|
|
+ }
|
|
|
</style>
|