This commit is contained in:
2024-10-29 14:04:59 +08:00
commit 48bf3e6f33
2839 changed files with 762707 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
<?php
$r = mt_rand(10000, 100000);
foreach ($list as $k => $product):
?>
<dd class="aej<?php echo $r + $k + 1; ?>">
<div class="ejimg bd c<?php echo $k + 1; ?>">
<ul>
<li><a href="<?php echo url_rewrite('productdetail', ['id' => $product['id']]); ?>"><img src="<?php echo getImage($product['picture']); ?>"></a></li>
<li><a href="<?php echo url_rewrite('productdetail', ['id' => $product['id']]); ?>"><img src="<?php echo getImage($product['picture_back']); ?>"></a></li>
</ul>
</div>
<div class="ejtext">
<div class="text1">
<p><a href="<?php echo url_rewrite('productdetail', ['id' => $product['id']]); ?>"><?php echo $product['name']; ?></a></p>
<p><a href="<?php echo url_rewrite('productdetail', ['id' => $product['id']]); ?>"><?php echo $product['shortname']; ?></a></p>
</div>
<div class="hd">
<ul>
<li></li><li></li>
</ul>
</div>
<script type="text/javascript">
jQuery(".aej<?php echo $r + $k + 1; ?>").slide({mainCell: ".bd ul", trigger: "click"});
</script>
<div class="clear"></div>
</div>
<div class="mask"><?php echo $product['categoryname']; ?></div>
</dd>
<?php
endforeach;
?>
<div class="clear"></div>

View File

@@ -0,0 +1,241 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
{include file="include/head-seo" /}
{include file="include/head" /}
<script type="text/javascript" src="__PUBLIC__/web/scripts/jquery.nicescroll.js"></script>
<link rel="stylesheet" type="text/css" href="__PUBLIC__/web/scripts/bxslider/jquery.bxslider-list.css">
<script type="text/javascript" src="__PUBLIC__/web/scripts/bxslider/jquery.bxslider.min.js"></script>
<script type="text/javascript">
var navID = "1";
</script>
</head>
<body>
<!--top-->
<header class="header-PC header-Index">
<div id="header">
{include file="include/top-head2023" /}
</div>
</header>
<!--top End-->
{include file="include/catbanner" /}
<!--if($hotproducts[0]['product_img']=='')-->
<?php if (!empty($oneLevelCategory[7])): ?>
<div class="lj_index_img_02">
<div class="lj_its_img">
<ul>
<?php foreach ($oneLevelCategory as $k1 => $pc1): ?>
<li>
<div class="lj-port-1 effect-1">
<div class="position-r"> <a href="<?php echo url_rewrite('productsub', ['id' => $pc1['id']]); ?>"><img src="<?php echo $pc1['image']; ?>" target="_blank">
<div class="groups_a"><?php echo $pc1['name']; ?></div>
</a></div>
<div class="text-desc"> <a href="<?php echo url_rewrite('productsub', ['id' => $pc1['id']]); ?>" target="_blank"> <img src="<?php echo getImage($pc1['picture']); ?>" alt=""/> </a></div>
</div>
</li>
<?php endforeach; ?>
</ul>
</div>
</div>
<script type="text/javascript">
var pl_length = $(".lj_its_img li").length
var pl_slier_width = $(".lj_its_img").width();
//var pl_li_width = pl_slier_width * 0.1429;
if(pl_slier_width>960){
var pl_li_width = pl_slier_width * 0.125;
}else if(pl_slier_width<640){
var pl_li_width = pl_slier_width * 0.25;
}else{
var pl_li_width = pl_slier_width * 0.2;
}
if((pl_li_width * pl_length)>pl_slier_width){
$(document).ready(function(){
$('.lj_index_img_02 ul').bxSlider({
slideWidth: pl_li_width,
minSlides: 1,
maxSlides: 7,
moveSlides: 1,
slideMargin: 0,
auto:true,
controls:true,
pager:false,
infiniteLoop:false
});
});
}
</script>
<?php else: ?>
<div class="lj_index_img">
<div class="lj_its_img">
<ul>
<?php foreach ($oneLevelCategory as $k1 => $pc1): ?>
<li class="">
<div class="lj-port-1 effect-1">
<div class="position-r"> <a href="<?php echo url_rewrite('productsub', ['id' => $pc1['id']]); ?>" target="_blank"><img src="<?php echo $pc1['image']; ?>" >
<div class="groups_a"><?php echo $pc1['name']; ?></div>
</a></div>
<div class="text-desc"> <a href="<?php echo url_rewrite('productsub', ['id' => $pc1['id']]); ?>" target="_blank"> <img src="<?php echo getImage($pc1['picture']); ?>" alt=""/> </a></div>
</div>
</li>
<?php endforeach; ?>
</ul>
</div>
</div>
<script type="text/javascript">
var pl_length = $(".lj_its_img li").length
var pl_slier_width = $(".lj_its_img").width();
//var pl_li_width = pl_slier_width * 0.1429;
if(pl_slier_width>960){
var pl_li_width = pl_slier_width * 0.125;
}else if(pl_slier_width<640){
var pl_li_width = pl_slier_width * 0.25;
}else{
var pl_li_width = pl_slier_width * 0.2;
}
if((pl_li_width * pl_length)>pl_slier_width){
$(document).ready(function(){
$('.lj_index_img ul').bxSlider({
slideWidth: pl_li_width,
minSlides: 1,
maxSlides: 7,
moveSlides: 1,
slideMargin: 0,
auto:true,
controls:true,
pager:false,
infiniteLoop:false
});
});
}
</script>
<?php endif; ?>
<!-- top 内容 s -->
<div class="indexbox-list-white">
<div class="swt-Container">
<!-- 电源产品 s -->
<?php if (empty($oneLevelCategory)){}else{?>
<?php if (!empty($oneLevelCategory)): ?>
<!-- 产品列表 s -->
<ul class="dcp">
<script src="<?php echo url('index/ad/tagsli', ['tags' => 'top_category_id_' . ($category['id']), 'num' => 4]); ?>" type="text/javascript"></script>
<div class="clear"></div>
</ul>
<!-- 产品列表 e -->
<?php endif; ?>
<?php
$products = getCateProduct($category['id'], 6, ['p.ishot' => 1], true);
if ($products):
?>
<!-- 热门产品 s -->
<div class="rmBox">
<div class="rmtit rmtit1">热门产品</div>
<ul>
<script src="<?php echo url('index/ad/tagsli', ['tags' => 'hot_category_id_' . ($category['id']), 'num' => 4]); ?>" type="text/javascript"></script>
<div class="clear"></div>
</ul>
</div>
<!-- 热门产品 e -->
<?php endif; ?>
</div>
<?php }?>
</div>
<!-- top 内容 e -->
<!-- 背景灰色 内容区 s -->
<?php if (!empty($oneLevelCategory)): ?>
<div class="indexbox-list cdbox">
<div class="swt-Container">
<?php foreach ($oneLevelCategory as $k1 => $pc1): ?>
<?php
$products = getCateoneProduct($pc1['id'], 5, [], true);
// tiaoshi($products);die;
// echo \think\Db::table('Product')->getLastSql();die;
// print_r($products);die;
if ($products):
?>
<div class="daily">
<div class="datit">
<p class="da1"><?php echo $pc1['name']; ?></p>
<p class="da2"><a href="<?php echo url_rewrite('productsub', ['id' => $pc1['id']]); ?>" target="_blank">查看全部<i></i></a></p>
<div class="clear"></div>
</div>
<!--<?php
switch ($k1 % 2) {
case 0:
?>
<div class="dafl">
<!--<script src="<?php echo url('index/ad/tags', ['tags' => 'category_left_' . ($pc1['id'])]); ?>" type="text/javascript"></script>
</div>
<?php
break;
case 1:
?>
<div class="dafl1">
<!--<script src="<?php echo url('index/ad/tags', ['tags' => 'category_left_' . ($pc1['id']), 'num' => 2]); ?>" type="text/javascript"></script>
</div>
<?php
break;
default:
break;
}
?>-->
<ul class="darh" style="width:99%">
<?php foreach ($products as $product): ?>
<li>
<a href="<?php echo url_rewrite('productdetail', ['id' => $product['id']]); ?>" target="_blank">
<div class="daimg"><img src="<?php
if (isset($product['product_two_img'][0])) {
echo getImage($product['product_two_img'][0]['image_url']);
} else {
echo "#";
}
?>"></div>
<div class="datext">
<p class="dat1"><?php echo $product['name']; ?></p>
<p class="dat2"><?php echo $product['brand_id']; ?></p>
</div>
<?php if ($product['isnew']): ?><div class="newcp">新品</div><?php endif; ?>
</a>
</li>
<?php endforeach; ?>
</ul>
<div class="clear"></div>
<!--底部广告图<div class="hwban">
<script src="<?php echo url('index/ad/tags', ['tags' => 'category_bottom_' . ($pc1['id'])]); ?>" type="text/javascript"></script>
</div>-->
</div>
<?php endif; ?>
<?php endforeach; ?>
</div>
</div>
<?php endif; ?>
<!-- 背景灰色 内容区 e -->
<!-- bottom s -->
{include file="include/bottom2023" /}
<!-- bottom e -->
</body>
</html>

