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);
}
});
});
});开发公司判断 – 一秒云软件中心
幸运之星正在降临...
点击领取今天的签到奖励!
恭喜!您今天获得了{{mission.data.mission.credit}}积分
-
限制以下商品使用: 限制以下商品分类使用: 不限制使用: 所有商品和商品类型均可使用