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

927 lines
16 KiB

  1. /* 页面整体样式 */
  2. .consult-page {
  3. width: 100vw;
  4. height: 100vh;
  5. background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  6. display: flex;
  7. flex-direction: column;
  8. font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  9. }
  10. /* 头部样式 */
  11. .consult-header {
  12. background: rgba(255, 255, 255, 0.95);
  13. backdrop-filter: blur(20px);
  14. padding: 15rpx 30rpx;
  15. border-bottom: 1rpx solid rgba(0, 0, 0, 0.1);
  16. position: relative;
  17. z-index: 100;
  18. box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
  19. }
  20. .header-content {
  21. display: flex;
  22. align-items: center;
  23. justify-content: space-between;
  24. height: 90rpx;
  25. }
  26. .header-left {
  27. flex: 1;
  28. display: flex;
  29. justify-content: flex-start;
  30. }
  31. .header-center {
  32. flex: 2;
  33. display: flex;
  34. flex-direction: column;
  35. align-items: center;
  36. }
  37. .header-right {
  38. flex: 1;
  39. display: flex;
  40. justify-content: flex-end;
  41. }
  42. .back-btn {
  43. width: 70rpx;
  44. height: 70rpx;
  45. border-radius: 50%;
  46. border: none;
  47. background: rgba(0, 0, 0, 0.05);
  48. display: flex;
  49. align-items: center;
  50. justify-content: center;
  51. transition: all 0.3s;
  52. }
  53. .back-btn:active {
  54. background: rgba(0, 0, 0, 0.1);
  55. transform: scale(0.95);
  56. }
  57. .back-icon {
  58. width: 30rpx;
  59. height: 30rpx;
  60. }
  61. .expert-name {
  62. font-size: 34rpx;
  63. font-weight: 600;
  64. color: #333;
  65. margin-bottom: 5rpx;
  66. }
  67. .expert-status {
  68. display: flex;
  69. align-items: center;
  70. justify-content: center;
  71. }
  72. .status-dot {
  73. width: 14rpx;
  74. height: 14rpx;
  75. border-radius: 50%;
  76. margin-right: 8rpx;
  77. }
  78. .status-dot.online {
  79. background: #07c160;
  80. box-shadow: 0 0 10rpx rgba(7, 193, 96, 0.5);
  81. }
  82. .status-dot.offline {
  83. background: #999;
  84. }
  85. .status-text {
  86. font-size: 24rpx;
  87. color: #666;
  88. }
  89. .header-action-btn {
  90. width: 70rpx;
  91. height: 70rpx;
  92. border-radius: 50%;
  93. border: none;
  94. background: rgba(0, 0, 0, 0.05);
  95. display: flex;
  96. align-items: center;
  97. justify-content: center;
  98. transition: all 0.3s;
  99. }
  100. .header-action-btn:active {
  101. background: rgba(0, 0, 0, 0.1);
  102. transform: scale(0.95);
  103. }
  104. .header-action-icon {
  105. width: 32rpx;
  106. height: 32rpx;
  107. }
  108. /* 聊天容器 */
  109. .chat-container {
  110. flex: 1;
  111. padding: 30rpx 20rpx 0;
  112. background: linear-gradient(180deg, #f5f7fa 0%, #f0f2f5 100%);
  113. overflow-y: auto;
  114. position: relative;
  115. }
  116. /* 欢迎语 */
  117. .system-welcome {
  118. display: flex;
  119. flex-direction: column;
  120. align-items: center;
  121. justify-content: center;
  122. padding: 60rpx 40rpx;
  123. text-align: center;
  124. background: white;
  125. border-radius: 30rpx;
  126. margin: 0 auto 40rpx;
  127. max-width: 80%;
  128. box-shadow: 0 8rpx 30rpx rgba(0, 0, 0, 0.08);
  129. animation: fadeInUp 0.6s ease;
  130. }
  131. @keyframes fadeInUp {
  132. from {
  133. opacity: 0;
  134. transform: translateY(50rpx);
  135. }
  136. to {
  137. opacity: 1;
  138. transform: translateY(0);
  139. }
  140. }
  141. .welcome-avatar {
  142. width: 120rpx;
  143. height: 120rpx;
  144. border-radius: 50%;
  145. overflow: hidden;
  146. margin-bottom: 20rpx;
  147. border: 4rpx solid white;
  148. box-shadow: 0 10rpx 30rpx rgba(0, 0, 0, 0.1);
  149. }
  150. .welcome-avatar image {
  151. width: 100%;
  152. height: 100%;
  153. }
  154. .welcome-name {
  155. font-size: 34rpx;
  156. font-weight: 600;
  157. color: #333;
  158. margin-bottom: 8rpx;
  159. }
  160. .welcome-title {
  161. font-size: 26rpx;
  162. color: #666;
  163. margin-bottom: 25rpx;
  164. }
  165. .welcome-tip {
  166. font-size: 28rpx;
  167. color: #4caf50;
  168. line-height: 1.4;
  169. }
  170. /* 日期分隔线 */
  171. .date-divider {
  172. display: flex;
  173. justify-content: center;
  174. margin: 40rpx 0;
  175. }
  176. .date-text {
  177. background: rgba(0, 0, 0, 0.05);
  178. padding: 8rpx 24rpx;
  179. border-radius: 20rpx;
  180. font-size: 24rpx;
  181. color: #999;
  182. font-weight: 500;
  183. }
  184. /* 时间分隔 */
  185. .time-divider {
  186. display: flex;
  187. justify-content: center;
  188. margin: 30rpx 0;
  189. animation: fadeIn 0.3s ease;
  190. }
  191. @keyframes fadeIn {
  192. from {
  193. opacity: 0;
  194. }
  195. to {
  196. opacity: 1;
  197. }
  198. }
  199. .time-divider text {
  200. background: rgba(0, 0, 0, 0.05);
  201. padding: 6rpx 20rpx;
  202. border-radius: 15rpx;
  203. font-size: 22rpx;
  204. color: #999;
  205. }
  206. /* 消息项 */
  207. .message-item {
  208. display: flex;
  209. margin-bottom: 40rpx;
  210. animation: slideIn 0.3s ease;
  211. }
  212. @keyframes slideIn {
  213. from {
  214. opacity: 0;
  215. transform: translateY(20rpx);
  216. }
  217. to {
  218. opacity: 1;
  219. transform: translateY(0);
  220. }
  221. }
  222. .message-left {
  223. justify-content: flex-start;
  224. }
  225. .message-right {
  226. justify-content: flex-end;
  227. }
  228. .message-avatar {
  229. width: 80rpx;
  230. height: 80rpx;
  231. border-radius: 10rpx;
  232. overflow: hidden;
  233. flex-shrink: 0;
  234. }
  235. .message-left .message-avatar {
  236. margin-right: 20rpx;
  237. }
  238. .message-right .message-avatar {
  239. margin-left: 20rpx;
  240. }
  241. .message-avatar image {
  242. width: 100%;
  243. height: 100%;
  244. }
  245. .message-content-wrapper {
  246. max-width: 65%;
  247. display: flex;
  248. flex-direction: column;
  249. }
  250. .message-left .message-content-wrapper {
  251. align-items: flex-start;
  252. }
  253. .message-right .message-content-wrapper {
  254. align-items: flex-end;
  255. }
  256. /* 消息气泡 */
  257. .message-bubble {
  258. padding: 20rpx 25rpx;
  259. border-radius: 20rpx;
  260. position: relative;
  261. word-break: break-word;
  262. line-height: 1.5;
  263. transition: all 0.3s;
  264. }
  265. .message-bubble-left {
  266. background: white;
  267. border-radius: 0 20rpx 20rpx 20rpx;
  268. box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.08);
  269. }
  270. .message-bubble-right {
  271. background: linear-gradient(135deg, #95ec69 0%, #5ac725 100%);
  272. color: white;
  273. border-radius: 20rpx 0 20rpx 20rpx;
  274. box-shadow: 0 4rpx 20rpx rgba(90, 199, 37, 0.2);
  275. }
  276. .message-text {
  277. font-size: 30rpx;
  278. line-height: 1.5;
  279. }
  280. .message-bubble-left .message-text {
  281. color: #333;
  282. }
  283. .message-bubble-right .message-text {
  284. color: white;
  285. }
  286. /* 消息时间 */
  287. .message-time {
  288. font-size: 22rpx;
  289. color: #999;
  290. margin-top: 8rpx;
  291. text-align: center;
  292. }
  293. /* 消息状态 */
  294. .message-status {
  295. margin-bottom: 10rpx;
  296. }
  297. .status-icon {
  298. width: 28rpx;
  299. height: 28rpx;
  300. }
  301. /* 图片消息 */
  302. .message-image {
  303. max-width: 300rpx;
  304. max-height: 400rpx;
  305. border-radius: 12rpx;
  306. display: block;
  307. }
  308. /* 视频消息 */
  309. .message-video {
  310. width: 300rpx;
  311. height: 200rpx;
  312. border-radius: 12rpx;
  313. background: #000;
  314. }
  315. .video-play-btn {
  316. position: absolute;
  317. top: 50%;
  318. left: 50%;
  319. transform: translate(-50%, -50%);
  320. width: 80rpx;
  321. height: 80rpx;
  322. border-radius: 50%;
  323. background: rgba(0, 0, 0, 0.6);
  324. display: flex;
  325. align-items: center;
  326. justify-content: center;
  327. }
  328. .video-play-btn image {
  329. width: 40rpx;
  330. height: 40rpx;
  331. }
  332. /* 语音消息 */
  333. .message-audio {
  334. display: flex;
  335. align-items: center;
  336. padding: 25rpx;
  337. }
  338. .audio-icon-left {
  339. width: 40rpx;
  340. height: 40rpx;
  341. margin-right: 20rpx;
  342. }
  343. .audio-icon-right {
  344. width: 40rpx;
  345. height: 40rpx;
  346. margin-left: 20rpx;
  347. }
  348. .audio-content {
  349. display: flex;
  350. align-items: center;
  351. }
  352. .audio-wave {
  353. display: flex;
  354. align-items: flex-end;
  355. height: 40rpx;
  356. margin-right: 15rpx;
  357. }
  358. .wave-bar {
  359. width: 4rpx;
  360. margin: 0 2rpx;
  361. background: currentColor;
  362. animation: wave 1.2s ease-in-out infinite;
  363. }
  364. .wave-bar:nth-child(1) {
  365. height: 20rpx;
  366. animation-delay: 0s;
  367. }
  368. .wave-bar:nth-child(2) {
  369. height: 30rpx;
  370. animation-delay: 0.2s;
  371. }
  372. .wave-bar:nth-child(3) {
  373. height: 40rpx;
  374. animation-delay: 0.4s;
  375. }
  376. .wave-bar:nth-child(4) {
  377. height: 30rpx;
  378. animation-delay: 0.6s;
  379. }
  380. .wave-bar:nth-child(5) {
  381. height: 20rpx;
  382. animation-delay: 0.8s;
  383. }
  384. @keyframes wave {
  385. 0%, 100% {
  386. transform: scaleY(0.5);
  387. }
  388. 50% {
  389. transform: scaleY(1);
  390. }
  391. }
  392. .audio-duration {
  393. font-size: 28rpx;
  394. font-weight: 500;
  395. }
  396. .message-bubble-left .audio-duration {
  397. color: #666;
  398. }
  399. .message-bubble-right .audio-duration {
  400. color: white;
  401. }
  402. /* 文件消息 */
  403. .message-file {
  404. display: flex;
  405. align-items: center;
  406. padding: 25rpx;
  407. min-width: 300rpx;
  408. }
  409. .file-icon-box {
  410. position: relative;
  411. margin-right: 20rpx;
  412. }
  413. .file-icon {
  414. width: 60rpx;
  415. height: 60rpx;
  416. }
  417. .file-extension {
  418. position: absolute;
  419. top: 50%;
  420. left: 50%;
  421. transform: translate(-50%, -50%);
  422. font-size: 18rpx;
  423. font-weight: 600;
  424. color: white;
  425. }
  426. .file-info {
  427. flex: 1;
  428. display: flex;
  429. flex-direction: column;
  430. }
  431. .file-name {
  432. font-size: 28rpx;
  433. font-weight: 500;
  434. margin-bottom: 8rpx;
  435. overflow: hidden;
  436. text-overflow: ellipsis;
  437. white-space: nowrap;
  438. max-width: 200rpx;
  439. }
  440. .message-bubble-left .file-name {
  441. color: #333;
  442. }
  443. .message-bubble-right .file-name {
  444. color: white;
  445. }
  446. .file-size {
  447. font-size: 24rpx;
  448. }
  449. .message-bubble-left .file-size {
  450. color: #999;
  451. }
  452. .message-bubble-right .file-size {
  453. color: rgba(255, 255, 255, 0.9);
  454. }
  455. .file-download-btn {
  456. background: rgba(0, 0, 0, 0.1);
  457. border: none;
  458. padding: 10rpx 20rpx;
  459. border-radius: 15rpx;
  460. font-size: 24rpx;
  461. color: white;
  462. margin-left: 15rpx;
  463. }
  464. .file-download-btn:active {
  465. background: rgba(0, 0, 0, 0.2);
  466. }
  467. /* 上传进度 */
  468. .upload-progress {
  469. position: absolute;
  470. top: 0;
  471. left: 0;
  472. right: 0;
  473. bottom: 0;
  474. background: rgba(0, 0, 0, 0.5);
  475. border-radius: 12rpx;
  476. display: flex;
  477. align-items: center;
  478. justify-content: center;
  479. }
  480. .progress-circle {
  481. position: relative;
  482. width: 80rpx;
  483. height: 80rpx;
  484. }
  485. .progress-fill {
  486. position: absolute;
  487. width: 100%;
  488. height: 100%;
  489. border: 6rpx solid #4caf50;
  490. border-radius: 50%;
  491. border-top-color: transparent;
  492. border-right-color: transparent;
  493. }
  494. .progress-text {
  495. position: absolute;
  496. top: 50%;
  497. left: 50%;
  498. transform: translate(-50%, -50%);
  499. font-size: 22rpx;
  500. color: white;
  501. font-weight: 600;
  502. }
  503. /* 输入区域 */
  504. .input-section {
  505. background: white;
  506. border-top: 1rpx solid #e0e0e0;
  507. padding: 20rpx 30rpx;
  508. position: relative;
  509. box-shadow: 0 -2rpx 10rpx rgba(0, 0, 0, 0.05);
  510. }
  511. /* 语音面板 */
  512. .voice-panel {
  513. display: flex;
  514. align-items: center;
  515. justify-content: center;
  516. padding: 20rpx 0;
  517. }
  518. .voice-record-btn {
  519. width: 100%;
  520. height: 100rpx;
  521. background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
  522. border: none;
  523. border-radius: 50rpx;
  524. display: flex;
  525. flex-direction: column;
  526. align-items: center;
  527. justify-content: center;
  528. transition: all 0.3s;
  529. }
  530. .voice-record-btn:active {
  531. background: linear-gradient(135deg, #e0e0e0 0%, #d0d0d0 100%);
  532. transform: scale(0.98);
  533. }
  534. .mic-icon {
  535. width: 50rpx;
  536. height: 50rpx;
  537. margin-bottom: 10rpx;
  538. }
  539. .voice-tip {
  540. font-size: 26rpx;
  541. color: #666;
  542. }
  543. /* 输入面板 */
  544. .input-panel {
  545. display: flex;
  546. align-items: center;
  547. gap: 20rpx;
  548. }
  549. .input-mode-btn {
  550. width: 80rpx;
  551. height: 80rpx;
  552. border-radius: 50%;
  553. border: none;
  554. background: #f5f5f5;
  555. display: flex;
  556. align-items: center;
  557. justify-content: center;
  558. transition: all 0.3s;
  559. }
  560. .input-mode-btn:active {
  561. background: #e0e0e0;
  562. transform: scale(0.95);
  563. }
  564. .mode-icon {
  565. width: 36rpx;
  566. height: 36rpx;
  567. }
  568. .input-box-wrapper {
  569. flex: 1;
  570. background: #f5f5f5;
  571. border-radius: 40rpx;
  572. padding: 0 30rpx;
  573. height: 80rpx;
  574. display: flex;
  575. align-items: center;
  576. transition: all 0.3s;
  577. }
  578. .input-box-wrapper:active {
  579. background: #e8e8e8;
  580. }
  581. .chat-input {
  582. flex: 1;
  583. height: 100%;
  584. font-size: 30rpx;
  585. color: #333;
  586. }
  587. .placeholder {
  588. color: #999;
  589. font-size: 28rpx;
  590. }
  591. .media-btn,
  592. .send-btn {
  593. width: 80rpx;
  594. height: 80rpx;
  595. border-radius: 50%;
  596. border: none;
  597. display: flex;
  598. align-items: center;
  599. justify-content: center;
  600. transition: all 0.3s;
  601. }
  602. .media-btn {
  603. background: #f5f5f5;
  604. }
  605. .media-btn:active {
  606. background: #e0e0e0;
  607. transform: scale(0.95);
  608. }
  609. .send-btn {
  610. background: linear-gradient(135deg, #95ec69 0%, #5ac725 100%);
  611. }
  612. .send-btn:active {
  613. background: linear-gradient(135deg, #5ac725 0%, #4caf50 100%);
  614. transform: scale(0.95);
  615. }
  616. .media-icon,
  617. .send-icon {
  618. width: 36rpx;
  619. height: 36rpx;
  620. }
  621. .send-icon {
  622. filter: brightness(0) invert(1);
  623. }
  624. /* 多媒体选择面板 */
  625. .media-action-sheet {
  626. position: fixed;
  627. top: 0;
  628. left: 0;
  629. right: 0;
  630. bottom: 0;
  631. background: rgba(0, 0, 0, 0.5);
  632. display: flex;
  633. align-items: flex-end;
  634. justify-content: center;
  635. z-index: 1000;
  636. animation: fadeIn 0.3s ease;
  637. }
  638. .media-sheet-content {
  639. width: 100%;
  640. background: white;
  641. border-radius: 40rpx 40rpx 0 0;
  642. padding: 40rpx 30rpx 60rpx;
  643. animation: slideUp 0.3s ease;
  644. }
  645. @keyframes slideUp {
  646. from {
  647. transform: translateY(100%);
  648. }
  649. to {
  650. transform: translateY(0);
  651. }
  652. }
  653. .media-sheet-header {
  654. display: flex;
  655. align-items: center;
  656. justify-content: space-between;
  657. margin-bottom: 40rpx;
  658. }
  659. .sheet-title {
  660. font-size: 32rpx;
  661. font-weight: 600;
  662. color: #333;
  663. }
  664. .close-sheet-btn {
  665. width: 60rpx;
  666. height: 60rpx;
  667. border-radius: 50%;
  668. border: none;
  669. background: #f5f5f5;
  670. display: flex;
  671. align-items: center;
  672. justify-content: center;
  673. }
  674. .close-sheet-btn image {
  675. width: 24rpx;
  676. height: 24rpx;
  677. }
  678. .media-options {
  679. display: grid;
  680. grid-template-columns: repeat(4, 1fr);
  681. gap: 30rpx;
  682. }
  683. .media-option {
  684. display: flex;
  685. flex-direction: column;
  686. align-items: center;
  687. border: none;
  688. background: none;
  689. padding: 20rpx 10rpx;
  690. border-radius: 20rpx;
  691. transition: all 0.3s;
  692. }
  693. .media-option:active {
  694. background: #f5f5f5;
  695. }
  696. .option-icon {
  697. width: 100rpx;
  698. height: 100rpx;
  699. border-radius: 25rpx;
  700. display: flex;
  701. align-items: center;
  702. justify-content: center;
  703. margin-bottom: 20rpx;
  704. }
  705. .photo-icon {
  706. background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
  707. }
  708. .camera-icon {
  709. background: linear-gradient(135deg, #f3e5f5 0%, #e1bee7 100%);
  710. }
  711. .video-icon {
  712. background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
  713. }
  714. .audio-icon {
  715. background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
  716. }
  717. .file-icon {
  718. background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
  719. }
  720. .option-icon image {
  721. width: 50rpx;
  722. height: 50rpx;
  723. }
  724. .option-text {
  725. font-size: 26rpx;
  726. color: #666;
  727. }
  728. /* 录音模态框 */
  729. .recording-modal {
  730. position: fixed;
  731. top: 0;
  732. left: 0;
  733. right: 0;
  734. bottom: 0;
  735. background: rgba(0, 0, 0, 0.7);
  736. display: flex;
  737. align-items: center;
  738. justify-content: center;
  739. z-index: 1001;
  740. animation: fadeIn 0.2s ease;
  741. }
  742. .recording-box {
  743. background: white;
  744. border-radius: 40rpx;
  745. padding: 60rpx;
  746. display: flex;
  747. flex-direction: column;
  748. align-items: center;
  749. box-shadow: 0 20rpx 60rpx rgba(0, 0, 0, 0.3);
  750. }
  751. .recording-wave-box {
  752. position: relative;
  753. width: 200rpx;
  754. height: 200rpx;
  755. margin-bottom: 30rpx;
  756. }
  757. .recording-wave {
  758. position: absolute;
  759. top: 0;
  760. left: 0;
  761. right: 0;
  762. bottom: 0;
  763. border: 8rpx solid #5ac725;
  764. border-radius: 50%;
  765. animation: pulse 1.5s ease-in-out infinite;
  766. }
  767. @keyframes pulse {
  768. 0% {
  769. transform: scale(1);
  770. opacity: 1;
  771. }
  772. 100% {
  773. transform: scale(1.2);
  774. opacity: 0;
  775. }
  776. }
  777. .recording-mic-icon {
  778. position: absolute;
  779. top: 50%;
  780. left: 50%;
  781. transform: translate(-50%, -50%);
  782. width: 80rpx;
  783. height: 80rpx;
  784. }
  785. .recording-tip {
  786. font-size: 32rpx;
  787. color: #333;
  788. font-weight: 500;
  789. margin-bottom: 15rpx;
  790. }
  791. .recording-time {
  792. font-size: 36rpx;
  793. color: #5ac725;
  794. font-weight: bold;
  795. }