Ver código fonte

Merge branch '2023-9-21_免费' into jenkins-main

liushengqiang 1 ano atrás
pai
commit
2c4254c9df
2 arquivos alterados com 17 adições e 17 exclusões
  1. 0 3
      src/views/courseList/index.tsx
  2. 17 14
      src/views/coursewarePlay/index.tsx

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

@@ -331,9 +331,6 @@ export default defineComponent({
                     let isLock = item.lockFlag ||
                       ((route.query.code == 'select' || state.platformType == 'STUDENT') &&
                         !item.unlock)
-                    if (String(item.accessScope) === '0'){
-                      isLock = false
-                    }
                     const isSelect = route.query.code === 'select'
                     return (
                       <Cell

+ 17 - 14
src/views/coursewarePlay/index.tsx

@@ -107,7 +107,7 @@ export default defineComponent({
     const route = useRoute()
     const headeRef = ref()
     const data = reactive({
-      detail: null,
+      detail: null as any,
       knowledgePointList: [] as any,
       itemList: [] as any,
       showHead: true,
@@ -315,21 +315,24 @@ export default defineComponent({
       }
     }
 
-    onMounted(() => {
-      const hasVip = handleCheckVip()
-      if (!hasVip) {
-        nextTick(() => {
-          postMessage({
-            api: 'courseLoading',
-            content: {
-              show: false,
-              type: 'fullscreen'
-            }
+    onMounted(async () => {
+      await getDetail()
+      const hasFree = String(data.detail?.accessScope) === '0'
+      if (!hasFree){
+        const hasVip = handleCheckVip()
+        if (!hasVip) {
+          nextTick(() => {
+            postMessage({
+              api: 'courseLoading',
+              content: {
+                show: false,
+                type: 'fullscreen'
+              }
+            })
           })
-        })
-        return
+          return
+        }
       }
-      getDetail()
       getCourseSchedule()
       window.addEventListener('message', iframeHandle)
     })