2 Commits 1772b8057d ... 2c4254c9df

Author SHA1 Message Date
  liushengqiang 2c4254c9df Merge branch '2023-9-21_免费' into jenkins-main 1 year ago
  liushengqiang b86edb5fc9 fix 1 year ago
2 changed files with 17 additions and 17 deletions
  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)
     })