<!DOCTYPE html>
<html>
<head>
<title>{$goods_info.goods_name} - {$shop_name}</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="author" content="ecdaddy.com">
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=0">
<meta name="apple-touch-fullscreen" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="format-detection" content="telephone=no">
<link rel="stylesheet" type="text/css" href="style/base.css?v=mzw" />
{insert_scripts files='common.js,../js/transport.js,../js/utils.js'}
</head>
<body>
{include file='head1.html'}
<div class="good-detail sift-mg">
	<h3 class="h_h3">{$goods_info.goods_name}<font color="red"></font> </h3>
	<script type="text/javascript">
			var widths=180;
			var heights=180;
			var counts={$picturesnum};
			<!-- {foreach from=$pictures item=picture name=picture}-->
				img{$smarty.foreach.picture.iteration}=new Image();img{$smarty.foreach.picture.iteration}.src='/{if $picture.thumb_url}{$picture.thumb_url}{else}{$picture.img_url}{/if}';
				url{$smarty.foreach.picture.iteration}=new Image();url{$smarty.foreach.picture.iteration}.src='javascript:;';
			<!--{/foreach}-->
			var nn=1;
			var key=0;
			function change_img(){
				if(key==0){
					key=1;
				}else if(document.all) {
					document.getElementById("pic").filters[0].Apply();document.getElementById("pic").filters[0].Play(duration=2);
				}
				eval('document.getElementById("pic").src=img'+nn+'.src');
				eval('document.getElementById("url").href=url'+nn+'.src');
				for (var i=1;i <=counts;i++){
					document.getElementById("xxjdjj"+i).className='axx';
				}
				document.getElementById("xxjdjj"+nn).className='bxx';
				nn++;if(nn>counts){
					nn=1;
				}
				tt=setTimeout('change_img()',4000);
			}
			function changeimg(n){
				nn=n;window.clearInterval(tt);change_img();
			}
			document.write('<style type="text/css">');
			document.write('.axx,.bxx{display:inline-block;width:14px;height:6px;margin:0 4px;overflow: hidden;text-indent: -99px;border: 1px solid #a5a5a5;box-shadow: 0 0 1px #999;border-radius: 5px;-webkit-border-radius: 5px;-moz-border-radius: 5px;}');
			document.write('a.axx:link,a.axx:visited{background-color:#F5F0E1;}');
			document.write('a.axx:active,a.axx:hover{background-color:#999;}');
			document.write('a.bxx:link,a.bxx:visited{background-color:#B5B5B5;}');
			document.write('a.bxx:active,a.bxx:hover{background-color:#B5B5B5;}');
			document.write('</style>');
			document.write('<div style="width:'+widths+'px;height:'+heights+';overflow:hidden;text-overflow:clip;margin:0px auto;padding-top:20px;text-align: center;">');
			document.write('<div><a id="url"><img id="pic" style="border:0px;box-shadow: -2px 2px 2px #999;" width='+widths+' height='+heights+' /> </a> </div>');
			document.write('<div style="margin-top:6px;">');
			for(var i=1;i <counts+1;i++){
				document.write('<a href="javascript:changeimg('+i+');" id="xxjdjj'+i+'" class="axx" target="_self">'+i+' </a>');
			}
			document.write('</div></div>');
			change_img();
		</script>
	<form action="javascript:addToCart({$goods_info.goods_id})" method="post" name="ECS_FORMBUY" id="ECS_FORMBUY" >
		<ul class="mu_lw">
			{if $goods_info.brand_id}
			<li class="mu_l"> <span class="mu_lh">品牌：</span> <span class="mu_lc"><a href='brands.php?b_id={$goods_info.brand_id}'>{$brand_name}</a></span></li>
			{/if}
			<li class="mu_l"> <span class="mu_lh">编号：</span> <span class="mu_lc">{$goods_info.goods_sn}</span></li>
			<li class="mu_l"><span class="mu_lh">分类：</span> <span class="mu_lc">{foreach from=$cat_array item=cat_data}<a href='category.php?c_id={$cat_data.cat_id}'>{$cat_data.cat_name}</a> &gt; {/foreach}{$goods_info.goods_name}</span> </li>
			{if $goods_info.promote_price and $goods_info.gmt_end_time}
			<li class="mu_l"><span class="mu_lh">促销价：</span> <span class="mu_lc red price-txt">{$goods_info.promote_price}</span></li>
			<li class="mu_l"><span><span class="mu_lh">促销信息：</span> <span class="mu_lc red"><span class="red">机不可失哦！</span></span> </span></li>
			{/if}
			{if $goods_info.goods_weight neq '0克'}<li class="mu_l"><span class="mu_lh">重量：</span> <span class="mu_lc price-txt">{$goods_info.goods_weight}</span></li>{/if}
			<li class="mu_l"><span class="mu_lh">点击数：</span> <span class="mu_lc q-txt">{$goods_info.click_count}</span></li>
			<li class="mu_l"><span class="mu_lh">市场价：</span> <span class="mu_lc q-txt"><del>{$goods_info.market_price}</del></span></li>
			<li class="mu_l"><span class="mu_lh">商品价格：</span> <span class="mu_lc red q-txt" id="ECS_SHOPPRICE">{$goods_info.shop_price_formated}</span></li>
			<!-- {foreach from=$rank_prices item=rank_price key=key} 会员等级对应的价格-->
			<li class="mu_l"><span class="mu_lh">{$rank_price.rank_name}：</span> <span class="mu_lc red q-txt" id="ECS_RANKPRICE_{$key}">{$rank_price.price}</span></li>
			<!--{/foreach}-->
			<li class="mu_l"><span class="mu_lh">用户评价：</span> <span class="mu_lc q-txt"><img src="./../mobile/images/stars{$goods_info.comment_rank}.gif" alt="comment rank {$goods_info.comment_rank}" /></span></li>

			<!--{if $volume_price_list } -->
			<li class="padd"> <font class="f1">购买商品达到以下数量区间时可享受的优惠价格：</font><br />
				<table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#aad6ff">
					<tr>
						<td bgcolor="#FFFFFF"><strong>数量</strong></td>
						<td bgcolor="#FFFFFF"><strong>优惠价格</strong></td>
					</tr>
					<!-- {foreach from=$volume_price_list item=price_list key=price_key} -->
					<tr>
						<td bgcolor="#FFFFFF" class="shop">{$price_list.number}</td>
						<td bgcolor="#FFFFFF" class="shop">{$price_list.format_price}</td>
					</tr>
					<!-- {/foreach} -->
				</table>
			</li>
			<!--{/if}-->
			
			<li class="mu_l"><span class="mu_lh">商品总价：</span> <span class="mu_lc red q-txt" id="ECS_GOODS_AMOUNT"></span></li>
			
			
			<!-- {if $goods_info.bonus_money} 红包-->
			<li class="padd loop" style="margin-bottom:5px; border-bottom:1px dashed #ccc;"> <strong>{$lang.goods_bonus}</strong><font class="shop">{$goods_info.bonus_money}</font><br />
			</li>
			<!-- {/if} -->
			<li class="mu_l"><span class="mu_lh">购买数量：</span> <span class="mu_lc q-txt"><input name="number" type="text" id="number" value="1" size="4" onblur="changePrice()" style="border:1px solid #ccc; "/></span></li>
	
			<!-- {if $goods_info.is_shipping} 为免运费商品则显示-->
			<li class="mu_l"> <span class="mu_lh2">免邮费：</span><span class="red mgn-bt">此商品为免运费商品，计算配送金额时将不计入配送费用</span> </li>
			<!-- {/if} -->
			<!-- {* 开始循环所有可选属性 *} -->
			<!-- {foreach from=$specification item=spec key=spec_key} -->
			<li class="mu_l"> <span class="mu_lh2">{$spec.name}：</span>
				<!-- {* 判断属性是复选还是单选 *} -->
				<!-- {if $spec.attr_type eq 1} -->
				<!-- {if $cfg.goodsattr_style eq 1} -->
				<!-- {foreach from=$spec.values item=value key=key} -->
				<label for="spec_value_{$value.id}">
				<input type="radio" name="spec_{$spec_key}" value="{$value.id}" id="spec_value_{$value.id}" {if $key eq 0}checked{/if} onclick="changePrice()" />
				{$value.label} [{if $value.price gt 0}{$lang.plus}{elseif $value.price lt 0}{$lang.minus}{/if} {$value.format_price|abs}] </label>
				<br />
				<!-- {/foreach} -->
				<input type="hidden" name="spec_list" value="{$key}" />
				<!-- {else} -->
				<select name="spec_{$spec_key}" onchange="changePrice()">
					<!-- {foreach from=$spec.values item=value key=key} -->
					<option label="{$value.label}" value="{$value.id}">{$value.label} {if $value.price gt 0}{$lang.plus}{elseif $value.price lt 0}{$lang.minus}{/if}{if $value.price neq 0}{$value.format_price}{/if}</option>
					<!-- {/foreach} -->
				</select>
				<input type="hidden" name="spec_list" value="{$key}" />
				<!-- {/if} -->
				<!-- {else} -->
				<!-- {foreach from=$spec.values item=value key=key} -->
				<label for="spec_value_{$value.id}">
				<input type="checkbox" name="spec_{$spec_key}" value="{$value.id}" id="spec_value_{$value.id}" onclick="changePrice()" />
				{$value.label} [{if $value.price gt 0}{$lang.plus}{elseif $value.price lt 0}{$lang.minus}{/if} {$value.format_price|abs}] </label>
				<br />
				<!-- {/foreach} -->
				<input type="hidden" name="spec_list" value="{$key}" />
				<!-- {/if} -->
			</li>
			<!-- {/foreach} -->
			
			<li class="mu_l" style="margin-top:10px;">
			<div class="btn-section"> <span class="btn-tbl-cell"><a class="btn-attention" id="attention" href="javascript:collect({$goods_info.goods_id});"><span class="icon">收藏</span></a></span> <span class="btn-tbl-cell"> <a href="javascript:addToCart({$goods_info.goods_id}, 'add_cart');" class="btn-add-cart" style="background-color: rgb(249, 65, 58); background-position: initial initial; background-repeat: initial initial;">加入购物车</a></span> <span class="btn-tbl-cell"> <a href="javascript:addToCart({$goods_info.goods_id}, 'quk_buy');" class="btn-quk-buy" style="background-color: rgb(255, 232, 164); background-position: initial initial; background-repeat: initial initial;">立即购买</a></span> </div>
			</li>
		</ul>
	</form>
	<div class="parting-line"></div>
	<a href="goods.php?act=view_img&amp;id={$goods_id}" class="good-lnk2" style="margin-left:10px"> <span class="tit">商品详情</span> </a>
	<div class="parting-line"></div>
	<a href="comment.php?g_id={$goods_id}" class="good-lnk2" style="margin-left:10px"> <span class="tit">商品评论（<span class="red" >{$comment.pager.record_count}</span>）</span> </a>
	<div class="parting-line"></div>
	{if $goods_info.goods_brief}
	<div href="#" class="good-lnk2" style="margin-left:10px"> <span class="tit">简单描述</span></div>
	<div class="parting-line"></div>
	<div class="detail" style="margin-left:10px;table-layout:fixed; word-break: break-all; overflow:hidden;"> {$goods_info.goods_brief} </div>
	{/if} </div>
{include file='foot1.html'}
<script type="text/javascript">
var addto_cart_success = "该商品已添加到购物车。";
var goods_id = {$goods_info.goods_id};
var goodsattr_style = {$cfg.goodsattr_style|default:1};
var goodsId = {$goods_info.goods_id};
var now_time = {$now_time};
onload = function(){
  changePrice();
  try {onload_leftTime();}
  catch (e) {}
}
/**
 * 点选可选属性或改变数量时修改商品价格的函数
 */
function changePrice()
{
  var attr = getSelectedAttributes(document.forms['ECS_FORMBUY']);
  var qty = document.forms['ECS_FORMBUY'].elements['number'].value;
  Ajax.call('goods.php', 'act=price&id=' + goodsId + '&attr=' + attr + '&number=' + qty, changePriceResponse, 'GET', 'JSON');
}
/**
 * 接收返回的信息
 */
function changePriceResponse(res)
{
  if (res.err_msg.length > 0)
  {
    alert(res.err_msg);
  }
  else
  {
    document.forms['ECS_FORMBUY'].elements['number'].value = res.qty;
    if (document.getElementById('ECS_GOODS_AMOUNT'))
      document.getElementById('ECS_GOODS_AMOUNT').innerHTML = res.result;
  }
}
</script>
</body>
</html>
