{extend name="default/base" /}
{block name="title"}{$goods['goodsName']} - {:WSTConf('CONF.shopName')}{__block__}{/block}
{block name="meta"}
<meta name="description" content="{$goods['goodsName']}">
<meta name="Keywords" content="{$goods['goodsSeoKeywords']}">
{/block}
{block name="css"}
<link href="__STYLE__/css/goods.css?v={$v}" rel="stylesheet">
{/block}
{block name="nav"}
	{include file="default/header" /}
{/block}
{block name="main"}
<div class='wst-w' style='border-bottom:1px solid #ddd;'>
<div class='wst-filters'>
   <div class='item' style="border-left:2px solid #df2003;padding-left: 8px;">
      <a class='link' href='__ROOT__'>首页</a>
      <i class="arrow">></i>
   </div>
   {volist name=":WSTPathGoodsCat($goods['goodsCatId'])" id='vo'}
   <div class='wst-lfloat'>
   	<div class='item dorpdown'>
     <div class='drop-down'>
        <a class='link' href='{:Url("home/goods/lists",["cat"=>$vo["catId"]])}'>{$vo['catName']}</a>
        <i class="drop-down-arrow"></i>
     </div>
     <div class="dorp-down-layer">
         {volist name=":WSTGoodsCats($vo['parentId'])" id='vo2'}
         <div class="{$vo['parentId']>0?'cat2':'cat1'}"><a href='{:Url("home/goods/lists","cat=".$vo2["catId"])}'>{$vo2['catName']}</a></div>
         {/volist}
	</div>
	</div>
	<i class="arrow">></i>
   </div>
   {/volist}
   <div class='wst-clear'></div>
