style:首页视频 产品详情样式修改

This commit is contained in:
杨丹华
2025-05-19 15:59:40 +08:00
parent eefc81784f
commit 349e53104d
3 changed files with 23 additions and 9 deletions

View File

@@ -102,14 +102,11 @@
<!-- 视频宣传 --> <!-- 视频宣传 -->
{notempty name="video"} {notempty name="video"}
<div class="hotProduct"> <div class="hotProduct">
<div class="hotvideo"> <div class="hotvideo">
<iframe src="{$video.video}" title="YouTube video player" style="width:100%;height:67rem;z-index:9999;" <video src="{$video.video}" style="max-height:50rem;z-index:9999;width: 100%;object-fit: cover;" autoplay muted loop controls></video>
frameborder="0" </div>
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" <img src="{$video.image}" class="hotImg" />
allowfullscreen id="videoElement"></iframe> </div>
</div>
<img src="{$video.image}" class="hotImg" />
</div>
{/notempty} {/notempty}
<!-- 场景介绍 --> <!-- 场景介绍 -->
{notempty name="scenes"} {notempty name="scenes"}
@@ -268,6 +265,23 @@
$(".oficlose").on("click", function () { $(".oficlose").on("click", function () {
$(".oricofixd-info").hide(); $(".oricofixd-info").hide();
}); });
// 视频
const video = $('#oricoVideo');
const videoContainer = $('.hotvideo');
const img = $('.hotImg');
// 监听视频加载完成事件
video.on('loadedmetadata', function() {
// 显示视频容器,隐藏图片
videoContainer.css('display', 'block');
img.hide();
});
// 处理视频加载失败(可选)
video.on('error', function() {
videoContainer.css('display', 'none');
console.error('视频加载失败:', video.attr('src'));
// 可在此添加失败提示,如显示错误信息或保留图片
img.show();
});
}); });
$(function () { $(function () {
// banner轮播 // banner轮播

View File

@@ -446,7 +446,6 @@
background-size: 100% 100%; background-size: 100% 100%;
background-position: center center; background-position: center center;
animation: breath 4s linear infinite; animation: breath 4s linear infinite;
display: none;
} }
.orico_Page_index .pageMain .hotProduct .hotImg { .orico_Page_index .pageMain .hotProduct .hotImg {
position: relative; position: relative;

View File

@@ -385,6 +385,7 @@
width: 75%; width: 75%;
margin-bottom: 50px; margin-bottom: 50px;
margin: 0 auto; margin: 0 auto;
margin-top: 15px;
} }
.orico_Page_prdetail .oriprdetail .oriprInfo .products_des img { .orico_Page_prdetail .oriprdetail .oriprInfo .products_des img {
text-align: center; text-align: center;