123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184 |
- <style type="text/css">
- .pagination{
- margin:0 !important;
- }
- </style>
- @if(Session::has('message'))
- <div class="alert alert-success alert-dismissable">
- <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
- <h4><i class="icon fa fa-check"></i> 提示!</h4>
- {{ Session::get('message') }}
- </div>
- @endif
- <div class="ibox float-e-margins">
- <div class="ibox-content" style="display: block;">
- <a href="{{ route('admin.course.vipcard.create') }}" class="btn btn-primary margin-bottom" no-pjax>添加会员卡</a>
- <div>
- <div class="box-body table-responsive">
- <table class="table table-hover table-bordered">
- <thead>
- <tr>
- <td>卡名称</td>
- <td>等级</td>
- <td>原价</td>
- <td>现价</td>
- <td>期限</td>
- <td>升级</td>
- <td>保级</td>
- <td>会员权益</td>
- <td>兑换码类型</td>
- <td>兑换码数量</td>
- <td>是否启用</td>
- <td>操作</td>
- </tr>
- </thead>
- @if(count($vipcard)>0)
- <tbody>
- @foreach ($vipcard as $item)
- <tr>
- <td>{{$item->name}}</td>
- <td>{{$item->gread}}级</td>
- <td>{{$item->original_price}}</td>
- <td>{{$item->price}}</td>
- <td>
- @if(!empty($item->use_day))
- {{ $item->use_day }}
- @if($item->date=='1')天
- @elseif($item->date=='2')月
- @elseif($item->date=='3')年
- @endif
- @else
- 永久
- @endif
- </td>
- <td>{{$item->promote_num}}</td>
- <td>{{$item->keep_grade_num}}</td>
- <td>{{$item->couponsInfo}}</td>
- <td>
- @if($item->exchange_type)
- @foreach($vipExchange as $key=>$val)
- @if($item->exchange_type==$val->id)
- {{$val->name}}
- @endif
- @endforeach
- @else
- 无
- @endif
- </td>
- <td>{{$item->exchange_num}}</td>
- <td><a class="status" cid="{{$item->id}}" status="{{$item->status}}">
- <i class="fa @if($item->status==1) fa-toggle-on @else fa-toggle-off @endif"></i></a></td>
- <td>
- <a class="btn btn-xs btn-primary"
- href="{{route('admin.course.vipcard.edit',['id'=>$item->id])}}" no-pjax>
- <i data-toggle="tooltip" data-placement="top" class="fa fa-pencil-square-o" title="编辑"></i></a>
- <a class="btn btn-xs btn-danger vipcard-delete"
- data-url="{{route('admin.course.vipcard.destroy',['id'=>$item->id])}}" no-pjax>
- <i data-toggle="tooltip" data-placement="top" class="fa fa-trash" title="删除"></i></a>
- </td>
- </tr>
- @endforeach
- </tbody>
- <tfoot>
- <tr>
- <td colspan="12">
- <div class="pull-left">
- 共 {!! $vipcard->total() !!} 条记录
- </div>
- <div class="pull-right">
- {!! $vipcard->appends(request()->except('page'))->render() !!}
- </div>
- </td>
- </tr>
- </tfoot>
- @else
- <tfoot>
- <tr>
- <td colspan="10">
- 当前无数据
- </td>
- </tr>
- </tfoot>
- @endif
- </table>
- </div>
- </div>
- </div>
- </div>
- <script>
- $('.vipcard-delete').on('click', function () {
- var thisPoint = $(this);
- var url = thisPoint.data('url');
- swal({
- title: "确认删除此项?",
- imageUrl: "/assets/backend/activity/backgroundImage/delete-xxl.png",
- showCancelButton: true,
- confirmButtonColor: "#DD6B55",
- confirmButtonText: "确认",
- cancelButtonText: "取消",
- closeOnConfirm: false,
- closeOnCancel: true
- },
- function (isConfirm) {
- if (isConfirm) {
- $.ajax({
- type: "GET",
- url: url,
- success: function (data) {
- if (data.status) {
- swal({
- title: "删除成功",
- text: "",
- type: "success"
- },
- function () {
- location.reload();
- });
- }
- }
- });
- } else {
- }
- });
- });
- $('.status').on('click', function () {
- var value = $(this).attr('status');
- var modelId = $(this).attr('cid');
- value = parseInt(value);
- modelId = parseInt(modelId);
- if (value == 1) {
- value = 0;
- } else {
- value = 1;
- }
- var that = $(this);
- $.post("{{route('admin.course.vipcard.status')}}",
- {
- status: value,
- modelId: modelId
- },
- function (data, status) {
- if (status) {
- if (1 == value) {
- that.children().removeClass('fa-toggle-off');
- that.children().addClass('fa-toggle-on');
- that.attr('status',1);
- } else {
- that.children().removeClass('fa-toggle-on');
- that.children().addClass('fa-toggle-off');
- that.attr('status',0);
- }
- that.attr('value', value);
- }
- });
- });
- </script>
|