</div>
</div>
<div class='wst-w'>
   <div class='wst-container' style="border:1px solid #dedede">
      <div class='goods-img-box'>
          <div class="goods-img spec-preview" id="preview">
          	<img title="{$goods['goodsName']}" alt="{$goods['goodsName']}" src="__ROOT__/{:WSTImg($goods['goodsImg'])}" class="cloudzoom" data-cloudzoom="zoomImage:'__ROOT__/{$goods['goodsImg']}'" height="350" width="350">
          </div>
          <div class="goods-pics">
            <a class="prev">&lt;</a>
            <a class="next">&gt;</a>
            <div class="items">
               <ul>
               {volist name="$goods['gallery']" id='vo'}
                   <li><img title="{$goods['goodsName']}" alt="{$goods['goodsName']}" class='cloudzoom-gallery' src="__ROOT__/{:WSTImg($vo)}" data-cloudzoom="useZoom: '.cloudzoom', image:'__ROOT__/{:WSTImg($vo)}', zoomImage:'__ROOT__/{$vo}' " width="60" height="54"></li>
               {/volist}
			   </ul>	
			</div>
         </div>
      </div>
      <div class='intro'>
          <h2>{$goods['goodsName']}</h2>
          <span class='tips'>{$goods['goodsTips']}</span>
          <div class='summary'>
          	<div class="infol">
             <div class='item'>
               <div class='dt' style="padding-left:13px;">市场价：</div>
               <div class='dd market-price' id='j-market-price'>￥{$goods['marketPrice']}</div>
             </div>
             <div class='item'>
               <div class='dt'>价格：</div>
               <div class='dd price' id='j-shop-price'>￥{$goods['shopPrice']}</div>
             </div>
             </div>

             <div class='wst-clear'></div>
          </div>
          <div class='spec'>
             {if !empty($goods['spec'])}
             {volist name="$goods['spec']" id='vo'}
             <div class='item'>
               <div class='dt'>{$vo['name']}：</div>
               <div class='dd'>
               {volist name="$vo['list']" id='vo2'}
                  {if $vo2['itemImg']!=''}
                  <div class='j-option img' data-val="{$vo2['itemId']}" style='height:28px;padding:0px;'><img class="cloudzoom-gallery" width="28" height="28" src="__ROOT__/{:WSTImg($vo2['itemImg'])}" data-cloudzoom="useZoom: '.cloudzoom', image:'__ROOT__/{:WSTImg($vo2['itemImg'])}', zoomImage:'__ROOT__/{$vo2['itemImg']}' "  title="{$vo2['itemName']}" alt="{$vo2['itemName']}"/><i></i></div>
                  {else}
                  <div class='j-option' data-val="{$vo2['itemId']}">{$vo2['itemName']}<i></i></div>
                  {/if}
               {/volist}
               </div>
               <div class='wst-clear'></div>
             </div>
             {/volist}
             {/if}
          </div>
          <div class='buy'>
             <div class='item'>
                <div class='dt'>数量：</div>
                <div class='dd'>
	                <a href='#none' class='buy-btn' id='buy-reduce' style='color:#ccc;' onclick='javascript:WST.changeIptNum(-1,"#buyNum","#buy-reduce,#buy-add")'>-</a>
	                <input type='text' id='buyNum' class='buy-num' value='1' data-min='1' autocomplete="off" onkeyup='WST.changeIptNum(0,"#buyNum","#buy-reduce,#buy-add")' onkeypress="return WST.isNumberKey(event);" maxlength="6"/>
	                <a href='#none' class='buy-btn' id='buy-add' onclick='javascript:WST.changeIptNum(1,"#buyNum","#buy-reduce,#buy-add")'>+</a>
                    &nbsp; &nbsp;（库存：<span id='goods-stock'>0</span>&nbsp;{$goods['goodsUnit']}）
                </div>
             </div>
             <div class='item' style="padding-left:35px;margin-top:10px;">
              服务：由<span class="shopName">{:WSTConf('CONF.shopName')}</span>商城发货并提供售后服务。
             </div>
             <div class='item' style='padding-left:35px;margin-top:20px;'>
               {if $goods['read']}
                 <a id='addBtn' href='javascript:void(0);' class='addBtn un-buy' >加入购物车</a>
                 <a id='buyBtn' href='javascript:void(0);' class='buyBtn un-buy'>立即购买</a>
               {else}
                 <a id='addBtn' href='javascript:addCart(0,"#buyNum")' class='addBtn' >加入购物车</a>
                 <a id='buyBtn' href='javascript:addCart(1,"#buyNum")' class='buyBtn'>立即购买</a>
               {/if}
               <div class="wst-favorite">
               {if ($goods['favGood']>0)}
                 <a href='javascript:void(0);' onclick='WST.cancelFavorite(this,0,{$goods["goodsId"]},{$goods['favGood']})' class='favorite j-fav'>已关注</a>
               {else}
                 <a href='javascript:void(0);' onclick='WST.addFavorite(this,0,{$goods["goodsId"]},{$goods["goodsId"]})' class='favorite j-fav2 j-fav3'>关注商品</a>
               {/if}
               </div>
             </div>
          </div>
      </div>
      <div class="introduce">
        <div class="head">商品概况</div>
        <ul class="int-item">
          <li>累计评价：<span>{$goods['appraiseNum']}</span></li>
          <li>商品评分：
             {for start="0" end="$goods['scores']['totalScores']"}
              <img src="__STATIC__/plugins/raty/img/star-on.png">
             {/for}
          </li>
          <li>成交量：<span>{$goods['saleNum']}</span>笔</li>
          <li>商品编号：<span>{$goods['goodsSn']}</span></li>
        </ul>
      </div>
      <div class='wst-clear'></div>
   </div>
