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

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