View File

@@ -0,0 +1,822 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
{include file="include/head-seo" /}
{include file="include/head" /}
{include file="include/head-product" /}
<script type="text/javascript" src="__PUBLIC__/web/scripts/comment.js"></script>
<script type="text/javascript">
var navID = "1";
</script>
</head>
<body>
<!--top-->
<header class="header-PC header-Product">
<div id="header" class="theme-black">
{include file="include/top-head2023" /}
</div>
</header>
<!--top End-->
<link rel="stylesheet" href="__PUBLIC__/web/css/tipso.min.css">
<script type="text/javascript" src="__PUBLIC__/web/scripts/large.js"></script>
<script src="__PUBLIC__/web/scripts/tipso.min.js"></script>
<div class="indexbox-product cpmbox">
<div class="swt-Container">
<div class="product_address">
<a href="/index" class="href_01">首页</a>
<span class="icon-arrow arrow_address"></span><?php if($pid==''){?>
<a href="<?php echo url_rewrite('product', ['id' => $cid['id']]); ?>" class="href_02"><?php echo $cid['name'];?></a>
<?php }else{?>
<a href="<?php echo url_rewrite('product', ['id' => $pid['id']]); ?>" class="href_02"><?php echo $pid['name'];?></a>
<?php }?>
<span class="icon-arrow arrow_address"></span> <a href="<?php echo url_rewrite('productsub', ['id' => $detail['cid']]); ?>" class="href_02"><?php echo $category['name'];?></a>
</div>
<!-- 产品 s -->
<div class="cp outBox">
<div class="cpfl">
<?php
$proimages = [];
$images = [];
if ($product_images):
$proimages = $product_images;
//判断属性规则为旧版【2023-12-30前】单一颜色属性 还是新版多属性
if(is_array($product_attr)) {
$images = reset($product_images);
$skuAttr = $images['image_color']; //获取多属性标签
}
else{
if ($color){
$images = $product_images[$color];
} else {
$images = reset($product_images);
}
}
?>
<!--preview start-->
<div class="preview">
<div class="smallImg">
<div class="scrollbutton smallImgUp disabled"></div>
<div id="imageMenu">
<ul id="image_list">
<?php
$firstimage = '';
if(is_array($product_attr) && is_array($images['image_url'])){
foreach($images['image_url'] as $km => $itm) {
if($km == 0) {
$firstimage = $itm;
echo '<li id="onlickImg"> <img src="'.getImage($itm).'"></li>';
}
else{
echo '<li> <img src="'.getImage($itm).'"></li>';
}
}
}
else{
if(isset($images['image_url']) && is_array($images['image_url'])) {
foreach ($images['image_url'] as $k => $img){
if($k == 0) { $firstimage = $img;}
echo '<li id="onlickImg"> <img src="'.getImage($img).'"></li>';
}
}
else{
foreach ($images as $k => $img){
if($k == 0) {
$firstimage = $img['image_url'];
echo '<li id="onlickImg"> <img src="'.getImage($img['image_url']).'"></li>';
}
else{
echo '<li> <img src="'.getImage($img['image_url']).'"></li>';
}
}
}
}
?>
</ul>
</div>
<div class="scrollbutton smallImgDown"></div>
</div><!--smallImg end-->
<div id="vertical" class="bigImg">
<img src="<?php echo getImage($firstimage); ?>" id="midimg"/>
</div><!--bigImg end-->
</div>
<!--preview end-->
<?php endif; ?>
<!-- 视频播放 s -->
<?php if ($detail['videopath'] == "") { ?><?php } else { ?>
<!--div class="play play1">
<a href="javascript:;" class="pcha"><img src="__PUBLIC__/web/images/images/cha1.png"></a>
<div class="moimg">
<video id="pvideo" width="100%" height="auto" controls
poster="<?php echo getImage($detail['picture']); ?>">
<source src="<?php echo $detail['videopath']; ?>">
您的浏览器不支持 video 标签。
Your browser does not support HTML5 video.
</video>
</div>
</div>
<div class="plbtn"><a href="javascript:;"><img src="__PUBLIC__/web/images/images/play.png"></a>
</div-->
<?php } ?>
<!-- 视频播放 e -->
</div>
<div class="cprh">
<div class="cpcon">
<p class="ctit1"><?php echo $detail['name']; ?></p>
<p class="ctit2"><?php echo $detail['shortname']; ?></p>
<div class="position-r" style="width:96px; margin-top:0.5vw;">
<!-- <img src="__PUBLIC__/web/images/star_whhite.png"> -->
<div class="star" style="width:<?php echo $detail['cpyanse']; ?>%;"></div>
</div>
</div>
<!-- 规格参数 s -->
<div class="proTfg">
<?php
if ($detail['product_view']) {
$detail_views = unserialize($detail['product_view']);
if ($detail_views) {
?>
<ul class="msul swt-Table">
<li class="Table-Row">
<div class="ms3 Table-Cell">型号</div>
<div class="ms2 Table-Cell"></div>
<div class="ms4 Table-Cell"><?php echo $detail['brand_id']; ?></div>
</li>
<?php foreach ($detail_views as $detail_view): ?>
<li class="Table-Row">
<div class="ms3 Table-Cell"><?php echo $detail_view['desc_title']; ?></div>
<div class="ms2 Table-Cell "></div>
<div class="ms4 Table-Cell"><?php echo $detail_view['desc_desc']; ?></div>
</li>
<?php endforeach; ?>
</ul>
<?php
}
}
?>
</div>
<!-- 规格参数 e -->
<?php if ($proimages): ?>
<?php
//echo "<pre>*******"; print_r($attributes);
if(is_array($attributes) && sizeof($attributes)){
foreach($attributes as $ka => $attrList){
echo "<div class='hd 111'><div class ='dt attr_type'>".$ka."</div>";
$isColor = false;
if(strtolower($ka) == 'color' || $ka == '颜色' || $ka == '色彩') {
echo "<ul class='dowebok'>";
$isColor = true;
}
else{
echo "<ul class='typeColor'>";
}
$colorType = '';
foreach($attrList as $kl => $attrValue){
$firstClass = " attr_item ".($kl ==0 ? "on" : "");
if($isColor){
//判断颜色属性取值【中文文字、色值、色块图英文名称】
$firstChar = substr($attrValue, 0, 1);
$colorFile = 'https://cc.f2b211.com/uploads/color/' .strtolower($attrValue). '.jpg';
if($kl == 0){
//判断为颜色色值RGB
if($firstChar == '#'){
$colorType = 1;
}
elseif(strlen($attrValue) ==2){
$colorType = 2;
}
//判断颜色色块图片是否存在
elseif(https_request($colorFile)){
$colorType = 3;
}
}
//判断为颜色色值RGB
if($colorType == 1){
echo '<li class="item attr_value '.$firstClass.'" data-type="'.$ka.'" data-value="'.trim($attrValue).'"><a style="background-color: '.$attrValue.'""></a></li>';
}
elseif($colorType == 2){
if(isset($productColor[strtoupper($attrValue)])) {
if($attrValue == 'GD'||$attrValue == 'GR'||$attrValue == 'SV'||$attrValue == 'RG'||$attrValue == 'CO'||$attrValue == 'WD'){
echo '<li class="item attr_value tip1 '.$firstClass.'" data-type="'.$ka.'" data-value="'.trim($attrValue).'" data-feed="'.$productColor[$attrValue].'" data-tipso="'.$productColor[strtoupper($attrValue)].'"><a><img src="/uploads/color/'.$attrValue.'.jpg" alt="" style="width:20px; height: 20px; border-radius: 10px; "></a></li>';
}
else{
echo '<li class="item attr_value tip1 '.$firstClass.'" data-type="'.$ka.'" data-value="'.trim($attrValue).'" data-feed="'.$productColor[$attrValue].'" data-tipso="'.$productColor[strtoupper($attrValue)].'"><span class="co-bg '.strtoupper($attrValue).'"></span></li>';
}
}else{
echo '<li class="item attr_value tip1 '.$firstClass.'" data-type="'.$ka.'" data-value="'.trim($attrValue).'" data-feed="'.strtoupper($attrValue).'" data-tipso="'.strtoupper($attrValue).'"><span class="co-bg '.strtoupper($attrValue).'"></span></li>';
}
}
//判断颜色色块图片是否存在
elseif($colorType == 3){
?>
<li class="item attr_value inner tip1 <?php echo $firstClass;?>" data-tipso="<?php echo strtoupper($attrValue);?>" data-type="<?php echo trim($ka);?>" data-value="<?php echo trim($attrValue);?>">
<a>
<img src="<?php echo '/uploads/color/'.strtolower($attrValue);?>.jpg" alt="" style="width:20px; height: 20px; border-radius: 10px; ">
</a>
</li>
<?php
}
else{
echo '<li class="item attr_value '.$firstClass.'" data-feed="'.strtoupper($attrValue).'" data-type="'.$ka.'" data-value="'.trim($attrValue).'"><a ><i class="text">'.strtoupper($attrValue).'</i></a></li>';
}
}
else{
echo '<li class="item attr_value '.$firstClass.'" data-feed="'.strtoupper($attrValue).'" data-type="'.$ka.'" data-value="'.trim($attrValue).'"><a ><i class="text">'.$attrValue.'</i></a></li>';
}
}
echo "</ul> </div>";
}
}
else{
//echo "<pre>=="; print_r($images); die;
if($images){
$firstKeys = array_keys($proimages);
$firstElement = array_shift($firstKeys);
if(!$firstElement == 0){
echo "<div class='hd 333'><div class ='dt'>颜色</div><ul class='dowebok'>";
}
foreach ($proimages as $k => $imgclrs):
if(!isset($imgclrs['product_id'])) {
$b = $k;
$c = $imgclrs[0]['image_color']; //背景图片色块
$colorName = mb_substr($b,-2,2);
if (!$c == '') { ?>
<li class="item inner <?php if ($b == $color): ?> on<?php endif; ?>" >
<a class="attr_value" href="<?php echo url_rewrite('productdetail', ['id' => $detail['id'], 'color' => $b]); ?>">
<img src="<?php echo $c; ?>" alt="" style="width:20px; height: 20px; border-radius: 10px; ">
</a>
</li>
<?php } } ?>
<?php endforeach; ?>
<?php echo " </ul></div>";?>
<?php } ?>
<?php } ?>
<?php endif; ?>
<div class="buy">
{volist name="purchase_links" id="vo"}
{if condition="trim($vo.link) != ''"}
<a target="_blank"
href="{$vo.link}"
class="business-button buybuttonin{$key == 0 ? ' btn1-blue-detail' : ' btn1-white-detail'} "
>
{$vo.platform}
</a>
{/if}
{/volist}
</div>
<!-- <div class="buy">
<?php if ($detail['url_tm']): ?>
<a href="<?php echo $detail['url_tm']; ?>" target="_blank" onclick="add_click(<?php echo $detail['id'] ?>, 1, '<?php echo $detail['url_tm']; ?>')">天猫购买</a>
<?php endif; ?>
<?php if ($detail['url_jd']): ?>
<a href="<?php echo $detail['url_jd']; ?>" target="_blank" onclick="add_click(<?php echo $detail['id'] ?>, 2, '<?php echo $detail['url_jd']; ?>')">京东购买</a>
<?php endif;?>
</div> -->
<!--a onclick="toggle_colleciton()" class="m_top_20">
<span class="house house_img01
<?php if ($detail['is_collection']): ?>
house_img02
<?php endif; ?>
"></span>
<div class="clear"></div>
</a-->
</div>
</div>
<!-- 产品 e -->
<script>
$(document).ready(function(){
$("a .house").click(function(){
$(this).toggleClass("house_img02");
})
})
</script>
</div>
</div>
<div class="warp">
<div class="warpa">
<!-- 锚链接 s -->
<ul class="cpa">
<li><a href="#link1">产品描述</a></li>
<?php if ($product_relateds): ?><li><a href="#link2">关联产品</a></li><?php endif; ?>
<?php if ($product_dls): ?><li><a href="#link3">相关下载</a></li><?php endif; ?>
<?php if ($count): ?><li><a href="#link4">评论</a></li><?php endif; ?>
<div class="clear"></div>
</ul>
<!-- 锚链接 e-->
</div>
<div class="swt-Container">
<!--产品详情-->
<div class="products_des"><?php echo $detail['ld_md_content']; ?></div>
</div>
<!-- 关联产品 s <?php //if ($product_relateds)print_r($product_relateds); ?>-->
<?php if ($product_relateds): ?>
<div class="warp2 proTfg">
<div class="swt-Container">
<div class="gltit" id="link2">关联产品</div>
<div class="cpBox">
<div class="owl-carousel">
<?php foreach ($product_relateds as $product):; ?>
<div class="item wow">
<?php $img = getProductReated($product['id']); ?>
<a href="<?php echo url_rewrite('productdetail', ['id' => $product['id']]); ?>">
<div class="glimg img-responsive"><img src="<?php echo $product['list_bk_img']; ?>">
<!--换成一级列表图--></div>
<div class="gltext">
<p class="gl1"><?php echo $product['name']; ?></p>
<p class="gl2"> <?php echo $product['brand_id']; ?></p>
<!-- <p class="gl2">-->
<?php //echo $product['shortname']; ?><!--</p>-->
</div>
<div class="clear"></div>
</a>
</div>
<?php endforeach; ?>
</div>
<script>
var owl = $(".cpBox .owl-carousel");
owl.owlCarousel({
autoplay: true,
navigationText: ["", ""],
responsive: {
0: {
items: 1,
margin: 0
},
420: {
items: 1,
margin: 0,
smartSpeed: 80,
dots: false
},
640: {
items: 2,
margin: 0,
smartSpeed: 80,
dots: false
},
998: {
items: 3,
margin: 0,
smartSpeed: 80,
dots: false
},
},
})
</script>
</div>
</div>
</div>
<?php endif; ?>
<!-- 相关下载 s -->
<?php if ($product_dls) { ?>
<div class="nybox proTfg">
<div class="swt-Container">
<div class="sptit" id="link3">相关下载</div>
<?php
if ($product_dls):
$selectTypeArr = config("product_dltype");
$prodls = [];
foreach ($product_dls as $dlrow) {
$prodls[$dlrow['dl_type']][] = $dlrow;
}
?>
<?php foreach ($prodls as $type => $dlclrs): ?>
<div class="xz">
<p class="xztit"><?php echo isset($selectTypeArr[$type]) ? $selectTypeArr[$type] : ''; ?></p>
<?php foreach ($dlclrs as $dl): ?>
<p class="xz1"><a
href="<?php echo url('index/download/prodownload', ['id' => $dl['id']]); ?>"><i></i><?php echo $dl['dl_name']; ?>
</a></p>
<?php endforeach; ?>
</div>
<?php endforeach; ?>
<?php endif; ?>
</div>
</div>
<?php } ?>
<!-- 相关下载 e -->
<script type="text/javascript">
$(function () {
var $category = $(".ans .anbox");
$category.hide();
$(".ans .antit").click(function () {
if ($(this).next(".anbox").is(":visible")) {
$(this).removeClass('on').next().slideUp(800);
$(this).parent('.ans').removeClass('on');
$(this).children("i").removeClass("ons")
} else {
$category.hide();
$(".ans .antit").removeClass('on');
$(this).children("i").addClass("ons")
$(this).addClass('on').next().slideDown(800);
$(this).parent('.ans').addClass('on');
}
});
});
$(function () {
$('a[href*=#],area[href*=#]').click(function () {
if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname) {
var $target = $(this.hash);
$target = $target.length && $target || $('[name=' + this.hash.slice(1) + ']');
if ($target.length) {
var targetOffset = $target.offset().top - 50;
$('html,body').animate({
scrollTop: targetOffset
}, 800);
return false; //页面锚点跳转动画 后面的800是锚点跳转的时间 800ms
}
}
});
})
$("input").click(function () {
$(this).siblings("div").children("span").addClass("active");
$(this).parents("div").siblings("div").find("span").removeClass("active");
});
$(function () {
$(window).scroll(function () {
var arr = []
$.each($(".proTfg"), function (k, v) {
arr[k] = $(this).offset().top + $(this).height();
})
$.each(arr, function (k, v) {
if (($(window).scrollTop() + $(".cpa li").eq(k - 1).height() + 10) < v) {
if (!$(".cpa li").eq(k).hasClass("current")) {
$(".cpa li").eq(k).attr("class", "current").siblings().removeClass();
}
return false;
}
})
})
})
</script>
</div>
<div class="enlarge-img" style="display: none;">
<div class="scrollbutton_01 smallImgUp disabled"></div>
<img src="<?php echo getImage($firstimage); ?>">
<div class="scrollbutton_01 smallImgDown"></div>
<div class="close"><span class="icon-close"></div>
</div>
<!--评论-->
<?php if ($count): ?>
<div class="" style="background-color:#f1f1f1; overflow: hidden;">
<div class="detail_title">
<p class="de_t_n" id="link4">评论</p>
<div class="position-r" style="width:96px; margin:auto;">
<img src="__PUBLIC__/web/images/star_whhite.png">
<div class="star" style="width:<?php echo $detail['cpyanse']; ?>%;"></div>
</div>
<p>{$count}条评论</p>
</div>
{volist name = 'list' id = 'user'}
<!--图片放大-->
<div class="swt-Container detail_con_a">
<div class="lj_detail_text clearfix">
<p><b class="Ts-black">{$user.auctionSku}</b></p>
</div>
<div class="lj_detail_texts clearfix">
<p>{$user.displayUserNick} {$user.rateDate}</p>
<p>{$user.rateContent}</p>
</div>
<div class="tm-m-photos">
{if condition="$user['pics'] eq null"}
{else/}
<ul class="tm-m-photos-thumb">
{volist name="user['pics']" id='vv'}
<li data-src="{$vv}"> <img src="{$vv}"> <b class="tm-photos-arrow"></b> </li>
{/volist}
</ul>
{/if}
<div class="tm-m-photo-viewer transition1">
<img src="img/a1.png">
<a class="tm-m-photo-viewer-navleft" style="cursor: default;"> <i
class="tm-m-photo-viewer-navicon arrow-right">&lt;</i> </a>
<a class="tm-m-photo-viewer-navright" data-spm-anchor-id="a220o.1000855.0.0" style="cursor: pointer;"> <i
class="tm-m-photo-viewer-navicon arrow-right">&gt;</i> </a>
</div>
<div>
</div>
</div>
</div>
<!--详情新增样式-->
{/volist}
{$page}
</div>
<div class="alert" style="display: none">
<div class="alert_white"></div>
</div>
<?php endif; ?>
<style>
.cp .cprh .buy a.btn1-blue-detail:hover{
background: #0044e2;
color: #fff !important;
}
.btn1-blue-detail {
background: #0044e2;
color: #fff !important;
cursor: pointer;
display: inline-block;
font-size: 14px;
line-height: 36px;
text-align: center;
width: 150px;
height: 36px;
border: 1px solid #009fdf!important;
margin-right: 18px;
}
.cp .cprh .buy a.btn1-white-detail:hover{
background: #fff;
color: #0044e2!important;
}
.btn1-white-detail {
background: #fff;
color: #0044e2!important;
cursor: pointer;
display: inline-block;
font-size: 14px;
line-height: 36px;
text-align: center;
width: 150px;
height: 36px;
border: 1px solid #009fdf !important;
margin-right: 18px;
}
.buybuttonin {
border: 1px solid #0044e2 !important;
border-radius: 32px;
width: auto;
padding: 0px 30px;
height: auto;
margin-top: 40px;
}
.indexbox-product {
width: 100%;
height: auto;
padding: 40px 0 0;
background: #f1f1f1;
margin-top: 0px !important;
}
</style>
<script>
$(function () {
var obj = new commentMove('.tm-m-photos', '.tm-m-photo-viewer');
obj.init()
})
</script>
<script>
$(function() {
$('.tip1').tipso({
useTitle: false
});
});
/*图片放大效果*/
$(".bigImg").click(function () {
$(".enlarge-img").show();
});
$(".enlarge-img .close").click(function () {
$(".enlarge-img").hide();
});
$(function () {
var attributes = JSON.parse('<?php echo json_encode($product_attr);?>');
var pictures = JSON.parse('<?php echo json_encode($product_images);?>');
//多属性选择及绑定事件
$(".hd .attr_item").click(function(){
$(this).siblings().removeClass('on');
$(this).toggleClass('on');
var attrVal = $(this).data('feed');
if($(this).hasClass("on")){
$(this).parents(".hd").find(".selectedAttr").text(attrVal);
}
else{
$(this).parents(".hd").find(".selectedAttr").html('');
}
//验证是否所有属性全部选中
var skuCount = $('.attr_type').length;
var activeCount = $('.hd .on').length;
var productAttr = skuAttrType();
if(activeCount == skuCount)
{
//勾选属性事件: 重新加载属性图片
pictures.forEach(function(image, key) {
//选中的属性
var imageColor = image.image_color;
//console.log(imageColor);
//console.log('===========');
//console.log(imageColor.filter(item => productAttr.includes(item)));
//判断属性是否全部匹配
var attrFlag = true;
attributes.forEach(function(attrName, kat) {
//console.log(imageColor[kat][attrName] + '=====+++++====' + productAttr[kat][attrName]);
if(imageColor[kat][attrName] == productAttr[kat][attrName]){
}else{
attrFlag = false;
return;
}
})
if(attrFlag){
var smaImagesHtml = '';
var bigImagesHtml = '';
var firstImage = '';
var imageUrl = image.image_url;
imageUrl.forEach(function(atrVal,atrKey) {
if(atrKey == 0) {
$("#midimg").attr('src', atrVal);
}
//bigImagesHtml += '<li id="onlickImg"> <img src="' + atrVal + '"></li>';
bigImagesHtml += '<li> <img src="' + atrVal + '"></li>';
smaImagesHtml += '<div class="swiper-slide"><a href="javascript:void(0);"><img src="' + atrVal + '"></a></div>';
});
$("#image_list").html(bigImagesHtml);
$("#mswiper-list").html(smaImagesHtml);
}
})
}
});
});
function skuAttrType(){
// 获取规格值
var spec = [];
$('.hd .on').each(function()
{
var typeName = $(this).data('type');
var selected = {};
selected[typeName] = $(this).data('value');
spec.push(selected);
});
return JSON.parse(JSON.stringify(spec));
}
</script>
<!-- bottom s -->
{include file="include/bottom2023" /}
<!-- bottom e -->
</body>
</html>
<script type="text/javascript">
function add_click(content_id, type, url) {
$.ajax({
url: '/index/clicksum/add_click',
data: {
content_id: content_id,
type: type,
customer_id: 0,
country_code: 'ZH',
url:url
},
type: 'post',
dataType: 'json',
success: function(res) {
}
})
}
var curr_url = '/product/detail/<?php echo $detail['id']; ?>.html';
var is_collection = <?php echo $detail['is_collection']; ?>;
var flag = 1; // 限制调用收藏接口 1可用 0不可用
function toggle_colleciton()
{
if (flag == 0)
{
return;
}
is_collection = Number(!is_collection);
flag = 0;
if (is_collection)
{
var url = '/index/collection/add_collection';
}
else
{
var url = '/index/collection/cancel_collection';
}
var coll_id = <?php echo $detail['id']; ?>;
var data = {
type: 1,
coll_id: coll_id,
curr_url: curr_url
};
$.ajax({
url: url,
type: 'post',
dataType: 'json',
data : data,
success: function(res) {
if (res.code == -1000)
{
$('.alert').show();
$('.alert_white').html('请先登录').delay(1000).fadeOut();
setTimeout(function() {
location.href = '/login.html?url=' + res.data.url;
}, 800);
}
}
});
setTimeout(function() {
flag = 1;
}, 1000);
}
</script>

