diff --git a/Cunkebao/src/pages/workspace/moments-sync/Detail.tsx b/Cunkebao/src/pages/workspace/moments-sync/Detail.tsx
index 283f96bef..8500a5858 100644
--- a/Cunkebao/src/pages/workspace/moments-sync/Detail.tsx
+++ b/Cunkebao/src/pages/workspace/moments-sync/Detail.tsx
@@ -1,19 +1,26 @@
-import React, { useState, useEffect, useCallback } from 'react';
-import { useParams, useNavigate } from 'react-router-dom';
-import { Button } from '@/components/ui/button';
-import { Card } from '@/components/ui/card';
-import { Badge } from '@/components/ui/badge';
-import { Switch } from '@/components/ui/switch';
-import { useToast } from '@/components/ui/toast';
-import {
- fetchMomentsSyncTaskDetail,
- toggleMomentsSyncTask,
- syncMoments
-} from '@/api/momentsSync';
-import { MomentsSyncTask } from '@/types/moments-sync';
-import { ChevronLeft, Edit2, RefreshCw, Clock, Database, Smartphone } from 'lucide-react';
-import Layout from '@/components/Layout';
-import BottomNav from '@/components/BottomNav';
+import React, { useState, useEffect, useCallback } from "react";
+import { useParams, useNavigate } from "react-router-dom";
+import { Button } from "@/components/ui/button";
+import { Card } from "@/components/ui/card";
+import { Badge } from "@/components/ui/badge";
+import { Switch } from "@/components/ui/switch";
+import { useToast } from "@/components/ui/toast";
+import {
+ fetchMomentsSyncTaskDetail,
+ toggleMomentsSyncTask,
+ syncMoments,
+} from "@/api/momentsSync";
+import { MomentsSyncTask } from "@/types/moments-sync";
+import {
+ ChevronLeft,
+ Edit2,
+ RefreshCw,
+ Clock,
+ Database,
+ Smartphone,
+} from "lucide-react";
+import Layout from "@/components/Layout";
+import BottomNav from "@/components/BottomNav";
export default function MomentsSyncDetail() {
const { id } = useParams();
@@ -31,7 +38,7 @@ export default function MomentsSyncDetail() {
setTask(taskData);
}
} catch (error) {
- toast({ title: '获取任务详情失败', variant: 'destructive' });
+ toast({ title: "获取任务详情失败", variant: "destructive" });
} finally {
setLoading(false);
}
@@ -49,9 +56,9 @@ export default function MomentsSyncDetail() {
const newStatus = task.status === 1 ? 2 : 1;
await toggleMomentsSyncTask(id, newStatus.toString());
setTask({ ...task, status: newStatus });
- toast({ title: newStatus === 1 ? '任务已开启' : '任务已暂停' });
+ toast({ title: newStatus === 1 ? "任务已开启" : "任务已暂停" });
} catch (error) {
- toast({ title: '操作失败', variant: 'destructive' });
+ toast({ title: "操作失败", variant: "destructive" });
}
};
@@ -59,10 +66,10 @@ export default function MomentsSyncDetail() {
if (!id) return;
try {
await syncMoments(id);
- toast({ title: '同步任务已启动' });
+ toast({ title: "同步任务已启动" });
fetchTaskDetail(); // 刷新任务详情
} catch (error) {
- toast({ title: '同步失败', variant: 'destructive' });
+ toast({ title: "同步失败", variant: "destructive" });
}
};
@@ -91,7 +98,10 @@ export default function MomentsSyncDetail() {
任务不存在
-
@@ -106,7 +116,11 @@ export default function MomentsSyncDetail() {
- navigate('/workspace/moments-sync')}>
+ navigate("/workspace/moments-sync")}
+ >
朋友圈同步任务详情
@@ -116,10 +130,10 @@ export default function MomentsSyncDetail() {
编辑
-
+ {/*
立即同步
-
+ */}
@@ -137,7 +151,10 @@ export default function MomentsSyncDetail() {
{task.status === 1 ? "进行中" : "已暂停"}
-
+
@@ -154,7 +171,9 @@ export default function MomentsSyncDetail() {
内容库
- {task.contentLib || '未设置'}
+
+ {task.contentLib || "未设置"}
+
已同步
@@ -180,11 +199,15 @@ export default function MomentsSyncDetail() {
上次同步
- {task.lastSyncTime || '暂无'}
+
+ {task.lastSyncTime || "暂无"}
+
更新时间
- {task.updateTime || '暂无'}
+
+ {task.updateTime || "暂无"}
+
@@ -203,35 +226,51 @@ export default function MomentsSyncDetail() {
同步间隔
{task.syncInterval} 秒
-
- 每日最大
- {task.maxSyncPerDay || 100} 条
-
+
+ 每日最大
+
+ {task.maxSyncPerDay || 100} 条
+
+
时间范围
- {task.timeRange.start} - {task.timeRange.end}
+
+ {task.timeRange?.start && task.timeRange?.end
+ ? `${task.timeRange.start} - ${task.timeRange.end}`
+ : "未设置"}
+
同步模式
- {task.syncMode === 'auto' ? '自动' : '手动'}
+
+ {task.syncMode === "auto" ? "自动" : "手动"}
+
-
- 今日同步
- {task.todaySyncCount || 0} 条
-
-
- 总同步数
- {task.totalSyncCount || task.syncCount || 0} 条
-
+
+ 今日同步
+
+ {task.todaySyncCount || 0} 条
+
+
+
+ 总同步数
+
+ {task.totalSyncCount || task.syncCount || 0} 条
+
+
目标标签
- {task.targetTags.length} 个
+
+ {task.targetTags?.length || 0} 个
+
内容类型
- {task.contentTypes.join(', ')}
+
+ {task.contentTypes?.join(", ") || "未设置"}
+
@@ -242,11 +281,13 @@ export default function MomentsSyncDetail() {
最近同步记录
暂无同步记录
-
任务开始执行后将显示同步记录
+
+ 任务开始执行后将显示同步记录
+
);
-}
\ No newline at end of file
+}
diff --git a/Cunkebao/src/types/moments-sync.ts b/Cunkebao/src/types/moments-sync.ts
index 4b66f7d7f..ebd1d7c5a 100644
--- a/Cunkebao/src/types/moments-sync.ts
+++ b/Cunkebao/src/types/moments-sync.ts
@@ -26,17 +26,17 @@ export interface MomentsSyncTask {
creatorName: string;
syncInterval: number;
maxSyncPerDay: number;
- timeRange: { start: string; end: string };
- contentTypes: ContentType[];
- targetTags: string[];
+ timeRange?: { start: string; end: string };
+ contentTypes?: ContentType[];
+ targetTags?: string[];
syncMode: SyncMode;
- filterKeywords: string[];
+ filterKeywords?: string[];
contentLib?: string;
- devices: string[];
- friends: string[];
- todaySyncCount: number;
- totalSyncCount: number;
- updateTime: string;
+ devices?: string[];
+ friends?: string[];
+ todaySyncCount?: number;
+ totalSyncCount?: number;
+ updateTime?: string;
config?: MomentsSyncConfig;
}
diff --git a/nkebao/src/pages/home/index.module.scss b/nkebao/src/pages/home/index.module.scss
index 1a7b7b1b6..0d92815b1 100644
--- a/nkebao/src/pages/home/index.module.scss
+++ b/nkebao/src/pages/home/index.module.scss
@@ -131,6 +131,14 @@
justify-content: center;
margin: 0 auto 6px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
+ overflow: hidden;
+}
+
+.scene-image {
+ width: 100%;
+ height: 100%;
+ object-fit: cover;
+ border-radius: 8px;
}
.scene-value {
diff --git a/nkebao/src/pages/home/index.tsx b/nkebao/src/pages/home/index.tsx
index b088548a4..ce27e61fb 100644
--- a/nkebao/src/pages/home/index.tsx
+++ b/nkebao/src/pages/home/index.tsx
@@ -16,33 +16,6 @@ import style from "./index.module.scss";
import LineChart from "@/components/LineChart";
import { getPlanStats } from "./api";
-const sceneStats = [
- {
- label: "公众号",
- value: 234,
- icon: ,
- gradient: "linear-gradient(135deg, #4caf50 0%, #45a049 100%)",
- },
- {
- label: "海报",
- value: 167,
- icon: ,
- gradient: "linear-gradient(135deg, #ff9800 0%, #f57c00 100%)",
- },
- {
- label: "抖音",
- value: 156,
- icon: ,
- gradient: "linear-gradient(135deg, #2196f3 0%, #1976d2 100%)",
- },
- {
- label: "小红书",
- value: 89,
- icon: ,
- gradient: "linear-gradient(135deg, #e91e63 0%, #c2185b 100%)",
- },
-];
-
const todayStats = [
{
label: "朋友圈",
@@ -71,9 +44,11 @@ const todayStats = [
];
const Home: React.FC = () => {
+ const [sceneStats, setSceneStats] = useState([]);
useEffect(() => {
getPlanStats({ num: 4 }).then((res: any) => {
- console.log(res);
+ // console.log(res);
+ setSceneStats(res);
});
}, []);
@@ -133,15 +108,16 @@ const Home: React.FC = () => {
{sceneStats.map((item) => (
-
-
- {item.icon}
+
+
+
-
{item.value}
-
{item.label}
+
{item.allNum}
+
{item.name}
))}