|
|
AIWROKÈí¼þ¿ò¼ÜµÄ¶¶Òô×Ô¶¯»¯ÓªÏúϵͳ
- <!DOCTYPE html>
- <html lang="zh-CN">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>🎵 ¶¶Òô×Ô¶¯»¯ÓªÏúϵͳ - AIWROK Pro</title>
- <style>
- * {
- margin: 0;
- padding: 0;
- box-sizing: border-box;
- }
-
- body {
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
- background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
- min-height: 100vh;
- padding: 15px;
- }
-
- .container {
- max-width: 800px;
- margin: 0 auto;
- background: white;
- border-radius: 20px;
- box-shadow: 0 20px 60px rgba(0,0,0,0.15);
- overflow: hidden;
- }
-
- /* Í·²¿Ñùʽ */
- .header {
- background: linear-gradient(135deg, #fe2c55 0%, #ff6b6b 50%, #ffa502 100%);
- color: white;
- padding: 35px 25px;
- text-align: center;
- position: relative;
- overflow: hidden;
- }
-
- .header::before {
- content: '';
- position: absolute;
- top: -50%;
- left: -50%;
- width: 200%;
- height: 200%;
- background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
- animation: pulse 4s ease-in-out infinite;
- }
-
- @keyframes pulse {
- 0%, 100% { transform: scale(1); opacity: 0.5; }
- 50% { transform: scale(1.1); opacity: 0.8; }
- }
-
- .header h1 {
- font-size: 28px;
- margin-bottom: 10px;
- position: relative;
- z-index: 1;
- text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
- }
-
- .header p {
- font-size: 15px;
- opacity: 0.95;
- position: relative;
- z-index: 1;
- }
-
- .version-badge {
- display: inline-block;
- background: rgba(255,255,255,0.2);
- padding: 5px 15px;
- border-radius: 20px;
- font-size: 12px;
- margin-top: 10px;
- position: relative;
- z-index: 1;
- }
-
- /* ±êǩҳµ¼º½ */
- .tab-nav {
- display: flex;
- background: #f8f9fa;
- border-bottom: 2px solid #e0e0e0;
- overflow-x: auto;
- }
-
- .tab-btn {
- flex: 1;
- padding: 15px 20px;
- border: none;
- background: transparent;
- font-size: 14px;
- font-weight: 600;
- color: #666;
- cursor: pointer;
- transition: all 0.3s;
- white-space: nowrap;
- position: relative;
- }
-
- .tab-btn.active {
- color: #fe2c55;
- background: white;
- }
-
- .tab-btn.active::after {
- content: '';
- position: absolute;
- bottom: 0;
- left: 0;
- right: 0;
- height: 3px;
- background: #fe2c55;
- }
-
- .tab-btn:hover {
- background: rgba(254, 44, 85, 0.05);
- }
-
- /* ÄÚÈÝÇøÓò */
- .content {
- padding: 25px;
- }
-
- .tab-content {
- display: none;
- }
-
- .tab-content.active {
- display: block;
- animation: fadeIn 0.3s ease;
- }
-
- @keyframes fadeIn {
- from { opacity: 0; transform: translateY(10px); }
- to { opacity: 1; transform: translateY(0); }
- }
-
- /* ¿¨Æ¬Ñùʽ */
- .card {
- background: white;
- border: 2px solid #f0f0f0;
- border-radius: 12px;
- padding: 20px;
- margin-bottom: 20px;
- transition: all 0.3s;
- }
-
- .card:hover {
- border-color: #fe2c55;
- box-shadow: 0 5px 20px rgba(254, 44, 85, 0.1);
- }
-
- .card-title {
- font-size: 18px;
- font-weight: bold;
- color: #333;
- margin-bottom: 15px;
- display: flex;
- align-items: center;
- gap: 8px;
- }
-
- .card-title::before {
- content: '';
- width: 4px;
- height: 20px;
- background: linear-gradient(to bottom, #fe2c55, #ff6b6b);
- border-radius: 2px;
- }
-
- /* ±íµ¥ÔªËØ */
- .form-group {
- margin-bottom: 18px;
- }
-
- .form-group label {
- display: block;
- font-size: 14px;
- color: #555;
- margin-bottom: 8px;
- font-weight: 500;
- }
-
- .form-group input[type="text"],
- .form-group input[type="number"],
- .form-group textarea,
- .form-group select {
- width: 100%;
- padding: 12px 15px;
- border: 2px solid #e0e0e0;
- border-radius: 8px;
- font-size: 15px;
- transition: all 0.3s;
- background: #fafafa;
- }
-
- .form-group input:focus,
- .form-group textarea:focus,
- .form-group select:focus {
- outline: none;
- border-color: #fe2c55;
- background: white;
- box-shadow: 0 0 0 3px rgba(254, 44, 85, 0.1);
- }
-
- .form-group textarea {
- resize: vertical;
- min-height: 100px;
- font-family: inherit;
- }
-
- .form-hint {
- font-size: 12px;
- color: #999;
- margin-top: 5px;
- }
-
- /* ¿ª¹ØÑùʽ */
- .switch-group {
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 15px;
- background: #f8f9fa;
- border-radius: 10px;
- margin-bottom: 10px;
- transition: all 0.3s;
- }
-
- .switch-group:hover {
- background: #f0f0f0;
- }
-
- .switch-info {
- flex: 1;
- }
-
- .switch-label {
- font-size: 15px;
- color: #333;
- font-weight: 500;
- margin-bottom: 3px;
- }
-
- .switch-desc {
- font-size: 12px;
- color: #999;
- }
-
- .switch {
- position: relative;
- width: 56px;
- height: 30px;
- margin-left: 15px;
- }
-
- .switch input {
- opacity: 0;
- width: 0;
- height: 0;
- }
-
- .slider {
- position: absolute;
- cursor: pointer;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- background-color: #ccc;
- transition: 0.3s;
- border-radius: 30px;
- }
-
- .slider:before {
- position: absolute;
- content: "";
- height: 24px;
- width: 24px;
- left: 3px;
- bottom: 3px;
- background-color: white;
- transition: 0.3s;
- border-radius: 50%;
- box-shadow: 0 2px 4px rgba(0,0,0,0.2);
- }
-
- input:checked + .slider {
- background: linear-gradient(135deg, #fe2c55 0%, #ff6b6b 100%);
- }
-
- input:checked + .slider:before {
- transform: translateX(26px);
- }
-
- /* °´Å¥×é */
- .btn-group {
- display: grid;
- grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
- gap: 12px;
- margin-top: 20px;
- }
-
- .btn {
- padding: 14px 20px;
- border: none;
- border-radius: 10px;
- font-size: 15px;
- font-weight: 600;
- cursor: pointer;
- transition: all 0.3s;
- display: flex;
- align-items: center;
- justify-content: center;
- gap: 8px;
- position: relative;
- overflow: hidden;
- }
-
- .btn::before {
- content: '';
- position: absolute;
- top: 50%;
- left: 50%;
- width: 0;
- height: 0;
- border-radius: 50%;
- background: rgba(255,255,255,0.3);
- transform: translate(-50%, -50%);
- transition: width 0.6s, height 0.6s;
- }
-
- .btn:active::before {
- width: 300px;
- height: 300px;
- }
-
- .btn-primary {
- background: linear-gradient(135deg, #fe2c55 0%, #ff6b6b 100%);
- color: white;
- box-shadow: 0 4px 15px rgba(254, 44, 85, 0.3);
- }
-
- .btn-primary:hover {
- transform: translateY(-2px);
- box-shadow: 0 6px 20px rgba(254, 44, 85, 0.4);
- }
-
- .btn-success {
- background: linear-gradient(135deg, #00C851 0%, #00a843 100%);
- color: white;
- box-shadow: 0 4px 15px rgba(0, 200, 81, 0.3);
- }
-
- .btn-success:hover {
- transform: translateY(-2px);
- box-shadow: 0 6px 20px rgba(0, 200, 81, 0.4);
- }
-
- .btn-warning {
- background: linear-gradient(135deg, #ffbb33 0%, #ff8800 100%);
- color: white;
- box-shadow: 0 4px 15px rgba(255, 187, 51, 0.3);
- }
-
- .btn-warning:hover {
- transform: translateY(-2px);
- box-shadow: 0 6px 20px rgba(255, 187, 51, 0.4);
- }
-
- .btn-danger {
- background: linear-gradient(135deg, #ff4444 0%, #cc0000 100%);
- color: white;
- box-shadow: 0 4px 15px rgba(255, 68, 68, 0.3);
- }
-
- .btn-danger:hover {
- transform: translateY(-2px);
- box-shadow: 0 6px 20px rgba(255, 68, 68, 0.4);
- }
-
- .btn-secondary {
- background: #f0f0f0;
- color: #333;
- }
-
- .btn-secondary:hover {
- background: #e0e0e0;
- }
-
- /* ×´Ì¬Ãæ°å */
- .status-panel {
- background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
- border: 2px solid #e0e0e0;
- border-radius: 12px;
- padding: 20px;
- margin-top: 20px;
- }
-
- .status-header {
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-bottom: 15px;
- }
-
- .status-title {
- font-size: 16px;
- font-weight: bold;
- color: #333;
- }
-
- .status-indicator {
- display: flex;
- align-items: center;
- gap: 8px;
- font-size: 14px;
- font-weight: 600;
- }
-
- .status-dot {
- width: 10px;
- height: 10px;
- border-radius: 50%;
- animation: blink 1.5s infinite;
- }
-
- .status-dot.running {
- background: #00C851;
- }
-
- .status-dot.stopped {
- background: #ff4444;
- animation: none;
- }
-
- @keyframes blink {
- 0%, 100% { opacity: 1; }
- 50% { opacity: 0.3; }
- }
-
- .stats-grid {
- display: grid;
- grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
- gap: 12px;
- margin-top: 15px;
- }
-
- .stat-item {
- background: white;
- border: 1px solid #e0e0e0;
- border-radius: 8px;
- padding: 12px;
- text-align: center;
- }
-
- .stat-value {
- font-size: 24px;
- font-weight: bold;
- color: #fe2c55;
- margin-bottom: 5px;
- }
-
- .stat-label {
- font-size: 12px;
- color: #999;
- }
-
- /* ½ø¶ÈÌõ */
- .progress-container {
- margin-top: 15px;
- }
-
- .progress-bar {
- width: 100%;
- height: 10px;
- background: #e0e0e0;
- border-radius: 5px;
- overflow: hidden;
- position: relative;
- }
-
- .progress-fill {
- height: 100%;
- background: linear-gradient(90deg, #fe2c55 0%, #ff6b6b 50%, #ffa502 100%);
- transition: width 0.5s ease;
- border-radius: 5px;
- position: relative;
- }
-
- .progress-fill::after {
- content: '';
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
- animation: shimmer 2s infinite;
- }
-
- @keyframes shimmer {
- 0% { transform: translateX(-100%); }
- 100% { transform: translateX(100%); }
- }
-
- .progress-text {
- text-align: center;
- margin-top: 8px;
- font-size: 13px;
- color: #666;
- }
-
- /* ÈÕÖ¾Ãæ°å */
- .log-panel {
- background: #1e1e1e;
- border-radius: 12px;
- padding: 15px;
- margin-top: 20px;
- max-height: 400px;
- overflow-y: auto;
- font-family: 'Courier New', Consolas, monospace;
- font-size: 13px;
- line-height: 1.8;
- }
-
- .log-header {
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-bottom: 10px;
- padding-bottom: 10px;
- border-bottom: 1px solid #333;
- }
-
- .log-title {
- color: #fff;
- font-weight: bold;
- }
-
- .log-clear {
- background: #333;
- color: #fff;
- border: none;
- padding: 5px 12px;
- border-radius: 5px;
- font-size: 12px;
- cursor: pointer;
- }
-
- .log-clear:hover {
- background: #444;
- }
-
- .log-entry {
- margin-bottom: 6px;
- padding: 4px 0;
- border-bottom: 1px solid #2a2a2a;
- }
-
- .log-time {
- color: #888;
- margin-right: 8px;
- }
-
- .log-info {
- color: #4ec9b0;
- }
-
- .log-success {
- color: #89d185;
- }
-
- .log-error {
- color: #f48771;
- }
-
- .log-warn {
- color: #dcdcaa;
- }
-
- /* Ìáʾ¿ò */
- .toast {
- position: fixed;
- top: 20px;
- right: 20px;
- background: white;
- border-left: 4px solid #fe2c55;
- box-shadow: 0 5px 20px rgba(0,0,0,0.2);
- padding: 15px 20px;
- border-radius: 8px;
- display: none;
- animation: slideIn 0.3s ease;
- z-index: 1000;
- max-width: 350px;
- }
-
- @keyframes slideIn {
- from {
- transform: translateX(100%);
- opacity: 0;
- }
- to {
- transform: translateX(0);
- opacity: 1;
- }
- }
-
- .toast.show {
- display: block;
- }
-
- .toast-title {
- font-weight: bold;
- margin-bottom: 5px;
- color: #333;
- }
-
- .toast-message {
- color: #666;
- font-size: 14px;
- }
-
- /* ÏìӦʽÉè¼Æ */
- @media (max-width: 768px) {
- .container {
- border-radius: 15px;
- }
-
- .header {
- padding: 25px 15px;
- }
-
- .header h1 {
- font-size: 22px;
- }
-
- .content {
- padding: 15px;
- }
-
- .btn-group {
- grid-template-columns: 1fr;
- }
-
- .stats-grid {
- grid-template-columns: repeat(2, 1fr);
- }
- }
- </style>
- </head>
- <body>
- <!-- ToastÌáʾ -->
- <div class="toast" id="toast">
- <div class="toast-title" id="toastTitle">Ìáʾ</div>
- <div class="toast-message" id="toastMessage"></div>
- </div>
-
- <div class="container">
- <!-- Í·²¿ -->
- <div class="header">
- <h1>🎵 ¶¶Òô×Ô¶¯»¯ÓªÏúϵͳ</h1>
- <p>AIWROK Pro - ÖÇÄÜ¹ã¸æÍ¶·Åƽ̨</p>
- <div class="version-badge">v2.0.0 | Build 2026.06.13</div>
- </div>
-
- <!-- ±êǩҳµ¼º½ -->
- <div class="tab-nav">
- <button class="tab-btn active" onclick="switchTab('config')">️ ÈÎÎñÅäÖÃ</button>
- <button class="tab-btn" onclick="switchTab('control')">🎮 Ö´ÐпØÖÆ</button>
- <button class="tab-btn" onclick="switchTab('monitor')">📊 ʵʱ¼à¿Ø</button>
- <button class="tab-btn" onclick="switchTab('logs')">📝 ÔËÐÐÈÕÖ¾</button>
- </div>
-
- <div class="content">
- <!-- ÈÎÎñÅäÖà -->
- <div class="tab-content active" id="tab-config">
- <div class="card">
- <div class="card-title">ËÑË÷¹Ø¼ü´Ê</div>
- <div class="form-group">
- <label for="keywords">ÇëÊäÈëÒªËÑË÷µÄ¹Ø¼ü´Ê£¬¶à¸ö¹Ø¼ü´ÊÓöººÅ·Ö¸ô£º</label>
- <input type="text" id="keywords" placeholder="ÃÀʳ̽µê,ÂÃÓι¥ÂÔ,½¡Éí½Ì³Ì">
- </div>
- </div>
-
- <div class="card">
- <div class="card-title">ÈÎÎñÉèÖÃ</div>
- <div class="form-group">
- <label for="maxVideos">×î´óÊÓÆµÊý£º</label>
- <input type="number" id="maxVideos" placeholder="5">
- </div>
- <div class="form-group">
- <label for="waitTime">²Ù×÷¼ä¸ô£¨Ã룩£º</label>
- <input type="number" id="waitTime" placeholder="2">
- </div>
- </div>
-
- <div class="card">
- <div class="card-title">²Ù×÷¿ª¹Ø</div>
- <div class="switch-group">
- <div class="switch-info">
- <div class="switch-label">µãÔÞ</div>
- <div class="switch-desc">ÊÇ·ñ×Ô¶¯µãÔÞÊÓÆµ</div>
- </div>
- <label class="switch">
- <input type="checkbox" id="likeEnabled">
- <span class="slider"></span>
- </label>
- </div>
- <div class="switch-group">
- <div class="switch-info">
- <div class="switch-label">ÆÀÂÛ</div>
- <div class="switch-desc">ÊÇ·ñ×Ô¶¯ÆÀÂÛÊÓÆµ</div>
- </div>
- <label class="switch">
- <input type="checkbox" id="commentEnabled">
- <span class="slider"></span>
- </label>
- </div>
- <div class="switch-group">
- <div class="switch-info">
- <div class="switch-label">·ÖÏí</div>
- <div class="switch-desc">ÊÇ·ñ×Ô¶¯·ÖÏíÊÓÆµ</div>
- </div>
- <label class="switch">
- <input type="checkbox" id="shareEnabled">
- <span class="slider"></span>
- </label>
- </div>
- <div class="switch-group">
- <div class="switch-info">
- <div class="switch-label">¹Ø×¢</div>
- <div class="switch-desc">ÊÇ·ñ×Ô¶¯¹Ø×¢×÷Õß</div>
- </div>
- <label class="switch">
- <input type="checkbox" id="followEnabled">
- <span class="slider"></span>
- </label>
- </div>
- </div>
-
- <div class="card">
- <div class="card-title">ÆÀÂÛÄ£°å</div>
- <div class="form-group">
- <label for="commentTemplates">ÇëÊäÈëÆÀÂÛÄ£°å£¬Ã¿ÐÐÒ»¸öÄ£°å£º</label>
- <textarea id="commentTemplates" placeholder="Õâ¸öÊÓÆµÕæ²»´í£¡👍\nѧµ½ÁË£¬¸Ðл·ÖÏí£¡\n̫ʵÓÃÁË£¬ÒÑÊÕ²Ø\nÖ§³Öһϣ¡¼ÓÓÍ💪"></textarea>
- </div>
- </div>
-
- <div class="btn-group">
- <button class="btn btn-primary" onclick="saveConfig()">💾 ±£´æÅäÖÃ</button>
- <button class="btn btn-secondary" onclick="loadConfig()">📂 ¼ÓÔØÅäÖÃ</button>
- <button class="btn btn-danger" onclick="resetConfig()">🗑️ ÖØÖÃÅäÖÃ</button>
- </div>
- </div>
-
- <!-- Ö´ÐпØÖÆ -->
- <div class="tab-content" id="tab-control">
- <div class="btn-group">
- <button class="btn btn-primary" id="btnStart" onclick="startCampaign()">🚀 Æô¶¯ÈÎÎñ</button>
- <button class="btn btn-danger" id="btnStop" onclick="stopCampaign()">⏹️ Í£Ö¹ÈÎÎñ</button>
- </div>
- </div>
-
- <!-- ʵʱ¼à¿Ø -->
- <div class="tab-content" id="tab-monitor">
- <div class="status-panel">
- <div class="status-header">
- <div class="status-title">ÈÎÎñ״̬</div>
- <div class="status-indicator">
- <div id="statusDot" class="status-dot stopped"></div>
- <div id="statusText">ÒÑÍ£Ö¹</div>
- </div>
- </div>
- <div class="stats-grid">
- <div class="stat-item">
- <div class="stat-value" id="statTotal">0</div>
- <div class="stat-label">×ÜÊÓÆµÊý</div>
- </div>
- <div class="stat-item">
- <div class="stat-value" id="statLiked">0</div>
- <div class="stat-label">µãÔÞÊý</div>
- </div>
- <div class="stat-item">
- <div class="stat-value" id="statCommented">0</div>
- <div class="stat-label">ÆÀÂÛÊý</div>
- </div>
- <div class="stat-item">
- <div class="stat-value" id="statShared">0</div>
- <div class="stat-label">·ÖÏíÊý</div>
- </div>
- <div class="stat-item">
- <div class="stat-value" id="statFollowed">0</div>
- <div class="stat-label">¹Ø×¢Êý</div>
- </div>
- <div class="stat-item">
- <div class="stat-value" id="statFailed">0</div>
- <div class="stat-label">ʧ°ÜÊý</div>
- </div>
- </div>
- <div class="progress-container">
- <div class="progress-bar">
- <div class="progress-fill" id="progressBar"></div>
- </div>
- <div class="progress-text" id="progressText">×¼±¸¾ÍÐ÷</div>
- </div>
- <div class="status-header">
- <div class="status-title">ÈÎÎñ½ø¶È</div>
- <div class="status-indicator">
- <div id="currentStep">-</div>
- <div id="startTime">-</div>
- </div>
- </div>
- </div>
-
- <div class="btn-group">
- <button class="btn btn-secondary" onclick="resetStats()">🔄 ÖØÖÃͳ¼Æ</button>
- <button class="btn btn-primary" onclick="exportReport()">📄 µ¼³ö±¨¸æ</button>
- </div>
- </div>
-
- <!-- ÔËÐÐÈÕÖ¾ -->
- <div class="tab-content" id="tab-logs">
- <div class="log-panel">
- <div class="log-header">
- <div class="log-title">ÔËÐÐÈÕÖ¾</div>
- <button class="log-clear" onclick="clearLogs()">🗑️ Çå¿ÕÈÕÖ¾</button>
- </div>
- <div id="logContainer">
- <div class="log-entry"><span class="log-time">[ϵͳ]</span><span class="log-info">ÈÕÖ¾ÒÑÇå¿Õ</span></div>
- </div>
- </div>
- </div>
- </div>
- </div>
-
- <script>
- // ==================== È«¾Ö±äÁ¿ ====================
- var isRunning = false;
- var statusInterval = null;
- var taskConfig = {
- keywords: '',
- maxVideos: 5,
- waitTime: 2,
- likeEnabled: true,
- commentEnabled: true,
- shareEnabled: false,
- followEnabled: false,
- commentTemplates: ''
- };
-
- // ==================== ¹¤¾ßº¯Êý ====================
-
- function showToast(title, message, type) {
- var toast = document.getElementById('toast');
- var toastTitle = document.getElementById('toastTitle');
- var toastMessage = document.getElementById('toastMessage');
-
- toastTitle.textContent = title;
- toastMessage.textContent = message;
-
- if (type === 'success') {
- toast.style.borderLeftColor = '#00C851';
- } else if (type === 'error') {
- toast.style.borderLeftColor = '#ff4444';
- } else if (type === 'warning') {
- toast.style.borderLeftColor = '#ffbb33';
- } else {
- toast.style.borderLeftColor = '#fe2c55';
- }
-
- toast.classList.add('show');
-
- setTimeout(function() {
- toast.classList.remove('show');
- }, 3000);
- }
-
- function addLog(message, type) {
- var logContainer = document.getElementById('logContainer');
- var timestamp = new Date().toLocaleTimeString();
- var entry = document.createElement('div');
- entry.className = 'log-entry';
-
- var timeSpan = document.createElement('span');
- timeSpan.className = 'log-time';
- timeSpan.textContent = '[' + timestamp + '] ';
-
- var msgSpan = document.createElement('span');
- msgSpan.className = 'log-' + type;
- msgSpan.textContent = message;
-
- entry.appendChild(timeSpan);
- entry.appendChild(msgSpan);
- logContainer.appendChild(entry);
-
- // ×Ô¶¯¹ö¶¯µ½µ×²¿
- var logPanel = document.querySelector('.log-panel');
- logPanel.scrollTop = logPanel.scrollHeight;
- }
-
- function clearLogs() {
- var logContainer = document.getElementById('logContainer');
- logContainer.innerHTML = '<div class="log-entry"><span class="log-time">[ϵͳ]</span><span class="log-info">ÈÕÖ¾ÒÑÇå¿Õ</span></div>';
- showToast('Ìáʾ', 'ÈÕÖ¾ÒÑÇå¿Õ', 'info');
- }
-
- function switchTab(tabName) {
- // Òþ²ØËùÓбêǩҳÄÚÈÝ
- var tabContents = document.querySelectorAll('.tab-content');
- tabContents.forEach(function(content) {
- content.classList.remove('active');
- });
-
- // È¡ÏûËùÓа´Å¥¼¤»î״̬
- var tabBtns = document.querySelectorAll('.tab-btn');
- tabBtns.forEach(function(btn) {
- btn.classList.remove('active');
- });
-
- // ÏÔʾѡÖеıêǩҳ
- document.getElementById('tab-' + tabName).classList.add('active');
-
- // ¼¤»î¶ÔÓ¦°´Å¥
- event.target.classList.add('active');
- }
-
- function updateProgress(current, total) {
- var percent = Math.round((current / total) * 100);
- document.getElementById('progressBar').style.width = percent + '%';
- document.getElementById('progressText').textContent = '½ø¶È: ' + current + '/' + total + ' (' + percent + '%)';
- }
-
- function updateStatus(data) {
- try {
- var status = typeof data === 'string' ? JSON.parse(data) : data;
-
- // ¸üÐÂÔËÐÐ״̬
- var statusDot = document.getElementById('statusDot');
- var statusText = document.getElementById('statusText');
-
- if (status.isRunning) {
- statusDot.className = 'status-dot running';
- statusText.textContent = 'ÔËÐÐÖÐ';
- statusText.style.color = '#00C851';
- } else {
- statusDot.className = 'status-dot stopped';
- statusText.textContent = 'ÒÑÍ£Ö¹';
- statusText.style.color = '#ff4444';
- }
-
- // ¸üв½ÖèÐÅÏ¢
- if (status.currentStep && status.totalSteps) {
- document.getElementById('currentStep').textContent =
- status.currentStep + '/' + status.totalSteps;
- updateProgress(status.currentStep, status.totalSteps);
- }
-
- // ¸üÐÂͳ¼ÆÊý¾Ý
- if (status.statistics) {
- document.getElementById('statTotal').textContent = status.statistics.totalVideos || 0;
- document.getElementById('statLiked').textContent = status.statistics.likedCount || 0;
- document.getElementById('statCommented').textContent = status.statistics.commentedCount || 0;
- document.getElementById('statShared').textContent = status.statistics.sharedCount || 0;
- document.getElementById('statFollowed').textContent = status.statistics.followedCount || 0;
- document.getElementById('statFailed').textContent = status.statistics.failedCount || 0;
- }
-
- // ¸üпªÊ¼Ê±¼ä
- if (status.statistics && status.statistics.startTime) {
- document.getElementById('startTime').textContent = status.statistics.startTime;
- }
-
- } catch (e) {
- console.error('¸üÐÂ״̬ʧ°Ü:', e);
- }
- }
-
- // ==================== ÅäÖùÜÀí ====================
-
- function saveConfig() {
- try {
- addLog('ÕýÔÚ±£´æÅäÖÃ...', 'info');
-
- if (window.at && window.at.publicSet) {
- // ±£´æËÑË÷¹Ø¼ü´Ê
- var keywords = document.getElementById('keywords').value;
- window.at.publicSet('douyin_keywords', keywords);
-
- // ±£´æ×î´óÊÓÆµÊý
- var maxVideos = document.getElementById('maxVideos').value;
- window.at.publicSet('douyin_max_videos', maxVideos);
-
- // ±£´æµÈ´ýʱ¼ä
- var waitTime = document.getElementById('waitTime').value;
- window.at.publicSet('douyin_wait_time', waitTime);
-
- // ±£´æ¿ª¹ØÅäÖÃ
- window.at.publicSet('douyin_like_enabled',
- document.getElementById('likeEnabled').checked ? 'true' : 'false');
- window.at.publicSet('douyin_comment_enabled',
- document.getElementById('commentEnabled').checked ? 'true' : 'false');
- window.at.publicSet('douyin_share_enabled',
- document.getElementById('shareEnabled').checked ? 'true' : 'false');
- window.at.publicSet('douyin_follow_enabled',
- document.getElementById('followEnabled').checked ? 'true' : 'false');
-
- // ±£´æÆÀÂÛÄ£°å
- var commentTemplates = document.getElementById('commentTemplates').value;
- window.at.publicSet('douyin_comment_templates', commentTemplates);
-
- addLog('ÅäÖñ£´æ³É¹¦', 'success');
- showToast('³É¹¦', 'ÅäÖÃÒѱ£´æµ½ÔÉú»·¾³', 'success');
-
- // ͬʱ֪ͨÔÉú¶Ë
- if (window.at.callFun) {
- window.at.callFun('main', 'MSG:💾 ÅäÖÃÒѱ£´æ');
- }
- } else {
- addLog('publicSet·½·¨²»¿ÉÓÃ', 'error');
- showToast('´íÎó', 'ÎÞ·¨Á¬½Óµ½ÔÉú»·¾³', 'error');
- }
- } catch (e) {
- addLog('±£´æÅäÖÃʧ°Ü: ' + e.message, 'error');
- showToast('´íÎó', '±£´æÊ§°Ü: ' + e.message, 'error');
- }
- }
-
- function loadConfig() {
- try {
- addLog('ÕýÔÚ¼ÓÔØÅäÖÃ...', 'info');
-
- if (window.at && window.at.publicGet) {
- // ¼ÓÔØËÑË÷¹Ø¼ü´Ê
- var keywords = window.at.publicGet('douyin_keywords');
- if (keywords) {
- document.getElementById('keywords').value = keywords;
- }
-
- // ¼ÓÔØ×î´óÊÓÆµÊý
- var maxVideos = window.at.publicGet('douyin_max_videos');
- if (maxVideos) {
- document.getElementById('maxVideos').value = maxVideos;
- }
-
- // ¼ÓÔØµÈ´ýʱ¼ä
- var waitTime = window.at.publicGet('douyin_wait_time');
- if (waitTime) {
- document.getElementById('waitTime').value = waitTime;
- }
-
- // ¼ÓÔØ¿ª¹ØÅäÖÃ
- var likeEnabled = window.at.publicGet('douyin_like_enabled');
- if (likeEnabled !== null) {
- document.getElementById('likeEnabled').checked = likeEnabled === 'true';
- }
-
- var commentEnabled = window.at.publicGet('douyin_comment_enabled');
- if (commentEnabled !== null) {
- document.getElementById('commentEnabled').checked = commentEnabled === 'true';
- }
-
- var shareEnabled = window.at.publicGet('douyin_share_enabled');
- if (shareEnabled !== null) {
- document.getElementById('shareEnabled').checked = shareEnabled === 'true';
- }
-
- var followEnabled = window.at.publicGet('douyin_follow_enabled');
- if (followEnabled !== null) {
- document.getElementById('followEnabled').checked = followEnabled === 'true';
- }
-
- // ¼ÓÔØÆÀÂÛÄ£°å
- var commentTemplates = window.at.publicGet('douyin_comment_templates');
- if (commentTemplates) {
- document.getElementById('commentTemplates').value = commentTemplates;
- }
-
- addLog('ÅäÖüÓÔØ³É¹¦', 'success');
- showToast('³É¹¦', 'ÅäÖÃÒÑ´ÓÔÉú»·¾³¼ÓÔØ', 'success');
- } else {
- addLog('publicGet·½·¨²»¿ÉÓÃ', 'error');
- showToast('´íÎó', 'ÎÞ·¨Á¬½Óµ½ÔÉú»·¾³', 'error');
- }
- } catch (e) {
- addLog('¼ÓÔØÅäÖÃʧ°Ü: ' + e.message, 'error');
- showToast('´íÎó', '¼ÓÔØÊ§°Ü: ' + e.message, 'error');
- }
- }
-
- function resetConfig() {
- if (confirm('È·¶¨ÒªÖØÖÃΪĬÈÏÅäÖÃÂð£¿')) {
- document.getElementById('keywords').value = 'ÃÀʳ̽µê,ÂÃÓι¥ÂÔ,½¡Éí½Ì³Ì';
- document.getElementById('maxVideos').value = '5';
- document.getElementById('waitTime').value = '2';
- document.getElementById('likeEnabled').checked = true;
- document.getElementById('commentEnabled').checked = true;
- document.getElementById('shareEnabled').checked = false;
- document.getElementById('followEnabled').checked = false;
- document.getElementById('commentTemplates').value = 'Õâ¸öÊÓÆµÕæ²»´í£¡👍\nѧµ½ÁË£¬¸Ðл·ÖÏí£¡\n̫ʵÓÃÁË£¬ÒÑÊÕ²Ø\nÖ§³Öһϣ¡¼ÓÓÍ💪';
-
- addLog('ÅäÖÃÒÑÖØÖÃΪĬÈÏÖµ', 'info');
- showToast('Ìáʾ', 'ÅäÖÃÒÑÖØÖÃ', 'info');
- }
- }
-
- // ==================== ÈÎÎñ¿ØÖÆ ====================
-
- function startCampaign() {
- if (isRunning) {
- showToast('¾¯¸æ', 'ÈÎÎñÒÑÔÚÔËÐÐÖÐ', 'warning');
- return;
- }
-
- try {
- addLog('🚀 ÕýÔÚÆô¶¯¶¶Òô¹ã¸æÈÎÎñ...', 'info');
-
- // Ïȱ£´æÅäÖÃ
- saveConfig();
-
- // µ÷ÓÃÔÉúº¯Êý - AIWROKÖ»Ö§³Öµ÷ÓÃmainº¯Êý
- if (window.at && window.at.callFun) {
- var result = window.at.callFun('main', 'START_CAMPAIGN');
- addLog('ÈÎÎñÆô¶¯Ö¸ÁîÒÑ·¢ËÍ', 'success');
-
- isRunning = true;
- document.getElementById('btnStart').disabled = true;
- document.getElementById('btnStop').disabled = false;
-
- showToast('³É¹¦', 'ÈÎÎñÒÑÆô¶¯', 'success');
-
- // ¶¨ÆÚ»ñȡ״̬
- if (statusInterval) {
- clearInterval(statusInterval);
- }
- statusInterval = setInterval(function() {
- getStatus();
- }, 2000);
-
- } else {
- addLog('callFun·½·¨²»¿ÉÓÃ', 'error');
- showToast('´íÎó', 'ÎÞ·¨Á¬½Óµ½ÔÉú»·¾³', 'error');
- }
-
- } catch (e) {
- addLog('Æô¶¯Ê§°Ü: ' + e.message, 'error');
- showToast('´íÎó', 'Æô¶¯Ê§°Ü: ' + e.message, 'error');
- }
- }
-
- function stopCampaign() {
- if (!isRunning) {
- showToast('¾¯¸æ', 'µ±Ç°Ã»ÓÐÔËÐÐÖеÄÈÎÎñ', 'warning');
- return;
- }
-
- try {
- addLog('⏹️ ÕýÔÚÍ£Ö¹ÈÎÎñ...', 'warn');
-
- if (window.at && window.at.callFun) {
- var result = window.at.callFun('main', 'STOP_CAMPAIGN');
- addLog('ÈÎÎñÍ£Ö¹Ö¸ÁîÒÑ·¢ËÍ', 'success');
-
- isRunning = false;
- document.getElementById('btnStart').disabled = false;
- document.getElementById('btnStop').disabled = true;
-
- if (statusInterval) {
- clearInterval(statusInterval);
- statusInterval = null;
- }
-
- showToast('³É¹¦', 'ÈÎÎñÒÑÍ£Ö¹', 'success');
- } else {
- addLog('callFun·½·¨²»¿ÉÓÃ', 'error');
- showToast('´íÎó', 'ÎÞ·¨Á¬½Óµ½ÔÉú»·¾³', 'error');
- }
-
- } catch (e) {
- addLog('ֹͣʧ°Ü: ' + e.message, 'error');
- showToast('´íÎó', 'ֹͣʧ°Ü: ' + e.message, 'error');
- }
- }
-
- function getStatus() {
- try {
- if (window.at && window.at.callFun) {
- var status = window.at.callFun('main', 'GET_STATUS');
- updateStatus(status);
- }
- } catch (e) {
- // ¾²Ä¬Ê§°Ü£¬±ÜÃâÆµ·±±¨´í
- }
- }
-
- function resetStats() {
- if (confirm('È·¶¨ÒªÖØÖÃͳ¼ÆÊý¾ÝÂð£¿')) {
- try {
- addLog('🔄 ÕýÔÚÖØÖÃͳ¼ÆÊý¾Ý...', 'info');
-
- if (window.at && window.at.callFun) {
- var result = window.at.callFun('main', 'RESET_STATS');
- addLog(result, 'success');
-
- // Çå¿Õ״̬ÏÔʾ
- document.getElementById('statTotal').textContent = '0';
- document.getElementById('statLiked').textContent = '0';
- document.getElementById('statCommented').textContent = '0';
- document.getElementById('statShared').textContent = '0';
- document.getElementById('statFollowed').textContent = '0';
- document.getElementById('statFailed').textContent = '0';
- document.getElementById('progressBar').style.width = '0%';
- document.getElementById('progressText').textContent = '×¼±¸¾ÍÐ÷';
- document.getElementById('currentStep').textContent = '-';
- document.getElementById('startTime').textContent = '-';
-
- showToast('³É¹¦', 'ͳ¼ÆÊý¾ÝÒÑÖØÖÃ', 'success');
- } else {
- addLog('callFun·½·¨²»¿ÉÓÃ', 'error');
- showToast('´íÎó', 'ÎÞ·¨Á¬½Óµ½ÔÉú»·¾³', 'error');
- }
-
- } catch (e) {
- addLog('ÖØÖÃʧ°Ü: ' + e.message, 'error');
- showToast('´íÎó', 'ÖØÖÃʧ°Ü: ' + e.message, 'error');
- }
- }
- }
-
- function exportReport() {
- try {
- addLog('📄 ÕýÔÚÉú³ÉÖ´Ðб¨¸æ...', 'info');
-
- var report = '========================================\n';
- report += '📊 ¶¶Òô¹ã¸æÍ¶·ÅÖ´Ðб¨¸æ\n';
- report += '========================================\n';
- report += 'Éú³Éʱ¼ä: ' + new Date().toLocaleString() + '\n\n';
-
- // Ìí¼ÓÅäÖÃÐÅÏ¢
- report += '--- ÅäÖÃÐÅÏ¢ ---\n';
- report += 'ËÑË÷¹Ø¼ü´Ê: ' + document.getElementById('keywords').value + '\n';
- report += '×î´óÊÓÆµÊý: ' + document.getElementById('maxVideos').value + '\n';
- report += '²Ù×÷¼ä¸ô: ' + document.getElementById('waitTime').value + 'Ãë\n';
- report += 'µãÔÞ: ' + (document.getElementById('likeEnabled').checked ? '¿ªÆô' : '¹Ø±Õ') + '\n';
- report += 'ÆÀÂÛ: ' + (document.getElementById('commentEnabled').checked ? '¿ªÆô' : '¹Ø±Õ') + '\n';
- report += '·ÖÏí: ' + (document.getElementById('shareEnabled').checked ? '¿ªÆô' : '¹Ø±Õ') + '\n';
- report += '¹Ø×¢: ' + (document.getElementById('followEnabled').checked ? '¿ªÆô' : '¹Ø±Õ') + '\n\n';
-
- // Ìí¼Óͳ¼ÆÊý¾Ý
- report += '--- ͳ¼ÆÊý¾Ý ---\n';
- report += '×ÜÊÓÆµÊý: ' + document.getElementById('statTotal').textContent + '\n';
- report += 'µãÔÞÊý: ' + document.getElementById('statLiked').textContent + '\n';
- report += 'ÆÀÂÛÊý: ' + document.getElementById('statCommented').textContent + '\n';
- report += '·ÖÏíÊý: ' + document.getElementById('statShared').textContent + '\n';
- report += '¹Ø×¢Êý: ' + document.getElementById('statFollowed').textContent + '\n';
- report += 'ʧ°ÜÊý: ' + document.getElementById('statFailed').textContent + '\n';
- report += '========================================\n';
-
- // ÏÔʾ±¨¸æ
- alert(report);
-
- addLog('±¨¸æÒÑÉú³É', 'success');
- showToast('³É¹¦', 'Ö´Ðб¨¸æÒÑÉú³É', 'success');
-
- } catch (e) {
- addLog('Éú³É±¨¸æÊ§°Ü: ' + e.message, 'error');
- showToast('´íÎó', 'Éú³É±¨¸æÊ§°Ü: ' + e.message, 'error');
- }
- }
-
- function testConnection() {
- try {
- addLog('🔗 ÕýÔÚ²âÊÔÁ¬½Ó...', 'info');
-
- if (window.at && window.at.callFun) {
- var testMessage = 'H5¿ØÖÆÌ¨Á¬½Ó²âÊÔ - ' + new Date().toLocaleString();
- var result = window.at.callFun('main', 'TEST:' + testMessage);
- addLog(result, 'success');
- showToast('³É¹¦', result, 'success');
- } else {
- addLog('callFun·½·¨²»¿ÉÓÃ', 'error');
- showToast('´íÎó', 'ÎÞ·¨Á¬½Óµ½ÔÉú»·¾³', 'error');
- }
-
- } catch (e) {
- addLog('²âÊÔÁ¬½Óʧ°Ü: ' + e.message, 'error');
- showToast('´íÎó', 'Á¬½Óʧ°Ü: ' + e.message, 'error');
- }
- }
-
- // ==================== ³õʼ»¯ ====================
-
- window.onload = function() {
- addLog('¿ØÖÆÌ¨³õʼ»¯Íê³É', 'info');
- addLog('ϵͳ°æ±¾: v2.0.0 | Build 2026.06.13', 'info');
-
- // ×Ô¶¯¼ÓÔØÅäÖÃ
- setTimeout(function() {
- loadConfig();
- }, 300);
-
- // ²âÊÔÁ¬½Ó£¨ÑÓ³Ù¸ü³¤Ê±¼äÈ·±£WebViewÍêÈ«³õʼ»¯£©
- setTimeout(function() {
- try {
- testConnection();
- } catch (e) {
- addLog('Á¬½Ó²âÊÔʧ°Ü£¨¿ÉºöÂÔ£©: ' + e.message, 'warn');
- }
- }, 1500);
-
- addLog('µÈ´ýÓû§²Ù×÷...', 'info');
- };
- </script>
- </body>
- </html>
¸´ÖÆ´úÂë
|
|