<!DOCTYPE HTML>
<html>
<head>
    <meta charset="UTF-8">
    <title>{$title}</title>
    <meta name="keywords" content="{$keywords}" />
    <meta name="description" content="{$description}" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <meta name="format-detection" content="telephone=no, email=no">
    <meta name="apple-mobile-web-app-title" content="{$site_name}" />
    <meta name="generator" content="openwbs {$version}" />
    <meta name="author" content="openwbs team" />
    <meta name="copyright" content="2008-2020 OpenWBS Inc." />
    <!--#include file="include.css.html"-->
    <link rel="stylesheet" href="../css/om.shop.goods.detail.css" />
    <link rel="stylesheet prefetch" href="../css/photoswipe/photoswipe.all.css">
</head>
<body>
<!--头部-->
<header class="ow-header">
    <a class="goback" href="javascript:OW.goBack();"></a>
    <div class="title">商品详情</div>
    <!--#include file="include.top.nav.html"-->
</header>

<section class="mbody">
    <div class="ow-goods-detail">
        <div id="gallery" class="gallery">
            <div class="header"><ul></ul></div>
            <div class="section">
                <ul name="photo_gallery" data-pswp-uid="1">{%=OW.echoImages("{$goods:images}","<li><figure><span><a href='{$url}'><img src='{$url}' alt='{$name}' title='{$name}' /></a></span></figure></li>")%}</ul>
            </div>
        </div>
        <div class="goods-property">
            <h1 class="title">{$goods:title}</h1>
            {if:OW.trim("{$goods:subtitle}")<>""}
            <h2 class="subtitle">{$goods:subtitle}</h2>
            {/if}
            <div class="goods-sn">商品编号：{$goods:goods_sn}</div>
            <div class="goods-product-sn">商品货号：<span id="goods_product_sn">{$goods:product_sn}</span></div>
            <div class="price">
                <div class="section">
                    {if:OW.int("{$config(is_member_price_show)}")=1}
                    <a href="javascript:;" class="get-member-price" name="get_member_price" onClick="OW.shop.getMGPrices()">查看会员价</a>
                    {/if}
                    {if:OW.int("{$goods:point_set}")=1 and OW.int("{$goods:point_pay_amount}")>0}
                    <dl class="point"><dt>只需</dt><dd><b>{$goods:point_pay_amount}</b><em><%=OS.lang(200)%></em><i id="pointplus">+</i></dd></dl>
                    {/if}
                    <dl class="my-price" id="my_price" style="display:none;">
                        <dt>我的会员价</dt>
                        <dd><span class="money"><em>{$moneysb}</em><b name="my_price">{$goods:price}</b></span></dd>
                    </dl>
                    <dl id="goods_price">
                        <dt>价格</dt>
                        <dd><span class="money"><em>{$moneysb}</em><b name="price">{$goods:price}</b></span></dd>
                    </dl>
                    {if:OW.parseMoney("{$goods:market_price}")>0}
                    <dl class="makprice">
                        <dt>原价</dt>
                        <dd><span class="money"><em>{$moneysb}</em><b name="market_price">{$goods:market_price}</b></span></dd>
                    </dl>
                    {/if}
                    <div class="member-price" name="member_group_prices" gid="{$goods:gid}" pid="{$goods:pid}"></div>
                </div>
            </div>
            <div class="book-money" name="book_price_section" is_book="{$goods:is_book}" book_front_money_rate="{$goods:book_front_money_rate}" book_price_discount="{$goods:book_price_discount}" style="display:none;">
                <div class="section">
                    {if:OW.parseMoney("{$goods:book_price_discount}")>0}
                    <dl class="book-discount" name="book_price_discount_box"><dt>预订立减<span class="dis-name">(优惠金额)</span></dt><dd><span class="money"><em>{$moneysb}</em><b name="book_price_discount">{$goods:book_price_discount}</b></span></dd></dl>
                    {/if}
                    {if:OW.parseMoney("{$goods:book_front_money_rate}")>0}
                    <dl class="book-front-money" name="book_front_money_box"><dt>预订只需支付预付款</dt><dd><span class="money"><em>{$moneysb}</em><b name="book_front_money"></b></span></dd></dl>
                    {/if}
                </div>
            </div>
            <div class="book-time" name="book_time_section" is_book="{$goods:is_book}" book_final_pay_day="{$goods:book_final_pay_day}" is_book_timelimit="{$goods:is_book_timelimit}" book_starttime="{$goods:book_starttime}" book_endtime="{$goods:book_endtime}" style="display:none;"></div>
            <div class="spec">
                <div class="header">请选择您要购买的商品规格</div>
                <div class="spec-section" name="goods_spec" spec_id="{$goods:spec_id}" data='{$goods:spec_data}'></div>
                <div class="footer" name="selected_spec_display"><dl><dt>您已选择</dt><dd name="selected_spec_value"></dd></dl></div>
            </div>
            {if:OW.int("{$config(is_point_open)}")=1}
            {if:OW.int("{$goods:point_set}")=0}
            <div class="goods-point" id="goods_point" point_get_type="{$goods:point_get_type}" shopping_point_rate="{$config(shopping_point_rate)}" point_get_amount="{$goods:point_get_amount}">购买此商品可获得：<b name="point"></b>积分</div>
            {/if}
            {/if}
            <div class="ow-amount">
                <div class="section">
                    <dl>
                        <dt>购买数量<span class="stock" name="stock">(剩余库存<b class="stock-amount" name="stock_amount">0</b>件)</span></dt>
                        <dd><a href="javascript:;" class="amount-do amount-decrease" name="amount_decrease">-</a><input type="number" class="text text-amount" min="1" name="amount_input" value="1"><a href="javascript:;" class="amount-do amount-increase" name="amount_increase">+</a></dd>
                    </dl>
                </div>
                <div class="stock-tip"><span name="stock_tip"></span></div>
            </div>
        </div>
        <!--优惠套装-->
        {if:OS.isValidGoodsMemberInTpl("{$goods:gid}")}
        <div id="suits" is_book="{$goods:is_book}"></div>
        {/if}
        <div id="details_section">
            <div class="ow-goods-details-tab" id="tab_header">
                <ul class="tabbar">
                    <li class="current"><a href="javascript:;">详情描述</a></li>
                    {if:OW.int("{$goods:type_id}")>0}
                    <li><a href="javascript:;">参数</a></li>
                    {/if}
                    {if:OW.int("{$config(is_goods_consultation_show)}")=1}
                    <li><a href="javascript:;">咨询</a></li>
                    {/if}
                    {if:OW.int("{$config(is_buy_record_show)}")=1}
                    <li><a href="javascript:;">成交记录(<span id="buy_record_count">{$goods:buy_record_count}</span>)</a></li>
                    {/if}
                    {if:OW.int("{$config(is_goods_comments_show)}")=1}
                    <li><a href="javascript:;">评价(<span id="comment_count">{$goods:comments}</span>)</a></li>
                    {/if}
                </ul>
            </div>
            <div class="clear"></div>
            <div class="ow-goods-details">
                <div id="tab_content">
                    <div class="content-section-item" name="tab_content_item">
                        {if:OW.int("{$goods:type_id}")>0}<div class="ow-goods-typeattr">{$goods:typeattr}</div>{/if}
                        {if:OW.isNotNul("{$goods:video}")}
                        <div class="ow-goods-video">
                        {if:OW.indexOf("{$goods:video}",".swf")>0}
                        <embed src="{$goods:video}" allowFullScreen="true" quality="high" width="100%" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash"></embed>
                        {else}
                        <video src="{$goods:video}" controls="controls"></video>
                        {/if}
                        </div>
                        {/if}
                        <div class="ow-goods-content" name="photo_gallery" data-pswp-uid="2">{$goods:mob_content}</div>
                        <div class="ow-goods-tags" id="tags">标签：
                        {tags gid="{$goods:gid}"}
                            {tags:loop}<a href="[tags:link]" title="[tags:tag]" target="_blank">[tags:tag]</a>{/tags:loop}
                        {/tags}
                        </div>
                    </div>
                    {if:OW.int("{$goods:type_id}")>0}
                    <div class="content-section-item" name="tab_content_item">
                        <div class="ow-goods-typeattr">{$goods:typeattr}</div>
                    </div>
                    {/if}
                    {if:OW.int("{$config(is_goods_consultation_show)}")=1}
                    <div class="content-section-item" name="tab_content_item">
                        <div class="ow-goods-consultation">
                            <h2 class="header">全部咨询</h2>
                            <div class="section list-section" id="consultation_list">
                                <%=Tpl.getConsultation(OW.int("{$goods:gid}"),"<div class='consult-data'><div class='cst-id'>{$cst_id}</div><div class='avatar'><img src='{$cst_author_avatar}' name='avatar' alt='{$cst_author}' /></div><div class='consult-data-content'><dl><dt><span class='author'>{$cst_author}</span><span class='datetime'>{$cst_date}</span></dt><dd>{$cst_content}</dd></dl></div></div><div class='consult-data consult-data-reply' name='consult_data_reply'><div class='avatar'><img src='{$reply_author_avatar}' name='avatar' alt='客服' /></div><div class='consult-data-content'><dl><dt><span class='servicer'>客服回复</span><span class='datetime'>{$reply_date}</span></dt><dd name='reply_content'>{$reply_content}</dd></dl></div></div>",10,"{prev}{current}{next}")%>
                                {$goods:consultation_list}
                            </div>
                            <div class="pager section pager-section" id="consultation_pager">
                                {$goods:consultation_pager}
                            </div>
                            <div class="section post-section" id="post_consultation_form">
                                <div class="header">亲，需要咨询吗</div>
                                <div class="section">
                                    <dl><dt>咨询类型</dt><dd><label><input type="radio" name="consult_type" checked="checked" value="0">商品咨询</label><label><input type="radio" name="consult_type" value="1">库存及配送</label><label><input type="radio" name="consult_type" value="2">支付问题</label><label><input type="radio" name="consult_type" value="3">发票及保修</label><label><input type="radio" name="consult_type" value="4">促销及赠品 </label></dd></dl>
                                    <dl><dt>咨询内容</dt><dd class="input-text"><textarea class="textarea" name="consult_content"></textarea><span name="t_consult_content" class="t-normal"></span></dd></dl>
                                    <dl><dt>我的称呼</dt><dd class="input-text"><input type="text" class="text text-large" name="consult_author" value=""><span name="t_consult_author" class="t-normal"></span></dd>
                                    </dl>
                                    <dl class="get-answer-email"><dt>我的邮箱(接收客服的回复)</dt><dd class="input-text"><input type="text" class="text text-large" name="consult_email" value=""><span name="t_consult_email" class="t-normal"></span></dd></dl>
                                    <dl><dt>防灌水验证码</dt><dd><input type="text" class="text text-large text-short-mini text-verifycode" name="verifycode_value" placeholder="验证码" ><span class="verifycode" name="verifycode"></span></dd></dl>
                                </div>
                                <div class="footer"><button type="button" class="btn btn-primary" name="btn_consult_submit">提交咨询</button><label><input type="checkbox" name="is_answer_to_email" checked="checked" value="true">将客服的回复发到我的邮箱</label></div>
                            </div>
                        </div>
                    </div>
                    {/if}
                    {if:OW.int("{$config(is_buy_record_show)}")=1}
                    <div class="content-section-item" name="tab_content_item">
                        <div class="ow-buy-records">
                            <%=Tpl.getBuyRecord(OW.int("{$goods:gid}"),"<tr><td>{$buyer}</td><td><ul><li>规格：{$spec_value}</li><li>数量：{$goods_amount}</li><li>时间：{$date}</li></ul></td></tr>",10,"{prev}{current}{next}")%>
                            <table class="buy-record" border="0" cellpadding="0" cellspacing="0">
                                <thead><tr><th>买家</th><th>商品信息</th></tr></thead>
                                <tbody id="buy_record_list">
                                    {$goods:buy_record_list}
                                </tbody>
                            </table>
                            <div class="pager buy-record-pager" id="buy_record_pager">{$goods:buy_record_pager}</div>
                        </div>
                    </div>
                    {/if}
                    {if:OW.int("{$config(is_goods_comments_show)}")=1}
                    <div class="content-section-item" name="tab_content_item">
                        <div class="ow-goods-appraise">
                            <h2 class="header">全部评价</h2>
                            <div class="section list-section" id="comment_list">
                                <%=Tpl.getComment(OW.int("{$goods:gid}"),"<div class='comment-data'><div class='avatar'><img name='avatar' src='{$cmt_author_avatar}'><p class='user'>{$cmt_author}</p></div><div class='comment-data-content'><div class='cmt-header'><span class='cmt-spec' name='cmt_spec'>规格：<b name='spec_value'>{$spec_value}</b></span></div><div class='cmt-footer'><span class='cmt-time'>时间：<b>{$cmt_date}</b></span><span class='cmt-type'>评分：<b name='cmt_type' cmt_type='{$cmt_type}'></b></span></div><div class='cmt-content'>{$cmt_content}</div></div></div><div class='comment-data comment-data-reply' name='comment_data_reply'><div class='avatar'><img name='avatar' src='{$reply_author_avatar}'><p class='user'></p></div><div class='comment-data-content'><div class='cmt-header'>客服回复</div><div class='cmt-content' name='reply_content'>{$reply_content}</div></div></div>",10,"{prev}{current}{next}")%>
                                {$goods:comment_list}
                            </div>
                            <div class="pager section pager-section" id="comment_pager">
                                {$goods:comment_pager}
                            </div>
                        </div>
                    </div>
                    {/if}
                </div>
            </div>
            <div class="ow-goods-related-content" id="om_related_content">
                <h2 class="header">相关内容</h2>
                <div class="section">
                    {content top="100" related_gid="{$goods:gid}"}
                    <ul>
                        {content:loop}
                        <li><a href="[content:link]">[content:title]</a></li>
                        {/content:loop}
                    </ul>
                    {/content}
                </div>
            </div>
            <div class="ow-related-goods" id="om_related_goods">
                <h2 class="header">相关推荐</h2>
                <div class="section">
                    <ul class="ow-goods-vertilist">
                        {goods top="30" related_gid="{$goods:gid}"}
                        {goods:loop}
                        <li>
                            <a href="[goods:link]">
                            <div class="thumb"><img src="[goods:thumbnail]" alt="[goods:title]" title="[goods:title]" /></div>
                            <div class="info">
                                <h3 class="title">[goods:title]</h3>
                                <div class="subtitle">[goods:subtitle]</div>
                                <div class="price">{if:OW.int("[goods:point_set]")=1}<span class="point"><b>[goods:point_pay_amount]</b><em>积分</em><i>+</i></span>{/if}<span class="money"><em>{$moneysb}</em><b><%=OW.parsePrice("[goods:price]")%></b></span></div>
                            </div>
                            </a>
                        </li>
                        {/goods:loop}
                        {/goods}
                    </ul>
                </div>
            </div>
            <div class="ow-latestview-goods" id="om_latestview_goods">
                <h2 class="header">您最近浏览过的</h2>
                <div class="section">
                    <ul class="ow-goods-vertilist">
                    {goods top="7" latestview="true"}
                    {goods:loop}
                        {if:OW.int("[goods:gid]")<>OW.int("{$goods:gid}")}
                        <li>
                            <a href="[goods:link]">
                            <div class="thumb"><img src="[goods:thumbnail]" alt="[goods:title]" title="[goods:title]" /></div>
                            <div class="info">
                                <h3 class="title">[goods:title]</h3>
                                <div class="subtitle">[goods:subtitle]</div>
                                <div class="price">{if:OW.int("[goods:point_set]")=1}<span class="point"><b>[goods:point_pay_amount]</b><em>积分</em><i>+</i></span>{/if}<span class="money"><em>{$moneysb}</em><b><%=OW.parsePrice("[goods:price]")%></b></span></div>
                            </div>
                            </a>
                        </li>
                        {/if}
                    {/goods:loop}
                    {/goods}
                    </ul>
                </div>
            </div>
        </div>
    </div>
