1. 最近死了么,挺火的,用ai写了个活着么,短信自己配置就行,保存到本地.html就可以..
    短信自己配置就行,保存到本地.html就可以

  2. <!DOCTYPE html>
  3. <html lang=“zh-CN”>
  4. <head>
  5.     <meta charset=“UTF-8”>
  6.     <meta name=“viewport” content=“width=device-width, initial-scale=1.0”>
  7.     <title>活着么签到系统</title>
  8.     <style>
  9.         * {
  10.             margin: 0;
  11.             padding: 0;
  12.             box-sizing: border-box;
  13.             font-family: ‘PingFang SC’, ‘Microsoft YaHei’, sans-serif;
  14.         }
  15.          
  16.         body {
  17.             background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  18.             min-height: 100vh;
  19.             display: flex;
  20.             justify-content: center;
  21.             align-items: center;
  22.             padding: 20px;
  23.         }
  24.          
  25.         .container {
  26.             width: 100%;
  27.             max-width: 500px;
  28.             background: white;
  29.             border-radius: 16px;
  30.             box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  31.             overflow: hidden;
  32.         }
  33.          
  34.         .header {
  35.             background: #4a6bdf;
  36.             color: white;
  37.             padding: 25px 20px;
  38.             text-align: center;
  39.         }
  40.          
  41.         .header h1 {
  42.             font-size: 24px;
  43.             font-weight: 600;
  44.         }
  45.          
  46.         .form-container {
  47.             padding: 25px;
  48.         }
  49.          
  50.         .form-group {
  51.             margin-bottom: 20px;
  52.         }
  53.          
  54.         .form-group label {
  55.             display: block;
  56.             margin-bottom: 8px;
  57.             font-weight: 500;
  58.             color: #333;
  59.         }
  60.          
  61.         .form-group input {
  62.             width: 100%;
  63.             padding: 14px;
  64.             border: 1px solid #ddd;
  65.             border-radius: 8px;
  66.             font-size: 16px;
  67.             transition: border-color 0.3s;
  68.         }
  69.          
  70.         .form-group input:focus {
  71.             border-color: #4a6bdf;
  72.             outline: none;
  73.             box-shadow: 0 0 0 2px rgba(74, 107, 223, 0.2);
  74.         }
  75.          
  76.         .btn {
  77.             width: 100%;
  78.             padding: 14px;
  79.             background: #4a6bdf;
  80.             color: white;
  81.             border: none;
  82.             border-radius: 8px;
  83.             font-size: 16px;
  84.             font-weight: 500;
  85.             cursor: pointer;
  86.             transition: background 0.3s;
  87.         }
  88.          
  89.         .btn:hover {
  90.             background: #3a5bce;
  91.         }
  92.          
  93.         .btn:disabled {
  94.             background: #b0b0b0;
  95.             cursor: not-allowed;
  96.         }
  97.          
  98.         .view {
  99.             display: none;
  100.         }
  101.          
  102.         .view.active {
  103.             display: block;
  104.             animation: fadeIn 0.3s ease;
  105.         }
  106.          
  107.         @keyframes fadeIn {
  108.             from { opacity: 0; }
  109.             to { opacity: 1; }
  110.         }
  111.          
  112.         .user-info {
  113.             background: #f9f9f9;
  114.             padding: 15px;
  115.             border-radius: 8px;
  116.             margin-bottom: 20px;
  117.         }
  118.          
  119.         .user-info p {
  120.             margin-bottom: 8px;
  121.             color: #555;
  122.         }
  123.          
  124.         .user-info span {
  125.             font-weight: 500;
  126.             color: #333;
  127.         }
  128.          
  129.         .checkin-status {
  130.             text-align: center;
  131.             padding: 20px;
  132.             border-radius: 8px;
  133.             margin-bottom: 20px;
  134.             font-weight: 500;
  135.         }
  136.          
  137.         .checked-in {
  138.             background: #e8f5e9;
  139.             color: #2e7d32;
  140.         }
  141.          
  142.         .not-checked-in {
  143.             background: #fff3e0;
  144.             color: #ef6c00;
  145.         }
  146.          
  147.         .history {
  148.             margin-top: 25px;
  149.         }
  150.          
  151.         .history h3 {
  152.             margin-bottom: 15px;
  153.             color: #333;
  154.             padding-bottom: 8px;
  155.             border-bottom: 1px solid #eee;
  156.         }
  157.          
  158.         .history-list {
  159.             max-height: 200px;
  160.             overflow-y: auto;
  161.         }
  162.          
  163.         .history-item {
  164.             padding: 12px 15px;
  165.             background: #f9f9f9;
  166.             border-radius: 8px;
  167.             margin-bottom: 10px;
  168.             display: flex;
  169.             justify-content: space-between;
  170.         }
  171.          
  172.         .history-date {
  173.             color: #555;
  174.         }
  175.          
  176.         .history-time {
  177.             color: #888;
  178.             font-size: 14px;
  179.         }
  180.          
  181.         .alert {
  182.             padding: 15px;
  183.             border-radius: 8px;
  184.             margin-bottom: 20px;
  185.             font-size: 14px;
  186.         }
  187.          
  188.         .alert-warning {
  189.             background: #fff3e0;
  190.             color: #ef6c00;
  191.             border-left: 4px solid #ff9800;
  192.         }
  193.          
  194.         .alert-info {
  195.             background: #e3f2fd;
  196.             color: #1565c0;
  197.             border-left: 4px solid #2196f3;
  198.         }
  199.          
  200.         .sms-config {
  201.             background: #f9f9f9;
  202.             padding: 15px;
  203.             border-radius: 8px;
  204.             margin-top: 20px;
  205.             font-size: 14px;
  206.         }
  207.          
  208.         .sms-config h4 {
  209.             margin-bottom: 10px;
  210.             color: #333;
  211.         }
  212.          
  213.         .sms-config p {
  214.             margin-bottom: 8px;
  215.             color: #555;
  216.         }
  217.          
  218.         [url=home.php?mod=space&uid=945662]@media[/url] (max-width: 600px) {
  219.             .container {
  220.                 border-radius: 12px;
  221.             }
  222.             
  223.             .header {
  224.                 padding: 20px 15px;
  225.             }
  226.             
  227.             .form-container {
  228.                 padding: 20px 15px;
  229.             }
  230.         }
  231.     </style>
  232. </head>
  233. <body>
  234.     <div class=“container”>
  235.         <div class=“header”>
  236.             <h1>活着么签到系统</h1>
  237.         </div>
  238.         <!– 注册视图 –>
  239.         <div id=“register-view” class=“view active”>
  240.             <div class=“form-container”>
  241.                 <h2>手机号注册</h2>
  242.                 <div class=“alert alert-info”>
  243.                     请输入您的手机号进行注册,注册后需要设置紧急联系人才能开始签到
  244.                 </div>
  245.                 <div class=“form-group”>
  246.                     <label for=“phone”>手机号</label>
  247.                     <input type=“tel” id=“phone” placeholder=“请输入11位手机号” pattern=“[0-9]{11}” required>
  248.                 </div>
  249.                 <button id=“register-btn” class=“btn”>注册</button>
  250.             </div>
  251.         </div>
  252.         <!– 紧急联系人视图 –>
  253.         <div id=“emergency-contact-view” class=“view”>
  254.             <div class=“form-container”>
  255.                 <h2>设置紧急联系人</h2>
  256.                 <div class=“alert alert-warning”>
  257.                     紧急联系人不能是自己,建议填写直系亲属信息
  258.                 </div>
  259.                 <div class=“form-group”>
  260.                     <label for=“contact-name”>联系人姓名</label>
  261.                     <input type=“text” id=“contact-name” placeholder=“请输入联系人姓名” required>
  262.                 </div>
  263.                 <div class=“form-group”>
  264.                     <label for=“contact-phone”>联系人手机号</label>
  265.                     <input type=“tel” id=“contact-phone” placeholder=“请输入11位手机号” pattern=“[0-9]{11}” required>
  266.                 </div>
  267.                 <div class=“form-group”>
  268.                     <label for=“relationship”>与您的关系</label>
  269.                     <input type=“text” id=“relationship” placeholder=“例如:父亲、母亲、配偶等” required>
  270.                 </div>
  271.                 <button id=“set-contact-btn” class=“btn”>完成设置</button>
  272.             </div>
  273.         </div>
  274.         <!– 主视图 –>
  275.         <div id=“main-view” class=“view”>
  276.             <div class=“form-container”>
  277.                 <h2>每日打卡</h2>
  278.                 <div class=“user-info”>
  279.                     <p>手机号: <span id=“user-phone”></span></p>
  280.                     <p>紧急联系人: <span id=“emergency-contact”></span> (<span id=“contact-relationship”></span>)</p>
  281.                 </div>
  282.                 <div id=“checkin-status” class=“checkin-status not-checked-in”>
  283.                     今日尚未签到,请点击下方按钮签到
  284.                 </div>
  285.                 <button id=“checkin-btn” class=“btn”>今日签到</button>
  286.                 <div class=“history”>
  287.                     <h3>签到历史</h3>
  288.                     <div id=“history-list” class=“history-list”>
  289.                         <!– 签到历史将在这里显示 –>
  290.                     </div>
  291.                 </div>
  292.                 <div class=“sms-config”>
  293.                     <h4>阿里云短信服务配置</h4>
  294.                     <p>AccessKey ID: <span id=“access-key-id”>已配置</span></p>
  295.                     <p>AccessKey Secret: <span id=“access-key-secret”>已配置</span></p>
  296.                     <p>签名: <span id=“sms-sign”>已配置</span></p>
  297.                     <p>模板代码: <span id=“template-code”>已配置</span></p>
  298.                 </div>
  299.             </div>
  300.         </div>
  301.     </div>
  302.     <script>
  303.         document.addEventListener(‘DOMContentLoaded’, function() {
  304.             // 初始化数据
  305.             let userData = {
  306.                 phone: ,
  307.                 emergencyContact: {
  308.                     name: ,
  309.                     phone: ,
  310.                     relationship:
  311.                 },
  312.                 checkInHistory: [],
  313.                 lastCheckInDate: null
  314.             };
  315.             
  316.             // 从localStorage加载数据
  317.             function loadData() {
  318.                 const savedData = localStorage.getItem(‘checkInData’);
  319.                 if (savedData) {
  320.                     userData = JSON.parse(savedData);
  321.                     updateUI();
  322.                 }
  323.             }
  324.             
  325.             // 保存数据到localStorage
  326.             function saveData() {
  327.                 localStorage.setItem(‘checkInData’, JSON.stringify(userData));
  328.             }
  329.             
  330.             // 更新UI
  331.             function updateUI() {
  332.                 if (userData.phone && !userData.emergencyContact.name) {
  333.                     showView(’emergency-contact-view’);
  334.                 } else if (userData.phone && userData.emergencyContact.name) {
  335.                     showView(‘main-view’);
  336.                     updateMainView();
  337.                 } else {
  338.                     showView(‘register-view’);
  339.                 }
  340.             }
  341.             
  342.             // 显示指定视图
  343.             function showView(viewId) {
  344.                 document.querySelectorAll(‘.view’).forEach(view => {
  345.                     view.classList.remove(‘active’);
  346.                 });
  347.                 document.getElementById(viewId).classList.add(‘active’);
  348.             }
  349.             
  350.             // 更新主视图
  351.             function updateMainView() {
  352.                 document.getElementById(‘user-phone’).textContent = userData.phone.replace(/(\d{3})\d{4}(\d{4})/, ‘$1****$2’);
  353.                 document.getElementById(’emergency-contact’).textContent = userData.emergencyContact.name;
  354.                 document.getElementById(‘contact-relationship’).textContent = userData.emergencyContact.relationship;
  355.                  
  356.                 // 更新签到状态
  357.                 const today = new Date().toISOString().split(‘T’)[0];
  358.                 const hasCheckedIn = userData.checkInHistory.some(record => record.date === today);
  359.                  
  360.                 const checkinStatus = document.getElementById(‘checkin-status’);
  361.                 const checkinBtn = document.getElementById(‘checkin-btn’);
  362.                  
  363.                 if (hasCheckedIn) {
  364.                     checkinStatus.textContent = `您今天已于 ${userData.checkInHistory.find(r => r.date === today).time} 签到成功!`;
  365.                     checkinStatus.className = ‘checkin-status checked-in’;
  366.                     checkinBtn.textContent = ‘今日已签到’;
  367.                     checkinBtn.disabled = true;
  368.                 } else {
  369.                     checkinStatus.textContent = ‘今日尚未签到,请点击下方按钮签到’;
  370.                     checkinStatus.className = ‘checkin-status not-checked-in’;
  371.                     checkinBtn.textContent = ‘今日签到’;
  372.                     checkinBtn.disabled = false;
  373.                 }
  374.                  
  375.                 // 更新签到历史
  376.                 const historyList = document.getElementById(‘history-list’);
  377.                 historyList.innerHTML = ;
  378.                  
  379.                 if (userData.checkInHistory.length === 0) {
  380.                     historyList.innerHTML = ‘<div class=”history-item”>暂无签到记录</div>’;
  381.                 } else {
  382.                     // 按日期降序排列
  383.                     const sortedHistory = […userData.checkInHistory].sort((a, b) => new Date(b.date) – new Date(a.date));
  384.                      
  385.                     sortedHistory.forEach(record => {
  386.                         const item = document.createElement(‘div’);
  387.                         item.className = ‘history-item’;
  388.                         item.innerHTML = `
  389.                             <div>
  390.                                 <div class=”history-date”>${record.date}</div>
  391.                             </div>
  392.                             <div class=”history-time”>${record.time}</div>
  393.                         `;
  394.                         historyList.appendChild(item);
  395.                     });
  396.                 }
  397.                  
  398.                 // 检查连续未签到天数
  399.                 checkConsecutiveMissedDays();
  400.             }
  401.             
  402.             // 检查连续未签到天数
  403.             function checkConsecutiveMissedDays() {
  404.                 if (!userData.lastCheckInDate) return;
  405.                  
  406.                 const lastCheckIn = new Date(userData.lastCheckInDate);
  407.                 const today = new Date();
  408.                 today.setHours(0, 0, 0, 0);
  409.                  
  410.                 const diffTime = Math.abs(today – lastCheckIn);
  411.                 const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));
  412.                  
  413.                 if (diffDays >= 3) {
  414.                     // 模拟发送短信
  415.                     sendSMSNotification(diffDays);
  416.                 }
  417.             }
  418.             
  419.             // 模拟发送短信通知
  420.             function sendSMSNotification(daysMissed) {
  421.                 // 在实际应用中,这里会调用阿里云短信API
  422.                 console.log(`正在发送短信通知紧急联系人 ${userData.emergencyContact.name} (${userData.emergencyContact.phone})`);
  423.                 console.log(`短信内容: 您的亲属 ${userData.phone.replace(/(\d{3})\d{4}(\d{4})/, ‘$1****$2’)} 已连续 ${daysMissed} 天未签到,请及时联系确认安全。`);
  424.                  
  425.                 alert(`模拟短信发送成功!\n\n已向紧急联系人 ${userData.emergencyContact.name} (${userData.emergencyContact.phone}) 发送通知:\n”您的亲属已连续 ${daysMissed} 天未签到,请及时联系确认安全。”`);
  426.                  
  427.                 // 重置计数器(在实际应用中,可能需要更复杂的逻辑)
  428.                 userData.lastCheckInDate = new Date().toISOString().split(‘T’)[0];
  429.                 saveData();
  430.             }
  431.             
  432.             // 注册按钮点击事件
  433.             document.getElementById(‘register-btn’).addEventListener(‘click’, function() {
  434.                 const phone = document.getElementById(‘phone’).value;
  435.                  
  436.                 if (!/^\d{11}$/.test(phone)) {
  437.                     alert(‘请输入有效的11位手机号!’);
  438.                     return;
  439.                 }
  440.                  
  441.                 userData.phone = phone;
  442.                 saveData();
  443.                 updateUI();
  444.             });
  445.             
  446.             // 设置紧急联系人按钮点击事件
  447.             document.getElementById(‘set-contact-btn’).addEventListener(‘click’, function() {
  448.                 const name = document.getElementById(‘contact-name’).value;
  449.                 const phone = document.getElementById(‘contact-phone’).value;
  450.                 const relationship = document.getElementById(‘relationship’).value;
  451.                  
  452.                 if (!name || !/^\d{11}$/.test(phone) || !relationship) {
  453.                     alert(‘请填写完整的紧急联系人信息!’);
  454.                     return;
  455.                 }
  456.                  
  457.                 if (phone === userData.phone) {
  458.                     alert(‘紧急联系人不能是自己!’);
  459.                     return;
  460.                 }
  461.                  
  462.                 userData.emergencyContact = {
  463.                     name,
  464.                     phone,
  465.                     relationship
  466.                 };
  467.                  
  468.                 saveData();
  469.                 updateUI();
  470.             });
  471.             
  472.             // 签到按钮点击事件
  473.             document.getElementById(‘checkin-btn’).addEventListener(‘click’, function() {
  474.                 const today = new Date().toISOString().split(‘T’)[0];
  475.                 const now = new Date();
  476.                 const time = now.toTimeString().split(‘ ‘)[0].substring(0, 5);
  477.                  
  478.                 // 检查今天是否已经签到
  479.                 const hasCheckedIn = userData.checkInHistory.some(record => record.date === today);
  480.                 if (hasCheckedIn) {
  481.                     alert(‘您今天已经签到过了!’);
  482.                     return;
  483.                 }
  484.                  
  485.                 // 添加签到记录
  486.                 userData.checkInHistory.push({
  487.                     date: today,
  488.                     time: time
  489.                 });
  490.                  
  491.                 // 更新最后签到日期
  492.                 userData.lastCheckInDate = today;
  493.                  
  494.                 saveData();
  495.                 updateUI();
  496.                  
  497.                 alert(‘签到成功!’);
  498.             });
  499.             
  500.             // 初始化应用
  501.             loadData();
  502.             
  503.             // 每天检查一次连续未签到情况(在实际应用中,这应该在后端完成)
  504.             setInterval(checkConsecutiveMissedDays, 24 * 60 * 60 * 1000);
  505.         });
  506.     </script>
  507. </body>
  508. </html>
声明:本站所有文章均为永久链接,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系邮箱:jyxs_top@163.com进行处理。