<!--{assign var="menu_id" value="cp"}-->
<!--{include file="<!--{$oetplpath}-->block_header.tpl"}-->
<div class="oe_ntop">
  <i class="iconfont" onclick="goBack();">&#xe616;</i>
  <p>在线充值</p>
</div>
<div class="oe_recharge">
  <dl class="dl_1">

    <dt>
      <i class="iconfont">&#xe62d;</i>
    </dt>

	<dd>
      <p>帐户余额</p>
	  <p><span>¥ <!--{$login.user.money}--></span></p>
    </dd>
    <div class="clear"></div>

  </dl>
  
  <div class="oe_recharge_con">
    <input type="text" name="money" id="money" placeholder="输入充值金额，单位：元" />
  </div>

  <div class="oe_recharge_btn">
    <span f="but_recharge">确认充值</span>
  </div>
</div>

<script type="text/javascript">
$(function(){
	
	$("[f='but_recharge']").bind("click", function(){
		$_money = $("#money").val();
		if ($_money.length == 0) {
			ToastShow("请输入要充值金额");
			return false;
		}
		$.ajax({
			type: "POST",
			url: "<!--{$oefile}-->&c=<!--{$c}-->",
			cache: false,
			data: {a:"submit", money:$_money, r:get_rndnum(8)},
			dataType: "json",
			success: function($data) {
				$json = eval($data);
				$response = $json.response;
				$result = $json.result;
				if ($response == '1') {
					if ($result.length > 0) {
						goUrl("<!--{$oefile}-->&c=pay&paynum="+$result);
					}
					else {
						ToastShow("提交失败");
					}
				}
				else {
					if ($result.length > 0) {
						ToastShow($result);
					}
					else {
						ToastShow("提交失败");
					}
				}
			},
			error: function() {
				ToastShow("系统繁忙，请稍后再试");
			}
		});

	});
});
</script>

</body>
</html>