jQuery(document).ready(function($) { // 选项卡切换 $('.doubao-tab-button').click(function() { var tabId = $(this).data('tab'); // 更新按钮状态 $('.doubao-tab-button').removeClass('active'); $(this).addClass('active'); // 更新内容显示 $('.doubao-tab-content').removeClass('active'); $('#tab-' + tabId).addClass('active'); }); // 生成提示语按钮点击 $('#doubao-generate-prompts').click(function() { $('#prompt-generation-options').toggle(); }); // 确认生成提示语 $('#confirm-generate-prompts').click(function() { var topic = $('#prompt-topic').val(); var count = $('#prompt-count').val(); if (!topic) { alert('请输入主题'); return; } $(this).prop('disabled', true).html(' 生成中...'); $.post(doubao_ajax.url, { action: 'doubao_generate_prompts', nonce: doubao_ajax.nonce, topic: topic, count: count }, function(response) { $('#confirm-generate-prompts').prop('disabled', false).html('确认生成'); if (response.success) { var container = $('#doubao-prompts-container'); response.data.forEach(function(prompt) { var index = container.find('.doubao-list-item').length; var html = '
' + '' + '
'; container.append(html); }); $('#prompt-generation-options').hide(); $('#prompt-topic').val(''); } else { alert('生成失败: ' + response.data); } }); }); // 手动发布 $('#manual-trigger').click(function() { var count = $('#manual-publish-count').val(); if (!count || count < 1 || count > 10) { alert('请输入1-10之间的发布数量'); return; } $(this).prop('disabled', true).html(' 处理中...'); $.post(doubao_ajax.url, { action: 'doubao_manual_trigger', nonce: doubao_ajax.nonce, count: count }, function(response) { $('#manual-trigger').prop('disabled', false).html(' 手动触发发布任务'); if (response.success) { alert(response.data); location.reload(); } else { alert('发布失败: ' + response.data); } }); }); });新手入门 – 一秒云软件中心

新手入门

个人中心
购物车
优惠劵
今日签到
搜索