ソースを参照

修改获取星星数量

丸子 3 ヶ月 前
コミット
bb99db88ae

+ 2 - 9
src/views/laboratory/ExperimentalCourses.vue

@@ -150,15 +150,8 @@ const hasMoved = ref(false) // 标记是否发生了移动
 // 获取contentBox元素的引用
 const middleBox = ref(null)
 
-// 根据内容类型获取星星数量
-const getStarCount = (contentType) => {
-  if (contentType === 'video') {
-    return 1; // video类型渲染1个星星
-  } else if (contentType === 'aiTextToText') {
-    return 3; // aiTextToText类型渲染3个星星
-  }
-  return 0; // 默认返回0个星星
-}
+// 获取星星数量,默认返回1个星星
+const getStarCount = () => 1
 
 // 上一节课程
 const prevExperimentalCourses = () => {

+ 1 - 7
src/views/programming/ProgrammingCourset.vue

@@ -147,13 +147,7 @@ const menuDict = ref({});
 
 
 // 根据内容类型获取星星数量
-const getStarCount = (contentType) => {
-  if (contentType === 'video') {
-    return 1; // video类型渲染1个星星
-  } else if (contentType === 'blockly') {
-    return 3; // blockly类型渲染3个星星
-  }
-}
+const getStarCount = (contentType) => contentType === 'video' ? 1 : 3;
 
 // 上一节课程
 const prevSlide = () => {