534 lines
22 KiB
PHTML
Executable File
534 lines
22 KiB
PHTML
Executable File
<!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"><</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">></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>
|