联系官方销售客服

1835022288

028-61286886

开发框架 版主:迅睿框架研发组
提交数据有保存吗?提交后如何获取
类型:迅睿CMS 更新时间:2023-06-16 16:43:12

{template "header.html"}
<html>
<body style="position: relative;">
  {php extract(dr_get_form_post_value('myform'))}
  <header class="hui-header" style="background: #d3250e;height: 50px;line-height: 50px;">
    <div id="hui-back"></div>
    <h1>{$cat.name}</h1>
    <a id="hui-search" href="javascript:dr_m_top_category();"><i style="margin-top: 15px;"
        class="fa fa-navicon"></i></a>
  </header>
  {if $cat.id == '15'}
  <div style="height:calc(100vh - 50px);margin-top: 50px;">
    <div style="width: 100%;height: 100%;">
      {if dr_get_form_post_value('myform')}
        <div style="padding: 20px 15px;color: #ccc;font-size: 18px;background: #fff;width: 90%;margin: 0 auto;">
          <div style="display: flex;align-items: center; justify-content: space-between;">
            <div style="display: flex;align-items: center;">
              <img style="width: 40px;height:40px;" src="../../../../static/assets/matter/tx.png" alt="">
              <div style="color: #000;margin-left: 8px;">{dr_strcut($c.liuyan, 1,'**')}</div>
            </div>
            <div style="font-size: 14px;">{dr_date($c.inputtime, 'Y-m-d')}</div>
          </div>
          <div style="width: 78%;margin: 8px auto;font-size: 16px">留言内容:{$t.liuyan}</div>
        </div>
      {else}
        <div style="width: 100%;height: 100%;display: flex;justify-content: center;align-items: center;">
          <img src="../../../../static/assets/matter/no-data.png" alt="">
        </div>
      {/if}
      <div style="height: 100px;background: #f5f6f8;"></div>
      <div style="width: 100%;position: fixed;bottom: 15px;display: flex;align-items: center;justify-content: center;">
        <div
          style="position: absolute;bottom: 15px;width: 90%;background: #fff;line-height: 50px;text-align: center;font-size: 16px;color: #4b7eff;">
          <a href="/index.php?c=category&id=564" id="triggerBtn"
            style="color: #4b7eff;display: flex;align-items: center;justify-content: center;">
            <img style="width: 20px;" src="../../../../static/assets/matter/liuyan.png" alt="">
            <div style="margin-left: 6px;">填写留言</div>
          </a>
        </div>
      </div>
    </div>
  </div>
  {/if}
  {if $cat.id == '564'}
  <div style="height:calc(100vh - 50px);margin-top: 50px;">
    <form action="{/index.php?c=category&id=15}&is_show_msg=1" method="post" name="myform" id="myform" class="myform" target="frameName">
      <div class="leave leaves">
        <div class="titl">
          您的姓名
        </div>
        <input style="border: none;padding: 0;" type="text" name="data[liuyan]" id="dr_liuyan" value="" placeholder="请输入您的姓名" />
      </div>
      <div class="leave leaves">
        <div class="titl">
          手机号
        </div>
        <input style="border: none;padding: 0;" type="text" name="data[shoujihao]" id="dr_shoujihao" value="" placeholder="请输入您的手机号" />
      </div>
      <div class="leave leaves">
        <div class="titl">
          邮箱
        </div>
        <input style="border: none;padding: 0;" type="text" name="data[youxiang]" id="dr_youxiang" value="" placeholder="请输入您的邮箱" />
      </div>
      <div class="leave leaves">
        <div class="titl">
          留言
        </div>
        <textarea placeholder="请输入留言" type="text" name="data[title]" id="dr_title" value=""
          style="width:100%; height:146px; outline: none; padding:15px;margin-top: 10px;">  </textarea>
      </div>
      <div style="display:flex;justify-content: center;align-items: center; width:100%;">
        <a href="/index.php?c=category&id=15" onclick="aa()" type="submit"
          style="border:none; background:#D3250E; color:#FFFFFF; padding:10px; font-size:16px;width: 90%;border-radius: 5px;text-align: center;">
          提交</a>
      </div>
    </form>
  </div>
  <div
    style="background:rgba(0, 0, 0, 0.5); width:140px;padding:10px; border-radius: 5px; position:absolute; right:35%;top: 30%; display:none; z-index:888;"
    id="tishi">
    <div
      style="display:flex;flex-direction: column;justify-content: center;align-items: center;color: #fff;font-size: 16px;">
      <div>
        <img style="color: #fff;margin-bottom: 10px;width:30px;height:30px;"
          src="../../../../static/assets/matter/chenggong.png" alt="" />
      </div>
      <div>
        留言发表成功
      </div>
    </div>
  </div>
  {/if}
  {php extract(dr_get_form_post_value('myform'))}
</body>

</html>

<script type="text/javascript" charset="utf-8">
  let Timer = ''
  function aa() {
    var tishi = document.getElementById("tishi");
    tishi.style.display = "block";
    Timer = setTimeout(() => {
      tishi.style.display = "none";
    }, 3000)
  }

  // 清除定时器
  function clear(){
    for (let i = 0; i <= Timer+2; i++) {
      console.log('2023-06-16 09:49:53 --- 打印', i)
      // 清除setTimeout创建的定时器
      clearTimeout(i)
    }
  }
</script>

<style>
  .leaves{
    padding: 15px;
    background: #fff;
  }
  .titl{
    font-size: 16px;
    font-weight: bold;
  }
</style>