@extends('Public.index')
@section('admin')
<script src="/admin/plugins/jquery/jquery.min.js"></script>
<script src="/admin/layer-v3.1.1/layer/layer.js"></script>
<!-- 图片裁剪 -->
<!-- <link rel="stylesheet" type="text/css" href="/img_cate/ycbootstrap.css"> -->
<link rel="stylesheet" type="text/css" href="/img_cate/reset.css">
<script src="/img_cate/jquery-1.10.2.js"></script>
<!-- <script src="/img_cate/jquery.min.js"></script> -->
<script src="/img_cate/iscroll-zoom.js" type="text/javascript" charset="utf-8"></script>
<script src="/img_cate/hammer.js" type="text/javascript" charset="utf-8"></script>
<script src="/img_cate/lrz.all.bundle.js" type="text/javascript" charset="utf-8"></script>
<script src="/img_cate/jquery.photoClip.min.js" type="text/javascript" charset="utf-8"></script>
<style>
  img {
    max-width: 100%;
  }
</style>
<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>
    </section>

    <section class="content">
        <input type="hidden" id="id" value="{{ $about -> id }}">
      <div class="container-fluid">
        <div class="row">
          <div class="col-md-12">
            <div class="card">
              <div class="card-body p-0">
                <!-- 表单 -->
                <form class="form">
                    <div class="form-group m-4">
                        <label for="exampleInputFile" class="col-md-4">编辑简介</label>
                        <div class="input-group col-md-6">
                            <!-- 加载编辑器的容器 -->
                              <script id="container" style="height:400px;" name="content" type="text/plain">{!! $about -> content !!}</script>
                              <!-- 配置文件 -->
                              <script type="text/javascript" src="/ueditor/ueditor.config.js"></script>
                              <!-- 编辑器源码文件 -->
                              <script type="text/javascript" src="/ueditor/ueditor.all.js"></script>
                              <!-- 实例化编辑器 -->
                              <script type="text/javascript">
                                  var ue = UE.getEditor('container');
                              </script>
                        </div>
                    </div>
                </form>
                <form class="form">
                    <div class="form-group m-4 col-sm-6">
                        <a class="btn btn-success ok" style="color:white">保存</a>
                    </div>
                </form>
                <!-- 表单结束 --> 

              </div>
            </div>
          </div>
        </div>
    </section>
  </div>

<script>
$('.ok').click(function(){
  var id = $('#id').val();
  var content = ue.getContent();
  if(!content) {
    layer.alert('简介不能为空');
    return false;
  }
  $.post('/admin/wenzhang/about_edit',{id:id,content:content},function(res){
          if(res.code == '1000'){
                layer.alert(res.msg);
            }else{
                layer.alert(res.msg);
            }
  })
})
</script>
@endsection
@section('title','文章添加')
@section('title','商品分类')
@section('wz','menu-open')
@section('wz2','active')
@section('about','active')