<!--{include file="<!--{$oetplpath}-->block_head.tpl"}-->

<!--{if $a == "run"}-->
<div class="layui-fluid oe_fluid">

  <form class="layui-form" id="mysearch" action="<!--{$oefile}-->&c=<!--{$c}-->" method="post">
  <div class="oe_breadcrumb_box clearfix">
    <div class="layui-breadcrumb fl" lay-filter="breadcrumb" style="visibility: visible;">
      <a href="javascript:;">系统配置</a><span lay-separator="">/</span>
      <a href="javascript:;">接口设置</a><span lay-separator="">/</span>
      <a><cite>支付接口</cite></a>
    </div>
    
  </div>
  <!--//Top End -->
  
  <div class="oe_searchbar layui-form">
    <div class="more_search_open"></div>
    <div class="layui-form-item">
      <div class="layui-inline">
        <div class="layui-form-label">标题：</div>
        <div class="layui-input-inline">
          <input type="text" name="stitle" id="stitle" value="<!--{$stitle}-->" class="layui-input">
        </div>
      </div>
      <div class="layui-inline">
        <div class="layui-form-label">接口名：</div>
        <div class="layui-input-inline">
          <input type="text" name="ssdkname" id="ssdkname" value="<!--{$ssdkname}-->" class="layui-input">
        </div>
      </div>
      
      <div class="layui-inline">
        <button class="layui-btn layui-btn-sm search" id="but_submit_search2" lay-submit lay-filter="searchform2">
          <i class="layui-icon layui-icon-search"></i>
          搜索
          <span class="oe_btn_loading layui-anim layui-icon layui-anim-rotate layui-anim-loop" style="display:none;">&#xe63d;</span>
        </button>
      </div>

    </div>
  </div>
  <!--//search End -->
  </form>

  <div class="oe_table_wrap layui-form">
  
    <table class="layui-table">
      <thead>
        <tr>
          <th width="8%">ID</th>
          <th width="15%">图标</th>
          <th width="15%">标题</th>
          <th width="12%">接口</th>
          <th width="10%">适用于</th>
          <th width="15%">商户ID</th>
          <th width="8%">状态</th>
          <th width="8%">排序</th>
          <th>操作</th>
        </tr> 
      </thead>
      
      <!--{if empty($paysdk)}-->
      <tr>
        <td colspan="9" class="text_center">没有符合条件的信息</td>
      </tr>
      <!--{else}-->
      <!--{foreach $paysdk as $volist}-->
      <tr>
        <td class="text_center"><!--{$volist.sdkid}--></td>
        <td class="text_center"><img src="<!--{$urlpath}--><!--{$volist.logo}-->" /></td>
        <td class="text_center"><!--{$volist.title}--></td>
        <td class="text_center"><!--{$volist.sdkname}--></td>
        <td class="text_center">
          <!--{if $volist.type == 'pc'}-->
          <font color="blue">电脑<font>
          <!--{else}-->
          <font color="orange">手机WAP</font>
          <!--{/if}-->
        </td>
        <td class="text_center"><!--{$volist.merchantpid}--></td>
        <td class="text_center">
        <!--{if $volist.flag=='1'}-->
          <font color="green">开启</font>
        <!--{else}-->
          <font color="gray">关闭</font>
        <!--{/if}-->
        </td>
        <td class="text_center"><!--{$volist.orders}--></td>
        <td class="text_center">
          <div class="btn_box">
            <a href="<!--{$oefile}-->&c=<!--{$c}-->&a=edit&id=<!--{$volist.sdkid}-->&<!--{$comeurl}-->" class="layui-btn layui-btn-xs layui-btn-normal">编辑</a>
          </div>
        </td>
      </tr>
      <!--{/foreach}-->
      <!--{/if}-->
      
      <tr>
        <td>&nbsp;</td>
        <td colspan="8">
          <div class="oe_weixin_paytips">
            <img src="<!--{$urlpath}-->tpl/static/netpay/logos/pay_weixin.png" />温馨提示：微信支付设置请移步 
            <a class="layui-btn layui-btn-xs" href="<!--{$oefile}-->&c=setting&a=weixin" >去设置</a>
          </div>
        </td>
      </tr>
    </table>
    
    <div class="oe_page_box"><!--{$showpage}--></div>
    
  </div>
</div>
<!--{/if}-->

