<{uqcms m="goods" c="get_one:id=smarty.get.id" v="row"}> 
<{uqcms m="shop" v="sprow" c="get_one:id="|cat:$row.shop_id}>
<{import 
	file="common.html"
	title=$row.title 
	css="detail,goods_sku,comment"
}>
<link rel="stylesheet" type="text/css" href="<{$__PUBLIC__}>plug/swiper/swiper.min.css"> 
<div class="cnav">
	<div class="left"><a href="javascript:history.go(-1);">&nbsp;</a></div> 
	<div class="right"><a href="javascript:;" class="thome">&nbsp;</a></div>
</div>
<div class="container" id="goods_info">
	<div class="topIntro">
		<!--主图-->
		<div class="mainImg">
			<{uqcms m="goods" v="simg" c="goods_simg:id=smarty.get.id"}> 
			<div class="swiper-container">
				<div class="swiper-wrapper">
					<{foreach item=s from=$simg}>
						<div class="swiper-slide">
							<a href="javascript:;"><img src="<{$__IMG__}><{$s.url|img_size:640x640}>" /></a>
						</div>
					<{/foreach}>
				</div>
				<div class="swiper-pagination"></div> 
			</div>
		</div>
		
		<!--各类价格-->
		<{if $row.sk_status == '1' || $row.sk_status == '2'}>
			<div class="actpr uq_bgcolor">
				<div class="apr"> 
					<i>¥ </i>
					<span class="html_act_price"><{$row.price}></span>
					<s>¥<{$row.market_price}></s>
				</div>
				<{if $row.sk_status == '1'}>
					<div class="djs_con">
						<div class="name"><span>距离结束还剩</span></div>
						<div class="djs"><div class="djs_box" data-diff="<{$row.etime_cha}>"></div></div> 
					</div>	
				<{elseif $row.sk_status == '2'}>
					<div class="djs"><em>距离开始</em><div class="djs_box" data-diff="<{$row.stime_cha}>"></div></div>
				<{/if}>
			</div> 
		<{else}> 
			<div class="pr">
				<div class="mprice">
					<i class="uq_color">¥ </i>
					<span class="uq_color"><{$row.price}></span>
					<s>¥ <{$row.market_price}></s>
				</div> 
				<div class="express">销量 <{$row.volume}></div>
			</div> 
		<{/if}> 
		
		<div class="ttl"> 
			<span><{$row.title}></span>
		</div>
		<{if $row.intro}>
			<div class="desc uq_color2"><{$row.intro}></div> 
		<{/if}>
	</div>
	
	<!--商品评价-->
	<div class="cmtbox">
		<div class="name"><span>商品评价（<{$row.comment}>）</span><a href="<{$__WAP__}>goods/comment?id=<{$smarty.get.id}>">查看全部</a></div>
		<div class="con">
		<{uqcms m="goods" v="comment" c="comment:gid=smarty.get.id&page=1&page_size=2&ccid=smarty.get.ccid"}>
		<{if $comment.list}> 
			<{foreach item=i from=$comment.list}>
				<div class="cmtconbox">
					<div class="uname">
						<div class="avatar"><img src="<{if $i.avatar}><{$__IMG__}><{$i.avatar|img_size:80x80}><{else}><{$__PUBLIC__}>images/avatar.png<{/if}>"><span><{$i.nick}></span></div>
						<div class="tm"><{$i.addtime}></div>
					</div>
					<div class="umsg">	
						<p><{$i.content}></p>
						<{if $i.sku_value}>
							<p class="p2">
								<{foreach item=ii from=$i.sku_value}>
									<{$ii.0}>: <{$ii.1}> &nbsp;&nbsp;
								<{/foreach}>
							</p>
						<{/if}>
					</div>
				</div>
			<{/foreach}>
		<{else}>
			<div class="nocmt">还没有评论呢！</div>
		<{/if}>
		</div>
	</div>
	
	<!--店铺信息--> 
	<div class="sp_box">
		<div class="info">
			<div class="con">
				<div class="splogo"><img src="<{$__IMG__}><{$sprow.logo|img_size:80x80}>"/></div>
				<div class="spname">
					<div class="name"><{$sprow.name}></div>
					<div class="score"> 
						<span>产品 <i><{$sprow.score.goods}></i></span>
						<span>服务 <i><{$sprow.score.service}></i></span>
						<span>物流 <i><{$sprow.score.logistics}></i></span> 
					</div>
				</div>
			</div>	
			<div class="sp_go"><a href="<{$__WAP__}>shop/<{$sprow.id}>">进店逛逛</a></div>
		</div> 
		<div class="gs">
			<{uqcms m="goods" v="hot" c="goods_hot:gid=smarty.get.id&limit=3"}>	
			<{if $hot}>
				<{foreach item=i from=$hot}> 		
					<dl>
						<dt><a href="<{$__WAP__}>goods/<{$i.id}><{$__HTML__}>"><img data-original="<{$__IMG__}><{$i.images|img_size:160x160}>" class="lazy"></a></dt>
						<dd><a class="ttl" href="<{$__WAP__}>goods/<{$i.id}><{$__HTML__}>"><{$i.title}></a></dd>
						<dd><span class="pr">¥ <{$i.price}></span></dd>
					</dl>
				<{/foreach}>
			<{else}>
				<div class="nocon">暂无关联</div>	
			<{/if}> 
		</div>
	</div>
	
	<!--产品详情-->
	<div class="gsdetail">
		<{$row.content|htmlspecialchars_decode}> 
	</div>
