Browse Source

日程开发

linxuxiang 1 month ago
parent
commit
3a3ef5e4b3

BIN
src/assets/images/ranking/jiangtai.png


BIN
src/assets/images/ranking/mao1.png


BIN
src/assets/images/ranking/mao2.png


BIN
src/assets/images/ranking/mao3.png


+ 14 - 13
src/components/MultipleItem/index.vue

@@ -383,20 +383,20 @@ const initProject = () => {
     return false;
   }
   //自动项目定时进入下一步
-  if (props.needStart == false) {
-    let time = 0;
-    // 控制开启速度
-    if (resultId.value) {
-      time = 10000;
+  //if (props.needStart == false) {}
+  let time = 0;
+  // 控制开启速度
+  if (resultId.value) {
+    time = 10000;
+  }
+  setTimeout(() => {
+    //再加一个判断以免和再测一次冲突
+    if (examState.value == 3 || examState.value == 43) {
+      console.log("执行了执行了执行了执行了执行了")
+      getOpenOneTestAndStartFace();
     }
-    setTimeout(() => {
-      //再加一个判断以免和再测一次冲突
-      if (examState.value == 3 || examState.value == 43) {
-        console.log("执行了执行了执行了执行了执行了")
-        getOpenOneTestAndStartFace();
-      }
-    }, time)
-  }
+  }, time)
+
 };
 
 /**
@@ -416,6 +416,7 @@ const getAchievement = (data: any) => {
   data.count = count || "0";
   data.score = data.score || "0";
   currentResultObj.value = data;
+  emit('returnData', { count: data.count, area: area });
   //违规处理
   let arr = backReason.value;
   if (["situp", "pullup", "sidepullup", "jumprope", "jumpingjack", "highknees", "jump", "longjump", "verticaljump"]

+ 172 - 13
src/components/MultipleItemRanking/index.vue

@@ -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>

+ 7 - 2
src/views/train/multiple.vue

@@ -4,7 +4,7 @@
     <Transition :enter-active-class="proxy?.animate.dialog.enter" :leave-active-class="proxy?.animate.dialog.leave">
       <div class="time"
         :class="{ 'time1': styleType == 1, 'time2': styleType == 2, 'time3': styleType == 3, 'time4': styleType == 4, }"
-        v-show="(needStart && [42].includes(examState)) || (['jumprope', 'jumpingjack', 'highknees', 'situp'].includes(parameter.project) && [42].includes(examState))">
+        v-show="(needStart && [42].includes(examState))">
         {{
           time.countdownNum
         }}
@@ -73,6 +73,8 @@
     </div>
     <!--倒计时结束-->
     <ChooseStudent ref="chooseStudentRef" @returnData="returnStudent" />
+    <!--排行榜-->
+    <MultipleItemRanking ref="multipleItemRankingRef" :testList="testList"></MultipleItemRanking>
   </div>
 </template>
 
@@ -101,6 +103,8 @@ const router = useRouter();
 const route = useRoute();
 const reportListRef = ref();
 const chooseStudentRef = ref();
+const multipleItemRankingRef = ref();
+
 const data = reactive<any>({
   timerManager: {}, //计时器管理
   parameter: {}, //参数
@@ -414,7 +418,7 @@ const returnData = (data: any) => {
         if (handcontroller && ctrl) {
           speckText(`请${ctrl}区举左手开始识别`);
         } else {
-          proxy?.$modal.msgWarning(`请点击右下角的【开始识别】`);
+          //proxy?.$modal.msgWarning(`请点击右下角的【开始识别】`);
         }
       }
     }
@@ -511,6 +515,7 @@ const returnData = (data: any) => {
     if (flag) {
       console.log('变更状态:', 3);
       examState.value = 3;
+      multipleItemRankingRef.value.open();
     }
   }