View File

@@ -0,0 +1,534 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
{include file="include/head-seo" /}
{include file="include/head-product" /}
<script type="text/javascript" src="__PUBLIC__/web/scripts/comment.js"></script>
<script type="text/javascript">
var navID = "1";
</script>
</head>
<body>
<!--top-->
<header class="header-PC header-Product">
<div id="header" class="theme-black">
{include file="include/top" /}
{include file="include/top-header" /}
</div>
</header>
<!--top End-->
<script type="text/javascript" src="__PUBLIC__/web/scripts/large.js"></script>
<div class="indexbox-product cpmbox">
<div class="swt-Container">
<div class="product_address">
<a href="/index" class="href_01">首页</a>
<span class="icon-arrow arrow_address"></span><?php if($pid==''){?>
<a href="<?php echo url_rewrite('product', ['id' => $cid['id']]); ?>" class="href_02"><?php echo $cid['name'];?></a>
<?php }else{?>
<a href="<?php echo url_rewrite('product', ['id' => $pid['id']]); ?>" class="href_02"><?php echo $pid['name'];?></a>
<?php }?>
<span class="icon-arrow arrow_address"></span> <a href="<?php echo url_rewrite('productsub', ['id' => $detail['cid']]); ?>" class="href_02"><?php echo $category['name'];?></a>
</div>
<!-- 产品 s -->
<div class="cp outBox">
<div class="cpfl">
<?php
$proimages = [];
$images = [];
if ($product_images):
$proimages = $product_images;
if ($color){
$images = $product_images[$color];
} else {
$images = reset($product_images);
}
?>
<!--preview start-->
<div class="preview">
<div class="smallImg">
<div class="scrollbutton smallImgUp disabled"></div>
<div id="imageMenu">
<ul>
<?php
$firstimage = '';
foreach ($images as $k => $img):
?>
<li<?php if ($k == 0):$firstimage = $img['image_url']; ?> id="onlickImg"<?php endif; ?>>
<img src="<?php echo getImage($img['image_url']); ?>"></li>
<?php endforeach; ?>
</ul>
</div>
<div class="scrollbutton smallImgDown"></div>
</div><!--smallImg end-->
<div id="vertical" class="bigImg">
<img src="<?php echo getImage($firstimage); ?>" id="midimg"/>
</div><!--bigImg end-->
</div>
<!--preview end-->
<!-- phone s-->
<div class="swiper-container banners">
<div class="swiper-wrapper">
<?php foreach ($images as $img): ?>
<div class="swiper-slide"><a href="javascript:void(0);"><img
src="<?php echo getImage($img['image_url']); ?>"></a></div>
<?php endforeach; ?>
</div>
<!-- Add Pagination -->
<div class="swiper-pagination bandot"></div>
</div>
<script type="text/javascript">
var swiper = new Swiper('.banners', {
loop: true,
autoplay: true,
pagination: {el: '.bandot',},
});
$(function () {
$(".plbtn").click(function () {
$(".play").show();
var video = document.getElementById("pvideo");
video.play();
});
$(".pcha").click(function () {
var video = document.getElementById("pvideo");
video.pause();
$(".play").hide();
});
});
</script>
<!-- phone e -->
<?php endif; ?>
<!-- 视频播放 s -->
<?php if ($detail['videopath'] == "") { ?><?php } else { ?>
<div class="play play1">
<a href="javascript:;" class="pcha"><img src="__PUBLIC__/web/images/images/cha1.png"></a>
<div class="moimg">
<video id="pvideo" width="100%" height="auto" controls
poster="<?php echo getImage($detail['picture']); ?>">
<source src="<?php echo $detail['videopath']; ?>">
您的浏览器不支持 video 标签。
Your browser does not support HTML5 video.
</video>
</div>
</div>
<div class="plbtn"><a href="javascript:;"><img src="__PUBLIC__/web/images/images/play.png"></a>
</div>
<?php } ?>
<!-- 视频播放 e -->
</div>
<div class="cprh">
<div class="cpcon">
<p class="ctit1"><?php echo $detail['name']; ?></p>
<p class="ctit2"><?php echo $detail['shortname']; ?></p>
<div class="position-r" style="width:96px; margin-top:0.5vw;">
<img src="__PUBLIC__/web/images/star_whhite.png">
<div class="star" style="width:<?php echo $detail['cpyanse']; ?>%;"></div>
</div>
</div>
<!-- 规格参数 s -->
<div class="proTfg">
<?php
if ($detail['product_view']) {
$detail_views = unserialize($detail['product_view']);
if ($detail_views) {
?>
<ul class="msul swt-Table">
<li class="Table-Row">
<div class="ms3 Table-Cell">型号</div>
<div class="ms2 Table-Cell"></div>
<div class="ms4 Table-Cell"><?php echo $detail['brand_id']; ?></div>
</li>
<?php foreach ($detail_views as $detail_view): ?>
<li class="Table-Row">
<div class="ms3 Table-Cell"><?php echo $detail_view['desc_title']; ?></div>
<div class="ms2 Table-Cell "></div>
<div class="ms4 Table-Cell"><?php echo $detail_view['desc_desc']; ?></div>
</li>
<?php endforeach; ?>
</ul>
<?php
}
}
?>
</div>
<!-- 规格参数 e -->
<?php if ($proimages): ?>
<div class="hd">
<ul>
<?php foreach ($proimages as $k => $imgclrs):
$b = $k;
$c = $imgclrs[0]['image_color'];
// $b = trim(strrchr($c, '/'), '/');
// $b = substr($b, 0, strpos($b, '.'));
// tiaoshi($b);
// tiaoshi($c);die;
// echo "url(__PUBLIC__/web/images' . $c . '.png)";die;
?>
<?php if ($c == '') { ?>
<?php } else { ?>
<li class="img-responsive<?php if ($b == $color): ?> on<?php endif; ?>">
<a <?php echo 'style="background: url(__PUBLIC__/web/images' . $c . '.png);" href="' . url_rewrite('productdetail', ['id' => $detail['id'], 'color' => $b]) . '"'; ?>><img
src="<?php echo $c; ?>" alt=""
style="width:10px; height: 10px; border-radius: 5px; margin:3px;"></a>
<?php } ?>
</li>
<?php endforeach; ?>
<?php if ($c == '') { ?>
<?php } else { ?>
<span>颜色</span>
<?php } ?>
</ul>
</div>
<?php endif; ?>
<div class="buy">
<?php if ($detail['url_tm']): ?>
<a href="<?php echo $detail['url_tm']; ?>" target="_blank" onclick="add_click(<?php echo $detail['id'] ?>, 1, '<?php echo $detail['url_tm']; ?>')">天猫购买</a>
<?php endif; ?>
<?php if ($detail['url_jd']): ?>
<a href="<?php echo $detail['url_jd']; ?>" target="_blank" onclick="add_click(<?php echo $detail['id'] ?>, 2, '<?php echo $detail['url_jd']; ?>')">京东购买</a>
<?php endif;?>
</div>
<a onclick="toggle_colleciton()">
<span class="house house_img01
<?php if ($detail['is_collection']): ?>
house_img02
<?php endif; ?>
"></span>
<div class="clear"></div>
</a>
</div>
</div>
<!-- 产品 e -->
<script>
$(document).ready(function(){
$("a .house").click(function(){
$(this).toggleClass("house_img02");
})
})
</script>
</div>
</div>
<div class="warp">
<div class="warpa">
<!-- 锚链接 s -->
<ul class="cpa">
<li><a href="#link1">产品描述</a></li>
<li><a href="#link2">关联产品</a></li>
<li><a href="#link3">相关下载</a></li>
<li><a href="#link4">评论</a></li>
<div class="clear"></div>
</ul>
<!-- 锚链接 e-->
</div>
<div class="swt-Container">
<!--产品详情-->
<div class="products_des"><?php echo $detail['ld_md_content']; ?></div>
</div>
<!-- 关联产品 s <?php //if ($product_relateds)print_r($product_relateds); ?>-->
<div class="warp2 proTfg">
<div class="swt-Container">
<div class="gltit" id="link2">关联产品</div>
<?php if ($product_relateds): ?>
<div class="cpBox">
<div class="owl-carousel">
<?php foreach ($product_relateds as $product):; ?>
<div class="item wow">
<?php $img = getProductReated($product['id']); ?>
<a href="<?php echo url_rewrite('productdetail', ['id' => $product['id']]); ?>">
<div class="glimg img-responsive"><img src="<?php echo $product['list_bk_img']; ?>">
<!--换成一级列表图--></div>
<div class="gltext">
<p class="gl1"><?php echo $product['name']; ?></p>
<p class="gl2"> <?php echo $product['brand_id']; ?></p>
<!-- <p class="gl2">-->
<?php //echo $product['shortname']; ?><!--</p>-->
</div>
<div class="clear"></div>
</a>
</div>
<?php endforeach; ?>
</div>
<script>
var owl = $(".cpBox .owl-carousel");
owl.owlCarousel({
autoplay: true,
navigationText: ["", ""],
responsive: {
0: {
items: 1,
margin: 0
},
420: {
items: 1,
margin: 0,
smartSpeed: 80,
dots: false
},
640: {
items: 2,
margin: 0,
smartSpeed: 80,
dots: false
},
998: {
items: 3,
margin: 0,
smartSpeed: 80,
dots: false
},
},
})
</script>
</div>
<?php endif; ?>
</div>
</div>
<!-- 相关下载 s -->
<?php if (!$product_dls) { ?>
<?php } else { ?>
<div class="nybox proTfg">
<div class="swt-Container">
<div class="sptit" id="link3">相关下载</div>
<?php
if ($product_dls):
$selectTypeArr = config("product_dltype");
$prodls = [];
foreach ($product_dls as $dlrow) {
$prodls[$dlrow['dl_type']][] = $dlrow;
}
?>
<?php foreach ($prodls as $type => $dlclrs): ?>
<div class="xz">
<p class="xztit"><?php echo isset($selectTypeArr[$type]) ? $selectTypeArr[$type] : ''; ?></p>
<?php foreach ($dlclrs as $dl): ?>
<p class="xz1"><a
href="<?php echo url('index/download/prodownload', ['id' => $dl['id']]); ?>"><i></i><?php echo $dl['dl_name']; ?>
</a></p>
<?php endforeach; ?>
</div>
<?php endforeach; ?>
<?php endif; ?>
</div>
</div>
<?php } ?>
<!-- 相关下载 e -->
<script type="text/javascript">
$(function () {
var $category = $(".ans .anbox");
$category.hide();
$(".ans .antit").click(function () {
if ($(this).next(".anbox").is(":visible")) {
$(this).removeClass('on').next().slideUp(800);
$(this).parent('.ans').removeClass('on');
$(this).children("i").removeClass("ons")
} else {
$category.hide();
$(".ans .antit").removeClass('on');
$(this).children("i").addClass("ons")
$(this).addClass('on').next().slideDown(800);
$(this).parent('.ans').addClass('on');
}
});
});
$(function () {
$('a[href*=#],area[href*=#]').click(function () {
console.log(this.pathname)
if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname) {
var $target = $(this.hash);
$target = $target.length && $target || $('[name=' + this.hash.slice(1) + ']');
if ($target.length) {
var targetOffset = $target.offset().top - 50;
$('html,body').animate({
scrollTop: targetOffset
}, 800);
return false; //页面锚点跳转动画 后面的800是锚点跳转的时间 800ms
}
}
});
})
$("input").click(function () {
$(this).siblings("div").children("span").addClass("active");
$(this).parents("div").siblings("div").find("span").removeClass("active");
});
$(function () {
$(window).scroll(function () {
var arr = []
$.each($(".proTfg"), function (k, v) {
arr[k] = $(this).offset().top + $(this).height();
})
$.each(arr, function (k, v) {
if (($(window).scrollTop() + $(".cpa li").eq(k - 1).height() + 10) < v) {
if (!$(".cpa li").eq(k).hasClass("current")) {
$(".cpa li").eq(k).attr("class", "current").siblings().removeClass();
}
return false;
}
})
})
})
</script>
</div>
<div class="enlarge-img" style="display: none;">
<div class="scrollbutton_01 smallImgUp disabled"></div>
<img src="<?php echo getImage($firstimage); ?>">
<div class="scrollbutton_01 smallImgDown"></div>
<div class="close"><span class="icon-close"></div>
</div>
<!--评论-->
<div class="" style="background-color:#f1f1f1; overflow: hidden;">
<!--详情新增样式-->
<div class="detail_title">
<p class="de_t_n" id="link4">评论</p>
<div class="position-r" style="width:96px; margin:auto;">
<img src="__PUBLIC__/web/images/star_whhite.png">
<div class="star" style="width:<?php echo $detail['cpyanse']; ?>%;"></div>
</div>
<p>{$count}条评论</p>
</div>
{volist name = 'list' id = 'user'}
<!--图片放大-->
<div class="swt-Container detail_con_a">
<div class="lj_detail_text clearfix">
<p><b class="Ts-black">{$user.auctionSku}</b></p>
</div>
<div class="lj_detail_texts clearfix">
<p>{$user.displayUserNick} {$user.rateDate}</p>
<p>{$user.rateContent}</p>
</div>
<div class="tm-m-photos">
{if condition="$user['pics'] eq null"}
{else/}
<ul class="tm-m-photos-thumb">
{volist name="user['pics']" id='vv'}
<li data-src="{$vv}"> <img src="{$vv}"> <b class="tm-photos-arrow"></b> </li>
{/volist}
</ul>
{/if}
<div class="tm-m-photo-viewer transition1">
<img src="img/a1.png">
<a class="tm-m-photo-viewer-navleft" style="cursor: default;"> <i
class="tm-m-photo-viewer-navicon arrow-right">&lt;</i> </a>
<a class="tm-m-photo-viewer-navright" data-spm-anchor-id="a220o.1000855.0.0" style="cursor: pointer;"> <i
class="tm-m-photo-viewer-navicon arrow-right">&gt;</i> </a>
</div>
<div>
</div>
</div>
</div>
<!--详情新增样式-->
{/volist}
{$page}
</div>
<div class="alert" style="display: none">
<div class="alert_white"></div>
</div>
<script>
$(function () {
var obj = new commentMove('.tm-m-photos', '.tm-m-photo-viewer');
obj.init()
})
</script>
<script>
/*图片放大效果*/
$(".bigImg").click(function () {
$(".enlarge-img").show();
});
$(".enlarge-img .close").click(function () {
$(".enlarge-img").hide();
});
</script>
<!-- bottom s -->
{include file="include/bottom" /}
<!-- bottom e -->
</body>
</html>
<script type="text/javascript">
function add_click(content_id, type, url) {
$.ajax({
url: '/index/clicksum/add_click',
data: {
content_id: content_id,
type: type,
customer_id: 0,
country_code: 'ZH',
url:url
},
type: 'post',
dataType: 'json',
success: function(res) {
}
})
}
var curr_url = '/product/detail/<?php echo $detail['id']; ?>.html';
var is_collection = <?php echo $detail['is_collection']; ?>;
var flag = 1; // 限制调用收藏接口 1可用 0不可用
function toggle_colleciton()
{
if (flag == 0)
{
return;
}
is_collection = Number(!is_collection);
flag = 0;
if (is_collection)
{
var url = '/index/collection/add_collection';
}
else
{
var url = '/index/collection/cancel_collection';
}
var coll_id = <?php echo $detail['id']; ?>;
var data = {
type: 1,
coll_id: coll_id,
curr_url: curr_url
};
$.ajax({
url: url,
type: 'post',
dataType: 'json',
data : data,
success: function(res) {
if (res.code == -1000)
{
$('.alert').show();
$('.alert_white').html('请先登录').delay(1000).fadeOut();
setTimeout(function() {
location.href = '/login.html?url=' + res.data.url;
}, 800);
}
}
});
setTimeout(function() {
flag = 1;
}, 1000);
}
</script>

