<!--{include file="<!--{$oetplpath}-->block_head.tpl"}-->

<!--{if $a == "run"}-->
<div class="layui-fluid oe_fluid">

  <form class="layui-form" id="mysearch" action="<!--{$oefile}-->&c=<!--{$c}-->" method="post">
  <div class="oe_breadcrumb_box clearfix">
    <div class="layui-breadcrumb fl" lay-filter="breadcrumb" style="visibility: visible;">
      <a href="javascript:;">内容模块</a><span lay-separator="">/</span>
      <a href="javascript:;">单页管理</a><span lay-separator="">/</span>
      <a><cite>单页内容</cite></a>
    </div>
  </div>
  <!--//top end -->
  
  <div class="oe_searchbar layui-form">
    <div class="more_search_open"></div>
    <div class="layui-form-item">
      <div class="layui-inline">
        <div class="layui-form-label">分类：</div>
        <div class="layui-input-inline">
          <!--{hook mod='aboutcat' type='select' name='scatid' text='=请选择=' value=$scatid}-->
        </div>
      </div>
      <div class="layui-inline">
        <div class="layui-form-label">标题：</div>
        <div class="layui-input-inline">
          <input type="text" name="stitle" id="stitle" value="<!--{$stitle}-->" class="layui-input" />
        </div>
      </div>
      <div class="layui-inline">
        <button class="layui-btn layui-btn-sm search" id="but_submit_search2" lay-submit lay-filter="searchform2">
          <i class="layui-icon layui-icon-search"></i>
          搜索
          <span class="oe_btn_loading layui-anim layui-icon layui-anim-rotate layui-anim-loop" style="display:none;">&#xe63d;</span>
        </button>
      </div>
      
    </div>

  </div>
  <!--//search End -->
  </form>

  <div class="oe_table_wrap layui-form">
  
    <div class="oe_tbl_tool clearfix">
      <div class="oe_gnbar clearfix">
        <div class="select btn fl">
          <input type="checkbox" name="allid[]" lay-skin="primary" title="全选" lay-filter="selectAll">
        </div>
        <div class="btn del fl" f="handle-array" data-form="myform">
          <i class="layui-icon layui-icon-delete"></i>
          <span>删除</span>
        </div>
        <a href="<!--{$oefile}-->&c=<!--{$c}-->&a=add" class="btn add fl">
          <i class="layui-icon layui-icon-add-1"></i>
          <span>添加</span>
        </a>
      </div>
      <div class="oe_tongji_bar clearfix current">
        <span><b><!--{$total}--></b> 条记录</span>
      </div>
    </div>
    
    <form class="layui-form" id="myform" action="<!--{$oefile}-->&c=<!--{$c}-->" method="post">
    <input type="hidden" name="a" id="a" value="del" />
    <table class="layui-table">
      <thead>
        <tr>
          <th width="2%">选</th>
          <th width="7%">ID</th>
          <th width="8%">分类</th>
          <th>标题</th>
          <th width="6%">图片</th>
          <th width="6%">排序</th>
          <th width="5%">状态</th>
          <th width="7%">PC导航</th>
          <th width="7%">WAP导航</th>
          <th width="6%">nofollow</th>
          <th width="14%">添加时间</th>
          <th width="10%">操作</th>
        </tr> 
      </thead>
      
      <!--{if empty($about)}-->
      <tr>
        <td colspan="12" class="text_center">没有符合条件的信息</td>
      </tr>
      <!--{else}-->
      <!--{foreach $about as $volist}-->
      <tr>
        <td class="check text_center">
          <input type="checkbox" name="id[]" lay-skin="primary" value="<!--{$volist.abid}-->" />
        </td>
        <td class="text_center">
          <!--{$volist.abid}-->
        </td>
        <td class="text_center"><!--{$volist.catname}--></td>
        <td><a href="<!--{$urlpath}-->index.php?c=about&a=detail&id=<!--{$volist.abid}-->" target="_blank"><!--{$volist.title}--></a></td>
        <td class="text_center">
        <!--{if !empty($volist.thumbimg)}-->
        <img src="<!--{$urlpath}--><!--{$volist.thumbimg}-->" width="20px" height="20px" f="viewimg" data-img="<!--{$volist.drawimg}-->" />
        <!--{else}-->
        --
        <!--{/if}-->
        </td>
        <td class="text_center"><!--{$volist.orders}--></td>
        
        <td class="text_center">
          <input type="checkbox" name="flag" lay-skin="primary" value="1" lay-filter="updatestatus" data-id="<!--{$volist.abid}-->" data-type="flag"<!--{if $volist.flag == '1'}--> checked<!--{/if}--> />
        </td>
        <td class="text_center">
          <input type="checkbox" name="elite" lay-skin="primary" value="1" lay-filter="updatestatus" data-id="<!--{$volist.abid}-->" data-type="elite"<!--{if $volist.elite == '1'}--> checked<!--{/if}--> />
        </td>
        
        <td class="text_center">
          <input type="checkbox" name="wapelite" lay-skin="primary" value="1" lay-filter="updatestatus" data-id="<!--{$volist.abid}-->" data-type="wapelite"<!--{if $volist.wapelite == '1'}--> checked<!--{/if}--> />
        </td>
        
        <td class="text_center">
          <input type="checkbox" name="nofollow" lay-skin="primary" value="1" lay-filter="updatestatus" data-id="<!--{$volist.abid}-->" data-type="nofollow"<!--{if $volist.nofollow == '1'}--> checked<!--{/if}--> />
        </td>
        
        <td class="text_center"><!--{$volist.addtime|date_format:"%Y-%m-%d %H:%M:%S"}--></td>
        <td class="text_center">
          <a href="<!--{$oefile}-->&c=<!--{$c}-->&a=edit&id=<!--{$volist.abid}-->&<!--{$comeurl}-->" class="layui-btn layui-btn-xs layui-btn-normal">编辑</a>
          <a href="javascript:;" f="handle-one" data-url="<!--{$oefile}-->&c=<!--{$c}-->&a=del&id[]=<!--{$volist.abid}-->&<!--{$comeurl}-->" class="layui-btn layui-btn-xs layui-btn-danger">删除</a>
        </td>
      </tr>
      <!--{/foreach}-->
      <!--{/if}-->
    </table>
    </form>
    
    <div class="oe_page_box"><!--{$showpage}--></div>
    
  </div>
