<?php if(!defined('IN_SDCMS')) exit;?>{include file="mobile/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}">
{include file="mobile/wxshare.php"}
</head>

<body>
	{include file="mobile/head.php"}
    <article>
    	<section>
            <div class="pro_show">
                {php $piclist=jsdecode($piclist)}
                {if count($piclist)>0}                
                <div class="banner">
                    <div class="ui-carousel" data-arrow="false" data-page="true">
                        <div class="ui-carousel-inner">
                            {php $step=0}
                            {foreach $piclist as $index=>$val}
                            {php $step++}
                            <div class="ui-carousel-item{if $step==1} active{/if}"><a href="{$val['image']}" class="lightbox" title="{$val['desc']}"><img src="{$val['image']}" alt="{$val['desc']}"></a></div>
                            {/foreach}
                        </div>
                    </div>
                </div>

                {/if}
                <h1>{$title}</h1>
                {if $price!=0}
                <div class="price">价格：<span>{$price}</span><em>元</em></div>
                {else}
                <div class="price">价格：<span>面议</span></div>
                {/if}
                {if strlen($intro)>0}
                <div class="intro">
                {$intro}
                </div>
                {else}
                <hr>
                {/if}
                <ul class="attribute">
                    {foreach $field as $key=>$rs}
                    {if !empty($rs)}
                    <li><em>{$key}：</em>{$rs}</li>
                    {/if}
                    {/foreach}
                </ul>
            </div>
        </section>

        <section>
        	<div class="subject">
                <b>产品介绍</b>
            </div>
            <div class="clear"></div>
            <div class="news_show">
                <div class="intro">
                    {$content}
                    <div class="clear"></div>
                </div>
                {if count($tagslist)>0}
                <div class="tags"><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>
        </section>
        {if count($edata)>0}
        <section>
        	<div class="subject">
                <b>规格参数</b>
            </div>
            <div class="clear"></div>
            <div class="pro_show">
                <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>
        </section>
        {/if}
        {if count($tags)>0}
        <section>
        	<div class="subject">
                <b>相关内容</b>
            </div>
            <div class="clear"></div>
            <div class="home_pro">
            <ul>
               {sdcms:rs top="6" 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><img src="{thumb($rs[pic],280,280)}" alt="{$rs[title]}"></div><p class="title">{$rs[title]}</p><p class="price"><span>人气：{$rs[hits]}</span>¥ {$rs[price]}</p></a></li>
               {/sdcms:rs}
             </ul>
             <div class="clear"></div>
        </section>
        {/if}
    </article>
    
    <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 ui-rotate">×</div>
        </div>
        <div class="ui-modal-body">
        	<!---->
            {if sdcms[web_order_login]==1 && USER_ID==0}
            	请先<a href="{N('login')}" class="ui-text-blue ui-ml ui-mr">登录</a>或<a href="{N('reg')}" class="ui-text-blue 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}
	
	<div class="ui-footbar ui-fixed-bottom ui-mwidth">
		<div class="ui-footbar-left">
			<a href="{$webroot}"><i class="ui-icon-home"></i>首页</a>
		</div>
		<div class="ui-footbar-right">
			<a href="javascript:;" class="ui-modal-show" data-target="#my-inquiry">询价</a>
			{if $price>0}<a href="javascript:;" class="ui-modal-show" data-target="#my-order">订购 <sub>￥</sub>{$price}</a>{/if}
		</div>
	</div>
	<script src="{WEB_ROOT}public/js/jquery.js"></script>
	<script src="{WEB_ROOT}public/js/ui.js"></script>
	<script src="{WEB_THEME}mobile/js/cms.js"></script>
	<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>