Browse Source

视频封面图更新

13127578837 11 months ago
parent
commit
e3e2386a2b
3 changed files with 17 additions and 23 deletions
  1. BIN
      src/assets/img/banner/poster.jpg
  2. 17 4
      src/components/layout/banner.vue
  3. 0 19
      src/views/index/index.vue

BIN
src/assets/img/banner/poster.jpg


+ 17 - 4
src/components/layout/banner.vue

@@ -11,12 +11,15 @@ columnImage.value =store.state.menuList[store.state.sub]?.imagePath
 if (typeof window !== 'undefined' && typeof window.globalThis.addEventListener === 'function') {
     var element:any = document.getElementsByClassName("mainmenu-area")[0]
     element.addEventListener('mouseenter', function() {
-        modelType.value = 1
-        columnImage.value = posterImg.value
+        if(modelType.value ==2){
+            modelType.value = 3
+        }
     })
     element.addEventListener('mouseleave', function() {
-        modelType.value = 2
-        columnImage.value = store.state.menuList[store.state.sub]?.imagePath
+        if(modelType.value ==3){
+            modelType.value = 2
+            columnImage.value = store.state.menuList[store.state.sub]?.imagePath
+        }
     })
   // 处理鼠标移入事件
 }
@@ -30,9 +33,19 @@ if (typeof window !== 'undefined' && typeof window.globalThis.addEventListener =
         style="width:100%;height:100%;object-fit:fill;" :src="columnImage">
         <source type="video/mp4">
     </video>
+    <img v-if="modelType==3" :src="posterImg" alt="" class="posterImg">
 </template>
 <style lang="scss">
 .common-bradcrumb-section{
     width:100vw;
 }
+.posterImg{
+    width:100%;
+    height:100%;
+    position: absolute;
+    z-index: 0;
+    img{
+        width:100%;
+    }
+}
 </style>

+ 0 - 19
src/views/index/index.vue

@@ -29,25 +29,6 @@ export default defineComponent({
         return store.dispatch('getMenuList',params).then(()=>{
             const data = reactive(store.state.menuList)
             let paramsData:any = reactive({})//页面主题内容请求参数
-            // for(let i=0;i<data.length;i++){
-            //     //主页内容
-            //     if(!data[i].sname && params == data[i].path || !data[i].sname &&  data[i].path =="/"){
-            //         paramsData = {
-            //             params:{
-            //                 categoryid: data[i].id,
-            //                 pageNum:1,
-            //                 pageSize:100,
-            //                 order:"sortindex",
-            //             },
-            //             index:params.path,
-            //             sub:i
-            //         }
-            //         if(params.path == "/"){
-            //             paramsData.params.categoryid = data[i].id
-            //         }
-            //         return store.dispatch('getPageData',paramsData)
-            //     }
-            // }
             //辅助判断参数
             let str = ref("")
             var dup = undefined