</div>

<div class="container" id="goods_detail" style="display:none;">
	<div class="detail_menu">
		<a href="javascript:;" class="select">商品介绍</a>
		<a href="javascript:;">规格参数</a>
		<a href="javascript:;">售后保障</a>
	</div>
	<div class="detail_con"><{$row.content|htmlspecialchars_decode}></div>	 
	<div class="detail_con detail_attr" style="display:none;">
		<{uqcms m="goods" v="attr_list" c="get_attr_list:id=smarty.get.id"}>	
		<{foreach item=attr from=$attr_list}>
			<dl>
				<dt><{$attr.name}> ：</dt>
				<dd><{$attr.value}></dd>
			</dl>
		<{/foreach}>
	</div>
	<div class="detail_con server_info" style="display:none;">
		<{uqcms m="help" c="get_one:alias=server_info" v="news_row"}>
		<{if $news_row.content}>
			<{$news_row.content}>
		<{/if}> 
	</div>
</div>
<{import file="goods/buy_sku.html"}> 
<{import file="footer.html"}> 
<script src="<{$__PUBLIC__}>plug/jquery.infinitescroll.js"></script> 
<script src="<{$__PUBLIC__}>plug/swiper/swiper.min.js"></script>
<script src="<{$__APP__}>public/js/cart.js?v=<{$js_version}>"></script>  
<{if $UQCMS.browser == 'wchat'}>
	<{uqcms m="wchat" v="js_row" c="js_config"}>
	<{if $js_row.appid}><{/if}> 
	<script type="text/javascript" charset="UTF-8" src="http://res.wx.qq.com/open/js/jweixin-1.4.0.js"></script> 
	<script type="text/javascript">
	function wxInit(){
		wx.config({
			//debug:true,
			appId:"<{$js_row.appid}>",
			timestamp:"<{$js_row.timestamp}>",
			nonceStr:"<{$js_row.noncestr}>",
			signature:"<{$js_row.signature}>",
			jsApiList:[ 
				"updateAppMessageShareData", 
				"updateTimelineShareData",
				"onMenuShareTimeline",
				"onMenuShareAppMessage"
			]
		}); 
	}
	wxInit();
	wx.ready(function () {   //需在用户可能点击分享按钮前就先调用 
		wx.updateAppMessageShareData({ 
			title: "<{$row.title}>", 
			desc: "<{$row.intro}>", 
			link: "<{$__URI__}>goods/<{$row.id}><{$__HTML__}>", // 分享链接，该链接域名或路径须与当前页面对应必的公众号JS安全域名一致
			imgUrl: "<{$__IMG__}><{$row.images|img_size:100x100}>", 
			success: function (res) { 
			  // 设置成功 
			}
		});
	}); 
	wx.ready(function () { 
		wx.updateTimelineShareData({ 
			title: "<{$row.title}>", // 分享标题
			link: "<{$UQCMS.site_url}>goods/<{$row.id}><{$__HTML__}>", // 分享链接，该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
			imgUrl: "<{$__IMG__}><{$row.images|img_size:100x100}>", 
			success: function (res) { 
			  // 设置成功 
			}
		});
	});  
	</script>
