shmily1213 3 недель назад
Родитель
Сommit
c3ce6422e7

+ 2 - 2
index.html

@@ -16,10 +16,10 @@
   <!--preload-links-->
   <!--app-context-->
   
-  <script src="https://unpkg.com/vconsole@3.15.1/dist/vconsole.min.js"></script>
+  <!-- <script src="https://unpkg.com/vconsole@3.15.1/dist/vconsole.min.js"></script>
   <script>
     const vconsole = new VConsole();
-  </script>
+  </script> -->
 </head>
 
 <body>

+ 1 - 0
package.json

@@ -43,6 +43,7 @@
     "unplugin-auto-import": "^19.3.0",
     "unplugin-vue-components": "^28.7.0",
     "vite": "5.2.8",
+    "vite-plugin-compression": "^0.5.1",
     "vite-plugin-uni-polyfill": "^0.1.0"
   }
 }

+ 3 - 3
src/api/modules/study.ts

@@ -1,6 +1,6 @@
 import { ApiResponse, ApiResponseList } from "@/types";
 import flyio from "../flyio";
-import { ApiQuestion, DirectedSchool, Examinee, ExamPaper, ExamPaperSubmit, GetExamPaperRequestDTO, Knowledge, KnowledgeListRequestDTO, KnowledgeRecord, OpenExamineeRequestDTO, SimulatedRecord, SimulationTestInfo, StudyPlan, Subject, SubjectListRequestDTO, VideoStudyRecord } from "@/types/study";
+import { ApiQuestion, DirectedSchool, Examinee, ExamPaper, ExamPaperSubmit, GetExamPaperRequestDTO, Knowledge, KnowledgeListRequestDTO, KnowledgeRecord, OpenExamineeRequestDTO, PracticeRecord, SimulatedRecord, SimulationTestInfo, StudyPlan, Subject, SubjectListRequestDTO, VideoStudyRecord } from "@/types/study";
 
 /**
  * 获取学习计划
@@ -156,8 +156,8 @@ export function getSimulatedRecord() {
  * @param params 
  * @returns 
  */
