update at 2025-10-10 17:00:09
This commit is contained in:
@@ -93,6 +93,18 @@ export class PreviewManager {
|
||||
|
||||
// 构建 UI
|
||||
this.platformChooser.render();
|
||||
|
||||
// 共享操作按钮
|
||||
this.platformChooser.setActions({
|
||||
onRefresh: () => this.refresh(),
|
||||
onPublish: () => this.publishCurrentPlatform(),
|
||||
getLabels: (platform) => {
|
||||
if (platform === 'wechat') {
|
||||
return { refresh: '🔄 刷新', publish: '📝 发布' };
|
||||
}
|
||||
return { refresh: '🔄 刷新', publish: '📤 发布' };
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -125,6 +137,22 @@ export class PreviewManager {
|
||||
this.wechatPreview.build();
|
||||
}
|
||||
|
||||
private async publishCurrentPlatform(): Promise<void> {
|
||||
if (this.currentPlatform === 'wechat') {
|
||||
if (!this.wechatPreview) {
|
||||
new Notice('微信预览未初始化');
|
||||
return;
|
||||
}
|
||||
await this.wechatPreview.publish();
|
||||
} else if (this.currentPlatform === 'xiaohongshu') {
|
||||
if (!this.xhsPreview) {
|
||||
new Notice('小红书预览未初始化');
|
||||
return;
|
||||
}
|
||||
await this.xhsPreview.publish();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建小红书预览组件
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user