feat: 新品上市
This commit is contained in:
51
app/index/view/product/newpro.html
Normal file
51
app/index/view/product/newpro.html
Normal file
@@ -0,0 +1,51 @@
|
||||
{extend name="public/base" /}
|
||||
{block name="style"}
|
||||
<link rel="stylesheet" href="__CSS__/product_newpro.css">
|
||||
{/block}
|
||||
{block name="main"}
|
||||
<div class="orico_Page_newproducts">
|
||||
<!-- 新品-->
|
||||
<!-- 主打产品banner轮播 -->
|
||||
<div class="opdBanner">
|
||||
{volist name="focus_image" id="fo"}
|
||||
<a {notempty name="fo.link"}href="{$fo.link}"{/notempty}><img src="{$fo.image}" class="opdbannerImg" /></a>
|
||||
{/volist}
|
||||
</div>
|
||||
{volist name="newpros" id="vo"}
|
||||
<div class="oricoNewPrMain">
|
||||
<h1 class="ori-pd-title">{$vo.category.name}</h1>
|
||||
<div class="ori-pd-list">
|
||||
{volist name="vo.products" id="pro"}
|
||||
<a class="oripditem" href="{:url('product/detail', ['id' => $pro.id])}">
|
||||
<!-- <div class="oNpicoNEW">New</div> -->
|
||||
<img src="{$pro.cover_image}" class="prdimg prdimg-show" />
|
||||
<div class="prdName">{$pro.name}</div>
|
||||
<div class="prddec">{$pro.spu}</div>
|
||||
</a>
|
||||
{/volist}
|
||||
</div>
|
||||
</div>
|
||||
{/volist}
|
||||
</div>
|
||||
{/block}
|
||||
{block name="script"}
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
// 显示第一张图片
|
||||
$('.opdbannerImg').eq(0).show();
|
||||
let currentIndex = 0;
|
||||
const imgCount = $('.opdbannerImg').length;
|
||||
setInterval(() => {
|
||||
// 淡出当前图片
|
||||
$('.opdbannerImg').eq(currentIndex).fadeTo(10, 0, () => {
|
||||
// 隐藏当前图片
|
||||
$('.opdbannerImg').eq(currentIndex).hide();
|
||||
// 计算下一张图片的索引
|
||||
currentIndex = (currentIndex + 1) % imgCount;
|
||||
// 显示并淡入下一张图片
|
||||
$('.opdbannerImg').eq(currentIndex).show().fadeTo(10, 1);
|
||||
});
|
||||
}, 10000);
|
||||
});
|
||||
</script>
|
||||
{/block}
|
||||
Reference in New Issue
Block a user