chenlei 3 месяцев назад
Родитель
Сommit
49aa83c331
3 измененных файлов с 27 добавлено и 5 удалено
  1. 1 1
      src/hotspot/views/hotspot/index.xs.scss
  2. 19 4
      src/hotspot/views/hotspot/index.xs.vue
  3. 7 0
      src/index/App.vue

+ 1 - 1
src/hotspot/views/hotspot/index.xs.scss

@@ -68,7 +68,7 @@
     div {
     div {
       line-height: 1.5;
       line-height: 1.5;
       font-size: 24px;
       font-size: 24px;
-      text-indent: 32px;
+      text-indent: 2em;
     }
     }
   }
   }
 
 

+ 19 - 4
src/hotspot/views/hotspot/index.xs.vue

@@ -36,10 +36,15 @@
               <iframe v-if="index === myInd" :src="item" frameborder="0" />
               <iframe v-if="index === myInd" :src="item" frameborder="0" />
             </template>
             </template>
             <template v-else-if="myType === 'video'">
             <template v-else-if="myType === 'video'">
-              <video ref="videos" controls :src="item.url" />
+              <video ref="videos" controls :src="item.url" controlslist="nodownload" />
             </template>
             </template>
             <template v-else-if="myType === 'img'">
             <template v-else-if="myType === 'img'">
-              <el-image :src="item" fit="contain" @click="handlePreview(index)" />
+              <el-image
+                id="protectedImage"
+                :src="item"
+                fit="contain"
+                @click="handlePreview(index)"
+              />
             </template>
             </template>
           </template>
           </template>
         </SwiperSlide>
         </SwiperSlide>
@@ -175,6 +180,10 @@
     },
     },
     mounted() {
     mounted() {
       this.getData();
       this.getData();
+
+      document.addEventListener('contextmenu', function (e) {
+        e.preventDefault();
+      });
     },
     },
     methods: {
     methods: {
       async getData() {
       async getData() {
@@ -222,8 +231,9 @@
           this.data = obj;
           this.data = obj;
 
 
           // 当前type的值 应该为
           // 当前type的值 应该为
-          if (resData.images) this.myType = 'img';
-          else if (resData.model) this.myType = 'model';
+          if (resData.images) {
+            this.myType = 'img';
+          } else if (resData.model) this.myType = 'model';
           else if (resData.video) {
           else if (resData.video) {
             this.myType = 'video';
             this.myType = 'video';
             this.$nextTick(() => {
             this.$nextTick(() => {
@@ -254,6 +264,11 @@
               this.handleVideoPlay(this.data.video[0].url);
               this.handleVideoPlay(this.data.video[0].url);
             });
             });
             break;
             break;
+          case 'img':
+            this.$nextTick(() => {
+              this.handleVideoPlay(this.data.video[0].url);
+            });
+            break;
         }
         }
       },
       },
 
 

+ 7 - 0
src/index/App.vue

@@ -11,6 +11,13 @@
     switch (e.data.type) {
     switch (e.data.type) {
       case MESSAGE_KEY.SHOW_VIEWER:
       case MESSAGE_KEY.SHOW_VIEWER:
         viewerApi({ images: e.data.images, options: { zIndex: 9999 } });
         viewerApi({ images: e.data.images, options: { zIndex: 9999 } });
+        setTimeout(() => {
+          const doms = document.getElementsByClassName('viewer-move');
+          if (doms.length)
+            doms[0].addEventListener('contextmenu', function (event) {
+              event.preventDefault();
+            });
+        }, 500);
         break;
         break;
     }
     }
   });
   });