</section>

<div class="ow-buy-section">
    <div class="action">
        {if:OW.int("{$config(is_fenxiao_open)}")}
        <a href="javascript:;" class="btn-fenxiao" id="btn_fenxiao"><i></i><span>分销</span></a>
        {else}
        <a href="javascript:;" class="btn-favorite" onClick="OW.shop.addToFavorite({$goods:gid})"><i></i><span>收藏</span></a>
        {/if}
        <a href="{$shop_cart_url}" class="btn-mycart"><i><em name="cart_amount"></em></i><span>购物车</span></a>
        {if:OS.isValidGoodsMemberInTpl("{$goods:gid}")}
            {if:OW.int("{$goods:status}")=1}<button type="button" class="btn-buy disabled">商品已下架</button>{else}{if:OW.int("{$goods:is_book}")=1}<button type="button" class="btn-book" name="btn_book">立即预订</button>{else}{if:OW.int("{$goods:point_set}")=1}<button type="button" class="btn-exchange" name="btn_buy">立即兑换</button>{else}<button type="button" class="btn-buy-cart" name="btn_buy_cart">加入购物车</button><button type="button" class="btn-buy" name="btn_buy">立即购买</button>{/if}{/if}{/if}
        {else}
            <div class="ow-cannot-buy"><span class="tip-text">温馨提示：很抱歉，您现在的会员级别不能购买此商品。</span></div>
        {/if}
    </div>