</div>
<!--{/if}-->


<!--{if $a == "add"}-->
<div class="layui-fluid oe_fluid">

  <div class="oe_breadcrumb_box clearfix">
    <div class="layui-breadcrumb fl" lay-filter="breadcrumb" style="visibility: visible;">
      <a href="javascript:;">内容模块</a><span lay-separator="">/</span>
      <a href="javascript:;">单页管理</a><span lay-separator="">/</span>
      <a><cite>单页内容</cite></a>
    </div>
    <div class="oe_tool_bar ft">
      <button class="layui-btn layui-btn-sm layui-btn-radius" id="but_submit_post2" lay-submit lay-filter="addform">
        添加保存
        <span class="oe_btn_loading layui-anim layui-icon layui-anim-rotate layui-anim-loop" style="display:none;">&#xe63d;</span>
      </button>
      <span class="layui-btn layui-btn-sm layui-btn-primary layui-btn-radius"><a href="<!--{$oefile}-->&c=<!--{$c}-->&<!--{$comeurl}-->">返回列表</a></span>
    </div> 
  </div>
  
  <form class="layui-form" id="myform" action="<!--{$oefile}-->&c=<!--{$c}-->&<!--{$comeurl}-->" method="post">
  <input type="hidden" name="a" id="a" value="saveadd" />
  <div class="layui-card">
    <div class="layui-card-header">添加单页</div>
    <div class="layui-card-body">
      <table class="oe_tbl_form layui-form">
        <tr>
          <th width="15%"><font color="red">*</font> 标&#12288;&#12288;题：</th>
          <td width="35%">
            <input type="text" name="title" id="title" class="layui-input input-300" />
          </td>
          <th width="15%">所属分类：</th>
          <td width="35%">
            <div class="input-200">
            <!--{hook mod='aboutcat' type='select' name='catid' text='=请选择='}-->
            </div>
            <a href="<!--{$oefile}-->&c=aboutcat&a=add">添加分类</a>
          </td>
        </tr>
        <tr>
          <th>状&#12288;&#12288;态：</th>
          <td>
            <input type="radio" name="flag" title="正常" value="1" checked />
            <input type="radio" name="flag" title="锁定" value="0" />
          </td>
          <th>导&#12288;&#12288;航：</th>
          <td>
            PC导航：
            <div class="input-100">
              <select name="elite" id="elite">
                <option value="">=请选择=</option>
                <option value="1">开启</option>
                <option value="0" selected>关闭</option>
              </select>
            </div>
            &#12288;
            WAP导航：
            <div class="input-100">
              <select name="wapelite" id="wapelite">
                <option value="">=请选择=</option>
                <option value="1">开启</option>
                <option value="0" selected>关闭</option>
              </select>
            </div>
          </td>
        </tr>
        
        <tr>
          <th>排&#12288;&#12288;序：</th>
          <td>
            <input type="text" name="orders" id="orders" class="layui-input input-100" value="<!--{$orders}-->" />
          </td>
          <th>浏览次数：</th>
          <td>
            <input type="text" name="hits" id="hits" class="layui-input input-100" />
          </td>
        </tr>
        <tr>
          <th>图&#12288;&#12288;文：</th>
          <td>
            <div class="layui-btn">
              <i class="layui-icon layui-icon-upload"></i>
              点击上传
              <input type="file" name="img" id="img" f="but_upload_image" data-thumb="1" />
            </div>
            <div class="upload_loading" id="img_loading" style="display:none;"></div>
            <input type="hidden" id="img_thumb" name="thumbimg" value="" />
            <input type="hidden" id="img_url" name="drawimg" value="" />
        
            <div class="tblform_tips normal">&nbsp;&nbsp;&nbsp;预览：</div>
            <div class="upload_pic upload_pic_md" style="width:30px;height:30px;">
              <img src="<!--{$urlpath}-->tpl/static/images/nopic.jpg" id="img_preview" f="viewimg" />
            </div>
            <a href="javascript:;" class="oe_deluploadimg" f="removeimg" data-preview="img" data-input="img">移除</a>
          </td>
          <th>链接nofollow：</th>
          <td>
            <div class="input-100">
            <select name="nofollow" id="nofollow">
              <option value="">=请选择=</option>
              <option value="1">是</option>
              <option value="0">否</option>
            </select>
            </div>
          </td>
        </tr>

        <tr>
          <th>PC内容：</th>
          <td colspan="3">
            <textarea name="content" id="content" class="layui-textarea" style="width:98%;height:300px;display:none;"></textarea>
          </td>
        </tr>
        <tr>
          <th>meta标题：</th>
          <td colspan="3">
            <input type="text" name="metatitle" id="metatitle" class="layui-input" style="width:50%;" />
          </td>
        </tr>
        <tr>
          <th>Meta描述：</th>
          <td colspan="3">
            <textarea name="metadesc" id="metadesc" class="layui-textarea" style="width:50%;height:40px;"></textarea>
          </td>
        </tr>
        <tr>
          <th>Meta关键词：</th>
          <td colspan="3">
            <textarea name="metakeyword" id="metakeyword" class="layui-textarea" style="width:50%;height:40px;"></textarea>
          </td>
        </tr>
        <tr>
          <th>指定模板：</th>
          <td colspan="3" style="line-height:45px;">
            PC：tpl/templets/<!--{$config.templet}-->/&nbsp;
            <input type="text" name="tplname" id="tplname" class="layui-input input-200" />.tpl
            <br />
            WAP：tpl/wbapp/&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <input type="text" name="wtplname" id="wtplname" class="layui-input input-200" />.tpl
          </td>
        </tr>
      </table>
    </div>
  </div>
  </form>
  <!--{include file="<!--{$oetplpath}-->widget_editor.tpl"}-->
  
  <div class="oe_kong"></div>
  <div class="oe_tbl_form_btn current">
    <button class="layui-btn" id="but_submit_post" lay-submit lay-filter="addform">
      添加保存
      <span class="oe_btn_loading layui-anim layui-icon layui-anim-rotate layui-anim-loop" style="display:none;">&#xe63d;</span>
    </button>
  </div>
  
