diff --git a/Cunkebao/.gitignore b/Cunkebao/.gitignore
index dcf55aed..a2bf4a07 100644
--- a/Cunkebao/.gitignore
+++ b/Cunkebao/.gitignore
@@ -3,4 +3,5 @@ dist/
build/
yarn.lock
.env
-.DS_Store
\ No newline at end of file
+.DS_Store
+dist/*
diff --git a/Cunkebao/dist/.vite/manifest.json b/Cunkebao/dist/.vite/manifest.json
index 23344959..994665e2 100644
--- a/Cunkebao/dist/.vite/manifest.json
+++ b/Cunkebao/dist/.vite/manifest.json
@@ -1,50 +1,50 @@
{
- "_charts-DsEZaGAW.js": {
- "file": "assets/charts-DsEZaGAW.js",
+ "_charts-B449e2xS.js": {
+ "file": "assets/charts-B449e2xS.js",
"name": "charts",
"imports": [
- "_ui-YC29IQHT.js",
- "_vendor-Bq99rrm8.js"
+ "_ui-DDu9FCjt.js",
+ "_vendor-0WYR1k4q.js"
]
},
"_ui-D0C0OGrH.css": {
"file": "assets/ui-D0C0OGrH.css",
"src": "_ui-D0C0OGrH.css"
},
- "_ui-YC29IQHT.js": {
- "file": "assets/ui-YC29IQHT.js",
+ "_ui-DDu9FCjt.js": {
+ "file": "assets/ui-DDu9FCjt.js",
"name": "ui",
"imports": [
- "_vendor-Bq99rrm8.js"
+ "_vendor-0WYR1k4q.js"
],
"css": [
"assets/ui-D0C0OGrH.css"
]
},
- "_utils-Ft3ushmX.js": {
- "file": "assets/utils-Ft3ushmX.js",
+ "_utils-DC06x9DY.js": {
+ "file": "assets/utils-DC06x9DY.js",
"name": "utils",
"imports": [
- "_vendor-Bq99rrm8.js"
+ "_vendor-0WYR1k4q.js"
]
},
- "_vendor-Bq99rrm8.js": {
- "file": "assets/vendor-Bq99rrm8.js",
+ "_vendor-0WYR1k4q.js": {
+ "file": "assets/vendor-0WYR1k4q.js",
"name": "vendor"
},
"index.html": {
- "file": "assets/index-d8oC2PBC.js",
+ "file": "assets/index-DzNmnMYg.js",
"name": "index",
"src": "index.html",
"isEntry": true,
"imports": [
- "_vendor-Bq99rrm8.js",
- "_ui-YC29IQHT.js",
- "_utils-Ft3ushmX.js",
- "_charts-DsEZaGAW.js"
+ "_vendor-0WYR1k4q.js",
+ "_ui-DDu9FCjt.js",
+ "_utils-DC06x9DY.js",
+ "_charts-B449e2xS.js"
],
"css": [
- "assets/index-D8Ews0CA.css"
+ "assets/index-QrS4Cvyc.css"
]
}
}
\ No newline at end of file
diff --git a/Cunkebao/dist/index.html b/Cunkebao/dist/index.html
index 693dadfc..0eea1718 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 972710b2..d1db021e 100644
--- a/Cunkebao/src/pages/login/Login.tsx
+++ b/Cunkebao/src/pages/login/Login.tsx
@@ -1,5 +1,4 @@
import React, { useState, useEffect } from "react";
-import { useCkChatStore } from "@/store/module/ckchat/ckchat";
import { Form, Input, Button, Toast, Checkbox } from "antd-mobile";
import {
EyeInvisibleOutline,
@@ -7,7 +6,6 @@ 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";
@@ -19,7 +17,6 @@ const Login: React.FC = () => {
const [countdown, setCountdown] = useState(0);
const [showPassword, setShowPassword] = useState(false);
const [agreeToTerms, setAgreeToTerms] = useState(false);
- const { setUserInfo } = useCkChatStore.getState();
const { login, login2 } = useUserStore();
// 倒计时效果
@@ -75,13 +72,9 @@ const Login: React.FC = () => {
: loginWithCode(loginParams);
response.then(res => {
- const { member, kefuData, deviceTotal } = res;
+ const { member, deviceTotal } = res;
// 清空WebSocket连接状态
- useWebSocketStore.getState().clearConnectionState();
login(res.token, member, deviceTotal);
- const { self, token } = kefuData;
- login2(token.access_token);
- setUserInfo(self);
});
};
diff --git a/Cunkebao/src/pages/mobile/mine/main/index.tsx b/Cunkebao/src/pages/mobile/mine/main/index.tsx
index 66450792..d2e56cea 100644
--- a/Cunkebao/src/pages/mobile/mine/main/index.tsx
+++ b/Cunkebao/src/pages/mobile/mine/main/index.tsx
@@ -84,16 +84,6 @@ const Mine: React.FC = () => {
bgColor: "#fff7e6",
iconColor: "#fa8c16",
},
- {
- id: "ckb",
- title: "触客宝",
- description: "触客宝",
- icon: ,
- count: 0,
- path: "/ckbox/weChat",
- bgColor: "#fff7e6",
- iconColor: "#fa8c16",
- },
];
// 加载统计数据
diff --git a/Touchkebao/src/pages/pc/ckbox/weChat/components/SidebarMenu/FriendsCicle/index.module.scss b/Touchkebao/src/pages/pc/ckbox/weChat/components/SidebarMenu/FriendsCicle/index.module.scss
index 876ccf6e..ddb2a15f 100644
--- a/Touchkebao/src/pages/pc/ckbox/weChat/components/SidebarMenu/FriendsCicle/index.module.scss
+++ b/Touchkebao/src/pages/pc/ckbox/weChat/components/SidebarMenu/FriendsCicle/index.module.scss
@@ -218,6 +218,63 @@
}
}
}
+
+ // 点赞和评论交互区域
+ .interactionArea {
+ margin-top: 8px;
+ padding: 8px 12px;
+ background-color: #f7f7f7;
+ border-radius: 4px;
+ font-size: 13px;
+
+ .likeArea {
+ display: flex;
+ align-items: center;
+ margin-bottom: 4px;
+
+ .likeIcon {
+ color: #ff6b6b;
+ margin-right: 6px;
+ font-size: 12px;
+ }
+
+ .likeList {
+ color: #576b95;
+
+ span {
+ cursor: pointer;
+
+ &:hover {
+ text-decoration: underline;
+ }
+ }
+ }
+ }
+
+ .commentArea {
+ .commentItem {
+ margin-bottom: 2px;
+ line-height: 1.4;
+
+ .commentUser {
+ color: #576b95;
+ cursor: pointer;
+
+ &:hover {
+ text-decoration: underline;
+ }
+ }
+
+ .commentSeparator {
+ color: #666;
+ }
+
+ .commentContent {
+ color: #333;
+ }
+ }
+ }
+ }
}
}
diff --git a/Touchkebao/src/pages/pc/ckbox/weChat/components/SidebarMenu/FriendsCicle/index.tsx b/Touchkebao/src/pages/pc/ckbox/weChat/components/SidebarMenu/FriendsCicle/index.tsx
index da7693ad..d8938386 100644
--- a/Touchkebao/src/pages/pc/ckbox/weChat/components/SidebarMenu/FriendsCicle/index.tsx
+++ b/Touchkebao/src/pages/pc/ckbox/weChat/components/SidebarMenu/FriendsCicle/index.tsx
@@ -10,16 +10,47 @@ import {
import { InfiniteScroll } from "antd-mobile";
import styles from "./index.module.scss";
+// 评论数据类型
+interface CommentItem {
+ commentArg: number;
+ commentId1: number;
+ commentId2: number;
+ commentTime: number;
+ content: string;
+ nickName: string;
+ wechatId: string;
+}
+
+// 点赞数据类型
+interface LikeItem {
+ createTime: number;
+ nickName: string;
+ wechatId: string;
+}
+
+// 朋友圈实体数据类型
+interface MomentEntity {
+ content: string;
+ createTime: number;
+ lat: number;
+ lng: number;
+ location: string;
+ objectType: number;
+ picSize: number;
+ resUrls: string[];
+ snsId: string;
+ urls: string[];
+ userName: string;
+}
+
// 朋友圈数据类型定义
interface FriendsCircleItem {
- id: string;
- avatar: string;
- username: string;
- content: string;
- images?: string[];
- time: string;
- likes?: number;
- comments?: number;
+ commentList: CommentItem[];
+ createTime: number;
+ likeList: LikeItem[];
+ momentEntity: MomentEntity;
+ snsId: string;
+ type: number;
}
// API响应类型
@@ -39,60 +70,83 @@ interface PaginationParams {
// 模拟朋友圈数据
const mockFriendsCircleData: FriendsCircleItem[] = [
{
- id: "1",
- avatar: "",
- username: "我的朋友圈",
- content: "",
- time: "",
+ commentList: [
+ {
+ commentArg: 2,
+ commentId1: 0,
+ commentId2: 35,
+ commentTime: 1758011325,
+ content: "测试评论",
+ nickName: "老坑爹- 解放双手,释放时间",
+ wechatId: "wxid_480es52qsj2812",
+ },
+ ],
+ createTime: 1757258659,
+ likeList: [
+ {
+ createTime: 1757315556,
+ nickName: "老坑爹- 解放双手,释放时间",
+ wechatId: "wxid_480es52qsj2812",
+ },
+ ],
+ momentEntity: {
+ content: "没看到血月[旺柴]",
+ createTime: 1757258659,
+ lat: 0,
+ lng: 0,
+ location: "",
+ objectType: 1,
+ picSize: 0,
+ resUrls: [
+ "https://ac-weremote-s2.oss-cn-shenzhen.aliyuncs.com/weremote/chat-logs/5E2C38F5A275450D935F3ECEC076124E/aa6d4c2f7b1fe24d04d34f4f409883e6/sns/wxid_480es52qsj2812/-3705790026851937712/-3705790026851937712-14740954047910318662.jpg",
+ ],
+ snsId: "-3705790026851937712",
+ urls: ["/sns/3/3/snst_14740954047910318662"],
+ userName: "wxid_dlhi90odctcl22",
+ },
+ snsId: "-3705790026851937712",
+ type: 1,
},
{
- id: "2",
- avatar: "",
- username: "朋友圈广场",
- content: "",
- time: "",
+ commentList: [],
+ createTime: 1757258600,
+ likeList: [],
+ momentEntity: {
+ content:
+ "🎉🎊🎈欢迎小伙伴加入单群聊客宝地盘思慕斯蛋糕的小伙伴们的支持与信任!!!",
+ createTime: 1757258600,
+ lat: 0,
+ lng: 0,
+ location: "",
+ objectType: 1,
+ picSize: 0,
+ resUrls: ["/public/assets/face/1.png"],
+ snsId: "-3705790026851937713",
+ urls: ["/sns/3/3/snst_14740954047910318663"],
+ userName: "wxid_dlhi90odctcl23",
+ },
+ snsId: "-3705790026851937713",
+ type: 1,
},
{
- id: "3",
- avatar: "/public/assets/face/1.png",
- username: "老坑爹-解放双手,释放时间",
- content:
- "🎉🎊🎈欢迎小伙伴加入单群聊客宝地盘思慕斯蛋糕的小伙伴们的支持与信任!!!",
- images: ["/public/assets/face/1.png"],
- time: "2025年9月16日 13:48",
- likes: 0,
- comments: 0,
- },
- {
- id: "4",
- avatar: "/public/assets/face/1.png",
- username: "老坑爹-解放双手,释放时间",
- content: "一整年卡1好的产品有用户的好评是买卖说的再多不如用户的有说服力",
- images: ["/public/assets/face/1.png"],
- time: "2025年9月16日 11:33",
- likes: 0,
- comments: 0,
- },
- {
- id: "5",
- avatar: "/public/assets/face/1.png",
- username: "老坑爹-解放双手,释放时间",
- content:
- "两个小时637朵卡今天的努力也是给我自己最好的礼物🎁坚持就是胜利第二年开干。",
- images: ["/public/assets/face/1.png"],
- time: "2025年9月16日 11:03",
- likes: 0,
- comments: 0,
- },
- {
- id: "6",
- avatar: "/public/assets/face/1.png",
- username: "老坑爹-解放双手,释放时间",
- content: "老坑爹如果不幸苦,没有品质保障,客户会无限复购?",
- images: ["/public/assets/face/1.png"],
- time: "2025年9月16日 10:33",
- likes: 0,
- comments: 0,
+ commentList: [],
+ createTime: 1757258500,
+ likeList: [],
+ momentEntity: {
+ content: "一整年卡1好的产品有用户的好评是买卖说的再多不如用户的有说服力",
+ createTime: 1757258500,
+ lat: 0,
+ lng: 0,
+ location: "",
+ objectType: 1,
+ picSize: 0,
+ resUrls: ["/public/assets/face/1.png"],
+ snsId: "-3705790026851937714",
+ urls: ["/sns/3/3/snst_14740954047910318664"],
+ userName: "wxid_dlhi90odctcl24",
+ },
+ snsId: "-3705790026851937714",
+ type: 1,
},
];
@@ -118,9 +172,9 @@ const FriendsCircle: React.FC = () => {
const { pageNum, pageSize, type } = params;
const startIndex = (pageNum - 1) * pageSize;
- // 使用原有的模拟数据
- const allData = mockFriendsCircleData.slice(2); // 排除前两个特殊项
- const typeData = type === "my" ? allData.slice(0, 2) : allData.slice(2);
+ // 使用模拟数据
+ const allData = mockFriendsCircleData;
+ const typeData = type === "my" ? allData.slice(0, 1) : allData;
const paginatedData = typeData.slice(startIndex, startIndex + pageSize);
return {
@@ -222,26 +276,57 @@ const FriendsCircle: React.FC = () => {
console.log("评论:", id);
};
+ // 格式化时间戳
+ const formatTime = (timestamp: number) => {
+ const date = new Date(timestamp * 1000);
+ return date.toLocaleString("zh-CN", {
+ year: "numeric",
+ month: "2-digit",
+ day: "2-digit",
+ hour: "2-digit",
+ minute: "2-digit",
+ });
+ };
+
+ // 获取用户昵称
+ const getUserNickName = (item: FriendsCircleItem) => {
+ // 优先从点赞列表或评论列表中获取昵称
+ if (item.likeList.length > 0) {
+ return item.likeList[0].nickName;
+ }
+ if (item.commentList.length > 0) {
+ return item.commentList[0].nickName;
+ }
+ return item.momentEntity.userName;
+ };
+
const renderNormalItem = (item: FriendsCircleItem, isNotMy?: boolean) => {
+ const nickName = getUserNickName(item);
+ const content = item.momentEntity.content;
+ const images = item.momentEntity.resUrls;
+ const time = formatTime(item.createTime);
+ const likesCount = item.likeList.length;
+ const commentsCount = item.commentList.length;
+
return (
{isNotMy && (
)}
-
{item.username}
+
{nickName}
-
{item.content}
- {item.images && item.images.length > 0 && (
+
{content}
+ {images && images.length > 0 && (
- {item.images.map((image, index) => (
+ {images.map((image, index) => (

{
)}
-
查看图片
+ {images && images.length > 0 && (
+
查看图片
+ )}
-
{item.time}
+
{time}
}
- onClick={() => handleLike(item.id)}
+ onClick={() => handleLike(item.snsId)}
className={styles.actionButton}
- />
+ >
+ {likesCount > 0 && {likesCount}}
+
}
- onClick={() => handleComment(item.id)}
+ onClick={() => handleComment(item.snsId)}
className={styles.actionButton}
- />
+ >
+ {commentsCount > 0 && {commentsCount}}
+
+
+ {/* 点赞和评论区域 */}
+ {(item.likeList.length > 0 || item.commentList.length > 0) && (
+
+ {/* 点赞列表 */}
+ {item.likeList.length > 0 && (
+
+
+
+ {item.likeList.map((like, index) => (
+
+ {like.nickName}
+ {index < item.likeList.length - 1 && "、"}
+
+ ))}
+
+
+ )}
+
+ {/* 评论列表 */}
+ {item.commentList.length > 0 && (
+
+ {item.commentList.map(comment => (
+
+
+ {comment.nickName}
+
+ :
+
+ {comment.content}
+
+
+ ))}
+
+ )}
+
+ )}
);
@@ -284,7 +415,7 @@ const FriendsCircle: React.FC = () => {
{myCircleData.length > 0 ? (
<>
{myCircleData.map(item => (
-
+
{renderNormalItem(item, false)}
))}
@@ -317,7 +448,7 @@ const FriendsCircle: React.FC = () => {
{squareData.length > 0 ? (
<>
{squareData.map(item => (
-
+
{renderNormalItem(item, true)}
))}