<!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" />
<title>{#$webtitle#}{#$web_config.poweredby#}</title>
<link rel="stylesheet" type="text/css" href="./templates/www/{#$web_config.temp -> dir#}/css/{#$web_config.temp -> style#}.css" />
<link rel="stylesheet" type="text/css" href="./templates/www/{#$web_config.temp -> dir#}/css/bootstrap.min.css" />
<link rel="stylesheet" type="text/css" href="./templates/www/{#$web_config.temp -> dir#}/css/carousel.css" />
<script language="javascript" src="./js/jquery.min.js" ></script>
<script language="javascript" src="./js/common.js"></script>
<script language="javascript" src="./js/gv32menu.js"></script>
<script language="javascript">
function getdetimg(str)
{
	document.getElementById("detproimg").innerHTML = "<a href='"+str+"' target='_blank' ><img src='"+str+"' width='320' border='0' /></a>";
}
function change_num(opation){
	var n = $('#num').val();
	var gid = $('#pro_id').val();
	if(opation === 'up'){
		n++;
		$('#num').val(n);
	}else{
		if(n < 2){
	 		$('#num').val(1);
	 	}else{
	 		n--;
	 		$('#num').val(n);
	 	}
	}
        aert(n+num);
	var num_val = $('#num').val();
	
	$.post("{#$base_weburl#}/index.php?/item/check_stock/",{upnum:num_val, goodid:gid } ,function(data){
		console.log(data);
  		if (data == 'error') {
  			alert('您好，库存不足');
  			$('#num').val(n-1);
  			return false;
  		}
	});
        aert(n+num);
}
</script>
</head>
<body>
{#include file="$tpl_path/cover/header.tpl"#}
{#include file="$tpl_path/cover/web_address.tpl"#}
<div class="maincss">
{#include file="$tpl_path/cover/pro_left.tpl"#}
{#if $getads.1.relurl neq ''#}
<div class="mainrightad">
{#$getads.1.relurl#}
</div>
{#/if#}
<div class="mainright_art">

 
<div class="list_art" style="line-height:200%;padding:5px;background-color:#FFFFFF;">
<ul class="list_pro_ul">

	<table width="100%" cellpadding="0"  cellspacing="0" >
	<tr align="center" >
	<td >
<table width="660" border="0" cellspacing="0" cellpadding="0" align="left" >
<tr>
    <td colspan="3" align="left" >
	
<table cellpadding="0" cellspacing="0" width="660">
  <tr>
    <td rowspan="8" width="320"><div id="detproimg"  ><a href="{#$base_weburl#}{#$infodetail.pro_img#}" target="_blank"><img src=".{#$infodetail.pro_img#}" width="320" border="0" alt="{#$infodetail.pro_name#}" /></a></div></td>
    <td><div align="right">商品分类：&nbsp;</div></td>
    <td><a href="./index.php?/item-info_list-{#$infodetail.prs_id#}.html" >{#$infodetail.prs_name#}</a></td>
  </tr>
  <tr>
    <td><div align="right">条码：&nbsp;</div></td>
    <td>{#$infodetail.pro_barcode#}<input type="hidden" value="{#$infodetail.pro_id#}" name="pro_id" id="pro_id"></td>
  </tr>
  <tr>
    <td><div align="right">规格：&nbsp;</div></td>
    <td>{#$infodetail.pro_spec#}</td>
  </tr>
  <tr>
    <td><div align="right">库存：&nbsp;</div></td>
    <td>{#$infodetail.pro_num#}(单位:{#$infodetail.pro_unit#})</td>
  </tr>
  <tr>
    <td><div align="right">产地：&nbsp;</div></td>
    <td>{#$infodetail.pro_production#}</td>
  </tr>
 
  <tr>
    <td><div align="right">市场价：&nbsp;</div></td>
    <td> {#if $infodetail.pro_market_price > 0#}<span style="color:#666666;text-decoration:line-through;">￥{#$infodetail.pro_market_price#}元 {#/if#}</td>
  </tr>
  <tr>
    <td><div align="right">数量（{#$infodetail.pro_unit#}）：&nbsp;</div></td>
    <td> <div class="input-group" style="width:120px;">
  <span class="input-group-addon"  onClick="change_num('down',1);">-</span>
  <input type="text" class="form-control" name="num" id="num" data-role="none"  value="1" readonly  style="background-color:#FFFFFF;">
  <span class="input-group-addon" onClick="change_num('up',1);">+</span>
</div></td>
  </tr>

  <tr>
    <td><div align="right">销售价：&nbsp;</div></td>
    <td><p  style="color:#CC0000; font-size:16px;">￥{#$infodetail.pro_sell_price#}元</td>
  </tr>
  
  <tr>
    <td rowspan="2"><div id="divproimg" style="background-color:#EEEEEE;">
      <ul>
        {#foreach item=item key=key from=$infoimgArray name=itempicfor#}
        <li><a href="#" onclick="getdetimg( '{#$base_weburl#}{#$item.big_img#}' )" ><img src=".{#$item.pro_img#}" data-large="{#$base_weburl#}{#$item.big_img#}"  id="detimg{#$key#}" width="50" alt="{#$infodetail.pro_name#}" /></a></li>
	{#/foreach#}
	  </ul>
	  </div></td>
    <td colspan="2" align="center"><button type="button" class="btn btn-primary" ><a href="{#$base_weburl#}/index.php?load=book&act=info_list&id={#$infodetail.pro_id#}" title="在线申请预订购">在线申请预订购</a></button></td>
  </tr>
  <tr>
    <td colspan="2">&nbsp;</td>
    </tr>
</table>	</td>
  </tr>

  <tr >
    <td colspan="3" align="left" style="line-height:200%; padding:5px;">详细内容：<br />{#$infodetail.pro_content#}</td>
  </tr>
  
  <tr >
    <td colspan="3" align="left" >
<div class="divcomment">
<form name="formcom" action="{#$base_weburl#}/index.php?/comment.html?type=addinfo" method="post" onsubmit="return submitFun(this)">
评论&nbsp;&nbsp;>> <a href="./index.php?/comment-info_list-{#$infodetail.pro_id#}.html?keyword=item" title="查看对“{#$infodetail.pro_name#}”">查看对应评论</a>
<input type="hidden" name="com_type" id="com_type" value="item">
<input type="hidden" name="com_value_id" id="com_value_id" value="{#$infodetail.pro_id#}"> 
<br>
<textarea name="com_content"  id="com_content" style="width:500px;height:80px;" ></textarea>
<br>
<input type="submit" name="submit" id="submit" value="提交" >
</form>
</div></td>
  </tr>
  
</table>	</td>
	</tr>
  <tr align="left" >
    <td colspan="3" align="left" ><table align="left" width="100%" ><tr align="left" ><td align="left" width="120" ><span style="font-weight:bolder">分享到：</span></td><td align="left" ><!-- Baidu Button BEGIN HuCart.COM ADD  -->
    <div id="bdshare" class="bdshare_t bds_tools get-codes-bdshare">
        <a class="bds_qzone">QQ空间</a>
        <a class="bds_tsina">新浪微博</a>
        <a class="bds_tqq">腾讯微博</a>
        <a class="bds_renren">人人网</a>
        <span class="bds_more">更多</span>    </div>
<script type="text/javascript" id="bdshare_js" data="type=tools&amp;mini=1" ></script>
<script type="text/javascript" id="bdshell_js"></script>
<script type="text/javascript">
	document.getElementById("bdshell_js").src = "http://bdimg.share.baidu.com/static/js/shell_v2.js?cdnversion=" + new Date().getHours();
</script>
<!-- Baidu Button END HuCart.COM ADD --></td></tr></table></td>
  </tr>
  <tr >
	<tr><td>&nbsp;
	</td></tr>
	</table>
</ul>

{#if $Nextdetail.pro_id eq ''#}{#else#}
  <div class="list_art"><span style="font-weight:bold;" >下一篇：</span><a href="{#$Nextdetail.get_url#}">{#$Nextdetail.pro_name#}</a></div>
  {#/if#}
{#if $Prodetail.pro_id eq ''#}{#else#}
 <div class="list_art"><span style="font-weight:bold;" >上一篇：</span><a href="{#$Prodetail.get_url#}">{#$Prodetail.pro_name#}</a></div>
  {#/if#}
</div>

<div class="list_art">
<ul class="list_art_ul" style="width:96%;float:center;">
	{#if $commentInfo eq ''#}
	<li style="color:#FF0000;">暂无评论</li>
	{#else#}
	{#foreach item=item from=$commentInfo#}
	<li style="border-bottom:1px solid #DDDDDD; margin: 0 auto;background-color:#EEEEEE;"><span style="font-weight:bold;">{#$item.com_nickname#}</span><span> 发表时间：{#$item.com_addtime|date_format:"%Y- %m- %d"#}</span><span style="font-size:10px;color:#999999;">在ip:{#$item.com_ip#}</span></li>
	<li>{#$item.com_content#}</li>
	{#/foreach#}
	<li> >><a href="./index.php?/comment-info_list-{#$infodetail.pro_id#}.html?keyword=item" title="查看对“{#$infodetail.pro_name#}”">查看所有评论</a></li>
	{#/if#}
</ul>
</div>

</div>



{#if $getads.9.relurl neq ''#}
<div class="mainrightad">
{#$getads.9.relurl#}
</div>
{#/if#}
</div>

</div>
{#include file="$tpl_path/cover/footer.tpl"#}
<script language="javascript">
$('#add_cart').click(function(){
    var proidval = $('#pro_id').val();
    var num = $('#num').val();
    //var att_all_str = '';
    window.location.replace('/index.php?load=order&act=add&pro_id='+proidval+'&num='+num );
})

</script>
</body>
</html>
