<?php
if (!defined('ROOT_PATH')) { exit('Access Denied'); }
require_once __DIR__ . '/_functions.php';
$tplNavKey = 'home';
$slides = tpl_slides(6);
$productRoot = tpl_root_channel(2);
$newsRoot = tpl_root_channel(1);
$productChannels = $productRoot ? tpl_channels($productRoot['id']) : array();
$products = $productRoot ? tpl_latest('product', $productRoot['id'], 12) : tpl_latest('product', 0, 12);
$news = $newsRoot ? tpl_latest('article', $newsRoot['id'], 6) : tpl_latest('article', 0, 6);
$links = tpl_links(20);
require_once __DIR__ . '/_header.php';
?>
<div class="apple-banner"><div class="swiper-container" id="swiper1"><div class="swiper-wrapper">
    <?php if ($slides): foreach ($slides as $slide): $slideImage = tpl_normalize_url($slide['litpic']); ?>
        <div class="swiper-slide slide2" style="background-image:url('<?php echo tpl_e($slideImage); ?>')"><?php if (!empty($slide['link'])): ?><a class="k620-slide-link" href="<?php echo tpl_e($slide['link']); ?>" target="<?php echo tpl_e($slide['target']); ?>" aria-label="<?php echo tpl_e($slide['title']); ?>"></a><?php endif; ?></div>
    <?php endforeach; else: ?>
        <div class="swiper-slide slide2" style="background-image:url('<?php echo tpl_e(tpl_reference_image('1742359865217479.jpg')); ?>')"></div>
    <?php endif; ?>
</div><div class="swiper-pagination"></div><div class="swiper-button-prev"><span></span></div><div class="swiper-button-next"><span></span></div></div></div>
</div>

<section class="abIdxTj_Pro"><div class="w1400">
    <div class="ab_tit"><div class="abtit_l"><b>推荐产品</b><span>PRODUCTS</span></div><div class="abtit_btn"><a href="<?php echo tpl_e($productRoot ? getUrl('channel', $productRoot['id'], $productRoot['channel_dir']) : getUrl('product')); ?>"><img src="<?php echo tpl_e(tpl_asset('skin/images/jt05.png')); ?>" alt="">所有产品</a></div></div>
    <div class="abIdx_Menu"><div class="abIdxMenu_tit"><b>产品目录</b><a href="javascript:;" class="abIdxMenu_Mbtn"><img src="<?php echo tpl_e(tpl_asset('skin/images/jt05.png')); ?>" alt=""></a></div><ul>
        <?php foreach ($productChannels as $channel): ?><li><a href="<?php echo tpl_e(getUrl('channel', $channel['id'], $channel['channel_dir'])); ?>"><?php echo tpl_e($channel['channel_name']); ?></a></li><?php endforeach; ?>
    </ul></div>
    <div class="abIdxTjPro_list"><div class="swiper-container" id="swiper2"><div class="swiper-wrapper">
        <?php foreach ($products as $product): ?><div class="swiper-slide"><div class="abIdxTjPro_Img"><a href="<?php echo tpl_e(tpl_item_url('product', $product)); ?>"><img src="<?php echo tpl_e(tpl_img($product)); ?>" alt="<?php echo tpl_e($product['title']); ?>"></a></div><div class="abIdxTjPro_Text"><a href="<?php echo tpl_e(tpl_item_url('product', $product)); ?>" class="abIdxTjPro_Name"><?php echo tpl_e($product['title']); ?></a><p><?php echo tpl_e(tpl_text(!empty($product['summary']) ? $product['summary'] : $product['content'], 90)); ?></p><div class="abIdxTjPro_btn"><a href="<?php echo tpl_e(tpl_item_url('product', $product)); ?>" class="abIdxTjPro_btn1">查看详情</a></div></div></div><?php endforeach; ?>
    </div></div><div class="swiper-button-prev"></div><div class="swiper-button-next"></div></div><div class="clear"></div>
</div></section>

<section class="abIdx_Pro"><div class="w1400"><div class="abIdxPro_list"><ul>
    <?php foreach ($products as $product): ?><li><div class="abIdxPro_Img"><a href="<?php echo tpl_e(tpl_item_url('product', $product)); ?>"><img src="<?php echo tpl_e(tpl_img($product)); ?>" alt="<?php echo tpl_e($product['title']); ?>"></a></div><div class="abIdxPro_Name"><a href="<?php echo tpl_e(tpl_item_url('product', $product)); ?>"><?php echo tpl_e($product['title']); ?></a></div></li><?php endforeach; ?>
    <?php if (!$products): ?><li class="cms-empty">暂无产品内容</li><?php endif; ?>
</ul><div class="clear"></div></div></div></section>

