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

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