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

671 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-text {
  320. font-size: 28rpx;
  321. color: #999999;
  322. }
  323. /* ========== 输入区域 - 优化垂直对齐和按钮美化 ========== */
  324. .input-section {
  325. background: #ffffff;
  326. border-top: 1rpx solid #e5e5e5;
  327. padding: 16rpx 30rpx;
  328. position: relative;
  329. z-index: 100;
  330. box-shadow: 0 -2rpx 10rpx rgba(0, 0, 0, 0.05);
  331. flex-shrink: 0;
  332. width: 100%;
  333. box-sizing: border-box;
  334. }
  335. /* 文字输入面板 - 垂直居中优化 */
  336. .text-input-panel {
  337. display: flex;
  338. align-items: center;
  339. gap: 16rpx;
  340. min-height: 72rpx;
  341. }
  342. /* 添加按钮 - 完美垂直居中 */
  343. .add-btn {
  344. width: 72rpx;
  345. height: 72rpx;
  346. display: flex;
  347. align-items: center;
  348. justify-content: center;
  349. flex-shrink: 0;
  350. }
  351. .add-icon {
  352. width: 60rpx;
  353. height: 60rpx;
  354. }
  355. /* 输入框包装器 - 优化高度和内边距 */
  356. .input-wrapper {
  357. flex: 1;
  358. position: relative;
  359. background: #f5f5f5;
  360. border-radius: 10rpx;
  361. min-height: 72rpx;
  362. display: flex;
  363. align-items: center;
  364. padding: 0 24rpx;
  365. transition: all 0.2s;
  366. box-sizing: border-box;
  367. }
  368. .input-wrapper:active {
  369. background: #e8e8e8;
  370. }
  371. /* 多行文本输入框 - 优化垂直居中 */
  372. .chat-textarea {
  373. flex: 1;
  374. width: 100%;
  375. font-size: 30rpx;
  376. color: #333333;
  377. line-height: 1.4;
  378. min-height: 48rpx;
  379. max-height: 160rpx;
  380. padding: 12rpx 0;
  381. margin: 0;
  382. background: transparent;
  383. border: none;
  384. box-sizing: border-box;
  385. overflow-y: auto;
  386. }
  387. /* 占位符样式 */
  388. .input-placeholder {
  389. color: #999999;
  390. font-size: 28rpx;
  391. line-height: 1.4;
  392. }
  393. /* 清空按钮 - 完美垂直居中 */
  394. .input-actions {
  395. position: absolute;
  396. right: 16rpx;
  397. top: 50%;
  398. transform: translateY(-50%);
  399. z-index: 2;
  400. flex-shrink: 0;
  401. display: flex;
  402. align-items: center;
  403. justify-content: center;
  404. }
  405. .clear-btn {
  406. width: 36rpx;
  407. height: 36rpx;
  408. border: none;
  409. background: transparent;
  410. padding: 0;
  411. margin: 0;
  412. line-height: 1;
  413. border-radius: 50%;
  414. display: flex;
  415. align-items: center;
  416. justify-content: center;
  417. }
  418. .clear-btn::after {
  419. border: none;
  420. }
  421. .clear-btn:active {
  422. background: rgba(0, 0, 0, 0.1);
  423. }
  424. .clear-icon {
  425. width: 28rpx;
  426. height: 28rpx;
  427. }
  428. /* 发送按钮 - 美观渐变绿色,完美垂直居中 */
  429. .send-btn {
  430. background: linear-gradient(135deg, #07c160 0%, #06ae56 100%);
  431. width: 112rpx;
  432. height: 66rpx;
  433. border-radius: 10rpx;
  434. border: none;
  435. display: flex;
  436. align-items: center;s
  437. justify-content: center;
  438. transition: all 0.3s ease;
  439. padding: 0;
  440. margin: 0;
  441. line-height: 1;
  442. flex-shrink: 0;
  443. box-shadow: 0 4rpx 8rpx rgba(7, 193, 96, 0.2);
  444. position: relative;
  445. overflow: hidden;
  446. }
  447. /* 发送按钮点击效果 */
  448. .send-btn:active {
  449. background: linear-gradient(135deg, #06ae56 0%, #059c4c 100%);
  450. transform: scale(0.96);
  451. box-shadow: 0 2rpx 4rpx rgba(7, 193, 96, 0.3);
  452. }
  453. /* 发送按钮水波纹效果 */
  454. .send-btn::after {
  455. content: '';
  456. position: absolute;
  457. top: 50%;
  458. left: 50%;
  459. width: 0;
  460. height: 0;
  461. border-radius: 50%;
  462. background: rgba(255, 255, 255, 0.3);
  463. transform: translate(-50%, -50%);
  464. transition: width 0.3s, height 0.3s;
  465. }
  466. .send-btn:active::after {
  467. width: 200rpx;
  468. height: 200rpx;
  469. opacity: 0;
  470. }
  471. .send-text {
  472. font-size: 28rpx;
  473. color: #ffffff;
  474. font-weight: 600;
  475. letter-spacing: 2rpx;
  476. }
  477. /* 发送按钮占位 - 保持布局稳定 */
  478. .send-placeholder {
  479. width: 112rpx;
  480. height: 72rpx;
  481. flex-shrink: 0;
  482. }
  483. /* 适配小屏幕 */
  484. @media screen and (max-width: 320px) {
  485. .send-btn { width: 100rpx; }
  486. .send-placeholder { width: 100rpx; }
  487. }
  488. /* ========== 多媒体选择面板 ========== */
  489. .media-action-sheet {
  490. position: fixed;
  491. top: 0;
  492. left: 0;
  493. right: 0;
  494. bottom: 0;
  495. background: rgba(0, 0, 0, 0.5);
  496. display: flex;
  497. align-items: flex-end;
  498. justify-content: center;
  499. z-index: 2000;
  500. animation: fadeIn 0.3s ease;
  501. }
  502. .media-sheet-content {
  503. width: 100%;
  504. background: #F7F7F7;
  505. border-radius: 40rpx 40rpx 0 0;
  506. padding: 40rpx 30rpx calc(10rpx + env(safe-area-inset-bottom));
  507. animation: slideUp 0.3s ease;
  508. box-sizing: border-box;
  509. }
  510. @keyframes slideUp {
  511. from { transform: translateY(100%); }
  512. to { transform: translateY(0); }
  513. }
  514. .media-sheet-header {
  515. display: flex;
  516. align-items: center;
  517. justify-content: space-between;
  518. margin-bottom: 40rpx;
  519. padding: 0 10rpx 20rpx;
  520. border-bottom: 1px solid #E4E4E4;
  521. }
  522. .sheet-title {
  523. font-size: 32rpx;
  524. font-weight: 600;
  525. color: #000000;
  526. }
  527. .close-sheet-btn {
  528. display: flex;
  529. align-items: center;
  530. justify-content: center;
  531. }
  532. .close-sheet-btn image {
  533. width: 60rpx;
  534. height: 60rpx;
  535. }
  536. .media-options-grid {
  537. display: grid;
  538. grid-template-columns: repeat(4, 1fr);
  539. gap: 40rpx 30rpx;
  540. margin-bottom: 40rpx;
  541. }
  542. .media-option {
  543. display: flex;
  544. flex-direction: column;
  545. align-items: center;
  546. border: none;
  547. background: transparent;
  548. padding: 0;
  549. margin: 0;
  550. line-height: 1;
  551. }
  552. .option-icon-box {
  553. width: 120rpx;
  554. height: 120rpx;
  555. border-radius: 30rpx;
  556. display: flex;
  557. align-items: center;
  558. justify-content: center;
  559. margin-bottom: 16rpx;
  560. transition: transform 0.2s;
  561. background-color: #fff;
  562. }
  563. .media-option:active .option-icon-box {
  564. transform: scale(0.95);
  565. }
  566. .option-icon-box image {
  567. width: 60rpx;
  568. height: 60rpx;
  569. }
  570. .option-text {
  571. font-size: 26rpx;
  572. color: #666666;
  573. }
  574. .sheet-bottom {
  575. text-align: center;
  576. }
  577. .bottom-tip {
  578. font-size: 24rpx;
  579. color: #999999;
  580. }
  581. /* 适配全面屏 */
  582. .safe-area-bottom {
  583. padding-bottom: env(safe-area-inset-bottom);
  584. }