lex 1 سال پیش
والد
کامیت
827f214edd

+ 2 - 2
src/router/index.ts

@@ -12,7 +12,7 @@ const router: Router = createRouter({
           name: 'lessonCourseware',
           component: () => import('@/views/lessonCourseware/index'),
           meta: {
-            title: '选择课件'
+            title: '教材课件'
           }
         },
         {
@@ -20,7 +20,7 @@ const router: Router = createRouter({
           name: 'courseList',
           component: () => import('@/views/courseList/index'),
           meta: {
-            title: '课程列表'
+            title: '课件详情'
           }
         },
         {

BIN
src/views/courseList/image/icon-close.png


+ 22 - 5
src/views/courseList/index.module.less

@@ -160,6 +160,10 @@
       }
     }
 
+    &.disabled {
+      opacity: 0.6 !important;
+    }
+
     &.look {
       background: linear-gradient(270deg, #4BE0A1 0%, #01C1B5 100%);
     }
@@ -195,6 +199,8 @@
 }
 
 .courseDialog {
+  width: 315px;
+
   :global {
     .van-dialog__header {
       // padding-top: 0;
@@ -259,11 +265,21 @@
 .courseDialog {
   padding: 20px;
 
-  :global {
-    .van-popup__close-icon {
-      color: #333;
-      top: 24px;
-    }
+  // :global {
+  //   .van-popup__close-icon {
+  //     color: #333;
+  //     top: 24px;
+  //   }
+  // }
+  .iconClose {
+    width: 18px;
+    height: 19px;
+    position: absolute;
+    top: 24px;
+    right: 23px;
+    z-index: 9;
+    background: url('./image/icon-close.png') no-repeat center;
+    background-size: contain;
   }
 
   .title {
@@ -288,6 +304,7 @@
 
     &>button {
       flex: 1;
+      font-weight: 400;
 
       &:last-child {
         margin-left: 15px;

+ 19 - 12
src/views/courseList/index.tsx

@@ -53,7 +53,8 @@ export default defineComponent({
         name: '',
         des: ''
       },
-      list: [] as any
+      list: [] as any,
+      isDownloading: false // 是否在下载资源
     });
 
     /** 获取课件详情 */
@@ -157,11 +158,11 @@ export default defineComponent({
         // 下载中不提示
         if (item.downloadStatus == 1) {
           // 取消下载
-          removeListenerMessage('downloadCoursewareToCache', getProgress);
           postMessage({ api: 'cancelDownloadCourseware' });
           setTimeout(() => {
             postMessage({ api: 'cancelDownloadCourseware' });
             item.downloadStatus = 0;
+            data.isDownloading = false;
           }, 1000);
           showLoadingToast({
             message: '取消中...',
@@ -234,7 +235,7 @@ export default defineComponent({
     const downCatch = async (item: any) => {
       if (browserInfo.isApp) {
         data.catchStatus = false;
-
+        data.isDownloading = true;
         const res = await postMessage({
           api: 'downloadCoursewareToCache',
           content: {
@@ -249,6 +250,9 @@ export default defineComponent({
     // 下载缓存进度
     const getProgress = (res: any) => {
       // console.log('🚀 ~ res', res)
+      if (!data.isDownloading) {
+        return;
+      }
       if (res?.content?.lessonCoursewareDetailId) {
         const { lessonCoursewareDetailId, downloadStatus, progress } =
           res.content;
@@ -261,6 +265,8 @@ export default defineComponent({
           if (downloadStatus == 2) {
             course.hasCache = 1;
             course.progress = 100;
+            // 下载完成
+            data.isDownloading = false;
           }
         }
       }
@@ -352,27 +358,26 @@ export default defineComponent({
                                 <>
                                   {item.hasCache ? (
                                     <Button
-                                      disabled={!hasVip()}
-                                      class={[styles.baseBtn, styles.look]}>
+                                      class={[
+                                        styles.baseBtn,
+                                        styles.look,
+                                        !hasVip() ? styles.disabled : ''
+                                      ]}>
                                       查看
                                     </Button>
                                   ) : (
                                     <Button
-                                      disabled={!hasVip()}
                                       class={[
                                         styles.baseBtn,
                                         styles.down,
+                                        !hasVip() ? styles.disabled : '',
                                         item.downloadStatus == 1
                                           ? styles.downing
                                           : ''
                                       ]}>
                                       {item.downloadStatus === 1
                                         ? `取消下载`
-                                        : item.downloadStatus === 2
-                                        ? '成功'
-                                        : item.downloadStatus === 3
-                                        ? '重试'
-                                        : '下载'}
+                                        : '查看'}
                                     </Button>
                                   )}
                                 </>
@@ -406,8 +411,10 @@ export default defineComponent({
         <Popup
           v-model:show={data.catchStatus}
           round
-          closeable
           class={styles.courseDialog}>
+          <i
+            class={styles.iconClose}
+            onClick={() => (data.catchStatus = false)}></i>
           <div class={styles.title}>下载提醒</div>
 
           <div class={styles.content}>

+ 1 - 1
src/views/coursewarePlay/component/play-loading/index.module.less

@@ -15,7 +15,7 @@
     height: 10px;
     background: linear-gradient(135deg, #34FFC5 0%, #1BD2FF 100%);
     transform-origin: bottom;
-    border-radius: 5px 5px 0 0;
+    border-radius: 5px;
     margin: 0 1px 0;
   }
 

+ 1 - 1
src/views/coursewarePlay/component/point.module.less

@@ -145,7 +145,7 @@
 }
 
 .itemActive {
-  background: rgba(0, 0, 0, 0.15);
+  background: rgba(0, 255, 224, 0.15);
   color: var(--van-primary);
 
   :global {

+ 1 - 1
src/views/coursewarePlay/component/video-item/index.tsx

@@ -140,7 +140,7 @@ export default defineComponent({
                             <img class="${styles.playIcon}" src="${iconPlay}" />
                             <img class="${styles.playIcon}" src="${iconPause}" />
                         </button>
-                        <button id="${loopBtnId}" class="${styles.actionBtn} ${styles.loopBtn}">
+                        <button id="${loopBtnId}" class="${styles.actionBtn} ${styles.loopBtn}" style="margin:0 2px;">
                             <img class="loop" src="${iconLoop}" />
                             <img class="loopActive" src="${iconLoopActive}" />
                         </button>

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
src/views/coursewarePlay/image/icons.json


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

@@ -79,7 +79,7 @@ export default defineComponent({
           }
         },
         () => {
-          console.log(234);
+          // console.log(234);
         }
       );
       // 头,包括返回箭头
@@ -293,6 +293,7 @@ export default defineComponent({
                   index++;
                   return {
                     ...item,
+                    content: item.content + '?t=' + item.id,
                     knowledgePointId: [item.knowledgePointId],
                     materialId: item.id,
                     id: index + ''
@@ -305,6 +306,7 @@ export default defineComponent({
                     index++;
                     return {
                       ...item,
+                      content: item.content + '?t=' + item.id,
                       knowledgePointId: [n.id, item.knowledgePointId],
                       materialId: item.id,
                       id: index + ''
@@ -639,7 +641,6 @@ export default defineComponent({
     };
 
     const activeVideoItem = computed(() => {
-      console.log(data.itemList, ' data.itemList');
       const item = data.itemList[popupData.activeIndex];
       if (
         item &&

+ 7 - 5
src/views/hook/useFee.ts

@@ -1,6 +1,7 @@
 import { postMessage } from '@/helpers/native-message';
 import { browser } from '@/helpers/utils';
 import { state } from '@/state';
+import dayjs from 'dayjs';
 import { showDialog } from 'vant';
 
 export const gotoMemberCenter = () => {
@@ -22,11 +23,12 @@ export const gotoMemberCenter = () => {
 
 /**验证是否是会员 */
 export const hasVip = () => {
-  return !state.user.data.student.memberRankSettingId ? false : true;
+  return !dayjs().isBefore(dayjs(state.user.data.student.membershipEndTime))
+    ? false
+    : true;
 };
 export const handleCheckVip = () => {
   // 学员端验证
-  console.log(state.user);
   if (state.platformType == 'STUDENT') {
     //学员有待激活会员
     // if (
@@ -35,7 +37,7 @@ export const handleCheckVip = () => {
     // ) {
     //   showDialog({
     //     title: '温馨提示',
-    //     message: '您的团练宝暂未激活,请激活后使用'
+    //     message: '您的云教练暂未激活,请激活后使用'
     //   }).then(() => {
     //     gotoMemberCenter();
     //   });
@@ -43,10 +45,10 @@ export const handleCheckVip = () => {
     // }
 
     //学员没有会员
-    if (!state.user.data.student.memberRankSettingId) {
+    if (!dayjs().isBefore(dayjs(state.user.data.student.membershipEndTime))) {
       showDialog({
         title: '温馨提示',
-        message: '您暂未开通团练宝,请开通后使用'
+        message: '您暂未开通云教练,请开通后使用'
       }).then(() => {
         gotoMemberCenter();
       });

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است