<?php if(!defined('IN_SDCMS')) exit;?>{include file="top.php"}
<title>{if !isempty($seotitle)}{$seotitle}{else}{$title}{/if}_{if $page>1}第{$page}页_{/if}{$catename}_{sdcms[web_name]}</title>
<meta name="keywords" content="{if !isempty($seokey)}{$seokey}{else}{$title}{/if}">
<meta name="description" content="{if !isempty($seodesc)}{$seodesc}{else}{$title}{/if}">
</head>

<body>

    {include file="head.php"}
    
    <div class="banner_inner" style="background:url({get_cate_self($mycatepic,$topid,'mycatepic',WEB_ROOT.'theme/20170105/images/b00.jpg')}) no-repeat center;">      
    </div>

    <div class="width container">
    	<div class="lefter">
        	<div class="left_title mts">
            	<h3>{get_catename($topid)}</h3>
                <p>{get_cate_self($mycateename,$topid,'mycateename','')}</p>
            </div>
            <div class="left_border">
                <ul>
                    {sdcms:rp top="0" table="sd_category" where="followid=$topid" order="catenum,cateid"}
                    {rp:eof}<li class="hover"><a href="{cateurl($topid)}">{get_catename($topid)}</a></li>{/rp:eof}
                    {php $sub_sonid=$rp[cateid]}
                    <li{is_active($rp[cateid],$parentid)}><a href="{cateurl($rp[cateid])}" title="{$rp[catename]}"><span class="am-icon-angle-right"></span>{$rp[catename]}</a></li>
                    {sdcms:rs top="0" table="sd_category" where="followid=$sub_sonid" order="catenum,cateid"}
                    <li class="small{is_active($rs[cateid],$parentid,' active')}"><a href="{cateurl($rs[cateid])}" title="{$rs[catename]}"{if $rs[isblank]==1} target="_blank"{/if}><span class="am-icon-angle-right"></span>{$rs[catename]}</a></li>
                    {/sdcms:rs}
                    {/sdcms:rp}
                </ul>
            </div>
            
            <div class="left_title mt20">
            	<h3>联系我们</h3>
                <p>Contact Us</p>
            </div>
            <div class="left_contact">
                {block("page_contact")}
            </div>
            
        </div>
        <div class="righter">
        	<div class="subject">
            	<div class="fl">{$catename}<span>{get_cate_self($mycateename,$topid,'mycateename','')}</span></div>
                <div class="fr">您的当前位置：<a href="{$webroot}">首页</a>{foreach $position as $rs} > <a href="{$rs['url']}" title="{$rs['url']}">{$rs['name']}</a>{/foreach}</div>
            </div>
        	<!---->
                {php $piclist=str_replace(PHP_EOL,'\n',$piclist)}
                {php $piclist=jsdecode($piclist)}
                <div class="pro_show">
                    <div class="left">
                        {if count($piclist)>0}
                        {php $big=reset($piclist)}
                        <div id="zoom_pic" class="big_pic zoom"><img src="{$big['image']}" alt="{$big['desc']}"></div>
                        <div class="thumb_pic">
                            <ul>
                                {php $step=0}
                                {foreach $piclist as $index=>$val}
                                {php $step++}
                                <li{if $step==1} class="active"{/if}><img src="{thumb($val['image'],60,60)}" data-url="{$val['image']}" alt="{$val['desc']}" width="60" height="60"></li>
                                {/foreach}
                            </ul>
                        </div>
                        {/if}
                    </div>
                    <div class="right">
                        <h1>{$title}</h1>
                        <hr>
                        {if strlen($intro)>0}
                        <h5>{$intro}</h5>
                        <hr>
                        {/if}
                        <ul class="attribute">
                            {foreach $field as $key=>$rs}
                            {if !empty($rs)}
                            <li><em>{$key}：</em>{$rs}</li>
                            {/if}
                            {/foreach}
                        </ul>
                        {if $price==0}
                        <div class="price">价格：<span>面议</span></div>
                        {else}
                        <div class="price">价格：<span>{$price}</span><em>元</em></div>
                        <div class="action">
                            <button class="ui-btn ui-btn-blue ui-modal-show" data-target="#my-inquiry">我要询价</button>
                            <button class="ui-btn ui-btn-yellow ui-ml ui-modal-show" data-target="#my-order">我要订购</button>
                        </div>
                        {/if}
                        {if count($tagslist)>0}
                    <div class="tags mt-20"><span class="ui-icon-tags"></span> 标签：{foreach $tagslist as $rs}<a href="{$rs['url']}" title="{$rs['name']}" target="_blank">{$rs['name']}</a>{/foreach}</div>
                    {/if}
                    </div>
                    <div class="clear"></div>
                </div>
                
                <div class="pro_intro">
                    <div class="tabs">
                        <ul>
                            <li class="hover"{if count($edata)>0} id="one1" onClick="setTab('one',1,2)"{/if}><a href="javascript:;">产品介绍</a></li>
                            {if count($edata)>0}
                            <li id="one2" onClick="setTab('one',2,2)"><a href="javascript:;">规格参数</a></li>{/if}
                        </ul>
                        <div class="clear"></div>
                    </div>
                    <div class="intro" id="con_one_1">
                        {$content}
                    </div>
                    <div class="intro dis" id="con_one_2">
                        <ul class="extend">
                            {foreach $edata as $key=>$rs}
                            <li><em>{$rs['field_title']}：</em>{if isset($extend[$rs['field_key']])}{$extend[$rs['field_key']]}{/if}</li>
                            {/foreach}
                        </ul>
                    </div>
                </div>
                {if count($tags)>0}
                <div class="h2"><span>相关产品</span></div>
                <div class="like_pro">
            	<ul>
                	{sdcms:rs top="9" table="sd_model_pro" join="left join sd_content on sd_model_pro.cid=sd_content.id" where="$like" order="ontop desc,ordnum desc,id desc"}
                    {rs:eof}暂无资料{/rs:eof}
                    <li>
                    	<a href="{$rs[link]}" title="{$rs[title]}"><div class="pic"><img src="{$rs[pic]}" alt="{$rs[title]}"></div><div class="title text-hide">{$rs[title]}</div></a>
                    </li>
                    {/sdcms:rs}
                </ul>
            	</div>
                {/if}
            <!---->
        </div>
        <div class="clear"></div>
    </div>
 
    {include file="foot.php"}
    	<div class="ui-modal" id="my-inquiry">
        <div class="ui-modal-header">
            <div class="ui-modal-title">我要询价</div>
            <div class="ui-modal-close ui-rotate">×</div>
        </div>
        <div class="ui-modal-body">
        	<!---->
            <form class="ui-form" id="form_inquiry" method="post">
                <div class="ui-form-group ui-row">
                    <label class="ui-col-3 ui-col-form-label ui-text-right">姓名：</label>
            		<div class="ui-col-9">
                    	<input type="text" name="truename" class="ui-form-ip" value="{$truename}" placeholder="请输入您的姓名" data-rule="姓名:required;">
                    </div>
                </div>
                <div class="ui-form-group ui-row">
                    <label class="ui-col-3 ui-col-form-label ui-text-right">手机号码：</label>
            		<div class="ui-col-9">
                    	<input type="text" name="mobile" maxlength="11" class="ui-form-ip" value="{$mobile}" placeholder="请输入您的手机号码" data-rule="手机号码:required;mobile;">
                    </div>
                </div>
                <div class="ui-form-group ui-row">
                    <label class="ui-col-3 ui-col-form-label ui-text-right">询价内容：</label>
            		<div class="ui-col-9">
                    	<textarea name="remark" class="ui-form-ip" rows="5" placeholder="请输入询价内容" data-rule="询价内容:required;"></textarea>
                    </div>
                </div>
                <div class="ui-form-group ui-row ui-mb-0">
                    <label class="ui-col-3 ui-col-form-label ui-text-right"></label>
            		<div class="ui-col-9">
                    	<input type="hidden" name="token" value="{$token}"><button type="submit" class="ui-btn ui-btn-blue">提交询价</button>
                    </div>
                </div>
            </form>
            <!---->
        </div>
    </div>
    {if $price>0}
    <div class="ui-modal" id="my-order">
        <div class="ui-modal-header">
            <div class="ui-modal-title">我要订购</div>
            <div class="ui-modal-close rotate">×</div>
        </div>
        <div class="ui-modal-body">
        	<!---->
            {if sdcms[web_order_login]==1 && USER_ID==0}
            	请先<a href="{N('login')}" class="ui-text-red ui-ml ui-mr">登录</a>或<a href="{N('reg')}" class="ui-text-red ui-ml ui-mr">注册</a>
            {else}
            <form class="ui-form" id="form_order" method="post">
                <div class="ui-form-group ui-row">
                    <label class="ui-col-3 ui-col-form-label ui-text-right">姓名：</label>
            		<div class="ui-col-9">
                    	<input type="text" name="truename" class="ui-form-ip" value="{$truename}" placeholder="请输入您的姓名" data-rule="姓名:required;">
                    </div>
                </div>
                <div class="ui-form-group ui-row">
                    <label class="ui-col-3 ui-col-form-label ui-text-right">手机号码：</label>
            		<div class="ui-col-9">
                    	<input type="text" name="mobile" maxlength="11" class="ui-form-ip" value="{$mobile}" placeholder="请输入您的手机号码" data-rule="手机号码:required;mobile;">
                    </div>
                </div>
                <div class="ui-form-group ui-row">
                    <label class="ui-col-3 ui-col-form-label ui-text-right">订购数量：</label>
            		<div class="ui-col-9">
                    	<input type="text" name="pronum" maxlength="6" class="ui-form-ip" placeholder="请输入订购数量" data-rule="订购数量:required;int;">
                    </div>
                </div>
                <div class="ui-form-group ui-row">
                    <label class="ui-col-3 ui-col-form-label ui-text-right">收货地址：</label>
            		<div class="ui-col-9">
                    	<input type="text" name="address" maxlength="255" class="ui-form-ip" value="{$address}" placeholder="请输入收货地址" data-rule="收货地址:required;">
                    </div>
                </div>
                <div class="ui-form-group ui-row">
                    <label class="ui-col-3 ui-col-form-label ui-text-right">备注：</label>
            		<div class="ui-col-9">
                    	<textarea name="remark" class="ui-form-ip" rows="5" placeholder="请输入备注，可以为空"></textarea>
                    </div>
                </div>
                <div class="ui-form-group ui-row ui-mb-0">
                    <label class="ui-col-3 ui-col-form-label ui-text-right"></label>
            		<div class="ui-col-9">
                    	<input type="hidden" name="token" value="{$token}"><button type="submit" class="ui-btn ui-btn-blue">提交订单</button>
                    </div>
                </div>
            </form>
            {/if}
            <!---->
        </div>
    </div>

    {/if}
	<script>
	$(function()
	{
		$("#form_inquiry").form(
		{
			type:2,
			align:'center',
			result:function(form)
			{
				$.ajax(
				{
					type:'post',
					cache:false,
					dataType:'json',
					url:'{U("other/inquiry/","id=".$id."","",1)}',
					data:$(form).serialize(),
					error:function(e){alert(e.responseText);},
					success:function(d)
					{
						if(d.state=='success')
						{
							sdcms.success(d.msg);
							$("#form_inquiry")[0].reset();
							$("#my-inquiry").modal('close');
						}
						else
						{
							sdcms.error(d.msg);
						}
					}
				});
			}
		});
		{if $price>0}
		$("#form_order").form(
		{
			type:2,
			align:'center',
			result:function(form)
			{
				$.ajax(
				{
					type:'post',
					cache:false,
					dataType:'json',
					url:'{U("other/order/","id=".$id."","",1)}',
					data:$(form).serialize(),
					error:function(e){alert(e.responseText);},
					success:function(d)
					{
						if(d.state=='success')
						{
							location.href=d.msg;
						}
						else
						{
							sdcms.error(d.msg);
						}
					}
				});
			}
		});
		{/if}
	})
	</script>
</body>
</html>