<{uqcms m="goods" c="getOne:smarty.get.gid" v="row"}>  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="<{$__PUBLIC__}>css/common_uqcms.css"> 
<link rel="stylesheet" type="text/css" href="<{$__APP__}>css/public.css"> 
<link rel="stylesheet" type="text/css" href="<{$__APP__}>css/consult.css"> 
<script type="text/javascript" src="<{$__PUBLIC__}>js/jquery.min.js"></script>
<script type="text/javascript" src="<{$__PUBLIC__}>js/cart.js"></script>
<script type="text/javascript" src="<{$__PUBLIC__}>js/jquery.fly.min.js"></script> 
<script type="text/javascript" src="<{$__PUBLIC__}>raty/jquery.raty.js"></script> 
<link href="<{$__PUBLIC__}>raty/jquery.raty.css" rel="stylesheet" type="text/css"> 
<title><{$row.title}></title> 
</head>
<body>
<{include file="default/header.html"}>
<div class="main_bar">
	<div class="main">
	 	<div class="left"> 
			<div class="goodsBox">
				<div class="name"><span>商品信息</span></div>
				<div class="simg"><a href="index.php?m=goods&a=detail&id=<{$smarty.get.gid}>"><img src="<{$row.images}>" ></a></div>
				<div class="gdesc ttl"><a href="index.php?m=goods&a=detail&id=<{$smarty.get.gid}>"><{$row.title}></a> </div>
				<div class="gdesc pr"><span>￥: <{$row.price}></span>  <s>￥: <{$row.market_price}></s></div>
				<div class="gdesc pl"><span>评论: <{$row.comment}></span></div>
			</div>
		</div>
		<div class="right">
			<div class="conCats" id="consult">
				<a href="?m=goods&a=consult&gid=<{$smarty.get.gid}>"<{if ''== $smarty.get.cid}> class="ck"<{/if}>>全部问题</a>
<{uqcms m="goods" v="consultType" c="consultType"}>				
<{foreach item=it key=ik from=$consultType}>
			<a href="?m=goods&a=consult&gid=<{$smarty.get.gid}>&cid=<{$ik}>#consult"<{if $ik == $smarty.get.cid}> class="ck"<{/if}>><{$it}></a>
<{/foreach}>
			</div>
				
	<{uqcms m="goods" v="consult" c="consult:gid=smarty.get.gid&cid=smarty.get.cid&page=smarty.get.page"}>		
	<{if $consult.list}>
		<{foreach item=c from=$consult.list}>
				<div class="zx_box">
					<dl class="wy">
						<dt>网　　友：</dt>
						<dd><span><{$c.nick}></span> <{$c.addtime|date_format:'%Y-%m-%d %H:%M'}>'</dd>
					</dl>
					<dl>
						<dt>咨询内容：</dt>
						<dd><{$c.question}></dd>
					</dl>
					<dl class="mj">
						<dt>卖家回复：</dt>
						<dd>
							<p><{if $c.reply == ''}>等待回复<{else}><{$c.reply}><{/if}></p>
							<span><{$c.replytime|date_format:'%Y-%m-%d %H:%M'}>'</span>
						</dd>  
					</dl> 
				</div>
		<{/foreach}>
						<div class="page"><{$consult.page}></div>	
	<{else}>
						<div class="nomsg">暂时无提问</div>
	<{/if}>		
<!------咨询提交--------> 
			<div class="addC">
				<dl>
					<dt>咨询类型：</dt>
					<dd>
						<{foreach item=it key=ik from=$consultType}> 
							<label><input type="radio" name="cid" value="<{$ik}>" <{if $ik == '1'}>checked="checked"<{/if}>/><{$it}></label>
						<{/foreach}>		
					</dd>
				</dl>
				<dl>
					<dt>咨询内容：</dt>
					<dd><textarea cols="80" rows="3" name="question" id="question"></textarea></dd>
				</dl>
				<dl>
					<dt>&nbsp;</dt>
					<dd><input type="submit" value="提问" class="submit2"/></dd>
				</dl> 
			</div>
		</div>
<!------咨询提交结束-------->
		</div>
	</div>
</div> 
<{include file="default/footer.html"}>
</body>
</html> 
<script type="text/javascript">
$(function(){
	
	$(".submit2").click(function(){
		var question = $("#question").val(); 
		if(question == ''){ alert('咨询内容不能为空！'); return false; } 
		var cid = $('input[name="cid"]:checked').val();  
		$.post('index.php?m=ajax_goods&a=addConsult',{gid:<{$smarty.get.gid}>, cid:cid, question:question},function(data){
			if(data=='1'){
				alert('提问成功，等待回复。'); 
				location.reload();
			}else{
				alert(data);
			} 
		});
		
	}); 
	  
}); 
</script> 
