<!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">
					<div class="searcher">
						<div class="right"><button type="button" class="layui-btn layui-add">添加商户</button></div>
						<form name="sch_form" id="sch_form" method="get" action="{echo \befen\get_url()}">
							<div class="layui-input-inline"><input type="text" name="wd" id="wd" class="layui-input" value="{echo input('param.wd')}" placeholder="商户编号或名称"></div>
							<div class="layui-input-inline layui-left-margin"><button type="submit" id="search" class="layui-btn">查询</button></div>
						</form>
						<div class="clear"></div>
					</div>
					<form name="theform" id="theform" method="post" action="{echo \befen\get_url()}">
					<table class="layui-table">
						<thead>
							<tr>
								<th>商户名称</th>
								<th>支付宝账户</th>
								<th>申请时间</th>
								<th style="display:none;">更新时间</th>
								<th>事务编号</th>
								<th>签约费率</th>
								<th>签约状态</th>
								<th>操作</th>
							</tr>
						</thead>
						<tbody>
							<!--{loop $list $key $val}-->
							<tr id="">
								<td>{$val[merchant_name]}</td>
								<td>{$val[alipay]}</td>
								<td>{echo gsdate('Y-m-d H:i:s', $val['time_create'])}</td>
								<td id="time_update_{$val[id]}" style="display:none;">{echo gsdate('Y-m-d H:i:s', $val['time_update'])}</td>
								<td>{$val[batch_no]}</td>
								<td><span class="layui-badge-rim">{$val[trade_rates]}%</span></td>
								<td><span class="layui-badge-rim" id="order_status_{$val[id]}">{echo isset($this->OrderStatus[$val[order_status]]) ? $this->OrderStatus[$val[order_status]] : '未知'}</span></td>
								<td class="op">
									<a op="detail" val="{$val[id]}" lay-url="{echo url('PayAlipay/merchant_detail', ['id' => $val['id'], 'merchant_id' => $val['merchant_id']])}" class="layui-btn layui-btn-xs layui-btn-normal">商户资料</a>
									<a op="update" val="{$val[id]}" lay-url="{echo url('PayAlipay/merchant_update', ['id' => $val['id'], 'merchant_id' => $val['merchant_id']])}" class="layui-btn layui-btn-xs layui-btn-normal">查看详情</a>
								</td>
							</tr>
							<!--{/loop}-->
						</tbody>
					</table>
					</form>
					<div class="listpages">{$pagenav}</div>
				</div>
			</div>
		</div>
	</div>
</div>
<!--footer-->
{template _:footer}
<script type="text/javascript">
$(".layui-add").click(function(){
	showWindow("添加商户", "{echo url('PayAlipay/merchant_add')}", "800px");
});
$("a[op=detail]").click(function(){
	showWindow("商户资料", $(this).attr('lay-url'), "800px");
});
$("a[op=update]").click(function(){
	showWindow("查看详情", $(this).attr('lay-url'), "600px", "update_window");
});
</script>
</body>
</html>