<?php include_once(mvc::$cfg['PATH_TPL'].'seller/publicHead.php');?>
<div class="maintb">
	<div class="main_middle" id="tixian">
		<div class="layui-tab layui-tab-card">
			<ul class="layui-tab-title">
				<li class="layui-this"><a href="<?php echo mvc::$cfg['SELF_URL']; ?>seller/tiXian">申请提现</a></li>
				<li><a href="<?php echo mvc::$cfg['SELF_URL']; ?>seller/tiXianList">提现记录</a></li>
				<li><a href="javascript:void(0)" class="a_blue" onclick="TIXIAN.addAccount()">添加收款账号</a></li>
				<li>
					<span class="gray marr10">余额<b class="red2"><?php echo sprintf('%.2f',$shopArr['money']);?></b>元</span>
					<span class="gray">可提现金额<b class="red2"><?php echo sprintf('%.2f',$shopArr['money_av']);?></b>元</span>
				</li>
			</ul>
			<div class="layui-tab-content" style="padding:20px;">
				<?php if($shopArr['money_av'] < $shopArr['minMoney']){?>
				<div class="alert alert-warning" role="alert">
					对不起，当前余额：<span class="red2"><?php echo sprintf('%.2f',$shopArr['money']);?></span> 元，可提现金额：<span class="red2"><?php echo sprintf('%.2f',$shopArr['money_av']);?></span> 元低于最小提现金额<span class="red2"><?php echo sprintf('%.2f',$shopArr['minMoney']);?></span> 元，不允许提现！
				</div>
				<?php }else{?>
				<form method="post" onsubmit="return TIXIAN.submitTiXian(0)" name="submitTiXianForm">
					<div class="column_row">
						<div class="column_title"><b>收款账号</b></div>
						<div class="column_body">
							<?php if(!empty($accArr)){?>
							<table class="table table-bordered">
								<thead>
									<tr>
										<th width="30px"></th>
										<th width="200px">收款人</th>
										<th width="120px">账号类型</th>
										<th width="250px">账号</th>
										<th width="150px">身份证</th>
										<th>操作</th>
									</tr>
								</thead>
								<tbody>
									<?php foreach($accArr as $acc){?>
									<tr>
										<?php if($acc['acc_type']==2){?>
										<td><input type="radio" name="acc_id" value="<?php echo $acc['acc_id'];?>"/></td>
										<td><?php echo $acc['acb_name'];?></td>
										<?php if($acc['acc_type'] == 1){?>
										<td>支付宝</td>
										<td title="支付宝账号"><?php echo $acc['acc_alipay_account'];?></td>
										<?php }else if($acc['acc_type'] == 2){?>
										<td><?php echo $acc['acc_bank_name'];?></td>
										<td><?php echo $acc['acc_bank_card'];?></td>
										<?php }else{?>
										<td>微信</td>
										<td>
											<span title="昵称"><?php echo $acc['acc_weixin_info']['nickname'];?></span>
											【<span title="微信号"><?php echo $acc['acc_weixin'];?></span>】
										</td>
										<?php }?>
										<td><?php echo $acc['acb_idcard'];?></td>
										<td><a href="javascript:void(0)" class="a_blue" onclick="MESSAGE.confirm('确定要删除此收款账号吗？', 'TIXIAN.delAccount(this, <?php echo $acc['acc_id'];?>)');">删除</a></td>
										<?php }?>
									</tr>
									<?php }?>
								</tbody>
							</table>
							<?php }else{?>
							<a href="javascript:void(0)" class="a_blue" onclick="TIXIAN.addAccount()">添加收款账号</a>
							<?php }?>
						</div>
						<div class="clear"></div>
					</div>
					<div class="column_row">
						<div class="column_title"><b>提现金额</b></div>
						<div class="column_body">
							<div class="marb10">
								<input type="text" class="layui-input" name="money" placeholder="输入金额" check="price:<?php echo sprintf('%.2f',$shopArr['minMoney']);?>:<?php echo sprintf('%.2f',$shopArr['money_av']);?>" value="<?php echo sprintf('%.2f',$shopArr['money_av']);?>"> 元
								&nbsp;&nbsp;&nbsp;&nbsp;可提现金额：<b class="red"><?php echo sprintf('%.2f',$shopArr['money_av']);?></b> 元
								&nbsp;&nbsp;&nbsp;&nbsp;最小提现金额：<b class="red"><?php echo sprintf('%.2f',$shopArr['minMoney']);?></b> 元
								&nbsp;&nbsp;&nbsp;&nbsp;佣金率为：<b class="red"><?php echo $shopArr['commission'];?>%</b></b>
							</div>
							<div class="mar10">
								<ul class="gray">
									<?php if(mvc::$cfg['TIXIAN']){?>
									<?php foreach(mvc::$cfg['TIXIAN'] as $v){?>
									<li><?php echo $v['name'];?>：同一个账号，单笔限额<?php echo $v['perMax']/10000;?>万元，单日限额<?php echo $v['dateMax']/10000;?>万元</li>
									<?php }?>
									<?php }?>
									<li>同一个收款账号每天最多可以提现10次</li>
								<ul>
							</div>
						</div>
						<div class="clear"></div>
					</div>
					<div class="column_row">
						<div class="column_title"><b>到账时间</b></div>
						<div class="column_body"><b>48小时内</b></div>
						<div class="clear"></div>
					</div>
					<div class="column_row">
						<div class="column_title">&nbsp;</div>
						<div class="column_body">
							<input type="submit" class="layui-btn layui-btn-danger" value="确认提现">
						</div>
						<div class="clear"></div>
					</div>
				</form>
				<?php }?>
			</div>
		</div>
		<div class="clear"></div>
		
	</div>
	<div class="clear"></div>