</div>
<div class='wst-w'>
   <div class='wst-container'>
       <div class='wst-side'>
		   <div class="goods-side">
				<div class="guess-like">
					<div class="title">猜你喜欢</div>
					{wst:goods type='best' cat="$goods['goodsCatId']" num='3'}
					<div class="item">
						<div class="img"><a target='_blank' href="{:Url('home/goods/detail','id='.$vo['goodsId'])}"><img title="{$vo['goodsName']}" alt="{$vo['goodsName']}" data-original="__ROOT__/{:WSTImg($vo['goodsImg'])}" class="goodsImg" /></a></div>
						<div class="p-name"><a class="wst-hide wst-redlink">{$vo['goodsName']}</a></div>
						<div class="p-price">￥{$vo['shopPrice']}<span class="v-price">￥{$vo['marketPrice']}</span></div>
					</div>
					{/wst:goods}
				</div>
				<div class="hot-goods">
					<div class="title">热销商品</div>
					{wst:goods type='hot' num='3'}
					<div class="item">
						<div class="img"><a target='_blank' href="{:Url('home/goods/detail','id='.$vo['goodsId'])}"><img title="{$vo['goodsName']}" alt="{$vo['goodsName']}" data-original="__ROOT__/{:WSTImg($vo['goodsImg'])}" class="goodsImg" /></a></div>
						<div class="p-name"><a class="wst-hide wst-redlink">{$vo['goodsName']}</a></div>
						<div class="p-price">￥{$vo['shopPrice']}<span class="v-price">￥{$vo['marketPrice']}</span></div>
					</div>
					{/wst:goods}
				</div>
        <div class="hot-goods">
          <div class="title">我的足迹</div>
          {wst:goods type='history' num='3'}
          <div class="item">
            <div class="img"><a target='_blank' href="{:Url('home/goods/detail','id='.$vo['goodsId'])}"><img title="{$vo['goodsName']}" alt="{$vo['goodsName']}" data-original="__ROOT__/{:WSTImg($vo['goodsImg'])}" class="goodsImg" /></a></div>
            <div class="p-name"><a class="wst-hide wst-redlink">{$vo['goodsName']}</a></div>
            <div class="p-price">￥{$vo['shopPrice']}<span class="v-price">￥{$vo['marketPrice']}</span></div>
          </div>
          {/wst:goods}
        </div>
			</div>
		</div>
		<div class='goods-desc'>
        <div id='tab' class="wst-tab-box">
        <ul class="wst-tab-nav">
           <li>商品介绍</li>
           <li>商品属性</li>
           <li>商品评价(<span id="apprNum">{$goods['appraiseNum']}</span>)</li>
        </ul>
          <div class="wst-tab-content" style='width:99%;margin-bottom: 10px;min-height:1312px;'>
             <div class="wst-tab-item goods-desc-box" style="position: relative;">
             {$goods['goodsDesc']|htmlspecialchars_decode}
             </div>
             <div class="wst-tab-item" style="position: relative;display:none">
                <table class='wst-attrs-list'>
                   {volist name="$goods['attrs']" id="vo"}
                   <tr>
                      <th nowrap>{$vo['attrName']}</th>
                      <td>{$vo['attrVal']}</td>
                   </tr>
                   {/volist}
                </table>
             </div>
             <input type="hidden" id="filtertype" value="all" />
             <script id="tblist" type="text/html">
              <div class="appr-filter">
                <ul class="appr-filterbox">
                  <li><a href="javascript:void(0)" onclick="apprfilter('all')" id='all'>全部评价(<span id="totalNum">0</span>)</a></li>
                  <li><a href="javascript:void(0)" onclick="apprfilter('pic')" id='pic'>晒图(<span id="picNum">0</span>)</a></li>
                  <li><a href="javascript:void(0)" onclick="apprfilter('best')" id='best'>好评(<span id="bestNum">0</span>)</a></li>
                  <li><a href="javascript:void(0)" onclick="apprfilter('good')" id='good'>中评(<span id="goodNum">0</span>)</a></li>
                  <li><a href="javascript:void(0)" onclick="apprfilter('bad')" id='bad'>差评(<span id="badNum">0</span>)</a></li>
                </ul>
              </div>
               {{# for(var i = 0; i < d.length; i++){ }}
               <div class="appraises-box">
               <div class="wst-appraises-right">
                  <div class="userinfo">
                    <img data-original="__ROOT__/{{d.userPhoto}}" class="apprimg" />
                    <div class="appraiser">
                        {{d[i]['loginName']}}
                    </div>
                  </div>
                  <p>{{d[i].rankName}}</p>
               </div>
                <div class="wst-appraises-left">
                  <div class="appr-starbox">
                    {{#  for(var j=0;j<d[i].avgScore;++j){ }}
                      <div class="appr-star"></div>
                    {{# }  }}
                    {{#for(var g=0;g<5-d[i].avgScore;++g){ }}
                        <div class="appr-star-off"></div>
                    {{# }  }}
                  </div>
                  <div class='wst-clear'></div>
                  <p class="app-content">
                    {{d[i]['content']}}
                    <div class="goods-spec-box">
                        {{d[i]['goodsSpecNames']}}
                    </div>
                  </p>
                  {{#  if(WST.blank(d[i]['images'])!=''){ var img = d[i]['images'].split(','); var length = img.length;  }}
                  <div id="img-file-{{i}}">
                  {{#  for(var g=0;g<length;g++){  }}
                         <img src="__ROOT__/{{img[g].replace('.','_thumb.')}}" layer-src="__ROOT__/{{img[g]}}"  style="width:80px;height:80px;" />
                  {{#  } }}
                  </div>
                  {{# }  }}
                  <span class="apprtime">{{d[i]['createTime']}}</span>
                  {{# if(d[i]['shopReply']!='' && d[i]['shopReply']!=null){ }}
                  <div class="reply-box">
                     <p class="reply-content"><a href="javascript:void(0)" onclick="goShop({{d[i]['shopId']}})">{{d[i]['shopName']}}</a>：{{d[i]['shopReply']}}</p>
                     <p class="reply-time">{{d[i]['replyTime']}}</p>
                 </div>
                 {{# } }}

               </div>
             <div class="wst-clear"></div>
              </div> 
               {{# } }}
               </script>
             <div class="wst-tab-item" style="position: relative;display:none;">
                  <div class="appraise-head">
                  <div class="app-head-l">
                    <div class="app-head-lbox">
                      <strong class="text">好评度</strong>
                      <div class='percent'>
                        <i class="best_percent">0</i><span>%</span>
                      </div>
                    </div>

                  </div>
                  <div class="app-head-r">
                    <div class="app-head-rbox">
                      <div class="app-hr-item">
                        <div class="app-hr-text">好评(<i class="best_percent">0</i>%)</div>
                        <div class="percentbox">
                            <div class="percentbg" id="best_percentbg" style="width:0%"></div>
                        </div>
                      </div>
                      <div class="app-hr-item">
                        <div class="app-hr-text">中评(<i class="good_percent">0</i>%)</div>
                        <div class="percentbox">
                            <div class="percentbg" id="good_percentbg" style="width:0%"></div>
                        </div>
                      </div>
                      <div class="app-hr-item">
                        <div class="app-hr-text">差评(<i class="bad_percent">0</i>%)</div>
                        <div class="percentbox">
                            <div class="percentbg" id="bad_percentbg" style="width:0%"></div>
                        </div>
                      </div>
                    </div>
                  </div>

                </div>
                 <div id='ga-box'></div>
                 <div id='pager' style='text-align:center;'></div>
             </div>
        </div>
    </div>  	
		<div class='wst-clear'></div>
	</div>
	<div class='wst-clear'></div>
</div>
{include file="default/right_cart"/}
{/block}
{block name="js"}
<script>
var goodsInfo = {
	id:{$goods['goodsId']},	
	isSpec:0,
	goodsStock:{$goods['goodsStock']},
	marketPrice:{$goods['marketPrice']},
	goodsPrice:{$goods['shopPrice']}
	{if isset($goods['saleSpec'])}
	,sku:{:json_encode($goods['saleSpec'])}
	{/if}
}
</script>
<script type='text/javascript' src='__STYLE__/js/cloudzoom.js?v={$v}'></script>
<script type='text/javascript' src='__STYLE__/js/goods.js?v={$v}'></script>
<script type='text/javascript' src='__STYLE__/js/qrcode.js?v={$v}'></script>
<script>
$(function(){
	var qr = qrcode(10, 'M');
	var url = window.location.href;
	qr.addData(url);
	qr.make();
	$('#qrcode').html(qr.createImgTag());
});
</script>
{/block}
