<!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('PayWeixin/index')}">参数配置</a></li>
					<li class="<!--{if request()->action() == 'merchant'}-->layui-this<!--{/if}-->"><a href="{echo url('PayWeixin/merchant')}">商户入网</a></li>
				</ul>
				<div class="layui-tab-content">
					<form name="form_weixin" id="form_weixin" method="post" action="{echo \befen\get_url()}">
					<table class="layui-table">
						<tbody>
							<tr>
								<td class="td1">开发者ID(AppID)</td>
								<td class="td2"><input type="text" name="appid" id="appid" class="layui-input" value="{$config_weixin[appid]}" placeholder=""></td>
							</tr>
							<tr>
								<td class="td1">开发者密码(AppSecret)</td>
								<td class="td2"><input type="text" name="appsecret" id="appsecret" class="layui-input" value="{$config_weixin[appsecret]}" placeholder=""></td>
							</tr>
							<tr>
								<td class="td1">公众号令牌(Token)</td>
								<td class="td2"><input type="text" name="token" id="token" class="layui-input" value="{$config_weixin[token]}" placeholder=""></td>
							</tr>
							<tr>
								<td class="td1">公众号密钥(EncodingAESKey)</td>
								<td class="td2"><input type="text" name="encodingaeskey" id="encodingaeskey" class="layui-input" value="{$config_weixin[encodingaeskey]}" placeholder=""></td>
							</tr>
							<tr>
								<td class="td1">服务商商户号(mch_id)</td>
								<td class="td2"><input type="text" name="mch_id" id="mch_id" class="layui-input" value="{$config_weixin[mch_id]}" placeholder=""></td>
							</tr>
							<tr>
								<td class="td1">服务商API密钥(mch_key)</td>
								<td class="td2"><input type="text" name="mch_key" id="mch_key" class="layui-input" value="{$config_weixin[mch_key]}" placeholder=""></td>
							</tr>
							<tr>
								<td class="td1">特约子商户号(sub_mch_id)</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">微信支付服务商<br />apiclient_key.pem</td>
								<td class="td2"><textarea name="ssl_key_body" id="ssl_key_body" class="layui-textarea">{$ssl_key_body}</textarea></td>
							</tr>
							<tr>
								<td class="td1">微信支付服务商<br />apiclient_cert.pem</td>
								<td class="td2"><textarea name="ssl_cer_body" id="ssl_cer_body" class="layui-textarea">{$ssl_cer_body}</textarea></td>
							</tr>
							<tr>
								<td class="td1">&nbsp;</td>
								<td class="td2">
									<button type="submit" name="submit_weixin" value="submit_weixin" id="submit_weixin" 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_weixin").click(function(){
	ajaxSubmit(this, "", "#form_weixin");
});
$('#form_weixin 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>