diff --git a/Cunkebao/dist/.vite/manifest.json b/Cunkebao/dist/.vite/manifest.json index 5e8f12f1..07c2448c 100644 --- a/Cunkebao/dist/.vite/manifest.json +++ b/Cunkebao/dist/.vite/manifest.json @@ -1,14 +1,18 @@ { - "_charts-CtV6DO5_.js": { - "file": "assets/charts-CtV6DO5_.js", + "_charts-ghR_XExL.js": { + "file": "assets/charts-ghR_XExL.js", "name": "charts", "imports": [ - "_ui-BRTknrR5.js", + "_ui-J9wtlgqT.js", "_vendor-BPPoWDlG.js" ] }, - "_ui-BRTknrR5.js": { - "file": "assets/ui-BRTknrR5.js", + "_ui-D0C0OGrH.css": { + "file": "assets/ui-D0C0OGrH.css", + "src": "_ui-D0C0OGrH.css" + }, + "_ui-J9wtlgqT.js": { + "file": "assets/ui-J9wtlgqT.js", "name": "ui", "imports": [ "_vendor-BPPoWDlG.js" @@ -17,10 +21,6 @@ "assets/ui-D0C0OGrH.css" ] }, - "_ui-D0C0OGrH.css": { - "file": "assets/ui-D0C0OGrH.css", - "src": "_ui-D0C0OGrH.css" - }, "_utils-DiZV3oaL.js": { "file": "assets/utils-DiZV3oaL.js", "name": "utils", @@ -33,18 +33,18 @@ "name": "vendor" }, "index.html": { - "file": "assets/index-DGdErvda.js", + "file": "assets/index-CTEriEiT.js", "name": "index", "src": "index.html", "isEntry": true, "imports": [ "_vendor-BPPoWDlG.js", "_utils-DiZV3oaL.js", - "_ui-BRTknrR5.js", - "_charts-CtV6DO5_.js" + "_ui-J9wtlgqT.js", + "_charts-ghR_XExL.js" ], "css": [ - "assets/index-DoT8YtM8.css" + "assets/index-ZHlr-6NP.css" ] } } \ No newline at end of file diff --git a/Cunkebao/dist/index.html b/Cunkebao/dist/index.html index 7cac6838..cc6295d6 100644 --- a/Cunkebao/dist/index.html +++ b/Cunkebao/dist/index.html @@ -11,13 +11,13 @@ - + - - + + - +
diff --git a/Cunkebao/src/pages/pc/ckbox/weChat/components/ChatWindow/components/MessageRecord/components/SmallProgramMessage/SmallProgramMessage.module.scss b/Cunkebao/src/pages/pc/ckbox/weChat/components/ChatWindow/components/MessageRecord/components/SmallProgramMessage/SmallProgramMessage.module.scss new file mode 100644 index 00000000..40124966 --- /dev/null +++ b/Cunkebao/src/pages/pc/ckbox/weChat/components/ChatWindow/components/MessageRecord/components/SmallProgramMessage/SmallProgramMessage.module.scss @@ -0,0 +1,315 @@ +// 通用消息文本样式 +.messageText { + line-height: 1.4; + white-space: pre-wrap; + word-break: break-word; +} + +// 小程序消息基础样式 +.miniProgramMessage { + background: #ffffff; + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08); + + // 通用小程序卡片基础样式 + .miniProgramCard { + display: flex; + align-items: center; + padding: 12px; + border-bottom: 1px solid #e1e8ed; + background: linear-gradient(135deg, #ffffff 0%, #fafbfc 100%); + cursor: pointer; + transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); + width: 280px; + min-height: 64px; + overflow: hidden; + } + + // 通用小程序元素样式 + .miniProgramThumb { + width: 50px; + height: 50px; + object-fit: cover; + background: linear-gradient(135deg, #f0f2f5 0%, #e6f7ff 100%); + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08); + transition: transform 0.2s ease; + &:hover { + transform: scale(1.05); + } + } + + .miniProgramInfo { + flex: 1; + min-width: 0; + display: flex; + flex-direction: column; + justify-content: center; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + + .miniProgramTitle { + padding-left: 16px; + font-weight: 600; + color: #1a1a1a; + font-size: 14px; + line-height: 1.4; + margin-bottom: 4px; + display: -webkit-box; + -webkit-line-clamp: 1; + -webkit-box-orient: vertical; + overflow: hidden; + text-overflow: ellipsis; + letter-spacing: -0.01em; + } + + .miniProgramApp { + font-size: 12px; + color: #8c8c8c; + line-height: 1.2; + font-weight: 500; + padding: 6px 12px; + } +} + +// 类型1小程序样式(默认横向布局) +.miniProgramType1 { + // 继承基础样式,无需额外定义 +} + +// 类型2小程序样式(垂直图片布局) +.miniProgramType2 { + .miniProgramCardType2 { + flex-direction: column; + align-items: stretch; + padding: 0; + min-height: 220px; + max-width: 280px; + + .miniProgramAppTop { + padding: 12px 16px 8px; + font-size: 13px; + font-weight: 500; + color: #495057; + background: #f8f9fa; + display: flex; + align-items: center; + + &::before { + content: "📱"; + font-size: 12px; + } + } + + .miniProgramImageArea { + width: calc(100% - 32px); + height: 0; + padding-bottom: 75%; // 4:3 宽高比 + margin: 0px 16px; + overflow: hidden; + position: relative; + background: #f8f9fa; + + .miniProgramImage { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + object-fit: cover; + transition: transform 0.3s ease; + border: 0.5px solid #e1e8ed; + &:hover { + transform: scale(1.05); + } + } + } + + .miniProgramContent { + padding: 12px 16px; + display: flex; + flex-direction: column; + gap: 8px; + + .miniProgramTitle { + font-size: 14px; + font-weight: 600; + color: #212529; + line-height: 1.4; + margin: 0; + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; + } + + .miniProgramIdentifier { + font-size: 11px; + color: #6c757d; + border-radius: 8px; + display: inline-flex; + align-items: center; + align-self: flex-start; + gap: 3px; + + &::before { + content: "🏷️"; + font-size: 9px; + } + } + } + } +} + +// 文章类型消息样式 +.articleMessage { + .articleCard { + flex-direction: column; + align-items: stretch; + padding: 16px; + min-height: auto; + max-width: 320px; + } + + .articleTitle { + font-size: 16px; + font-weight: 600; + color: #1a1a1a; + line-height: 1.4; + margin-bottom: 12px; + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; + overflow: hidden; + text-overflow: ellipsis; + } + + .articleContent { + display: flex; + gap: 12px; + align-items: flex-start; + } + + .articleTextArea { + flex: 1; + min-width: 0; + } + + .articleDescription { + font-size: 13px; + color: #666; + line-height: 1.5; + display: -webkit-box; + -webkit-line-clamp: 3; + -webkit-box-orient: vertical; + overflow: hidden; + text-overflow: ellipsis; + } + + .articleImageArea { + flex-shrink: 0; + width: 60px; + height: 60px; + overflow: hidden; + border-radius: 8px; + background: #f8f9fa; + } + + .articleImage { + width: 100%; + height: 100%; + object-fit: cover; + transition: transform 0.3s ease; + } +} + +// 文件消息样式 +.fileMessage { + .fileCard { + display: flex; + align-items: center; + gap: 12px; + padding: 12px; + border: 1px solid #d9d9d9; + border-radius: 8px; + background: #fafafa; + cursor: pointer; + transition: all 0.2s; + max-width: 250px; + + &:hover { + background: #f0f0f0; + border-color: #1890ff; + } + } + + .fileIcon { + font-size: 24px; + color: #1890ff; + flex-shrink: 0; + } + + .fileInfo { + flex: 1; + min-width: 0; + } + + .fileName { + font-weight: 500; + color: #262626; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + margin-bottom: 4px; + } + + .fileAction { + font-size: 12px; + color: #1890ff; + cursor: pointer; + + &:hover { + text-decoration: underline; + } + } +} + +// 响应式设计 +@media (max-width: 768px) { + // 小程序消息移动端适配 + .miniProgramMessage { + .miniProgramCard { + max-width: 260px; + padding: 10px 14px; + min-height: 56px; + border-radius: 10px; + } + + .miniProgramThumb { + width: 36px; + height: 36px; + border-radius: 6px; + + &:hover { + transform: none; + } + } + + .miniProgramTitle { + font-size: 13px; + line-height: 1.3; + font-weight: 500; + } + + .miniProgramApp { + font-size: 11px; + padding: 1px 4px; + + &::before { + width: 12px; + height: 12px; + } + } + } +} \ No newline at end of file diff --git a/Cunkebao/src/pages/pc/ckbox/weChat/components/ChatWindow/components/MessageRecord/components/SmallProgramMessage/index.tsx b/Cunkebao/src/pages/pc/ckbox/weChat/components/ChatWindow/components/MessageRecord/components/SmallProgramMessage/index.tsx new file mode 100644 index 00000000..44787540 --- /dev/null +++ b/Cunkebao/src/pages/pc/ckbox/weChat/components/ChatWindow/components/MessageRecord/components/SmallProgramMessage/index.tsx @@ -0,0 +1,259 @@ +import React from "react"; +import { parseWeappMsgStr } from "@/utils/common"; +import styles from "./SmallProgramMessage.module.scss"; + +interface SmallProgramMessageProps { + content: string; +} + +const SmallProgramMessage: React.FC