-
Notifications
You must be signed in to change notification settings - Fork 46
feat(sharing): add Xiaohongshu sharing guide to three share-option popups #2222
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
52ad704
2e24794
b91fe68
3dfa9fc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,7 @@ | ||
| <script setup lang="ts"> | ||
| import { ref, computed, watch } from 'vue' | ||
| import PlatformSelector from './PlatformSelector.vue' | ||
| import XiaohongshuShareGuide from './XiaohongshuShareGuide.vue' | ||
| import { type RecordingData } from '@/apis/recording' | ||
| import { type PlatformConfig } from './platform-share' | ||
| import { universalUrlToWebUrl } from '@/models/common/cloud' | ||
|
|
@@ -70,22 +71,13 @@ async function updateVideoSrc() { | |
| // Handle platform selection change | ||
| function handlePlatformChange(platform: PlatformConfig) { | ||
| selectedPlatform.value = platform | ||
|
|
||
| // 检查是否需要显示下载提示 | ||
| if (!platform.shareType.supportVideo && !platform.shareType.supportURL) { | ||
| throw new DefaultException({ | ||
| en: `Please download the video to local and share it on ${platform.basicInfo.label.en}`, | ||
| zh: `请下载视频到本地,然后去${platform.basicInfo.label.zh}分享` | ||
| }) | ||
| } | ||
|
|
||
| // QR code generation is handled automatically by watch, no need to call manually | ||
| } | ||
|
Comment on lines
72
to
75
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The check for unsupported sharing types has been removed from
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
这个暂时不用,因为抖音后面可以支持了,小红书直接显示不支持,B站后面如果确定了行或者不行,就也给出比较明确的提示 |
||
|
|
||
| // Use useMessageHandle wrapped platform change handler | ||
| const handlePlatformChangeWithMessage = useMessageHandle(handlePlatformChange, { | ||
| en: 'Video sharing not supported', | ||
| zh: '视频分享暂不支持' | ||
| en: 'Platform selection failed', | ||
| zh: '平台选择失败' | ||
| }) | ||
|
|
||
| // Get current recording URL | ||
|
|
@@ -276,7 +268,14 @@ watch( | |
| </div> | ||
| <div class="qr-section"> | ||
| <div class="qr-section-inner"> | ||
| <div class="qr-content"> | ||
| <XiaohongshuShareGuide | ||
| v-if="selectedPlatform?.basicInfo.name === 'xiaohongshu'" | ||
| type="video" | ||
| :is-loading="handleDownloadClick.isLoading.value" | ||
| @download="handleDownloadClick.fn" | ||
| /> | ||
|
|
||
| <div v-else class="qr-content"> | ||
| <div class="qr-code"> | ||
| <img | ||
| v-if="qrCodeData" | ||
|
|
@@ -296,16 +295,19 @@ watch( | |
| $t({ en: 'Scan the code with the corresponding platform to share', zh: '用对应平台进行扫码分享' }) | ||
| }} | ||
| </div> | ||
| </div> | ||
| <div class="action-buttons"> | ||
| <button | ||
| class="download-btn" | ||
| :disabled="!videoSrc" | ||
| :loading="handleDownloadClick.isLoading.value" | ||
| @click="handleDownloadClick.fn" | ||
| > | ||
| {{ $t({ en: 'Download Video', zh: '下载视频' }) }} | ||
| </button> | ||
| <div class="action-buttons"> | ||
| <button | ||
| class="download-btn" | ||
| :disabled="!videoSrc || handleDownloadClick.isLoading.value" | ||
| @click="handleDownloadClick.fn" | ||
| > | ||
| {{ | ||
| handleDownloadClick.isLoading.value | ||
| ? $t({ en: 'Downloading...', zh: '下载中...' }) | ||
| : $t({ en: 'Download Video', zh: '下载视频' }) | ||
| }} | ||
| </button> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
|
|
@@ -365,9 +367,10 @@ watch( | |
| } | ||
|
|
||
| .share-main { | ||
| height: 100%; | ||
| display: flex; | ||
| align-items: stretch; | ||
| gap: 24px; | ||
| min-height: 330px; | ||
| } | ||
|
|
||
| .video-section { | ||
|
|
@@ -376,7 +379,6 @@ watch( | |
| flex-direction: column; | ||
| justify-content: center; | ||
| align-items: center; | ||
| height: 100%; | ||
| gap: 16px; | ||
| } | ||
|
|
||
|
|
@@ -453,7 +455,6 @@ watch( | |
| flex-direction: column; | ||
| align-items: center; | ||
| gap: 8px; | ||
| margin-bottom: 16px; | ||
| } | ||
|
|
||
| .rerecord-hint { | ||
|
|
@@ -488,7 +489,6 @@ watch( | |
| width: 100%; | ||
| display: flex; | ||
| justify-content: center; | ||
| margin-top: 24px; | ||
| padding: 0 20px; | ||
| } | ||
|
|
||
|
|
@@ -500,7 +500,6 @@ watch( | |
| align-items: stretch; | ||
| min-width: 220px; | ||
| min-height: 0; | ||
| padding: 16px; | ||
| } | ||
|
|
||
| .qr-section-inner { | ||
|
|
@@ -592,7 +591,6 @@ watch( | |
| .actions { | ||
| display: flex; | ||
| gap: 10px; | ||
| margin-top: 20px; | ||
| justify-content: center; | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个跟 #2189 (comment) 这里提到的有关,我们定义 platform-share 模块的目标是,把每个平台自身的逻辑统一维护(在 platform-share),而不需要扩散到每一个具体的业务模块(如 ProjectDirectSharing, ProjectRecordingSharing, ProjectScreenshotSharing)中;因此在这里出现针对 xiaohongshu 的逻辑不是我们预期的
这里要想一下怎么把
<XiaohongshuShareGuide>的逻辑也做进现有的PlatformConfig中(我们大概率需要扩展PlatformConfig);它可能体现为一个 component(component 可以看成是返回一份 UI 描述的函数),也可能体现为返回结构化的 steps 信息或者 markdown 字符串的函数,也可能是别的There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
明白,我去和海龙沟通改进一下