<?php if (!defined('THINK_PATH')) exit(); /*a:1:{s:71:"/www/wwwroot/10.168.1.202/public/../app/index/view/index/api_index.html";i:1611035162;}*/ ?>

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title><?php echo $web_config['web_site']; ?> - 6gym.com 6G源码 </title>
    <link rel="stylesheet" href="/static/assets/libs/layui/css/layui.css"/>
    <link rel="stylesheet" href="/static/assets/module/admin.css?v=318"/>
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->

</head>
<body>
<!-- 正文开始 -->
<div class="layui-fluid ew-console-wrapper">
    <div class="layui-row layui-col-space15">
       <div class="layui-col-xs12 layui-col-md4">
      <!-- 填充内容 -->
      <div class="layui-card layui-form-pane">
        <div class="layui-card-header">我的接口信息</div>
        <div class="layui-card-body">
            <div class="layui-form-item">
    <label class="layui-form-label">商户PID</label>
    <div class="layui-input-block">
      <input type="text" name="pid" value="<?php echo $user_pid; ?>" autocomplete="off" placeholder="商户PID" class="layui-input" readonly onclick="fuzhi(this)">
    </div>
  </div>
  
  <div class="layui-form-item">
    <label class="layui-form-label">商户KEY</label>
    <div class="layui-input-block">
      <input type="text" name="key" id="key_id" value="***已隐藏***" autocomplete="off" placeholder="商户KEY" class="layui-input" readonly onclick="fuzhi(this)">
    </div>
  </div>
  
 
        <input type="button" class="layui-btn layui-btn-xs" value="显示商户KEY" id="displaykey" style="border: none;outline:none;" />
        <input type="button" id="GeneratingKey" value="重新生成商户KEY" class="layui-btn layui-btn-danger layui-btn-xs" style="border: none;outline:none;" />
        </div>
      </div>
      
       
      
       <div class="layui-card">
        <div class="layui-card-header">支付网关网址</div>
        <div class="layui-card-body">
            
        <input type="text" style="margin-top:5px" value="<?php echo $web_pay1; ?>" autocomplete="off" placeholder="网关网址" class="layui-input" readonly onclick="fuzhi(this)">
            
            
        </div>
      </div>
    </div>
    
    <div class="layui-col-xs12 layui-col-md8">
      <!-- 填充内容 -->
      <div class="layui-card">
        <div class="layui-card-header">接口文档</div>
        <div class="layui-card-body">
           <?php echo $news_txt; ?>
        </div>
      </div>
    </div>
        
    </div>
    
   
</div>
<!-- js部分 -->
<script type="text/javascript" src="/static/assets/libs/layui/layui.js"></script>
<script type="text/javascript" src="/static/assets/js/common.js?v=318"></script>
<script>
    layui.use(['layer', 'form','admin','table', 'util', 'dropdown','baseTable'], function () {
        var $ = layui.jquery;
        var layer = layui.layer;
        var form = layui.form;
        var table = layui.table;
        var util = layui.util;
        var dropdown = layui.dropdown;
        var admin = layui.admin;
       
        
        
        $('#displaykey').click(function () {
        	$('#key_id').val("<?php echo $user_key; ?>");
        	$('#displaykey').remove();
        });
        
        $('#GeneratingKey').click(function () {
        	 admin.confirm('你真的要重新生成key吗？这样会造成已对接过的网站发起支付和异步通知失败！', {
		            btn: ['确认','取消'] //按钮
		            }, function(){
		         	    layer.load(4, {shade: [0.6,'#fff']});
			            $.get('<?php echo url("index/GeneratingKey"); ?>', function(result){
      		               if(result.code == '0'){
       		    	       layer.closeAll('loading');
       		    	       layer.msg(result.msg, {icon: 1});
       		    	       $('#key_id').val(result.result);
       		    	       $('#displayKey').remove();
              		 }else{
					//请求失败
               			layer.closeAll('loading');
                    	layer.msg(result.msg, {icon: 2});
                   }
    		  });
		});
        });
       

    });
    
    function fuzhi(s) {
            s.select(); // 选择对象
            document.execCommand("Copy"); // 执行浏览器复制命令
            layer.msg("复制成功！");
    }
    
   
</script>


</body>
</html>