-export function getPlanStudyRecord(params: {year: number, monthSeq: number, weekSeq: number}) {
-  return flyio.get('/front/student/record/planStudy', params) as Promise<ApiResponse<any>>;
+export function getPlanStudyRecord(params: { year: number, month: number }) {
+  return flyio.get('/front/student/record/planStudy', params) as Promise<ApiResponse<PracticeRecord>>;
 }
 
 /**

+ 84 - 228
src/composables/useCalendar.ts

@@ -1,38 +1,36 @@
 import { ref, computed, watch } from 'vue';
+import { getPlanStudyRecord } from '@/api/modules/study';
 // @ts-ignore
 import CalendarUtil from '@/uni_modules/uni-calendar/components/uni-calendar/util.js';
 
+export interface PracticeStatistics {
+  list: PracticeData[],
+  rate: number,
+  studyDays: number,
+  total: number,
+}
+
 export interface PracticeData {
   date: string;
   info: number;
   questionNum: number;
 }
 
-export interface PracticeStatistics {
-  totalQuestions: number; // 刷题总量
-  averageAccuracy: number; // 平均正确率
-  practiceDays: number; // 练习天数
-  totalPracticeDays: number; // 累计刷题天数(所有打点数据的总长度)
-}
-
 export function useCalendar() {
   const calendarUtil = new CalendarUtil();
   const globalStudentId = ref(0);
   const selected = ref<PracticeData[]>([]);
   const statistics = ref<PracticeStatistics>({
-    totalQuestions: 0,
-    averageAccuracy: 0,
-    practiceDays: 0,
-    totalPracticeDays: 0
+    list: [],
+    rate: 0,
+    studyDays: 0,
+    total: 0
   });
   const currentWeekNumber = ref(1); // 用于外部数据计算
   const calendarWeekNumber = ref(1); // 专门用于日历组件显示
   const currentDate = ref(new Date());
-  const displayMode = ref<'year' | 'month' | 'week'>('year');
+  const displayMode = ref<'year' | 'month'>('year');
   const loading = ref(false);
-  
-  // 配置变量:最早可访问的年份
-  const EARLIEST_YEAR = 2020;
 
   // 计算当前周范围
   const currentWeekRange = computed(() => {
@@ -50,13 +48,10 @@ export function useCalendar() {
     const current = currentDate.value;
 
     if (displayMode.value === 'year') {
-      return current.getFullYear() > EARLIEST_YEAR;
-    } else if (displayMode.value === 'week') {
-      // 周模式:支持跨年
-      return currentWeekNumber.value > 1 || !(current.getFullYear() === EARLIEST_YEAR && current.getMonth() === 0);
+      return current.getFullYear() > EARLIEST_YEAR.value;
     } else {
       // 月份模式:支持跨年,只要不是最早年份1月就可以往前切换
-      return !(current.getFullYear() === EARLIEST_YEAR && current.getMonth() === 0);
+      return !(current.getFullYear() === EARLIEST_YEAR.value && current.getMonth() === 0);
     }
   });
 
@@ -67,22 +62,6 @@ export function useCalendar() {
 
     if (displayMode.value === 'year') {
       return current.getFullYear() < today.getFullYear();
-    } else if (displayMode.value === 'week') {
-      // 检查是否已经到达当前日期
-      const isCurrentMonth = current.getFullYear() === today.getFullYear() &&
-        current.getMonth() === today.getMonth();
-
-      if (isCurrentMonth) {
-        // 当前月份,检查是否超过当前周
-        const firstDayOfMonth = new Date(current.getFullYear(), current.getMonth(), 1);
-        const firstWeekday = firstDayOfMonth.getDay() === 0 ? 7 : firstDayOfMonth.getDay();
-        const currentWeekInMonth = Math.ceil((today.getDate() + firstWeekday - 1) / 7);
-        return currentWeekNumber.value < currentWeekInMonth;
-      } else {
-        // 非当前月份,检查是否超过当前月份
-        return current.getFullYear() < today.getFullYear() ||
-          (current.getFullYear() === today.getFullYear() && current.getMonth() < today.getMonth());
-      }
     } else {
       // 月份模式,不能超过当前月份
       return current.getFullYear() < today.getFullYear() ||
@@ -90,186 +69,59 @@ export function useCalendar() {
     }
   });
 
-  // 模拟接口请求打点数据
-  // ==================== 真实接口对接说明 ====================
-  // 当对接真实接口时,请替换以下部分:
-  // 1. 删除模拟网络延迟:await new Promise(resolve => setTimeout(resolve, 300));
-  // 2. 替换为真实API调用:
-  //    const response = await api.getPracticeData({ startDate, endDate });
-  //    return response.data;
   // 3. 确保返回的数据格式符合 PracticeData[] 接口
   // 4. 统计数据会从返回的练习数据中自动计算,无需额外处理
   // ========================================================
-  const fetchPracticeData = async (startDate: string, endDate: string): Promise<PracticeData[]> => {
-    console.log('请求数据', startDate, endDate, globalStudentId.value)
-    // ========== 模拟网络延迟 - 真实接口时删除此部分 ==========
-    await new Promise(resolve => setTimeout(resolve, 300));
-
-    // ========== 模拟数据生成逻辑 - 真实接口时替换为API调用 ==========
-    // 生成日期范围内的随机几天数据
-    const start = new Date(startDate);
-    const end = new Date(endDate);
-    const practiceData: PracticeData[] = [];
-
-    // 计算总天数
-    const totalDays = Math.ceil((end.getTime() - start.getTime()) / (1000 * 60 * 60 * 24)) + 1;
-
-    // 根据时间范围决定练习天数
-    let practiceDays: number;
-    const today = new Date();
-    const isCurrentPeriod = start <= today && end >= today;
-    const isYearData = totalDays > 100; // 如果总天数超过100天,认为是年份数据
-
-    if (isYearData) {
-      // 年份数据,生成较多的练习天数
-      practiceDays = Math.floor(Math.random() * 100) + 50; // 50-150天
-    } else if (isCurrentPeriod) {
-      // 当前时间段,练习天数较少
-      practiceDays = Math.floor(Math.random() * 2) + 2; // 2-4天
-    } else if (start < today) {
-      // 过去时间段,练习天数较多
-      practiceDays = Math.floor(Math.random() * 4) + 4; // 4-8天
-    } else {
-      // 未来时间段,没有练习数据
-      return [];
-    }
-
-    // 确保不超过总天数
-    practiceDays = Math.min(practiceDays, totalDays);
-    const practiceDates = new Set<string>();
-
-    // 随机选择练习日期
-    while (practiceDates.size < practiceDays) {
-      const randomDay = Math.floor(Math.random() * totalDays);
-      const practiceDate = new Date(start);
-      practiceDate.setDate(practiceDate.getDate() + randomDay);
-      const dateStr = practiceDate.toISOString().split('T')[0];
-      practiceDates.add(dateStr);
-    }
-
-    // 为每个练习日期生成数据
-    practiceDates.forEach(dateStr => {
-      const questionNum = Math.floor(Math.random() * 20) + 10; // 10-30题
-      const correctRate = Math.random() * 0.4 + 0.6; // 0.6-1.0 的正确率
+  const fetchPracticeData = async (year: number, month: number): Promise<PracticeStatistics> => {
+    console.log('请求数据', year, month, globalStudentId.value)
+    let practiceData: PracticeStatistics = {
+      list: [],
+      rate: 0,
+      studyDays: 0,
+      total: 0
+    };
 
-      practiceData.push({
-        date: dateStr,
-        info: Math.round(correctRate * 100) / 100, // 四舍五入到两位小数
-        questionNum: questionNum
-      });
+    const { data } = await getPlanStudyRecord({
+      year,
+      month
     });
-
-    return practiceData.sort((a, b) => a.date.localeCompare(b.date));
+    practiceData.list = data.list.map(item => ({
+      date: item.date,
+      info: item.rate ? Number(item.rate) : 0,
+      questionNum: item.study ? Number(item.study) : 0
+    })).sort((a, b) => a.date.localeCompare(b.date));
+    practiceData.rate = data.rate ? Number(data.rate) : 0;
+    practiceData.studyDays = data.studyDays ? Number(data.studyDays) : 0;
+    practiceData.total = data.total ? Number(data.total) : 0;
+    console.log('response', practiceData)
+    return practiceData;
   };
 
 
   // 更新日历数据 - 统一的数据更新方法
-  const updateCalendarData = async (date?: Date, mode?: 'year' | 'month' | 'week', modeNumber?: number) => {
+  const updateCalendarData = async (year: number, month: number) => {
+    if (month !== 0) {
+      displayMode.value = 'month';
+      currentDate.value = new Date(year, month - 1, 1);
+    } else {
+      displayMode.value = 'year';
+      currentDate.value = new Date(year, month, 1);
+    }
+    console.log(year, month)
+
+    console.log('currentDate', currentDate.value)
     loading.value = true;
     try {
-      // 使用传入的参数或当前状态
-      const targetDate = date || currentDate.value;
-      const targetMode = mode || displayMode.value;
-      const targetModeNumber = modeNumber !== undefined ? modeNumber : 
-        (targetMode === 'week' ? currentWeekNumber.value : 
-         targetMode === 'month' ? (date ? date.getMonth() + 1 : currentDate.value.getMonth() + 1) : 
-         targetDate.getFullYear());
-
-      // 计算数据范围
-      let startDate: string, endDate: string;
-      
-      if (targetMode === 'year') {
-        // 年份模式:从1月1日到12月31日
-        const year = targetModeNumber;
-        startDate = `${year}-01-01`;
-        endDate = `${year}-12-31`;
-      } else if (targetMode === 'week') {
-        // 周模式:根据指定周数计算范围
-        const range = calendarUtil.getCurrentWeekRange(targetDate, targetModeNumber);
-        startDate = range.startDate;
-        endDate = range.endDate;
-      } else {
-        // 月份模式:根据指定月份计算范围
-        const year = targetDate.getFullYear();
-        const month = targetModeNumber; // 使用传入的月份参数
-        const start = new Date(year, month - 1, 1);
-        const end = new Date(year, month, 0); // 获取该月最后一天
-        startDate = start.getFullYear() + '-' + String(start.getMonth() + 1).padStart(2, '0') + '-' + String(start.getDate()).padStart(2, '0');
-        endDate = end.getFullYear() + '-' + String(end.getMonth() + 1).padStart(2, '0') + '-' + String(end.getDate()).padStart(2, '0');
-      }
-
       // 请求数据
-      const practiceData = await fetchPracticeData(startDate, endDate);
-
+      const practiceData = await fetchPracticeData(year, month);
       // 更新状态
-      currentDate.value = targetDate;
-      displayMode.value = targetMode;
-      
-      if (targetMode === 'week') {
-        currentWeekNumber.value = targetModeNumber;
-        calendarWeekNumber.value = targetModeNumber;
-      }
-      
-      selected.value = practiceData;
-
-      // 计算统计数据
-      const totalQuestions = practiceData.reduce((sum, item) => sum + item.questionNum, 0);
-      const averageAccuracy = practiceData.length > 0
-        ? practiceData.reduce((sum, item) => sum + item.info, 0) / practiceData.length
-        : 0;
-      const practiceDays = practiceData.length;
-      const totalPracticeDays = practiceData.length; // 累计刷题天数就是打点数据的长度
-
-      statistics.value = {
-        totalQuestions,
-        averageAccuracy: Math.round(averageAccuracy * 100) / 100,
-        practiceDays,
-        totalPracticeDays
-      };
+      selected.value = practiceData.list
+      statistics.value = practiceData;
     } finally {
       loading.value = false;
     }
   };
 
-
-  // 切换到上一周
-  const goToPrevWeek = async () => {
-    if (!canGoPrev.value) return;
-
-    if (currentWeekNumber.value > 1) {
-      await updateCalendarData(undefined, 'week', currentWeekNumber.value - 1);
-    } else {
-      // 切换到上个月的最后一周
-      const currentMonth = currentDate.value.getMonth();
-      const currentYear = currentDate.value.getFullYear();
-      
-      // 计算上个月的年月
-      const prevYear = currentMonth === 0 ? currentYear - 1 : currentYear;
-      const prevMonth = currentMonth === 0 ? 11 : currentMonth - 1;
-      
-      const preDate = new Date(prevYear, prevMonth, 1);
-      calendarUtil.setDate(preDate);
-      const range = calendarUtil.getCurrentWeekRange(preDate);
-      await updateCalendarData(preDate, 'week', range.totalWeeks);
-    }
-  };
-
-  // 切换到下一周
-  const goToNextWeek = async () => {
-    if (!canGoNext.value) return;
-
-    const range = currentWeekRange.value;
-    if (currentWeekNumber.value < range.totalWeeks) {
-      await updateCalendarData(undefined, 'week', currentWeekNumber.value + 1);
-    } else {
-      // 切换到下个月的第一周
-      const nextDate = new Date(currentDate.value);
-      nextDate.setMonth(nextDate.getMonth() + 1);
-      calendarUtil.setDate(nextDate);
-      await updateCalendarData(nextDate, 'week', 1);
-    }
-  };
-
   // 切换到上一个月
   const goToPrevMonth = async () => {
     if (!canGoPrev.value) return;
@@ -277,9 +129,9 @@ export function useCalendar() {
     const currentMonth = currentDate.value.getMonth();
     const targetMonth = currentMonth === 0 ? 12 : currentMonth; // 如果当前是1月,目标月份是12月
     const targetYear = currentMonth === 0 ? currentDate.value.getFullYear() - 1 : currentDate.value.getFullYear();
-    
-    const preDate = new Date(targetYear, targetMonth - 1, 1);
-    await updateCalendarData(preDate, 'month', targetMonth);
+    const prevDate = new Date(targetYear, targetMonth - 1, 1);
+    currentDate.value = prevDate;
+    await updateCalendarData(targetYear, targetMonth);
   };
 
   // 切换到下一个月
@@ -289,34 +141,42 @@ export function useCalendar() {
     const currentMonth = currentDate.value.getMonth();
     const targetMonth = currentMonth === 11 ? 1 : currentMonth + 2; // 如果当前是12月,目标月份是1月
     const targetYear = currentMonth === 11 ? currentDate.value.getFullYear() + 1 : currentDate.value.getFullYear();
-    
-    const nextDate = new Date(targetYear, targetMonth - 1, 1);
-    await updateCalendarData(nextDate, 'month', targetMonth);
-  };
 
-  // 设置显示模式
-  const setDisplayMode = async (mode: 'year' | 'month' | 'week') => {
-    await updateCalendarData(undefined, mode);
+    const nextDate = new Date(targetYear, targetMonth - 1, 1);
+    currentDate.value = nextDate;
+    await updateCalendarData(targetYear, targetMonth);
   };
 
   // 根据年份跳转
   const goToYear = async (year: number) => {
-    const targetDate = new Date(year, 0, 1); // 年初
-    await updateCalendarData(targetDate, 'year', year);
+    await updateCalendarData(year, 0);
   };
 
   // 根据年份和月份跳转
   const goToYearMonth = async (year: number, month: number) => {
-    const targetDate = new Date(year, month - 1, 1);
-    await updateCalendarData(targetDate, 'month', month);
+    await updateCalendarData(year, month);
   };
 
-  // 根据周数跳转
-  const goToWeek = async (weekNumber: number) => {
-    if (weekNumber >= 1 && weekNumber <= currentWeekRange.value.totalWeeks) {
-      await updateCalendarData(undefined, 'week', weekNumber);
-    }
-  };
+  // 生成可以选择的年份列表,默认去年+今年
+  const yearList = computed(() => {
+    const today = new Date();
+    const currentYear = today.getFullYear();
+    return [
+      {
+        label: currentYear - 1,
+        value: currentYear - 1
+      },
+      {
+        label: currentYear,
+        value: currentYear
+      }
+    ];
+  })
+
+  // 配置变量:最早可访问的年份
+  const EARLIEST_YEAR = computed(() => {
+    return yearList.value[0].value;
+  });
 
   // 获取当前年份
   const currentYear = computed(() => currentDate.value.getFullYear());
@@ -332,7 +192,6 @@ export function useCalendar() {
     return {
       year: currentYearToday.toString(),
       month: '', // 默认不选择月份
-      week: '' // 默认不选择周
     };
   };
 
@@ -340,7 +199,7 @@ export function useCalendar() {
   const init = async (studentId: number) => {
     const today = new Date();
     globalStudentId.value = studentId;
-    await updateCalendarData(today, 'year', today.getFullYear());
+    await updateCalendarData(today.getFullYear(), 0);
   };
 
   return {
@@ -354,29 +213,26 @@ export function useCalendar() {
     displayMode,
     currentWeekRange,
     currentMonthRange,
-    
+
     // 状态
     canGoPrev,
     canGoNext,
     loading,
-    
+
     // 计算属性
     currentYear,
     currentMonth,
-    
+
     // 配置
     EARLIEST_YEAR,
-    
+    yearList,
+
     // 方法
     updateCalendarData,
-    goToPrevWeek,
-    goToNextWeek,
     goToPrevMonth,
     goToNextMonth,
     goToYear,
     goToYearMonth,
-    goToWeek,
-    setDisplayMode,
     initializeFormData,
     init
   };

+ 5 - 3
src/pagesMain/pages/splash/splash.vue

@@ -22,9 +22,11 @@ const imgLaunch = computed(() => {
   return config.ossUrl + '/launch.png'
 });
 const handleLoad = () => {
-  window.webviewBridge.getStatusBarHeight().then(height => {
-    appStore.statusBarHeight = height;
-  });
+  if (window.platform === 'wap2app') {
+    window.webviewBridge.getStatusBarHeight().then(height => {
+      appStore.statusBarHeight = height;
+    });
+  }
   // 执行初始化的操作:预加载字典、提前校验token是否有效等
   appStore.init().then(() => {
     setTimeout(() => {

+ 82 - 77
src/pagesOther/pages/video-center/index/components/video-page-layout.vue

@@ -1,104 +1,109 @@
 <template>
-    <z-paging ref="paging" v-model="list" @query="handleQuery" @on-refresh="handleRefresh">
-        <view v-if="list.length" class="p-30">
-            <tree-view :tree-data="list" @leaf-click="handleLeafClick">
-                <template #icon="{deep}">
-                    <uv-icon v-if="deep==0" name="arrow-right"/>
-                </template>
-                <template #node="{node, deep}">
-                    <view v-if="deep==0" class="flex-1 fx-col gap-5">
-                        <text class="text-main font-[PingFang]">{{ node.label }}</text>
-                    </view>
-                    <view v-else class="flex-1 fx-row items-center gap-10">
-                        <uv-icon :name="node.img" width="40" height="40" img-mode="cover"
-                                 class="rounded-[20px] overflow-hidden"/>
-                        <text class="text-main text-sm font-[PingFang]">{{ node.name }}</text>
-                    </view>
-                </template>
-                <template #command="{node, deep}">
-                    <uv-button v-if="deep > 0" type="primary" shape="circle" text="播放" icon="play-circle"
-                               icon-color="(--primary-color)" plain :custom-style="{height: '32px'}"
-                               @click="handleVideoPlay(node)"/>
-                </template>
-            </tree-view>
-        </view>
-    </z-paging>
+  <z-paging ref="paging" v-model="list" @query="handleQuery" @on-refresh="handleRefresh">
+    <view v-if="list.length" class="p-30">
+      <tree-view :tree-data="list" @leaf-click="handleLeafClick">
+        <template #icon="{ deep }">
+          <uv-icon v-if="deep == 0" name="arrow-right" />
+        </template>
+        <template #node="{ node, deep }">
+          <view v-if="deep == 0" class="flex-1 fx-col gap-5">
+            <text class="text-main font-[PingFang]">{{ node.label }}</text>
+          </view>
+          <view v-else class="flex-1 fx-row items-center gap-10">
+            <uv-icon :name="node.img" width="40" height="40" img-mode="cover" class="rounded-[20px] overflow-hidden" />
+            <text class="text-main text-sm font-[PingFang]">{{ node.name }}</text>
+          </view>
+        </template>
+        <template #command="{ node, deep }">
+          <uv-button v-if="deep > 0" type="primary" shape="circle" text="播放" icon="play-circle"
+            icon-color="(--primary-color)" plain :custom-style="{ height: '32px' }" @click="handleVideoPlay(node)" />
+        </template>
+      </tree-view>
+    </view>
+  </z-paging>
 </template>
 
 <script setup>
-import {ref} from 'vue'
+import { ref } from 'vue'
+import { OPEN_VIP_POPUP } from '@/types/injectionSymbols';
 import TreeView from "@/pagesOther/pages/topic-center/index/components/tree-view.vue";
-import {useCacheStore} from "@/hooks/useCacheStore";
-import {cacheActions} from "@/hooks/defineCacheActions";
-import {empty} from "@/uni_modules/uv-ui-tools/libs/function/test";
-import {useTransfer} from "@/hooks/useTransfer";
+import { useCacheStore } from "@/hooks/useCacheStore";
+import { cacheActions } from "@/hooks/defineCacheActions";
+import { empty } from "@/uni_modules/uv-ui-tools/libs/function/test";
+import { useTransfer } from "@/hooks/useTransfer";
 import mxConst from "@/common/mxConst";
-
+import { useUserStore } from '@/store/userStore';
+const userStore = useUserStore();
+const openVipPopup = inject(OPEN_VIP_POPUP);
 const props = defineProps({
-    subject: {
-        type: Object,
-        default: () => ({})
-    }
+  subject: {
+    type: Object,
+    default: () => ({})
+  }
 })
 const list = ref([])
-const {dispatchCache, removeCache} = useCacheStore()
-const {transferTo} = useTransfer()
+const { dispatchCache, removeCache } = useCacheStore()
+const { transferTo } = useTransfer()
 const paging = ref(null)
 
 const handleQuery = async () => {
-    try {
-        const {code: subject} = props.subject
-        const res = await dispatchCache(cacheActions.getVideoKnowledge, {subject})
-        // 默认收起,因为有缓存,防止用户之前打开过多引起渲染缓慢
-        res.rows.forEach(k => k.expanded = false)
-        // completeByNoMore 非标准返回,后台未分页
-        paging.value.completeByNoMore(res.rows, true)
-    } catch {
-        paging.value.complete(false)
-    }
+  try {
+    const { code: subject } = props.subject
+    const res = await dispatchCache(cacheActions.getVideoKnowledge, { subject })
+    // 默认收起,因为有缓存,防止用户之前打开过多引起渲染缓慢
+    res.rows.forEach(k => k.expanded = false)
+    // completeByNoMore 非标准返回,后台未分页
+    paging.value.completeByNoMore(res.rows, true)
+  } catch {
+    paging.value.complete(false)
+  }
 }
 
 const handleRefresh = async () => {
-    // 知识点树可以精准清除
-    const {code: subject} = props.subject
-    removeCache(cacheActions.getVideoKnowledge, {subject})
-    // 视频只能全清,但因为缓存结果有挂在知识点上所以,旁边的tab见效没有那么快
-    removeCache(cacheActions.getVideoOfKnowledge)
+  // 知识点树可以精准清除
+  const { code: subject } = props.subject
+  removeCache(cacheActions.getVideoKnowledge, { subject })
+  // 视频只能全清,但因为缓存结果有挂在知识点上所以,旁边的tab见效没有那么快
+  removeCache(cacheActions.getVideoOfKnowledge)
 }
 
-const handleLeafClick = async ({node, deep}) => {
-    if (deep === 0) {
-        node.expanded = !!!node.expanded // 强制展开
-        if (empty(node.children)) {
-            if (!node.loading) {
-                node.loading = true
-                try {
-                    const payload = {subject: props.subject.code, knowledge: node.code, pageNum: 1, pageSize: 100}
-                    const res = await dispatchCache(cacheActions.getVideoOfKnowledge, payload)
-                    node.children = res.rows
-                } catch (e) {
-                    node.expanded = false // 异常强制关闭
-                } finally {
-                    node.loading = false
-                }
-            }
+const handleLeafClick = async ({ node, deep }) => {
+  if (deep === 0) {
+    node.expanded = !!!node.expanded // 强制展开
+    if (empty(node.children)) {
+      if (!node.loading) {
+        node.loading = true
+        try {
+          const payload = { subject: props.subject.code, knowledge: node.code, pageNum: 1, pageSize: 100 }
+          const res = await dispatchCache(cacheActions.getVideoOfKnowledge, payload)
+          node.children = res.rows
+        } catch (e) {
+          node.expanded = false // 异常强制关闭
+        } finally {
+          node.loading = false
         }
+      }
     }
+  }
 }
 
-const handleVideoPlay = (node) => {
-    // 尝试传递更多数据,不使用playVideo,启用usingCache
-    // playVideo(node.aliId, node.aliIdType, node.name)
+const handleVideoPlay = async (node) => {
+  // 尝试传递更多数据,不使用playVideo,启用usingCache
+  // playVideo(node.aliId, node.aliIdType, node.name)
+  const isVip = await userStore.checkVip();
+  if (isVip) {
     const nodeWithKnowledge = list.value.find(n => n.children?.includes(node))
     transferTo(mxConst.routes.videoPlay, {
-        aliId: node.aliId,
-        aliIdType: node.aliIdType,
-        title: node.name,
-        node: nodeWithKnowledge
+      aliId: node.aliId,
+      aliIdType: node.aliIdType,
+      title: node.name,
+      node: nodeWithKnowledge
     }, null, true)
+  } else {
+    openVipPopup();
+  }
+
 }
 </script>
 
-<style scoped>
-
-</style>
+<style scoped></style>

+ 12 - 14
src/pagesOther/pages/video-center/index/index.vue

@@ -1,22 +1,20 @@
 <template>
-    <view class="page-content">
-        <!-- <mx-nav-bar title="视频课程"/> -->
-         <ie-navbar title="视频课程"/>
-        <mx-tabs-swiper :tabs="subjects" :key-name="keyName" template="video" border>
-            <template #video="subject">
-                <video-page-layout :subject="subject"/>
-            </template>
-        </mx-tabs-swiper>
-    </view>
+  <ie-page class="page-content" :fix-height="true">
+    <!-- <mx-nav-bar title="视频课程"/> -->
+    <ie-navbar title="视频课程" />
+    <mx-tabs-swiper :tabs="subjects" :key-name="keyName" template="video" border>
+      <template #video="subject">
+        <video-page-layout :subject="subject" />
+      </template>
+    </mx-tabs-swiper>
+  </ie-page>
 </template>
 
 <script setup>
 import VideoPageLayout from "@/pagesOther/pages/video-center/index/components/video-page-layout.vue";
-import {useVideoSubjects} from "@/pagesOther/pages/video-center/hooks/useVideoSubjects";
+import { useVideoSubjects } from "@/pagesOther/pages/video-center/hooks/useVideoSubjects";
 
-const {subjects, keyName} = useVideoSubjects()
+const { subjects, keyName } = useVideoSubjects()
 </script>
 
-<style lang="scss">
-
-</style>
+<style lang="scss"></style>

+ 1 - 1
src/pagesStudy/components/knowledge-table.vue

@@ -9,7 +9,7 @@
         </view>
       </template>
       <template #rate="{ item }">
-        {{ item.rate }}%
+        <text :class="[item.rate < 70 ? 'text-danger' : 'text-fore-title']">{{ item.rate }}%</text>
       </template>
     </ie-table>
   </view>

+ 41 - 142
src/pagesStudy/components/practice-table.vue

@@ -19,14 +19,6 @@
             </template>
           </ie-picker>
         </view>
-        <view class="picker-wrap">
-          <ie-picker ref="pickerRef" :disabled="!form.month" v-model="form.week" :list="weekList" placeholder="请选择"
-            title="选择周" :fontSize="26" icon="arrow-down" key-label="label" key-value="value" @change="handleWeekChange">
-            <template #default="{ label }">
-              <text>{{ label }}</text>
-            </template>
-          </ie-picker>
-        </view>
         <view :class="calendarButtonClass" @click="canOpenCalendar ? handleOpenCalendar() : null">
           <text>刷题日历</text>
           <uv-icon name="search" size="16" :color="canOpenCalendar ? 'white' : '#CCCCCC'" />
@@ -43,10 +35,10 @@
     </view>
     <view class="mt-30 flex items-center">
       <text>已累计刷题</text>
-      <text class="text-32 text-primary">{{ totalPracticeDays }}</text>
+      <text class="text-32 text-primary">{{ practiceDays }}</text>
       <text>天~</text>
     </view>
-    <view v-if="(form.month || form.week) && displayMode !== 'year'" class="mt-30">
+    <view v-if="(form.month) && displayMode !== 'year'" class="mt-30">
       <ie-table :tableColumns="tableColumns" :data="tableDate">
         <template #date="{ item }">
           <text class="font-bold">{{ item.date }}</text>
@@ -55,7 +47,7 @@
           <text class="font-bold">{{ item.questionNum }}</text>
         </template>
         <template #correctNum="{ item }">
-          <text class="font-bold">{{ item.correctNum }}</text>
+          <text class="font-bold" :class="[item.info < 70 ? 'text-danger' : 'text-fore-title']">{{ item.info }}%</text>
         </template>
       </ie-table>
     </view>
@@ -82,26 +74,26 @@
               <view class="px-40 py-20 flex items-center justify-between">
                 <view class=" text-28">
                   <text>{{ calendarSubTitle }}</text>
-                  <text class="text-32 text-primary font-bold">{{ practiceDate }}</text>
+                  <text class="text-32 text-primary font-bold">{{ practiceDays }}</text>
                   <text>天~</text>
                 </view>
-                <uv-icon name="question-circle" size="18" color="#31a0fc" />
+                <!-- <uv-icon name="question-circle" size="18" color="#31a0fc" /> -->
               </view>
 
               <uni-calendar ref="calendarRef" :insert="true" :lunar="false" :readonly="true" :showMonth="false"
                 :sundayFirst="false" :highlightToday="false" :showToolbar="false" :displayMode="displayMode"
-                :weekNumber="calendarWeekNumber" :selected="[]" :date="currentDate"
-                @change-week="handleCalendarWeekChange" @monthSwitch="handleCalendarMonthSwitch">
+                :selected="selected" :date="currentDate" @change-week="handleCalendarWeekChange"
+                @monthSwitch="handleCalendarMonthSwitch">
                 <template #calendar-item="{ weeks }">
                   <view class="calendar-item" :class="{
                     'calendar-item--week-mode-disabled': weeks.isWeekModeDisabled,
                     'uni-calendar-item--disable': !weeks.isCurrentMonth,
-                    'calendar-item--valid': weeks.extraInfo && weeks.extraInfo.info >= 0.7,
-                    'calendar-item--invalid': weeks.extraInfo && weeks.extraInfo.info < 0.7
+                    'calendar-item--valid': weeks.extraInfo && weeks.extraInfo.info >= 70,
+                    'calendar-item--invalid': weeks.extraInfo && weeks.extraInfo.info < 70
                   }">
                     <view class="date">{{ weeks.date }}</view>
                     <view class="info">
-                      <text v-if="weeks.extraInfo && weeks.extraInfo.info">{{ weeks.extraInfo.info * 100 }}%</text>
+                      <text v-if="weeks.extraInfo && weeks.extraInfo.info">{{ weeks.extraInfo.info }}%</text>
                     </view>
                   </view>
                 </template>
@@ -126,6 +118,8 @@ import { nextTick } from 'vue';
 import { TableColumnConfig } from '@/types';
 import ieEchart from './ie-echart/ie-echart.vue';
 import { useCalendar } from '@/composables/useCalendar';
+import { getPlanStudyRecord } from '@/api/modules/study';
+import * as Study from '@/types';
 const props = defineProps<{
   studentId: number;
 }>();
@@ -133,24 +127,19 @@ const props = defineProps<{
 const {
   selected,
   statistics,
-  currentWeekNumber,
-  calendarWeekNumber,
   currentDate,
+  yearList,
   displayMode,
-  currentWeekRange,
   currentMonthRange,
   canGoPrev,
   canGoNext,
   loading,
   currentYear,
   currentMonth,
-  goToPrevWeek,
-  goToNextWeek,
   goToPrevMonth,
   goToNextMonth,
   goToYear,
   goToYearMonth,
-  goToWeek,
   initializeFormData,
   init: initCalendar
 } = useCalendar();
@@ -159,18 +148,21 @@ const {
 const form = ref({
   year: '',
   month: '',
-  week: ''
 })
 
 // 年份列表(当前年份前后各2年,但不能超过当前年份)
-const yearList = computed(() => {
-  return [
-    {
-      label: '2025',
-      value: '2025'
-    }
-  ];
-});
+// const yearList = computed(() => {
+//   return [
+//     {
+//       label: 2024,
+//       value: 2024
+//     },
+//     {
+//       label: 2025,
+//       value: 2025
+//     }
+//   ];
+// });
 
 // 月份列表(不能超过当前月份)
 const monthList = computed(() => {
@@ -191,34 +183,6 @@ const monthList = computed(() => {
   return months;
 });
 
-// 周列表 - 根据当前月份动态生成,不显示未来周数
-const weekList = computed(() => {
-  const weeks: { label: string, value: string }[] = [];
-  // const totalWeeks = currentWeekRange.value?.totalWeeks || 1;
-
-  // // 计算当前周数
-  // const today = new Date();
-  // const current = new Date(currentYear.value, currentMonth.value - 1, 1);
-  // const isCurrentMonth = current.getFullYear() === today.getFullYear() &&
-  //   current.getMonth() === today.getMonth();
-
-  // let maxWeek = totalWeeks;
-  // if (isCurrentMonth) {
-  //   // 当前月份,只显示到当前周
-  //   const firstDayOfMonth = new Date(current.getFullYear(), current.getMonth(), 1);
-  //   const firstWeekday = firstDayOfMonth.getDay() === 0 ? 7 : firstDayOfMonth.getDay();
-  //   const currentWeekInMonth = Math.ceil((today.getDate() + firstWeekday - 1) / 7);
-  //   maxWeek = Math.min(totalWeeks, currentWeekInMonth);
-  // }
-
-  // for (let i = 1; i <= maxWeek; i++) {
-  //   weeks.push({
-  //     label: `第${i}周`,
-  //     value: i.toString()
-  //   });
-  // }
-  return weeks;
-});
 
 // 检查是否可以选择日历
 const canOpenCalendar = computed(() => {
@@ -227,11 +191,6 @@ const canOpenCalendar = computed(() => {
     return false;
   }
 
-  // 如果是week模式,必须选择月份和周
-  if (displayMode.value === 'week') {
-    return !!(form.value.month && form.value.week);
-  }
-
   // 如果是month模式,必须选择月份
   if (displayMode.value === 'month') {
     return !!form.value.month;
@@ -272,8 +231,7 @@ const calendarButtonClass = computed(() => {
 const options1 = computed(() => {
   return {
     title: {
-      // text: statistics.value.totalQuestions.toString(),
-      text: '0',
+      text: statistics.value.total.toString(),
       subtext: '{a|刷题总量}',
       left: 'center',
       top: '34%',
@@ -328,9 +286,7 @@ const options1 = computed(() => {
 });
 
 const options2 = computed(() => {
-  // const accuracy = Math.round(statistics.value.averageAccuracy * 100);
-  const accuracy = 0;
-
+  const accuracy = statistics.value.rate;
   return {
     title: {
       text: `${accuracy}%`,
@@ -411,71 +367,39 @@ const tableColumns = ref<TableColumnConfig[]>([
 
 // 表格数据(从 selected 数据转换)
 const tableDate = computed(() => {
-  // return selected.value.map(item => ({
-  //   date: item.date.replace(/-/g, '.'),
-  //   questionNum: item.questionNum, // 使用 composable 中的数据
-  //   correctNum: Math.round(item.info * 100) + '%' // 四舍五入到整数
-  // }));
-  return [];
+  return statistics.value.list;
 });
 
 // 练习天数统计
-const practiceDate = computed(() => {
-  // return statistics.value.practiceDays;
-  return 0;
-});
-
-// 累计刷题天数统计
-const totalPracticeDays = computed(() => {
-  // return statistics.value.totalPracticeDays;
-  return 0;
+const practiceDays = computed(() => {
+  return statistics.value.studyDays;
 });
 
 // 日历标题
 const calendarTitle = computed(() => {
-  if (displayMode.value === 'week') {
-    const year = currentWeekRange.value?.startDate?.split('-')[0] || new Date().getFullYear();
-    const month = currentWeekRange.value?.startDate?.split('-')[1] || new Date().getMonth() + 1;
-    return `${year}年-第${month}月-第${currentWeekNumber.value}周`;
-  } else {
-    const year = currentMonthRange.value?.startDate?.split('-')[0] || new Date().getFullYear();
-    const month = currentMonthRange.value?.startDate?.split('-')[1] || new Date().getMonth() + 1;
-    return `${year}年-第${month}月`;
-  }
+  const year = currentMonthRange.value?.startDate?.split('-')[0] || new Date().getFullYear();
+  const month = currentMonthRange.value?.startDate?.split('-')[1] || new Date().getMonth() + 1;
+  return `${year}年-${month}月`;
 });
 
 // 日历副标题
 const calendarSubTitle = computed(() => {
-  if (displayMode.value === 'week') {
-    const startDate = currentWeekRange.value?.startDate?.slice(5).replace('-', '月') + '日' || '';
-    const endDate = currentWeekRange.value?.endDate?.slice(5).replace('-', '月') + '日' || '';
-    return `本周(${startDate}-${endDate})已累计刷题`;
-  } else {
-    const month = currentMonthRange.value?.startDate?.split('-')[1] || new Date().getMonth() + 1;
-    return `本月(${month}月)已累计刷题`;
-  }
+  const month = currentMonthRange.value?.startDate?.split('-')[1] || new Date().getMonth() + 1;
+  return `本月(${month}月)已累计刷题`;
 });
 
 // 导航方法
 const handlePrev = async () => {
   if (loading.value) return; // 加载中时禁止操作
   uni.$ie.showLoading();
-  if (displayMode.value === 'week') {
-    await goToPrevWeek();
-  } else {
-    await goToPrevMonth();
-  }
+  await goToPrevMonth();
   uni.$ie.hideLoading();
 };
 
 const handleNext = async () => {
   if (loading.value) return; // 加载中时禁止操作
   uni.$ie.showLoading();
-  if (displayMode.value === 'week') {
-    await goToNextWeek();
-  } else {
-    await goToNextMonth();
-  }
+  await goToNextMonth();
   uni.$ie.hideLoading();
 };
 
@@ -483,7 +407,6 @@ const handleNext = async () => {
 const handleYearChange = async () => {
   // 年份切换时清空月份和周
   form.value.month = '';
-  form.value.week = '';
 
   // 年份切换时请求年度数据,但不显示记录表
   if (form.value.year) {
@@ -495,36 +418,17 @@ const handleYearChange = async () => {
 
 const handleMonthChange = async () => {
   if (form.value.year && form.value.month) {
-    // 月份切换时清空周,不自动选中
-    form.value.week = '';
-
     // 切换到月份模式并跳转到指定年月
     await goToYearMonth(parseInt(form.value.year), parseInt(form.value.month));
   }
 };
-
-const handleWeekChange = async () => {
-  if (form.value.week) {
-    // 切换到week模式并跳转到指定周(合并两个操作,避免重复请求)
-    await goToWeek(parseInt(form.value.week));
-  }
-};
-
 // 监听日历状态变化,同步到表单
-watch([currentYear, currentMonth, currentWeekNumber, displayMode], ([year, month, week, mode]) => {
+watch([currentYear, currentMonth, displayMode], ([year, month, mode]) => {
   form.value.year = year.toString();
-
   // 只有在非年份模式下才同步月份,年份模式下保持用户选择
   if (mode !== 'year') {
     form.value.month = month.toString();
   }
-
-  // 只有在week模式下才同步周数,避免月份模式下被清空
-  if (mode === 'week') {
-    form.value.week = week.toString();
-  } else {
-    form.value.week = '';
-  }
 }, { immediate: true });
 
 // 初始化默认选中当前时间
@@ -532,20 +436,14 @@ const initializeDefaultSelection = () => {
   const formData = initializeFormData();
   form.value.year = formData.year;
   form.value.month = formData.month;
-  form.value.week = formData.week;
 };
 
 // 监听日历组件内部事件,确保数据同步
 const handleCalendarWeekChange = (event: any) => {
-  // console.log('周变化:', event);
-  // 更新外部状态以保持同步
-  if (event.weekNumber) {
-    currentWeekNumber.value = event.weekNumber;
-  }
+
 };
 
 const handleCalendarMonthSwitch = (event: any) => {
-  // console.log('月份切换:', event);
   // 更新外部状态以保持同步
   if (event.year && event.month) {
     // 通过 goToYearMonth 方法来更新状态
@@ -566,11 +464,12 @@ const handleOpenCalendar = () => {
 onMounted(async () => {
   // 先初始化默认选中
   initializeDefaultSelection();
+  initCalendar(props.studentId);
   // 显示全屏loading
   uni.$ie.showLoading();
   try {
     // 初始化日历
-    await initCalendar(props.studentId);
+    // await initCalendar(props.studentId);
   } finally {
     // 隐藏loading
     uni.$ie.hideLoading();

+ 8 - 4
src/pagesStudy/components/video-table.vue

@@ -18,6 +18,9 @@
             <text class="ml-10 flex-1 min-w-1 ellipsis-1">{{ item.name }}</text>
           </view>
         </template>
+        <template #duration="{ item }">
+          <text>{{ Math.round(item.study / 60) }}分钟</text>
+        </template>
       </ie-table>
     </view>
   </view>
@@ -29,17 +32,17 @@ const props = defineProps<{
   data: Study.VideoStudyRecord;
 }>();
 
-const stat = ref([
+const stat = computed(() => [
   {
     name: '视频总数',
     unit: '课时',
-    value: '0',
+    value: props.data.total,
     icon: '/pagesStudy/static/image/icon-video.png'
   },
   {
     name: '观看时长',
     unit: '分钟',
-    value: '0',
+    value: Math.round((props.data.study || 0) / 60),
     icon: '/pagesStudy/static/image/icon-time.png'
   },
 ])
@@ -58,9 +61,10 @@ const tableColumns = ref<TableColumnConfig[]>([
     prop: 'duration',
     label: '时长',
     flex: 0.5,
+    slot: 'duration',
   }
 ])
-const data = ref<Study.StudentVideoRecord[]>([])
+const data = computed(() => props.data.list || [])
 const emit = defineEmits<{
   rowClick: [row: Study.StudentVideoRecord]
 }>();

+ 5 - 5
src/pagesStudy/pages/index/compoentns/index-menu.vue

@@ -36,11 +36,11 @@ const menus = [
     icon: '/menu/menu-mistake.png',
     pageUrl: '/pagesOther/pages/topic-center/wrong-book/wrong-book'
   },
-  // {
-  //   label: '学习记录',
-  //   icon: '/menu/menu-record.png',
-  //   pageUrl: '/pagesStudy/pages/study-history/study-history'
-  // }
+  {
+    label: '学习记录',
+    icon: '/menu/menu-record.png',
+    pageUrl: '/pagesStudy/pages/study-history/study-history'
+  }
 ]
 const navigateTo = (menu: MenuItem) => {
   if (menu.label === '错题本') {

+ 2 - 1
src/pagesStudy/pages/start-exam/start-exam.vue

@@ -334,7 +334,8 @@ const loadData = async () => {
   uni.$ie.showLoading();
   const { data } = await getOpenExaminee({
     paperType: prevData.value.paperType,
-    relateId: prevData.value.relateId
+    relateId: prevData.value.relateId,
+    directed: prevData.value.directed
   });
   if (!data) {
     uni.$ie.hideLoading();

+ 7 - 2
src/pagesStudy/pages/study-history/components/knowledge-history-student.vue

@@ -8,8 +8,13 @@ import { Study } from '@/types';
 
 const dataList = ref<Study.KnowledgeRecord[]>([]);
 const loadData = async () => {
-  const { rows } = await getKnowledgeRecord();
-  // dataList.value = rows;
+  uni.$ie.showLoading();
+  try {
+    const { rows } = await getKnowledgeRecord();
+    dataList.value = rows;
+  } finally {
+    uni.$ie.hideLoading();
+  }
 }
 onLoad(() => {
   loadData();

+ 6 - 2
src/pagesStudy/pages/study-history/components/video-history-student.vue

@@ -1,5 +1,5 @@
 <template>
-  <view>
+  <view v-if="!loading">
     <video-table :data="dataList" />
   </view>
 </template>
@@ -8,10 +8,14 @@ import videoTable from '@/pagesStudy/components/video-table.vue';
 import { getVideoStudyRecord } from '@/api/modules/study';
 import * as Study from '@/types/study';
 const dataList = ref<Study.VideoStudyRecord>({} as Study.VideoStudyRecord);
+const loading = ref(false);
 const loadData = async () => {
+  loading.value = true;
+  uni.$ie.showLoading();
   const res = await getVideoStudyRecord();
-  console.log(res)
   dataList.value = res.data;
+  uni.$ie.hideLoading();
+  loading.value = false;
 }
 loadData();
 </script>

+ 1 - 1
src/pagesStudy/pages/study-plan/components/page-header.vue

@@ -54,7 +54,7 @@ const getValue = (val?: number) => {
   return val || 0;
 }
 const formatMinutes = (val?: number) => {
-  return val ? val / 60 : 0;
+  return val ? Math.round(val / 60) : 0;
 }
 </script>
 <style lang="scss" scoped></style>

+ 0 - 1
src/store/userStore.ts

@@ -141,7 +141,6 @@ export const useUserStore = defineStore('ie-user', {
       });
     },
     checkInfoComplete() {
-      console.log('this.needCompleteInfo', this.needCompleteInfo)
       return new Promise((resolve, reject) => {
         if (this.needCompleteInfo && (!this.userInfo.location || !this.userInfo.examType || !this.userInfo.endYear)) {
           const { transferTo } = useTransferPage();

+ 13 - 1
src/types/study.ts

@@ -190,7 +190,8 @@ export interface KnowledgeListRequestDTO {
 
 export interface OpenExamineeRequestDTO {
   paperType: string,
-  relateId: number
+  relateId: number,
+  directed: boolean
 }
 
 export interface GetExamPaperRequestDTO {
@@ -267,4 +268,15 @@ export interface VideoStudyRecord {
     date: string;
     study: string;
   }[]
+}
+
+export interface PracticeRecord {
+  rate: number;
+  total: number;
+  studyDays: number;
+  list: {
+    rate: number;
+    date: string;
+    study: number;
+  }[]
 }

+ 4 - 2
src/uni_modules/lime-drag/components/l-drag/index.scss

@@ -23,6 +23,9 @@ $drag-delete-size: var(--l-drag-delete-size, 32rpx);
 	// touch-action: none;
 	// user-select: none;
 	// -webkit-user-select: auto; 
+  /* #ifndef APP-NVUE */
+  box-sizing: border-box;
+	/*  #endif */
 	z-index: 2;
 	transition: opacity 300ms ease; 
 	.mask {
@@ -38,7 +41,6 @@ $drag-delete-size: var(--l-drag-delete-size, 32rpx);
 			height: 100%;
 		}
 	}
