You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

838 lines
23 KiB

5 months ago
5 months ago
1 week ago
2 months ago
2 months ago
1 week ago
2 months ago
5 months ago
1 month ago
2 months ago
2 months ago
2 months ago
2 months ago
1 week ago
  1. <script setup>
  2. import {computed, onMounted, ref} from 'vue'
  3. import {useRoute, useRouter} from 'vue-router'
  4. import {ElMessage} from 'element-plus'
  5. import ChangePassword from '@/components/dialogs/changePassword.vue'
  6. import LanguageSwitch from '@/components/dialogs/LanguageSwitch.vue' // 语言切换
  7. import {useAdminStore} from '@/store'
  8. import {storeToRefs} from 'pinia'
  9. import {filterMenu, getRoutePath} from "@/utils/menuUtils.js";
  10. import API from '@/util/http.js'
  11. import bell from '@/assets/SvgIcons/bell.svg'
  12. import noMessage from '@/assets/images/no-message.svg'
  13. import goTop from '@/assets/SvgIcons/go-top.svg'
  14. import {getOrderPage} from '@/utils/goToCheck.js'
  15. import {groupMessages} from "@/utils/getMessage.js"
  16. import {findMenuById,permissionMapping} from "@/utils/menuTreePermission.js"
  17. import {useMessageStore} from '@/store/index.js'
  18. // ------------------ ICONS ------------------
  19. const icons = import.meta.glob('@/assets/SvgIcons/*.svg', {eager: true})
  20. const menuNameMap = {
  21. '2': 'workbench', // 工作台
  22. '3': 'gold-management', //金币管理
  23. '58': 'cash-management', //现金管理
  24. '119': 'activity-management', //活动管理
  25. '124': 'channel-management', //频道管理
  26. '128': 'permission-management', //权限管理
  27. '146': 'mutiple-language', //多语言配置
  28. }
  29. const getIconPath = (menuNameId) => {
  30. const englishName = menuNameMap[menuNameId] || menuNameId;
  31. const possibleKeys = [
  32. `@/assets/SvgIcons/${englishName}.svg`,
  33. `./SvgIcons/${englishName}.svg`,
  34. `/src/assets/SvgIcons/${englishName}.svg`
  35. ]
  36. for (const key of possibleKeys) {
  37. if (icons[key]) {
  38. const iconModule = icons[key]
  39. return iconModule.default || iconModule
  40. }
  41. }
  42. }
  43. // ------------------ 语言切换 ------------------
  44. const languageSwitchRef = ref()
  45. const openLanguageSwitch = () => {
  46. languageSwitchRef.value?.open()
  47. }
  48. const handleLanguageChanged = (lang) => {
  49. ElMessage.success(`语言已切换到${lang}`)
  50. }
  51. // ------------------ 刷新数据 ------------------
  52. const refreshData = async () => {
  53. try {
  54. ElMessage({message: '数据刷新中,请稍候...', type: 'info'});
  55. const response = await API({url: '/Mysql', method: 'POST', data: {}});
  56. if (response && response.code === 200) {
  57. const currentRoute = route.fullPath;
  58. router.replace('/blank');
  59. setTimeout(() => router.replace(currentRoute), 10);
  60. ElMessage.success('数据刷新成功');
  61. } else {
  62. ElMessage.error('数据刷新失败:' + (response?.msg || '未知错误'));
  63. }
  64. } catch (error) {
  65. console.error(error)
  66. ElMessage.error('数据刷新异常,请重试');
  67. }
  68. }
  69. // ------------------ 菜单逻辑 ------------------
  70. const route = useRoute()
  71. const router = useRouter()
  72. const adminStore = useAdminStore()
  73. const {adminData, menuTree, flag} = storeToRefs(adminStore)
  74. const menuList = ref(filterMenu(menuTree.value))
  75. function findBestMatch(menuList, path) {
  76. let bestMatch = ''
  77. function traverse(menus) {
  78. for (const item of menus) {
  79. const itemPath = getRoutePath(item)
  80. if (path.startsWith(itemPath) && itemPath.length > bestMatch.length) {
  81. bestMatch = itemPath
  82. }
  83. if (item.children?.length) traverse(item.children)
  84. }
  85. }
  86. traverse(menuList)
  87. return bestMatch || path
  88. }
  89. const activeMenu = computed(() => findBestMatch(menuList.value, route.path))
  90. // ------------------ 用户信息 / 密码修改 ------------------
  91. const messageVisible = ref(false)
  92. const openMessage = () => (messageVisible.value = true)
  93. const closeMessage = () => (messageVisible.value = false)
  94. const message = function () {
  95. openMessage()
  96. }
  97. const showPasswordDialog = ref(false)
  98. const pwdRef = ref()
  99. const openChangePassword = () => (showPasswordDialog.value = true)
  100. const onPwdDialogClosed = () => pwdRef.value?.resetFields()
  101. // ------------------ 退出登录 ------------------
  102. function logout() {
  103. const machineId = localStorage.getItem('machineId')
  104. localStorage.removeItem('token')
  105. adminStore.clearState()
  106. router.push('/login?machineId=' + machineId)
  107. ElMessage.success('退出成功')
  108. }
  109. // ------------------ 员工数据开关 ------------------
  110. const toggleFlag = () => {
  111. const newFlag = flag.value === 1 ? 0 : 1
  112. adminStore.setFlag(newFlag)
  113. ElMessage.success(newFlag === 1 ? '员工数据已隐藏' : '员工数据已显示')
  114. }
  115. // ------------------ 消息中心(完全修复版) ------------------
  116. const messageStore = useMessageStore()
  117. const {messages} = storeToRefs(messageStore)
  118. //根据用户id查询消息状态
  119. const selectStatusById = () => {
  120. // 定义权限检查函数
  121. const hasPermission = (permission) => findMenuById(menuTree.value, permission);
  122. // 初始化状态数组
  123. const status = [];
  124. // ===== 收款流程状态 =====
  125. // 地区财务收款待审核
  126. if (hasPermission(permissionMapping.area_finance_collection_pending)) {
  127. status.push(0);
  128. }
  129. //地区客服收款
  130. if (hasPermission(permissionMapping.collection_area_customer_service)) {
  131. status.push(2);
  132. }
  133. // 地区负责人收款待审核
  134. // else if (hasPermission(permissionMapping.area_manager_collection_pending)) {
  135. // status.push(0);
  136. // }
  137. // ===== 退款流程状态 =====
  138. // 地区财务退款审核
  139. if (hasPermission(permissionMapping.audit_area_finance_refund)) {
  140. status.push(10);
  141. }
  142. // 地区负责人退款审核
  143. if (hasPermission(permissionMapping.audit_area_manager_refund)) {
  144. status.push(20);
  145. }
  146. // 总部财务退款审核
  147. if (hasPermission(permissionMapping.audit_headquarters_refund)) {
  148. status.push(30);
  149. }
  150. // 执行人待处理
  151. if (hasPermission(permissionMapping.view_execution_details)) {
  152. status.push(40);
  153. }
  154. //地区客服退款审核驳回
  155. if (hasPermission(permissionMapping.refund_area_customer_service)) {
  156. status.push(12,22,32);
  157. }
  158. // 去重并返回结果(单一角色下实际不会有重复)
  159. return [...new Set(status)];
  160. };
  161. console.log('权限测试',selectStatusById());
  162. // 获取消息
  163. const getMessage = async () => {
  164. console.log('权限测试',displayMessages);
  165. try {
  166. let params = {status: selectStatusById()};
  167. const res = await API({
  168. url: '/getMessage',
  169. method: 'POST',
  170. data: params
  171. });
  172. if (res?.data) {
  173. const cleanList = res.data.filter(i => i.flag !== 1)
  174. messageStore.setMessages(cleanList)
  175. }
  176. } catch (e) {
  177. console.error("getMessage error:", e)
  178. }
  179. }
  180. // 点击铃铛 → 打开弹窗并刷新
  181. const showMessageDialog = ref(false)
  182. const openMessageDialog = async () => {
  183. showMessageDialog.value = true
  184. await getMessage() // 等待消息更新
  185. }
  186. // 关闭消息窗口
  187. const closeMessageDialog = () => showMessageDialog.value = false
  188. // 小红点(完全响应式)
  189. const messageDot = computed(() => messages.value.length > 0)
  190. // 消息数量(完全响应式)
  191. const messageNum = computed(() => messages.value.length)
  192. // 按日期分组(computed)
  193. const messageList = computed(() => groupMessages(messages.value))
  194. // 按日期生成最终结构(computed)
  195. const groupedMessages = computed(() => {
  196. const result = {}
  197. messageList.value.forEach(item => {
  198. if (!result[item.group]) result[item.group] = []
  199. result[item.group].push(item)
  200. })
  201. return result
  202. })
  203. // 显示全部 or 显示前两条
  204. const showAll = ref(false)
  205. const displayMessages = computed(() => {
  206. if (showAll.value) return groupedMessages.value
  207. let count = 0
  208. const limited = {}
  209. const groupOrder = ['今天', '昨天', '更早']
  210. for (const g of groupOrder) {
  211. const group = groupedMessages.value[g]
  212. if (!group) continue
  213. limited[g] = []
  214. for (const item of group) {
  215. if (count < 2) {
  216. limited[g].push(item)
  217. count++
  218. }
  219. }
  220. if (limited[g].length === 0) delete limited[g]
  221. if (count >= 2) break
  222. }
  223. return limited
  224. })
  225. const toggleShowAll = () => showAll.value = !showAll.value
  226. // 返回顶部
  227. const scrollContainer = ref(null)
  228. const scrollToTop = () => scrollContainer.value?.scrollTo({top: 0, behavior: 'smooth'})
  229. // 点击消息 → 已读 + 跳转
  230. const handleMessageClick = async (item) => {
  231. const res = await API({
  232. url: '/getMessage/update',
  233. method: 'POST',
  234. data: {id: item.id}
  235. });
  236. if (res.code === 200) {
  237. closeMessageDialog()
  238. await router.push(getOrderPage(item.status))
  239. await getMessage()
  240. ElMessage.success('跳转成功')
  241. } else {
  242. ElMessage.error('跳转失败')
  243. }
  244. }
  245. onMounted(() => getMessage())
  246. </script>
  247. <template>
  248. <div class="main-container">
  249. <!-- 背景毛玻璃层作为内容容器 -->
  250. <div class="background-glass">
  251. <!-- 侧边栏 -->
  252. <div class="sidebar-container">
  253. <el-aside class="sidebar-layout">
  254. <div class="logo">
  255. <img src="../assets/logo.png" alt="logo" style="width: 9vh; height: 9vh"/>
  256. </div>
  257. <div class="menu-scroll-container">
  258. <el-menu :router="true" :default-active="activeMenu" style="min-height: 80vh;border:none;">
  259. <!-- 递归渲染菜单层级 -->
  260. <template v-for="menu in menuList" :key="menu.id">
  261. <!-- 有子菜单的父级菜单menuType=2 且存在children -->
  262. <el-sub-menu v-if="menu.children && menu.children.length > 0" :index="menu.id.toString()">
  263. <template #title>
  264. <img
  265. :src="getIconPath(menu.id)"
  266. :alt="`${menu.menuName}图标`"
  267. style="width: 4vh; height: 4vh; margin-right: 4px;"
  268. >
  269. <span>{{ menu.menuName }}</span>
  270. </template>
  271. <!-- 子菜单 -->
  272. <template v-for="child in menu.children" :key="child.id">
  273. <!-- 子菜单为叶子节点无children -->
  274. <el-menu-item v-if="!child.children || child.children.length === 0" :index="getRoutePath(child)">
  275. <el-icon style="margin-right: 4px;">
  276. <Folder/>
  277. </el-icon>
  278. <span>{{ child.menuName }}</span>
  279. </el-menu-item>
  280. <!-- 子菜单有下级 -->
  281. <el-sub-menu v-else :index="child.id.toString()">
  282. <template #title>
  283. <el-icon style="margin-right: 4px;">
  284. <Folder/>
  285. </el-icon>
  286. <span>{{ child.menuName }}</span>
  287. </template>
  288. <!-- 递归 下一级-->
  289. <template v-for="grandChild in child.children" :key="grandChild.id">
  290. <el-menu-item :index="getRoutePath(grandChild)">
  291. <el-icon style="margin-right: 4px;">
  292. <Folder/>
  293. </el-icon>
  294. <span>{{ grandChild.menuName }}</span>
  295. </el-menu-item>
  296. </template>
  297. </el-sub-menu>
  298. </template>
  299. </el-sub-menu>
  300. <!-- 无子菜单的一级菜单 -->
  301. <el-menu-item v-else :index="getRoutePath(menu)">
  302. <img
  303. :src="getIconPath(menu.id)"
  304. :alt="`${menu.menuName}图标`"
  305. style="width: 4vh; height: 4vh; margin-right: 4px;"
  306. >
  307. <span>{{ menu.menuName }}</span>
  308. </el-menu-item>
  309. </template>
  310. </el-menu>
  311. </div>
  312. <div style="display: flex">
  313. <!-- 底部固定的设置中心 -->
  314. <div class="settings-container">
  315. <el-dropdown placement="top-start">
  316. <span class="el-dropdown-link">
  317. <!-- 暂时使用静态路径确保设置图标正常显示 -->
  318. <img src="@/assets/SvgIcons/setting.svg" alt="设置" style="width: 4vh; height: 4vh"/>
  319. <span>设置中心</span>
  320. <el-icon class="arrow-icon">
  321. <ArrowUp/>
  322. </el-icon>
  323. </span>
  324. <template #dropdown>
  325. <el-dropdown-menu>
  326. <!-- <el-dropdown-item @click="refreshData()">数据刷新</el-dropdown-item>-->
  327. <el-dropdown-item @click="openLanguageSwitch">语言切换</el-dropdown-item>
  328. <el-dropdown-item @click="toggleFlag()">
  329. {{ flag === 1 ? '显示员工数据' : '隐藏员工数据' }}
  330. </el-dropdown-item>
  331. <el-dropdown-item @click="message()">查看个人信息</el-dropdown-item>
  332. <el-dropdown-item @click="openChangePassword">修改密码</el-dropdown-item>
  333. <el-dropdown-item @click="logout">退出登录</el-dropdown-item>
  334. </el-dropdown-menu>
  335. </template>
  336. </el-dropdown>
  337. </div>
  338. <!-- 消息提示 这里的 小红点不用el-badge 他在切换状态会抽一下 应该是dom问题 -->
  339. <div class="message-container">
  340. <div style="position: relative;">
  341. <el-image :src="bell" style="width: 28px; height: 28px;" @click="openMessageDialog"></el-image>
  342. <span v-show="messageDot" class="dot"></span>
  343. </div>
  344. </div>
  345. </div>
  346. </el-aside>
  347. </div>
  348. <!-- 右侧内容区域 -->
  349. <div class="content-container">
  350. <!-- 头部
  351. <el-header class="header">
  352. </el-header> -->
  353. <!-- 主内容区域 -->
  354. <div class="main-area">
  355. <el-main>
  356. <router-view></router-view>
  357. </el-main>
  358. </div>
  359. </div>
  360. </div>
  361. <!-- 查看个人信息 -->
  362. <el-dialog v-model="messageVisible" title="查看个人信息" width="500px">
  363. <el-form :model="adminData">
  364. <el-form-item label="用户姓名" label-width="100px" label-position="left">
  365. <span class="message-font">{{ adminData.adminName }}</span>
  366. </el-form-item>
  367. <el-form-item label="精网号" label-width="100px" label-position="left">
  368. <span class="message-font">{{ adminData.account }}</span>
  369. </el-form-item>
  370. <el-form-item label="地区" label-width="100px" label-position="left">
  371. <span class="message-font">{{ adminData.markets }}</span>
  372. </el-form-item>
  373. <el-form-item label="注册时间" label-width="100px" label-position="left">
  374. <span class="message-font">{{ adminData.createTime }}</span>
  375. </el-form-item>
  376. </el-form>
  377. <template #footer>
  378. <div>
  379. <el-button text @click="closeMessage()">关闭</el-button>
  380. </div>
  381. </template>
  382. </el-dialog>
  383. <!-- 自定义密码修改弹窗组件 -->
  384. <el-dialog v-model="showPasswordDialog" :center="true" width="470px" @closed="onPwdDialogClosed">
  385. <ChangePassword ref="pwdRef" @confirm="showPasswordDialog = false"/>
  386. </el-dialog>
  387. <!--消息推送的弹窗-->
  388. <el-dialog style="background: #F3FAFE" v-model="showMessageDialog" title="" width="500px">
  389. <div class="message-title">
  390. <el-divider
  391. class="divider"
  392. direction="vertical"
  393. ></el-divider>
  394. 消息中心 ({{ messageNum }})
  395. </div>
  396. <!-- todo 这是为了样式显示 一定要改逻辑-->
  397. <div v-if="messageNum === 0">
  398. <div class="no-message">
  399. <el-image :src="noMessage"></el-image>
  400. <p class="no-message-text">暂无未办消息快去处理工作吧</p>
  401. </div>
  402. </div>
  403. <div v-else
  404. ref="scrollContainer"
  405. style="max-height: 60vh; overflow-y: auto;">
  406. <!-- 按时间分组的消息列表 -->
  407. <div
  408. v-for="(group, time) in displayMessages"
  409. :key="time"
  410. style="margin-bottom: 16px;"
  411. >
  412. <div class="time-header">
  413. {{ time }} <span class="little-dot"></span>
  414. <el-divider
  415. style="height: 2px; align-self: stretch;flex: 1;background: #CEE5FE; border: none;"
  416. ></el-divider>
  417. </div>
  418. <div
  419. v-for="item in group"
  420. :key="item.id"
  421. class="message-item"
  422. >
  423. <div style="display: flex; margin-bottom: 10px">
  424. <span class="red-dot"></span>
  425. <span class="message-card-title">{{ item.title }}</span>
  426. <div
  427. class="message-time"
  428. :style="{ color: item.czTime.includes('分钟') ? 'red' : '' }"
  429. >
  430. {{ item.czTime }}
  431. </div>
  432. </div>
  433. <div class="message-desc">
  434. <div v-if="findMenuById(menuTree, permissionMapping.refund_headquarters_finance)">[{{ item.marketName }}] </div>
  435. <div>[{{item.name}}{{ item.jwcode }}]用户有条收款订单需审核</div>
  436. </div>
  437. <el-button
  438. type="primary"
  439. style="margin: 0 auto; display: block;"
  440. @click="handleMessageClick(item)"
  441. >
  442. 前往查看
  443. </el-button>
  444. </div>
  445. <el-divider
  446. style="height: 1px; align-self: stretch;flex: 1;background: #CEE5FE; border: none;"
  447. ></el-divider>
  448. </div>
  449. <!-- 控制按钮 -->
  450. <div>
  451. <el-button
  452. type="text"
  453. v-if="messageNum > 2"
  454. class="view-all"
  455. @click="toggleShowAll"
  456. >
  457. {{ showAll ? '收起' : '查看全部' }}
  458. </el-button>
  459. <div v-if="showAll" @click="scrollToTop" class="go-top">
  460. <el-image
  461. :src="goTop"
  462. style="width: 20px; height: 20px;"
  463. fit="contain"
  464. />
  465. <span>返回顶部</span>
  466. </div>
  467. </div>
  468. </div>
  469. </el-dialog>
  470. <!-- 语言切换弹窗 -->
  471. <LanguageSwitch ref="languageSwitchRef" />
  472. </div>
  473. </template>
  474. <style scoped>
  475. /* 主容器,设置背景图并居中 */
  476. .main-container {
  477. position: fixed;
  478. top: 0;
  479. left: 0;
  480. right: 0;
  481. bottom: 0;
  482. background-image: url('@/assets/backgroundBlue.png');
  483. background-size: cover;
  484. background-position: center center;
  485. background-repeat: no-repeat;
  486. overflow: hidden;
  487. }
  488. /* 背景毛玻璃层(作为内容容器) */
  489. .background-glass {
  490. position: absolute;
  491. top: 1vh;
  492. left: 1vh;
  493. right: 1vh;
  494. bottom: 1vh;
  495. background-image: url('@/assets/blue-background.png');
  496. background-size: cover;
  497. z-index: 1;
  498. display: flex;
  499. flex-direction: row;
  500. padding: 10px;
  501. border-radius: 12px;
  502. }
  503. /* 侧边栏容器 */
  504. .sidebar-container {
  505. flex-shrink: 0;
  506. }
  507. .logo {
  508. display: flex;
  509. align-items: center;
  510. justify-content: center;
  511. height: 12vh;
  512. }
  513. /* 中间可滚动菜单容器 */
  514. .menu-scroll-container {
  515. flex: 1;
  516. overflow-y: auto;
  517. padding: 10px 0;
  518. }
  519. /* 底部设置中心样式 */
  520. .settings-container {
  521. padding: 10px 0 10px 20px; /* 上,右, 下,左 */
  522. display: flex;
  523. align-items: center; /* 垂直居中 */
  524. }
  525. /* 调整下拉菜单的样式,确保它向上弹出 */
  526. .el-dropdown-link:focus {
  527. /* 移除底部的异常效果 */
  528. outline: none;
  529. text-decoration: none;
  530. }
  531. .el-dropdown-link {
  532. display: flex;
  533. align-items: center;
  534. cursor: pointer;
  535. gap: 10px; /* 图标和文字左右间距 */
  536. }
  537. .sidebar-layout {
  538. width: 15vw;
  539. height: 100%;
  540. background: #E7F4FD; /* 浅蓝色背景 */
  541. /* backdrop-filter: blur(5px); 毛玻璃效果 --消耗性能 */
  542. box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1); /* 添加阴影增强层次感 */
  543. border-radius: 12px;
  544. display: flex;
  545. flex-direction: column;
  546. position: relative;
  547. transition: all 0.3s ease;
  548. }
  549. /* 内容区域容器 */
  550. .content-container {
  551. flex: 1;
  552. display: flex;
  553. flex-direction: column;
  554. margin-left: 5px;
  555. gap: 5px;
  556. height: 100%;
  557. overflow: hidden;
  558. }
  559. /* 主内容区域容器 */
  560. .main-area {
  561. flex: 1;
  562. background: #E7F4FD;
  563. /* 半透明浅色背景 */
  564. /* backdrop-filter: blur(5px); */
  565. /* 毛玻璃效果 */
  566. border-radius: 12px;
  567. box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  568. /* 添加阴影增强层次感 */
  569. overflow: hidden;
  570. display: flex;
  571. flex-direction: column;
  572. }
  573. /* 主内容区域样式 */
  574. .el-main {
  575. height: 100%;
  576. padding: 1px 8px 10px 8px;
  577. background: transparent;
  578. overflow-y: auto;
  579. /* 应用自定义滚动条 */
  580. }
  581. /* 确保el-menu撑满容器 */
  582. .sidebar-layout .el-menu {
  583. width: 100%;
  584. }
  585. /* 侧边栏菜单样式 适配浅色背景 */
  586. .el-menu {
  587. background: transparent !important;
  588. }
  589. /* 工作台,金币管理,现金管理 */
  590. ::v-deep(.el-sub-menu__title:hover),
  591. ::v-deep(.el-menu-item:hover) {
  592. background: #E5EBFE;
  593. }
  594. /* 子菜单展开时和背景同色 */
  595. ::v-deep(.el-sub-menu__title),
  596. ::v-deep(.el-menu-item) {
  597. background: #E7F4FD;
  598. }
  599. .message-font {
  600. /* 个人信息字体样式 */
  601. font-size: 16px;
  602. font-weight: bold;
  603. }
  604. /* 确保全局el-container适应容器 */
  605. :deep(.el-container) {
  606. /* vue3的深度选择器,用于覆盖element-plus的默认样式 */
  607. min-height: 100%;
  608. width: 100%;
  609. background: transparent;
  610. }
  611. /* 为侧边栏和主内容区域添加滚动条样式 */
  612. .menu-scroll-container,
  613. .el-main {
  614. scrollbar-width: thin;
  615. /* Firefox */
  616. scrollbar-color: rgba(0, 0, 0, 0.3) rgba(255, 255, 255, 0.2);
  617. /* Firefox滑块和轨道颜色 */
  618. }
  619. /* 小红点 */
  620. .dot {
  621. position: absolute;
  622. top: -2px;
  623. right: -2px;
  624. width: 8px;
  625. height: 8px;
  626. background: #F23C39;
  627. border-radius: 50%;
  628. }
  629. /* 消息中心整体容器 */
  630. .message-container {
  631. padding: 10px 50px 10px 50px; /* 上,右, 下,左 */
  632. display: flex;
  633. align-items: center; /* 垂直居中 */
  634. }
  635. /* 消息中心标题 */
  636. .message-title {
  637. display: flex;
  638. font-size: 16px;
  639. color: black;
  640. .divider {
  641. align-items: flex-start;
  642. gap: 36px;
  643. align-self: stretch;
  644. height: 20px;
  645. border-left: 3px solid #266EFF;
  646. }
  647. }
  648. /* 无消息的样式 */
  649. .no-message {
  650. text-align: center;
  651. position: relative;
  652. .no-message-text {
  653. position: absolute;
  654. top: 60%;
  655. left: 50%;
  656. /* 水平垂直居中 */
  657. transform: translate(-50%, -50%);
  658. /* 文字样式 */
  659. font-weight: bold;
  660. margin: 0;
  661. /* 可添加更多样式(如字体大小、阴影等) */
  662. font-size: 14px;
  663. }
  664. }
  665. /* 有消息的样式 */
  666. .time-header {
  667. font-size: 14px;
  668. color: #666;
  669. display: flex;
  670. align-items: center;
  671. gap: 8px;
  672. }
  673. .message-item {
  674. height: 100px;
  675. padding: 10px 10px 10px 10px;
  676. border-radius: 4px;
  677. border: 1px solid #E5E5E5;
  678. background: #FCFEFF;
  679. margin-bottom: 10px;
  680. }
  681. .message-card-title {
  682. font-weight: bold;
  683. margin-right: 4px;
  684. }
  685. /* 圆点样式 */
  686. .red-dot {
  687. width: 6px;
  688. height: 6px;
  689. margin-right: 9px;
  690. border-radius: 50%;
  691. background-color: red;
  692. }
  693. .message-desc {
  694. display: flex;
  695. font-size: 13px;
  696. color: #666;
  697. margin: 4px 0 15px 15px;
  698. }
  699. .message-time {
  700. margin-left: auto;
  701. font-size: 13px;
  702. color: #999;
  703. }
  704. .view-all {
  705. display: block;
  706. margin: 0 auto 16px;
  707. }
  708. .little-dot {
  709. display: inline-block;
  710. width: 8px; /* 圆点直径 */
  711. height: 8px;
  712. border-radius: 50%; /* 圆形 */
  713. background-color: #CEE5FE;;
  714. }
  715. /* 返回最上*/
  716. .go-top {
  717. display: flex;
  718. flex-direction: column;
  719. align-items: center;
  720. gap: 4px;
  721. cursor: pointer;
  722. padding: 8px;
  723. }
  724. </style>