feat(wechat-channel): add draft upload functionality for video channel

- Add isDraft parameter to TencentVideo class to control publishing behavior
- Modify click_publish method to click "保存草稿" instead of "发表" when isDraft is true
- Update post_video_tencent function to accept and pass is_draft parameter
- Add is_draft parameter to /postVideo API endpoint to receive frontend data
- Add "视频号上传草稿" checkbox in frontend that appears only for video channel platform
- Update defaultTabInit to include isDraft property with default value false
- Include isDraft in publishData sent to backend API
- Implement proper URL checking for draft vs publish success confirmation

The new functionality allows users to save WeChat Channel videos as drafts
instead of immediately publishing them when the checkbox is selected.
This commit is contained in:
Deroino
2025-11-13 09:12:39 +08:00
parent c0e7b64b94
commit 81b71d023d
4 changed files with 46 additions and 17 deletions
+13 -2
View File
@@ -402,6 +402,15 @@
/>
</div>
<!-- 草稿选项 (仅在视频号可见) -->
<div v-if="tab.selectedPlatform === 2" class="draft-section">
<el-checkbox
v-model="tab.isDraft"
label="视频号上传草稿"
class="draft-checkbox"
/>
</div>
<!-- 定时发布 -->
<div class="schedule-section">
<h3>定时发布</h3>
@@ -534,7 +543,8 @@ const defaultTabInit = {
dailyTimes: ['10:00'], // 每天发布时间点列表
startDays: 0, // 从今天开始计算的发布天数,0表示明天,1表示后天
publishStatus: null, // 发布状态,包含message和type
publishing: false // 发布状态,用于控制按钮loading效果
publishing: false, // 发布状态,用于控制按钮loading效果
isDraft: false // 是否保存为草稿,仅视频号平台可见
}
// helper to create a fresh deep-copied tab from defaultTabInit
@@ -791,7 +801,8 @@ const confirmPublish = async (tab) => {
startDays: tab.scheduleEnabled ? tab.startDays || 0 : 0, // 从今天开始计算的发布天数,0表示明天,1表示后天
category: 0, //表示非原创
productLink: tab.productLink.trim() || '', // 商品链接
productTitle: tab.productTitle.trim() || '' // 商品名称
productTitle: tab.productTitle.trim() || '', // 商品名称
isDraft: tab.isDraft // 是否保存为草稿,仅视频号平台使用
}
// 调用后端发布API