@extends('vip.layouts')
@section('seo_title')
	支付管理
@endsection
@section('content')
    <style>
        .layui-laydate-range {
            width: auto;
        }

        .layui-form-switch em {
            width: auto;
        }

        .layui-form-switch {
            width: 44px;
            line-height: 23px;
        }

        .layui-form-item .checkbox {
            width: auto;
        }
    </style>
	<script type="text/html" id="type">
		@{{#if(d.type==2){ }}
		微信扫码
		@{{#}else if(d.type==3){ }}
		支付宝扫码
		@{{#}else if(d.type==4){ }}
		QQ扫码
		@{{#}else if(d.type==5){ }}
		银联扫码
		@{{#}else if(d.type==6){ }}
		京东扫码
		@{{#}else if(d.type==7){ }}
		一码多扫
		@{{#} }}
	</script>

	<script type="text/html" id="status">
		@if(checkRriv('/admin/Payment/UserStart'))<input type="checkbox" name="status" value="@{{d.id}}" lay-skin="switch" lay-text="启用|禁用" lay-filter="openStatus" @{{ d.status == '1' ? 'checked' : '' }}>@endif
	</script>

    <div class="layui-row">
        <div class="layui-col-xs12">
            <form class="layui-form rewrite" eventType="eventForm"  action="">
                <div class="layui-form-item">
                    <div class="layui-inline">
                    <div class="layui-inline">
						<label class="layui-form-label">{{ trans('payment.infoname') }}</label>
						<div class="layui-input-inline">
							<input type="text" name="show_name" id="show_name" eventType="event-query"  value="{{ $show_name }}" lay-verify="required" autocomplete="off" class="layui-input">
						</div>
						<div class="layui-input-inline checkbox">
							<input type="checkbox" name="sureblur" id="sureblur" lay-skin="switch" lay-text="精确|模糊" checked>
						</div>
                    </div>

					<div class="layui-inline">
					<a class="layui-btn layui-btn-sm lay-btn-diy"   data-type="reload" eventType="event-query-submit" style="opacity: 1; pointer-events: auto;">提交</a>
					<a  class="layui-btn   layui-btn-sm layui-btn-normal reset" data-type="reload" style="opacity: 1; pointer-events: auto;">重置</a>
                    <a class="layui-btn layui-btn-sm layui-btn-green set" data-type="reload" style="opacity: 1; pointer-events: auto;"><i class="layui-icon">ဂ</i></a>
                    @if(checkRriv('/admin/Payment/add'))<a href="/admin/Payment/add" class="layui-btn layui-btn-sm ">添加</a>@endif
                    @if(checkRriv('/admin/Payment/delete'))<a href="javascript:delWin('/admin/Payment/delete?id=');" class="layui-btn layui-btn-sm  layui-btn-danger">删除</a>@endif
				   </div>

                    <!-- &nbsp;&nbsp;&nbsp;&nbsp;<div class="layui-inline"><a href="javascript:openWin('/admin/user/infoAdd','{{ trans('menu.menu_add') }}','700px','500px')" class="layui-btn layui-btn-sm  ">添加</a></div>
                    <div class="layui-inline"><a href="/admin/menu/add" class="layui-btn layui-btn-sm  layui-btn-danger">删除</a></div> -->

                </div>
            </form>
        </div>
    </div>
@push('dataTableJS')
//var active = {
//    reload: function(){
//      //执行重载
//      table.reload('{{ $dataId }}', {
//        page: {
//          curr: 1 //重新从第 1 页开始
//        }
//        ,where: {
//            infoname:$('#infoname').val(),
//        }
//      });
//    }
//  };

//启用|禁用用户
	form.on('switch(openStatus)', function(obj){
		var status = 0;
		if(obj.elem.checked==true){
			status = 1;
		}
		setcolumn('/admin/Payment/UserStart',this.name,status,this.value,obj);
        console.log(this.name);
        console.log(status);
        console.log(this.value);
        console.log(obj);
		//layer.tips(msg, obj.othis);
	});

		function setcolumn(url,column,value,id,obj){
		$.ajax({
			url: url+'?'+column+'='+value+'&id='+id,
			dataType: 'json',
			type: 'get',
			success:function(data){
				layer.msg(data.msg);
				if(data.status!=1){
					if(value==1){
						obj.othis[0].setAttribute("class", "layui-unselect layui-form-switch");
						obj.othis[0].innerHTML='<em>开启</em><i></i>';
					}else{
						obj.othis[0].setAttribute("class",'layui-unselect layui-form-switch layui-form-onswitch');
						obj.othis[0].innerHTML='<em>禁用</em><i></i>';
					}
				}
			}
		});
	}

//$('.lay-btn-diy').on('click', function(){
//    var type = $(this).data('type');
//    active[type] ? active[type].call(this) : '';
//  });

  //重置表单
  $('.reset').on('click',function(){
	  $('input').val('');
	  $('#infoname').val('');
//	  var type = $(this).data('type');
//	  active[type] ? active[type].call(this) : '';
  });

  //刷新表单
//    $('.set').on('click',function(){
//    var type = $(this).data('type');
//    active[type] ? active[type].call(this) : '';
//    });

@endpush

    @include('vip.datatable')
	<link rel="stylesheet" href="{{ asset('/css/untablelist.css') }}"  />
@endsection