View File

@@ -0,0 +1,95 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
{include file="include/head-seo" /}
{include file="include/head" /}
<script type="text/javascript" src="__PUBLIC__/web/scripts/jquery.nicescroll.js"></script>
<link rel="stylesheet" type="text/css" href="__PUBLIC__/web/scripts/bxslider/jquery.bxslider-list.css">
<script type="text/javascript" src="__PUBLIC__/web/scripts/bxslider/jquery.bxslider.min.js"></script>
<script type="text/javascript">
var navID = "1";
</script>
</head>
<body>
<!--top-->
<header class="header-PC header-Index">
<div id="header" class="theme-white">
{include file="include/top-head2023" /}
</div>
</header>
<!--top End-->
<!-- 背景灰色 内容区 s -->
<div class="indexbox-list cdbox">
<div class="swt-Container">
<?php
if (!empty($newProduct)):
foreach ($newProduct as $k1 => $pc1): ?>
<div class="daily">
<div class="datit">
<p class="da1"><?php echo $pc1['category_name']; ?></p>
<div class="clear"></div>
</div>
<?php
$products = $pc1['list'];
if ($products):
?>
<ul class="darh">
<?php foreach ($products as $product): ?>
<li>
<a href="__ORICOROOT__<?php echo url_rewrite('productdetail', ['id' => $product['id']]); ?>" target="_blank">
<div class="daimg"><img src="<?php echo getImage($product['list_bk_img']); ?>"></div>
<div class="datext">
<p class="dat1"><?php echo $product['name']; ?></p>
<p class="dat2"><?php echo $product['brand_id']; ?></p>
</div>
<?php if ($product['isnew']): ?><div class="newcp">New</div><?php endif; ?>
</a>
</li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
<div class="clear"></div>
</div>
<?php endforeach; ?>
<?php endif; ?>
</div>
</div>
<!-- 背景灰色 内容区 e -->
<script type="text/javascript">
$(function() {
$(".hd ul li").hover(
function() {
$(this).children(".bds").stop(true, true).show();
},
function() {
$(this).children(".bds").stop(true, true).hide();
}
);
});
/*轮播滚动条*/
$('.hd').niceScroll({
cursorcolor: "transparent",//#CC0071 光标颜色
cursoropacitymax: 1, //改变不透明度非常光标处于活动状态scrollabar“可见”状态范围从1到0
touchbehavior: false, //使光标拖动滚动像在台式电脑触摸设备
cursorwidth: "5px", //像素光标的宽度
cursorborder: "0", // 游标边框css定义
cursorborderradius: "5px",//以像素为光标边界半径
autohidemode: false //是否隐藏滚动条
});
</script>
<!-- bottom s -->
{include file="include/bottom2023" /}
<!-- bottom e -->
</body>
</html>

