与牧同行-兽医端小程序
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.

684 lines
13 KiB

  1. /* 专家端聊天样式 */
  2. .consult-page {
  3. width: 100vw;
  4. height: 100vh;
  5. background: #f5f5f5;
  6. display: flex;
  7. flex-direction: column;
  8. overflow: hidden;
  9. }
  10. /* 头部样式 */
  11. .consult-header {
  12. background: #ffffff;
  13. border-bottom: 1rpx solid #e5e5e5;
  14. position: relative;
  15. z-index: 1000;
  16. box-shadow: 0 1rpx 6rpx rgba(0, 0, 0, 0.05);
  17. flex-shrink: 0;
  18. }
  19. .header-content {
  20. display: flex;
  21. align-items: center;
  22. padding: 12rpx 24rpx;
  23. height: 96rpx;
  24. }
  25. .back-btn, .header-right {
  26. width: 48rpx;
  27. height: 48rpx;
  28. display: flex;
  29. align-items: center;
  30. justify-content: center;
  31. }
  32. .back-icon, .more-icon {
  33. width: 40rpx;
  34. height: 40rpx;
  35. }
  36. .header-center {
  37. flex: 1;
  38. display: flex;
  39. justify-content: center;
  40. }
  41. .expert-info {
  42. display: flex;
  43. flex-direction: column;
  44. align-items: center;
  45. justify-content: center;
  46. }
  47. .expert-name {
  48. font-size: 32rpx;
  49. font-weight: 600;
  50. color: #000000;
  51. line-height: 44rpx;
  52. margin-bottom: 4rpx;
  53. }
  54. .expert-status {
  55. display: flex;
  56. align-items: center;
  57. justify-content: center;
  58. }
  59. .status-dot {
  60. width: 16rpx;
  61. height: 16rpx;
  62. border-radius: 50%;
  63. margin-right: 8rpx;
  64. }
  65. .status-dot.online {
  66. background: #07c160;
  67. animation: pulse 2s infinite;
  68. }
  69. .status-dot.offline {
  70. background: #cccccc;
  71. }
  72. @keyframes pulse {
  73. 0% { box-shadow: 0 0 0 0 rgba(7, 193, 96, 0.4); }
  74. 70% { box-shadow: 0 0 0 8rpx rgba(7, 193, 96, 0); }
  75. 100% { box-shadow: 0 0 0 0 rgba(7, 193, 96, 0); }
  76. }
  77. .status-text {
  78. font-size: 24rpx;
  79. color: #666666;
  80. }
  81. /* 聊天容器 */
  82. .chat-container {
  83. flex: 1;
  84. padding: 20rpx 0;
  85. background: #f5f5f5;
  86. overflow-y: auto;
  87. position: relative;
  88. height: 0;
  89. }
  90. /* 消息项 */
  91. .message-item {
  92. display: flex;
  93. margin-bottom: 24rpx;
  94. padding: 0 30rpx;
  95. opacity: 0;
  96. animation: fadeIn 0.3s ease forwards;
  97. align-items: flex-start;
  98. position: relative;
  99. }
  100. @keyframes fadeIn {
  101. from { opacity: 0; transform: translateY(10rpx); }
  102. to { opacity: 1; transform: translateY(0); }
  103. }
  104. .message-left { justify-content: flex-start; }
  105. .message-right { justify-content: flex-end; }
  106. /* 头像 */
  107. .message-avatar {
  108. width: 80rpx;
  109. height: 80rpx;
  110. border-radius: 8rpx;
  111. overflow: hidden;
  112. flex-shrink: 0;
  113. background: #ffffff;
  114. border: 1rpx solid #f0f0f0;
  115. position: relative;
  116. z-index: 1;
  117. }
  118. .message-left .message-avatar { margin-right: 16rpx; }
  119. .message-right .message-avatar { margin-left: 16rpx; }
  120. .avatar-img {
  121. width: 100%;
  122. height: 100%;
  123. object-fit: cover;
  124. }
  125. /* 消息内容包装器 */
  126. .message-content-wrapper {
  127. max-width: 480rpx;
  128. position: relative;
  129. display: flex;
  130. flex-direction: column;
  131. z-index: 2;
  132. }
  133. .message-left .message-content-wrapper { align-items: flex-start; }
  134. .message-right .message-content-wrapper { align-items: flex-end; }
  135. /* 气泡箭头 */
  136. .message-arrow {
  137. position: absolute;
  138. width: 0;
  139. height: 0;
  140. border-style: solid;
  141. border-width: 12rpx;
  142. top: 30rpx;
  143. z-index: 1;
  144. }
  145. .arrow-left {
  146. left: -24rpx;
  147. border-color: transparent #ffffff transparent transparent;
  148. }
  149. .arrow-right {
  150. right: -24rpx;
  151. border-color: transparent transparent transparent #95ec69;
  152. }
  153. /* 消息气泡 */
  154. .message-bubble {
  155. position: relative;
  156. padding: 16rpx 20rpx;
  157. word-break: break-word;
  158. box-sizing: border-box;
  159. min-height: 60rpx;
  160. display: flex;
  161. align-items: center;
  162. }
  163. .bubble-left {
  164. background: #ffffff;
  165. border-radius: 10rpx;
  166. border-top-left-radius: 4rpx;
  167. box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.05);
  168. }
  169. .bubble-right {
  170. background: #95ec69;
  171. border-radius: 10rpx;
  172. border-top-right-radius: 4rpx;
  173. box-shadow: 0 2rpx 8rpx rgba(149, 236, 105, 0.2);
  174. }
  175. /* 文本消息 */
  176. .message-text {
  177. font-size: 32rpx;
  178. color: #000000;
  179. line-height: 1.4;
  180. }
  181. .bubble-right .message-text { color: #000000; }
  182. /* 媒体消息 */
  183. .media-bubble {
  184. position: relative;
  185. border-radius: 10rpx;
  186. overflow: hidden;
  187. box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.05);
  188. background: #ffffff;
  189. min-height: 60rpx;
  190. display: flex;
  191. align-items: center;
  192. justify-content: center;
  193. }
  194. .message-left .media-bubble { border-top-left-radius: 4rpx; }
  195. .message-right .media-bubble { border-top-right-radius: 4rpx; }
  196. .message-image {
  197. width: 280rpx;
  198. height: 280rpx;
  199. display: block;
  200. }
  201. .message-video {
  202. width: 280rpx;
  203. height: 280rpx;
  204. background: #000000;
  205. }
  206. .video-play-overlay {
  207. position: absolute;
  208. top: 50%;
  209. left: 50%;
  210. transform: translate(-50%, -50%);
  211. width: 80rpx;
  212. height: 80rpx;
  213. border-radius: 50%;
  214. background: rgba(0, 0, 0, 0.6);
  215. display: flex;
  216. align-items: center;
  217. justify-content: center;
  218. }
  219. .play-icon {
  220. width: 40rpx;
  221. height: 40rpx;
  222. margin-left: 4rpx;
  223. }
  224. /* 文件消息 */
  225. .message-file {
  226. min-width: 280rpx;
  227. padding: 20rpx;
  228. display: flex;
  229. align-items: center;
  230. min-height: 60rpx;
  231. }
  232. .file-icon-box {
  233. width: 56rpx;
  234. height: 72rpx;
  235. margin-right: 16rpx;
  236. position: relative;
  237. flex-shrink: 0;
  238. }
  239. .file-icon {
  240. width: 100%;
  241. height: 100%;
  242. }
  243. .file-info {
  244. flex: 1;
  245. display: flex;
  246. flex-direction: column;
  247. justify-content: center;
  248. overflow: hidden;
  249. }
  250. .file-name {
  251. font-size: 28rpx;
  252. font-weight: 500;
  253. color: #000000;
  254. margin-bottom: 6rpx;
  255. overflow: hidden;
  256. text-overflow: ellipsis;
  257. white-space: nowrap;
  258. }
  259. .file-size {
  260. font-size: 24rpx;
  261. color: #666666;
  262. }
  263. /* 消息时间 */
  264. .message-time {
  265. font-size: 22rpx;
  266. color: #999999;
  267. margin-top: 8rpx;
  268. align-self: flex-start;
  269. }
  270. .message-right .message-time {
  271. align-self: flex-end;
  272. }
  273. /* 消息状态 */
  274. .message-status {
  275. font-size: 22rpx;
  276. color: #999999;
  277. margin-top: 4rpx;
  278. display: flex;
  279. align-items: center;
  280. gap: 8rpx;
  281. }
  282. .message-status .fail {
  283. color: #ff4d4f;
  284. }
  285. .retry-text {
  286. color: #1890ff;
  287. text-decoration: underline;
  288. margin-left: 8rpx;
  289. }
  290. /* 上传进度 */
  291. .upload-progress {
  292. position: absolute;
  293. top: 0;
  294. left: 0;
  295. right: 0;
  296. bottom: 0;
  297. background: rgba(0, 0, 0, 0.5);
  298. display: flex;
  299. align-items: center;
  300. justify-content: center;
  301. border-radius: inherit;
  302. }
  303. .progress-circle {
  304. width: 80rpx;
  305. height: 80rpx;
  306. border-radius: 50%;
  307. border: 6rpx solid rgba(255, 255, 255, 0.3);
  308. border-top-color: #ffffff;
  309. animation: spin 1s linear infinite;
  310. display: flex;
  311. align-items: center;
  312. justify-content: center;
  313. }
  314. @keyframes spin {
  315. 0% { transform: rotate(0deg); }
  316. 100% { transform: rotate(360deg); }
  317. }
  318. .progress-text {
  319. font-size: 20rpx;
  320. color: #ffffff;
  321. font-weight: 600;
  322. }
  323. /* 底部留白 */
  324. .chat-bottom-space { height: 40rpx; }
  325. /* 加载更多 */
  326. .load-more-tip {
  327. display: flex;
  328. justify-content: center;
  329. align-items: center;
  330. padding: 30rpx 0;
  331. color: #999999;
  332. font-size: 24rpx;
  333. }
  334. /* 空状态 */
  335. .empty-tip {
  336. display: flex;
  337. flex-direction: column;
  338. align-items: center;
  339. justify-content: center;
  340. padding: 100rpx 0;
  341. color: #999999;
  342. }
  343. .empty-text {
  344. font-size: 28rpx;
  345. color: #999999;
  346. }
  347. /* 输入区域 */
  348. .input-section {
  349. background: #ffffff;
  350. border-top: 1rpx solid #e5e5e5;
  351. padding: 16rpx 30rpx;
  352. position: relative;
  353. z-index: 100;
  354. box-shadow: 0 -2rpx 10rpx rgba(0, 0, 0, 0.05);
  355. flex-shrink: 0;
  356. width: 100%;
  357. box-sizing: border-box;
  358. }
  359. .text-input-panel {
  360. display: flex;
  361. align-items: center;
  362. gap: 16rpx;
  363. min-height: 72rpx;
  364. }
  365. .add-btn {
  366. width: 72rpx;
  367. height: 72rpx;
  368. display: flex;
  369. align-items: center;
  370. justify-content: center;
  371. flex-shrink: 0;
  372. }
  373. .add-icon {
  374. width: 60rpx;
  375. height: 60rpx;
  376. }
  377. .input-wrapper {
  378. flex: 1;
  379. position: relative;
  380. background: #f5f5f5;
  381. border-radius: 10rpx;
  382. min-height: 72rpx;
  383. display: flex;
  384. align-items: center;
  385. padding: 0 24rpx;
  386. transition: all 0.2s;
  387. box-sizing: border-box;
  388. }
  389. .input-wrapper:active {
  390. background: #e8e8e8;
  391. }
  392. .chat-textarea {
  393. flex: 1;
  394. width: 100%;
  395. font-size: 30rpx;
  396. color: #333333;
  397. line-height: 1.4;
  398. min-height: 48rpx;
  399. max-height: 160rpx;
  400. padding: 12rpx 0;
  401. margin: 0;
  402. background: transparent;
  403. border: none;
  404. box-sizing: border-box;
  405. overflow-y: auto;
  406. }
  407. .input-placeholder {
  408. color: #999999;
  409. font-size: 28rpx;
  410. line-height: 1.4;
  411. }
  412. .input-actions {
  413. position: absolute;
  414. right: 16rpx;
  415. top: 50%;
  416. transform: translateY(-50%);
  417. z-index: 2;
  418. flex-shrink: 0;
  419. display: flex;
  420. align-items: center;
  421. justify-content: center;
  422. }
  423. .clear-btn {
  424. width: 36rpx;
  425. height: 36rpx;
  426. border: none;
  427. background: transparent;
  428. padding: 0;
  429. margin: 0;
  430. line-height: 1;
  431. border-radius: 50%;
  432. display: flex;
  433. align-items: center;
  434. justify-content: center;
  435. }
  436. .clear-btn::after {
  437. border: none;
  438. }
  439. .clear-btn:active {
  440. background: rgba(0, 0, 0, 0.1);
  441. }
  442. .clear-icon {
  443. width: 28rpx;
  444. height: 28rpx;
  445. }
  446. .send-btn {
  447. background: linear-gradient(135deg, #07c160 0%, #06ae56 100%);
  448. width: 112rpx;
  449. height: 66rpx;
  450. border-radius: 10rpx;
  451. border: none;
  452. display: flex;
  453. align-items: center;
  454. justify-content: center;
  455. transition: all 0.3s ease;
  456. padding: 0;
  457. margin: 0;
  458. line-height: 1;
  459. flex-shrink: 0;
  460. box-shadow: 0 4rpx 8rpx rgba(7, 193, 96, 0.2);
  461. position: relative;
  462. overflow: hidden;
  463. }
  464. .send-btn:active {
  465. background: linear-gradient(135deg, #06ae56 0%, #059c4c 100%);
  466. transform: scale(0.96);
  467. box-shadow: 0 2rpx 4rpx rgba(7, 193, 96, 0.3);
  468. }
  469. .send-text {
  470. font-size: 28rpx;
  471. color: #ffffff;
  472. font-weight: 600;
  473. letter-spacing: 2rpx;
  474. }
  475. .send-placeholder {
  476. width: 112rpx;
  477. height: 72rpx;
  478. flex-shrink: 0;
  479. }
  480. /* 多媒体选择面板 */
  481. .media-action-sheet {
  482. position: fixed;
  483. top: 0;
  484. left: 0;
  485. right: 0;
  486. bottom: 0;
  487. background: rgba(0, 0, 0, 0.5);
  488. display: flex;
  489. align-items: flex-end;
  490. justify-content: center;
  491. z-index: 2000;
  492. animation: fadeIn 0.3s ease;
  493. }
  494. .media-sheet-content {
  495. width: 100%;
  496. background: #F7F7F7;
  497. border-radius: 40rpx 40rpx 0 0;
  498. padding: 40rpx 30rpx calc(10rpx + env(safe-area-inset-bottom));
  499. animation: slideUp 0.3s ease;
  500. box-sizing: border-box;
  501. }
  502. @keyframes slideUp {
  503. from { transform: translateY(100%); }
  504. to { transform: translateY(0); }
  505. }
  506. .media-sheet-header {
  507. display: flex;
  508. align-items: center;
  509. justify-content: space-between;
  510. margin-bottom: 40rpx;
  511. padding: 0 10rpx 20rpx;
  512. border-bottom: 1px solid #E4E4E4;
  513. }
  514. .sheet-title {
  515. font-size: 32rpx;
  516. font-weight: 600;
  517. color: #000000;
  518. }
  519. .close-sheet-btn image {
  520. width: 60rpx;
  521. height: 60rpx;
  522. }
  523. .media-options-grid {
  524. display: grid;
  525. grid-template-columns: repeat(4, 1fr);
  526. gap: 40rpx 30rpx;
  527. margin-bottom: 40rpx;
  528. }
  529. .media-option {
  530. display: flex;
  531. flex-direction: column;
  532. align-items: center;
  533. }
  534. .option-icon-box {
  535. width: 120rpx;
  536. height: 120rpx;
  537. border-radius: 30rpx;
  538. display: flex;
  539. align-items: center;
  540. justify-content: center;
  541. margin-bottom: 16rpx;
  542. transition: transform 0.2s;
  543. background-color: #fff;
  544. }
  545. .media-option:active .option-icon-box {
  546. transform: scale(0.95);
  547. }
  548. .option-icon-box image {
  549. width: 60rpx;
  550. height: 60rpx;
  551. }
  552. .option-text {
  553. font-size: 26rpx;
  554. color: #666666;
  555. }
  556. .sheet-bottom {
  557. text-align: center;
  558. }
  559. .bottom-tip {
  560. font-size: 24rpx;
  561. color: #999999;
  562. }
  563. /* 更多菜单 */
  564. .more-menu {
  565. position: fixed;
  566. top: 0;
  567. left: 0;
  568. right: 0;
  569. bottom: 0;
  570. background: rgba(0, 0, 0, 0.3);
  571. z-index: 2000;
  572. }
  573. .menu-content {
  574. position: absolute;
  575. top: 96rpx;
  576. right: 24rpx;
  577. background: #ffffff;
  578. border-radius: 12rpx;
  579. padding: 16rpx 0;
  580. min-width: 200rpx;
  581. box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.15);
  582. }
  583. .menu-item {
  584. padding: 24rpx 32rpx;
  585. font-size: 28rpx;
  586. color: #333333;
  587. border-bottom: 1rpx solid #f0f0f0;
  588. }
  589. .menu-item:last-child {
  590. border-bottom: none;
  591. }
  592. .menu-item:active {
  593. background: #f5f5f5;
  594. }