Browse Source

课件播放优化

lex-xin 7 months ago
parent
commit
668deaab88
1 changed files with 15 additions and 2 deletions
  1. 15 2
      src/views/coursewarePlay/index.tsx

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

@@ -424,6 +424,7 @@ export default defineComponent({
 
 
     /** 从搜索页面来的 */
     /** 从搜索页面来的 */
     const getSearchDetail = async (params: { type?: string, id?: any, search?: string }) => {
     const getSearchDetail = async (params: { type?: string, id?: any, search?: string }) => {
+      data.searchLoading = true
       try {
       try {
         const res = await request.post(
         const res = await request.post(
           state.platformApi +
           state.platformApi +
@@ -584,6 +585,8 @@ export default defineComponent({
         return true
         return true
       } catch (error) {
       } catch (error) {
         console.log(error);
         console.log(error);
+      } finally {
+        data.searchLoading = false
       }
       }
     }
     }
 
 
@@ -1627,6 +1630,18 @@ export default defineComponent({
                 open={popupData.open}
                 open={popupData.open}
                 onHandleSelect={(res: any) => {
                 onHandleSelect={(res: any) => {
                   if(data.source !== "search") {
                   if(data.source !== "search") {
+                    const tempList: any[] = []
+                    detailTempSearchList.value?.forEach((item: any) => {
+                      if(Array.isArray(item.list)) {
+                        tempList.push(...item.list)
+                      }
+                    })
+                    const item = tempList.find((n: any) => n.id == res.itemActive)
+                    const parentItem = detailTempSearchList.value?.find((n: any) => n.lessonCoursewareDetailId == item?.lessonCoursewareDetailId)
+                    if(String(parentItem?.accessScope) === '1') {
+                      const hasVip = handleCheckVip(false)
+                      if (!hasVip) return
+                    }
                     if (browser().isApp) {
                     if (browser().isApp) {
                       postMessage({
                       postMessage({
                         api: 'openWebView',
                         api: 'openWebView',
@@ -1683,7 +1698,6 @@ export default defineComponent({
                   popupData.open = false;
                   popupData.open = false;
                 }}
                 }}
                 onHandleSearch={async (val: any) => {
                 onHandleSearch={async (val: any) => {
-                  data.searchLoading = true
                   detailTempSearchList.value = []
                   detailTempSearchList.value = []
                   if(data.source === 'search') {
                   if(data.source === 'search') {
                     await getSearchDetail({
                     await getSearchDetail({
@@ -1698,7 +1712,6 @@ export default defineComponent({
                     })
                     })
                   }
                   }
                   data.searchTemp = val.search;
                   data.searchTemp = val.search;
-                  data.searchLoading = false
                 }} /> :
                 }} /> :
                 <Points
                 <Points
                 data={data.knowledgePointList}
                 data={data.knowledgePointList}