fix: 首页热点产品无点击链接

This commit is contained in:
2025-06-10 10:01:50 +08:00
parent ccbd70706a
commit 57e284e790

View File

@@ -30,8 +30,7 @@
{volist name="product_categorys" id="cate"} {volist name="product_categorys" id="cate"}
<a class="catit" href="{$cate.link}"> <a class="catit" href="{$cate.link}">
<img src="{$cate.image}" class="catIcoImg" /> <img src="{$cate.image}" class="catIcoImg" />
<span class="catName" {notempty name="cate.title_txt_color" }style="color:{$cate.title_txt_color};" <span class="catName" {notempty name="cate.title_txt_color" }style="color:{$cate.title_txt_color};" {/notempty}>{$cate.title}</span>
{/notempty}>{$cate.title}</span>
</a> </a>
{/volist} {/volist}
</div> </div>
@@ -78,12 +77,12 @@
<div class="swiper-wrapper"> <div class="swiper-wrapper">
{volist name="featured_products" id="product"} {volist name="featured_products" id="product"}
<div class="swiper-slide picture"> <div class="swiper-slide picture">
<a class="primg"> <a class="primg" href="{:url('product/detail', ['id' => $product.id])}">
<img src="{$product.cover_image}" /> <img src="{$product.cover_image}" />
</a> </a>
<div class="fpptitle">{$product.name}</div> <div class="fpptitle">{$product.name}</div>
<div class="subtitle">{$product.short_name}</div> <div class="subtitle">{$product.short_name}</div>
<a class="more">{:lang_i18n('了解更多')} ></a> <a class="more" href="{:url('product/detail', ['id' => $product.id])}">{:lang_i18n('了解更多')} ></a>
</div> </div>
{/volist} {/volist}
</div> </div>
@@ -103,13 +102,7 @@
{notempty name="video"} {notempty name="video"}
<div class="hotProduct"> <div class="hotProduct">
<div class="hotvideo"> <div class="hotvideo">
<video poster="{$video.image}" <video poster="{$video.image}" src="{$video.video}" style="max-height:50rem;z-index:9999;width: 100%;object-fit: cover;" autoplay loop controls id="oricoVideo"></video>
src="{$video.video}"
style="max-height:50rem;z-index:9999;width: 100%;object-fit: cover;"
autoplay
loop
controls
id="oricoVideo"></video>
</div> </div>
<img src="{$video.image}" class="hotImg" /> <img src="{$video.image}" class="hotImg" />
</div> </div>
@@ -120,8 +113,7 @@
{volist name="scenes" id="scene"} {volist name="scenes" id="scene"}
<div class="sceneitem"> <div class="sceneitem">
<div class="sceneInfo"> <div class="sceneInfo">
<p class="scenetitle" {notempty name="scene.title_txt_color" }style="color:{$scene.title_txt_color};" <p class="scenetitle" {notempty name="scene.title_txt_color" }style="color:{$scene.title_txt_color};" {/notempty}>{$scene.title}</p>
{/notempty}>{$scene.title}</p>
<p class="subtitle" {notempty name="scene.desc_txt_color" }style="color:{$scene.desc_txt_color};" {/notempty}> <p class="subtitle" {notempty name="scene.desc_txt_color" }style="color:{$scene.desc_txt_color};" {/notempty}>
{$scene.desc|raw}</p> {$scene.desc|raw}</p>
<a class="sceneMore" href="{$scene.link}">{:lang_i18n('了解更多')} ></a> <a class="sceneMore" href="{$scene.link}">{:lang_i18n('了解更多')} ></a>
@@ -157,10 +149,8 @@
<img src="{$story.image}" class="bsImg" /> <img src="{$story.image}" class="bsImg" />
</div> </div>
<div class="bsinf"> <div class="bsinf">
<div class="bstitle" {notempty name="story.title_txt_color" }style="color:{$story.title_txt_color};" <div class="bstitle" {notempty name="story.title_txt_color" }style="color:{$story.title_txt_color};" {/notempty}>{$story.title}</div>
{/notempty}>{$story.title}</div> <div class="bssubtitle" {notempty name="story.desc_txt_color" }style="color:{$story.desc_txt_color};" {/notempty}>{$story.desc|raw}</div>
<div class="bssubtitle" {notempty name="story.desc_txt_color" }style="color:{$story.desc_txt_color};"
{/notempty}>{$story.desc|raw}</div>
<a class="bsmore" href="{$story.link}">{:lang_i18n('了解更多')} ></a> <a class="bsmore" href="{$story.link}">{:lang_i18n('了解更多')} ></a>
</div> </div>
</div> </div>
@@ -276,14 +266,14 @@
const videoContainer = $('.hotvideo'); const videoContainer = $('.hotvideo');
const img = $('.hotImg'); const img = $('.hotImg');
// 监听视频加载完成事件 // 监听视频加载完成事件
video.on('canplaythrough', function() { video.on('canplaythrough', function () {
// 显示视频容器,隐藏图片 // 显示视频容器,隐藏图片
videoContainer.css('display', 'block'); videoContainer.css('display', 'block');
img.hide(); img.hide();
console.log('视频可以流畅播放'); console.log('视频可以流畅播放');
}); });
// 处理视频加载失败(可选) // 处理视频加载失败(可选)
video.on('error', function() { video.on('error', function () {
// 可在此添加失败提示,如显示错误信息或保留图片 // 可在此添加失败提示,如显示错误信息或保留图片
img.show(); img.show();
videoContainer.css('display', 'none'); videoContainer.css('display', 'none');
@@ -340,11 +330,11 @@
}, },
}); });
// 计算品牌故事轮播个数样式调整 // 计算品牌故事轮播个数样式调整
function calculateDisplayValue (n) { function calculateDisplayValue(n) {
return 8 - n; return 8 - n;
} }
// 动态调整分页点和年份位置 // 动态调整分页点和年份位置
function adjustTimeline () { function adjustTimeline() {
const slideCount = brandStoryswiper.slides.length; // 获取轮播项个数 const slideCount = brandStoryswiper.slides.length; // 获取轮播项个数
if (slideCount === 0) return; if (slideCount === 0) return;
// 计算分页点间距 // 计算分页点间距