注册 登录
发贴工具
查看: 2|回复: 0
打印 上一主题 下一主题

[24小时收录超级好的网站] AIWROK苹果脚本H5任务执行小例子

[复制链接]

2488

主题

2536

帖子

1万

积分

积分
15124
跳转到指定楼层
楼主
AIWROK苹果脚本H5任务执行小例子
AIWROK苹果脚本H5任务执行小例子 群发软件发帖工具
AIWROK苹果脚本H5任务执行小例子 群发软件发帖工具

  1. // 创建 WebView 实例
  2. var web = new WebView();

  3. // 显示 WebView 界面
  4. web.show();

  5. // 加载本地 HTML 文件
  6. var htmlPath = project.getCodePath() + "h5.html";
  7. web.loadFile(htmlPath);

  8. // 定义 H5 中调用的函数
  9. function test(arg) {
  10.     printl("我被 H5 调用了,参数是: " + arg);
  11. }

  12. // 定义返回桌面的函数,供H5页面调用
  13. function returnToHome() {
  14.     printl("执行返回桌面操作");
  15.     hid.home();
  16. }

  17. // 打印加载信息
  18. printl("WebView 已创建并加载本地文件: " + htmlPath);
复制代码
  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  3. <head>
  4.     <meta charset="UTF-8">
  5.     <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
  6.     <meta name="apple-mobile-web-app-capable" content="yes">
  7.     <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
  8.     <title>AIWROK 智能任务调度中心</title>
  9.     <style>
  10.         /* 基础样式重置 */
  11.         * {
  12.             margin: 0;
  13.             padding: 0;
  14.             box-sizing: border-box;
  15.         }

  16.         /* 全局样式 */
  17.         body {
  18.             font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  19.             background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  20.             color: #333;
  21.             min-height: 100vh;
  22.             -webkit-font-smoothing: antialiased;
  23.             -moz-osx-font-smoothing: grayscale;
  24.             position: relative;
  25.             overflow-x: hidden;
  26.         }

  27.         /* 背景动画粒子 */
  28.         .particles {
  29.             position: fixed;
  30.             top: 0;
  31.             left: 0;
  32.             width: 100%;
  33.             height: 100%;
  34.             pointer-events: none;
  35.             z-index: 0;
  36.             overflow: hidden;
  37.         }

  38.         .particle {
  39.             position: absolute;
  40.             width: 10px;
  41.             height: 10px;
  42.             background: rgba(255, 255, 255, 0.1);
  43.             border-radius: 50%;
  44.             animation: float 6s ease-in-out infinite;
  45.         }

  46.         .particle:nth-child(1) { left: 10%; animation-delay: 0s; }
  47.         .particle:nth-child(2) { left: 20%; animation-delay: 1s; }
  48.         .particle:nth-child(3) { left: 30%; animation-delay: 2s; }
  49.         .particle:nth-child(4) { left: 40%; animation-delay: 3s; }
  50.         .particle:nth-child(5) { left: 50%; animation-delay: 4s; }
  51.         .particle:nth-child(6) { left: 60%; animation-delay: 5s; }
  52.         .particle:nth-child(7) { left: 70%; animation-delay: 0.5s; }
  53.         .particle:nth-child(8) { left: 80%; animation-delay: 1.5s; }
  54.         .particle:nth-child(9) { left: 90%; animation-delay: 2.5s; }
  55.         .particle:nth-child(10) { left: 5%; animation-delay: 3.5s; }

  56.         @keyframes float {
  57.             0%, 100% {
  58.                 transform: translateY(100vh) rotate(0deg);
  59.                 opacity: 0;
  60.             }
  61.             10% {
  62.                 opacity: 1;
  63.             }
  64.             90% {
  65.                 opacity: 1;
  66.             }
  67.             100% {
  68.                 transform: translateY(-100vh) rotate(720deg);
  69.                 opacity: 0;
  70.             }
  71.         }

  72.         /* 主容器 */
  73.         .main-container {
  74.             position: relative;
  75.             z-index: 1;
  76.             max-width: 500px;
  77.             margin: 0 auto;
  78.             padding: 20px;
  79.         }

  80.         /* 头部卡片 */
  81.         .header-card {
  82.             background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.9) 100%);
  83.             border-radius: 24px;
  84.             padding: 24px;
  85.             margin-bottom: 20px;
  86.             box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  87.             backdrop-filter: blur(10px);
  88.             text-align: center;
  89.         }

  90.         .header-card h1 {
  91.             font-size: 24px;
  92.             font-weight: 800;
  93.             background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  94.             -webkit-background-clip: text;
  95.             -webkit-text-fill-color: transparent;
  96.             background-clip: text;
  97.             margin-bottom: 8px;
  98.         }

  99.         .header-card .subtitle {
  100.             font-size: 14px;
  101.             color: #666;
  102.             margin-bottom: 12px;
  103.         }

  104.         .header-card .qq-group {
  105.             font-size: 13px;
  106.             color: #667eea;
  107.             font-weight: 600;
  108.         }

  109.         /* 统计卡片 */
  110.         .stats-container {
  111.             display: grid;
  112.             grid-template-columns: repeat(3, 1fr);
  113.             gap: 12px;
  114.             margin-bottom: 20px;
  115.         }

  116.         .stat-card {
  117.             background: rgba(255, 255, 255, 0.95);
  118.             border-radius: 16px;
  119.             padding: 16px 8px;
  120.             text-align: center;
  121.             box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  122.             transition: transform 0.3s ease;
  123.         }

  124.         .stat-card:hover {
  125.             transform: translateY(-4px);
  126.         }

  127.         .stat-card .number {
  128.             font-size: 28px;
  129.             font-weight: 800;
  130.             color: #667eea;
  131.             display: block;
  132.         }

  133.         .stat-card .label {
  134.             font-size: 12px;
  135.             color: #666;
  136.             margin-top: 4px;
  137.         }

  138.         /* 标签页导航 */
  139.         .tab-nav {
  140.             display: flex;
  141.             background: rgba(255, 255, 255, 0.95);
  142.             border-radius: 16px;
  143.             padding: 6px;
  144.             margin-bottom: 20px;
  145.             box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  146.         }

  147.         .tab-btn {
  148.             flex: 1;
  149.             padding: 12px 8px;
  150.             border: none;
  151.             background: transparent;
  152.             border-radius: 12px;
  153.             font-size: 14px;
  154.             font-weight: 600;
  155.             color: #666;
  156.             cursor: pointer;
  157.             transition: all 0.3s ease;
  158.         }

  159.         .tab-btn.active {
  160.             background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  161.             color: white;
  162.             box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
  163.         }

  164.         /* 内容区域 */
  165.         .content-area {
  166.             background: rgba(255, 255, 255, 0.95);
  167.             border-radius: 24px;
  168.             padding: 20px;
  169.             box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  170.             min-height: 400px;
  171.         }

  172.         .tab-content {
  173.             display: none;
  174.         }

  175.         .tab-content.active {
  176.             display: block;
  177.             animation: fadeIn 0.3s ease-out;
  178.         }

  179.         @keyframes fadeIn {
  180.             from { opacity: 0; transform: translateY(10px); }
  181.             to { opacity: 1; transform: translateY(0); }
  182.         }

  183.         /* 任务列表 */
  184.         .task-list {
  185.             list-style: none;
  186.         }

  187.         .task-item {
  188.             display: flex;
  189.             align-items: center;
  190.             padding: 16px;
  191.             background: #f8f9fa;
  192.             border-radius: 12px;
  193.             margin-bottom: 12px;
  194.             transition: all 0.3s ease;
  195.             cursor: pointer;
  196.         }

  197.         .task-item:hover {
  198.             background: #e9ecef;
  199.             transform: translateX(4px);
  200.         }

  201.         .task-item.selected {
  202.             background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
  203.             border: 2px solid #667eea;
  204.         }

  205.         .task-checkbox {
  206.             width: 24px;
  207.             height: 24px;
  208.             margin-right: 12px;
  209.             cursor: pointer;
  210.             accent-color: #667eea;
  211.         }

  212.         .task-info {
  213.             flex: 1;
  214.         }

  215.         .task-name {
  216.             font-size: 15px;
  217.             font-weight: 600;
  218.             color: #333;
  219.             margin-bottom: 4px;
  220.         }

  221.         .task-desc {
  222.             font-size: 12px;
  223.             color: #666;
  224.         }

  225.         .task-status {
  226.             padding: 4px 12px;
  227.             border-radius: 20px;
  228.             font-size: 12px;
  229.             font-weight: 600;
  230.         }

  231.         .task-status.pending {
  232.             background: #fff3cd;
  233.             color: #856404;
  234.         }

  235.         .task-status.running {
  236.             background: #d4edda;
  237.             color: #155724;
  238.         }

  239.         .task-status.completed {
  240.             background: #d1ecf1;
  241.             color: #0c5460;
  242.         }

  243.         /* 设置表单 */
  244.         .settings-form {
  245.             space-y: 16px;
  246.         }

  247.         .form-group {
  248.             margin-bottom: 20px;
  249.         }

  250.         .form-label {
  251.             display: block;
  252.             font-size: 14px;
  253.             font-weight: 600;
  254.             color: #333;
  255.             margin-bottom: 8px;
  256.         }

  257.         .form-input {
  258.             width: 100%;
  259.             padding: 12px 16px;
  260.             border: 2px solid #e9ecef;
  261.             border-radius: 12px;
  262.             font-size: 15px;
  263.             transition: all 0.3s ease;
  264.         }

  265.         .form-input:focus {
  266.             outline: none;
  267.             border-color: #667eea;
  268.             box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  269.         }

  270.         .form-select {
  271.             width: 100%;
  272.             padding: 12px 16px;
  273.             border: 2px solid #e9ecef;
  274.             border-radius: 12px;
  275.             font-size: 15px;
  276.             background: white;
  277.             cursor: pointer;
  278.         }

  279.         /* 开关样式 */
  280.         .switch-container {
  281.             display: flex;
  282.             align-items: center;
  283.             justify-content: space-between;
  284.             padding: 16px;
  285.             background: #f8f9fa;
  286.             border-radius: 12px;
  287.             margin-bottom: 12px;
  288.         }

  289.         .switch-label {
  290.             font-size: 15px;
  291.             font-weight: 500;
  292.             color: #333;
  293.         }

  294.         .switch {
  295.             position: relative;
  296.             width: 52px;
  297.             height: 28px;
  298.         }

  299.         .switch input {
  300.             opacity: 0;
  301.             width: 0;
  302.             height: 0;
  303.         }

  304.         .slider {
  305.             position: absolute;
  306.             cursor: pointer;
  307.             top: 0;
  308.             left: 0;
  309.             right: 0;
  310.             bottom: 0;
  311.             background-color: #ccc;
  312.             transition: .4s;
  313.             border-radius: 28px;
  314.         }

  315.         .slider:before {
  316.             position: absolute;
  317.             content: "";
  318.             height: 20px;
  319.             width: 20px;
  320.             left: 4px;
  321.             bottom: 4px;
  322.             background-color: white;
  323.             transition: .4s;
  324.             border-radius: 50%;
  325.         }

  326.         input:checked + .slider {
  327.             background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  328.         }

  329.         input:checked + .slider:before {
  330.             transform: translateX(24px);
  331.         }

  332.         /* 按钮样式 */
  333.         .btn {
  334.             width: 100%;
  335.             padding: 16px;
  336.             border: none;
  337.             border-radius: 12px;
  338.             font-size: 16px;
  339.             font-weight: 700;
  340.             cursor: pointer;
  341.             transition: all 0.3s ease;
  342.             margin-bottom: 12px;
  343.         }

  344.         .btn-primary {
  345.             background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  346.             color: white;
  347.             box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
  348.         }

  349.         .btn-primary:hover {
  350.             transform: translateY(-2px);
  351.             box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
  352.         }

  353.         .btn-danger {
  354.             background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
  355.             color: white;
  356.             box-shadow: 0 4px 16px rgba(255, 107, 107, 0.4);
  357.         }

  358.         .btn-danger:hover {
  359.             transform: translateY(-2px);
  360.             box-shadow: 0 6px 20px rgba(255, 107, 107, 0.5);
  361.         }

  362.         .btn-success {
  363.             background: linear-gradient(135deg, #51cf66 0%, #40c057 100%);
  364.             color: white;
  365.             box-shadow: 0 4px 16px rgba(81, 207, 102, 0.4);
  366.         }

  367.         .btn-success:hover {
  368.             transform: translateY(-2px);
  369.             box-shadow: 0 6px 20px rgba(81, 207, 102, 0.5);
  370.         }

  371.         .btn:disabled {
  372.             opacity: 0.6;
  373.             cursor: not-allowed;
  374.             transform: none;
  375.         }

  376.         /* 日志区域 */
  377.         .log-container {
  378.             background: #1a1a2e;
  379.             border-radius: 12px;
  380.             padding: 16px;
  381.             max-height: 200px;
  382.             overflow-y: auto;
  383.             font-family: 'Courier New', monospace;
  384.             font-size: 12px;
  385.         }

  386.         .log-item {
  387.             color: #a0a0a0;
  388.             margin-bottom: 4px;
  389.             padding: 4px 0;
  390.             border-bottom: 1px solid #2a2a3e;
  391.         }

  392.         .log-item:last-child {
  393.             border-bottom: none;
  394.         }

  395.         .log-time {
  396.             color: #667eea;
  397.             margin-right: 8px;
  398.         }

  399.         .log-info { color: #4dabf7; }
  400.         .log-success { color: #51cf66; }
  401.         .log-warning { color: #ffd43b; }
  402.         .log-error { color: #ff6b6b; }

  403.         /* Toast 提示 */
  404.         .toast {
  405.             position: fixed;
  406.             bottom: 100px;
  407.             left: 50%;
  408.             transform: translateX(-50%) translateY(100px);
  409.             background: rgba(0, 0, 0, 0.9);
  410.             color: white;
  411.             padding: 16px 32px;
  412.             border-radius: 50px;
  413.             font-size: 14px;
  414.             font-weight: 600;
  415.             opacity: 0;
  416.             transition: all 0.3s ease;
  417.             z-index: 9999;
  418.             box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  419.         }

  420.         .toast.show {
  421.             opacity: 1;
  422.             transform: translateX(-50%) translateY(0);
  423.         }

  424.         /* 加载动画 */
  425.         .loading {
  426.             position: relative;
  427.         }

  428.         .loading::after {
  429.             content: '';
  430.             position: absolute;
  431.             top: 50%;
  432.             left: 50%;
  433.             width: 20px;
  434.             height: 20px;
  435.             margin: -10px 0 0 -10px;
  436.             border: 2px solid rgba(255, 255, 255, 0.3);
  437.             border-top-color: white;
  438.             border-radius: 50%;
  439.             animation: spin 1s linear infinite;
  440.         }

  441.         @keyframes spin {
  442.             to { transform: rotate(360deg); }
  443.         }

  444.         /* 响应式设计 */
  445.         @media (max-width: 480px) {
  446.             .main-container {
  447.                 padding: 16px;
  448.             }
  449.             
  450.             .stats-container {
  451.                 grid-template-columns: repeat(3, 1fr);
  452.                 gap: 8px;
  453.             }
  454.             
  455.             .stat-card {
  456.                 padding: 12px 4px;
  457.             }
  458.             
  459.             .stat-card .number {
  460.                 font-size: 20px;
  461.             }
  462.         }
  463.     </style>
  464. </head>
  465. <body>
  466.     <!-- 背景粒子 -->
  467.     <div class="particles">
  468.         <div class="particle"></div>
  469.         <div class="particle"></div>
  470.         <div class="particle"></div>
  471.         <div class="particle"></div>
  472.         <div class="particle"></div>
  473.         <div class="particle"></div>
  474.         <div class="particle"></div>
  475.         <div class="particle"></div>
  476.         <div class="particle"></div>
  477.         <div class="particle"></div>
  478.     </div>

  479.     <div class="main-container">
  480.         <!-- 头部卡片 -->
  481.         <div class="header-card">
  482.             <h1>智能任务调度中心</h1>
  483.             <div class="subtitle">AIWROK 自动化任务管理系统</div>
  484.             <div class="qq-group">&#127822;交流QQ群711841924群一,苹果内测群,528816639</div>
  485.         </div>

  486.         <!-- 统计卡片 -->
  487.         <div class="stats-container">
  488.             <div class="stat-card">
  489.                 <span class="number" id="pendingCount">0</span>
  490.                 <div class="label">待执行</div>
  491.             </div>
  492.             <div class="stat-card">
  493.                 <span class="number" id="runningCount">0</span>
  494.                 <div class="label">执行中</div>
  495.             </div>
  496.             <div class="stat-card">
  497.                 <span class="number" id="completedCount">0</span>
  498.                 <div class="label">已完成</div>
  499.             </div>
  500.         </div>

  501.         <!-- 标签页导航 -->
  502.         <div class="tab-nav">
  503.             <button class="tab-btn active" onclick="switchTab('tasks')">任务列表</button>
  504.             <button class="tab-btn" onclick="switchTab('settings')">系统设置</button>
  505.             <button class="tab-btn" onclick="switchTab('logs')">运行日志</button>
  506.         </div>

  507.         <!-- 内容区域 -->
  508.         <div class="content-area">
  509.             <!-- 任务列表 -->
  510.             <div id="tasks-tab" class="tab-content active">
  511.                 <ul class="task-list" id="taskList">
  512.                     <!-- 任务项将通过JS动态生成 -->
  513.                 </ul>
  514.                 <button class="btn btn-primary" onclick="executeSelectedTasks()">
  515.                     执行选中任务
  516.                 </button>
  517.                 <button class="btn btn-danger" onclick="clearAllTasks()">
  518.                     清空所有任务
  519.                 </button>
  520.             </div>

  521.             <!-- 系统设置 -->
  522.             <div id="settings-tab" class="tab-content">
  523.                 <div class="settings-form">
  524.                     <div class="form-group">
  525.                         <label class="form-label">运行间隔 (秒)</label>
  526.                         <input type="number" class="form-input" id="intervalInput" value="5" min="1" max="60">
  527.                     </div>
  528.                     
  529.                     <div class="form-group">
  530.                         <label class="form-label">最大重试次数</label>
  531.                         <input type="number" class="form-input" id="retryInput" value="3" min="1" max="10">
  532.                     </div>

  533.                     <div class="form-group">
  534.                         <label class="form-label">执行模式</label>
  535.                         <select class="form-select" id="modeSelect">
  536.                             <option value="serial">顺序执行</option>
  537.                             <option value="parallel">并行执行</option>
  538.                             <option value="smart">智能调度</option>
  539.                         </select>
  540.                     </div>

  541.                     <div class="switch-container">
  542.                         <span class="switch-label">任务完成后返回桌面</span>
  543.                         <label class="switch">
  544.                             <input type="checkbox" id="autoReturn" checked>
  545.                             <span class="slider"></span>
  546.                         </label>
  547.                     </div>

  548.                     <div class="switch-container">
  549.                         <span class="switch-label">自动清理缓存</span>
  550.                         <label class="switch">
  551.                             <input type="checkbox" id="autoClean" checked>
  552.                             <span class="slider"></span>
  553.                         </label>
  554.                     </div>

  555.                     <div class="switch-container">
  556.                         <span class="switch-label">后台运行</span>
  557.                         <label class="switch">
  558.                             <input type="checkbox" id="backgroundRun">
  559.                             <span class="slider"></span>
  560.                         </label>
  561.                     </div>

  562.                     <div class="switch-container">
  563.                         <span class="switch-label">错误自动重试</span>
  564.                         <label class="switch">
  565.                             <input type="checkbox" id="autoRetry" checked>
  566.                             <span class="slider"></span>
  567.                         </label>
  568.                     </div>

  569.                     <button class="btn btn-success" onclick="saveSettings()">
  570.                         保存设置
  571.                     </button>
  572.                 </div>
  573.             </div>

  574.             <!-- 运行日志 -->
  575.             <div id="logs-tab" class="tab-content">
  576.                 <div class="log-container" id="logContainer">
  577.                     <div class="log-item">
  578.                         <span class="log-time">[系统]</span>
  579.                         <span class="log-info">任务调度中心已启动</span>
  580.                     </div>
  581.                 </div>
  582.                 <button class="btn btn-primary" onclick="clearLogs()">
  583.                     清空日志
  584.                 </button>
  585.             </div>
  586.         </div>
  587.     </div>

  588.     <!-- Toast 提示 -->
  589.     <div class="toast" id="toast"></div>

  590.     <script>
  591.         // 任务数据
  592.         const tasksData = [
  593.             { id: 1, name: '抖音极速版', desc: '自动刷视频赚金币', status: 'pending' },
  594.             { id: 2, name: '快手极速版', desc: '自动浏览任务', status: 'pending' },
  595.             { id: 3, name: '番茄小说', desc: '自动阅读赚金币', status: 'pending' },
  596.             { id: 4, name: '番茄畅听', desc: '自动听书任务', status: 'pending' },
  597.             { id: 5, name: '红果短剧', desc: '自动刷短剧', status: 'pending' },
  598.             { id: 6, name: '悟空浏览器', desc: '自动浏览资讯', status: 'pending' },
  599.             { id: 7, name: '西瓜视频', desc: '自动看视频赚金币', status: 'pending' },
  600.             { id: 8, name: '今日头条', desc: '自动阅读新闻', status: 'pending' },
  601.             { id: 9, name: '喜番短剧', desc: '自动刷短剧任务', status: 'pending' },
  602.             { id: 10, name: '汽水音乐', desc: '自动听歌赚金币', status: 'pending' }
  603.         ];

  604.         // 当前选中的任务
  605.         let selectedTasks = new Set();

  606.         // 初始化
  607.         function init() {
  608.             renderTaskList();
  609.             updateStats();
  610.             addLog('系统初始化完成', 'info');
  611.         }

  612.         // 渲染任务列表
  613.         function renderTaskList() {
  614.             const taskList = document.getElementById('taskList');
  615.             taskList.innerHTML = '';

  616.             tasksData.forEach(task => {
  617.                 const li = document.createElement('li');
  618.                 li.className = 'task-item' + (selectedTasks.has(task.id) ? ' selected' : '');
  619.                 li.onclick = function(e) {
  620.                     if (e.target.type !== 'checkbox') {
  621.                         toggleTaskSelection(task.id);
  622.                     }
  623.                 };

  624.                 const statusClass = task.status;
  625.                 const statusText = {
  626.                     'pending': '待执行',
  627.                     'running': '执行中',
  628.                     'completed': '已完成'
  629.                 }[task.status];

  630.                 li.innerHTML = `
  631.                     <input type="checkbox" class="task-checkbox"
  632.                            ${selectedTasks.has(task.id) ? 'checked' : ''}
  633.                            onchange="toggleTaskSelection(${task.id})">
  634.                     <div class="task-info">
  635.                         <div class="task-name">${task.name}</div>
  636.                         <div class="task-desc">${task.desc}</div>
  637.                     </div>
  638.                     <span class="task-status ${statusClass}">${statusText}</span>
  639.                 `;

  640.                 taskList.appendChild(li);
  641.             });
  642.         }

  643.         // 切换任务选择
  644.         function toggleTaskSelection(taskId) {
  645.             if (selectedTasks.has(taskId)) {
  646.                 selectedTasks.delete(taskId);
  647.             } else {
  648.                 selectedTasks.add(taskId);
  649.             }
  650.             renderTaskList();
  651.         }

  652.         // 更新统计
  653.         function updateStats() {
  654.             const pending = tasksData.filter(t => t.status === 'pending').length;
  655.             const running = tasksData.filter(t => t.status === 'running').length;
  656.             const completed = tasksData.filter(t => t.status === 'completed').length;

  657.             document.getElementById('pendingCount').textContent = pending;
  658.             document.getElementById('runningCount').textContent = running;
  659.             document.getElementById('completedCount').textContent = completed;
  660.         }

  661.         // 切换标签页
  662.         function switchTab(tabName) {
  663.             // 更新按钮状态
  664.             document.querySelectorAll('.tab-btn').forEach(btn => {
  665.                 btn.classList.remove('active');
  666.             });
  667.             event.target.classList.add('active');

  668.             // 更新内容显示
  669.             document.querySelectorAll('.tab-content').forEach(content => {
  670.                 content.classList.remove('active');
  671.             });
  672.             document.getElementById(tabName + '-tab').classList.add('active');

  673.             addLog('切换到' + tabName + '页面', 'info');
  674.         }

  675.         // 执行选中的任务
  676.         function executeSelectedTasks() {
  677.             if (selectedTasks.size === 0) {
  678.                 showToast('请先选择要执行的任务');
  679.                 return;
  680.             }

  681.             const btn = event.target;
  682.             btn.classList.add('loading');
  683.             btn.disabled = true;

  684.             showToast('开始执行 ' + selectedTasks.size + ' 个任务');
  685.             addLog('开始执行 ' + selectedTasks.size + ' 个任务', 'info');

  686.             // 模拟任务执行
  687.             let completed = 0;
  688.             selectedTasks.forEach(taskId => {
  689.                 const task = tasksData.find(t => t.id === taskId);
  690.                 if (task) {
  691.                     task.status = 'running';
  692.                     addLog('开始执行: ' + task.name, 'info');
  693.                 }
  694.             });

  695.             renderTaskList();
  696.             updateStats();

  697.             // 模拟执行完成
  698.             setTimeout(function() {
  699.                 selectedTasks.forEach(taskId => {
  700.                     const task = tasksData.find(t => t.id === taskId);
  701.                     if (task) {
  702.                         task.status = 'completed';
  703.                         completed++;
  704.                         addLog('完成: ' + task.name, 'success');
  705.                     }
  706.                 });

  707.                 selectedTasks.clear();
  708.                 renderTaskList();
  709.                 updateStats();

  710.                 btn.classList.remove('loading');
  711.                 btn.disabled = false;

  712.                 showToast('任务执行完成');
  713.                 addLog('所有任务执行完成', 'success');

  714.                 // 检查是否需要返回桌面
  715.                 const autoReturn = document.getElementById('autoReturn').checked;
  716.                 if (autoReturn) {
  717.                     setTimeout(function() {
  718.                         showToast('正在返回桌面');
  719.                         addLog('任务完成,返回桌面', 'info');
  720.                         
  721.                         // 尝试不同方式调用返回桌面
  722.                         let success = false;
  723.                         
  724.                         // 方式1:直接调用hid.home()
  725.                         try {
  726.                             if (typeof hid !== 'undefined' && typeof hid.home === 'function') {
  727.                                 hid.home();
  728.                                 addLog('已调用 hid.home() 返回桌面', 'success');
  729.                                 success = true;
  730.                             }
  731.                         } catch (e) {}
  732.                         
  733.                         // 方式2:调用全局home()函数
  734.                         if (!success) {
  735.                             try {
  736.                                 if (typeof home === 'function') {
  737.                                     home();
  738.                                     addLog('已调用 home() 返回桌面', 'success');
  739.                                     success = true;
  740.                                 }
  741.                             } catch (e) {}
  742.                         }
  743.                         
  744.                         // 方式3:调用window.home()
  745.                         if (!success) {
  746.                             try {
  747.                                 if (typeof window !== 'undefined' && typeof window.home === 'function') {
  748.                                     window.home();
  749.                                     addLog('已调用 window.home() 返回桌面', 'success');
  750.                                     success = true;
  751.                                 }
  752.                             } catch (e) {}
  753.                         }
  754.                         
  755.                         // 方式4:调用window.hid.home()
  756.                         if (!success) {
  757.                             try {
  758.                                 if (typeof window !== 'undefined' && window.hid && typeof window.hid.home === 'function') {
  759.                                     window.hid.home();
  760.                                     addLog('已调用 window.hid.home() 返回桌面', 'success');
  761.                                     success = true;
  762.                                 }
  763.                             } catch (e) {}
  764.                         }
  765.                         
  766.                         // 方式5:使用eval调用
  767.                         if (!success) {
  768.                             try {
  769.                                 eval('hid.home()');
  770.                                 addLog('已调用 eval(hid.home()) 返回桌面', 'success');
  771.                                 success = true;
  772.                             } catch (e) {}
  773.                         }
  774.                         
  775.                         // 方式6:使用全局对象调用
  776.                         if (!success) {
  777.                             try {
  778.                                 // 尝试使用全局对象
  779.                                 const globalObj = (function() { return this; })();
  780.                                 if (globalObj && globalObj.hid && typeof globalObj.hid.home === 'function') {
  781.                                     globalObj.hid.home();
  782.                                     addLog('已调用 globalObj.hid.home() 返回桌面', 'success');
  783.                                     success = true;
  784.                                 }
  785.                             } catch (e) {}
  786.                         }
  787.                         
  788.                         // 如果所有方式都失败
  789.                         if (!success) {
  790.                             addLog('返回桌面功能暂不可用,请确保在AIWROK环境中运行', 'warning');
  791.                             showToast('返回桌面功能暂不可用');
  792.                         }
  793.                     }, 1000);
  794.                 }
  795.             }, 2000);
  796.         }

  797.         // 清空所有任务
  798.         function clearAllTasks() {
  799.             if (!confirm('确定要清空所有任务状态吗?')) {
  800.                 return;
  801.             }

  802.             tasksData.forEach(task => {
  803.                 task.status = 'pending';
  804.             });
  805.             selectedTasks.clear();
  806.             renderTaskList();
  807.             updateStats();

  808.             showToast('所有任务已重置');
  809.             addLog('所有任务状态已重置', 'warning');
  810.         }

  811.         // 保存设置
  812.         function saveSettings() {
  813.             const settings = {
  814.                 interval: document.getElementById('intervalInput').value,
  815.                 retry: document.getElementById('retryInput').value,
  816.                 mode: document.getElementById('modeSelect').value,
  817.                 autoClean: document.getElementById('autoClean').checked,
  818.                 backgroundRun: document.getElementById('backgroundRun').checked,
  819.                 autoRetry: document.getElementById('autoRetry').checked
  820.             };

  821.             const btn = event.target;
  822.             btn.classList.add('loading');
  823.             btn.disabled = true;

  824.             setTimeout(function() {
  825.                 btn.classList.remove('loading');
  826.                 btn.disabled = false;

  827.                 showToast('设置保存成功');
  828.                 addLog('系统设置已保存: ' + JSON.stringify(settings), 'success');
  829.             }, 1000);
  830.         }

  831.         // 清空日志
  832.         function clearLogs() {
  833.             document.getElementById('logContainer').innerHTML = `
  834.                 <div class="log-item">
  835.                     <span class="log-time">[系统]</span>
  836.                     <span class="log-info">日志已清空</span>
  837.                 </div>
  838.             `;
  839.             showToast('日志已清空');
  840.         }

  841.         // 添加日志
  842.         function addLog(message, type) {
  843.             const container = document.getElementById('logContainer');
  844.             const time = new Date().toLocaleTimeString();
  845.             const typeClass = 'log-' + type;

  846.             const logItem = document.createElement('div');
  847.             logItem.className = 'log-item';
  848.             logItem.innerHTML = `
  849.                 <span class="log-time">[${time}]</span>
  850.                 <span class="${typeClass}">${message}</span>
  851.             `;

  852.             container.appendChild(logItem);
  853.             container.scrollTop = container.scrollHeight;
  854.         }

  855.         // Toast 提示
  856.         function showToast(message) {
  857.             const toast = document.getElementById('toast');
  858.             toast.textContent = message;
  859.             toast.classList.add('show');

  860.             setTimeout(function() {
  861.                 toast.classList.remove('show');
  862.             }, 2000);
  863.         }

  864.         // 页面加载完成
  865.         window.onload = function() {
  866.             init();
  867.             showToast('智能任务调度中心已启动');
  868.             
  869.             // 绑定所有事件
  870.             bindAllEvents();
  871.         };

  872.         // 绑定所有事件
  873.         function bindAllEvents() {
  874.             // 输入框事件
  875.             bindInputEvents();
  876.             
  877.             // 开关事件
  878.             bindSwitchEvents();
  879.             
  880.             // 下拉菜单事件
  881.             bindSelectEvents();
  882.             
  883.             // 键盘事件
  884.             bindKeyboardEvents();
  885.             
  886.             // 窗口事件
  887.             bindWindowEvents();
  888.         }

  889.         // 绑定输入框事件
  890.         function bindInputEvents() {
  891.             const inputs = document.querySelectorAll('.form-input');
  892.             inputs.forEach(input => {
  893.                 input.addEventListener('input', function() {
  894.                     addLog('设置已更新: ' + this.id + ' = ' + this.value, 'info');
  895.                 });
  896.                
  897.                 input.addEventListener('focus', function() {
  898.                     this.style.borderColor = '#667eea';
  899.                     this.style.boxShadow = '0 0 0 3px rgba(102, 126, 234, 0.1)';
  900.                 });
  901.                
  902.                 input.addEventListener('blur', function() {
  903.                     this.style.borderColor = '#e9ecef';
  904.                     this.style.boxShadow = 'none';
  905.                 });
  906.             });
  907.         }

  908.         // 绑定开关事件
  909.         function bindSwitchEvents() {
  910.             const switches = document.querySelectorAll('.switch input[type="checkbox"]');
  911.             switches.forEach(switchEl => {
  912.                 switchEl.addEventListener('change', function() {
  913.                     const label = this.closest('.switch-container').querySelector('.switch-label').textContent;
  914.                     addLog('设置已更新: ' + label + ' = ' + (this.checked ? '开启' : '关闭'), 'info');
  915.                 });
  916.             });
  917.         }

  918.         // 绑定下拉菜单事件
  919.         function bindSelectEvents() {
  920.             const selects = document.querySelectorAll('.form-select');
  921.             selects.forEach(select => {
  922.                 select.addEventListener('change', function() {
  923.                     addLog('设置已更新: ' + this.id + ' = ' + this.value, 'info');
  924.                 });
  925.                
  926.                 select.addEventListener('focus', function() {
  927.                     this.style.borderColor = '#667eea';
  928.                     this.style.boxShadow = '0 0 0 3px rgba(102, 126, 234, 0.1)';
  929.                 });
  930.                
  931.                 select.addEventListener('blur', function() {
  932.                     this.style.borderColor = '#e9ecef';
  933.                     this.style.boxShadow = 'none';
  934.                 });
  935.             });
  936.         }

  937.         // 绑定键盘事件
  938.         function bindKeyboardEvents() {
  939.             document.addEventListener('keydown', function(e) {
  940.                 // 按 Enter 键执行选中任务
  941.                 if (e.key === 'Enter' && document.getElementById('tasks-tab').classList.contains('active')) {
  942.                     const selectedCount = selectedTasks.size;
  943.                     if (selectedCount > 0) {
  944.                         executeSelectedTasks();
  945.                     }
  946.                 }
  947.                
  948.                 // 按 Escape 键清空选择
  949.                 if (e.key === 'Escape') {
  950.                     selectedTasks.clear();
  951.                     renderTaskList();
  952.                     addLog('已清空任务选择', 'info');
  953.                 }
  954.             });
  955.         }

  956.         // 绑定窗口事件
  957.         function bindWindowEvents() {
  958.             // 窗口大小变化事件
  959.             window.addEventListener('resize', function() {
  960.                 addLog('窗口大小已变化', 'info');
  961.             });
  962.             
  963.             // 页面可见性变化事件
  964.             document.addEventListener('visibilitychange', function() {
  965.                 if (document.hidden) {
  966.                     addLog('页面已隐藏', 'info');
  967.                 } else {
  968.                     addLog('页面已显示', 'info');
  969.                 }
  970.             });
  971.         }
  972.     </script>
  973. </body>
  974. </html>
复制代码



untoAIWROK软件苹果水平容器[Horizontal]小实例nextnocontent
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

相关导读了
    采集亚马逊正版群发工具有没有?
    Apr.20旅行X心语今天来说说YYPOST新功能的一个灵活用法,采集亚马逊商品信息,并且获得排名的软件,亚马逊现在越来越多客户做,淘宝的水是越来越清了,以前做电商的客户,现在都转战到外国,最赚钱的要数一些客户往亚马逊里堆了吧,拿我这个YYPOST的客户,最多的是采集,分析排名,刷价格,刷数量,改价,刷访问量等等技术

    企业发展B2B网站有什么东东软件可以发呢
    标题企业发展网B2B软件,现在虽然B2B网站收录不错,可愁的是心急的人们,他们太想一口吃撑胖子了,发帖宣传虽然不能像佛系那样淡定,但也不能像跑火车那般急躁对待,自己内容不收录,完全是自己操作内容问题,可以参考一下别人的内容是怎么弄的,然后自己要试着转变,而且收录这个内容,常常会变化的,不是一种规则就吃到老

    搜房天下房聊软件哪一个好呢
    本帖最后由 发帖软件 于 2019-5-22 16:15 编辑 2搜房天下群发房聊信息软件,开始本来打算做58同城的,但发一个就要一次点触验证码,这就让人没有感觉到存在的价值了吧,都是卖二手房和新房的搜房天下倒是可以发即时聊天信息,也没有发现他这个网站有啥子限制,登陆一个搜房天下账号,然后采集回来分类列表的网址,然后就一

    大家坛有没有好用的群发工具下载呢
    当你的笑容给我礼貌的招呼,大家坛全自动发帖软件,宣传推广是一场持久战,总是有一些人把软件用了一天,或是几个小时,就觉得自己付出太多了,那加进来的粉丝,或是流量,应该是和宣传多少成正比的,其实没有这么便宜的事,就像很多阅读量超过一百万的视频,或是电影,真正会在屏幕打赏的人不会超过三千,真正大额打赏给主

    群发正版软件中国塑料网
    中国塑料网群发软件YYPOST脚本下载地址,这个网站会有一个很奇怪的问题就是你在首页登陆无半个验证码,但在登陆网址登陆就会有一个验证码,所以我们灵活一些,在首页登陆就不用输入验证码了哈。网站秒收录比较高,但发的都是五金和建筑行业,先前有很多人都是发土建工程的大公司操作的,现在这个网站专为那个行业诞生的吧。

    OpenStreetMap网站正版2019年发帖工具下载
    本帖最后由 发帖软件 于 2019-5-21 11:13 编辑 OpenStreetMap网站全自动群发,OpenStreetMapOpenStreetMap(简称OSM,中文是公开地图)是一个网上地图协作计划,目标是创造一个内容自由且能让所有人编辑的世界地图。有的人编辑地图然后等收录,有的人发日志等收录,我们这里也是利用地图日志做为宣传的目标,简单的脚本理

    搜房天下全自动收短信全自动识别验证码注册账号软件
    房天下自动注册机,这个脚本是前几天发房聊的脚本廷伸品种,这个脚本能做到自动注册账号,自动保存账号,自动发房聊的效果,不过今天我们主要说一说怎么注册账号写脚本吧,这个搜房天天下的账号,可以发提问,可以发房聊,发论坛,发博客,还有发个人中心页都是有秒收的效果的,这样就省去了去买号,去乱花钱的效果了吧,而

    企业邮箱安卓端有什么APP软件可以发的呢
    请输入标题企业邮箱安卓发发送邮箱脚本,这个脚本是利用企业邮箱进行群发的,全程是一种模拟手工操作的过程,所以封号是很少的,而且企业邮箱群发到普通QQ邮箱不容易进垃圾箱中的,所以这个脚本也是这样的原理,不过最好是利用一些多开器,登陆多点的QQ邮箱账号会比较流畅一些,然后用软件一个一个的切换APP进行群发邮件会

    头条留评论软件有没有好用的呢?
    今天整一个今日头条留言软件,对于留言YYPOST是优势是比较大的存在,因为他往往专注一些下拉定位的优点,像今日头条这样,还是需要一些特殊下拉定位的,因为他新闻有长有短,有图有视频的,所以综合起来定位是比较难的,如果用POST也不是很轻松可以破解他的加密参数。这个脚本也是有一个不好的地方就是换号会比较麻烦,您电

    单网页生成神器
    最近新技术,网页生成机占领了整个网络的半壁江山,效果很疯狂,虽然不知道能持续多久,作为开发软件的领头者,一直在找收录的方法,一直在努力创新着,一直被人模仿,却从没有被超越过,这个网页生成机,已经出来有一段时间了,一直没有拿出来分享,醉过醉过,它是利用的一些小小收录漏洞整的,您最好用一些老站域名,进行

关闭
快速回复 返回列表 返回顶部
本站自动发贴软件,是现在最流行的做脚本软件,这种发贴工具,不但发贴收录快,而且抢占好的先机,完全自由编辑,实现针对性群发模拟操作,软件可以顶贴,也可以发贴,可以兼容支持Discuz、PHPWind、Dvbbs三大主流论坛,有手机验证码收件,邮件收发的功能,支持验证码识别,注册问题识别,多线程任务,自动上传头像,自动激活注册邮件,兼容防注册插件,本站软件原创正版,更新效率最快的原创软件。 『网络推广软件』『自动发帖软件』『 自动发帖