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

<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">
        <!--{if $from == "view"}-->
        <a href="<!--{$oefile}-->&c=<!--{$c}-->&a=view&id=<!--{$party.partyid}-->&<!--{$comeurl}-->">&lt;&lt;返回上一页</a>
        <!--{else}-->
        <a href="<!--{$oefile}-->&c=<!--{$c}-->&<!--{$comeurl}-->">&lt;&lt;返回上一页</a>
        <!--{/if}-->
      </span>
    </div> 
  </div>
  
  <form class="layui-form" id="myform" action="<!--{$oefile}-->&c=<!--{$c}-->&<!--{$comeurl}-->&from=<!--{$from}-->" 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">
    
      <div class="layui-tab">
        <ul class="layui-tab-title">
          <li class="layui-this">基本信息</li>
          <li>活动详情</li>
          <!--//21.04.28-->
          <!--{if $config.baidumap_flag == "1"}-->
          <li>标注地图</li>
          <!--{/if}-->
          <li>活动回顾</li>
        </ul>
        
        <div class="layui-tab-content">
        
          <div class="layui-tab-item layui-show">
            <table class="oe_tbl_form layui-form">
              <tr>
                <th><font color="red">*</font> 活动标题：</th>
                <td colspan="3">
                  <input type="text" name="title" id="title" class="layui-input input-300" value="<!--{$party.title}-->" />
                </td>
              </tr>
              <tr>
                <th width="15%"><font color="red">*</font> 活动分类：</th>
                <td width="35%">
                  <div class="input-150">
                  <!--{hook mod='var' item='partycat' type='select' name='catid' text='=请选择=' value=$party.catid}-->
                  </div>
                </td>
                <th width="15%">封面图片：</th>
                <td width="35%">
                  <div class="layui-btn">
                    <i class="layui-icon layui-icon-upload"></i>
                    点击上传
                    <input type="file" name="img" id="img" f="but_upload_image" data-mod="party" data-thumb="1" />
                  </div>
                  <div class="upload_loading" id="img_loading" style="display:none;"></div>
                  <input type="hidden" id="img_thumb" name="thumbimg" value="<!--{$party.thumbimg}-->" />
                  <input type="hidden" id="img_url" name="drawimg" value="<!--{$party.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($party.thumbimg)}--><!--{$party.thumbimg}--><!--{else}-->tpl/static/images/nopic.jpg<!--{/if}-->" data-img="<!--{$party.drawimg}-->" id="img_preview" f="viewimg" />
                  </div>
                  <a href="javascript:;" class="oe_deluploadimg" f="removeimg" data-preview="img" data-input="img">移除</a>
                </td>
              </tr>

              <tr>
                <th><font color="red">*</font> 活动城市： </th>
                <td colspan="3">
                  <div class="layui-input-inline input-100">
                    <!--{assign var="distlist" value=vo_list("mod={area} where={v.parentid='0'} orderby={v.orders ASC}")}-->
                    <select name="area1" id="area1" lay-filter="area" data-depth="1" data-name="area" data-text="=请选择=">
                      <option value="">=请选择=</option>
                      <!--{foreach $distlist as $val}-->
                      <option value="<!--{$val.areaid}-->"<!--{if $party.area1 == $val.areaid}--> selected<!--{/if}-->><!--{$val.areaname}--></option>
                      <!--{/foreach}-->
                    </select>
                  </div>
                  <div class="layui-input-inline input-100" id="json_area2">
                    <!--{if $party.area1 > 0}-->
                    <!--{assign var="distlist2" value=vo_list("mod={area} where={v.parentid='<!--{$party.area1}-->'}")}-->
                    <select name="area2" id="area2" lay-filter="area" data-depth="2" data-name="area" data-text="=请选择=">
                      <option value="">=请选择=</option>
                      <!--{foreach $distlist2 as $val}-->
                      <option value="<!--{$val.areaid}-->"<!--{if $party.area2 == $val.areaid}--> selected<!--{/if}-->><!--{$val.areaname}--></option>
                      <!--{/foreach}-->
                    </select>
                    <!--{else}-->
                    <select name="area2" id="area2" lay-filter="area">
                      <option value="">=请选择=</option>
                    </select>
                    <!--{/if}-->
                  </div>
                  <div class="layui-input-inline input-120" id="json_area3">
                    <!--{if $party.area2 > 0}-->
                    <!--{assign var="distlist3" value=vo_list("mod={area} where={v.parentid='<!--{$party.area2}-->'}")}-->
                    <select name="area3" id="area3" lay-filter="area" data-depth="3" data-name="area" data-text="=请选择=">
                      <option value="">=请选择=</option>
                      <!--{foreach $distlist3 as $val}-->
                      <option value="<!--{$val.areaid}-->"<!--{if $party.area3 == $val.areaid}--> selected<!--{/if}-->><!--{$val.areaname}--></option>
                      <!--{/foreach}-->
                    </select>
                    <!--{else}-->
                    <select name="area3" id="area3" lay-filter="area">
                      <option value="">=请选择=</option>
                    </select>
                    <!--{/if}-->
                  </div>
                  <div class="layui-input-inline input-120" id="json_area4">
                    <!--{if $party.area3 > 0}-->
                    <!--{assign var="distlist4" value=vo_list("mod={area} where={v.parentid='<!--{$party.area3}-->'}")}-->
                    <select name="area4" id="area4" lay-filter="area" data-depth="3" data-name="area" data-text="=请选择=">
                      <option value="">=请选择=</option>
                      <!--{foreach $distlist4 as $val}-->
                      <option value="<!--{$val.areaid}-->"<!--{if $party.area4 == $val.areaid}--> selected<!--{/if}-->><!--{$val.areaname}--></option>
                      <!--{/foreach}-->
                    </select>
                    <!--{else}-->
                    <select name="area4" id="area4" lay-filter="area">
                      <option value="">=请选择=</option>
                    </select>
                    <!--{/if}-->
                  </div>
                </td>
              </tr>
              <tr>
                <th><font color="red">*</font> 活动地址：</th>
                <td colspan="3">
                  <input type="text" name="address" id="address" class="layui-input input-300" value="<!--{$party.address}-->" />
                </td>
              </tr>
              
              <tr>
                <th>交通线路：</th>
                <td>
                  <input type="text" name="traffic" id="traffic" class="layui-input input-300" value="<!--{$party.traffic}-->" />
                </td>
                <th><font color="red">*</font> 联系方式：</th>
                <td>
                  <input type="text" name="contact" id="contact" class="layui-input input-300" value="<!--{$party.contact}-->" /><br />
                  <span class="text_tip_inline">（填写活动主办方联系电话）</span>
                </td>
              </tr>
              <tr>
                <th>活动说明：</th>
                <td colspan="3">
                  <textarea name="explain" id="explain" class="layui-textarea" style="width:50%;height:60px;"><!--{$party.explain}--></textarea>
                  <span class="text_tip_inline">（简要描述活动的特别说明信息，100个字以内）</span>
                </td>
              </tr>
              <tr>
                <th>活动简介：<span class="f_red"></span> </th>
                <td colspan="3">
                  <textarea name="intro" id="intro" class="layui-textarea" style="width:50%;height:90px;"><!--{$party.intro}--></textarea>
                  <span class="text_tip_inline"> （活动简介，250个字以内）</span>
                </td>
              </tr>
              <tr>
                <th><font color="red">*</font> 活动状态：</th>
                <td>
                  <div class="input-150">
                  <select name="flag" id="flag">
                    <option value="">请选择</option>
                     <option value="1"<!--{if $party.flag == '1'}--> selected<!--{/if}-->>已通过</option>
                    <option value="2"<!--{if $party.flag == '2'}--> selected<!--{/if}-->>未通过</option>
                    <option value="3"<!--{if $party.flag == '3'}--> selected<!--{/if}-->>已结束</option>
                    <option value="0"<!--{if $party.flag == '0'}--> selected<!--{/if}-->>待审核</option>
                  </select>
                  </div>
                </td>
                <th>推荐：<span class="f_red"></span> </th>
                <td>
                  <input type="radio" name="elite" title="是，" value="1"<!--{if $party.elite == '1'}--> checked<!--{/if}--> />
                  <input type="radio" name="elite" title="否" value="0"<!--{if $party.elite == '0'}--> checked<!--{/if}--> />
                </td>
              </tr>
              <tr>
                <td colspan="4"><b>分享设置</b>&nbsp;&nbsp;&nbsp;<font color="red">（分享活动到QQ、微博、朋友圈等）</font></td>
              </tr>
              <tr>
                <th>分享标题：</th>
                <td colspan="3">
                  <input type="text" name="sharetitle" id="sharetitle" class="layui-input" style="width:50%;" value="<!--{$party.sharetitle}-->" />
                </td>
              </tr>
              <tr>
                <th>分享描述：</th>
                <td colspan="3">
                  <textarea name="shareintro" id="shareintro" class="layui-textarea" style="width:50%;height:50px;"><!--{$party.shareintro}--></textarea>
                </td>
              </tr>
            </table>
          </div>
          <!--//tab content End -->
        
                 
          <div class="layui-tab-item">
            <table class="oe_tbl_form layui-form">
              <tr>
                <th><font color="red">*</font> 开始时间：</th>
                <td colspan="3">
                  日期：<input type="text" name="sdate" id="sdate" class="layui-input input-150" readonly="only" value="<!--{$party.starttime|date_format:"%Y-%m-%d"}-->" />&nbsp;&nbsp;
                  时间：<input type="text" name="stime" id="stime" class="layui-input input-150" readonly="only" value="<!--{$party.starttime|date_format:"%H:%M:%S"}-->" />
                  <script type="text/javascript">
                  $(function(){
                      layui.use('laydate', function(){
                          $laydate = layui.laydate;
                          $laydate.render({
                              elem: "#sdate"
                          });
                          
                          $laydate.render({
                              elem: "#stime",
                              type: "time"
                          });
                      });
                  });
                  </script>
                </td>
              </tr>
              <tr>
                <th><font color="red">*</font> 结束时间：</th>
                <td colspan="3">
                  日期：<input type="text" name="edate" id="edate" class="layui-input input-150" readonly="only" value="<!--{$party.endtime|date_format:"%Y-%m-%d"}-->" />&nbsp;&nbsp;
                  时间：<input type="text" name="etime" id="etime" class="layui-input input-150" readonly="only" value="<!--{$party.endtime|date_format:"%H:%M:%S"}-->" />
                  <script type="text/javascript">
                  $(function(){
                      layui.use('laydate', function(){
                          $laydate.render({
                              elem: "#edate"
                          });
                          
                          $laydate.render({
                              elem: "#etime",
                              type: "time"
                          });
                      });
                  });
                  </script>
                </td>
              </tr>
              <tr>
                <th><font color="red">*</font> 截止报名：</th>
                <td colspan="3">
                  日期：<input type="text" name="bmdate" id="bmdate" class="layui-input input-150" readonly="only" value="<!--{$party.endbmtime|date_format:"%Y-%m-%d"}-->" />&nbsp;&nbsp;
                  时间：<input type="text" name="bmtime" id="bmtime" class="layui-input input-150" readonly="only" value="<!--{$party.endbmtime|date_format:"%H:%M:%S"}-->" />
                  <script type="text/javascript">
                  $(function(){
                      layui.use('laydate', function(){
                          $laydate.render({
                              elem: "#bmdate"
                          });
                          
                          $laydate.render({
                              elem: "#bmtime",
                              type: "time"
                          });
                      });
                  });
                  </script>
                </td>
              </tr>
              <tr>
                <th width="15%"><font color="red">*</font> 女士上限：</th>
                <td width="35%">
                  <input type="text" name="limitlady" id="limitlady" class="layui-input input-100" value="<!--{$party.limitlady}-->" /> 人（0表示不限制）
                </td>
                <th width="15%"><font color="red">*</font> 男士上限：</th>
                <td width="35%">
                  <input type="text" name="limitman" id="limitman" class="layui-input input-100" value="<!--{$party.limitman}-->"  /> 人（0表示不限制）
                </td>
              </tr>
              <tr>
                <th>女士费用：</th>
                <td>
                  <input type="text" name="moneylady" id="moneylady" class="layui-input input-100" value="<!--{doubleval($party.moneylady)}-->" /> 元（0表示免费）
                </td>
                <th>男士费用：</th>
                <td>
                  <input type="text" name="moneyman" id="moneyman" class="layui-input input-100" value="<!--{doubleval($party.moneyman)}-->" /> 元 （0表示免费）
                </td>
              </tr>
            </table>
            <table class="oe_tbl_form layui-form">
              <tr>
                <th width="15%">活动详情：<span class="f_red"></span></th>
                <td width="85%">
                  <textarea name="content" id="content" class="layui-textarea" style="width:99%;height:350px;display:none;"><!--{$party.content}--></textarea>
                </td>
              </tr>
            </table>
          </div>
          <!--//tab content End -->
          <!--{include file="<!--{$oetplpath}-->widget_editor.tpl"}-->
          <!--{include file="<!--{$oetplpath}-->block_map.tpl"}-->
          <!--//21.04.28-->
          <!--{if $config.baidumap_flag == "1"}-->
          <div class="layui-tab-item">
            <table class="oe_tbl_form layui-form">
              <tr>
                <th width="15%">标注地图：</th>
                <td width="85%">
                  搜索地址：<input type="text" name="maplocation" id="maplocation" class="layui-input input-150" />
                  <input type="button" name="btn_sermap" id="btn_sermap" f="but_sermap_location" class="layui-btn oe_btn_32" value="搜索" />&nbsp;&nbsp;&nbsp;
                  地图坐标：
                  经度：<input type="text" name="maplng" id="maplng" class="layui-input input-150" value="<!--{$party.maplng}-->" />&nbsp;&nbsp;&nbsp;
                  纬度：<input type="text" name="maplat" id="maplat" class="layui-input input-150" value="<!--{$party.maplat}-->" />
                  <br />
                  <font color="red">（鼠标右击地图，出现红色标注，拖动红色标注可设置地图坐标）</font>
                  <div id="oe_map" style="width:800px;height:400px;margin-top:10px;">
                  </div>
                </td>
              </tr>
            </table>
          </div>
          <!--{/if}-->
          <!--//tab content End -->
          
          <div class="layui-tab-item">
            <table class="oe_tbl_form layui-form">
              <tr>
                <th width="15%">活动回顾：<span class="f_red"></span></th>
                <td width="85%">
                  <textarea name="review" id="review" class="layui-textarea" style="width:99%;height:350px;display:none;"><!--{$party.review}--></textarea>
                </td>
              </tr>
            </table>
          </div>
          <!--//tab content End -->
          <script type="text/javascript">
          var OEeditor2;
          KindEditor.ready(function(K) {
              OEeditor2 = K.create('textarea[name="review"]', {
              
              });
          });
          </script>
          
        </div>
        <!--//content End -->
            
      </div>
      <!--//tab End -->
      
      
    </div>
  </div>
  </form>
  
  
  <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(['layer', 'element'], 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;
                }
                if ($("#catid").val().length == 0) {
                    layer.msg("请选择活动分类");
                    return false;
                }
                if ($("#area1").val().length == 0) {
                    layer.msg("请选择活动城市");
                    return false;
                }
                if ($("#address").val().length == 0) {
                    layer.msg("请填写活动地址");
                    return false;
                }
                if ($("#contact").val().length == 0) {
                    layer.msg("请填写联系方式");
                    return false;
                }
                
                if ($("#sdate").val().length == 0) {
                    layer.msg("请填写活动开始时间");
                    return false;
                }
                if ($("#edate").val().length == 0) {
                    layer.msg("请填写活动结束时间");
                    return false;
                }
                if ($("#bmdate").val().length == 0) {
                    layer.msg("请填写截止报名时间");
                    return false;
                }
                if ($("#limitlady").val().length == 0) {
                    layer.msg("请填写女士上限");
                    return false;
                }
                if ($("#limitman").val().length == 0) {
                    layer.msg("请填写男士上限");
                    return false;
                }
                $("#content").text(OEeditor.html());
                $("#review").text(OEeditor2.html());
                
                $("#"+$obj_id).addClass("forbid_submit");
                if ($("#"+$obj_id).find("span").length > 0) {
                    $("#"+$obj_id).find("span").show();
                }
               
                $("#myform").submit();
            }
        });   
    });
    
});
</script>

</body>
</html>