index.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. <template>
  2. <div class="container">
  3. <div class="chat-bg"></div>
  4. <div class="header-chat">
  5. <svg-icon class="page-icon" name="lf-arrow" @click="goBack"/>
  6. <div class="header-title">群聊(8)</div>
  7. <svg-icon class="page-icon" name="more" @click="goDetail"/>
  8. </div>
  9. <div class="chat-list">
  10. <div v-for="(item,index) in 2">
  11. <div class="chat-time">23:{{ 20+index }}</div>
  12. <div class="box" v-for="(text,i) in 10">
  13. <div class="list-item" :class="i % 2 === 0 ? '' : 'flex-reverse'">
  14. <van-image class="list-img" :class="i % 2 === 0 ? 'mr12' : 'ml12'" round src="https://fastly.jsdelivr.net/npm/@vant/assets/cat.jpeg"/>
  15. <div class="list-cont">
  16. <div :class="i % 2 === 0 ? '' : 'text-right'">苏苏编号</div>
  17. <!-- 名片 -->
  18. <div class="business-card" v-if="i % 2 === 0">
  19. <div class="business-card-cont">
  20. <van-image class="list-img mr12" round src="https://fastly.jsdelivr.net/npm/@vant/assets/cat.jpeg"/>
  21. <div>名字名字</div>
  22. </div>
  23. <div class="line"></div>
  24. <div class="business-card-text">个人名片</div>
  25. </div>
  26. <!-- 文本信息 -->
  27. <div class="content" v-if="i % 2 !== 0">文本信息文本信息文本信息文本信息文本信息文本信息文本信息文本信息</div>
  28. </div>
  29. </div>
  30. <!--消息撤回 -->
  31. <div class="withdrawal">
  32. <div class="withdrawal-text">哈哈哈撤回了一条消息</div>
  33. </div>
  34. </div>
  35. </div>
  36. </div>
  37. <!-- 输入框 -->
  38. <div class="page-foot">
  39. <div class="flex-box">
  40. <svg-icon class="page-icon" name="voice" />
  41. <van-field
  42. rows="1"
  43. type="textarea"
  44. :border="false"
  45. autosize class="input" v-model="text" placeholder="输入文本"
  46. />
  47. <svg-icon class="page-icon mr12" name="emoji" />
  48. <svg-icon class="page-icon" name="add2" />
  49. </div>
  50. </div>
  51. </div>
  52. </template>
  53. <script setup>
  54. import { useRouter } from 'vue-router'
  55. const router = useRouter();
  56. const text = ref('')
  57. const goBack = () => {
  58. router.push('im')
  59. }
  60. const goDetail = () => {
  61. router.push('detail')
  62. }
  63. </script>
  64. <style lang="less" scoped>
  65. .mr12{
  66. margin-right: 12px;
  67. }
  68. .ml12{
  69. margin-left: 12px;
  70. }
  71. .text-right{
  72. text-align: right;
  73. }
  74. .page-icon{
  75. width: 24px;
  76. height: 24px;
  77. flex-shrink: 0;
  78. }
  79. .container{
  80. height: 100vh;
  81. display: flex;
  82. flex-direction: column;
  83. .chat-bg{
  84. height: 126px;
  85. background: linear-gradient( 90deg, @theme-color1 0%, #40A4FB 100%);
  86. position: absolute;
  87. left: 0;
  88. right: 0;
  89. z-index: -1;
  90. }
  91. .header-chat{
  92. padding-top: 56px;
  93. margin: 0 16px;
  94. display: flex;
  95. align-items: center;
  96. color: @theme-color1;
  97. .header-title{
  98. flex: 1;
  99. font-family: PingFang SC, PingFang SC;
  100. font-weight: 500;
  101. font-size: 19px;
  102. color: #FFFFFF;
  103. text-align: center;
  104. }
  105. }
  106. .chat-list{
  107. background: #F7F8FA;
  108. border-radius: 30px 30px 0 0;
  109. flex: 1;
  110. overflow: auto;
  111. margin-top: 20px;
  112. padding:0 16px 24px;
  113. .chat-time{
  114. font-family: PingFang SC, PingFang SC;
  115. font-weight: 400;
  116. font-size: 12px;
  117. color: #8D8D8D;
  118. text-align: center;
  119. margin: 20px 0;
  120. }
  121. .box{
  122. .list-item{
  123. display: flex;
  124. margin-bottom: 24px;
  125. .list-img{
  126. width: 44px;
  127. height: 44px;
  128. flex-shrink: 0;
  129. }
  130. .list-cont{
  131. font-family: PingFang SC, PingFang SC;
  132. font-weight: 400;
  133. font-size: 12px;
  134. color: #8D8D8D;
  135. .business-card{
  136. width: 199px;
  137. height: 93px;
  138. background: #FFFFFF;
  139. border-radius: 10px;
  140. margin-top: 8px;
  141. padding: 10px;
  142. box-sizing: border-box;
  143. .business-card-cont{
  144. display: flex;
  145. align-items: center;
  146. font-family: PingFang SC, PingFang SC;
  147. font-weight: 400;
  148. font-size: 15px;
  149. color: #000000;
  150. }
  151. .line{
  152. height: 1px;
  153. background: #F2F2F2;
  154. margin: 10px 0 6px;
  155. }
  156. .business-card-text{
  157. font-family: PingFang SC, PingFang SC;
  158. font-weight: 400;
  159. font-size: 10px;
  160. color: #8D8D8D;
  161. }
  162. }
  163. .content{
  164. max-width: 230px;
  165. background: #4D71FF;
  166. border-radius: 10px;
  167. margin-top: 8px;
  168. padding: 8px 17px;
  169. font-family: PingFang SC, PingFang SC;
  170. font-weight: 400;
  171. font-size: 15px;
  172. color: #FFFFFF;
  173. }
  174. }
  175. }
  176. .withdrawal{
  177. display: flex;
  178. justify-content: center;
  179. margin-bottom: 24px;
  180. .withdrawal-text{
  181. width: 142px;
  182. height: 29px;
  183. line-height: 29px;
  184. box-sizing: border-box;
  185. background: #F2F2F2;
  186. border-radius: 4px;
  187. font-family: PingFang SC, PingFang SC;
  188. font-weight: 400;
  189. font-size: 12px;
  190. color: #8D8D8D;
  191. text-align: center;
  192. }
  193. }
  194. .flex-reverse{
  195. flex-direction: row-reverse;
  196. }
  197. }
  198. }
  199. .chat-list::-webkit-scrollbar{
  200. width: 0;
  201. }
  202. .page-foot{
  203. position: relative;
  204. background-color: #fff;
  205. .flex-box {
  206. padding: 8px 16px;
  207. display: flex;
  208. align-items: center;
  209. box-sizing: border-box;
  210. .input{
  211. flex: 1;
  212. background: #F2F2F2;
  213. border-radius: 17px;
  214. border: 1px solid #D8D8D8;
  215. padding: 6px 16px;
  216. font-weight: 500;
  217. font-size: 15px;
  218. margin: 0 12px;
  219. overflow-y: auto;
  220. }
  221. }
  222. }
  223. }
  224. </style>