Browse Source

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

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

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

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