</div>

<div class="ow-goods-fenxiao" style="display:none;">
    <a href="javascript::" class="close"></a>
    <dl class="qrcode-grid">
        <dt>商品分销二维码</dt>
        <dd><div class="qrcode" id="qrcode"></div></dd>
    </dl>
    <dl class="mytlink-grid">
        <dt>商品分销链接</dt>
        <dd><input type="text" class="myrlink" name="myrlink" readonly="readonly" value="" /></dd>
    </dl>
    <div class="tip">将以上二维码或链接分享到微信群和朋友圈，即可坐享佣金！</div>
</div>

<div class="pswp" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="pswp__bg"></div>
    <div class="pswp__scroll-wrap">
        <div class="pswp__container">
            <div class="pswp__item"></div>
            <div class="pswp__item"></div>
            <div class="pswp__item"></div>
        </div>
        <div class="pswp__ui pswp__ui--hidden">
            <div class="pswp__top-bar">
                <div class="pswp__counter"></div>
                <button class="pswp__button pswp__button--close" title="关闭"></button>
                <button class="pswp__button pswp__button--fs" title="全屏"></button>
                <button class="pswp__button pswp__button--zoom" title="放大/缩小"></button>
                <div class="pswp__preloader">
                    <div class="pswp__preloader__icn">
                      <div class="pswp__preloader__cut">
                        <div class="pswp__preloader__donut"></div>
                      </div>
                    </div>
                </div>
            </div>
            <div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap">
                <div class="pswp__share-tooltip"></div> 
            </div>
            <button class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)"></button>
            <button class="pswp__button pswp__button--arrow--right" title="Next (arrow right)"></button>
            <div class="pswp__caption">
                <div class="pswp__caption__center"></div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript" src="../js/photoswipe.min.js"></script>
