Browse Source

云教材下载课件提示优化

liushengqiang 2 years ago
parent
commit
37e3814298
1 changed files with 18 additions and 14 deletions
  1. 18 14
      src/views/courseList/index.tsx

+ 18 - 14
src/views/courseList/index.tsx

@@ -77,17 +77,24 @@ export default defineComponent({
       }
 
       if (!item.hasCache) {
-        if (browserInfo.isStudent || route.query.isdev) {
-          const hasVip = handleCheckVip()
-          if (!hasVip) return
-          try {
-            await showConfirmDialog({
-              message: '当前课程没有缓存,是否缓存?'
-            })
-          } catch (error) {
-            gotoPlay(item)
-            return
-          }
+        const hasVip = handleCheckVip()
+        if (!hasVip) return
+        // 下载中不提示
+        if (item.downloadStatus == 1) {
+          return
+        }
+        // 重新下载
+        if (item.downloadStatus == 3) {
+          downCatch(item)
+          return
+        }
+        try {
+          await showConfirmDialog({
+            message: '当前课程没有缓存,是否缓存?'
+          })
+        } catch (error) {
+          gotoPlay(item)
+          return
         }
         downCatch(item)
         return
@@ -231,9 +238,6 @@ export default defineComponent({
             )
           })}
         </Grid>
-        {/* <Button onClick={() => {
-          location.href = 'http://192.168.3.114:1000/teacher.html#/coursewarePlay?id=1613426640725217281'
-        }}>胜强测试老师端</Button> */}
         {!data.loading && !data.list.length && <OEmpty tips="暂无内容" />}
       </div>
     )