人生啊人生 3 nedēļas atpakaļ
vecāks
revīzija
8751e59750
1 mainītis faili ar 14 papildinājumiem un 3 dzēšanām
  1. 14 3
      user_web/src/view/student/main/Main.vue

+ 14 - 3
user_web/src/view/student/main/Main.vue

@@ -88,6 +88,7 @@ const menuListEvent = (json, index) => {
         return;
     }
     
+    router.push('/train/list?courseId=' + db.id);
 
     // switch (json.name) {
 
@@ -131,7 +132,16 @@ const studentTaskGetSelfCourseEvent = () => {
                 "name" : objList?.name,
                 "logo" : objList?.logo,
                 "db" : objList,
+                "style_1" : "",
+                "style_2" : "",
             };
+
+            // 如果是没有课程
+            if (objList?.isAllocated == false) {
+                addJson["style_1"] = "background: linear-gradient(181deg, #c3c3c3 0%, #FFFFFF 100%);";
+                addJson["style_2"] = "color: #c1c1c1;";
+            }
+
             menuList.value.push(addJson);
         }
         
@@ -192,7 +202,7 @@ const studentTaskLearningAchievementStatisticsEvent = () => {
             addJson["stydyTime"] = totalStudyTimeNew;
             addJson["num"] = objArray.rank;
             addJson["numMax"] = objArray.totalStudentCount;
-            
+
             studyList.value.push(addJson);
 
             uiListIndex += 1;
@@ -289,11 +299,12 @@ onMounted(function() {
                 <div class="menuMain">
 
                     <div v-on:click="menuListEvent(item, index)"
-                    class="menuList" v-for="(item, index) of menuList" :key="index" >
+                    class="menuList" :style="item.style_1"
+                    v-for="(item, index) of menuList" :key="index" >
 
                         <img class="menuListLogo" :src="item.logo" />
 
-                        <div class="txt">
+                        <div class="txt" :style="item.style_2" >
                             {{ item.name }}
                         </div>