<script type="text/javascript" src="../js/photoswipe-ui-default.min.js"></script>
<!--底部-->
<!--#include file="include.footer.html"-->
<script type="text/javascript">
function more(obj,id){};
function initPhotoSwipeFromDOM(gallerySelector){
	var parseThumbnailElements = function(el){
		var thumbElements = el.childNodes,
		numNodes          = thumbElements.length,
		items = [],figureEl,linkEl,size,item,divEl;
		for(var i=0; i<numNodes; i++){
			figureEl = thumbElements[i];
			if(figureEl.nodeType !== 1){
				continue;
			};
			divEl  = figureEl.children[0];
			linkEl = divEl.children[0];
			var $image = OW.loadImage(linkEl.children[0].getAttribute('src'));
			size = Array($image.width,$image.height);
			item = {
				src:linkEl.getAttribute('href'),
				w:parseInt(size[0], 10),
				h:parseInt(size[1], 10)
			};
			if(figureEl.children.length>1){
				item.title = figureEl.children[1].innerHTML; 
			};
			if(linkEl.children.length > 0){
				item.msrc = linkEl.children[0].getAttribute('src');
			};
			item.el = figureEl;
			items.push(item);
		};
		return items;
	};
	var closest = function closest(el, fn){
		return el && ( fn(el) ? el : closest(el.parentNode, fn) );
	};
	var onThumbnailsClick = function(e){
		e = e || window.event;
		e.preventDefault ? e.preventDefault() : e.returnValue = false;
		var eTarget     = e.target || e.srcElement,
		clickedListItem = closest(eTarget, function(el){
			return (el.tagName && el.tagName.toLowerCase() === 'figure');
		});
		if(!clickedListItem){
			return;
		};
		var clickedGallery = clickedListItem.parentNode,
			childNodes     = clickedListItem.parentNode.childNodes,
			numChildNodes  = childNodes.length,
			nodeIndex      = 0,
			index;
		for (var i=0; i<numChildNodes; i++){
			if(childNodes[i].nodeType !== 1){ continue; };
			if(childNodes[i] === clickedListItem){
				index = nodeIndex; break;
			};
			nodeIndex++;
		};
		if(index >= 0){ openPhotoSwipe( index, clickedGallery ); };
		return false;
	};
	var photoswipeParseHash = function(){
		var hash = window.location.hash.substring(1), params = {};
		if(hash.length < 5){ return params; };
		var vars = hash.split('&');
		for(var i=0; i<vars.length; i++){
			if(!vars[i]){
				continue;
			};
			var pair = vars[i].split('=');  
			if(pair.length < 2){ continue; };         
			params[pair[0]] = pair[1];
		};
		if(params.gid){ params.gid = parseInt(params.gid, 10); };
		return params;
	};
	var openPhotoSwipe = function(index, galleryElement, disableAnimation, fromURL){
		var pswpElement = document.querySelectorAll('.pswp')[0],gallery,options,
		items   = parseThumbnailElements(galleryElement);
		options = {
			barsSize: {top:100,bottom:100}, 
			fullscreenEl: false,
			shareButtons: [
				{id:'wechat',   label:'分享微信', url:'#'},
				{id:'weibo',    label:'新浪微博', url:'#'},
				{id:'download', label:'保存图片', url:'{{raw_image_url}}', download:true}
			],
			galleryUID: galleryElement.getAttribute('data-pswp-uid'),
			getThumbBoundsFn: function(index){
				var thumbnail = items[index].el.getElementsByTagName('img')[0],
				pageYScroll   = window.pageYOffset || document.documentElement.scrollTop,
				rect          = thumbnail.getBoundingClientRect(); 
				return {x:rect.left, y:rect.top + pageYScroll, w:rect.width};
			}
		};
		if(fromURL){
			if(options.galleryPIDs){
				for(var j = 0; j < items.length; j++){
					if(items[j].pid == index){ options.index = j; break; }
				};
			} else {
				options.index = parseInt(index,10) - 1;
			};
		}else{
			options.index = parseInt(index,10);
		};
		if(isNaN(options.index)){
			return;
		};
		if(disableAnimation){
			options.showAnimationDuration = 0;
		};
		gallery = new PhotoSwipe(pswpElement,PhotoSwipeUI_Default,items,options);
		gallery.init();
	};
	var galleryElements = document.querySelectorAll(gallerySelector);
	for(var i=0,l=galleryElements.length; i<l; i++){
		galleryElements[i].setAttribute('data-pswp-uid',i+1);
		galleryElements[i].onclick = onThumbnailsClick;
	};
	var hashData = photoswipeParseHash();
	if(hashData.pid && hashData.gid){openPhotoSwipe(hashData.pid,galleryElements[hashData.gid-1],true,true);}
};
</script>
<script type="text/javascript">
function commentType(type){
	var type = OW.int(type),text = "";
	if(type<=4){
		text = '<b class="cmt-type-c">差评</b>';
	}else if(type>=5 && type<=7){
		text = '<b class="cmt-type-b">中评</b>';
	}else if(type>=7){
		text = '<b class="cmt-type-a">好评</b>';
	};
	return text;
};
function changeGoodsImages(data){
	var i,data = OW.rep(data,"&quot;",'"'),
	jn         = OW.JSON.parse(data),
	$ul        = $("#gallery").find("ul");
	if(jn.length>0){
		OW.appendToString = "";
		for(i=0;i<jn.length;i++){
			OW.append('<li><figure><span><a href="'+ jn[i].url +'"><img src="'+ jn[i].url +'" alt="'+ jn[i].name +'" title="'+ jn[i].name +'" /></a></span></figure></li>');
		};
		$ul.html(OW.appendToString);
		TouchSlide({ 
			slideCell:"#gallery",
			titCell:".header ul",
			mainCell:".section ul",
			effect:"leftLoop",
			autoPage:true,
			autoPlay:true,
			interTime:3000
		});
	};
};
$(document).ready(function(){
	$(".ow-goods-content").find("img").each(function(){
		$(this).wrap("<figure><span><a href='"+$(this).attr("src")+"'></a></span></figure>");
	});
	//导航不浮动
	navFixing();
	//商品图片组
	if(OW.int($("#gallery").find("img").length)>0){
		TouchSlide({ 
			slideCell:"#gallery",
			titCell:".header ul",
			mainCell:".section ul",
			effect:"leftLoop",
			autoPage:true,
			autoPlay:true,
			interTime:5000
		});
	};
	//商品初始化
	OW.shop.pointSet = "{$goods:point_set}";
	OW.shop.pointPayAmount = "{$goods:point_pay_amount}";
	OW.shop.goodsInit({
		priceSection:$("[name='price']"),
		marketPriceSection:$("[name='market_price']"),
		myPriceSection:$("#my_price"),
		bookPriceSection:$("div[name='book_price_section']"),
		bookTimeSection:$("div[name='book_time_section']"),
		amountInput:$("input[name='amount_input']"),
		amountDecrease:$("a[name='amount_decrease']"),
		amountIncrease:$("a[name='amount_increase']"),
		specSection:$("div[name='goods_spec']"),
		stockTipSection:$("span[name='stock_tip']"),
		btnBook:$("[name='btn_book']"),
		btnBuy:$("[name='btn_buy']"),
		btnBuyCart:$("[name='btn_buy_cart']"),
		btnCart:$("[name='btn_cart']"),
		specImagesFun:function(imagesData){
			changeGoodsImages(imagesData);
			initPhotoSwipeFromDOM("[name='photo_gallery']");
		}
	});
	//规格初始化
	var $specUl = $("div[name='goods_spec']").find("ul");
	specUlNum   = $specUl.length;
	if(specUlNum>1){
		$specUl.each(function(){
			$(this).find("li:eq(0)>a").click();
		});
	}else{
		$("div[name='goods_spec']").find("li>a").each(function(){$(this).click();});
		$specUl.find("li:eq(0)>a").click();
	};
	//[切换]详细/咨询/评价
	TouchSlide({ 
		slideCell:"#details_section",
		titCell:"#tab_header ul li",
		mainCell:"#tab_content",
		titOnClassName:"current"
	});
	{if:OW.int("{$config(is_buy_record_show)}")=1}
	//成交记录初始化
	OW.shop.buyRecordInit({
		initGet:true,
		pageSize:10,
		pageTpl:"{prev}{current}{next}",
		tpl:"<tr><td>{$buyer}</td><td><ul><li>规格：{$spec_value}</li><li>数量：{$goods_amount}</li><li>时间：{$date}</li></ul></td></tr>",
		countSection:$("#buy_record_count"),//数据统计显示区
		listSection:$("#buy_record_list"),//数据显示区
		pagerSection:$("#buy_record_pager")//数据分页区
	});
	{/if}
	{if:OW.int("{$config(is_goods_consultation_show)}")=1}
	//咨询初始化
	var $form = $("#post_consultation_form");
	OW.shop.consultationInit({
		pageSize:10,
		pageTpl:"{prev}{current}{next}",
		//咨询输出模板
		tpl:"<div class='consult-data'><div class='cst-id'>{$cst_id}</div><div class='avatar'><img src='{$cst_author_avatar}' name='avatar' alt='{$cst_author}' /></div><div class='consult-data-content'><dl><dt><span class='author'>{$cst_author}</span><span class='datetime'>{$cst_date}</span></dt><dd>{$cst_content}</dd></dl></div></div><div class='consult-data consult-data-reply' name='consult_data_reply'><div class='avatar'><img src='{$reply_author_avatar}' name='avatar' alt='客服' /></div><div class='consult-data-content'><dl><dt><span class='servicer'>客服回复</span><span class='datetime'>{$reply_date}</span></dt><dd name='reply_content'>{$reply_content}</dd></dl></div></div>",
		countSection:$("#consultation_count"),//数据统计显示区
		listSection:$("#consultation_list"),//咨询数据显示区
		pagerSection:$("#consultation_pager"),//咨询数据分页区
		form:$form,
		vcodeValue:$form.find("input[name='verifycode_value']"),
		verifycode:$form.find("span[name='verifycode']"),
		submit:$form.find("button[name='btn_consult_submit']")
	});
	//删除没有回复的咨询回复
	$("[name='consult_data_reply']").each(function(){if(OW.isNull($(this).find("[name='reply_content']").html())){$(this).remove();}});
	{/if}
	{if:OW.int("{$config(is_goods_comments_show)}")=1}
	//评价
	OW.shop.commentInit({
		pageSize:10,
		pageTpl:"{prev}{current}{next}",
		//评价输出模板
		tpl:"<div class='comment-data'><div class='avatar'><img name='avatar' src='{$cmt_author_avatar}'><p class='user'>{$cmt_author}</p></div><div class='comment-data-content'><div class='cmt-header'><span class='cmt-spec' name='cmt_spec'>规格：<b name='spec_value'>{$spec_value}</b></span></div><div class='cmt-footer'><span class='cmt-time'>时间：<b>{$cmt_date}</b></span><span class='cmt-type'>评分：<b name='cmt_type' cmt_type='{$cmt_type}'></b></span></div><div class='cmt-content'>{$cmt_content}</div></div></div><div class='comment-data comment-data-reply' name='comment_data_reply'><div class='avatar'><img name='avatar' src='{$reply_author_avatar}'><p class='user'></p></div><div class='comment-data-content'><div class='cmt-header'>客服回复</div><div class='cmt-content' name='reply_content'>{$reply_content}</div></div></div>",
		countSection:$("#comment_count"),//数据统计显示区
		listSection:$("#comment_list"),//评价数据显示区
		pagerSection:$("#comment_pager")//评价数据分页区
	});
	//删除没有回复的评价回复
	$("[name='comment_data_reply']").each(function(){if(OW.isNull($(this).find("[name='reply_content']").html())){$(this).remove();}});
	$("[name='cmt_type']").each(function(){$(this).html(commentType($(this).attr("cmt_type")))});
	{/if}
	//处理预订进度条
	var $bookTimeSection = $("[name='book_time_section']");
	if($bookTimeSection.find("li").length==2){
		$bookTimeSection.find("li").css("width","50%");
	};
	if(!$("#tags").find("a").length>0){$("#tags").remove();};
	if(!$("#om_related_content").find("li").length>0){$("#om_related_content").remove();};
	if(!$("#om_related_goods").find("li").length>0){$("#om_related_goods").remove();};
	if(!$("#om_latestview_goods").find("li").length>0){$("#om_latestview_goods").remove();};
	$("#om_latestview_goods").find("li").each(function(i){
		var k = i+1 ;
		if(k%3==0){
			$(this).addClass("li3");
		};
	});
	//积分价格
	$(".price").each(function(){
		var price = OW.parseMoney($(this).find(".money > b").html());
		if(!price>0){
			$(this).find(".money").hide();
			$(this).find(".point > i").hide();
		};
	});
	//图片放大
	initPhotoSwipeFromDOM("[name='photo_gallery']");
});
</script>
<script type="text/javascript" src="../js/qrcode.js"></script>
<script type="text/javascript">
$(window).ready(function(){
	var $btnFenxiao = $("#btn_fenxiao"),
	$fenxiaoFrid    = $(".ow-goods-fenxiao"),
	fenxiaoURL      = OW.currentURL();
	var $qrcode = new QRCode(document.getElementById("qrcode"),{width:200,height:200});
	$qrcode.makeCode(fenxiaoURL);
	$fenxiaoFrid.find(".close").click(function(){$fenxiaoFrid.hide();});
	$fenxiaoFrid.find("input[name='myrlink']").focus(function(){$(this).select();}).val(fenxiaoURL);
	OW.valignCenter($fenxiaoFrid);
	$fenxiaoFrid.css("top",48+'px');
	$btnFenxiao.click(function(){$fenxiaoFrid.show();});
});
</script>
<% if OS.isJWeixinCanUse then %>
<%=OS.getWeixinTicket%>
<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
<script type="text/javascript">
wx.config({
    debug:false,appId:'<%=OS.weixinAppid%>',timestamp:'<%=OS.weixinTimestamp%>',nonceStr:'<%=OS.weixinNonceStr%>',signature:'<%=OS.weixinSignature%>',
    jsApiList: ['onMenuShareTimeline','onMenuShareAppMessage','onMenuShareQQ','onMenuShareQZone']
});
wx.ready(function(){
	var wxTitle = '{$title}',
	wxDesc      = '{$description}'
	wxLink      = OW.currentURL(),
	wxImgUrl    = '<%=OW.validImageUrl("{$goods:thumbnail}")%>';
	wx.onMenuShareTimeline({
		title:wxTitle,link:wxLink,imgUrl:wxImgUrl
	});
	wx.onMenuShareAppMessage({
		title:wxTitle,desc:wxDesc,link:wxLink,imgUrl:wxImgUrl
	});
	wx.onMenuShareQQ({
		title:wxTitle,desc:wxDesc,link:wxLink,imgUrl:wxImgUrl
	});
	wx.onMenuShareQZone({
		title:wxTitle,desc:wxDesc,link:wxLink,imgUrl:wxImgUrl
	});
});
</script>
<% end if %>
</body>
</html>
