<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <?php $shoname_name = D('Home/Front')->get_config_by_name('shoname'); ?>
  <title><?php echo $shoname; ?></title>
  <link rel="shortcut icon" href="" />
        
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">

  <link rel="stylesheet" href="/layuiadmin/style/admin.css" media="all">
  <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
  <!--[if lt IE 9]>
  <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
  <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
  <![endif]-->

  <link href="./resource/css/bootstrap.min.css?v=201903260001" rel="stylesheet">
  <link href="./resource/css/common.css?v=201903260001" rel="stylesheet">
  <script type="text/javascript">
      window.sysinfo = {
        <?php if (!empty($_W['uniacid']) ){ ?>'uniacid': '{$_W['uniacid']}',<?php } ?>
        <?php if( !empty($_W['acid'])  ){ ?>'acid': '{$_W['acid']}',<?php } ?>
        <?php if (!empty($_W['openid']) ) { ?>'openid': '{$_W['openid']}',<?php } ?>
        <?php if( !empty($_W['uid']) ) {  ?>'uid': '{$_W['uid']}',<?php } ?>
        'isfounder': <?php if (!empty($_W['isfounder']) ) { ?>1<?php  }else{  ?>0<?php } ?>,
        'siteroot': '{$_W['siteroot']}',
        'siteurl': '{$_W['siteurl']}',
        'attachurl': '{$_W['attachurl']}',
        'attachurl_local': '{$_W['attachurl_local']}',
        'attachurl_remote': '{$_W['attachurl_remote']}',
        'module': {'url' : '<?php if( defined('MODULE_URL') ) { ?>{MODULE_URL}<?php } ?>', 'name' : '<?php if (defined('IN_MODULE') ) { ?>{IN_MODULE}<?php } ?>'},
        'cookie': {'pre': ''},
        'account': {:json_encode($_W['account'])},
      };
  </script>
        
  <script type="text/javascript" src="./resource/js/lib/jquery-1.11.1.min.js"></script>
  <script type="text/javascript" src="./resource/js/lib/bootstrap.min.js"></script>
  <script type="text/javascript" src="./resource/js/app/util.js?v=201903260001"></script>
  <script type="text/javascript" src="./resource/js/app/common.min.js?v=201903260001"></script>
  <script type="text/javascript" src="./resource/js/require.js?v=201903260001"></script>
  <script type="text/javascript" src="./resource/js/lib/jquery.nice-select.js?v=201903260001"></script>
  <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all">
  <link href="/static/css/snailfish.css" rel="stylesheet">
</head>
<body layadmin-themealias="default">

<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-card-header layui-elem-quote">当前位置：<span class="line-text">提现列表</span></div>
        <div class="layui-card-body" style="padding:15px;">
        <div class="page-content">
			<div class="summary_box">
				<div class="summary_title">
					<div class="title_inner">
						已提现金额：<span class="text-danger">{$supply_commiss['getmoney']}</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;提现中金额：<span class="text-danger"><?php echo $supply_commiss['dongmoney']<0 ?0:$supply_commiss['dongmoney'];?></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;可提现金额：<span class="text-danger">{$supply_commiss['money']}</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;提现手续费：<span class="text-danger">{$supply_tixian_moneyfree}%</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						<a href="{:U('supply/apply_money')}" class="btn btn-primary">申请提现</a>
					</div>
					
				</div>
			</div>
			
           
            <form action="" class="layui-form" lay-filter="example" method="post" >
                <div class="row">
                    <div class="col-md-12">
                        <div class="page-table-header">
                        </div>
                        <table class="table table-responsive" lay-even lay-skin="line" lay-size="lg">
                            <thead>
                                <tr>
            						<th style="width:25px;"></th>
									<th style="width:60px;">ID</th>
									
									<th style="">账户信息</th>
									<th style="">提现金额</th>
									
									<th style="">手续费</th>
									<th style="">到账金额</th>
									
									<th style='width:150px;'>状态</th>
									
									<th style=''>提现申请时间/处理时间</th>
                                </tr>
                            </thead>
                            <tbody>
        					<?php foreach( $list as  $row  ){ ?>
        						<tr>
									<td style="position: relative; ">
									   
									</td>
									<td>
										{$row['id']}
									</td>
									<td>
										<?php echo '转账类型：'.$row['bankname'];?><br/>
										
										<?php if( $row['supply_apply_type'] == 1 ){ ?>
											<?php echo '微信真实姓名：'.$row['bankaccount']; ?><br/>
										<?php }else{ ?>
											<?php echo '账户：'.$row['bankaccount']; ?><br/>
										<?php } ?>
										
										
										<?php echo empty($row['bankusername']) ? '': '持卡人姓名：'.$row['bankusername'];?><br/>
									</td>
									<td > 
										{$row['money']}
									</td>
									<td >
										{$row['service_charge']}
									</td>
									<td> 
										{:round($row['money'] - $row['service_charge'], 2)}
									</td>
									<td>
										<?php if( $row['state'] ==2 ){ ?>
											提现失败
										<?php }elseif($row['state'] ==1){ ?>
											<text class="text-green">提现成功，已打款</text>
										<?php  }else{  ?>
											<text class='text-danger'>提现中</text>
										<?php } ?>
									</td>
										<td>
									
									{:date('Y-m-d H:i:s', $row['addtime'])}<br/>
									<?php echo empty($row['shentime']) ? '': date('Y-m-d H:i:s', $row['shentime']);?><br/>
									
									</td>
								</tr>
        					<?php } ?>
                            </tbody>
                            <tfoot>
                                <tr>
                                   
                                    <td colspan="5" style="text-align: right">
                                        {$pager}
                                    </td>
                                </tr>
                            </tfoot>
                        </table>
                    </div>
                </div>
            </form>
        </div>

    </div>
