<{uqcms m="goods" c="get_one:smarty.get.id" v="row"}>   
<{uqcms m="shop" v="sprow" c="get_one:"|cat:$row.shop_id}>
<{import file="common.html" title=$row.title}>
<link rel="stylesheet" type="text/css" href="<{$__PUBLIC__}>plug/swiper/swiper.min.css">
<link rel="stylesheet" type="text/css" href="<{$__APP__}>public/css/detail.css?t=<{$smarty.now}>"> 
<link rel="stylesheet" type="text/css" href="<{$__APP__}>public/css/goods_sku.css?t=<{$smarty.now}>"> 
<div class="cnav">
	<div class="left"><a href="javascript:history.go(-1);">&nbsp;</a></div>
	<div class="center">
		<div class="center_c" id="top_menu">
			<a href="javascript:;" class="goods_info ch" data-ch="info"><span>商品</span></a>
			<a href="javascript:;" class="goods_detail" data-ch="detail"><span>详情</span></a>
			<a href="javascript:;" class="goods_comment" data-ch="comment"><span>评价</span></a>
		</div>
	</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: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}>" width="100%"/></a></div>
				<{/foreach}>
				</div>
				<div class="swiper-pagination"></div> 
			</div>
		</div> 
		<!--各种价格-->
		<{if $row.sk_status == '1' || $row.sk_status == '2'}>
			<div class="stock_box">
				<div class="stock_price">
					<em>秒杀</em>
					<i>¥ </i>
					<span class="html_act_price"><{$row.price}></span>
					<s>¥<{$row.market_price}></s>
				</div>
				<{if $row.sk_status == '1'}>
					<div class="djs"><i>还剩</i><div class="djs_box" data-diff="<{$row.etime_cha}>"></div></div>
				<{elseif $row.sk_status == '2'}>
					<div class="djs"><i>距离开始还有</i><div class="djs_box" data-diff="<{$row.stime_cha}>"></div></div>
				<{/if}>
			</div> 
		<{else}> 
			<{if $row.promote_type == '2'}>
				<div class="stock_box">
					<div class="stock_price">
						<em><{$row.p_number}>人团</em>
						<i>¥ </i>
						<span class="html_act_price"><{$row.group_price}></span>
						<s>¥<{$row.price}></s>
					</div> 
					<div class="djs"><i>还剩</i><div class="djs_box" data-diff="<{$row.time_cha}>"></div></div> 
				</div> 	
			<{else}>
				<div class="pr">
					<div class="mprice">
						<i>¥ </i>
						<span><{$row.price}></span>
						<s>¥ <{$row.market_price}></s>
					</div> 
					<div class="express">月销 <{$row.volume}> &nbsp;&nbsp; 评价 <{$row.comment}></div>
				</div> 
			<{/if}>
		<{/if}>
		<div class="ttl"><span><{$row.title}></span></div>
		<{if $row.intro}>
			<div class="desc"><p><{$row.intro}></p></div> 
		<{/if}>
	</div>
	
	<!--规格选择-->
	<div class="sku_ck">
		<span>选择</span>
		<span class="sku_ck_value"></span>
	</div>
	<{if $row.promote_type == '2'}> <!----多人拼团未成功的----->
		<{uqcms m="goods_act" v="guser" c="group_goods:id=smarty.get.id&limit=2"}> 
		<{if $guser}>
			<div class="group_user">
				<div class="name"><span>正在拼团</span></div>
				<div class="con"> 
					<{foreach item=i from=$guser}>
						<div class="ugs">
							<div class="avatar">
								<{if $i.avatar != ''}>
									<img src="<{$__IMG__}><{$i.avatar|img_size:50x50}>">
								<{else}>
									<img src="<{$__PUBLIC__}>images/avatar.png"/>
								<{/if}>
								<span><{$i.nick}> 的团</span>
							</div>
							<div class="buy"><a href="?m=goods&a=share_goods&share_id=<{$i.id}>">去参团</a></div>
						</div>
					<{/foreach}> 
				</div>
			</div>
		<{/if}>	
	<{/if}>
	<!--店铺信息--> 
	<div class="sp_info">
		<div class="sp_info_con"> 
			<div class="sp_db">
				<div class="splogo"><img src="<{$__IMG__}><{$sprow.logo|img_size:80x80}>"/></div>
				<div class="spname">
					<div class="nam"><{$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 class="spgo"><a href="wap.php?m=shop&id=<{$sprow.id}>">进店逛逛</a> </div>
			</div>
		</div>
	</div> 
	
	<!--店铺相关-->
	<div class="info_relate">
		<div class="name"><span>店铺相关</span></div>
		<div class="con">
		<{uqcms m="goods" v="hot" c="goods_hot:gid=smarty.get.id&limit=6"}>	
		<{if $hot}>
			<{foreach item=h from=$hot}> 		
				<dl>
					<dt><a href="wap.php?m=goods&a=detail&id=<{$h.id}>"><img data-original="<{$__IMG__}><{$h.images|img_size:160x160}>" class="lazy"></a></dt> 
					<dd><a class="ttl" href="wap.php?m=goods&a=detail&id=<{$h.id}>"><{$h.title}></a></dd>
					<dd><span class="pr">¥ <{$h.price}></span></dd>
				</dl>
			<{/foreach}>
		<{else}>
			<div class="nocon">暂无关联</div>	
		<{/if}>	 
		</div>
	</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}></div>	 
	<div class="detail_con detail_attr" style="display:none;">
		<{uqcms m="goods" v="attr_list" c="get_attr_list: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="news" c="get_one:alias=server_info" v="news_row"}>
		<{if $news_row.content}>
			<{$news_row.content}>
		<{/if}> 
	</div>
</div>

<!--评论部分-->
<div class="container" id="goods_comment" style="display:none;">
	<{import file="goods/comment.html"}>
</div>

<!-- 产品规格 -->
<div class="buyContainer">
	<div class="sku_show">
		<div class="img"><img src="<{$__IMG__}><{$row.images|img_size:160x160}>"/></div>
		<div class="info"> 
			<div class="pr"><em>¥ </em><span class="value_price"><{$row.price}></span></div> 
			<div class="stock_num"><em>库存：</em><span><{$row.stock}></span></div>
			<div class="ck_val"></div>
			<div class="skuClose">×</div>
		</div>
	</div>
		
	<div class="buyContainerCenter">
		<{uqcms m="goods_sku" v="sku" c="get_list:smarty.get.id"}>
		<{if $sku.list}>
			<div class="sku"> 
				<{foreach item=i from=$sku.list}>			
				<dl>
					<dt><span class="sku_name_key" data-value="<{$i.name}>"><{$i.name}></span></dt>
					<dd> 
						<{foreach item=v from=$i.detail}>									
							<a data-id="<{$v.id}>" title="<{if $v.img_name}><{$v.img_name}><{else}><{$v.name}><{/if}>" href="javascript:;">
								<{if $v.img_url}><img src="<{$__IMG__}><{$v.img_url|img_size:60x60}>" data-img="<{$__IMG__}><{$v.img_url|img_size:160x160}>" width="35"/><{/if}>
								<em><{if $v.img_name}><{$v.img_name}><{else}><{$v.name}><{/if}></em>
							</a>
						<{/foreach}>   
					</dd> 
				</dl>
				<{/foreach}>
			</div>
			<input type="hidden" autocomplete="off" id="sku_id" data-sku="1" value=""> 
		<{else}>
			<input type="hidden" autocomplete="off" id="sku_id" data-sku="0" value="<{$sku.id}>">
		<{/if}>
		
		<div class="buynum">
			<dl>
				<dt><span>数量</span></dt>
				<dd>
					<div class="Gnum"> 
						<span class="lt"><a href="javascript:;" id="minus_button">-</a></span> 
						<input type="text" value="1" id="buy_num" autocomplete="off"/>
						<span class="rt"><a href="javascript:;" id="plus_button" max-num="<{$row.stock}>" >+</a></span>
					</div>
				</dd>
			</dl>
		</div>
	</div>
	<div class="add_sure">
		<a href="javascript:;" class="sure_button" data-type="">确定</a> 
	</div> 
	<{if $row.promote_type == '2'}>
		<div class="add_chose sku_pt">
			<a href="javascript:;" class="buy_add" data-type="1">单独购买 ￥<{$row.price}> </a> 
			<a href="javascript:;" class="buy_add" data-type="2">发起拼单 ￥<{$row.group_price}></a> 
		</div> 
	<{else}>
		<div class="add_chose">
			<a href="javascript:;" class="nowbuy buy_add" data-type="0">加入购物车</a> 
			<a href="javascript:;" class="nowbuy buy_add" data-type="1">立即购买</a> 
		</div> 
	<{/if}>
</div>
<div class="buyContainerBg"></div> 
<!--加入到购物车的操作--> 
<div class="Gcart">
	<div class="btmbuy">
		<a href="mqqwpa://im/chat?chat_type=wpa&uin=<{$sprow.qq}>&version=1&src_type=web&web_src=site.com">
			<i class="home"></i><span>客服</span>
		</a>
	</div>
	<div class="btmbuy">
		<a href="javascript:;" class="collect_goods" data-gid="<{$row.id}>" data-status="<{$row.collect_status}>">
			<i class="<{if $row.collect_status == '0'}>love<{else}>love2<{/if}>"></i><span>关注</span>
		</a>
	</div>
	<input type="hidden" id="goods_id" value="<{$row.id}>"/>
	<input type="hidden" id="shop_id" value="<{$row.shop_id}>"/> 
	<input type="hidden" id="share_id" value="<{$smarty.get.share_id}>"/>
	<{if $row.promote_type == '2'}>
		<!--拼团直接购买-->
		<div class="buy_grp"> 
			<a href="javascript:;" class="<{if $row.stock == '0'}>buy_no<{else}>buy_add<{/if}> nowbuy onebuy" data-type="1">
				<i>￥<{$row.price}></i>
				<em>单独购买</em>
			</a>
			<a href="javascript:;" class="<{if $row.stock == '0'}>buy_no<{else}>buy_add<{/if}> nowbuy groupbuy" data-type="2">
				<i>￥<{$row.group_price}></i>
				<em>发起拼单</em>
			</a>
		</div>
	<{else}>
		<!--购物车购买-->
		<div class="btmbuy">
			<a href="wap.php?m=cart&a=index"> <i class="cart"></i><span>购物车<em class="cart_num" id="cart_num">0</em></span></a>
		</div> 
		<div class="buy_cart"> 
			<a href="javascript:;" class="<{if $row.stock == '0'}>buy_no<{else}>buy_add<{/if}> addcart" data-type="0">加入购物车</a> 
			<a href="javascript:;" class="<{if $row.stock == '0'}>buy_no<{else}>buy_add<{/if}> nowbuy" data-type="1">立即购买</a> 
		</div>
	<{/if}>
	
</div> 
<{import file="footer.html"}>
<script>
var PUBLIC_PATH	= '<{$__PUBLIC__}>';
var APP_PATH	= '<{$__APP__}>';
var IMG_HOST 	= '<{$__IMG__}>';
<{if $sku.json}>
var SKU_DATA 	= <{$sku.json}>; 
<{/if}>
</script>
<script src="<{$__PUBLIC__}>js/jquery.infinitescroll.js"></script> 
<script src="<{$__PUBLIC__}>js/jquery.lazyload.js"></script> 
<script src="<{$__PUBLIC__}>plug/swiper/swiper.min.js"></script> 
<script src="<{$__APP__}>public/js/cart.js?t=<{$smarty.now}>"></script>
<script> 
lazyload();
countDown('.djs_box');
$(function(){
	$(".swiper-slide").css('height',$('.swiper-slide').width()); 
	$(".info_relate .con dt").css('height', $('.info_relate .con dt').width()); 
	<{if $comment.list}> 
		$("#goods_comment .comment").infinitescroll({  
			navSelector: "#more",     	//页面分页元素--成功后自动隐藏  
			nextSelector: "#more a",  
			itemSelector: ".one_con",
			state: { 
				currPage: $("#curr_page").val() 
			},
			pathParse:[$("#path_parse").val(),''], 
			loading: {   
				msgText: "加载中...",   
				finishedMsg: '没有新数据了...'
			},errorCallback:function(e){ 
				//alert(e); 
			}
		});
	<{/if}>
	// 关注
	$("a.collect_goods").click(function(){
		var $this = $(this);
		gid = $this.attr('data-gid'); 
		$.post('index.php?m=ajax&a=collect_goods', {gid:gid}, function(result){ 
			var data = jQuery.parseJSON(result); 
			if(data.error == '0'){
				if(data.status == '2'){ 
					location.href="wap.php?m=member&a=login&returnUrl=<{$UQCMS.request_url}>";
				}else if(data.status == '1'){
					$this.children('i').removeClass('love').addClass('love2');
				}else if(data.status == '0'){
					$this.children('i').removeClass('love2').addClass('love'); 
				}
			}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> 
