{extend name='base'/}
{block name='style'}
<style>
    .result {
        background-color: white;
        padding: 50px;
    }

    h3.text-danger {
        margin-bottom: 10px;
    }
    .container{
        max-width: 800px;
    }
    .tishi{
        margin:20px 0px;
        padding:5px 10px;
    }
    .t{
        margin-bottom: 10px;
    }
</style>
{/block}
{block name='main'}
<section class="software_banner banner_pad">
    <div class="container">
        <div class="panel panel-default">
            <div class="panel-body">
                <form action="/web/query" method="get">
                <div class="input-group" style="margin-top:15px">
                    <input type="text" id="keywords" name="trade_no" class="form-control" value="{$trade_no}" placeholder="请输入订单号">
                    <span class="input-group-btn">
                        <button class="btn btn-default">查询</button>
                    </span>
                </div>
                </form>

                <p class="tishi bg-warning">
                    每个订单号查询前3次为实时数据，3次以后3分钟更新一次订单数据
                </p>
                <div class="well">
                    {if !empty($order)}
                    <div class="t">
                        <small class="text-danger">商品名:{$order->name}</small>
                        <small>状态:{$order->statusText['text']}</small>
                        <span class="label label-{$order->statusText['style']}">{$order->statusText['text']}</span>
                    </div>

                        {if $order->status == 1}
                            {if $order->goods_type == 0 }
                            <div class="alert alert-success" role="alert">
                                你的连接为：{$order->url}
                            </div>
                            {/if}
                            {if $order->goods_type == 1}
                            <p>
                                {$order->goods->html|raw}
                            </p>
                            {/if}
                            {if $order->goods_type == 2}
                            <ul class="list-group">
                                <li class="list-group-item">卡密：{$order->card->card_no} </li>
                                <!--<li class="list-group-item">卡密：{$order->card->card_pass}</li>-->
                            </ul>
                            {/if}
                        {/if}
                    {else /}
                        未查询到任何信息
                    {/if}
                </div>
            </div>
        </div>

    </div>
</section>
{/block}
{block name='script'}
<script>
    $(function(){
        $("#submit").on('click',function(){
            console.log('dd');
            $("form").attr('action','/web/query/'+$("#keywords").val());
            $("form").submit();
        })
    })
</script>
{/block}
