chat.wxss 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. @charset "UTF-8";
  2. /* 需要放到文件最上面 */
  3. /* 水平间距 */
  4. /* 水平间距 */
  5. /*
  6. 以下变量是默认值,如不需要修改可以不用给下面的变量重新赋值
  7. */
  8. /* 水平间距 */
  9. .chat-box .chat-tips {
  10. position: fixed;
  11. left: 0;
  12. top: 0;
  13. width: 100%;
  14. z-index: 9;
  15. background-color: #08979c;
  16. height: 72rpx;
  17. line-height: 72rpx;
  18. color: #fff;
  19. text-align: center;
  20. opacity: 0.9;
  21. }
  22. .chat-box .chat-list {
  23. width: 100%;
  24. height: auto;
  25. padding-bottom: 120rpx;
  26. box-sizing: content-box;
  27. /* 兼容iPhoneX */
  28. margin-bottom: 0;
  29. margin-bottom: constant(safe-area-inset-bottom);
  30. margin-bottom: env(safe-area-inset-bottom);
  31. }
  32. .chat-box .chat-list .chat-item {
  33. display: flex;
  34. padding: 20rpx;
  35. align-items: flex-start;
  36. align-content: flex-start;
  37. position: relative;
  38. /* 收到的消息 */
  39. /* 发出的消息 */
  40. }
  41. .chat-box .chat-list .chat-item .date {
  42. position: absolute;
  43. bottom: -5rpx;
  44. font-size: 20rpx;
  45. color: #8c8c8c;
  46. }
  47. .chat-box .chat-list .chat-item .avatar {
  48. width: 80rpx;
  49. height: 80rpx;
  50. border-radius: 50%;
  51. border: #fff solid 1px;
  52. }
  53. .chat-box .chat-list .chat-item .content-box {
  54. flex: 1;
  55. width: 0;
  56. display: flex;
  57. }
  58. .chat-box .chat-list .chat-item .image-box {
  59. border-radius: 16rpx;
  60. padding-bottom: 4rpx;
  61. }
  62. .chat-box .chat-list .chat-item .image-width {
  63. width: 280rpx;
  64. height: 200rpx;
  65. }
  66. .chat-box .chat-list .chat-item .image-height {
  67. width: 200rpx;
  68. height: 280rpx;
  69. }
  70. .chat-box .chat-list .chat-item .image-width-height {
  71. width: 200rpx;
  72. height: 200rpx;
  73. }
  74. .chat-box .chat-list .chat-item .content {
  75. padding: 20rpx 30rpx;
  76. border-radius: 16rpx;
  77. word-break: break-all;
  78. line-height: 42rpx;
  79. position: relative;
  80. font-weight: 300;
  81. }
  82. .chat-box .chat-list .chat-item.pull .content-box {
  83. margin-right: 100rpx;
  84. }
  85. .chat-box .chat-list .chat-item.pull .image-box {
  86. margin-left: 20rpx;
  87. }
  88. .chat-box .chat-list .chat-item.pull .content {
  89. margin-left: 20rpx;
  90. background-color: #fff;
  91. }
  92. .chat-box .chat-list .chat-item.pull .date {
  93. left: 124rpx;
  94. }
  95. .chat-box .chat-list .chat-item.push {
  96. /* 主轴为水平方向,起点在右端。使不修改DOM结构,也能改变元素排列顺序 */
  97. flex-direction: row-reverse;
  98. }
  99. .chat-box .chat-list .chat-item.push .content-box {
  100. flex-direction: row-reverse;
  101. margin-left: 100rpx;
  102. }
  103. .chat-box .chat-list .chat-item.push .image-box {
  104. margin-right: 20rpx;
  105. }
  106. .chat-box .chat-list .chat-item.push .content {
  107. margin-right: 20rpx;
  108. background-color: #08979c;
  109. color: #fff;
  110. box-shadow: 0px 1px 12px rgba(3, 3, 3, 0.08);
  111. }
  112. .chat-box .chat-list .chat-item.push .date {
  113. right: 124rpx;
  114. }
  115. .chat-box .chat-submit {
  116. position: fixed;
  117. left: 0;
  118. width: 100%;
  119. bottom: 0;
  120. height: 100rpx;
  121. z-index: 2;
  122. background-color: #fff;
  123. box-shadow: 0px 2px 10px rgba(3, 3, 3, 0.1);
  124. /* 兼容iPhoneX */
  125. padding-bottom: 0;
  126. padding-bottom: constant(safe-area-inset-bottom);
  127. padding-bottom: env(safe-area-inset-bottom);
  128. display: flex;
  129. align-items: center;
  130. }
  131. .chat-box .chat-submit .message-content {
  132. flex: 1;
  133. margin: 0 30rpx;
  134. border: 1px solid #d9d9d9;
  135. border-radius: 68rpx;
  136. height: 68rpx;
  137. padding: 0 20rpx;
  138. }
  139. .chat-box .chat-submit .message-placeholder {
  140. color: #8c8c8c;
  141. font-weight: 300;
  142. }
  143. .chat-box .chat-submit .send-button {
  144. width: 68rpx;
  145. height: 68rpx;
  146. border-radius: 50%;
  147. display: flex;
  148. align-items: center;
  149. justify-content: center;
  150. }
  151. .chat-box .chat-submit .send-button.send-image {
  152. border: 1px solid #d9d9d9;
  153. margin-right: 20rpx;
  154. }
  155. .chat-box .chat-submit .send-button.send-submit {
  156. background: #08979c;
  157. margin-right: 30rpx;
  158. }