</div>
    


<script language="javascript">
    
    require(['bootstrap'], function () {
        $("[rel=pop]").popover({
            trigger: 'manual',
            placement: 'right',
            title: $(this).data('title'),
            html: 'true',
            content: $(this).data('content'),
            animation: false
        }).on("mouseenter", function () {
            var _this = this;
            $(this).popover("show");
            $(this).siblings(".popover").on("mouseleave", function () {
                $(_this).popover('hide');
            });
        }).on("mouseleave", function () {
            var _this = this;
            setTimeout(function () {
                if (!$(".popover:hover").length) {
                    $(_this).popover("hide")
                }
            }, 100);
        });
    });
   

    $("[data-toggle='batch-group'], [data-toggle='batch-level']").click(function () {
        var toggle = $(this).data('toggle');
        $("#modal-change .modal-title").text(toggle=='batch-group'?"批量修改分组":"批量修改会员等级");
        $("#modal-change").find("."+toggle).show().siblings().hide();
        $("#modal-change-btn").attr('data-toggle', toggle=='batch-group'?'group':'level');
        $("#modal-change").modal();
    });
    $("#modal-change-btn").click(function () {
        var _this = $(this);
        if(_this.attr('stop')){
            return;
        }
        var toggle = $(this).data('toggle');
        var ids = [];
        $(".checkone").each(function () {
            var checked = $(this).is(":checked");
            var id = $(this).val();
            if(checked && id){
                ids.push(id);
            }
        });
        if(ids.length<1){
            tip.msgbox.suc("请选择要批量操作的会员");
            return;
        }
        var option = $("#modal-change .batch-"+toggle+" option:selected");
        level = '';
        if (toggle=='group'){
            for(i=0;i<option.length;i++){
                if (level == ''){
                    level += $(option[i]).val();
                }else{
                    level += ','+$(option[i]).val();
                }
            }
        }else{
            var level = option.val();
        }

        var levelname = option.text();
        tip.confirm("确定要将选中会员移动到 "+levelname+" 吗？", function () {
            _this.attr('stop', 1).text("操作中...");
            $.post(biz.url('user/changelevel'),{
                level: level,
                ids: ids,
                toggle: toggle
            }, function (ret) {
                $("#modal-change").modal('hide');
                if(ret.status==1){
                    tip.msgbox.suc("操作成功");
                    setTimeout(function () {
                        location.reload();
                    },1000);
                }else{
                    tip.msgbox.err(ret.result.message);
                }
            }, 'json')
        });
    });
</script>

<script src="/layuiadmin/layui/layui.js"></script>

