chat-box.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711
  1. <template>
  2. <view class="page chat-box">
  3. <view class="header">
  4. <uni-icons class="btn-side left" type="back" size="30" @click="onNavBack()"></uni-icons>
  5. <text class="title">{{title}}</text>
  6. <uni-icons class="btn-side right" type="more-filled" size="30" @click="onShowMore()"></uni-icons>
  7. </view>
  8. <view class="chat-msg" @click="switchChatTabBox('none',true)">
  9. <scroll-view class="scroll-box" scroll-y="true" @scrolltoupper="onScrollToTop"
  10. :scroll-into-view="'chat-item-'+scrollMsgIdx">
  11. <view v-for="(msgInfo,idx) in chat.messages" :key="idx">
  12. <chat-message-item v-if="idx>=showMinIdx" :headImage="headImage(msgInfo)"
  13. :showName="showName(msgInfo)" @recall="onRecallMessage" @delete="onDeleteMessage"
  14. @longPressHead="onLongPressHead(msgInfo)"
  15. @download="onDownloadFile" :id="'chat-item-'+idx" :msgInfo="msgInfo">
  16. </chat-message-item>
  17. </view>
  18. </scroll-view>
  19. </view>
  20. <view v-if="atUserIds.length>0" class="chat-at-bar" @click="openAtBox()">
  21. <view class="iconfont icon-at">:&nbsp;</view>
  22. <scroll-view v-if="atUserIds.length>0" class="chat-at-scroll-box" scroll-x="true" scroll-left="120">
  23. <view class="chat-at-items">
  24. <view v-for="m in atUserItems" class="chat-at-item">
  25. <head-image :name="m.aliasName" :url="m.headImage" :size="50"></head-image>
  26. </view>
  27. </view>
  28. </scroll-view>
  29. </view>
  30. <view class="send-bar">
  31. <view class="send-text">
  32. <textarea class="send-text-area" v-model="sendText" auto-height :show-confirm-bar="false"
  33. :adjust-position="false" @confirm="sendTextMessage()" @keyboardheightchange="onKeyboardheightchange"
  34. confirm-type="send" confirm-hold :hold-keyboard="true"></textarea>
  35. </view>
  36. <view v-if="chat.type=='GROUP'" class="iconfont icon-at" @click="openAtBox()"></view>
  37. <view class="iconfont icon-icon_emoji" @click="switchChatTabBox('emo',true)"></view>
  38. <view v-if="sendText==''" class="iconfont icon-add" @click="switchChatTabBox('tools',true)">
  39. </view>
  40. <button v-if="sendText!=''||atUserIds.length>0" class="btn-send" type="primary" @touchend.prevent="sendTextMessage()"
  41. size="mini">发送</button>
  42. </view>
  43. <view class="chat-tab-bar" v-show="chatTabBox!='none' ||showKeyBoard " :style="{height:`${keyboardHeight}px`}">
  44. <view v-if="chatTabBox == 'tools'" class="chat-tools">
  45. <view class="chat-tools-item">
  46. <image-upload :maxCount="9" sourceType="album" :onBefore="onUploadImageBefore"
  47. :onSuccess="onUploadImageSuccess" :onError="onUploadImageFail">
  48. <view class="tool-icon iconfont icon-picture"></view>
  49. </image-upload>
  50. <view class="tool-name">相册</view>
  51. </view>
  52. <view class="chat-tools-item">
  53. <image-upload sourceType="camera" :onBefore="onUploadImageBefore" :onSuccess="onUploadImageSuccess"
  54. :onError="onUploadImageFail">
  55. <view class="tool-icon iconfont icon-camera"></view>
  56. </image-upload>
  57. <view class="tool-name">拍摄</view>
  58. </view>
  59. <view class="chat-tools-item">
  60. <file-upload :onBefore="onUploadFileBefore" :onSuccess="onUploadFileSuccess"
  61. :onError="onUploadFileFail">
  62. <view class="tool-icon iconfont icon-folder"></view>
  63. </file-upload>
  64. <view class="tool-name">文件</view>
  65. </view>
  66. <view class="chat-tools-item" @click="showTip()">
  67. <view class="tool-icon iconfont icon-microphone"></view>
  68. <view class="tool-name">语音输入</view>
  69. </view>
  70. <view class="chat-tools-item" @click="showTip()">
  71. <view class="tool-icon iconfont icon-call"></view>
  72. <view class="tool-name">呼叫</view>
  73. </view>
  74. </view>
  75. <scroll-view v-if="chatTabBox==='emo'" class="chat-emotion" scroll-y="true">
  76. <view class="emotion-item-list">
  77. <image class="emotion-item" :title="emoText" :src="$emo.textToPath(emoText)"
  78. v-for="(emoText, i) in $emo.emoTextList" :key="i" @click="selectEmoji(emoText)" mode="aspectFit"
  79. lazy-load="true"></image>
  80. </view>
  81. </scroll-view>
  82. <view v-if="showKeyBoard"></view>
  83. </view>
  84. <chat-at-box ref="atBox" :ownerId="group.ownerId" :members="groupMembers"
  85. @complete="onAtComplete"></chat-at-box>
  86. </view>
  87. </template>
  88. <script>
  89. export default {
  90. data() {
  91. return {
  92. chat: {},
  93. friend: {},
  94. group: {},
  95. groupMembers: [],
  96. sendText: "",
  97. showVoice: false, // 是否显示语音录制弹窗
  98. scrollMsgIdx: 0, // 滚动条定位为到哪条消息
  99. chatTabBox: 'none',
  100. showKeyBoard: false,
  101. keyboardHeight: 322,
  102. atUserIds: [],
  103. showMinIdx: 0 // 下标小于showMinIdx的消息不显示,否则可能很卡
  104. }
  105. },
  106. methods: {
  107. showTip() {
  108. uni.showToast({
  109. title: "加班开发中...",
  110. icon: "none"
  111. })
  112. },
  113. openAtBox() {
  114. this.$refs.atBox.init(this.atUserIds);
  115. this.$refs.atBox.open();
  116. },
  117. onAtComplete(atUserIds) {
  118. this.atUserIds = atUserIds;
  119. },
  120. onLongPressHead(msgInfo){
  121. if(!msgInfo.selfSend && this.chat.type=="GROUP" && this.atUserIds.indexOf(msgInfo.sendId)<0){
  122. this.atUserIds.push(msgInfo.sendId);
  123. }
  124. },
  125. headImage(msgInfo) {
  126. if (this.chat.type == 'GROUP') {
  127. let member = this.groupMembers.find((m) => m.userId == msgInfo.sendId);
  128. return member ? member.headImage : "";
  129. } else {
  130. return msgInfo.selfSend ? this.mine.headImageThumb : this.chat.headImage
  131. }
  132. },
  133. showName(msgInfo) {
  134. if (this.chat.type == 'GROUP') {
  135. let member = this.groupMembers.find((m) => m.userId == msgInfo.sendId);
  136. return member ? member.aliasName : "";
  137. } else {
  138. return msgInfo.selfSend ? this.mine.nickName : this.chat.showName
  139. }
  140. },
  141. sendTextMessage() {
  142. if (!this.sendText.trim() && this.atUserIds.length==0) {
  143. return uni.showToast({
  144. title: "不能发送空白信息",
  145. icon: "none"
  146. });
  147. }
  148. let atText = this.createAtText()
  149. let msgInfo = {
  150. content: this.sendText + atText,
  151. atUserIds: this.atUserIds,
  152. type: 0
  153. }
  154. // 填充对方id
  155. this.fillTargetId(msgInfo, this.chat.targetId);
  156. this.sendText = "";
  157. this.$http({
  158. url: this.messageAction,
  159. method: 'POST',
  160. data: msgInfo
  161. }).then((id) => {
  162. msgInfo.id = id;
  163. msgInfo.sendTime = new Date().getTime();
  164. msgInfo.sendId = this.$store.state.userStore.userInfo.id;
  165. msgInfo.selfSend = true;
  166. msgInfo.status = this.$enums.MESSAGE_STATUS.UNSEND;
  167. this.$store.commit("insertMessage", msgInfo);
  168. this.sendText = "";
  169. }).finally(() => {
  170. // 滚动到底部
  171. this.scrollToBottom();
  172. // 清空@用户列表
  173. this.atUserIds = [];
  174. });
  175. },
  176. createAtText() {
  177. let atText = "";
  178. this.atUserIds.forEach((id) => {
  179. let member = this.groupMembers.find((m)=>m.userId==id);
  180. if (member) {
  181. atText += ` @${member.aliasName}`;
  182. }
  183. })
  184. return atText;
  185. },
  186. fillTargetId(msgInfo, targetId) {
  187. if (this.chat.type == "GROUP") {
  188. msgInfo.groupId = targetId;
  189. } else {
  190. msgInfo.recvId = targetId;
  191. }
  192. },
  193. scrollToBottom() {
  194. let size = this.chat.messages.length;
  195. if (size > 0) {
  196. this.scrollToMsgIdx(size - 1);
  197. }
  198. },
  199. scrollToMsgIdx(idx) {
  200. // 如果scrollMsgIdx值没变化,滚动条不会移动
  201. if (idx == this.scrollMsgIdx && idx > 0) {
  202. this.$nextTick(() => {
  203. // 先滚动到上一条
  204. this.scrollMsgIdx = idx - 1;
  205. // 再滚动目标位置
  206. this.scrollToMsgIdx(idx);
  207. });
  208. return;
  209. }
  210. this.$nextTick(() => {
  211. console.log("scrollToMsgIdx", this.scrollMsgIdx)
  212. this.scrollMsgIdx = idx;
  213. });
  214. },
  215. switchChatTabBox(chatTabBox, hideKeyBoard) {
  216. this.chatTabBox = chatTabBox;
  217. if (hideKeyBoard) {
  218. uni.hideKeyboard();
  219. }
  220. },
  221. selectEmoji(emoText) {
  222. this.sendText += `#${emoText};`;
  223. },
  224. onNavBack() {
  225. uni.switchTab({
  226. url: "/pages/chat/chat"
  227. })
  228. },
  229. onKeyboardheightchange(e) {
  230. if (e.detail.height > 0) {
  231. this.showKeyBoard = true;
  232. this.switchChatTabBox('none', false)
  233. this.keyboardHeight = this.rpxTopx(e.detail.height);
  234. } else {
  235. this.showKeyBoard = false;
  236. }
  237. },
  238. onUploadImageBefore(file) {
  239. let data = {
  240. originUrl: file.path,
  241. thumbUrl: file.path
  242. }
  243. let msgInfo = {
  244. id: 0,
  245. fileId: file.uid,
  246. sendId: this.mine.id,
  247. content: JSON.stringify(data),
  248. sendTime: new Date().getTime(),
  249. selfSend: true,
  250. type: this.$enums.MESSAGE_TYPE.IMAGE,
  251. loadStatus: "loading",
  252. status: this.$enums.MESSAGE_STATUS.UNSEND
  253. }
  254. // 填充对方id
  255. this.fillTargetId(msgInfo, this.chat.targetId);
  256. // 插入消息
  257. this.$store.commit("insertMessage", msgInfo);
  258. // 借助file对象保存
  259. file.msgInfo = msgInfo;
  260. // 滚到最低部
  261. this.scrollToBottom();
  262. return true;
  263. },
  264. onUploadImageSuccess(file, res) {
  265. let msgInfo = JSON.parse(JSON.stringify(file.msgInfo));
  266. msgInfo.content = JSON.stringify(res.data);
  267. this.$http({
  268. url: this.messageAction,
  269. method: 'POST',
  270. data: msgInfo
  271. }).then((id) => {
  272. msgInfo.loadStatus = 'ok';
  273. msgInfo.id = id;
  274. this.$store.commit("insertMessage", msgInfo);
  275. })
  276. },
  277. onUploadImageFail(file, err) {
  278. let msgInfo = JSON.parse(JSON.stringify(file.msgInfo));
  279. msgInfo.loadStatus = 'fail';
  280. this.$store.commit("insertMessage", msgInfo);
  281. },
  282. onUploadFileBefore(file) {
  283. let data = {
  284. name: file.name,
  285. size: file.size,
  286. url: file.path
  287. }
  288. let msgInfo = {
  289. id: 0,
  290. sendId: this.mine.id,
  291. content: JSON.stringify(data),
  292. sendTime: new Date().getTime(),
  293. selfSend: true,
  294. type: this.$enums.MESSAGE_TYPE.FILE,
  295. loadStatus: "loading",
  296. status: this.$enums.MESSAGE_STATUS.UNSEND
  297. }
  298. // 填充对方id
  299. this.fillTargetId(msgInfo, this.chat.targetId);
  300. // 插入消息
  301. this.$store.commit("insertMessage", msgInfo);
  302. // 借助file对象保存
  303. file.msgInfo = msgInfo;
  304. // 滚到最低部
  305. this.scrollToBottom();
  306. return true;
  307. },
  308. onUploadFileSuccess(file, res) {
  309. let data = {
  310. name: file.name,
  311. size: file.size,
  312. url: res.data
  313. }
  314. let msgInfo = JSON.parse(JSON.stringify(file.msgInfo));
  315. msgInfo.content = JSON.stringify(data);
  316. this.$http({
  317. url: this.messageAction,
  318. method: 'POST',
  319. data: msgInfo
  320. }).then((id) => {
  321. msgInfo.loadStatus = 'ok';
  322. msgInfo.id = id;
  323. this.$store.commit("insertMessage", msgInfo);
  324. })
  325. },
  326. onUploadFileFail(file, res) {
  327. let msgInfo = JSON.parse(JSON.stringify(file.msgInfo));
  328. msgInfo.loadStatus = 'fail';
  329. this.$store.commit("insertMessage", msgInfo);
  330. },
  331. onDeleteMessage(msgInfo) {
  332. uni.showModal({
  333. title: '删除消息',
  334. content: '确认删除消息?',
  335. success: (res) => {
  336. if (!res.cancel) {
  337. this.$store.commit("deleteMessage", msgInfo);
  338. uni.showToast({
  339. title: "删除成功",
  340. icon: "none"
  341. })
  342. }
  343. }
  344. })
  345. },
  346. onRecallMessage(msgInfo) {
  347. uni.showModal({
  348. title: '撤回消息',
  349. content: '确认撤回消息?',
  350. success: (res) => {
  351. if (!res.cancel) {
  352. let url = `/message/${this.chat.type.toLowerCase()}/recall/${msgInfo.id}`
  353. this.$http({
  354. url: url,
  355. method: 'DELETE'
  356. }).then(() => {
  357. msgInfo = JSON.parse(JSON.stringify(msgInfo));
  358. msgInfo.type = this.$enums.MESSAGE_TYPE.RECALL;
  359. msgInfo.content = '你撤回了一条消息';
  360. msgInfo.status = this.$enums.MESSAGE_STATUS.RECALL;
  361. this.$store.commit("insertMessage", msgInfo);
  362. })
  363. }
  364. }
  365. })
  366. },
  367. onDownloadFile(msgInfo) {
  368. let url = JSON.parse(msgInfo.content).url;
  369. uni.downloadFile({
  370. url: url,
  371. success(res) {
  372. if (res.statusCode === 200) {
  373. var filePath = encodeURI(res.tempFilePath);
  374. uni.openDocument({
  375. filePath: filePath,
  376. showMenu: true
  377. });
  378. }
  379. },
  380. fail(e) {
  381. console.log(e);
  382. uni.showToast({
  383. title: "文件下载失败",
  384. icon: "none"
  385. })
  386. }
  387. });
  388. },
  389. onScrollToTop() {
  390. // #ifdef MP
  391. // 防止滚动条定格在顶部,不能一直往上滚
  392. this.scrollToMsgIdx(this.showMinIdx);
  393. // #endif
  394. // 多展示10条信息
  395. this.showMinIdx = this.showMinIdx > 10 ? this.showMinIdx - 10 : 0;
  396. },
  397. onShowMore() {
  398. if (this.chat.type == "GROUP") {
  399. uni.navigateTo({
  400. url: "/pages/group/group-info?id=" + this.group.id
  401. })
  402. } else {
  403. uni.navigateTo({
  404. url: "/pages/common/user-info?id=" + this.friend.id
  405. })
  406. }
  407. },
  408. readedMessage() {
  409. if (this.chat.type == "GROUP") {
  410. var url = `/message/group/readed?groupId=${this.chat.targetId}`
  411. } else {
  412. url = `/message/private/readed?friendId=${this.chat.targetId}`
  413. }
  414. this.$http({
  415. url: url,
  416. method: 'PUT'
  417. }).then(() => {
  418. this.$store.commit("resetUnreadCount", this.chat)
  419. this.scrollToBottom();
  420. })
  421. },
  422. loadGroup(groupId) {
  423. this.$http({
  424. url: `/group/find/${groupId}`,
  425. method: 'GET'
  426. }).then((group) => {
  427. this.group = group;
  428. this.$store.commit("updateChatFromGroup", group);
  429. this.$store.commit("updateGroup", group);
  430. });
  431. this.$http({
  432. url: `/group/members/${groupId}`,
  433. method: 'get'
  434. }).then((groupMembers) => {
  435. this.groupMembers = groupMembers;
  436. });
  437. },
  438. loadFriend(friendId) {
  439. // 获取对方最新信息
  440. this.$http({
  441. url: `/user/find/${friendId}`,
  442. method: 'GET'
  443. }).then((friend) => {
  444. this.friend = friend;
  445. this.$store.commit("updateChatFromFriend", friend);
  446. this.$store.commit("updateFriend", friend);
  447. })
  448. },
  449. rpxTopx(rpx) {
  450. // px转换成rpx
  451. let info = uni.getSystemInfoSync()
  452. let px = info.windowWidth * rpx / 750;
  453. return Math.floor(rpx);
  454. }
  455. },
  456. computed: {
  457. mine() {
  458. return this.$store.state.userStore.userInfo;
  459. },
  460. title() {
  461. if (!this.chat) {
  462. return "";
  463. }
  464. let title = this.chat.showName;
  465. if (this.chat.type == "GROUP") {
  466. let size = this.groupMembers.filter(m => !m.quit).length;
  467. title += `(${size})`;
  468. }
  469. return title;
  470. },
  471. messageAction() {
  472. return `/message/${this.chat.type.toLowerCase()}/send`;
  473. },
  474. messageSize() {
  475. if (!this.chat || !this.chat.messages) {
  476. return 0;
  477. }
  478. return this.chat.messages.length;
  479. },
  480. unreadCount() {
  481. return this.chat.unreadCount;
  482. },
  483. atUserItems(){
  484. let atUsers = [];
  485. this.atUserIds.forEach((id)=>{
  486. if(id==-1){
  487. atUsers.push({id:-1,aliasName:"全体成员"})
  488. return;
  489. }
  490. let member = this.groupMembers.find((m)=>m.userId==id);
  491. if(member){
  492. atUsers.push(member);
  493. }
  494. })
  495. return atUsers;
  496. }
  497. },
  498. watch: {
  499. messageSize: function(newSize, oldSize) {
  500. // 接收到消息时滚动到底部
  501. if (newSize > oldSize) {
  502. this.scrollToBottom();
  503. }
  504. },
  505. unreadCount: {
  506. handler(newCount, oldCount) {
  507. if (newCount > 0) {
  508. // 消息已读
  509. this.readedMessage()
  510. }
  511. }
  512. }
  513. },
  514. onLoad(options) {
  515. // 聊天数据
  516. this.chat = this.$store.state.chatStore.chats[options.chatIdx];
  517. // 初始状态只显示30条消息
  518. let size = this.chat.messages.length;
  519. this.showMinIdx = size > 30 ? size - 30 : 0;
  520. // 激活当前会话
  521. this.$store.commit("activeChat", options.chatIdx);
  522. // 页面滚到底部
  523. this.scrollToBottom();
  524. // 消息已读
  525. this.readedMessage()
  526. // 加载好友或群聊信息
  527. if (this.chat.type == "GROUP") {
  528. this.loadGroup(this.chat.targetId);
  529. } else {
  530. this.loadFriend(this.chat.targetId);
  531. }
  532. },
  533. onUnload() {
  534. this.$store.commit("activeChat", -1);
  535. }
  536. }
  537. </script>
  538. <style lang="scss" scoped>
  539. .chat-box {
  540. position: relative;
  541. border: #dddddd solid 1px;
  542. display: flex;
  543. flex-direction: column;
  544. .header {
  545. display: flex;
  546. justify-content: center;
  547. align-items: center;
  548. height: 60rpx;
  549. padding: 5px;
  550. background-color: white;
  551. line-height: 50px;
  552. font-size: 40rpx;
  553. font-weight: 600;
  554. border: #dddddd solid 1px;
  555. .btn-side {
  556. position: absolute;
  557. line-height: 60rpx;
  558. font-size: 28rpx;
  559. cursor: pointer;
  560. &.left {
  561. left: 30rpx;
  562. }
  563. &.right {
  564. right: 30rpx;
  565. }
  566. }
  567. }
  568. .chat-msg {
  569. flex: 1;
  570. padding: 0;
  571. border: #dddddd solid 1px;
  572. overflow: hidden;
  573. position: relative;
  574. background-color: #f8f8f8;
  575. .scroll-box {
  576. height: 100%;
  577. }
  578. }
  579. .chat-at-bar {
  580. display: flex;
  581. align-items: center;
  582. padding: 0 10rpx;
  583. border: #dddddd solid 1px;
  584. .icon-at {
  585. font-size: 35rpx;
  586. color: darkblue;
  587. font-weight: 600;
  588. }
  589. .chat-at-scroll-box {
  590. flex: 1;
  591. width: 80%;
  592. .chat-at-items {
  593. display: flex;
  594. align-items: center;
  595. height: 70rpx;
  596. .chat-at-item {
  597. padding: 0 3rpx;
  598. }
  599. }
  600. }
  601. }
  602. .send-bar {
  603. display: flex;
  604. align-items: center;
  605. padding: 10rpx;
  606. margin-bottom: 10rpx;
  607. border: #dddddd solid 1px;
  608. background-color: white;
  609. .iconfont {
  610. font-size: 60rpx;
  611. margin: 3rpx;
  612. }
  613. .send-text {
  614. flex: 1;
  615. background-color: #f8f8f8 !important;
  616. overflow: auto;
  617. padding: 20rpx;
  618. background-color: #fff;
  619. border-radius: 20rpx;
  620. max-height: 300rpx;
  621. min-height: 85rpx;
  622. font-size: 30rpx;
  623. box-sizing: border-box;
  624. .send-text-area {
  625. width: 100%;
  626. }
  627. }
  628. .btn-send {
  629. margin: 5rpx;
  630. }
  631. }
  632. .chat-tab-bar {
  633. height: 500rpx;
  634. padding: 20rpx;
  635. background-color: whitesmoke;
  636. .chat-tools {
  637. display: flex;
  638. flex-wrap: wrap;
  639. justify-content: space-between;
  640. .chat-tools-item {
  641. width: 140rpx;
  642. padding: 15rpx;
  643. display: flex;
  644. flex-direction: column;
  645. align-items: center;
  646. .tool-icon {
  647. padding: 15rpx;
  648. font-size: 80rpx;
  649. background-color: white;
  650. border-radius: 20%;
  651. }
  652. .tool-name {
  653. height: 60rpx;
  654. line-height: 60rpx;
  655. font-size: 25rpx;
  656. }
  657. }
  658. }
  659. .chat-emotion {
  660. height: 100%;
  661. .emotion-item-list {
  662. display: flex;
  663. flex-wrap: wrap;
  664. .emotion-item {
  665. width: 40px;
  666. height: 40px;
  667. text-align: center;
  668. cursor: pointer;
  669. padding: 6px;
  670. }
  671. }
  672. }
  673. }
  674. }
  675. </style>