fix: 修复消息发送后输入框未清空及自动点赞状态切换问题

修复消息发送后输入框未清空的问题,优化自动点赞任务状态切换逻辑
更新消息处理逻辑,修正构建文件引用路径
This commit is contained in:
超级老白兔
2025-09-03 17:05:53 +08:00
parent 9cdfe552e0
commit 0bddc4dc5b
6 changed files with 23 additions and 18 deletions

View File

@@ -1,14 +1,14 @@
{
"_charts-Cbn6yFil.js": {
"file": "assets/charts-Cbn6yFil.js",
"_charts-BET_YNJb.js": {
"file": "assets/charts-BET_YNJb.js",
"name": "charts",
"imports": [
"_ui-Cytu8vuP.js",
"_ui-BSfOMVFg.js",
"_vendor-2vc8h_ct.js"
]
},
"_ui-Cytu8vuP.js": {
"file": "assets/ui-Cytu8vuP.js",
"_ui-BSfOMVFg.js": {
"file": "assets/ui-BSfOMVFg.js",
"name": "ui",
"imports": [
"_vendor-2vc8h_ct.js"
@@ -33,18 +33,18 @@
"name": "vendor"
},
"index.html": {
"file": "assets/index-QManA_e5.js",
"file": "assets/index-DX2o9_TA.js",
"name": "index",
"src": "index.html",
"isEntry": true,
"imports": [
"_vendor-2vc8h_ct.js",
"_utils-6WF66_dS.js",
"_ui-Cytu8vuP.js",
"_charts-Cbn6yFil.js"
"_ui-BSfOMVFg.js",
"_charts-BET_YNJb.js"
],
"css": [
"assets/index-BkBrwKGe.css"
"assets/index-DwDrBOQB.css"
]
}
}

View File

@@ -11,13 +11,13 @@
</style>
<!-- 引入 uni-app web-view SDK必须 -->
<script type="text/javascript" src="/websdk.js"></script>
<script type="module" crossorigin src="/assets/index-QManA_e5.js"></script>
<script type="module" crossorigin src="/assets/index-DX2o9_TA.js"></script>
<link rel="modulepreload" crossorigin href="/assets/vendor-2vc8h_ct.js">
<link rel="modulepreload" crossorigin href="/assets/utils-6WF66_dS.js">
<link rel="modulepreload" crossorigin href="/assets/ui-Cytu8vuP.js">
<link rel="modulepreload" crossorigin href="/assets/charts-Cbn6yFil.js">
<link rel="modulepreload" crossorigin href="/assets/ui-BSfOMVFg.js">
<link rel="modulepreload" crossorigin href="/assets/charts-BET_YNJb.js">
<link rel="stylesheet" crossorigin href="/assets/ui-D0C0OGrH.css">
<link rel="stylesheet" crossorigin href="/assets/index-BkBrwKGe.css">
<link rel="stylesheet" crossorigin href="/assets/index-DwDrBOQB.css">
</head>
<body>
<div id="root"></div>

View File

@@ -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<any> {
// 切换任务状态
export function toggleAutoLikeTask(data): Promise<any> {
return request("/v1/workbench/update-status", { ...data, type: 1 }, "POST");
return request("/v1/workbench/update-status", { ...data }, "POST");
}
// 复制自动点赞任务

View File

@@ -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",

View File

@@ -41,6 +41,7 @@ const MessageEnter: React.FC<MessageEnterProps> = ({ contract }) => {
content: inputValue,
};
sendCommand("CmdSendMessage", params);
setInputValue("");
// try {
// onSendMessage(inputValue);
// setInputValue("");

View File

@@ -26,17 +26,22 @@ const messageHandlers: Record<string, MessageHandler> = {
// 发送消息响应
CmdSendMessageResp: message => {
console.log("发送消息响应", message);
addMessage(message.friendMessage);
// 在这里添加具体的处理逻辑
},
CmdSendMessageResult: message => {
console.log("发送消息结果", message);
// 在这里添加具体的处理逻辑
},
// 接收消息响应
CmdReceiveMessageResp: message => {
console.log("接收消息响应", message);
addMessage(message.friendMessage);
// 在这里添加具体的处理逻辑
},
//收到消息
CmdNewMessage: (message: Messages) => {
console.log("收到消息", message.friendMessage);
addMessage(message.friendMessage);
// 在这里添加具体的处理逻辑
},