<script>
    layui.config({
        base: '/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use('index');
</script>

<script>
var layer = layui.layer;
var $;

layui.use(['jquery', 'layer','form'], function(){ 
    $ = layui.$;
    var form = layui.form;
  
    $('.deldom').click(function(){
        var s_url = $(this).attr('data-href');
        layer.confirm($(this).attr('data-confirm'), function(index){
                     $.ajax({
                        url:s_url,
                        type:'post',
                        dataType:'json',
                        success:function(info){
                        
                            if(info.status == 0)
                            {
                                layer.msg(info.result.message,{icon: 1,time: 2000});
                            }else if(info.status == 1){
                                var go_url = location.href;
                                if( info.result.hasOwnProperty("url") )
                                {
                                    go_url = info.result.url;
                                }
                                
                                layer.msg('操作成功',{time: 1000,
                                    end:function(){
                                        location.href = info.result.url;
                                    }
                                }); 
                            }
                        }
                    })
                }); 
    })
    
    $('.btn-operation').click(function(){
        var ids_arr = [];
        var obj = $(this);
        var s_toggle = $(this).attr('data-toggle');
        var s_url = $(this).attr('data-href');
        
        
        $("input[name=item_checkbox]").each(function() {
            
            if( $(this).prop('checked') )
            {
                ids_arr.push( $(this).val() );
            }
        })
        if(ids_arr.length < 1)
        {
            layer.msg('请选择要操作的内容');
        }else{
            var can_sub = true;
            if( s_toggle == 'batch-remove' )
            {
                can_sub = false;
                
                layer.confirm($(obj).attr('data-confirm'), function(index){
                     $.ajax({
                        url:s_url,
                        type:'post',
                        dataType:'json',
                        data:{ids:ids_arr},
                        success:function(info){
                        
                            if(info.status == 0)
                            {
                                layer.msg(info.result.message,{icon: 1,time: 2000});
                            }else if(info.status == 1){
                                var go_url = location.href;
                                if( info.result.hasOwnProperty("url") )
                                {
                                    go_url = info.result.url;
                                }
                                
                                layer.msg('操作成功',{time: 1000,
                                    end:function(){
                                        location.href = info.result.url;
                                    }
                                }); 
                            }
                        }
                    })
                }); 
            }else{
                $.ajax({
                    url:s_url,
                    type:'post',
                    dataType:'json',
                    data:{ids:ids_arr},
                    success:function(info){
                    
                        if(info.status == 0)
                        {
                            layer.msg(info.result.message,{icon: 1,time: 2000});
                        }else if(info.status == 1){
                            var go_url = location.href;
                            if( info.result.hasOwnProperty("url") )
                            {
                                go_url = info.result.url;
                            }
                            
                            layer.msg('操作成功',{time: 1000,
                                end:function(){
                                    location.href = info.result.url;
                                }
                            }); 
                        }
                    }
                })
            }
        }
    })
  
    form.on('switch(statewsitch)', function(data){
      
      var s_url = $(this).attr('data-href')
      
      var s_value = 1;
      if(data.elem.checked)
      {
        s_value = 1;
      }else{
        s_value = 0;
      }
      
      $.ajax({
            url:s_url,
            type:'post',
            dataType:'json',
            data:{state:s_value},
            success:function(info){
            
                if(info.status == 0)
                {
                    layer.msg(info.result.message,{icon: 1,time: 2000});
                }else if(info.status == 1){
                    var go_url = location.href;
                    if( info.result.hasOwnProperty("url") )
                    {
                        go_url = info.result.url;
                    }
                    
                    layer.msg('操作成功',{time: 1000,
                        end:function(){
                            location.href = info.result.url;
                        }
                    }); 
                }
            }
        })
    });  
    form.on('checkbox(checkboxall)', function(data){
      if(data.elem.checked)
      {
        $("input[name=item_checkbox]").each(function() {
            $(this).prop("checked", true);
        });
        $("input[name=checkall]").each(function() {
            $(this).prop("checked", true);
        });
        
      }else{
        $("input[name=item_checkbox]").each(function() {
            $(this).prop("checked", false);
        });
        $("input[name=checkall]").each(function() {
            $(this).prop("checked", false);
        });
      }
      
      form.render('checkbox');
    });
  
    //监听提交
    form.on('submit(formDemo)', function(data){
        $.ajax({
            url: data.form.action,
            type: data.form.method,
            data: data.field,
            dataType:'json',
            success: function (info) {
              
                if(info.status == 0)
                {
                    layer.msg(info.result.message,{icon: 1,time: 2000});
                }else if(info.status == 1){
                    var go_url = location.href;
                    if( info.result.hasOwnProperty("url") )
                    {
                        go_url = info.result.url;
                    }
                    
                    layer.msg('操作成功',{time: 1000,
                        end:function(){
                            location.href = info.result.url;
                        }
                    }); 
                }
            }
        });
        return false;
    });
})

</script>  
</body>
</html>