<header class="uc_head">
	<h3 class="current">在线充值</h3>
</header>
<section class="user_form">
	<form action='{url:/block/doPay}' method='post'>
		<dl>
			<dt>充值金额：</dt>
			<dd>
				<input type='text' class="input_text w100" name="recharge" pattern='float' alt='请输入充值的金额'>
				<span>请输入充值的金额</span>
			</dd>
		</dl>

		<dl>
			<dt>选择充值方式：</dt>
			{set:$paymentList=Api::run('getPaymentListByOnline')}
			<dd>
				{if:!empty($paymentList)}
				{foreach:items = $paymentList}
				<label class='attr'>
					<input class="radio" name="payment_id" title="{$item['name']}" type="radio" value="{$item['id']}">
					<span>
					{$item['name']}
					{$item['note']}，手续费：{if:$item['poundage_type']==2}￥{$item['poundage']}{else:}{$item['poundage']}%{/if}
					</span>
				</label>
				<br />
				{/foreach}
				{else:}
				没有线上支付方式
				{/if}
			</dd>
		</dl>
		<dl>
			<dt></dt>
			<dd><input class="input_submit" type="submit" value="确定充值" /></dd>
		</dl>
	</form>
</section>

<script type='text/javascript'>

	function check_form()
	{
		if($('[name="payment_id"]:checked').length == 0)
		{
			alert('请选择支付方式');
			return false;
		}

		if($('[name="recharge"]').val() <= 0)
		{
			alert('要充值的金额必须大于0元');
			return false;
		}
	}
</script>