View File

@@ -0,0 +1,186 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
{include file="include/head-seo" /}
{include file="include/head" /}
<script type="text/javascript">
var navID = "1";
</script>
</head>
<body>
<!--top-->
<header class="header-PC header-Index">
<div id="header">
{include file="include/top-head2023" /}
</div>
</header>
<!--top End-->{include file="include/catbanner" /}
<div class="ejbox">
<?php
$num = 1;
if(empty($subproductCategory)){
?>
<div class="swt-Container day">
<div class="daytit"><?php echo $category['name']; ?></div>
<?php
$products = getCateColor($category['id'], 100, [], true, ['sort' => 'asc', 'id' => 'desc']);
if ($products){
?>
<dl class="ejul">
<?php foreach ($products as $product): ?>
<dd class="ej<?php echo $num; ?>">
<div class="ejimg bd">
<ul>
<?php foreach ($product['product_two_img'] as $v){ ?>
<li>
<a href="<?php echo url_rewrite('productdetail', ['id' => $v['product_id']]); ?>" target="_blank">
<img src="<?php echo getImage($v['image_url']); ?>">
</a>
</li>
<?php }?>
</ul>
</div>
<div class="ejtext">
<div class="text1">
<p><a href="<?php echo url_rewrite('productdetail', ['id' => $product['id']]); ?>" target="_blank"><?php echo $product['name']; ?></a></p>
<p><a href="<?php echo url_rewrite('productdetail', ['id' => $product['id']]); ?>" target="_blank"><?php echo $product['brand_id']; ?></a></p>
</div>
<div class="hd">
<ul>
<?php foreach ($product['product_two_img'] as $imglist){?>
<?php
if(!$imglist['image_color']==''){
if(strlen($imglist['image_color']) == 2){
$colorImg = '/uploads/product/'.trim($imglist['image_color']).'.jpg';
}else{
$colorImg = $imglist['image_color'];
}
// echo $colorImg.'==========='; die;
?>
<li class=" S-small-img">
<div class="cricle">
<img src="<?php echo $colorImg; ?>" alt="" class="S-Cricle-Bg">
</div>
</li>
<?php }};?>
</ul>
</div>
<script type="text/javascript">
jQuery(".ej<?php echo $num; ?>").slide({mainCell: ".bd ul", trigger: "click"});
</script>
<div class="clear"></div>
</div>
</dd>
<?php
$num++;
endforeach;
?>
<div class="clear"></div>
</dl>
<?php } ?>
</div>
<?php
}else{
?>
<?php foreach ($subproductCategory as $spc) { ?>
<div class="swt-Container day">
<div class="daytit"><?php echo $spc['name']; ?></div>
<?php
$products = getCateColor($spc['id'], 100, [], true, ['sort' => 'asc', 'id' => 'desc']);
if ($products):
?>
<dl class="ejul">
<?php foreach ($products as $product): ?>
<dd class="ej<?php echo $num; ?>">
<div class="ejimg bd">
<ul>
<?php foreach ($product['product_two_img'] as $v){ ?>
<li>
<a href="<?php echo url_rewrite('productdetail', ['id' => $v['product_id']]); ?>" target="_blank">
<img src="<?php echo getImage($v['image_url']); ?>">
</a>
</li>
<?php }?>
</ul>
</div>
<div class="ejtext">
<div class="text1">
<p><a href="<?php echo url_rewrite('productdetail', ['id' => $product['id']]); ?>" target="_blank"><?php echo $product['name']; ?></a></p>
<p><a href="<?php echo url_rewrite('productdetail', ['id' => $product['id']]); ?>" target="_blank"><?php echo $product['brand_id']; ?></a></p>
</div>
<div class="hd">
<ul>
<?php foreach ($product['product_two_img'] as $imglist){?>
<?php
if(!$imglist['image_color']==''){
if(strlen($imglist['image_color']) == 2){
$colorImg = '/uploads/product/'.trim($imglist['image_color']).'.jpg';
}else{
$colorImg = $imglist['image_color'];
}
?>
<li class=" S-small-img">
<div class="cricle">
<img src="<?php echo $colorImg; ?>" alt="" class="S-Cricle-Bg">
</div>
</li>
<?php }};?>
</ul>
</div>
<script type="text/javascript">
jQuery(".ej<?php echo $num; ?>").slide({mainCell: ".bd ul", trigger: "click"});
</script>
<div class="clear"></div>
</div>
</dd>
<?php
$num++;
endforeach;
?>
<div class="clear"></div>
</dl>
<?php endif; ?>
</div>
<?php } ?>
</div>
<?php } ?>
<script>
$(function () {
$(".ejmore").click(function(){
$(this).siblings(".ejul-show").show();
$(this).hide();
})
});
</script>
<!-- bottom s -->
{include file="include/bottom2023" /}
<!-- bottom e -->
</body>
<style>
.ejbox {
width: 100%;
padding: 50px 0 0 0px !important;
background: #f9f9f9;
}
</style>
</html>

