黄琪勇 1 year ago
parent
commit
09fd353224
2 changed files with 36 additions and 31 deletions
  1. 33 28
      src/components/myCalendar/myCalendar.vue
  2. 3 3
      src/views/curriculum/hooks/useStartClass.ts

+ 33 - 28
src/components/myCalendar/myCalendar.vue

@@ -21,9 +21,13 @@
       </template>
       <template #date-cell="{ data }">
          <div class="dayCon" @click.stop>
-            <div v-if="data.type === 'current-month'" class="dayBox" @click.stop="handleClickDate(data)">
-               <div class="daytit" :class="isMarkClass(data.day)">
-                  {{ format() === data.day ? "今" : format(data.day, "d") }}
+            <div v-if="data.type === 'current-month'" :class="isMarkClass(data.day)" class="dayBox" @click.stop="handleClickDate(data)">
+               <div class="daytit">
+                  {{
+                     format() === data.day && format(props.modelValue, "yyyy/mm/dd") !== format(new Date(), "yyyy/mm/dd")
+                        ? "今"
+                        : format(data.day, "d")
+                  }}
                </div>
             </div>
             <div v-else class="nobg"></div>
@@ -193,15 +197,7 @@ function handleClickDate(data: { type: "prev-month" | "current-month" | "next-mo
             &:hover {
                background: #fff7ed;
             }
-         }
-         .nobg {
-            height: var(--el-calendar-cell-width);
-         }
-         .daytit {
-            font-weight: 600;
-            font-size: 28px;
-            position: relative;
-            &.old {
+            &.old .daytit {
                &::after {
                   content: "";
                   position: absolute;
@@ -215,19 +211,30 @@ function handleClickDate(data: { type: "prev-month" | "current-month" | "next-mo
                }
             }
             &.new {
-               &::after {
-                  content: "";
-                  position: absolute;
-                  width: 8px;
-                  height: 8px;
-                  border-radius: 50%;
-                  bottom: -14px;
-                  left: 50%;
-                  transform: translateX(-50%);
-                  background-color: #ff8057;
+               background: #fff7ed;
+               .daytit {
+                  &::after {
+                     content: "";
+                     position: absolute;
+                     width: 8px;
+                     height: 8px;
+                     border-radius: 50%;
+                     bottom: -14px;
+                     left: 50%;
+                     transform: translateX(-50%);
+                     background-color: #ff8057;
+                  }
                }
             }
          }
+         .nobg {
+            height: var(--el-calendar-cell-width);
+         }
+         .daytit {
+            font-weight: 600;
+            font-size: 28px;
+            position: relative;
+         }
       }
       &.is-today .el-calendar-day .dayCon .dayBox {
          background-image: url("./img//jiao.png");
@@ -238,12 +245,10 @@ function handleClickDate(data: { type: "prev-month" | "current-month" | "next-mo
    &.isNowMonth .el-calendar-table td.is-selected .el-calendar-day .dayCon .dayBox {
       background: linear-gradient(45deg, #ffa357 0%, #ff6736 100%), #fff7ed;
       color: #ffffff;
-      .daytit {
-         &.old,
-         &.new {
-            &::after {
-               background-color: #fff;
-            }
+      &.old .daytit,
+      &.new .daytit {
+         &::after {
+            background-color: #fff;
          }
       }
    }

+ 3 - 3
src/views/curriculum/hooks/useStartClass.ts

@@ -62,7 +62,7 @@ export function isONLINE_gym(teachMode: string) {
 export function handleStartClass_gyt(id: string) {
    httpAjaxErrMsg(getCourseScheduleDetail_gyt, id).then(res => {
       if (res.code === 200) {
-         const { signIn, rollCall, lessonCoursewareId, startTime, endTime, status } = res.data
+         const { signIn, rollCall, lessonCoursewareDetailId, startTime, endTime, status } = res.data
          if (status === "COMPLETE") {
             useDialogConfirm({
                headImg: require("@/img/curriculum/ts4.png"),
@@ -87,7 +87,7 @@ export function handleStartClass_gyt(id: string) {
             })
             return
          }
-         if (!lessonCoursewareId) {
+         if (!lessonCoursewareDetailId) {
             useDialogConfirm({
                headImg: require("@/img/curriculum/ts3.png"),
                text: `该课程未配置课件,请配置课件。`,
@@ -95,7 +95,7 @@ export function handleStartClass_gyt(id: string) {
             })
             return
          }
-         handlePaly(lessonCoursewareId)
+         handlePaly(lessonCoursewareDetailId)
       }
    })
 }