|
@@ -1,23 +1,54 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
<Transition :enter-active-class="proxy?.animate.face.enter" :leave-active-class="proxy?.animate.face.right">
|
|
|
- <div class="mask" v-show="windowState">
|
|
|
+ <div class="mask" v-if="windowState" @click="close">
|
|
|
<div class="rankingBox">
|
|
|
<div class="top">
|
|
|
- <div class="two">
|
|
|
- <div class="userInfo">
|
|
|
- <i class="pai"></i>
|
|
|
- <div class="touxiang">
|
|
|
-
|
|
|
+ <div class="item two">
|
|
|
+ <div>
|
|
|
+ <div class="userInfo">
|
|
|
+ <div class="maozi maozi2">2</div>
|
|
|
+ <div class="touxiang">
|
|
|
+ <img :src="twoObj.faceCheckStu.face_pic || twoObj.faceCheckStu.logo_url" v-if="twoObj.faceCheckStu.face_pic || twoObj.faceCheckStu.logo_url" />
|
|
|
+ <img src="@/assets/images/test/profilePicture2.png" v-else />
|
|
|
+ </div>
|
|
|
+ <div class="name">
|
|
|
+ {{ twoObj.faceCheckStu.name }}
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- <div class="name">
|
|
|
-
|
|
|
+ <div class="score">{{ twoObj.count || 0 }}</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="item one">
|
|
|
+ <div>
|
|
|
+ <div class="userInfo">
|
|
|
+ <div class="maozi maozi1">1</div>
|
|
|
+ <div class="touxiang">
|
|
|
+ <img :src="oneObj.faceCheckStu.face_pic || oneObj.faceCheckStu.logo_url" v-if="oneObj.faceCheckStu.face_pic || oneObj.faceCheckStu.logo_url" />
|
|
|
+ <img src="@/assets/images/test/profilePicture2.png" v-else />
|
|
|
+ </div>
|
|
|
+ <div class="name">
|
|
|
+ {{ oneObj.faceCheckStu.name }}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="score">{{ oneObj.count || 0 }}</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="item three">
|
|
|
+ <div>
|
|
|
+ <div class="userInfo">
|
|
|
+ <div class="maozi maozi3">3</div>
|
|
|
+ <div class="touxiang">
|
|
|
+ <img :src="threeObj.faceCheckStu.face_pic || threeObj.faceCheckStu.logo_url" v-if="threeObj.faceCheckStu.face_pic || threeObj.faceCheckStu.logo_url" />
|
|
|
+ <img src="@/assets/images/test/profilePicture2.png" v-else />
|
|
|
+ </div>
|
|
|
+ <div class="name">
|
|
|
+ {{ threeObj.faceCheckStu.name }}
|
|
|
+ </div>
|
|
|
</div>
|
|
|
+ <div class="score">{{ threeObj.count || 0 }}</div>
|
|
|
</div>
|
|
|
- <div class="score"></div>
|
|
|
</div>
|
|
|
- <div class="one"></div>
|
|
|
- <div class="three"></div>
|
|
|
</div>
|
|
|
<div class="bottom"></div>
|
|
|
</div>
|
|
@@ -29,14 +60,36 @@
|
|
|
<script setup lang="ts">
|
|
|
const { proxy } = getCurrentInstance() as any;
|
|
|
|
|
|
+//父值
|
|
|
+const props = defineProps({
|
|
|
+ testList: {
|
|
|
+ type: Object,
|
|
|
+ default: []
|
|
|
+ },
|
|
|
+});
|
|
|
+
|
|
|
const data = reactive<any>({
|
|
|
windowState: false,//窗口状态
|
|
|
+ oneObj: {},
|
|
|
+ twoObj: {},
|
|
|
+ threeObj: {},
|
|
|
});
|
|
|
|
|
|
-const { windowState } = toRefs(data);
|
|
|
+const { windowState, oneObj, twoObj, threeObj } = toRefs(data);
|
|
|
|
|
|
//打开
|
|
|
const open = () => {
|
|
|
+ let list = JSON.parse(JSON.stringify(props.testList))
|
|
|
+ list.sort((a:any, b:any) => Number(b.count) - Number(a.count));
|
|
|
+ if(list[0]){
|
|
|
+ oneObj.value = list[0];
|
|
|
+ }
|
|
|
+ if(list[1]){
|
|
|
+ twoObj.value = list[1];
|
|
|
+ }
|
|
|
+ if(list[2]){
|
|
|
+ threeObj.value = list[2]
|
|
|
+ }
|
|
|
windowState.value = true;
|
|
|
};
|
|
|
|
|
@@ -45,6 +98,23 @@ const close = (data?: any) => {
|
|
|
windowState.value = false;
|
|
|
};
|
|
|
|
|
|
+/**
|
|
|
+ * 播报时间
|
|
|
+ */
|
|
|
+watch(
|
|
|
+ () => windowState.value,
|
|
|
+ (newData) => {
|
|
|
+ if (newData == true) {
|
|
|
+ setTimeout(() => {
|
|
|
+ if (windowState.value == true) {
|
|
|
+ close();
|
|
|
+ }
|
|
|
+ }, 8000)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ { immediate: true }
|
|
|
+);
|
|
|
+
|
|
|
//暴露给父组件用
|
|
|
defineExpose({
|
|
|
open,
|
|
@@ -58,7 +128,96 @@ defineExpose({
|
|
|
width: 100vw;
|
|
|
top: 0;
|
|
|
left: 0;
|
|
|
- background: rgba(0, 0, 0, 0.3);
|
|
|
+ background: rgba(0, 0, 0, 0.8);
|
|
|
z-index: 998;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+}
|
|
|
+
|
|
|
+.rankingBox {
|
|
|
+ width: 50%;
|
|
|
+
|
|
|
+ .top {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-around;
|
|
|
+
|
|
|
+ .item {
|
|
|
+ display: flex;
|
|
|
+
|
|
|
+ .userInfo {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ flex-direction: column;
|
|
|
+
|
|
|
+ .maozi {
|
|
|
+ width: 60px;
|
|
|
+ height: 40px;
|
|
|
+ line-height: 40px;
|
|
|
+ text-align: center;
|
|
|
+ font-size: 20px;
|
|
|
+ color: #ffffff;
|
|
|
+ }
|
|
|
+
|
|
|
+ .maozi1 {
|
|
|
+ background: url('@/assets/images/ranking/mao1.png') center center no-repeat;
|
|
|
+ background-size: 100% 100%;
|
|
|
+ }
|
|
|
+
|
|
|
+ .maozi2 {
|
|
|
+ background: url('@/assets/images/ranking/mao2.png') center center no-repeat;
|
|
|
+ background-size: 100% 100%;
|
|
|
+ }
|
|
|
+
|
|
|
+ .maozi3 {
|
|
|
+ background: url('@/assets/images/ranking/mao3.png') center center no-repeat;
|
|
|
+ background-size: 100% 100%;
|
|
|
+ }
|
|
|
+
|
|
|
+ .touxiang {
|
|
|
+ width: 180px;
|
|
|
+ height: 180px;
|
|
|
+
|
|
|
+ img {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .name {
|
|
|
+ color: #000000;
|
|
|
+ height: 50px;
|
|
|
+ line-height: 50px;
|
|
|
+ border-radius: 25px;
|
|
|
+ padding: 0 20px;
|
|
|
+ background: radial-gradient(96% 96% at 2% 32%, #FFFFFF 0%, #FCFDFD 54%, #E1E4E7 100%);
|
|
|
+ box-shadow: inset 0px 1px 0px 2px rgba(255, 255, 255, 0.9046), inset 0px 3px 6px 0px rgba(0, 0, 0, 0.0851);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .score {
|
|
|
+ color: #ffffff;
|
|
|
+ font-size: 24px;
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .two {
|
|
|
+ position: relative;
|
|
|
+ bottom: -34px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .three {
|
|
|
+ position: relative;
|
|
|
+ bottom: -70px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .bottom {
|
|
|
+ width: 100%;
|
|
|
+ height: 30vh;
|
|
|
+ background: url('@/assets/images/ranking/jiangtai.png') center center no-repeat;
|
|
|
+ background-size: 100% 100%;
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|