</div>
<div id="addAccount">
	<form id="ajaxAccountForm">
		<table class="layui-table" style="width:600px;margin-bottom: 20px;">
			<tbody>
				<tr>
					<th class="right w100"><i class="required">*</i>账号类型：</th>
					<td>
						<!-- 
						<label><input type="radio" name="acc_type" value="0" checked>微信</label>&nbsp;&nbsp;
						<label><input type="radio" name="acc_type" value="1">支付宝</label>&nbsp;&nbsp;
						 -->
						<label><input type="radio" name="acc_type" value="2" checked>银行卡</label>&nbsp;&nbsp;
					</td>
				</tr>
				<tr class="acc_des acc_0">
					<th class="right">绑定步骤：</th>
					<td>
						<div class="addWxAcStep">
						<div class="mar10">
							<b class="red2">第一步：</b>
							<div class="WxEwm mar10">
								<div class="txt">关注宜配网公众号</div>
								<img src="<?php echo mvc::$cfg['SELF_URL'];?>/static/images/WeChat.jpg" alt="关注宜配网微信公众号">
								<div class="gray">（关注后10分钟生效）</div>
							</div>
						</div>
						<div class="mar10">
							<b class="red2">第二步：</b>
							<div class="mar10"><a href="<?php echo $wxBindurl;?>" class="btn btn-primary" role="button" target="_blank">绑定已实名认证的微信</a></div>
						</div>
					</td>
				</tr>
				<tr class="acc_des acc_1 acc_2">
					<th class="right w100"><i class="required">*</i>收款人：</th>
					<td>
					<?php if(!empty($idcardArr)){?>
						<?php foreach($idcardArr as $k=>$v){?>
						<label class="irCarRow"><input type="radio" name="acc_acb_id" value="<?php echo $v['acb_id'];?>" <?php if($k==0) echo ' checked';?>><span class="idname"><?php echo $v['acb_name'];?></span><span title="身份证号码"><?php echo $v['acb_idcard'];?></label>
						<?php }?>
					<?php }else{?>
						<div class="warn">请联系商城在线客服添加收款人信息</div>
					<?php }?>
					</td>
				</tr>
				<tr class="acc_des acc_1">
					<th class="right w100"><i class="required">*</i>支付宝账号：</th>
					<td><input type="text" class="layui-input" name="acc_alipay_account" placeholder="输入支付宝账号，支持邮箱或手机号"/></td>
				</tr>
				<tr class="acc_des acc_2">
					<th class="right w100"><i class="required">*</i>银行名称：</th>
					<td>
						<select name="acc_bank_name"  class="layui-input">
							<?php foreach($bankArr as $v){?>
							<option name="<?php echo $v?>"><?php echo $v?></option>
							<?php }?>
						</select>
					</td>
				</tr>
				<tr class="acc_des acc_2">
					<th class="right w100"><i class="required">*</i>储蓄卡卡号：</th>
					<td><input type="text" style="width:35%" class="layui-input" name="acc_bank_card" placeholder="输入银行卡号"/><span style="padding-left: 10px;font-size: 14px;" class="red">对公账号</span></td>
				</tr>
				<tr class="acc_des acc_2">
					<th class="right w100"><i class="required">*</i>开户支行：</th>
					<td><input type="text" class="layui-input" name="acc_bank_open" placeholder="输入开户银行支行"/></td>
				</tr>
			</tbody>
		</table>
	</form>
</div>
<?php include_once(mvc::$cfg['PATH_TPL'].'public/footBase.php');?>
<script type="text/javascript">
var commission = <?php echo $shopArr['commission'];?>;
var minMOney = <?php echo sprintf('%.2f',$shopArr['minMoney']);?>;
$(document).ready(function(){
	$('.wxul li').click(function(){
		$(this).siblings().removeClass('active');
		$(this).addClass('active');
		$(this).find('[name="acc_id"]').prop("checked", "checked");
	});
	VERIFICATION.check();
});
</script>