<extend name="Public/promote_base"/>
<block name="css">
  <link rel="stylesheet" href="__CSS__/20170831/select2.min.css" type="text/css"/>
  <link href="__CSS__/20180207/data.css" rel="stylesheet">
  <link href="__CSS__/20180207/game.css" rel="stylesheet">
  <link href="__CSS__/20180207/finance.css" rel="stylesheet">
  <link href="__CSS__/detailed.css?v=1.1" rel="stylesheet">

  <style type="text/css">
    .trunk-content {
      margin: 0 2%;
    }

    .input-security {
      width: 500px;
      height: 2.4rem;
      padding-left: 10px;
      border-radius: 5px;
      border: 1px solid #E5E5E5;
      border-radius: 5px;
    }

    .btn-security {
      width: 246px;
      height: 2.4rem;
      border: 0;
      border-radius: 5px;
      background-color: #358fe4;
      color: #fff;
    }

    .btn-security-close {
      width: 246px;
      height: 2.4rem;
      border: 1px solid #E5E5E5;
      border-radius: 5px;
      background-color: #fff;
      color: #999;
    }

    .detailed-content-box {
      width: auto;
      padding-left: 0;
    }
  </style>
</block>

<block name="body">
  <div class="page-list normal_list apply-index-list jssearch">
    <div class="trunk-title">
      <div class="location">
        <div class="location-container">当前位置:
          <volist name="modelList" id="vo" key="k">
            <?php if ($k == count($modelList)) {
              echo "<span>$vo</span>";
            } else {
              echo "<span>$vo></span>";
            }?>
          </volist>
        </div>
      </div>
      <span class="title_main">安全密码</span>
    </div>
    <div class="trunk-content article">
      <div class="trunk-search clearfix" style="display: table-caption;">
        <div class="tab detailed-box" style="margin-top: 40px;align-items: center;">
          <label class="detailed-title detailed-label" style="margin-right: 20px;">安全密码:</label>
          <div class="detailed-content-box">
            <input class="input-security" id="security_password" type="password" placeholder="安全密码">
          </div>
        </div>
        <div class="tab detailed-box">
          <label class="detailed-title detailed-label" style="margin-right: 20px;"></label>
          <div class="detailed-content-box" style="display: flex;width: 100%;margin-left: 20px;">
            <button class="btn-security" style="margin-right: 20px;">确定</button>
            <button class="btn-security-close">取消</button>
          </div>
        </div>
      </div>
    </div>
  </div>
</block>
<block name="script">
  <script type="text/javascript" src="__JS__/20170831/select2.min.js"></script>
  <script type="text/javascript">
      $(document).ready(function () {
          $(".select_gallery").select2();

          $('.btn-security').on('click', function () {
              var password = $('#security_password').val();

              $.ajax({
                  type: "post",
                  url: "__URL__/verifyPassword",
                  dataType: "json",
                  data: {'password': password},
                  success: function (data) {
                      if (data.status == 1) {
                          window.location.reload();
                      } else {
                          layer.msg(data.msg, {icon: 5});
                      }
                  },
                  error: function (result) {
                      layer.msg('网络异常', {icon: 5});
                  }
              });
          });

          $('.btn-security-close').on('click', function () {
              window.location.href = "{:U('Promote/index')}";
          });
      });
  </script>
</block>