<section class="abIdx_About"><div class="w1400">
    <div class="abIdxAbout_l"><div class="ab_tit"><div class="abtit_l"><b>关于我们</b><span>ABOUT US</span></div></div><div class="clear"></div>
        <div class="abIdxAbout_Con"><?php echo tpl_e(tpl_company_intro_text(420)); ?></div>
        <div class="abIdxAbout_ys"><ul>
            <li><a href="<?php echo tpl_e(tpl_page_link('about')); ?>#ab02"><img src="<?php echo tpl_e(tpl_asset('skin/images/about_ico01.png')); ?>" alt=""><p>企业文化</p></a></li>
            <li><a href="<?php echo tpl_e(tpl_page_link('about')); ?>#ab03"><img src="<?php echo tpl_e(tpl_asset('skin/images/about_ico02.png')); ?>" alt=""><p>荣誉资质</p></a></li>
            <li><a href="<?php echo tpl_e(tpl_page_link('contact')); ?>"><img src="<?php echo tpl_e(tpl_asset('skin/images/about_ico03.png')); ?>" alt=""><p>联系我们</p></a></li>
        </ul></div>
    </div>
    <div class="abIdxAbout_r"><a href="<?php echo tpl_e(tpl_page_link('about')); ?>"><img src="<?php echo tpl_e(tpl_reference_image('1742194824442955.jpg')); ?>" alt="关于<?php echo tpl_e(tpl_site_name()); ?>"></a></div><div class="clear"></div>
</div></section>

<?php if ($news): $featured = $news[0]; ?>
<section class="abIdx_News"><div class="w1400"><div class="ab_tit"><div class="abtit_l"><b>新闻资讯</b><span>NEWS</span></div></div><div class="abIdx_tit"><a href="<?php echo tpl_e($newsRoot ? getUrl('channel', $newsRoot['id'], $newsRoot['channel_dir']) : getUrl('article')); ?>">查看更多<em></em></a><div class="clear"></div></div>
    <div class="abIdxNews_list"><div class="list_Part on"><div class="abIdxNews_l">
        <div class="abIdxNewsTj_Img"><a href="<?php echo tpl_e(tpl_item_url('article', $featured)); ?>"><img src="<?php echo tpl_e(tpl_img($featured, tpl_reference_image('1742361317226024.jpg'))); ?>" alt="<?php echo tpl_e($featured['title']); ?>"></a></div>
        <div class="abIdxNewsTj_Text"><a href="<?php echo tpl_e(tpl_item_url('article', $featured)); ?>" class="abIdxNewsTj_Name"><?php echo tpl_e($featured['title']); ?></a><p><?php echo tpl_e(tpl_text(!empty($featured['summary']) ? $featured['summary'] : $featured['content'], 130)); ?></p><div class="abIdxNewsTj_time"><span><?php echo date('Y-m-d', tpl_row_time($featured)); ?></span><a href="<?php echo tpl_e(tpl_item_url('article', $featured)); ?>"><i></i></a></div></div>
    </div><div class="abIdxNews_r"><ul>
        <?php foreach (array_slice($news, 1, 3) as $article): ?><li><div class="abIdxNews_time"><span><?php echo date('Y', tpl_row_time($article)); ?></span><b><?php echo date('m-d', tpl_row_time($article)); ?></b><a href="<?php echo tpl_e(tpl_item_url('article', $article)); ?>">查看详情</a></div><div class="abIdxNews_Text"><a href="<?php echo tpl_e(tpl_item_url('article', $article)); ?>" class="abIdxNews_Name"><?php echo tpl_e($article['title']); ?></a><p><?php echo tpl_e(tpl_text(!empty($article['summary']) ? $article['summary'] : $article['content'], 130)); ?></p></div></li><?php endforeach; ?>
    </ul></div><div class="clear"></div></div></div>
</div></section>
<?php endif; ?>

<section class="abIdx_Contact"><div class="w1400"><div class="abIdx_tit2"><span>CONTACT US</span><p><i></i>欢迎与我们联系<i></i></p></div><div class="clear"></div><div class="abIdxContact_list"><ul>
    <li><div class="abIdxContact_T"><img src="<?php echo tpl_e(tpl_asset('skin/images/lycontact_ico01.png')); ?>" alt="">咨询热线：</div><p><?php echo tpl_e(tpl_phone()); ?></p></li>
    <li><div class="abIdxContact_T"><img src="<?php echo tpl_e(tpl_asset('skin/images/lycontact_ico02.png')); ?>" alt="">联系人：</div><p><?php echo tpl_e(tpl_contact_person()); ?></p></li>
    <li><div class="abIdxContact_T"><img src="<?php echo tpl_e(tpl_asset('skin/images/lycontact_ico03.png')); ?>" alt="">电子邮箱：</div><p><?php echo tpl_e(tpl_email()); ?></p></li>
    <li><div class="abIdxContact_T"><img src="<?php echo tpl_e(tpl_asset('skin/images/lycontact_ico04.png')); ?>" alt="">公司地址：</div><p><?php echo tpl_e(tpl_address()); ?></p></li>
</ul></div></div></section>

<?php if ($links): ?><div class="ab_Links"><div class="w1400"><div class="abLinks_main"><div class="Lk_tit">友情链接 / LINKS</div><div class="Lk_list"><?php foreach ($links as $link): ?><a href="<?php echo tpl_e($link['link_url']); ?>" target="<?php echo tpl_e($link['target']); ?>"><?php echo tpl_e($link['link_name']); ?></a><?php endforeach; ?></div></div></div></div><?php endif; ?>
<?php require_once __DIR__ . '/_footer.php'; ?>
