Parcourir la source

修改样式和bug

lex-xin il y a 2 mois
Parent
commit
41e44cbb1b

+ 9 - 3
src/components/o-search/index.module.less

@@ -18,8 +18,8 @@
   padding-right: 13px;
   :global {
     .van-field__left-icon {
-      display: flex;
-      align-items: center;
+      flex-shrink: 0;
+      padding-top: 2px;
     }
     .van-field__right-icon {
       font-size: 0;
@@ -80,7 +80,13 @@
     height: 28px;
     padding: 0;
     font-size: 14px;
-    --van-button-mini-height: 28px;
+    border: none;
+    --van-button-mini-height: 24px;
     --van-font-size-xs: 14px;
+    :global {
+      .van-button__text {
+        padding-top: 1px;
+      }
+    }
   }
 }

+ 3 - 3
src/views/courseList/index.module.less

@@ -1,7 +1,7 @@
 .courseList {
   min-height: 100vh;
   background-color: #F8F8F8;
-  background-image: linear-gradient(180deg, #FFE8CE 0%, rgba(251, 233, 213, 0) 198px);
+  background-image: linear-gradient(180deg, #FFE8CE 0%, rgba(251, 233, 213, 0) 277px);
   padding: 0;
   box-sizing: border-box;
 }
@@ -82,7 +82,7 @@
   justify-content: space-between;
   padding: 20px 20px 12px;
   .searchGroup {
-    padding: 3px 10px 3px 7px;
+    padding: 2px 10px 2px 7px;
     border-radius: 19px;
     border: 1px solid rgba(255,128,87,0.5);
     font-size: 14px;
@@ -92,10 +92,10 @@
     align-items: center;
     cursor: pointer;
     .iconSearch {
-      // width: 20px;
       flex-shrink: 0;
       margin-right: 5px;
       height: 12px;
+
     }
     span {
       flex-shrink: 0;

+ 0 - 2
src/views/courseList/index.tsx

@@ -20,10 +20,8 @@ import { useRoute, useRouter } from 'vue-router'
 import {
   listenerMessage,
   postMessage,
-  promisefiyPostMessage,
   removeListenerMessage
 } from '@/helpers/native-message'
-import iconLook from './image/look.svg'
 import iconCachePoint from './image/icon-cache-point.png'
 import iconCourse from './image/icon-course.png'
 import iconCourseLock from './image/icon-course-lock.png'

+ 1 - 1
src/views/courseListSearch/index.module.less

@@ -2,7 +2,7 @@
   min-height: 100vh;
   background-color: #F8F8F8;
   // background: linear-gradient(180deg, #7defe6 0%, rgba(255, 255, 255, 0) 170px);
-  background: linear-gradient( 180deg, #FCE5FA 0%, rgba(255,255,255,0) 170px), linear-gradient( 180deg, #FFE8CE 0%, rgba(251,233,213,0) 170px);
+  background: linear-gradient( 180deg, #FFE8CE 0%, rgba(251,233,213,0) 170px);
   box-sizing: border-box;
 
   :global {

+ 4 - 1
src/views/coursewarePlay/component/point.module.less

@@ -33,7 +33,10 @@
       padding-right: 20px;
 
       input {
-        color: rgba(255,255,255, 1);
+        color: rgba(255,255,255, 1) !important;
+      }
+      input::placeholder {
+        color: rgba(255,255,255, .8) !important;
       }
     }
   }

+ 3 - 4
src/views/coursewarePlay/component/points-search.tsx

@@ -51,7 +51,6 @@ export default defineComponent({
       childActive: props.tabActive[1] || '',
       liftChildActive: props.tabActive[2] || '',
     });
-    console.log(props.tabActive, "tabActive ------------");
     watch(
       () => props.tabActive,
       () => {
@@ -67,11 +66,11 @@ export default defineComponent({
 
     // 获取对应图片
     const getImage = (item: any) => {
-      if (item.typeCode === 'VIDEO') {
+      if (item.type === 'VIDEO') {
         return props.itemActive == item.id ? iconVideoActive : iconVideo;
-      } else if (['IMAGE', 'IMG'].includes(item.typeCode)) {
+      } else if (['IMAGE', 'IMG'].includes(item.type)) {
         return props.itemActive == item.id ? iconImageActive : iconImage;
-      } else if (item.typeCode === 'SONG') {
+      } else if (item.type === 'SONG') {
         return props.itemActive == item.id ? iconSongActive : iconSong;
       } else {
         return props.itemActive == item.id ? iconVideoActive : iconVideo;

+ 1 - 1
src/views/coursewarePlay/index.module.less

@@ -56,7 +56,7 @@
 
   :global {
     .van-icon {
-      margin-right: 8px;
+      padding-right: 8px;
       pointer-events: auto;
     }
   }

+ 15 - 3
src/views/coursewarePlay/index.tsx

@@ -433,6 +433,7 @@ export default defineComponent({
                       materialMusicId,
                       content: item.content,
                       coursewareDetailId: itemResult.lessonCoursewareDetailId,
+                      lessonCoursewareDetailId: itemResult.lessonCoursewareDetailId,
                       knowledgePointId: [itemResult.lessonCoursewareDetailId, item.knowledgePointId],
                       materialId: item.id,
                       id: (i * 1000 + '') + index + ''
@@ -458,6 +459,7 @@ export default defineComponent({
                         isLock,
                         materialMusicId,
                         coursewareDetailId: itemResult.lessonCoursewareDetailId,
+                        lessonCoursewareDetailId: itemResult.lessonCoursewareDetailId,
                         content: item.content,
                         knowledgePointId: [itemResult.lessonCoursewareDetailId, n.id, item.knowledgePointId],
                         materialId: item.id,
@@ -908,7 +910,8 @@ export default defineComponent({
     const handleSwipeChange = async (index: number) => {
       if(data.source === 'search') {
         const item = data.itemList[index];
-        data.detail = detailList.value?.find((child: any) => child.coursewareDetailId === item.coursewareDetailId)
+        console.log(item, detailList.value, "value");
+        data.detail = detailList.value?.find((child: any) => child.lessonCoursewareDetailId === item.lessonCoursewareDetailId)
         popupData.tabActive = item.knowledgePointId;
         popupData.itemActive = item.id;
         popupData.itemName = item.name;
@@ -1178,7 +1181,7 @@ export default defineComponent({
             const videoBrowseData = formatEffectiveTime(item.moreTime)
             const time = videoBrowseData.length > 0 ? formatTimer(videoBrowseData) : 0
             const temp = {
-              lessonCoursewareDetailId: route.query.id,
+              lessonCoursewareDetailId: route.query.id || data.detail?.lessonCoursewareDetailId,
               browseTime: time, // 播放时长
               videoBrowseData: JSON.stringify(videoBrowseData), // 播放的数据
               videoTime: item.videoTime, // 视频时长
@@ -1558,7 +1561,6 @@ export default defineComponent({
                 itemActive={popupData.tempItemActive || popupData.itemActive}
                 open={popupData.open}
                 onHandleSelect={(res: any) => {
-                  popupData.open = false;
                   if(res.isSearch) {
                     detailList.value = detailTempSearchList.value
                     const tempList: any[] = []
@@ -1570,7 +1572,17 @@ export default defineComponent({
                     data.itemList = tempList || []
                     data.search = data.searchTemp ? JSON.parse(JSON.stringify(data.searchTemp)) : ''
                   }
+
+                  // 判断是否需要会员
+                  const item = data.itemList.find((n: any) => n.id == res.itemActive)
+                  const parentItem = detailList.value?.find((n: any) => n.lessonCoursewareDetailId == item?.lessonCoursewareDetailId)
+                  if(String(parentItem?.accessScope) === '1') {
+                    const hasVip = handleCheckVip()
+                    if (!hasVip) return
+                  }
+
                   toggleMaterial(res.itemActive);
+                  popupData.open = false;
                 }}
                 onHandleSearch={async (val: any) => {
                   data.searchLoading = true