</div>

<script type="text/javascript">
$(function(){

    layui.use('form', function(){
        $form = layui.form;
        //保存...
        $form.on('submit(addform)', function(data){
            $obj_id = data.elem.getAttribute("id");
            if (!$("#"+$obj_id).hasClass("forbid_submit")) {
            
                if ($("#title").val().length  == 0) {
                    layer.msg("请填写标题");
                    return false;
                }
                
                $("#"+$obj_id).addClass("forbid_submit");
                if ($("#"+$obj_id).find("span").length > 0) {
                    $("#"+$obj_id).find("span").show();
                }
                //...
                $("#content").text(OEeditor.html());
                $("#myform").submit();
            }
        });   
    });
    
});
</script>
<!--{/if}-->

<!--{if $a == "edit"}-->
<div class="layui-fluid oe_fluid">

  <div class="oe_breadcrumb_box clearfix">
    <div class="layui-breadcrumb fl" lay-filter="breadcrumb" style="visibility: visible;">
      <a href="javascript:;">内容模块</a><span lay-separator="">/</span>
      <a href="javascript:;">单页管理</a><span lay-separator="">/</span>
      <a><cite>单页内容</cite></a>
    </div>
    <div class="oe_tool_bar ft">
      <button class="layui-btn layui-btn-sm layui-btn-radius" id="but_submit_post2" lay-submit lay-filter="editform">
        编辑保存
        <span class="oe_btn_loading layui-anim layui-icon layui-anim-rotate layui-anim-loop" style="display:none;">&#xe63d;</span>
      </button>
      <span class="layui-btn layui-btn-sm layui-btn-primary layui-btn-radius"><a href="<!--{$oefile}-->&c=<!--{$c}-->&<!--{$comeurl}-->">返回列表</a></span>
    </div> 
  </div>
  
  <form class="layui-form" id="myform" action="<!--{$oefile}-->&c=<!--{$c}-->&<!--{$comeurl}-->" method="post">
  <input type="hidden" name="a" id="a" value="saveedit" />
	<input type="hidden" name="id" id="id" value="<!--{$id}-->" />
  <div class="layui-card">
    <div class="layui-card-header">编辑单页</div>
    <div class="layui-card-body">
      <table class="oe_tbl_form layui-form">
        <tr>
          <th width="15%"><font color="red">*</font> 标&#12288;&#12288;题：</th>
          <td width="35%">
            <input type="text" name="title" id="title" class="layui-input input-300" value="<!--{$about.title}-->" />
          </td>
          <th width="15%">所属分类：</th>
          <td width="35%">
            <div class="input-200">
            <!--{hook mod='aboutcat' type='select' name='catid' text='=请选择=' value=$about.catid}-->
            </div>
          </td>
        </tr>
        <tr>
          <th>状&#12288;&#12288;态：</th>
          <td>
            <input type="radio" name="flag" title="正常" value="1"<!--{if $about.flag == '1'}--> checked<!--{/if}--> />
            <input type="radio" name="flag" title="锁定" value="0"<!--{if $about.flag == '0'}--> checked<!--{/if}--> />
          </td>
          <th>导&#12288;&#12288;航：</th>
          <td>
            PC导航：
            <div class="input-100">
              <select name="elite" id="elite">
                <option value="">=请选择=</option>
                <option value="1"<!--{if $about.elite == '1'}--> selected<!--{/if}-->>开启</option>
                <option value="0"<!--{if $about.elite == '0'}--> selected<!--{/if}-->>关闭</option>
              </select>
            </div>
            &#12288;
            WAP导航：
            <div class="input-100">
              <select name="wapelite" id="wapelite">
                <option value="">=请选择=</option>
                <option value="1"<!--{if $about.wapelite == '1'}--> selected<!--{/if}-->>开启</option>
                <option value="0"<!--{if $about.wapelite == '0'}--> selected<!--{/if}-->>关闭</option>
              </select>
            </div>
          </td>
        </tr>
        
        <tr>
          <th>排&#12288;&#12288;序：</th>
          <td>
            <input type="text" name="orders" id="orders" class="layui-input input-100" value="<!--{$about.orders}-->" />
          </td>
          <th>浏览次数：</th>
          <td>
            <input type="text" name="hits" id="hits" class="layui-input input-100" value="<!--{$about.hits}-->" />
          </td>
        </tr>
        <tr>
          <th>图&#12288;&#12288;文：</th>
          <td>
            <div class="layui-btn">
              <i class="layui-icon layui-icon-upload"></i>
              点击上传
              <input type="file" name="img" id="img" f="but_upload_image" data-thumb="1" />
            </div>
            <div class="upload_loading" id="img_loading" style="display:none;"></div>
            <input type="hidden" id="img_thumb" name="thumbimg" value="<!--{$about.thumbimg}-->" />
            <input type="hidden" id="img_url" name="drawimg" value="<!--{$about.drawimg}-->" />
        
            <div class="tblform_tips normal">&nbsp;&nbsp;&nbsp;预览：</div>
            <div class="upload_pic upload_pic_md" style="width:30px;height:30px;">
              <img src="<!--{$urlpath}--><!--{if !empty($aboutcat.thumbimg)}--><!--{$aboutcat.thumbimg}--><!--{else}-->tpl/static/images/nopic.jpg<!--{/if}-->" id="img_preview" f="viewimg" />
            </div>
            <a href="javascript:;" class="oe_deluploadimg" f="removeimg" data-preview="img" data-input="img">移除</a>
          </td>
          <th>链接nofollow：</th>
          <td>
            <div class="input-100">
            <select name="nofollow" id="nofollow">
              <option value="">=请选择=</option>
              <option value="1"<!--{if $about.nofollow == '1'}--> selected<!--{/if}-->>是</option>
              <option value="0"<!--{if $about.nofollow == '0'}--> selected<!--{/if}-->>否</option>
            </select>
            </div>
          </td>
        </tr>

        <tr>
          <th>指定模板：</th>
          <td colspan="3" style="line-height:45px;">
            PC：tpl/templets/<!--{$config.templet}-->/&nbsp;
            <input type="text" name="tplname" id="tplname" class="layui-input input-200" value="<!--{$about.tplname}-->" />.tpl
            <br />
            WAP：tpl/wbapp/&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <input type="text" name="wtplname" id="wtplname" class="layui-input input-200" value="<!--{$about.wtplname}-->" />.tpl
          </td>
        </tr>
        <tr>
          <th>PC内容：</th>
          <td colspan="3">
            <textarea name="content" id="content" class="layui-textarea" style="width:98%;height:300px;display:none;"><!--{$about.content}--></textarea>
          </td>
        </tr>
        <tr style="display:none;">
          <th>WAP手机版内容：</th>
          <td colspan="3">
            <textarea name="wcontent" id="wcontent" class="layui-textarea" style="width:90%;height:300px;display:none;"><!--{$about.wcontent}--></textarea>
          </td>
        </tr>
        <tr>
          <th>meta标题：</th>
          <td colspan="3">
            <input type="text" name="metatitle" id="metatitle" class="layui-input" style="width:50%;" value="<!--{$about.metatitle}-->" />
          </td>
        </tr>
        <tr>
          <th>Meta描述：</th>
          <td colspan="3">
            <textarea name="metadesc" id="metadesc" class="layui-textarea" style="width:50%;height:40px;"><!--{$about.metadesc}-->
          </textarea></td>
        </tr>
        <tr>
          <th>Meta关键词：</th>
          <td colspan="3">
            <textarea name="metakeyword" id="metakeyword" class="layui-textarea" style="width:50%;height:40px;"><!--{$about.metakeyword}--></textarea>
          </td>
        </tr>
      </table>
    </div>
  </div>
  </form>
  <!--{include file="<!--{$oetplpath}-->widget_editor.tpl"}-->
  
  <div class="oe_kong"></div>
  <div class="oe_tbl_form_btn current">
    <button class="layui-btn" id="but_submit_post" lay-submit lay-filter="editform">
      编辑保存
      <span class="oe_btn_loading layui-anim layui-icon layui-anim-rotate layui-anim-loop" style="display:none;">&#xe63d;</span>
    </button>
  </div>
  
</div>
<script type="text/javascript">
$(function(){

    layui.use('form', function(){
        $form = layui.form;
        //保存...
        $form.on('submit(editform)', function(data){
            $obj_id = data.elem.getAttribute("id");
            if (!$("#"+$obj_id).hasClass("forbid_submit")) {
            
                if ($("#title").val().length  == 0) {
                    layer.msg("请填写标题");
                    return false;
                }
                
                $("#"+$obj_id).addClass("forbid_submit");
                if ($("#"+$obj_id).find("span").length > 0) {
                    $("#"+$obj_id).find("span").show();
                }
                //...
                $("#content").text(OEeditor.html());
                $("#myform").submit();
            }
        });   
    });
    
});
</script>
<!--{/if}-->
</body>
</html>