Selaa lähdekoodia

refactor(subject): 统一课程卡片图标获取方式

新增ossIconPath字段替换原fileList拼接方式获取图标,简化多页面图片加载逻辑
408249787@qq.com 1 viikko sitten
vanhempi
commit
57cc59859d

+ 1 - 1
pages/chinese/index.uvue

@@ -104,7 +104,7 @@ function debouncedOnScroll(e: any) {
       <scroll-view class="scroll-view_H" direction="horizontal" :show-scrollbar="false"  ref="cardsScrollView"  @scroll="debouncedOnScroll">
         <view class="scroll-view-item_H bg-[white]"  :class="`category-${course.catalogId}`" v-for="course in courseList || []" :key="course.id"
           @tap="handleDetail(course)">
-          <cl-image :src="config.baseUrl + course?.fileList?.[0]?.url" mode="heightFix"
+          <cl-image :src="course?.ossIconPath" mode="heightFix"
             class="!w-full !h-[26vh] mb-[2px] rounded-xl"></cl-image>
           <view class="text-[4vh] font-bold absolute top-[4vh] left-0 w-full text-center"  >{{
             course.mainTitle }}</view>

+ 1 - 1
pages/english/index.uvue

@@ -103,7 +103,7 @@ function debouncedOnScroll(e: any) {
       <scroll-view class="scroll-view_H" direction="horizontal" ref="cardsScrollView" :show-scrollbar="false" @scroll="debouncedOnScroll">
          <view class="scroll-view-item_H bg-[white]"  :class="`category-${course.catalogId}`" v-for="course in courseList || []" :key="course.id"
           @tap="handleDetail(course)">
-          <cl-image :src="config.baseUrl + course?.fileList?.[0]?.url" mode="heightFix"
+        <cl-image :src="course?.ossIconPath" mode="heightFix"
             class="!w-full !h-[26vh] mb-[2px] rounded-xl"></cl-image>
           <view class="text-[4vh] font-bold absolute top-[4vh] left-0 w-full text-center"  >{{
             course.mainTitle }}</view>

+ 1 - 1
pages/math/index.uvue

@@ -104,7 +104,7 @@ const userInfo = computed(() => user.info.value?.userInfo)
       <scroll-view class="scroll-view_H" direction="horizontal" :show-scrollbar="false" ref="cardsScrollView" @scroll="debouncedOnScroll">
         <view class="scroll-view-item_H bg-[white]" v-for="course in catalog?.courseList || []" :class="`category-${course.catalogId}`" :key="course.id"
           @tap="handleDetail(course)">
-          <cl-image :src="config.baseUrl + course?.fileList?.[0]?.url" mode="heightFix"
+         <cl-image :src="course?.ossIconPath" mode="heightFix"
             class="!w-full !h-[26vh] mb-[2px] rounded-xl"></cl-image>
           <view class="text-[4vh] font-bold absolute top-[4vh] left-0 w-full text-center"  >{{
             course.mainTitle }}</view>

+ 1 - 1
pages/mix/index.uvue

@@ -96,7 +96,7 @@ function handleDetail(item: SubjectCatalogResult) {
       <scroll-view class="scroll-view_H" direction="horizontal" :show-scrollbar="false" ref="cardsScrollView" @scroll="debouncedOnScroll">
         <view class="scroll-view-item_H bg-[white]" v-for="course in catalog?.courseList || []" :class="`category-${course.catalogId}`" :key="course.id"
           @tap="handleDetail(course)">
-          <cl-image :src="config.baseUrl + course?.fileList?.[0]?.url" mode="heightFix"
+          <cl-image :src="course?.ossIconPath" mode="heightFix"
             class="!w-full !h-[26vh] mb-[2px] rounded-xl"></cl-image>
           <view class="text-[4vh] font-bold absolute top-[4vh] left-0 w-full text-center"  >{{
             course.mainTitle }}</view>

+ 1 - 0
services/subject/course.ts

@@ -24,6 +24,7 @@ export interface SubjectCourseResult {
     videoPath?: string
     detailItem?: any
     practiceList?: any[]
+    ossIconPath?: string
     testItem?: any
     diaryItem?: any
     courseUserProgress?: any