<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>一键生成会议签到链接1.2</title>
    <style>
      body {
        font-family: Arial, sans-serif;
        font-size: 16px;
        line-height: 1.5;
        padding: 20px;
        background-color: #f5f5f5;
      }
<pre><code>  h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 20px;
    text-align: center;
    color: #007bff;
  }
  
  form {
    max-width: 500px;
    margin: 0 auto;
    background-color: #fff;
    padding: 30px;
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, .1);
  }
  
  label {
    display: block;
    margin-bottom: 10px;
    color: #555;
    font-weight: 500;
  }
  
  input[type=&quot;number&quot;],
  input[type=&quot;text&quot;],
  textarea {
    display: block;
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 3px;
    margin-bottom: 20px;
    font-size: 16px;
    font-weight: 400;
    color: #555;
  }
  
  input[type=&quot;number&quot;]:focus,
  input[type=&quot;text&quot;]:focus,
  textarea:focus {
    outline: none;
    border-color: #007bff;
  }
  
  button {
    display: inline-block;
    padding: 10px 20px;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: 3px;
    background-color: #007bff;
    color: #fff;
    transition: all .15s ease-in-out;
    margin-bottom: 20px;
  }
  
  button:hover {
    background-color: #0069d9;
    border-color: #0062cc;
  }
  
  textarea {
    resize: none;
    font-size: 16px;
    font-weight: 400;
    color: #555;
  }
  
  .copy-link {
    display: inline-block;
    padding: 10px 20px;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    border: 1px solid #007bff;
    border-radius: 3px;
    background-color: #fff;
    color: #007bff;
    transition: all .15s ease-in-out;
    margin-left: 10px;
  }
  
  .copy-link:hover {
    background-color: #007bff;
    color: #fff;
  }
&lt;/style&gt;
</code></pre>
</head>
<body>
  <h1>一键生成会议签到链接1.2</h1>
  <form>
    <label for="coder">课程代码</label>
    <input type="number" name="coder" id="coder" required>
<pre><code>&lt;label for=&quot;timer&quot;&gt;增加小时(默认值即可)&lt;/label&gt;
&lt;input type=&quot;number&quot; name=&quot;timer&quot; id=&quot;timer&quot; value=&quot;7&quot;&gt;

&lt;label for=&quot;date&quot;&gt;指定时间(格式:YYYY-MM-DD HH:MM:SS)&lt;/label&gt;
&lt;input type=&quot;text&quot; value=&quot;&quot; name=&quot;&quot; id=&quot;date&quot;&gt;&lt;br/&gt;

&lt;script&gt;
  // 获取当前时间
  setInterval(() =&gt; {
    var now = new Date();
    // 格式化时间
    var year = now.getFullYear();
    var month = now.getMonth() + 1;
    var day = now.getDate();
    var hour = now.getHours();
    var minute = now.getMinutes();
    var second = now.getSeconds();
    var formattedTime = year + '-' + addZero(month) + '-' + addZero(day) + ' ' + addZero(hour) + ':' + addZero(minute) + ':' + addZero(second);
    // 将格式化后的时间赋值给input元素的value属性
    document.getElementById('date').value = formattedTime;
  }, 2000);

  // 补零函数,用于确保月份、日期、小时、分钟和秒数的两位数格式
  function addZero(num) {
    if (num &lt; 10) {
      return '0' + num;
    } else {
      return num;
    }
  }
&lt;/script&gt;

&lt;button type=&quot;button&quot; onclick=&quot;getLink()&quot;&gt;点击生成&lt;/button&gt;

&lt;label for=&quot;link&quot;&gt;生成会议签到链接&lt;/label&gt;
&lt;textarea name=&quot;link&quot; id=&quot;link&quot; cols=&quot;30&quot; rows=&quot;10&quot; readonly&gt;&lt;/textarea&gt;

&lt;button type=&quot;button&quot; onclick=&quot;copyLink()&quot;&gt;复制链接&lt;/button&gt;
</code></pre>
  </form>
  <script>
    const coder = document.getElementById('coder');
    const timer = document.getElementById('timer');
    const link = document.getElementById('link');
    const date = document.getElementById('date');
    
    function getLink(){
      if(!coder.value || !timer.value || !date.value) {
        alert("请填写所有内容");
        return;
      }
      
      const timeStamp = Math.floor(new Date(date.value).getTime() / 1000) + timer.value * 3600;
      const url = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx23e1a7bd726c18b8&redirect_uri=http://www.jsscme.com/hyt/Home/qd.php?gid=${coder.value}-${timeStamp}&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect`;
      
      link.value = url;
    }

    function copyLink(){
      link.select();
      document.execCommand("Copy");
      alert("复制成功!");
    }
  </script>
</body>
</html>
New chatquiritalorena764outlookcom!DOCTYPE htmlhtml lang=enhead meta charset=UTF-8 meta http-equiv=X-UA-Compatible content=IE=edge meta name=viewport content=width=device-width initial-scale=10 ti

原文地址: https://www.cveoy.top/t/topic/OhX 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录