<!--{if $a == "edit"}-->
<div class="layui-fluid oe_fluid">

  <div class="oe_breadcrumb_box clearfix">
    <div class="layui-breadcrumb fl" lay-filter="breadcrumb" style="visibility: visible;">
      <a href="javascript:;">系统配置</a><span lay-separator="">/</span>
      <a href="javascript:;">接口设置</a><span lay-separator="">/</span>
      <a><cite>支付接口</cite></a>
    </div>
    <div class="oe_tool_bar ft">
      <button class="layui-btn layui-btn-sm layui-btn-radius" id="but_submit_post2" lay-submit lay-filter="editform">
        编辑保存
        <span class="oe_btn_loading layui-anim layui-icon layui-anim-rotate layui-anim-loop" style="display:none;">&#xe63d;</span>
      </button>
      <span class="layui-btn layui-btn-sm layui-btn-primary layui-btn-radius"><a href="<!--{$oefile}-->&c=<!--{$c}-->&<!--{$comeurl}-->">返回列表</a></span>
    </div>
  </div>
  
  <form class="layui-form" id="myform" action="<!--{$oefile}-->&c=<!--{$c}-->&<!--{$comeurl}-->" method="post">
  <input type="hidden" name="a" id="a" value="saveedit" />
	<input type="hidden" name="id" id="id" value="<!--{$id}-->" />
  <div class="layui-card">
    <div class="layui-card-header">编辑接口</div>
    <div class="layui-card-body">
      <table class="oe_tbl_form layui-form">
        <tr>
          <th width="15%">支付接口：</th>
          <td width="85%">
            <!--{$paysdk.sdkname}-->
            <!--{if $paysdk.type == 'pc'}-->
            <font color="blue">（适用于电脑PC）</font>
            <!--{else}-->
            <font color="orange">（适用于手机WAP）</font>
            <!--{/if}-->
          </td>
        </tr>
        <tr>
          <th>标题名称：</th>
          <td>
            <input type="text" name="title" id="title" class="layui-input input-300" value="<!--{$paysdk.title}-->" />
          </td>
        </tr>
        <tr>
          <th>商户ID：</th>
          <td>
            <input type="text" name="merchantpid" id="merchantpid" class="layui-input input-300" value="<!--{$paysdk.merchantpid}-->" />
          </td>
        </tr>
        
        <!--{if $paysdk.sdkname == 'wapyjpay'}-->
        <tr>
          <th>商户RSA私钥：</th>
          <td>
            <textarea name="yjpayprivatekey" id="yjpayprivatekey" class="layui-textarea" style="width:50%;height:60px;"><!--{$paysdk.yjpayprivatekey}--></textarea>
          </td>
        </tr>
        <tr>
          <th>商户RSA公钥：</th>
          <td>
            <textarea name="yjpaypublickey" id="yjpaypublickey" class="layui-textarea" style="width:50%;height:60px;"><!--{$paysdk.yjpaypublickey}--></textarea>
          </td>
        </tr>
        <tr>
          <th>易宝RSA公钥：</th>
          <td>
            <textarea name="yeepaypublickey" id="yeepaypublickey" class="layui-textarea"  style="width:50%;height:60px;"><!--{$paysdk.yeepaypublickey}--></textarea>
          </td>
        </tr>
        <!--{else}-->
        <tr>
          <th>支付密钥：</th>
          <td>
            <input type="text" name="privatekey" id="privatekey" class="layui-input input-300" value="<!--{$paysdk.privatekey}-->" />
          </td>
        </tr>
        <tr>
          <th>收款帐号：</th>
          <td>
            <input type="text" name="merchantaccount" id="merchantaccount" class="layui-input input-300" value="<!--{$paysdk.merchantaccount}-->" /> 
            <span class="text_tip_inline">（支付宝接口需填写此项）</span>
          </td>
        </tr>
        <!--{/if}-->
        
        <tr>
          <th>支付费率：<span class="f_red"></span></th>
          <td>
            <input type="text" name="payrate" id="payrate" class="layui-input input-80" value="<!--{$paysdk.payrate}-->" /> %
            <span class="text_tip_inline">（不填写表示无费率）</span>
          </td>
        </tr>
        <tr>
          <th>排序：<span class="f_red"></span></th>
          <td>
            <input type="text" name="orders" id="orders" class="layui-input input-80" value="<!--{$paysdk.orders}-->" />
          </td>
        </tr>
        <tr>
          <th>状态：<span class="f_red"></span></th>
          <td>
            <input type="radio" name="flag" value="1" title="开启"<!--{if $paysdk.flag == '1'}--> checked<!--{/if}--> />
            <input type="radio" name="flag" value="0" title="关闭"<!--{if $paysdk.flag == '0'}--> checked<!--{/if}--> />
          </td>
        </tr>
        <tr>
          <th>描述说明：</th>
          <td>
            <textarea name="intro" id="intro" class="layui-textarea" style="width:50%;height:60px;"><!--{$paysdk.intro}--></textarea>
          </td>
        </tr>
      </table>
    </div>
  </div>
  </form>
  
  <div class="oe_tbl_form_btn">
    <button class="layui-btn" id="but_submit_post" lay-submit lay-filter="editform">
      编辑保存
      <span class="oe_btn_loading layui-anim layui-icon layui-anim-rotate layui-anim-loop" style="display:none;">&#xe63d;</span>
    </button>
  </div>
  
</div>
<script type="text/javascript">
$(function(){

    layui.use('form', function(){
        $form = layui.form;
        //保存...
        $form.on('submit(editform)', function(data){
            $obj_id = data.elem.getAttribute("id");
            if (!$("#"+$obj_id).hasClass("forbid_submit")) {                
                $("#"+$obj_id).addClass("forbid_submit");
                if ($("#"+$obj_id).find("span").length > 0) {
                    $("#"+$obj_id).find("span").show();
                }
                //...
                $("#myform").submit();
            }
        });   
    });
    
});
</script>
<!--{/if}-->
</body>
</html>