Browse Source

Merge branch 'hqyDev' of http://git.dayaedu.com/lex/classroom-instruments into jenkins

黄琪勇 3 days ago
parent
commit
fdbfe1ed69
2 changed files with 11 additions and 2 deletions
  1. 2 1
      src/views/attend-class/component/pptList.tsx
  2. 9 1
      src/views/attend-class/index.tsx

+ 2 - 1
src/views/attend-class/component/pptList.tsx

@@ -15,7 +15,7 @@ export default defineComponent({
       default: 'TEACHER'
     }
   },
-  emits: ['initPPT', 'changeSlideIndex'],
+  emits: ['initPPT', 'changeSlideIndex', 'init'],
   setup(props, { emit, expose }) {
     const userStore = useUserStore();
     const iframeRef = ref<HTMLIFrameElement>();
@@ -40,6 +40,7 @@ export default defineComponent({
         emit('changeSlideIndex', content);
       }
     }
+    emit('init');
     onMounted(() => {
       window.addEventListener('message', handleMessage);
     });

+ 9 - 1
src/views/attend-class/index.tsx

@@ -221,7 +221,8 @@ export default defineComponent({
     const pptData = reactive({
       pptEl: null as any,
       slidesLen: 1,
-      activeLen: 0
+      activeLen: 0,
+      disable: false
     });
 
     const activeData = reactive({
@@ -1162,6 +1163,7 @@ export default defineComponent({
     // 是否允许上一页
     const isUpArrow = computed(() => {
       if (data.coursewareType === 'PPT') {
+        if (pptData.disable) return false;
         if (pptData.activeLen > 0) {
           return true;
         }
@@ -1236,6 +1238,7 @@ export default defineComponent({
     // 是否允许下一页
     const isDownArrow = computed(() => {
       if (data.coursewareType === 'PPT') {
+        if (pptData.disable) return false;
         if (pptData.activeLen < pptData.slidesLen - 1) {
           return true;
         }
@@ -1971,8 +1974,13 @@ export default defineComponent({
                           ref={el => {
                             pptData.pptEl = el;
                           }}
+                          onInit={() => {
+                            pptData.disable = true;
+                          }}
                           onInitPPT={({ slidesLen }) => {
+                            pptData.disable = false;
                             pptData.slidesLen = slidesLen;
+                            pptData.activeLen = 0;
                           }}
                           onChangeSlideIndex={({ slideIndex }) => {
                             pptData.activeLen = slideIndex;