瀏覽代碼

feat: iframe

chenlei 1 周之前
父節點
當前提交
f8def19cb1
共有 1 個文件被更改,包括 8 次插入2 次删除
  1. 8 2
      src/hotspot/views/hotspot/index.hzrm.vue

+ 8 - 2
src/hotspot/views/hotspot/index.hzrm.vue

@@ -31,7 +31,7 @@
       >
         <SwiperSlide v-for="(item, index) in curList" :key="item.url">
           <template v-if="swiperInited">
-            <template v-if="myType === 'model'">
+            <template v-if="myType === 'model' || myType === 'iframe'">
               <iframe v-if="index === myInd" :src="item" frameborder="0" />
             </template>
             <template v-else-if="myType === 'video'">
@@ -98,6 +98,7 @@
   import ImageIcon from '@hotspot/assets/images/img-icon.png';
   import VideoIcon from '@hotspot/assets/images/video-icon.png';
   import VolumeOn from '@hotspot/assets/images/audio-icon.png';
+  import infoIcon from '@hotspot/assets/images/info-icon.png';
 
   const urlParams = parseUrlParams(window.location.href);
   const isMobile = judgeIsMobile();
@@ -216,12 +217,17 @@
             obj.model = resData.model;
             arr.push({ id: 1, type: 'model', name: '模型', icon: ModelIcon });
           }
+          if (resData.iframe) {
+            obj.iframe = resData.iframe;
+            arr.push({ id: 4, type: 'iframe', name: '网页', icon: infoIcon });
+          }
 
           this.flooTab = arr;
           this.data = obj;
 
           // 当前type的值 应该为
-          if (resData.images) this.myType = 'img';
+          if (resData.iframe) this.myType = 'iframe';
+          else if (resData.images) this.myType = 'img';
           else if (resData.model) this.myType = 'model';
           else if (resData.video) {
             this.myType = 'video';