|
@@ -91,10 +91,7 @@ export default defineComponent({
|
|
|
});
|
|
|
|
|
|
// 由于ios没有对应api
|
|
|
- const _list =
|
|
|
- state.platformType === 'STUDENT'
|
|
|
- ? await checkCoursewareCache(res.data)
|
|
|
- : [];
|
|
|
+ const _list = await checkCoursewareCache(res.data);
|
|
|
data.list = browserInfo.isApp
|
|
|
? res.data.map((item: any) => {
|
|
|
const _item = _list.find(
|
|
@@ -153,43 +150,40 @@ export default defineComponent({
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- // 学生端需要判断缓存
|
|
|
- console.log(state.platformType, 'state.platformType');
|
|
|
- if (state.platformType === 'STUDENT') {
|
|
|
- const isVip = handleCheckVip();
|
|
|
- if (!isVip) return;
|
|
|
+ const isVip = handleCheckVip();
|
|
|
+ if (!isVip) return;
|
|
|
|
|
|
- if (!item.hasCache) {
|
|
|
- // const hasFree = String(item.accessScope) === '0';
|
|
|
- // if (!hasFree) {
|
|
|
+ if (!item.hasCache) {
|
|
|
+ // const hasFree = String(item.accessScope) === '0';
|
|
|
+ // if (!hasFree) {
|
|
|
|
|
|
- // 下载中不提示
|
|
|
- if (item.downloadStatus == 1) {
|
|
|
- // 取消下载
|
|
|
+ // 下载中不提示
|
|
|
+ if (item.downloadStatus == 1) {
|
|
|
+ // 取消下载
|
|
|
+ postMessage({ api: 'cancelDownloadCourseware' });
|
|
|
+ setTimeout(() => {
|
|
|
postMessage({ api: 'cancelDownloadCourseware' });
|
|
|
- setTimeout(() => {
|
|
|
- postMessage({ api: 'cancelDownloadCourseware' });
|
|
|
- item.downloadStatus = 0;
|
|
|
- data.isDownloading = false;
|
|
|
- }, 1000);
|
|
|
- showLoadingToast({
|
|
|
- message: '取消中...',
|
|
|
- forbidClick: false,
|
|
|
- loadingType: 'spinner',
|
|
|
- duration: 1000
|
|
|
- });
|
|
|
- return;
|
|
|
- }
|
|
|
- // 重新下载
|
|
|
- if (item.downloadStatus == 3) {
|
|
|
- downCatch(item);
|
|
|
- return;
|
|
|
- }
|
|
|
- data.catchStatus = true;
|
|
|
- data.catchItem = item;
|
|
|
+ item.downloadStatus = 0;
|
|
|
+ data.isDownloading = false;
|
|
|
+ }, 1000);
|
|
|
+ showLoadingToast({
|
|
|
+ message: '取消中...',
|
|
|
+ forbidClick: false,
|
|
|
+ loadingType: 'spinner',
|
|
|
+ duration: 1000
|
|
|
+ });
|
|
|
return;
|
|
|
}
|
|
|
+ // 重新下载
|
|
|
+ if (item.downloadStatus == 3) {
|
|
|
+ downCatch(item);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ data.catchStatus = true;
|
|
|
+ data.catchItem = item;
|
|
|
+ return;
|
|
|
}
|
|
|
+
|
|
|
gotoPlay(item);
|
|
|
};
|
|
|
// 去课件播放
|