<{/if}>
<script type="text/javascript"> 
<{if $UQCMS.sys_type == '1'}>
$(function(){
	$(document).on('click', '.shareimgopen a', function(){
		$(".shareimg,.shareimgbg").show();
		img_data = $("img.share_img").attr('data-src'); 
		$("img.share_img").attr('src', img_data);
		 $(document.body).css({"overflow-x":"hidden","overflow-y":"hidden"});
	});
	$(document).on('click', '.shareimgcancel a', function(){
		$(".shareimg,.shareimgbg").hide(); 
		$(document.body).css({"overflow-x":"auto", "overflow-y":"auto"});
	});
});
<{/if}>

lazyload(); 
countDown('.djs_box'); 
$(function(){
	$(".swiper-slide").css('height',$('.swiper-slide').width()); 
	$(".info_relate .con dt").css('height', $('.info_relate .con dt').width());
	cart_total_num();		// 计算数量
	// 关注
	$("a.collect_goods").click(function(){
		var $this = $(this);
		gid = $this.attr('data-gid'); 
		$.post(URI+'ajax/collect_goods', {gid:gid}, function(result){ 
			var data = jQuery.parseJSON(result); 
			if(data.error == '0'){
				if(data.status == '1'){
					$this.children('i').removeClass('love').addClass('love2');
				}else if(data.status == '0'){
					$this.children('i').removeClass('love2').addClass('love'); 
				}
			}else if(data.error == '4'){
				location.href="<{$__WAP__}>member/login?returnUrl=<{$UQCMS.request_url}>";
			}else{
				$.alert(data.msg);
			}
		});
	});
	
	$("#top_menu a").click(function(){
		var $this = $(this);
		var target = $this.attr('data-ch');
		if(target == 'info'){
			$("#goods_info").show(); 
			$("#goods_detail").hide(); 
			$("#goods_comment").hide();
		}else if(target == 'detail'){
			$("#goods_info").hide(); 
			$("#goods_detail").show(); 
			$("#goods_comment").hide();
		}else if(target == 'comment'){
			$("#goods_info").hide(); 
			$("#goods_detail").hide(); 
			$("#goods_comment").show();
		}
		$this.addClass('ch').siblings().removeClass('ch');
		window.scrollTo(0,0);  
	});
	
	$(".show_goods_detail").click(function(){
		$("#goods_info").hide();
		$("#goods_detail").show();
		$("#goods_comment").hide();
		$(".goods_detail").addClass('ch').siblings().removeClass('ch');
		window.scrollTo(0,0);
	});
	
	$(".detail_menu a").click(function(){
		$(this).addClass("select").siblings('a').removeClass("select");  
		var $index=$(this).index(); 
      	$(".detail_con").eq($index).show().siblings('.detail_con').hide();  
	}); 
	
 	new Swiper('.swiper-container',{
		pagination: '.swiper-pagination', 
		paginationClickable: true,
		autoplayDisableOnInteraction: false,
		autoplay: 2500,
		loop: true
	}); 
	$(".conBox .name a").click(function(){
		$(this).addClass("ch").siblings().removeClass("ch"); 
		var index = $(this).index(); 
		$(".conBox .content").eq(index).show().siblings().hide(); 
	}); 
});
</script>