diff --git a/Cunkebao/dist/.vite/manifest.json b/Cunkebao/dist/.vite/manifest.json index aa2b3d0b..90e573c1 100644 --- a/Cunkebao/dist/.vite/manifest.json +++ b/Cunkebao/dist/.vite/manifest.json @@ -1,18 +1,14 @@ { - "_charts-DKSCc2_C.js": { - "file": "assets/charts-DKSCc2_C.js", + "_charts-BET_YNJb.js": { + "file": "assets/charts-BET_YNJb.js", "name": "charts", "imports": [ - "_ui-DhAz00L0.js", + "_ui-BSfOMVFg.js", "_vendor-2vc8h_ct.js" ] }, - "_ui-D0C0OGrH.css": { - "file": "assets/ui-D0C0OGrH.css", - "src": "_ui-D0C0OGrH.css" - }, - "_ui-DhAz00L0.js": { - "file": "assets/ui-DhAz00L0.js", + "_ui-BSfOMVFg.js": { + "file": "assets/ui-BSfOMVFg.js", "name": "ui", "imports": [ "_vendor-2vc8h_ct.js" @@ -21,6 +17,10 @@ "assets/ui-D0C0OGrH.css" ] }, + "_ui-D0C0OGrH.css": { + "file": "assets/ui-D0C0OGrH.css", + "src": "_ui-D0C0OGrH.css" + }, "_utils-6WF66_dS.js": { "file": "assets/utils-6WF66_dS.js", "name": "utils", @@ -33,18 +33,18 @@ "name": "vendor" }, "index.html": { - "file": "assets/index-BdCPAYQ7.js", + "file": "assets/index-DX2o9_TA.js", "name": "index", "src": "index.html", "isEntry": true, "imports": [ "_vendor-2vc8h_ct.js", "_utils-6WF66_dS.js", - "_ui-DhAz00L0.js", - "_charts-DKSCc2_C.js" + "_ui-BSfOMVFg.js", + "_charts-BET_YNJb.js" ], "css": [ - "assets/index-ChiFk16x.css" + "assets/index-DwDrBOQB.css" ] } } \ No newline at end of file diff --git a/Cunkebao/dist/index.html b/Cunkebao/dist/index.html index 0b6673bb..d9e4faec 100644 --- a/Cunkebao/dist/index.html +++ b/Cunkebao/dist/index.html @@ -11,13 +11,13 @@ - + - - + + - +
diff --git a/Cunkebao/src/pages/login/Login.tsx b/Cunkebao/src/pages/login/Login.tsx index d375422a..972710b2 100644 --- a/Cunkebao/src/pages/login/Login.tsx +++ b/Cunkebao/src/pages/login/Login.tsx @@ -7,6 +7,7 @@ import { UserOutline, } from "antd-mobile-icons"; import { useUserStore } from "@/store/module/user"; +import { useWebSocketStore } from "@/store/module/websocket/websocket"; import { loginWithPassword, loginWithCode, sendVerificationCode } from "./api"; import style from "./login.module.scss"; @@ -75,6 +76,8 @@ const Login: React.FC = () => { response.then(res => { const { member, kefuData, deviceTotal } = res; + // 清空WebSocket连接状态 + useWebSocketStore.getState().clearConnectionState(); login(res.token, member, deviceTotal); const { self, token } = kefuData; login2(token.access_token); diff --git a/Cunkebao/src/pages/mobile/workspace/auto-like/list/api.ts b/Cunkebao/src/pages/mobile/workspace/auto-like/list/api.ts index 615cb7ff..ddc48d91 100644 --- a/Cunkebao/src/pages/mobile/workspace/auto-like/list/api.ts +++ b/Cunkebao/src/pages/mobile/workspace/auto-like/list/api.ts @@ -5,7 +5,7 @@ import { UpdateLikeTaskData, LikeRecord, PaginatedResponse, -} from "@/pages/workspace/auto-like/record/data"; +} from "@/pages/mobile/workspace/auto-like/record/data"; // 获取自动点赞任务列表 export function fetchAutoLikeTasks( @@ -36,7 +36,7 @@ export function deleteAutoLikeTask(id: string): Promise { // 切换任务状态 export function toggleAutoLikeTask(data): Promise { - return request("/v1/workbench/update-status", { ...data, type: 1 }, "POST"); + return request("/v1/workbench/update-status", { ...data }, "POST"); } // 复制自动点赞任务 diff --git a/Cunkebao/src/pages/mobile/workspace/auto-like/list/index.tsx b/Cunkebao/src/pages/mobile/workspace/auto-like/list/index.tsx index 073603ee..a967f725 100644 --- a/Cunkebao/src/pages/mobile/workspace/auto-like/list/index.tsx +++ b/Cunkebao/src/pages/mobile/workspace/auto-like/list/index.tsx @@ -201,8 +201,7 @@ const AutoLike: React.FC = () => { // 切换任务状态 const toggleTaskStatus = async (id: string, status: number) => { try { - const newStatus = status === 1 ? "2" : "1"; - await toggleAutoLikeTask(id, newStatus); + await toggleAutoLikeTask({ id }); Toast.show({ content: status === 1 ? "已暂停" : "已启动", position: "top", diff --git a/Cunkebao/src/pages/pc/ckbox/api.ts b/Cunkebao/src/pages/pc/ckbox/api.ts index 1d27fdb0..daa8a79a 100644 --- a/Cunkebao/src/pages/pc/ckbox/api.ts +++ b/Cunkebao/src/pages/pc/ckbox/api.ts @@ -22,8 +22,13 @@ export function WechatGroup(params) { export function clearUnreadCount(params) { return request("/api/WechatFriend/clearUnreadCount", params, "PUT"); } + +//更新配置 +export function updateConfig(params) { + return request("/api/WechatFriend/updateConfig", params, "PUT"); +} //获取聊天记录-2 获取列表 -export function getMessages(params: { +export function getChatMessages(params: { wechatAccountId: number; wechatFriendId?: number; wechatChatroomId?: number; @@ -73,19 +78,6 @@ export const getControlTerminalList = params => { return request("/api/wechataccount", params, "GET"); }; -// 搜索联系人 -export const getChatMessage = (params: { - wechatAccountId: number; - wechatFriendId: number; - From: number; - To: number; - Count: number; - olderData: boolean; - keyword: string; -}) => { - return request("/api/FriendMessage/SearchMessage", params, "GET"); -}; - // 获取聊天历史 export const getChatHistory = ( chatId: string, diff --git a/Cunkebao/src/pages/pc/ckbox/components/ChatWindow/ChatWindow.module.scss b/Cunkebao/src/pages/pc/ckbox/components/ChatWindow/ChatWindow.module.scss index c2515179..917988e3 100644 --- a/Cunkebao/src/pages/pc/ckbox/components/ChatWindow/ChatWindow.module.scss +++ b/Cunkebao/src/pages/pc/ckbox/components/ChatWindow/ChatWindow.module.scss @@ -128,128 +128,6 @@ } } -.chatFooter { - background: #fff; - border-top: 1px solid #f0f0f0; - padding: 0; - height: auto; - min-height: auto; - flex-shrink: 0; - - .inputContainer { - .inputToolbar { - display: flex; - border-bottom: 1px solid #f0f0f0; - background: #fafafa; - justify-content: space-between; - - .leftTool { - display: flex; - gap: 4px; - } - - .rightTool { - display: flex; - gap: 8px; - padding: 8px; - } - - .toolbarButton { - color: #666; - border: none; - padding: 8px; - border-radius: 4px; - font-size: 18px; - width: 36px; - height: 36px; - display: flex; - align-items: center; - justify-content: center; - background: transparent; - transition: all 0.2s; - - &:hover { - color: #1890ff; - background: #e6f7ff; - } - - &:active { - background: #bae7ff; - } - } - } - - .inputArea { - display: flex; - padding: 12px 16px; - gap: 8px; - align-items: flex-end; - background: #fff; - - .messageInput { - flex: 1; - border: 1px solid #d9d9d9; - border-radius: 4px; - resize: none; - padding: 8px 12px; - font-size: 14px; - line-height: 1.5; - min-height: 36px; - max-height: 120px; - background: #fff; - transition: all 0.2s; - - &:focus { - border-color: #1890ff; - box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2); - outline: none; - } - - &::placeholder { - color: #bfbfbf; - } - } - - .sendButton { - border-radius: 4px; - height: 36px; - padding: 0 16px; - font-size: 14px; - font-weight: 500; - background: #1890ff; - border: 1px solid #1890ff; - color: #fff; - transition: all 0.2s; - - &:hover { - background: #40a9ff; - border-color: #40a9ff; - } - - &:active { - background: #096dd9; - border-color: #096dd9; - } - - &:disabled { - background: #f5f5f5; - border-color: #d9d9d9; - color: #bfbfbf; - cursor: not-allowed; - } - } - } - - .inputHint { - padding: 4px 16px 8px; - font-size: 12px; - color: #8c8c8c; - background: #fff; - border-top: 1px solid #f0f0f0; - } - } -} - // 右侧个人资料卡片 .profileSider { background: #fff; @@ -748,19 +626,6 @@ } } - .chatFooter { - padding: 12px; - - .inputContainer { - .inputArea { - .sendButton { - height: 28px; - padding: 0 12px; - } - } - } - } - .messageItem { .messageContent { max-width: 85%; diff --git a/Cunkebao/src/pages/pc/ckbox/components/ChatWindow/components/MessageEnter/MessageEnter.module.scss b/Cunkebao/src/pages/pc/ckbox/components/ChatWindow/components/MessageEnter/MessageEnter.module.scss new file mode 100644 index 00000000..36977bd1 --- /dev/null +++ b/Cunkebao/src/pages/pc/ckbox/components/ChatWindow/components/MessageEnter/MessageEnter.module.scss @@ -0,0 +1,181 @@ +// MessageEnter 组件样式 - 微信风格 +.chatFooter { + background: #f7f7f7; + border-top: 1px solid #e1e1e1; + padding: 0; + height: auto; + min-height: 100px; +} + +.inputContainer { + padding: 8px 12px; + display: flex; + flex-direction: column; + gap: 6px; +} + +.inputToolbar { + display: flex; + justify-content: space-between; + align-items: center; + padding: 4px 0; + border-bottom: none; +} + +.leftTool { + display: flex; + gap: 2px; + align-items: center; +} + +.toolbarButton { + width: 28px; + height: 28px; + display: flex; + align-items: center; + justify-content: center; + border-radius: 4px; + color: #666; + font-size: 16px; + transition: all 0.15s; + border: none; + background: transparent; + + &:hover { + background: #e6e6e6; + color: #333; + } + + &:active { + background: #d9d9d9; + } +} + +.rightTool { + display: flex; + gap: 12px; + align-items: center; +} + +.rightToolItem { + display: flex; + align-items: center; + gap: 3px; + color: #666; + font-size: 11px; + cursor: pointer; + padding: 3px 6px; + border-radius: 3px; + transition: all 0.15s; + + &:hover { + background: #e6e6e6; + color: #333; + } +} + +.inputArea { + display: flex; + flex-direction: column; + padding: 4px 0; +} + +.inputWrapper { + border: 1px solid #d1d1d1; + border-radius: 4px; + background: #fff; + overflow: hidden; + + &:focus-within { + border-color: #07c160; + } +} + +.messageInput { + width: 100%; + border: none; + resize: none; + font-size: 13px; + line-height: 1.4; + padding: 8px 10px; + background: transparent; + + &:focus { + box-shadow: none; + outline: none; + } + + &::placeholder { + color: #b3b3b3; + } +} + +.sendButtonArea { + padding: 8px 10px; + display: flex; + justify-content: flex-end; +} + +.sendButton { + height: 32px; + border-radius: 4px; + font-weight: normal; + min-width: 60px; + font-size: 13px; + background: #07c160; + border-color: #07c160; + + &:hover { + background: #06ad56; + border-color: #06ad56; + } + + &:active { + background: #059748; + border-color: #059748; + } + + &:disabled { + background: #b3b3b3; + border-color: #b3b3b3; + opacity: 1; + } +} + +.inputHint { + font-size: 11px; + color: #999; + text-align: right; + margin-top: 2px; +} + +// 响应式设计 +@media (max-width: 768px) { + .inputContainer { + padding: 8px 12px; + } + + .inputToolbar { + flex-wrap: wrap; + gap: 8px; + } + + .rightTool { + gap: 8px; + } + + .rightToolItem { + font-size: 11px; + padding: 2px 6px; + } + + .inputArea { + flex-direction: column; + gap: 8px; + } + + .sendButton { + align-self: flex-end; + min-width: 60px; + } +} diff --git a/Cunkebao/src/pages/pc/ckbox/components/ChatWindow/components/MessageEnter/index.tsx b/Cunkebao/src/pages/pc/ckbox/components/ChatWindow/components/MessageEnter/index.tsx index e69de29b..e226b02a 100644 --- a/Cunkebao/src/pages/pc/ckbox/components/ChatWindow/components/MessageEnter/index.tsx +++ b/Cunkebao/src/pages/pc/ckbox/components/ChatWindow/components/MessageEnter/index.tsx @@ -0,0 +1,301 @@ +import React, { useState } from "react"; +import { Layout, Input, Button, Dropdown, Menu, Tooltip, Modal } from "antd"; +import { + ShareAltOutlined, + SendOutlined, + SmileOutlined, + FolderOutlined, + AudioOutlined, + AudioOutlined as AudioHoldOutlined, + CodeSandboxOutlined, + MessageOutlined, + EnvironmentOutlined, + StarOutlined, +} from "@ant-design/icons"; +import { ContractData, weChatGroup } from "@/pages/pc/ckbox/data"; +import { useWebSocketStore } from "@/store/module/websocket/websocket"; +import styles from "./MessageEnter.module.scss"; + +const { Footer } = Layout; +const { TextArea } = Input; + +interface MessageEnterProps { + contract: ContractData | weChatGroup; +} + +const { sendCommand } = useWebSocketStore.getState(); + +const MessageEnter: React.FC = ({ contract }) => { + const [inputValue, setInputValue] = useState(""); + const [showMaterialModal, setShowMaterialModal] = useState(false); + + const handleSend = async () => { + if (!inputValue.trim()) return; + console.log("发送消息", contract); + const params = { + wechatAccountId: contract.wechatAccountId, + wechatChatroomId: contract?.chatroomId ? contract.id : 0, + wechatFriendId: contract?.chatroomId ? 0 : contract.id, + msgSubType: 0, + msgType: 1, + content: inputValue, + }; + sendCommand("CmdSendMessage", params); + setInputValue(""); + }; + + const handleKeyPress = (e: React.KeyboardEvent) => { + if (e.key === "Enter" && !e.shiftKey && !e.ctrlKey) { + e.preventDefault(); + handleSend(); + } + // Ctrl+Enter 换行由 TextArea 自动处理,不需要阻止默认行为 + }; + + // 素材菜单项 + const materialMenuItems = [ + { + key: "text", + label: "文字素材", + icon: 📝, + }, + { + key: "audio", + label: "语音素材", + icon: 🎵, + }, + { + key: "image", + label: "图片素材", + icon: 🖼️, + }, + { + key: "video", + label: "视频素材", + icon: 🎬, + }, + { + key: "link", + label: "链接素材", + icon: 🔗, + }, + { + key: "card", + label: "名片素材", + icon: 📇, + }, + ]; + + const handleMaterialSelect = (key: string) => { + console.log("选择素材类型:", key); + setShowMaterialModal(true); + // 这里可以根据不同的素材类型显示不同的模态框 + }; + + return ( + <> + {/* 聊天输入 */} +