|
@@ -81,18 +81,21 @@
|
|
|
<!--图示-->
|
|
<!--图示-->
|
|
|
<levelIcon></levelIcon>
|
|
<levelIcon></levelIcon>
|
|
|
<newRecord :toper-info="toperInfo"></newRecord>
|
|
<newRecord :toper-info="toperInfo"></newRecord>
|
|
|
|
|
+ <newStudent :student-info="studentInfo"></newStudent>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
import Headside from '@/components/Headside'
|
|
import Headside from '@/components/Headside'
|
|
|
import newRecord from '@/components/newRecord'
|
|
import newRecord from '@/components/newRecord'
|
|
|
|
|
+ import newStudent from '@/components/newStudent'
|
|
|
import levelIcon from '@/components/levelIcon'
|
|
import levelIcon from '@/components/levelIcon'
|
|
|
import
|
|
import
|
|
|
{
|
|
{
|
|
|
getHello,
|
|
getHello,
|
|
|
getRecordBreak,
|
|
getRecordBreak,
|
|
|
- getClassStat
|
|
|
|
|
|
|
+ getClassStat,
|
|
|
|
|
+ getNewUser
|
|
|
} from '@/api/getApiRes'
|
|
} from '@/api/getApiRes'
|
|
|
|
|
|
|
|
import '../libs/rem';
|
|
import '../libs/rem';
|
|
@@ -105,8 +108,9 @@
|
|
|
return {
|
|
return {
|
|
|
eqSn: '30:9C:23:0C:8B:1E',
|
|
eqSn: '30:9C:23:0C:8B:1E',
|
|
|
pageStyle: RandomBg(),
|
|
pageStyle: RandomBg(),
|
|
|
- trueDate: false,//真实数据 true false
|
|
|
|
|
|
|
+ trueDate: true,//真实数据 true false
|
|
|
totalTime: 4,
|
|
totalTime: 4,
|
|
|
|
|
+ studentTime: 15,
|
|
|
times: 1,
|
|
times: 1,
|
|
|
thisClassName: '',
|
|
thisClassName: '',
|
|
|
studentsClassName: [],
|
|
studentsClassName: [],
|
|
@@ -120,6 +124,11 @@
|
|
|
dialogVisible: false,
|
|
dialogVisible: false,
|
|
|
toper: {},
|
|
toper: {},
|
|
|
},
|
|
},
|
|
|
|
|
+ studentInfo: {
|
|
|
|
|
+ dialogVisible: false,
|
|
|
|
|
+ Rs: [],
|
|
|
|
|
+ percent: 0
|
|
|
|
|
+ },
|
|
|
fakeEgg: {
|
|
fakeEgg: {
|
|
|
Rs: {
|
|
Rs: {
|
|
|
"DuId": 37,
|
|
"DuId": 37,
|
|
@@ -141,45 +150,24 @@
|
|
|
},
|
|
},
|
|
|
mounted() {
|
|
mounted() {
|
|
|
// this.$router.push({path: '/2pkRank'});
|
|
// this.$router.push({path: '/2pkRank'});
|
|
|
- // return false
|
|
|
|
|
|
|
|
|
|
if (this.trueDate) {
|
|
if (this.trueDate) {
|
|
|
- this.GetgetUserList();
|
|
|
|
|
- this.curgetClassStat();
|
|
|
|
|
- this.mainTimer = setInterval(() => {
|
|
|
|
|
- this.GetgetUserList();
|
|
|
|
|
- this.curgetClassStat();
|
|
|
|
|
- }, 1000);
|
|
|
|
|
-
|
|
|
|
|
- this.timer2 = setInterval(() => {
|
|
|
|
|
- this.createEgg();
|
|
|
|
|
- }, 6000);
|
|
|
|
|
- this.createEgg();
|
|
|
|
|
|
|
+ this.init();
|
|
|
} else {
|
|
} else {
|
|
|
// 彩蛋
|
|
// 彩蛋
|
|
|
// this.OpenEgg(this.fakeEgg);
|
|
// this.OpenEgg(this.fakeEgg);
|
|
|
- // 1 2 4 6 9
|
|
|
|
|
- let Rs = fakeNews(11);
|
|
|
|
|
|
|
+ // 1 2 4 6 9 10 13 16 21 24
|
|
|
|
|
+ let Rs = fakeNews(33);
|
|
|
this.giveClassName(Rs);
|
|
this.giveClassName(Rs);
|
|
|
this.students = Rs;
|
|
this.students = Rs;
|
|
|
- // this.mainTimer = setInterval(() => {
|
|
|
|
|
- // this.students = fakeNews(2);
|
|
|
|
|
- // this.giveClassName(this.students);
|
|
|
|
|
- // }, 10000);
|
|
|
|
|
|
|
+ // this.createNewStudent();
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
watch: {
|
|
watch: {
|
|
|
'$route': function (val) {
|
|
'$route': function (val) {
|
|
|
if (val.path == '/main') {
|
|
if (val.path == '/main') {
|
|
|
if (this.trueDate) {
|
|
if (this.trueDate) {
|
|
|
- this.mainTimer = setInterval(() => {
|
|
|
|
|
- this.GetgetUserList();
|
|
|
|
|
- this.curgetClassStat();
|
|
|
|
|
- }, 1000);
|
|
|
|
|
- this.GetgetUserList();
|
|
|
|
|
- this.timer2 = setInterval(() => {
|
|
|
|
|
- this.createEgg();
|
|
|
|
|
- }, 6000);
|
|
|
|
|
|
|
+ this.init();
|
|
|
} else {
|
|
} else {
|
|
|
this.students = fakeNews(2);
|
|
this.students = fakeNews(2);
|
|
|
this.giveClassName(this.students);
|
|
this.giveClassName(this.students);
|
|
@@ -188,16 +176,38 @@
|
|
|
} else {
|
|
} else {
|
|
|
clearInterval(this.mainTimer);
|
|
clearInterval(this.mainTimer);
|
|
|
clearInterval(this.timer2);
|
|
clearInterval(this.timer2);
|
|
|
|
|
+ clearInterval(this.timer3);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
beforeDestroy() {
|
|
beforeDestroy() {
|
|
|
clearInterval(this.mainTimer);
|
|
clearInterval(this.mainTimer);
|
|
|
clearInterval(this.timer2);
|
|
clearInterval(this.timer2);
|
|
|
|
|
+ clearInterval(this.timer3);
|
|
|
this.mainTimer = null;
|
|
this.mainTimer = null;
|
|
|
this.timer2 = null;
|
|
this.timer2 = null;
|
|
|
|
|
+ this.timer3 = null;
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ init(){
|
|
|
|
|
+ this.GetgetUserList();
|
|
|
|
|
+ this.createEgg();
|
|
|
|
|
+ this.createNewStudent();
|
|
|
|
|
+ this.curgetClassStat();
|
|
|
|
|
+
|
|
|
|
|
+ this.mainTimer = setInterval(() => {
|
|
|
|
|
+ this.GetgetUserList();
|
|
|
|
|
+ this.curgetClassStat();
|
|
|
|
|
+ }, 1000);
|
|
|
|
|
+
|
|
|
|
|
+ this.timer2 = setInterval(() => {
|
|
|
|
|
+ this.createEgg();
|
|
|
|
|
+ }, 1000);
|
|
|
|
|
+
|
|
|
|
|
+ this.timer3 = setInterval(() => {
|
|
|
|
|
+ this.createNewStudent();
|
|
|
|
|
+ }, 6000);
|
|
|
|
|
+ },
|
|
|
alertInfo(info) {
|
|
alertInfo(info) {
|
|
|
alert(info);
|
|
alert(info);
|
|
|
},
|
|
},
|
|
@@ -212,7 +222,39 @@
|
|
|
getRecordBreak(postdata).then(res => {
|
|
getRecordBreak(postdata).then(res => {
|
|
|
let json = res;
|
|
let json = res;
|
|
|
if (json.Code == 0) {
|
|
if (json.Code == 0) {
|
|
|
- this.OpenEgg(json);
|
|
|
|
|
|
|
+ // 欢迎新学生时不显示彩蛋
|
|
|
|
|
+ if (that.studentInfo.dialogVisible == true) {
|
|
|
|
|
+ console.log('正在显示新学生');
|
|
|
|
|
+ return false
|
|
|
|
|
+ }else{
|
|
|
|
|
+ this.OpenEgg(json);
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // 并没有人破记录
|
|
|
|
|
+ if (json.Code == 999) return false;
|
|
|
|
|
+ if (json.Code != 999) that.$message.error(json.Memo + '[egg]');
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ // 欢迎新同学
|
|
|
|
|
+ createNewStudent() {
|
|
|
|
|
+ let that = this;
|
|
|
|
|
+ let param = {
|
|
|
|
|
+ token: localStorage.token,
|
|
|
|
|
+ eqSn: localStorage.eqSn
|
|
|
|
|
+ };
|
|
|
|
|
+ let postdata = qs.stringify(param);
|
|
|
|
|
+ getNewUser(postdata).then(res => {
|
|
|
|
|
+ let json = res;
|
|
|
|
|
+ if (json.Code == 0) {
|
|
|
|
|
+ console.log('来新生了');
|
|
|
|
|
+ // 显示彩蛋时不欢迎新学生
|
|
|
|
|
+ if (that.toperInfo.dialogVisible == true) {
|
|
|
|
|
+ console.log('正在显示彩蛋');
|
|
|
|
|
+ return false
|
|
|
|
|
+ }else{
|
|
|
|
|
+ that.OpenStudent(json.Rs);
|
|
|
|
|
+ }
|
|
|
} else {
|
|
} else {
|
|
|
// 并没有人破记录
|
|
// 并没有人破记录
|
|
|
if (json.Code == 999) return false;
|
|
if (json.Code == 999) return false;
|
|
@@ -234,6 +276,22 @@
|
|
|
}
|
|
}
|
|
|
}, 1000)
|
|
}, 1000)
|
|
|
},
|
|
},
|
|
|
|
|
+ OpenStudent(msg) {
|
|
|
|
|
+ let that = this;
|
|
|
|
|
+ that.studentInfo.Rs = msg;
|
|
|
|
|
+ that.studentInfo.dialogVisible = true;
|
|
|
|
|
+ // 倒计时5秒自动关闭
|
|
|
|
|
+ this.studentTime = 6;
|
|
|
|
|
+ let clock = window.setInterval(() => {
|
|
|
|
|
+ this.studentTime--;
|
|
|
|
|
+ let num = parseInt((6 - this.studentTime) / 6) * 100;
|
|
|
|
|
+ this.studentInfo.percent = num > 100 ? 100 : num;
|
|
|
|
|
+ if (parseInt(this.studentTime) < 0) {
|
|
|
|
|
+ that.studentInfo.dialogVisible = false;
|
|
|
|
|
+ clearInterval(clock);
|
|
|
|
|
+ }
|
|
|
|
|
+ }, 1000)
|
|
|
|
|
+ },
|
|
|
GetgetUserList() {
|
|
GetgetUserList() {
|
|
|
let that = this;
|
|
let that = this;
|
|
|
let param = {
|
|
let param = {
|
|
@@ -258,7 +316,6 @@
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
curgetClassStat() {
|
|
curgetClassStat() {
|
|
|
- console.log(123);
|
|
|
|
|
let that = this;
|
|
let that = this;
|
|
|
let param = {
|
|
let param = {
|
|
|
token: localStorage.token,
|
|
token: localStorage.token,
|
|
@@ -333,7 +390,7 @@
|
|
|
numberClass = 'twentyFour';
|
|
numberClass = 'twentyFour';
|
|
|
break;
|
|
break;
|
|
|
case parseInt(res.length) > 31:
|
|
case parseInt(res.length) > 31:
|
|
|
- numberClass = 'thirtyFive';
|
|
|
|
|
|
|
+ numberClass = 'twentyFour';
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -398,7 +455,7 @@
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
components: {
|
|
components: {
|
|
|
- Headside, newRecord, levelIcon
|
|
|
|
|
|
|
+ Headside, newRecord, levelIcon, newStudent
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
</script>
|
|
</script>
|
|
@@ -1907,7 +1964,6 @@
|
|
|
margin-top: 0.16rem;
|
|
margin-top: 0.16rem;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
.birth {
|
|
.birth {
|
|
|
position: relative;
|
|
position: relative;
|
|
|
top: -3.3rem;
|
|
top: -3.3rem;
|
|
@@ -1946,31 +2002,117 @@
|
|
|
.three .birth img.birthCrow {
|
|
.three .birth img.birthCrow {
|
|
|
top: 0.8rem;
|
|
top: 0.8rem;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
.six .birth {
|
|
.six .birth {
|
|
|
top: -3.1rem;
|
|
top: -3.1rem;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
.six .birth img.birthCrow {
|
|
.six .birth img.birthCrow {
|
|
|
width: 0.8rem;
|
|
width: 0.8rem;
|
|
|
height: 0.5rem;
|
|
height: 0.5rem;
|
|
|
top: 1.2rem;
|
|
top: 1.2rem;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
.six .birth img.birthText {
|
|
.six .birth img.birthText {
|
|
|
top: 2rem;
|
|
top: 2rem;
|
|
|
width: 1.5rem;
|
|
width: 1.5rem;
|
|
|
height: 0.6rem;
|
|
height: 0.6rem;
|
|
|
}
|
|
}
|
|
|
- .nine .birth {
|
|
|
|
|
|
|
+
|
|
|
|
|
+ .nine .birth {
|
|
|
top: -3.1rem;
|
|
top: -3.1rem;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
.nine .birth img.birthCrow {
|
|
.nine .birth img.birthCrow {
|
|
|
width: 0.8rem;
|
|
width: 0.8rem;
|
|
|
height: 0.5rem;
|
|
height: 0.5rem;
|
|
|
top: 1.6rem;
|
|
top: 1.6rem;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
.nine .birth img.birthText {
|
|
.nine .birth img.birthText {
|
|
|
top: 2.1rem;
|
|
top: 2.1rem;
|
|
|
width: 1.2rem;
|
|
width: 1.2rem;
|
|
|
height: 0.5rem;
|
|
height: 0.5rem;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ .ten .birth {
|
|
|
|
|
+ top: -3.1rem;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .ten .birth img.birthCrow {
|
|
|
|
|
+ width: 0.8rem;
|
|
|
|
|
+ height: 0.5rem;
|
|
|
|
|
+ top: 1.6rem;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .ten .birth img.birthText {
|
|
|
|
|
+ top: 2.1rem;
|
|
|
|
|
+ width: 1.2rem;
|
|
|
|
|
+ height: 0.5rem;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .twelve .birth {
|
|
|
|
|
+ top: -3.1rem;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .twelve .birth img.birthCrow {
|
|
|
|
|
+ width: 0.6rem;
|
|
|
|
|
+ height: 0.3rem;
|
|
|
|
|
+ top: 2rem;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .twelve .birth img.birthText {
|
|
|
|
|
+ top: 2.4rem;
|
|
|
|
|
+ width: 1rem;
|
|
|
|
|
+ height: 0.4rem;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .sixteen .birth {
|
|
|
|
|
+ top: -3.1rem;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .sixteen .birth img.birthCrow {
|
|
|
|
|
+ width: 0.6rem;
|
|
|
|
|
+ height: 0.3rem;
|
|
|
|
|
+ top: 2.1rem;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .sixteen .birth img.birthText {
|
|
|
|
|
+ top: 2.45rem;
|
|
|
|
|
+ width: 1rem;
|
|
|
|
|
+ height: 0.4rem;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .twenty .birth {
|
|
|
|
|
+ top: -3.1rem;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .twenty .birth img.birthCrow {
|
|
|
|
|
+ width: 0.6rem;
|
|
|
|
|
+ height: 0.3rem;
|
|
|
|
|
+ top: 2.1rem;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .twenty .birth img.birthText {
|
|
|
|
|
+ top: 2.45rem;
|
|
|
|
|
+ width: 1rem;
|
|
|
|
|
+ height: 0.4rem;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .twentyFour .birth {
|
|
|
|
|
+ top: -3.1rem;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .twentyFour .birth img.birthCrow {
|
|
|
|
|
+ width: 0.6rem;
|
|
|
|
|
+ height: 0.3rem;
|
|
|
|
|
+ top: 2.2rem;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .twentyFour .birth img.birthText {
|
|
|
|
|
+ top: 2.5rem;
|
|
|
|
|
+ width: 0.8rem;
|
|
|
|
|
+ height: 0.3rem;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
</style>
|
|
</style>
|