chat.wxss 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  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 20rpx 0 20rpx;
  35. align-items: flex-start;
  36. align-content: flex-start;
  37. /* 收到的消息 */
  38. /* 发出的消息 */
  39. }
  40. .chat-box .chat-list .chat-item .avatar {
  41. width: 80rpx;
  42. height: 80rpx;
  43. border-radius: 50%;
  44. border: #fff solid 1px;
  45. }
  46. .chat-box .chat-list .chat-item .content-box {
  47. flex: 1;
  48. width: 0;
  49. display: flex;
  50. }
  51. .chat-box .chat-list .chat-item .image-box {
  52. border-radius: 16rpx;
  53. }
  54. .chat-box .chat-list .chat-item .image-width {
  55. width: 280rpx;
  56. height: 200rpx;
  57. }
  58. .chat-box .chat-list .chat-item .image-height {
  59. width: 200rpx;
  60. height: 280rpx;
  61. }
  62. .chat-box .chat-list .chat-item .image-width-height {
  63. width: 200rpx;
  64. height: 200rpx;
  65. }
  66. .chat-box .chat-list .chat-item .content {
  67. padding: 20rpx 30rpx;
  68. border-radius: 16rpx;
  69. word-break: break-all;
  70. line-height: 42rpx;
  71. position: relative;
  72. font-weight: 300;
  73. }
  74. .chat-box .chat-list .chat-item.pull .content-box {
  75. margin-right: 100rpx;
  76. }
  77. .chat-box .chat-list .chat-item.pull .image-box {
  78. margin-left: 20rpx;
  79. }
  80. .chat-box .chat-list .chat-item.pull .content {
  81. margin-left: 20rpx;
  82. background-color: #fff;
  83. }
  84. .chat-box .chat-list .chat-item.push {
  85. /* 主轴为水平方向,起点在右端。使不修改DOM结构,也能改变元素排列顺序 */
  86. flex-direction: row-reverse;
  87. }
  88. .chat-box .chat-list .chat-item.push .content-box {
  89. flex-direction: row-reverse;
  90. margin-left: 100rpx;
  91. }
  92. .chat-box .chat-list .chat-item.push .image-box {
  93. margin-right: 20rpx;
  94. }
  95. .chat-box .chat-list .chat-item.push .content {
  96. margin-right: 20rpx;
  97. background-color: #08979c;
  98. color: #fff;
  99. box-shadow: 0px 1px 12px rgba(3, 3, 3, 0.08);
  100. }
  101. .chat-box .chat-submit {
  102. position: fixed;
  103. left: 0;
  104. width: 100%;
  105. bottom: 0;
  106. height: 100rpx;
  107. z-index: 2;
  108. background-color: #fff;
  109. box-shadow: 0px 2px 10px rgba(3, 3, 3, 0.1);
  110. /* 兼容iPhoneX */
  111. padding-bottom: 0;
  112. padding-bottom: constant(safe-area-inset-bottom);
  113. padding-bottom: env(safe-area-inset-bottom);
  114. display: flex;
  115. align-items: center;
  116. }
  117. .chat-box .chat-submit .message-content {
  118. flex: 1;
  119. margin: 0 30rpx;
  120. border: 1px solid #d9d9d9;
  121. border-radius: 68rpx;
  122. height: 68rpx;
  123. padding: 0 20rpx;
  124. }
  125. .chat-box .chat-submit .message-placeholder {
  126. color: #8c8c8c;
  127. font-weight: 300;
  128. }
  129. .chat-box .chat-submit .send-button {
  130. width: 68rpx;
  131. height: 68rpx;
  132. border-radius: 50%;
  133. display: flex;
  134. align-items: center;
  135. justify-content: center;
  136. }
  137. .chat-box .chat-submit .send-button.send-image {
  138. border: 1px solid #d9d9d9;
  139. margin-right: 20rpx;
  140. }
  141. .chat-box .chat-submit .send-button.send-submit {
  142. background: #08979c;
  143. margin-right: 30rpx;
  144. }