|
|
@@ -64,6 +64,7 @@
|
|
|
import '../libs/rem';
|
|
|
import '../Global';
|
|
|
import {ClassUserRank} from '@/api/getApiRes'
|
|
|
+
|
|
|
let qs = require('qs');
|
|
|
export default {
|
|
|
data() {
|
|
|
@@ -76,24 +77,13 @@
|
|
|
CkSort: [],
|
|
|
CalSort: [],
|
|
|
},
|
|
|
- rankTimer:null,
|
|
|
- totalTime:60
|
|
|
+ rankTimer: null,
|
|
|
+ totalTime: 60
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
if (this.trueDate) {
|
|
|
this.getClassUserRank();
|
|
|
- // this.rankTimer = setInterval(() => {
|
|
|
- // this.getClassUserRank();
|
|
|
- // }, 5000);
|
|
|
-
|
|
|
- } else {
|
|
|
- // this.rankTimer = setInterval(() => {
|
|
|
- this.students.CkSort = this.fakeNews();
|
|
|
- this.students.CalSort = this.fakeNews();
|
|
|
- // }, 5000);
|
|
|
- }
|
|
|
- if (this.autoJump) {
|
|
|
// 倒计时60秒自动关闭
|
|
|
let that = this;
|
|
|
this.totalTime = 60;
|
|
|
@@ -107,6 +97,22 @@
|
|
|
clearInterval(clock);
|
|
|
}
|
|
|
}, 1000)
|
|
|
+ // this.rankTimer = setInterval(() => {
|
|
|
+ // this.getClassUserRank();
|
|
|
+ // }, 5000);
|
|
|
+
|
|
|
+ } else {
|
|
|
+ // this.rankTimer = setInterval(() => {
|
|
|
+ this.students.CkSort = fakeNews(5);
|
|
|
+ this.students.CalSort = fakeNews(5);
|
|
|
+ this.students.CkSort = this.students.CkSort.sort(function (a, b) {
|
|
|
+ return b.Ck - a.Ck;
|
|
|
+ });
|
|
|
+ this.students.CalSort = this.students.CalSort.sort(function (a, b) {
|
|
|
+ return b.Cle - a.Cle;
|
|
|
+ });
|
|
|
+
|
|
|
+ // }, 5000);
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
|
@@ -118,13 +124,6 @@
|
|
|
// this.getClassUserRank();
|
|
|
// }, 5000);
|
|
|
|
|
|
- } else {
|
|
|
- // this.rankTimer = setInterval(() => {
|
|
|
- this.students.CkSort = this.fakeNews();
|
|
|
- this.students.CalSort = this.fakeNews();
|
|
|
- // }, 5000);
|
|
|
- }
|
|
|
- if (this.autoJump) {
|
|
|
// 倒计时60秒自动关闭
|
|
|
let that = this;
|
|
|
this.totalTime = 60;
|
|
|
@@ -137,6 +136,12 @@
|
|
|
clearInterval(clock);
|
|
|
}
|
|
|
}, 1000)
|
|
|
+
|
|
|
+ } else {
|
|
|
+ // this.rankTimer = setInterval(() => {
|
|
|
+ this.students.CkSort = fakeNews(5);
|
|
|
+ this.students.CalSort = fakeNews(5);
|
|
|
+ // }, 5000);
|
|
|
}
|
|
|
} else {
|
|
|
clearInterval(this.autoJump);
|
|
|
@@ -149,31 +154,6 @@
|
|
|
this.rankTimer = null;
|
|
|
},
|
|
|
methods: {
|
|
|
- fakeNews() {
|
|
|
- let item = [];
|
|
|
- // 1 2 3 5 9 11 13 16 21 30
|
|
|
- let fakeNums = 7;
|
|
|
- for (var i = 0; i < fakeNums; i++) {
|
|
|
- item.push(
|
|
|
- {
|
|
|
- "SvId": 1,
|
|
|
- "UserId": 1,
|
|
|
- "Cle": 999,
|
|
|
- "realHr1": parseInt(Math.random() * 100 + 50),
|
|
|
- "realHr": 60,
|
|
|
- "activePercent": 30,
|
|
|
- "heartRate": 90,
|
|
|
- "Steps": 9999,
|
|
|
- "PureCalorieNoVo2": 999,
|
|
|
- "Name": "东南西北中",
|
|
|
- "updateTime": 1604568915582,
|
|
|
- "Ck": 99.9,
|
|
|
- "Head": "http://192.168.0.2/zw.png",
|
|
|
- }
|
|
|
- )
|
|
|
- }
|
|
|
- return item;
|
|
|
- },
|
|
|
getClassUserRank() {
|
|
|
let that = this;
|
|
|
let param = {
|
|
|
@@ -186,7 +166,7 @@
|
|
|
this.students.CkSort = json.Rs;
|
|
|
this.students.CalSort = json.Rs;
|
|
|
let Rs = json.Rs;
|
|
|
- if(Rs){
|
|
|
+ if (Rs != '') {
|
|
|
// 排序
|
|
|
that.students.CkSort = that.students.CkSort.sort(function (a, b) {
|
|
|
return b.Ck - a.Ck;
|
|
|
@@ -349,6 +329,7 @@
|
|
|
line-height: 1rem;
|
|
|
text-align: right;
|
|
|
}
|
|
|
+
|
|
|
li .score em {
|
|
|
font-size: 0.2rem;
|
|
|
}
|