@extends('Public.index')
@section('admin')

<div class="content-wrapper" style="min-height: 810px;">
    <section class="content-header">
      <div class="container-fluid">
        <div class="row mb-2">
          <div class="col-sm-6">
            <h4>积分规则</h4>
          </div>
          <div class="col-sm-6">
            <ol class="breadcrumb float-sm-right">
              <li class="breadcrumb-item"><a href="/admin/index">首页</a></li>
              <li class="breadcrumb-item active">积分管理</li>
              <li class="breadcrumb-item active">积分规则</li>
            </ol>
          </div>
        </div>
      </div><!-- /.container-fluid -->
    </section>
    
    <!-- Main content -->
    <section class="content">
      <div class="container-fluid">
        <div class="row">
          <div class="col-md-6">
          <input type="hidden" class="ruleid" value="{{ $rule -> id }}">
                <div class="form-group">
                    <label> 每一元积分</label>
                    <input type="number" class="form-control jifen" value="{{ $rule -> jifen }}">
                    <label style="margin-top:30px;color:red;font-size:12px"> 会员积分规则：上面填写的是每一元积多少分，此处的积分规则在下单时通用，都只计算实际支付金额。</label>
                </div>
                
                <button class="btn btn-info save">保存</button>
          </div>
        </div>
    </section>
  </div>
  <script src="/admin/plugins/jquery/jquery.min.js"></script>
  <script src="/admin/layer-v3.1.1/layer/layer.js"></script>
  <script>
    $('.save').click(function(){
        var jifen = $('.jifen').val();
        var id = $('.ruleid').val();
        if(!jifen){
            layer.alert('内容不能为空');
            return false;
        }
        $.get('/admin/jifen/guize_save',{id:id,jifen:jifen},function(res){
            if(res.code == '1000'){
                layer.alert(res.msg);
            }else{
                layer.alert(res.msg);
            }
        })
    })
  </script>
@endsection
@section('title','积分商品列表')
@section('jifen','menu-open')
@section('jifen2','active')
@section('jifen-guize','active')