|
@@ -28,11 +28,8 @@
|
|
<img class="noPic"
|
|
<img class="noPic"
|
|
v-else src="@/assets/images/common/noImg.png" /> -->
|
|
v-else src="@/assets/images/common/noImg.png" /> -->
|
|
<div class="nameBox">{{ item.name }}</div>
|
|
<div class="nameBox">{{ item.name }}</div>
|
|
- <div
|
|
|
|
- class="pic"
|
|
|
|
- v-if="item.student_id && item.student_icon_url"
|
|
|
|
- :style="{ backgroundImage: 'url(' + item.student_icon_url + ')' }"
|
|
|
|
- ></div>
|
|
|
|
|
|
+ <div class="pic" v-if="item.student_id && item.student_icon_url"
|
|
|
|
+ :style="{ backgroundImage: 'url(' + item.student_icon_url + ')' }"></div>
|
|
<div class="con">
|
|
<div class="con">
|
|
<!-- <div class="name">{{ item.name }}</div> -->
|
|
<!-- <div class="name">{{ item.name }}</div> -->
|
|
<div class="score">
|
|
<div class="score">
|
|
@@ -57,7 +54,8 @@
|
|
<ul>
|
|
<ul>
|
|
<li v-for="(item, index) in reportList" :key="index">
|
|
<li v-for="(item, index) in reportList" :key="index">
|
|
<div class="left">
|
|
<div class="left">
|
|
- <div class="pai" :class="{ 'pai1': item.rankid == 1, 'pai2': item.rankid == 2, 'pai3': item.rankid == 3 }">
|
|
|
|
|
|
+ <div class="pai"
|
|
|
|
+ :class="{ 'pai1': item.rankid == 1, 'pai2': item.rankid == 2, 'pai3': item.rankid == 3 }">
|
|
<div>{{ item.rankid }}</div>
|
|
<div>{{ item.rankid }}</div>
|
|
</div>
|
|
</div>
|
|
<!-- <div class="pic"><img :src="item.icon" /></div> -->
|
|
<!-- <div class="pic"><img :src="item.icon" /></div> -->
|
|
@@ -78,7 +76,7 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
- <!-- <RankingWindow ref="rankingWindowRef" @getClose="openRanking"></RankingWindow> -->
|
|
|
|
|
|
+ <RankingWindow ref="rankingWindowRef" @getClose="openRanking"></RankingWindow>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -88,8 +86,7 @@ const { proxy } = getCurrentInstance() as any;
|
|
const router = useRouter();
|
|
const router = useRouter();
|
|
const myInfo: any = localStorage.getItem('userInfo');
|
|
const myInfo: any = localStorage.getItem('userInfo');
|
|
const { sunshineRunWs, startConnect } = useSunshineRunSocket();
|
|
const { sunshineRunWs, startConnect } = useSunshineRunSocket();
|
|
-// const rankingWindowRef = ref();
|
|
|
|
-
|
|
|
|
|
|
+const rankingWindowRef = ref();
|
|
const data = reactive<any>({
|
|
const data = reactive<any>({
|
|
timerManager: {}, //计时器管理
|
|
timerManager: {}, //计时器管理
|
|
userInfo: {}, //用户信息
|
|
userInfo: {}, //用户信息
|
|
@@ -133,7 +130,7 @@ const confirmExit = async () => {
|
|
if (import.meta.env.DEV) {
|
|
if (import.meta.env.DEV) {
|
|
getClearTimer();
|
|
getClearTimer();
|
|
proxy?.$modal.msgSuccess('测试环境免密退出');
|
|
proxy?.$modal.msgSuccess('测试环境免密退出');
|
|
- await proxy?.$http.common.logout({}).then((res: any) => {});
|
|
|
|
|
|
+ await proxy?.$http.common.logout({}).then((res: any) => { });
|
|
proxy?.$modal?.closeLoading();
|
|
proxy?.$modal?.closeLoading();
|
|
//清空缓存
|
|
//清空缓存
|
|
// localStorage.clear();
|
|
// localStorage.clear();
|
|
@@ -155,7 +152,7 @@ const confirmExit = async () => {
|
|
};
|
|
};
|
|
proxy?.$http.common.checkPassword(params).then(async (res: any) => {
|
|
proxy?.$http.common.checkPassword(params).then(async (res: any) => {
|
|
if (res.status === 200 || res.status === 1) {
|
|
if (res.status === 200 || res.status === 1) {
|
|
- await proxy?.$http.common.logout({}).then((res: any) => {});
|
|
|
|
|
|
+ await proxy?.$http.common.logout({}).then((res: any) => { });
|
|
proxy?.$modal?.closeLoading();
|
|
proxy?.$modal?.closeLoading();
|
|
//清空缓存
|
|
//清空缓存
|
|
// localStorage.clear();
|
|
// localStorage.clear();
|
|
@@ -169,7 +166,7 @@ const confirmExit = async () => {
|
|
});
|
|
});
|
|
}
|
|
}
|
|
})
|
|
})
|
|
- .finally(() => {});
|
|
|
|
|
|
+ .finally(() => { });
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
|
|
@@ -240,7 +237,7 @@ const getSunshineRunPushData = async () => {
|
|
password: 'fb083a6fe1e14600910b06977c1d037e',
|
|
password: 'fb083a6fe1e14600910b06977c1d037e',
|
|
school_id: '3'
|
|
school_id: '3'
|
|
};
|
|
};
|
|
- await proxy?.$http.common.sunshineRunPushData(params).then((res: any) => {});
|
|
|
|
|
|
+ await proxy?.$http.common.sunshineRunPushData(params).then((res: any) => { });
|
|
};
|
|
};
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -248,8 +245,9 @@ const getSunshineRunPushData = async () => {
|
|
*/
|
|
*/
|
|
const initSunshineRun = () => {
|
|
const initSunshineRun = () => {
|
|
sunshineRunWs((e: any) => {
|
|
sunshineRunWs((e: any) => {
|
|
- console.log('eeeee', e);
|
|
|
|
- // openRanking();
|
|
|
|
|
|
+ //console.log('eeeee', e);
|
|
|
|
+ //定时打开排行榜
|
|
|
|
+ openRanking();
|
|
if (e?.wksid) {
|
|
if (e?.wksid) {
|
|
startConnect();
|
|
startConnect();
|
|
}
|
|
}
|
|
@@ -262,9 +260,8 @@ const initSunshineRun = () => {
|
|
return !ids.includes(item.student_id);
|
|
return !ids.includes(item.student_id);
|
|
});
|
|
});
|
|
testList.value = [...e.data, ...list];
|
|
testList.value = [...e.data, ...list];
|
|
- //清除之前的重新执行定时打开排行榜
|
|
|
|
- // closeRanking();
|
|
|
|
- // openRanking();
|
|
|
|
|
|
+ //定时打开排行榜
|
|
|
|
+ openRanking();
|
|
//模拟数据
|
|
//模拟数据
|
|
// setInterval(() => {
|
|
// setInterval(() => {
|
|
// getSunshineRunPushData();
|
|
// getSunshineRunPushData();
|
|
@@ -280,9 +277,8 @@ const initSunshineRun = () => {
|
|
testList.value.splice(myIndex, 1); //删除数据
|
|
testList.value.splice(myIndex, 1); //删除数据
|
|
}
|
|
}
|
|
testList.value.unshift(e.data); //插入数据
|
|
testList.value.unshift(e.data); //插入数据
|
|
- //清除之前的重新执行定时打开排行榜
|
|
|
|
- // closeRanking();
|
|
|
|
- // openRanking();
|
|
|
|
|
|
+ //定时打开排行榜
|
|
|
|
+ openRanking();
|
|
}
|
|
}
|
|
});
|
|
});
|
|
};
|
|
};
|
|
@@ -290,20 +286,19 @@ const initSunshineRun = () => {
|
|
/**
|
|
/**
|
|
* 定时打开排行榜
|
|
* 定时打开排行榜
|
|
*/
|
|
*/
|
|
-// const openRanking = () => {
|
|
|
|
-// clearTimeout(timer.value);
|
|
|
|
-// timer.value = setTimeout(() => {
|
|
|
|
-// rankingWindowRef.value.open();
|
|
|
|
-// }, 1000 * 60 * 5);
|
|
|
|
-// };
|
|
|
|
-
|
|
|
|
-/**
|
|
|
|
- * 关闭排行榜
|
|
|
|
- */
|
|
|
|
-// const closeRanking = () => {
|
|
|
|
-// rankingWindowRef.value.close();
|
|
|
|
-// clearTimeout(timer.value);
|
|
|
|
-// };
|
|
|
|
|
|
+const openRanking = () => {
|
|
|
|
+ clearTimeout(timer.value);
|
|
|
|
+ if (rankingWindowRef.value.rankingState) {
|
|
|
|
+ rankingWindowRef.value.close();
|
|
|
|
+ }
|
|
|
|
+ console.log("timer.value", timer.value)
|
|
|
|
+ // 设置新的定时器,6秒后执行
|
|
|
|
+ timer.value = setTimeout(() => {
|
|
|
|
+ if (!rankingWindowRef.value.rankingState) {
|
|
|
|
+ rankingWindowRef.value.open();
|
|
|
|
+ }
|
|
|
|
+ }, 1000 * 60 * 5);
|
|
|
|
+};
|
|
|
|
|
|
onBeforeMount(() => {
|
|
onBeforeMount(() => {
|
|
//获取当前时间
|
|
//获取当前时间
|
|
@@ -319,8 +314,6 @@ onBeforeMount(() => {
|
|
}
|
|
}
|
|
//单位
|
|
//单位
|
|
unit.value = 'M';
|
|
unit.value = 'M';
|
|
- //初始化手势
|
|
|
|
- initSunshineRun();
|
|
|
|
//排行榜
|
|
//排行榜
|
|
getAutoplay();
|
|
getAutoplay();
|
|
});
|
|
});
|
|
@@ -340,10 +333,12 @@ onBeforeMount(() => {
|
|
// { immediate: true }
|
|
// { immediate: true }
|
|
// );
|
|
// );
|
|
|
|
|
|
-onMounted(() => {});
|
|
|
|
|
|
+onMounted(() => {
|
|
|
|
+ //初始化WS
|
|
|
|
+ initSunshineRun();
|
|
|
|
+});
|
|
|
|
|
|
onBeforeUnmount(() => {
|
|
onBeforeUnmount(() => {
|
|
- // closeRanking();
|
|
|
|
getClearTimer();
|
|
getClearTimer();
|
|
});
|
|
});
|
|
</script>
|
|
</script>
|