-	box-sizing: border-box;
 	/*  #endif */
 	
 }
@@ -47,13 +49,13 @@ $drag-delete-size: var(--l-drag-delete-size, 32rpx);
 }
 .l-drag__ghost {
 	/* #ifndef APP-NVUE */
+  box-sizing: border-box;
 	> view {
 		&:last-child {
 			width: 100%;
 			height: 100%;
 		}
 	}
-	box-sizing: border-box;
 	/*  #endif */
 }
 .l-is-active {

+ 0 - 5
src/uni_modules/uv-navbar/components/uv-navbar/uv-navbar.vue

@@ -111,9 +111,6 @@
 
 			}
 		},
-    created() {
-      console.log(123123, this.statusBarHeight);
-    },
 		computed: {
 			getBgColor(){
 				const style = {};
@@ -138,8 +135,6 @@
 				}
 			},
       getStatusBarHeight() {
-        console.log(123123, this.statusBarHeight);
-        console.log(this.$uv.sys().statusBarHeight);
         return this.statusBarHeight || this.$uv.sys().statusBarHeight;
       },
 			// 判断传入的bgColor属性,是否图片路径,只要带有"/"均认为是图片形式

+ 0 - 1
src/uni_modules/uv-status-bar/components/uv-status-bar/uv-status-bar.vue

