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