<!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,user-scalable=no,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0">
<title>{echo admin_title()}</title>
<!--header-->
{template _:header}
</head>
<body>
<div class="layui-layout layui-layout-admin">
<!--top-->
{template _main_top}
<!--nav-->
{template _main_nav}
	<div class="position"><h1>支付宝</h1></div>
	<div class="layui-body admin-body">
		<div class="admin-content">
			<div class="layui-tab layui-tab-brief" lay-filter="gate">
				<ul class="layui-tab-title layui-tab-links">
					<li class="<!--{if request()->action() == 'index'}-->layui-this<!--{/if}-->"><a href="{echo url('PayAlipay/index')}">参数配置</a></li>
					<li class="<!--{if request()->action() == 'merchant'}-->layui-this<!--{/if}-->"><a href="{echo url('PayAlipay/merchant')}">商户入网</a></li>
				</ul>
				<div class="layui-tab-content">
					<form name="form_alipay" id="form_alipay" method="post" action="{echo \befen\get_url()}">
					<table class="layui-table">
						<tbody>
							<tr>
								<td class="td1">系统服务商(PID)</td>
								<td class="td2"><input type="text" name="sys_service_provider_id" id="sys_service_provider_id" class="layui-input" value="{$config_alipay[sys_service_provider_id]}" placeholder=""></td>
							</tr>
							<tr>
								<td class="td1">第三方应用(AppID)</td>
								<td class="td2"><input type="text" name="appId" id="appId" class="layui-input" value="{$config_alipay[appId]}" placeholder=""></td>
							</tr>
							<tr>
								<td class="td1">商户授权令牌(app_auth_token)</td>
								<td class="td2">
									<div class="layui-input-inline" style="width:100%;"><input type="text" name="merchant_name" id="merchant_name" class="layui-input" value="{echo input('param.merchant_name')}" placeholder="商户名称"></div>
								</td>
							</tr>
							<tr>
								<td class="td1">签名类型</td>
								<td class="td2">
									<input type="radio" name="rsa_Type" class="radio" id="rsaType_key" value="key" <!--{if $config_alipay['rsaType'] != 'cert'}-->checked<!--{/if}--> /> <label for="rsaType_key" style="cursor:pointer;">公钥</label>&nbsp;&nbsp;
									<input type="radio" name="rsa_Type" class="radio" id="rsaType_cert" value="cert" <!--{if $config_alipay['rsaType'] == 'cert'}-->checked<!--{/if}--> /> <label for="rsaType_cert" style="cursor:pointer;">证书</label>&nbsp;&nbsp;
								</td>
							</tr>
							<tr>
								<td class="td1">应用私钥<br />rsaPrivateKey.pem</td>
								<td class="td2"><textarea name="rsaPrivateKey_body" id="rsaPrivateKey_body" class="layui-textarea">{$rsaPrivateKey_body}</textarea></td>
							</tr>
							<tr>
								<td class="td1">应用公钥<br />rsaPublicKey.pem</td>
								<td class="td2"><textarea name="rsaPublicKey_body" id="rsaPrivateKey_body" class="layui-textarea">{$rsaPublicKey_body}</textarea></td>
							</tr>
							<tr>
								<td class="td1">支付宝公钥<br />alipayrsaPublicKey.pem</td>
								<td class="td2"><textarea name="alipayrsaPublicKey_body" id="alipayrsaPublicKey_body" class="layui-textarea">{$alipayrsaPublicKey_body}</textarea></td>
							</tr>
							<!--
							<tr>
								<td class="td1">应用证书<br />appCertPath.pem</td>
								<td class="td2"><textarea name="appCertPath_body" id="appCertPath_body" class="layui-textarea">{$appCertPath_body}</textarea></td>
							</tr>
							<tr>
								<td class="td1">公钥证书<br />alipayCertPath.pem</td>
								<td class="td2"><textarea name="alipayCertPath_body" id="alipayCertPath_body" class="layui-textarea">{$alipayCertPath_body}</textarea></td>
							</tr>
							<tr>
								<td class="td1">支付宝根证书<br />alipayRootCertPath.pem</td>
								<td class="td2"><textarea name="alipayRootCertPath_body" id="alipayRootCertPath_body" class="layui-textarea">{$alipayRootCertPath_body}</textarea></td>
							</tr>
							-->
							<tr>
								<td class="td1">&nbsp;</td>
								<td class="td2">
									<button type="submit" name="submit_alipay" value="submit_alipay" id="submit_alipay" class="layui-btn">提交</button>
									<button type="reset" id="reset" class="layui-btn layui-btn-primary">重置</button>
								</td>
							</tr>
						</tbody>
					</table>
					</form>
				</div>
			</div>
		</div>
	</div>
</div>
<!--footer-->
{template _:footer}
<script type="text/javascript">
layui.use("element", function(){
	var element = layui.element;
	element.on("tab(gate)", function(elem){

	});
});
$("#submit_alipay").click(function(){
	ajaxSubmit(this, "", "#form_alipay");
});
$('#form_alipay input[name=merchant_name]').autoComplete({
	url: "{echo url('merchant/index')}",
	field: "",
	value: "{echo input('param.merchant_name')}",
	name_hidden: "merchant_id",
	value_hidden: "{echo input('param.merchant_id')}",
});
</script>
</body>
</html>