{template "header.html"}
<div class="note note-danger">
    <p><a href="javascript:dr_update_cache();">{dr_lang('更改数据之后需要更新缓存之后才能生效')}</a></p>
</div>
<form action="" class="form-horizontal" method="post" name="myform" id="myform">
    {$form}
    <div class="portlet bordered light myfbody">
        <div class="portlet-title tabbable-line">
            <ul class="nav nav-tabs" style="float:left;">
                <li class="{if $page==0}active{/if}">
                    <a href="#tab_0" data-toggle="tab" onclick="$('#dr_page').val('0')"> <i class="fa fa-cog"></i> {dr_lang('常用设置')} </a>
                </li>
                <li class="{if $page==1}active{/if}">
                    <a href="#tab_1" data-toggle="tab" onclick="$('#dr_page').val('1')"> <i class="fa fa-table"></i> {dr_lang('选项参数')} </a>
                </li>
                <li class="{if $page==2}active{/if}">
                    <a href="#tab_2" data-toggle="tab" onclick="$('#dr_page').val('2')"> <i class="fa fa-code"></i> {dr_lang('运输设置')} </a>
                </li>
            </ul>
        </div>
        <div class="portlet-body">
            <div class="tab-content">

                <div class="tab-pane {if $page==2}active{/if}" id="tab_2">
                    <div class="form-body">
                        <div class="form-group">
                            <label class="col-md-2 control-label">授权密匙(Key)</label>
                            <div class="col-md-9">
                                <input class="form-control" type="text" name="data[kuaidi_id]" value="{$data['kuaidi_id']}" >
                                <span class="help-block"><a href="https://www.kuaidi100.com/openapi/applyapi.shtml" target="_blank">{dr_lang('免费申请快递查询接口')}</a></span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-md-2 control-label">{dr_lang('退换货地址')}</label>
                            <div class="col-md-9">
                                <textarea class="form-control" name="data[tui_address]" rows="5">{$data[tui_address]}</textarea>
                            </div>
                        </div>

                    </div>

                </div>

                <div class="tab-pane {if $page==0}active{/if}" id="tab_0">
                    <div class="form-body">
                        <div class="form-group">
                            <label class="col-md-2 control-label">{dr_lang('收货地址')}</label>
                            <div class="col-md-9">
                                <input type="checkbox" name="data[buy_address]" value="1" {if $data['buy_address']}checked{/if} data-on-text="{dr_lang('开启')}" data-off-text="{dr_lang('关闭')}" data-on-color="success" data-off-color="danger" class="make-switch" data-size="small">

                                <span class="help-block">{dr_lang('关闭之后下单时不出现收货人地址选项')}</span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-md-2 control-label">{dr_lang('交易流程')}</label>
                            <div class="col-md-9">
                                <label>
                                    <select class="form-control" name="data[buy_step]">
                                        <option value="0" {if !$data.buy_step}selected=""{/if}>付款→发货→收货→完成</option>
                                        <option value="1" {if 1 == $data.buy_step}selected=""{/if}>付款→收货→完成</option>
                                        <option value="2" {if 2 == $data.buy_step}selected=""{/if}>付款→发货→完成</option>
                                        <option value="3" {if 3 == $data.buy_step}selected=""{/if}>付款→完成</option>
                                    </select>
                                </label>
                                <span class="help-block">{dr_lang('可根据商品的实际情况选择一种交易模式')}</span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-md-2 control-label">{dr_lang('付款超时时间')}</label>
                            <div class="col-md-9">
                                <label><input class="form-control" type="text" name="data[pay_endtime]" value="{$data['pay_endtime']}" ></label>
                                <span class="help-block">{dr_lang('单位秒，0表示不超时，超时之后自动关闭订单')}</span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-md-2 control-label">{dr_lang('发货超时时间')}</label>
                            <div class="col-md-9">
                                <label><input class="form-control" type="text" name="data[deliver_endtime]" value="{$data['deliver_endtime']}" ></label>
                                <span class="help-block">{dr_lang('单位秒，0表示不超时，超时之后自动对买家退款')}</span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-md-2 control-label">{dr_lang('收货超时时间')}</label>
                            <div class="col-md-9">
                                <label><input class="form-control" type="text" name="data[receipt_endtime]" value="{$data['receipt_endtime']}" ></label>
                                <span class="help-block">{dr_lang('单位秒，0表示不超时，超时之后自动确定收货')}</span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-md-2 control-label">{dr_lang('售后发起时间')}</label>
                            <div class="col-md-9">
                                <label><input class="form-control" type="text" name="data[service_endtime]" value="{$data['service_endtime']}" ></label>
                                <span class="help-block">{dr_lang('单位天，0表示不限制，超时之后无法发起售后申请')}</span>
                            </div>
                        </div>
                        <div class="form-group hide">
                            <label class="col-md-2 control-label">{dr_lang('付款之后跳转')}</label>
                            <div class="col-md-7">
                                <input class="form-control" type="text" name="data[pay_url]" value="{$data['pay_url']}" >
                                <span class="help-block">{dr_lang('付款成功后跳转的页面地址，不填写默认跳转到订单详情页')}</span>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="tab-pane {if $page==1}active{/if}" id="tab_1">
                    <div class="form-body">
                        <div class="form-group">
                            <label class="col-md-2 control-label">{dr_lang('关闭订单理由')}</label>
                            <div class="col-md-9">
                                <textarea class="form-control" rows="8" name="data[data_close]">{$data['data_close']}</textarea>
                                <span class="help-block">{dr_lang('回车换行符号分隔多条数据')}</span>
                            </div>
                        </div>
                    </div>
                    <div class="form-body">
                        <div class="form-group">
                            <label class="col-md-2 control-label">{dr_lang('订单退款理由')}</label>
                            <div class="col-md-9">
                                <textarea class="form-control" rows="8" name="data[data_refund]">{$data['data_refund']}</textarea>
                                <span class="help-block">{dr_lang('回车换行符号分隔多条数据')}</span>
                            </div>
                        </div>
                    </div>
                    <div class="form-body">
                        <div class="form-group">
                            <label class="col-md-2 control-label">{dr_lang('常用短信内容')}</label>
                            <div class="col-md-9">
                                <textarea class="form-control" rows="8" name="data[data_sms]">{$data['data_sms']}</textarea>
                                <span class="help-block">{dr_lang('回车换行符号分隔多条数据')}</span>
                            </div>
                        </div>
                    </div>
                </div>

            </div>
        </div>
    </div>

    <div class="portlet-body form myfooter">
        <div class="form-actions text-center">
            <button type="button" onclick="dr_ajax_submit('{dr_now_url()}&page='+$('#dr_page').val(), 'myform', '2000')" class="btn green"> <i class="fa fa-save"></i> {dr_lang('保存')}</button>
        </div>
    </div>
</form>

{template "footer.html"}