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

651 lines
11 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. /* 文件消息 */
  210. .message-file {
  211. min-width: 280rpx;
  212. padding: 20rpx;
  213. display: flex;
  214. align-items: center;
  215. min-height: 60rpx;
  216. }
  217. .file-icon-box {
  218. width: 56rpx;
  219. height: 72rpx;
  220. margin-right: 16rpx;
  221. position: relative;
  222. flex-shrink: 0;
  223. }
  224. .file-icon {
  225. width: 100%;
  226. height: 100%;
  227. }
  228. .file-info {
  229. flex: 1;
  230. display: flex;
  231. flex-direction: column;
  232. justify-content: center;
  233. overflow: hidden;
  234. }
  235. .file-name {
  236. font-size: 28rpx;
  237. font-weight: 500;
  238. color: #000000;
  239. margin-bottom: 6rpx;
  240. overflow: hidden;
  241. text-overflow: ellipsis;
  242. white-space: nowrap;
  243. }
  244. .file-size {
  245. font-size: 24rpx;
  246. color: #666666;
  247. }
  248. /* 上传进度 */
  249. .upload-progress {
  250. position: absolute;
  251. top: 0;
  252. left: 0;
  253. right: 0;
  254. bottom: 0;
  255. background: rgba(0, 0, 0, 0.5);
  256. display: flex;
  257. align-items: center;
  258. justify-content: center;
  259. border-radius: inherit;
  260. }
  261. .progress-circle {
  262. width: 80rpx;
  263. height: 80rpx;
  264. border-radius: 50%;
  265. border: 6rpx solid rgba(255, 255, 255, 0.3);
  266. border-top-color: #ffffff;
  267. animation: spin 1s linear infinite;
  268. display: flex;
  269. align-items: center;
  270. justify-content: center;
  271. }
  272. @keyframes spin {
  273. 0% { transform: rotate(0deg); }
  274. 100% { transform: rotate(360deg); }
  275. }
  276. .progress-text {
  277. font-size: 20rpx;
  278. color: #ffffff;
  279. font-weight: 600;
  280. }
  281. /* 底部留白 */
  282. .chat-bottom-space { height: 40rpx; }
  283. /* 加载更多 */
  284. .load-more-tip {
  285. display: flex;
  286. justify-content: center;
  287. align-items: center;
  288. padding: 30rpx 0;
  289. color: #999999;
  290. font-size: 24rpx;
  291. }
  292. /* 空状态 */
  293. .empty-tip {
  294. display: flex;
  295. flex-direction: column;
  296. align-items: center;
  297. justify-content: center;
  298. padding: 100rpx 0;
  299. color: #999999;
  300. }
  301. .empty-text {
  302. font-size: 28rpx;
  303. color: #999999;
  304. }
  305. /* ========== 输入区域 - 优化垂直对齐和按钮美化 ========== */
  306. .input-section {
  307. background: #ffffff;
  308. border-top: 1rpx solid #e5e5e5;
  309. padding: 16rpx 30rpx;
  310. position: relative;
  311. z-index: 100;
  312. box-shadow: 0 -2rpx 10rpx rgba(0, 0, 0, 0.05);
  313. flex-shrink: 0;
  314. width: 100%;
  315. box-sizing: border-box;
  316. }
  317. /* 文字输入面板 - 垂直居中优化 */
  318. .text-input-panel {
  319. display: flex;
  320. align-items: center;
  321. gap: 16rpx;
  322. min-height: 72rpx;
  323. }
  324. /* 添加按钮 - 完美垂直居中 */
  325. .add-btn {
  326. width: 72rpx;
  327. height: 72rpx;
  328. display: flex;
  329. align-items: center;
  330. justify-content: center;
  331. flex-shrink: 0;
  332. }
  333. .add-icon {
  334. width: 60rpx;
  335. height: 60rpx;
  336. }
  337. /* 输入框包装器 - 优化高度和内边距 */
  338. .input-wrapper {
  339. flex: 1;
  340. position: relative;
  341. background: #f5f5f5;
  342. border-radius: 10rpx;
  343. min-height: 72rpx;
  344. display: flex;
  345. align-items: center;
  346. padding: 0 24rpx;
  347. transition: all 0.2s;
  348. box-sizing: border-box;
  349. }
  350. .input-wrapper:active {
  351. background: #e8e8e8;
  352. }
  353. /* 多行文本输入框 - 优化垂直居中 */
  354. .chat-textarea {
  355. flex: 1;
  356. width: 100%;
  357. font-size: 30rpx;
  358. color: #333333;
  359. line-height: 1.4;
  360. min-height: 48rpx;
  361. max-height: 160rpx;
  362. padding: 12rpx 0;
  363. margin: 0;
  364. background: transparent;
  365. border: none;
  366. box-sizing: border-box;
  367. overflow-y: auto;
  368. }
  369. /* 占位符样式 */
  370. .input-placeholder {
  371. color: #999999;
  372. font-size: 28rpx;
  373. line-height: 1.4;
  374. }
  375. /* 清空按钮 - 完美垂直居中 */
  376. .input-actions {
  377. position: absolute;
  378. right: 16rpx;
  379. top: 50%;
  380. transform: translateY(-50%);
  381. z-index: 2;
  382. flex-shrink: 0;
  383. display: flex;
  384. align-items: center;
  385. justify-content: center;
  386. }
  387. .clear-btn {
  388. width: 36rpx;
  389. height: 36rpx;
  390. border: none;
  391. background: transparent;
  392. padding: 0;
  393. margin: 0;
  394. line-height: 1;
  395. border-radius: 50%;
  396. display: flex;
  397. align-items: center;
  398. justify-content: center;
  399. }
  400. .clear-btn::after {
  401. border: none;
  402. }
  403. .clear-btn:active {
  404. background: rgba(0, 0, 0, 0.1);
  405. }
  406. .clear-icon {
  407. width: 28rpx;
  408. height: 28rpx;
  409. }
  410. /* 发送按钮 */
  411. .send-btn {
  412. background: linear-gradient(135deg, #07c160 0%, #06ae56 100%);
  413. width: 112rpx;
  414. height: 66rpx;
  415. border-radius: 10rpx;
  416. border: none;
  417. display: flex;
  418. align-items: center;
  419. justify-content: center;
  420. transition: all 0.3s ease;
  421. padding: 0;
  422. margin: 0;
  423. line-height: 1;
  424. flex-shrink: 0;
  425. box-shadow: 0 4rpx 8rpx rgba(7, 193, 96, 0.2);
  426. position: relative;
  427. overflow: hidden;
  428. }
  429. /* 发送按钮点击效果 */
  430. .send-btn:active {
  431. background: linear-gradient(135deg, #06ae56 0%, #059c4c 100%);
  432. transform: scale(0.96);
  433. box-shadow: 0 2rpx 4rpx rgba(7, 193, 96, 0.3);
  434. }
  435. /* 发送按钮水波纹效果 */
  436. .send-btn::after {
  437. content: '';
  438. position: absolute;
  439. top: 50%;
  440. left: 50%;
  441. width: 0;
  442. height: 0;
  443. border-radius: 50%;
  444. background: rgba(255, 255, 255, 0.3);
  445. transform: translate(-50%, -50%);
  446. transition: width 0.3s, height 0.3s;
  447. }
  448. .send-btn:active::after {
  449. width: 200rpx;
  450. height: 200rpx;
  451. opacity: 0;
  452. }
  453. .send-text {
  454. font-size: 28rpx;
  455. color: #ffffff;
  456. font-weight: 600;
  457. letter-spacing: 2rpx;
  458. }
  459. /* 发送按钮占位 - 保持布局稳定 */
  460. .send-placeholder {
  461. width: 112rpx;
  462. height: 72rpx;
  463. flex-shrink: 0;
  464. }
  465. /* 适配小屏幕 */
  466. @media screen and (max-width: 320px) {
  467. .send-btn { width: 100rpx; }
  468. .send-placeholder { width: 100rpx; }
  469. }
  470. /* ========== 多媒体选择面板 ========== */
  471. .media-action-sheet {
  472. position: fixed;
  473. top: 0;
  474. left: 0;
  475. right: 0;
  476. bottom: 0;
  477. background: rgba(0, 0, 0, 0.5);
  478. display: flex;
  479. align-items: flex-end;
  480. justify-content: center;
  481. z-index: 2000;
  482. animation: fadeIn 0.3s ease;
  483. }
  484. .media-sheet-content {
  485. width: 100%;
  486. background: #F7F7F7;
  487. border-radius: 40rpx 40rpx 0 0;
  488. padding: 40rpx 30rpx calc(10rpx + env(safe-area-inset-bottom));
  489. animation: slideUp 0.3s ease;
  490. box-sizing: border-box;
  491. }
  492. @keyframes slideUp {
  493. from { transform: translateY(100%); }
  494. to { transform: translateY(0); }
  495. }
  496. .media-sheet-header {
  497. display: flex;
  498. align-items: center;
  499. justify-content: space-between;
  500. margin-bottom: 40rpx;
  501. padding: 0 10rpx 20rpx;
  502. border-bottom: 1px solid #E4E4E4;
  503. }
  504. .sheet-title {
  505. font-size: 32rpx;
  506. font-weight: 600;
  507. color: #000000;
  508. }
  509. .close-sheet-btn {
  510. display: flex;
  511. align-items: center;
  512. justify-content: center;
  513. }
  514. .close-sheet-btn image {
  515. width: 60rpx;
  516. height: 60rpx;
  517. }
  518. .media-options-grid {
  519. display: grid;
  520. grid-template-columns: repeat(4, 1fr);
  521. gap: 40rpx 30rpx;
  522. margin-bottom: 40rpx;
  523. }
  524. .media-option {
  525. display: flex;
  526. flex-direction: column;
  527. align-items: center;
  528. border: none;
  529. background: transparent;
  530. padding: 0;
  531. margin: 0;
  532. line-height: 1;
  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. .safe-area-bottom {
  565. padding-bottom: env(safe-area-inset-bottom);
  566. }