@@ -29,7 +29,6 @@
 		computed: {
 			style() {
 				const style = {}
-        console.log(123123, this.statusBarHeight);
 				// 状态栏高度,由于某些安卓和微信开发工具无法识别css的顶部状态栏变量,所以使用js获取的方式
 				style.height = this.$uv.addUnit(this.$uv.sys().statusBarHeight || this.statusBarHeight, 'px')
 				if(this.bgColor){

+ 6 - 0
tailwind.config.js

@@ -104,6 +104,12 @@ module.exports = {
         },
         border: {
           DEFAULT: "var(--border)",
+        },
+        danger: {
+          DEFAULT: "var(--danger)",
+          dark: "var(--danger-dark)",
+          disabled: "var(--danger-disabled)",
+          light: "var(--danger-light)",
         }
       },
       // borderWidth: {

+ 10 - 2
vite.config.js

@@ -7,9 +7,10 @@ import AutoImport from 'unplugin-auto-import/vite';
 import Components from 'unplugin-vue-components/vite';
 import { resolve } from 'node:path';
 import uniPolyfill from 'vite-plugin-uni-polyfill';
+import viteCompression from "vite-plugin-compression";
 // https://vitejs.dev/config/
 
-export default defineConfig({
+export default defineConfig(({ mode }) => ({
   outDir: 'h5',
   resolve: {
     alias: {
@@ -18,6 +19,13 @@ export default defineConfig({
     }
   },
   plugins: [
+    viteCompression({
+      verbose: true,
+      disable: false,
+      threshold: 10240,
+      algorithm: 'gzip',
+      ext: '.gz'
+    }),
     AutoImport({
       dts: 'src/auto-imports.d.ts',
       imports: [
@@ -50,4 +58,4 @@ export default defineConfig({
       plugins: [tailwindcss()],
     },
   }
-})
+}));