|
|
@@ -91,7 +91,7 @@
|
|
|
title="提示"
|
|
|
:visible.sync="dialogVisible"
|
|
|
width="30%"
|
|
|
- >
|
|
|
+ >
|
|
|
<span>{{dialogText}}</span>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
<el-button type="primary" @click="dialogVisible = false">知道了</el-button>
|
|
|
@@ -144,17 +144,8 @@
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
- // for test
|
|
|
- // this.$router.push({path: '/3pkRank'});
|
|
|
-
|
|
|
if (this.trueDate) {
|
|
|
- this.waitTimer = setInterval(() => {
|
|
|
- // this.GetgetUserList();
|
|
|
- this.curgetClassStat();
|
|
|
- this.GetHerosRankingQuery();
|
|
|
- this.GetCalorieStatsQuery();
|
|
|
- this.GetUserRankingQuery();
|
|
|
- }, 1000);
|
|
|
+ this.init();
|
|
|
} else {
|
|
|
this.students = this.fakeNews();
|
|
|
this.studentsLimit = this.fakeNewsLimit();
|
|
|
@@ -237,15 +228,11 @@
|
|
|
},
|
|
|
watch: {
|
|
|
'$route': function (val) {
|
|
|
+ let that = this;
|
|
|
if (val.path == '/') {
|
|
|
this.autoplayStatus = false;
|
|
|
if (this.trueDate) {
|
|
|
- this.waitTimer = setInterval(() => {
|
|
|
- this.curgetClassStat();
|
|
|
- this.GetHerosRankingQuery();
|
|
|
- this.GetCalorieStatsQuery();
|
|
|
- this.GetUserRankingQuery();
|
|
|
- }, 1000);
|
|
|
+ that.init();
|
|
|
} else {
|
|
|
this.students = this.fakeNews();
|
|
|
this.topMsg = this.students[0];
|
|
|
@@ -260,6 +247,15 @@
|
|
|
this.waitTimer = null;
|
|
|
},
|
|
|
methods: {
|
|
|
+ init() {
|
|
|
+ this.waitTimer = setInterval(() => {
|
|
|
+ this.curgetClassStat();
|
|
|
+ this.GetHerosRankingQuery();
|
|
|
+ this.GetCalorieStatsQuery();
|
|
|
+ this.GetUserRankingQuery();
|
|
|
+ }, 1000);
|
|
|
+
|
|
|
+ },
|
|
|
fakeNews() {
|
|
|
let item = [];
|
|
|
for (var i = 0; i < 7; i++) {
|
|
|
@@ -337,7 +333,8 @@
|
|
|
if (json.Code == 0) {
|
|
|
that.bottom = json.Rs;
|
|
|
} else {
|
|
|
- if (json.Code == 4002) {}else{
|
|
|
+ if (json.Code == 4002) {
|
|
|
+ } else {
|
|
|
that.$message.error(json.Memo);
|
|
|
}
|
|
|
}
|
|
|
@@ -355,7 +352,8 @@
|
|
|
if (json.Code == 0) {
|
|
|
that.rt = json.Rs;
|
|
|
} else {
|
|
|
- if (json.Code == 4002) {}else{
|
|
|
+ if (json.Code == 4002) {
|
|
|
+ } else {
|
|
|
that.$message.error(json.Memo);
|
|
|
}
|
|
|
}
|
|
|
@@ -385,7 +383,7 @@
|
|
|
if (json.Code == 4002) {
|
|
|
that.dialogVisible = true;
|
|
|
that.dialogText = json.Memo;
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
that.$message.error(json.Memo);
|
|
|
}
|
|
|
|