|
@@ -9,7 +9,8 @@
|
|
|
<div class="sunshineRun-title"><img src="@/assets/images/sunshineRun/title.png" /></div>
|
|
|
<div class="toolList">
|
|
|
<div class="li">{{ date }}</div>
|
|
|
- <div class="li btn screen" :class="{ 'on': screen, 'off': !screen }" @click="getFullScreen"></div>
|
|
|
+ <div class="li btn screen" :class="{ 'on': screen, 'off': !screen }" @click="getFullScreen" title="屏幕"></div>
|
|
|
+ <div class="li btn rankingSwitch" :class="{ 'on': rankingSwitch2, 'off': !rankingSwitch2 }" @click="getRankingBtn" title="排行榜"></div>
|
|
|
<div class="li btn closeBtn" @click="confirmExit"></div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -100,10 +101,11 @@ const data = reactive<any>({
|
|
|
size: 8,
|
|
|
pages: 1
|
|
|
}, //学生分页
|
|
|
- timer: null //排行榜定时弹窗状态
|
|
|
+ timer: null, //排行榜定时弹窗状态
|
|
|
+ rankingSwitch2: true, //排行榜开关
|
|
|
});
|
|
|
|
|
|
-const { timerManager, userInfo, testList, reportList, date, unit, screen, studentPage, timer } = toRefs(data);
|
|
|
+const { timerManager, userInfo, testList, reportList, date, unit, screen, studentPage, timer, rankingSwitch2 } = toRefs(data);
|
|
|
|
|
|
/**
|
|
|
* 更新时间
|
|
@@ -287,17 +289,36 @@ const initSunshineRun = () => {
|
|
|
* 定时打开排行榜
|
|
|
*/
|
|
|
const openRanking = () => {
|
|
|
- // clearTimeout(timer.value);
|
|
|
- // if (rankingWindowRef.value.rankingState) {
|
|
|
- // rankingWindowRef.value.close();
|
|
|
- // }
|
|
|
- // //console.log("timer.value", timer.value)
|
|
|
- // // 设置新的定时器
|
|
|
- // timer.value = setTimeout(() => {
|
|
|
- // if (!rankingWindowRef.value.rankingState) {
|
|
|
- // rankingWindowRef.value.open();
|
|
|
- // }
|
|
|
- // }, 1000 * 60 * 5);
|
|
|
+ clearTimeout(timer.value);
|
|
|
+ if (rankingWindowRef.value.rankingState) {
|
|
|
+ rankingWindowRef.value.close();
|
|
|
+ }
|
|
|
+ //console.log("timer.value", timer.value)
|
|
|
+ let state = localStorage.getItem('rankingSwitch2');
|
|
|
+ if (state != "1") {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ // 设置新的定时器
|
|
|
+ timer.value = setTimeout(() => {
|
|
|
+ if (!rankingWindowRef.value.rankingState) {
|
|
|
+ rankingWindowRef.value.open();
|
|
|
+ }
|
|
|
+ }, 1000 * 60 * 5);
|
|
|
+};
|
|
|
+
|
|
|
+/**
|
|
|
+ * 排行榜开关
|
|
|
+*/
|
|
|
+const getRankingBtn = () => {
|
|
|
+ let state = localStorage.getItem('rankingSwitch2');
|
|
|
+ if (state == "1") {
|
|
|
+ localStorage.setItem('rankingSwitch2', "0");
|
|
|
+ rankingSwitch2.value = false;
|
|
|
+ } else {
|
|
|
+ localStorage.setItem('rankingSwitch2', "1");
|
|
|
+ rankingSwitch2.value = true;
|
|
|
+ }
|
|
|
+ openRanking();
|
|
|
};
|
|
|
|
|
|
onBeforeMount(() => {
|
|
@@ -417,6 +438,14 @@ onBeforeUnmount(() => {
|
|
|
.screen.off {
|
|
|
background-image: url('@/assets/images/sunshineRun/screen2.png');
|
|
|
}
|
|
|
+
|
|
|
+ .rankingSwitch.on {
|
|
|
+ background-image: url('@/assets/images/sunshineRun/screen1.png');
|
|
|
+ }
|
|
|
+
|
|
|
+ .rankingSwitch.off {
|
|
|
+ background-image: url('@/assets/images/sunshineRun/screen2.png');
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|