chat-box.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715
  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. if(id==-1){
  180. atText += ` @全体成员`;
  181. }else{
  182. let member = this.groupMembers.find((m)=>m.userId==id);
  183. if (member) {
  184. atText += ` @${member.aliasName}`;
  185. }
  186. }
  187. })
  188. return atText;
  189. },
  190. fillTargetId(msgInfo, targetId) {
  191. if (this.chat.type == "GROUP") {
  192. msgInfo.groupId = targetId;
  193. } else {
  194. msgInfo.recvId = targetId;
  195. }
  196. },
  197. scrollToBottom() {
  198. let size = this.chat.messages.length;
  199. if (size > 0) {
  200. this.scrollToMsgIdx(size - 1);
  201. }
  202. },
  203. scrollToMsgIdx(idx) {
  204. // 如果scrollMsgIdx值没变化,滚动条不会移动
  205. if (idx == this.scrollMsgIdx && idx > 0) {
  206. this.$nextTick(() => {
  207. // 先滚动到上一条
  208. this.scrollMsgIdx = idx - 1;
  209. // 再滚动目标位置
  210. this.scrollToMsgIdx(idx);
  211. });
  212. return;
  213. }
  214. this.$nextTick(() => {
  215. console.log("scrollToMsgIdx", this.scrollMsgIdx)
  216. this.scrollMsgIdx = idx;
  217. });
  218. },
  219. switchChatTabBox(chatTabBox, hideKeyBoard) {
  220. this.chatTabBox = chatTabBox;
  221. if (hideKeyBoard) {
  222. uni.hideKeyboard();
  223. }
  224. },
  225. selectEmoji(emoText) {
  226. this.sendText += `#${emoText};`;
  227. },
  228. onNavBack() {
  229. uni.switchTab({
  230. url: "/pages/chat/chat"
  231. })
  232. },
  233. onKeyboardheightchange(e) {
  234. if (e.detail.height > 0) {
  235. this.showKeyBoard = true;
  236. this.switchChatTabBox('none', false)
  237. this.keyboardHeight = this.rpxTopx(e.detail.height);
  238. } else {
  239. this.showKeyBoard = false;
  240. }
  241. },
  242. onUploadImageBefore(file) {
  243. let data = {
  244. originUrl: file.path,
  245. thumbUrl: file.path
  246. }
  247. let msgInfo = {
  248. id: 0,
  249. fileId: file.uid,
  250. sendId: this.mine.id,
  251. content: JSON.stringify(data),
  252. sendTime: new Date().getTime(),
  253. selfSend: true,
  254. type: this.$enums.MESSAGE_TYPE.IMAGE,
  255. loadStatus: "loading",
  256. status: this.$enums.MESSAGE_STATUS.UNSEND
  257. }
  258. // 填充对方id
  259. this.fillTargetId(msgInfo, this.chat.targetId);
  260. // 插入消息
  261. this.$store.commit("insertMessage", msgInfo);
  262. // 借助file对象保存
  263. file.msgInfo = msgInfo;
  264. // 滚到最低部
  265. this.scrollToBottom();
  266. return true;
  267. },
  268. onUploadImageSuccess(file, res) {
  269. let msgInfo = JSON.parse(JSON.stringify(file.msgInfo));
  270. msgInfo.content = JSON.stringify(res.data);
  271. this.$http({
  272. url: this.messageAction,
  273. method: 'POST',
  274. data: msgInfo
  275. }).then((id) => {
  276. msgInfo.loadStatus = 'ok';
  277. msgInfo.id = id;
  278. this.$store.commit("insertMessage", msgInfo);
  279. })
  280. },
  281. onUploadImageFail(file, err) {
  282. let msgInfo = JSON.parse(JSON.stringify(file.msgInfo));
  283. msgInfo.loadStatus = 'fail';
  284. this.$store.commit("insertMessage", msgInfo);
  285. },
  286. onUploadFileBefore(file) {
  287. let data = {
  288. name: file.name,
  289. size: file.size,
  290. url: file.path
  291. }
  292. let msgInfo = {
  293. id: 0,
  294. sendId: this.mine.id,
  295. content: JSON.stringify(data),
  296. sendTime: new Date().getTime(),
  297. selfSend: true,
  298. type: this.$enums.MESSAGE_TYPE.FILE,
  299. loadStatus: "loading",
  300. status: this.$enums.MESSAGE_STATUS.UNSEND
  301. }
  302. // 填充对方id
  303. this.fillTargetId(msgInfo, this.chat.targetId);
  304. // 插入消息
  305. this.$store.commit("insertMessage", msgInfo);
  306. // 借助file对象保存
  307. file.msgInfo = msgInfo;
  308. // 滚到最低部
  309. this.scrollToBottom();
  310. return true;
  311. },
  312. onUploadFileSuccess(file, res) {
  313. let data = {
  314. name: file.name,
  315. size: file.size,
  316. url: res.data
  317. }
  318. let msgInfo = JSON.parse(JSON.stringify(file.msgInfo));
  319. msgInfo.content = JSON.stringify(data);
  320. this.$http({
  321. url: this.messageAction,
  322. method: 'POST',
  323. data: msgInfo
  324. }).then((id) => {
  325. msgInfo.loadStatus = 'ok';
  326. msgInfo.id = id;
  327. this.$store.commit("insertMessage", msgInfo);
  328. })
  329. },
  330. onUploadFileFail(file, res) {
  331. let msgInfo = JSON.parse(JSON.stringify(file.msgInfo));
  332. msgInfo.loadStatus = 'fail';
  333. this.$store.commit("insertMessage", msgInfo);
  334. },
  335. onDeleteMessage(msgInfo) {
  336. uni.showModal({
  337. title: '删除消息',
  338. content: '确认删除消息?',
  339. success: (res) => {
  340. if (!res.cancel) {
  341. this.$store.commit("deleteMessage", msgInfo);
  342. uni.showToast({
  343. title: "删除成功",
  344. icon: "none"
  345. })
  346. }
  347. }
  348. })
  349. },
  350. onRecallMessage(msgInfo) {
  351. uni.showModal({
  352. title: '撤回消息',
  353. content: '确认撤回消息?',
  354. success: (res) => {
  355. if (!res.cancel) {
  356. let url = `/message/${this.chat.type.toLowerCase()}/recall/${msgInfo.id}`
  357. this.$http({
  358. url: url,
  359. method: 'DELETE'
  360. }).then(() => {
  361. msgInfo = JSON.parse(JSON.stringify(msgInfo));
  362. msgInfo.type = this.$enums.MESSAGE_TYPE.RECALL;
  363. msgInfo.content = '你撤回了一条消息';
  364. msgInfo.status = this.$enums.MESSAGE_STATUS.RECALL;
  365. this.$store.commit("insertMessage", msgInfo);
  366. })
  367. }
  368. }
  369. })
  370. },
  371. onDownloadFile(msgInfo) {
  372. let url = JSON.parse(msgInfo.content).url;
  373. uni.downloadFile({
  374. url: url,
  375. success(res) {
  376. if (res.statusCode === 200) {
  377. var filePath = encodeURI(res.tempFilePath);
  378. uni.openDocument({
  379. filePath: filePath,
  380. showMenu: true
  381. });
  382. }
  383. },
  384. fail(e) {
  385. console.log(e);
  386. uni.showToast({
  387. title: "文件下载失败",
  388. icon: "none"
  389. })
  390. }
  391. });
  392. },
  393. onScrollToTop() {
  394. // #ifdef MP
  395. // 防止滚动条定格在顶部,不能一直往上滚
  396. this.scrollToMsgIdx(this.showMinIdx);
  397. // #endif
  398. // 多展示10条信息
  399. this.showMinIdx = this.showMinIdx > 10 ? this.showMinIdx - 10 : 0;
  400. },
  401. onShowMore() {
  402. if (this.chat.type == "GROUP") {
  403. uni.navigateTo({
  404. url: "/pages/group/group-info?id=" + this.group.id
  405. })
  406. } else {
  407. uni.navigateTo({
  408. url: "/pages/common/user-info?id=" + this.friend.id
  409. })
  410. }
  411. },
  412. readedMessage() {
  413. if (this.chat.type == "GROUP") {
  414. var url = `/message/group/readed?groupId=${this.chat.targetId}`
  415. } else {
  416. url = `/message/private/readed?friendId=${this.chat.targetId}`
  417. }
  418. this.$http({
  419. url: url,
  420. method: 'PUT'
  421. }).then(() => {
  422. this.$store.commit("resetUnreadCount", this.chat)
  423. this.scrollToBottom();
  424. })
  425. },
  426. loadGroup(groupId) {
  427. this.$http({
  428. url: `/group/find/${groupId}`,
  429. method: 'GET'
  430. }).then((group) => {
  431. this.group = group;
  432. this.$store.commit("updateChatFromGroup", group);
  433. this.$store.commit("updateGroup", group);
  434. });
  435. this.$http({
  436. url: `/group/members/${groupId}`,
  437. method: 'get'
  438. }).then((groupMembers) => {
  439. this.groupMembers = groupMembers;
  440. });
  441. },
  442. loadFriend(friendId) {
  443. // 获取对方最新信息
  444. this.$http({
  445. url: `/user/find/${friendId}`,
  446. method: 'GET'
  447. }).then((friend) => {
  448. this.friend = friend;
  449. this.$store.commit("updateChatFromFriend", friend);
  450. this.$store.commit("updateFriend", friend);
  451. })
  452. },
  453. rpxTopx(rpx) {
  454. // px转换成rpx
  455. let info = uni.getSystemInfoSync()
  456. let px = info.windowWidth * rpx / 750;
  457. return Math.floor(rpx);
  458. }
  459. },
  460. computed: {
  461. mine() {
  462. return this.$store.state.userStore.userInfo;
  463. },
  464. title() {
  465. if (!this.chat) {
  466. return "";
  467. }
  468. let title = this.chat.showName;
  469. if (this.chat.type == "GROUP") {
  470. let size = this.groupMembers.filter(m => !m.quit).length;
  471. title += `(${size})`;
  472. }
  473. return title;
  474. },
  475. messageAction() {
  476. return `/message/${this.chat.type.toLowerCase()}/send`;
  477. },
  478. messageSize() {
  479. if (!this.chat || !this.chat.messages) {
  480. return 0;
  481. }
  482. return this.chat.messages.length;
  483. },
  484. unreadCount() {
  485. return this.chat.unreadCount;
  486. },
  487. atUserItems(){
  488. let atUsers = [];
  489. this.atUserIds.forEach((id)=>{
  490. if(id==-1){
  491. atUsers.push({id:-1,aliasName:"全体成员"})
  492. return;
  493. }
  494. let member = this.groupMembers.find((m)=>m.userId==id);
  495. if(member){
  496. atUsers.push(member);
  497. }
  498. })
  499. return atUsers;
  500. }
  501. },
  502. watch: {
  503. messageSize: function(newSize, oldSize) {
  504. // 接收到消息时滚动到底部
  505. if (newSize > oldSize) {
  506. this.scrollToBottom();
  507. }
  508. },
  509. unreadCount: {
  510. handler(newCount, oldCount) {
  511. if (newCount > 0) {
  512. // 消息已读
  513. this.readedMessage()
  514. }
  515. }
  516. }
  517. },
  518. onLoad(options) {
  519. // 聊天数据
  520. this.chat = this.$store.state.chatStore.chats[options.chatIdx];
  521. // 初始状态只显示30条消息
  522. let size = this.chat.messages.length;
  523. this.showMinIdx = size > 30 ? size - 30 : 0;
  524. // 激活当前会话
  525. this.$store.commit("activeChat", options.chatIdx);
  526. // 页面滚到底部
  527. this.scrollToBottom();
  528. // 消息已读
  529. this.readedMessage()
  530. // 加载好友或群聊信息
  531. if (this.chat.type == "GROUP") {
  532. this.loadGroup(this.chat.targetId);
  533. } else {
  534. this.loadFriend(this.chat.targetId);
  535. }
  536. },
  537. onUnload() {
  538. this.$store.commit("activeChat", -1);
  539. }
  540. }
  541. </script>
  542. <style lang="scss" scoped>
  543. .chat-box {
  544. position: relative;
  545. border: #dddddd solid 1px;
  546. display: flex;
  547. flex-direction: column;
  548. .header {
  549. display: flex;
  550. justify-content: center;
  551. align-items: center;
  552. height: 60rpx;
  553. padding: 5px;
  554. background-color: white;
  555. line-height: 50px;
  556. font-size: 40rpx;
  557. font-weight: 600;
  558. border: #dddddd solid 1px;
  559. .btn-side {
  560. position: absolute;
  561. line-height: 60rpx;
  562. font-size: 28rpx;
  563. cursor: pointer;
  564. &.left {
  565. left: 30rpx;
  566. }
  567. &.right {
  568. right: 30rpx;
  569. }
  570. }
  571. }
  572. .chat-msg {
  573. flex: 1;
  574. padding: 0;
  575. border: #dddddd solid 1px;
  576. overflow: hidden;
  577. position: relative;
  578. background-color: #f8f8f8;
  579. .scroll-box {
  580. height: 100%;
  581. }
  582. }
  583. .chat-at-bar {
  584. display: flex;
  585. align-items: center;
  586. padding: 0 10rpx;
  587. border: #dddddd solid 1px;
  588. .icon-at {
  589. font-size: 35rpx;
  590. color: darkblue;
  591. font-weight: 600;
  592. }
  593. .chat-at-scroll-box {
  594. flex: 1;
  595. width: 80%;
  596. .chat-at-items {
  597. display: flex;
  598. align-items: center;
  599. height: 70rpx;
  600. .chat-at-item {
  601. padding: 0 3rpx;
  602. }
  603. }
  604. }
  605. }
  606. .send-bar {
  607. display: flex;
  608. align-items: center;
  609. padding: 10rpx;
  610. margin-bottom: 10rpx;
  611. border: #dddddd solid 1px;
  612. background-color: white;
  613. .iconfont {
  614. font-size: 60rpx;
  615. margin: 3rpx;
  616. }
  617. .send-text {
  618. flex: 1;
  619. background-color: #f8f8f8 !important;
  620. overflow: auto;
  621. padding: 20rpx;
  622. background-color: #fff;
  623. border-radius: 20rpx;
  624. max-height: 300rpx;
  625. min-height: 85rpx;
  626. font-size: 30rpx;
  627. box-sizing: border-box;
  628. .send-text-area {
  629. width: 100%;
  630. }
  631. }
  632. .btn-send {
  633. margin: 5rpx;
  634. }
  635. }
  636. .chat-tab-bar {
  637. height: 500rpx;
  638. padding: 20rpx;
  639. background-color: whitesmoke;
  640. .chat-tools {
  641. display: flex;
  642. flex-wrap: wrap;
  643. justify-content: space-between;
  644. .chat-tools-item {
  645. width: 140rpx;
  646. padding: 15rpx;
  647. display: flex;
  648. flex-direction: column;
  649. align-items: center;
  650. .tool-icon {
  651. padding: 15rpx;
  652. font-size: 80rpx;
  653. background-color: white;
  654. border-radius: 20%;
  655. }
  656. .tool-name {
  657. height: 60rpx;
  658. line-height: 60rpx;
  659. font-size: 25rpx;
  660. }
  661. }
  662. }
  663. .chat-emotion {
  664. height: 100%;
  665. .emotion-item-list {
  666. display: flex;
  667. flex-wrap: wrap;
  668. .emotion-item {
  669. width: 40px;
  670. height: 40px;
  671. text-align: center;
  672. cursor: pointer;
  673. padding: 6px;
  674. }
  675. }
  676. }
  677. }
  678. }
  679. </style>