View File

@@ -0,0 +1,269 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
{include file="include/head-seo" /}
{include file="include/head" /}
<script type="text/javascript">
var navID = "1";
</script>
</head>
<body>
<!--top-->
<header class="header-PC header-Index">
<div id="header">
{include file="include/top" /}
{include file="include/top-header" /}
</div>
</header>
<!--top End-->{include file="include/catbanner" /}
<div class="ejbox">
<?php
$num = 1;
if(empty($subproductCategory)){
$hotproducts = getCategoryProduct($pid, 5);
?>
<div class="swt-Container day">
<div class="daytit"><?php echo $category['name']; ?></div>
<?php
$products = getCateColor($category['id'], 4, [], true, ['id' => 'desc', 'sort']);
if ($products){
?>
<dl class="ejul">
<?php foreach ($products as $product): ?>
<dd class="ej<?php echo $num; ?>">
<div class="ejimg bd">
<ul>
<?php foreach ($product['product_two_img'] as $v){ ?>
<li>
<a href="<?php echo url_rewrite('productdetail', ['id' => $v['product_id']]); ?>" target="_blank">
<img src="<?php echo getImage($v['image_url']); ?>">
</a>
</li>
<?php }?>
</ul>
</div>
<div class="ejtext">
<div class="text1">
<p><a href="<?php echo url_rewrite('productdetail', ['id' => $product['id']]); ?>" target="_blank"><?php echo $product['name']; ?></a></p>
<p><a href="<?php echo url_rewrite('productdetail', ['id' => $product['id']]); ?>" target="_blank"><?php echo $product['brand_id']; ?></a></p>
</div>
<div class="hd">
<ul>
<?php foreach ($product['product_two_img'] as $imglist){?>
<?php if($imglist['image_color']==''){ }else{?>
<li class="img-responsive S-small-img">
<div class="cricle">
<img src="<?php echo $imglist['image_color']; ?>" alt="" class="S-Cricle-Bg">
</div>
</li>
<?php }};?>
</ul>
</div>
<script type="text/javascript">
jQuery(".ej<?php echo $num; ?>").slide({mainCell: ".bd ul", trigger: "click"});
</script>
<div class="clear"></div>
</div>
</dd>
<?php
$num++;
endforeach;
?>
<div class="clear"></div>
</dl>
<dl class="ejul ejul-show">
<?php
$products = getCateColor($category['id'], ('4, 100'), [], true, ['id' => 'desc', 'sort']);
?>
<?php foreach ($products as $product): ?>
<dd class="ej<?php echo $num; ?>">
<div class="ejimg bd">
<ul>
<?php foreach ($product['product_two_img'] as $v){ ?>
<li>
<a href="<?php echo url_rewrite('productdetail', ['id' => $v['product_id']]); ?>" target="_blank">
<img src="<?php echo getImage($v['image_url']); ?>">
</a>
</li>
<?php }?>
</ul>
</div>
<div class="ejtext">
<div class="text1">
<p><a href="<?php echo url_rewrite('productdetail', ['id' => $product['id']]); ?>" target="_blank"><?php echo $product['name']; ?></a></p>
<p><a href="<?php echo url_rewrite('productdetail', ['id' => $product['id']]); ?>" target="_blank"><?php echo $product['brand_id']; ?></a></p>
</div>
<div class="hd">
<ul>
<?php foreach ($product['product_two_img'] as $imglist){?>
<?php if($imglist['image_color']==''){ }else{?>
<li class="img-responsive S-small-img">
<div class="cricle">
<img src="<?php echo $imglist['image_color']; ?>" alt="" class="S-Cricle-Bg">
</div>
</li>
<?php }};?>
</ul>
</div>
<script type="text/javascript">
jQuery(".ej<?php echo $num; ?>").slide({mainCell: ".bd ul", trigger: "click"});
</script>
<div class="clear"></div>
</div>
</dd>
<?php
$num++;
endforeach;
?>
<div class="clear"></div>
</dl>
<?php $products = getCateColor($category['id'], null, [], true); if(count($products)<=4){?>
<?php }else{?>
<div class="ejmore">点击展开</div>
<?php }?>
<?php } ?>
</div>
<?php
}else{
$hotproducts = getSonCategoryProduct($subproductCategory[0]['pid'], 5);
?>
<?php foreach ($subproductCategory as $spc) { ?>
<div class="swt-Container day">
<div class="daytit"><?php echo $spc['name']; ?></div>
<?php
$products = getCateColor($spc['id'], 4, [], true, ['id' => 'desc']);
if ($products):
?>
<dl class="ejul">
<?php foreach ($products as $product): ?>
<dd class="ej<?php echo $num; ?>">
<div class="ejimg bd">
<ul>
<?php foreach ($product['product_two_img'] as $v){ ?>
<li>
<a href="<?php echo url_rewrite('productdetail', ['id' => $v['product_id']]); ?>" target="_blank">
<img src="<?php echo getImage($v['image_url']); ?>">
</a>
</li>
<?php }?>
</ul>
</div>
<div class="ejtext">
<div class="text1">
<p><a href="<?php echo url_rewrite('productdetail', ['id' => $product['id']]); ?>" target="_blank"><?php echo $product['name']; ?></a></p>
<p><a href="<?php echo url_rewrite('productdetail', ['id' => $product['id']]); ?>" target="_blank"><?php echo $product['brand_id']; ?></a></p>
</div>
<div class="hd">
<ul>
<?php foreach ($product['product_two_img'] as $imglist){?>
<?php if($imglist['image_color']==''){ }else{?>
<li class="img-responsive S-small-img">
<div class="cricle">
<img src="<?php echo $imglist['image_color']; ?>" alt="" class="S-Cricle-Bg">
</div>
</li>
<?php }};?>
</ul>
</div>
<script type="text/javascript">
jQuery(".ej<?php echo $num; ?>").slide({mainCell: ".bd ul", trigger: "click"});
</script>
<div class="clear"></div>
</div>
</dd>
<?php
$num++;
endforeach;
?>
<div class="clear"></div>
</dl>
<dl class="ejul ejul-show">
<?php $products = getCateColor($spc['id'], ('4,100'), [], true, ['id' => 'desc']); ?>
<?php foreach ($products as $product): ?>
<dd class="ej<?php echo $num; ?>">
<div class="ejimg bd">
<ul>
<?php foreach ($product['product_two_img'] as $v){ ?>
<li>
<a href="<?php echo url_rewrite('productdetail', ['id' => $v['product_id']]); ?>" target="_blank">
<img src="<?php echo getImage($v['image_url']); ?>">
</a>
</li>
<?php }?>
</ul>
</div>
<div class="ejtext">
<div class="text1">
<p><a href="<?php echo url_rewrite('productdetail', ['id' => $product['id']]); ?>" target="_blank"><?php echo $product['name']; ?></a></p>
<p><a href="<?php echo url_rewrite('productdetail', ['id' => $product['id']]); ?>" target="_blank"><?php echo $product['brand_id']; ?></a></p>
</div>
<div class="hd">
<ul>
<?php foreach ($product['product_two_img'] as $imglist){?>
<?php if($imglist['image_color']==''){ }else{?>
<li class="img-responsive S-small-img">
<div class="cricle">
<img src="<?php echo $imglist['image_color']; ?>" alt="" class="S-Cricle-Bg">
</div>
</li>
<?php }};?>
</ul>
</div>
<script type="text/javascript">
jQuery(".ej<?php echo $num; ?>").slide({mainCell: ".bd ul", trigger: "click"});
</script>
<div class="clear"></div>
</div>
</dd>
<?php
$num++;
endforeach;
?>
<div class="clear"></div>
</dl>
<?php $products = getCateColor($spc['id'], null, [], true); if(count($products)<=4){?>
<?php }else{?>
<div class="ejmore">点击展开</div>
<?php }?>
<?php endif; ?>
</div>
<?php } ?>
</div>
<?php } ?>
<script>
$(function () {
$(".ejmore").click(function(){
$(this).siblings(".ejul-show").show();
$(this).hide();
})
});
</script>
<!-- bottom s -->
{include file="include/bottom" /}
<!-- bottom e -->
</body>
</html>