From bd833828be903b047de946fad4f67e6d4f38816b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=AC=94=E8=AE=B0=E6=9C=AC=E9=87=8C=E7=9A=84=E6=B0=B8?= =?UTF-8?q?=E5=B9=B3?= Date: Wed, 23 Jul 2025 18:33:53 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9C=AC=E6=AC=A1=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=86=85=E5=AE=B9=E5=A6=82=E4=B8=8B=20?= =?UTF-8?q?=E5=9C=BA=E6=99=AF=E8=AE=A1=E5=88=92-=E6=B6=88=E6=81=AF?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE-=E5=8D=A1=E7=89=87=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E5=A4=84=E7=90=86=E4=B8=80=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plan/new/steps/FriendRequestSettings.tsx | 288 ++++++++---------- .../plan/new/steps/MessageSettings.tsx | 75 +++-- .../plan/new/steps/friend.module.scss | 48 +++ .../plan/new/steps/messages.module.scss | 60 ++++ 4 files changed, 276 insertions(+), 195 deletions(-) create mode 100644 nkebao/src/pages/scenarios/plan/new/steps/friend.module.scss create mode 100644 nkebao/src/pages/scenarios/plan/new/steps/messages.module.scss diff --git a/nkebao/src/pages/scenarios/plan/new/steps/FriendRequestSettings.tsx b/nkebao/src/pages/scenarios/plan/new/steps/FriendRequestSettings.tsx index 16e458d2e..1c7b11e8a 100644 --- a/nkebao/src/pages/scenarios/plan/new/steps/FriendRequestSettings.tsx +++ b/nkebao/src/pages/scenarios/plan/new/steps/FriendRequestSettings.tsx @@ -1,19 +1,10 @@ "use client"; import React, { useState, useEffect } from "react"; -import { - Form, - Input, - Button, - Checkbox, - Modal, - Alert, - Select, - message, -} from "antd"; -import { QuestionCircleOutlined, MessageOutlined } from "@ant-design/icons"; +import { Input, Button, Modal, Alert, Select } from "antd"; +import { MessageOutlined } from "@ant-design/icons"; import DeviceSelection from "@/components/DeviceSelection"; -import Layout from "@/components/Layout/Layout"; +import styles from "./friend.module.scss"; interface FriendRequestSettingsProps { formData: any; @@ -46,8 +37,8 @@ const FriendRequestSettings: React.FC = ({ }) => { const [isTemplateDialogOpen, setIsTemplateDialogOpen] = useState(false); const [hasWarnings, setHasWarnings] = useState(false); - const [selectedDevices, setSelectedDevices] = useState( - formData.selectedDevices || [] + const [selectedDevices, setSelectedDevices] = useState( + formData.device || [] ); const [showRemarkTip, setShowRemarkTip] = useState(false); @@ -97,171 +88,156 @@ const FriendRequestSettings: React.FC = ({ }; return ( - <> - -
- - -
- - } - > -
-
- 选择设备 -
- d.id)} - onSelect={(deviceIds) => { - const newSelectedDevices = deviceIds.map((id) => ({ - id, - name: `设备 ${id}`, - status: "online", - })); - setSelectedDevices(newSelectedDevices); - onChange({ ...formData, device: deviceIds }); - }} - placeholder="选择设备" - /> -
-
+
+ {/* 选择设备区块 */} +
选择设备
+
+ { + setSelectedDevices(deviceIds); + onChange({ ...formData, device: deviceIds }); + }} + placeholder="选择设备" + /> +
-
-
- 好友备注 - setShowRemarkTip(true)} - onMouseLeave={() => setShowRemarkTip(false)} - onClick={() => setShowRemarkTip((v) => !v)} - > - ? - - {showRemarkTip && ( -
-
设置添加好友时的备注格式
-
- 备注格式预览: -
-
- {formData.remarkType === "phone" && - `138****1234+${getScenarioTitle()}`} - {formData.remarkType === "nickname" && - `小红书用户2851+${getScenarioTitle()}`} - {formData.remarkType === "source" && - `抖音直播+${getScenarioTitle()}`} -
-
- )} + {/* 好友备注区块 */} +
好友备注
+
+ + setShowRemarkTip(true)} + onMouseLeave={() => setShowRemarkTip(false)} + > + ? + + {showRemarkTip && ( +
+
设置添加好友时的备注格式
+
+ 备注格式预览:
- onChange({ ...formData, greeting: e.target.value })} + placeholder="请输入招呼语" + suffix={ +
+ 参考模板 + + } + /> +
-
-
- 招呼语 - -
- - onChange({ ...formData, greeting: e.target.value }) - } - placeholder="请输入招呼语" - className="mt-2" - /> -
+ {/* 添加间隔区块 */} +
添加间隔
+
+ + onChange({ + ...formData, + addFriendInterval: Number(e.target.value), + }) + } + style={{ width: 100 }} + /> + 分钟 +
-
- 添加间隔 -
- - onChange({ - ...formData, - addFriendInterval: Number(e.target.value), - }) - } - /> -
分钟
-
-
+ {/* 允许加人时间段区块 */} +
允许加人的时间段
+
+ + onChange({ ...formData, addFriendTimeStart: e.target.value }) + } + style={{ width: 120 }} + /> + + + onChange({ ...formData, addFriendTimeEnd: e.target.value }) + } + style={{ width: 120 }} + /> +
-
- 允许加人的时间段 -
- - onChange({ ...formData, addFriendTimeStart: e.target.value }) - } - className="w-32" - /> - - - onChange({ ...formData, addFriendTimeEnd: e.target.value }) - } - className="w-32" - /> -
-
+ {hasWarnings && ( + + )} - {hasWarnings && ( - - )} -
- + {/* 底部按钮 */} +
+ + +
+ {/* 招呼语模板弹窗 */} setIsTemplateDialogOpen(false)} footer={null} > -
+
{greetingTemplates.map((template, index) => ( ))}
- +
); }; diff --git a/nkebao/src/pages/scenarios/plan/new/steps/MessageSettings.tsx b/nkebao/src/pages/scenarios/plan/new/steps/MessageSettings.tsx index a3a34c24b..9d2c795a0 100644 --- a/nkebao/src/pages/scenarios/plan/new/steps/MessageSettings.tsx +++ b/nkebao/src/pages/scenarios/plan/new/steps/MessageSettings.tsx @@ -1,5 +1,5 @@ import React, { useState } from "react"; -import { Form, Input, Button, Tabs, Modal, Alert, Upload, message } from "antd"; +import { Input, Button, Tabs, Modal, Alert, message } from "antd"; import { PlusOutlined, CloseOutlined, @@ -13,7 +13,7 @@ import { LinkOutlined, TeamOutlined, } from "@ant-design/icons"; -import Layout from "@/components/Layout/Layout"; +import styles from "./messages.module.scss"; interface MessageContent { id: string; @@ -194,9 +194,9 @@ const MessageSettings: React.FC = ({ key: plan.day.toString(), label: plan.day === 0 ? "即时消息" : `第${plan.day}天`, children: ( -
+
{plan.messages.map((message, messageIndex) => ( -
+
{plan.day === 0 ? ( @@ -524,7 +524,10 @@ const MessageSettings: React.FC = ({
))} - @@ -533,31 +536,24 @@ const MessageSettings: React.FC = ({ })); return ( - <> - -
- - -
-
- } - > -
-
-

消息设置

- -
- - -
- - +
+
+

消息设置

+ +
+ +
+ + +
{/* 添加天数计划弹窗 */} = ({ }} >

选择要添加的消息计划类型

-
- {/* 选择群聊弹窗 */} = ({ setIsGroupSelectOpen(false); }} > -
+
{mockGroups.map((group) => (
handleSelectGroup(group.id)} >
{group.name}
@@ -603,7 +600,7 @@ const MessageSettings: React.FC = ({ ))}
- +
); }; diff --git a/nkebao/src/pages/scenarios/plan/new/steps/friend.module.scss b/nkebao/src/pages/scenarios/plan/new/steps/friend.module.scss new file mode 100644 index 000000000..0c0f11386 --- /dev/null +++ b/nkebao/src/pages/scenarios/plan/new/steps/friend.module.scss @@ -0,0 +1,48 @@ +.friend-container { + padding: 12px; +} +.friend-label { + margin-bottom: 12px; + font-weight: 500; +} +.friend-block { + margin-bottom: 16px; +} +.friend-remark-tip { + position: absolute; + right: 0; + top: 36px; + z-index: 10; + background: #fff; + border: 1px solid #eee; + border-radius: 6px; + padding: 12px; + width: 220px; + box-shadow: 0 2px 8px rgba(0,0,0,0.08); +} +.friend-remark-q { + position: absolute; + right: 8px; + top: 8px; + cursor: pointer; + color: #888; +} +.friend-interval-row { + display: flex; + align-items: center; + gap: 8px; +} +.friend-time-row { + display: flex; + align-items: center; + gap: 8px; +} +.friend-footer { + display: flex; + justify-content: space-between; + margin-top: 32px; +} +.friend-modal-btn { + width: 100%; + margin-bottom: 8px; +} diff --git a/nkebao/src/pages/scenarios/plan/new/steps/messages.module.scss b/nkebao/src/pages/scenarios/plan/new/steps/messages.module.scss new file mode 100644 index 000000000..37ff9a1db --- /dev/null +++ b/nkebao/src/pages/scenarios/plan/new/steps/messages.module.scss @@ -0,0 +1,60 @@ +.messages-container { + padding: 16px; +} +.messages-header { + display: flex; + align-items: center; + justify-content: space-between; + margin-bottom: 16px; +} +.messages-title { + font-size: 18px; + font-weight: 600; +} +.messages-tab { + margin-bottom: 16px; +} +.messages-day-panel { + background: #fafbfc; + border-radius: 10px; + padding: 16px; + margin-bottom: 16px; +} +.messages-message-card { + background: #fff; + border-radius: 8px; + box-shadow: 0 2px 8px rgba(0,0,0,0.03); + padding: 16px; + margin-bottom: 16px; +} +.messages-message-type-btns { + display: flex; + gap: 8px; + margin-bottom: 8px; +} +.messages-add-message-btn { + width: 100%; + margin-top: 8px; +} +.messages-footer { + display: flex; + justify-content: space-between; + margin-top: 32px; +} +.messages-modal-btn { + width: 100%; + margin-bottom: 8px; +} +.messages-group-select-item { + padding: 16px; + border-radius: 8px; + cursor: pointer; + background: #fff; + margin-bottom: 8px; + border: 1px solid #eee; + transition: border 0.2s, background 0.2s; +} +.messages-group-select-item.selected { + background: #e6f7ff; + border: 1.5px solid #1677ff; +}