feat(分享): 新增分享模板风格选择与访客反馈功能
All checks were successful
test/timeline-frontend/pipeline/head This commit looks good
All checks were successful
test/timeline-frontend/pipeline/head This commit looks good
新增分享模板风格选择功能,支持编辑、电影和剪贴簿三种风格 添加访客反馈系统,包括查看次数统计和留言功能 优化分享状态管理,区分公开、草稿和预览状态 扩展分享配置数据模型,支持模板风格和反馈统计 重构分享页面样式,根据模板风格应用不同主题
This commit is contained in:
@@ -4,6 +4,12 @@ import SortableTimelineGrid from '@/pages/story/components/SortableTimelineGrid'
|
||||
import TimelineItemDrawer from '@/pages/story/components/TimelineItemDrawer';
|
||||
import type { StoryItem, StoryItemTimeQueryParams, StoryType } from '@/pages/story/data';
|
||||
import { queryStoryDetail, queryStoryItem, removeStoryItem } from '@/pages/story/service';
|
||||
import {
|
||||
getStoryShareActionLabel,
|
||||
getStorySharePath,
|
||||
getStoryShareState,
|
||||
getStoryShareStatusText,
|
||||
} from '@/pages/story/utils/shareState';
|
||||
import { judgePermission } from '@/pages/story/utils/utils';
|
||||
import {
|
||||
EyeOutlined,
|
||||
@@ -156,6 +162,10 @@ const Index = () => {
|
||||
const storyId = lineId || detail?.instanceId;
|
||||
const canEdit = judgePermission(detail?.permissionType ?? null, 'edit');
|
||||
const canManageCollaborators = judgePermission(detail?.permissionType ?? null, 'auth');
|
||||
const shareState = getStoryShareState(detail);
|
||||
const shareStatusText = getStoryShareStatusText(detail);
|
||||
const shareActionLabel =
|
||||
shareState === 'public' ? 'Open Public Share' : getStoryShareActionLabel(detail);
|
||||
|
||||
const refreshStory = useCallback(() => {
|
||||
setItems([]);
|
||||
@@ -189,6 +199,16 @@ const Index = () => {
|
||||
history.push(`/share/studio/${storyId}`);
|
||||
}, [storyId]);
|
||||
|
||||
const openShareSurface = useCallback(() => {
|
||||
const sharePath = getStorySharePath(detail);
|
||||
if (!sharePath) {
|
||||
message.warning('This story is not ready for sharing yet.');
|
||||
return;
|
||||
}
|
||||
|
||||
history.push(sharePath);
|
||||
}, [detail]);
|
||||
|
||||
useEffect(() => {
|
||||
setItems([]);
|
||||
setHasMoreOld(true);
|
||||
@@ -334,10 +354,10 @@ const Index = () => {
|
||||
if (isMobile) {
|
||||
const menuItems: MenuProps['items'] = [
|
||||
{
|
||||
key: 'preview',
|
||||
label: 'Preview',
|
||||
icon: <EyeOutlined />,
|
||||
onClick: openSharePreview,
|
||||
key: 'share',
|
||||
label: shareActionLabel,
|
||||
icon: shareState === 'public' ? <ShareAltOutlined /> : <EyeOutlined />,
|
||||
onClick: openShareSurface,
|
||||
},
|
||||
{
|
||||
key: 'studio',
|
||||
@@ -372,7 +392,7 @@ const Index = () => {
|
||||
return (
|
||||
<Space wrap>
|
||||
<Button icon={<EyeOutlined />} onClick={openSharePreview}>
|
||||
Preview
|
||||
{shareActionLabel}
|
||||
</Button>
|
||||
<Button icon={<ShareAltOutlined />} onClick={openShareStudio}>
|
||||
Share Studio
|
||||
@@ -418,14 +438,18 @@ const Index = () => {
|
||||
<span>{detail.storyTime || 'No story time set'}</span>
|
||||
<span>{Number(detail.itemCount || 0)} moments</span>
|
||||
<span>{detail.updateTime || 'No recent update'}</span>
|
||||
<span>{shareStatusText}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div style={{ display: 'flex', gap: 8, flexWrap: 'wrap', alignItems: 'flex-start' }}>
|
||||
<Button type="primary" icon={<ShareAltOutlined />} onClick={openShareStudio}>
|
||||
Open Studio
|
||||
</Button>
|
||||
<Button icon={<EyeOutlined />} onClick={openSharePreview}>
|
||||
Preview
|
||||
<Button
|
||||
icon={shareState === 'public' ? <ShareAltOutlined /> : <EyeOutlined />}
|
||||
onClick={openShareSurface}
|
||||
>
|
||||
{shareActionLabel}
|
||||
</Button>
|
||||
{canEdit && (
|
||||
<Button
|
||||
|
||||
Reference in New Issue
Block a user