吴树波 1 ماه پیش
والد
کامیت
84e4ae21bd
1فایلهای تغییر یافته به همراه3 افزوده شده و 13 حذف شده
  1. 3 13
      src/views/course/userCoursePeriod/index.vue

+ 3 - 13
src/views/course/userCoursePeriod/index.vue

@@ -303,6 +303,7 @@
       <el-table v-loading="course.loading" :data="course.list">
         <el-table-column label="课程" align="center" prop="courseName" />
         <el-table-column label="小节" align="center" prop="videoName" />
+        <el-table-column label="营期时间" align="center" prop="dayDate" />
         <el-table-column v-if="course.row.redPacketGrantMethod == 2" label="红包金额" align="center" prop="money">
           <template slot-scope="scope">
             <el-input v-model="scope.row.money">
@@ -877,19 +878,8 @@ export default {
       const startDate = this.getUTCDate(start);
       const endDate = this.getUTCDate(end);
 
-      // 判断是否为同一天(UTC 日期)
-      const isSameDay =
-        startDate.getUTCFullYear() === endDate.getUTCFullYear() &&
-        startDate.getUTCMonth() === endDate.getUTCMonth() &&
-        startDate.getUTCDate() === endDate.getUTCDate();
-
-      if (isSameDay) {
-        return 1; // 同一天返回 1
-      } else {
-        // 计算非同日期的天数差(基于 UTC 午夜时间)
-        const timeDiff = endDate - startDate;
-        return Math.floor(timeDiff / (1000 * 3600 * 24)); // 直接取整
-      }
+      const timeDiff = endDate - startDate;
+      return (Math.floor(timeDiff / (1000 * 3600 * 24))) + 1; // 直接取整
     },
     getUTCDate(dateStr) {
       const [year, month, day] = dateStr.split('-').map(Number);