cc-comment.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724
  1. <template>
  2. <view>
  3. <view class="c_total">评论 {{ tableTotal }}</view>
  4. <template v-if="dataList && dataList.length">
  5. <view class="c_comment" v-for="(item1, index1) in dataList" :key="item1.id + index1">
  6. <!-- 一级评论 -->
  7. <CommonComp :data="item1" @likeClick="() => likeClick({ item1, index1 })"
  8. @replyClick="() => replyClick({ item1, index1 })"
  9. @deleteClick="() => deleteClick({ item1, index1 })" />
  10. <view class="children_item" v-if="item1.children && item1.children.length">
  11. <!-- 二级评论 -->
  12. <CommonComp v-for="(item2, index2) in item1.childrenShow" :key="item2.id" :data="item2"
  13. :pData="item1" @likeClick="() => likeClick({ item1, index1, item2, index2 })"
  14. @replyClick="() => replyClick({ item1, index1, item2, index2 })"
  15. @deleteClick="() => deleteClick({ item1, index1, item2, index2 })" />
  16. <!-- 展开二级评论 -->
  17. <view class="expand_reply" v-if="expandTxtShow({ item1, index1 })"
  18. @tap="() => expandReplyFun({ item1, index1 })">
  19. <span class="txt"> 展开{{ item1.children.length - item1.childrenShow.length }}条回复 </span>
  20. <uni-icons type="down" size="24" color="#007aff"></uni-icons>
  21. </view>
  22. <!-- 折叠二级评论 -->
  23. <view class="shrink_reply" v-if="shrinkTxtShow({ item1, index1 })"
  24. @tap="() => shrinkReplyFun({ item1, index1 })">
  25. <span class="txt"> 收起回复内容 </span>
  26. <uni-icons type="up" size="24" color="#007aff"></uni-icons>
  27. </view>
  28. </view>
  29. </view>
  30. </template>
  31. <!-- 空盒子 -->
  32. <view class="empty_box" v-else>
  33. <!-- <uni-icons type="chatboxes" size="36" color="#c0c0c0"></uni-icons> -->
  34. <image src="@/static/icon/quexing_01.png" style="width: 380rpx; height: 308rpx;"></image>
  35. <view>
  36. <span class="txt"> 来鼓励一下作者吧~ </span>
  37. <span class="txt click" @click="() => newCommentFun()">说点什么...</span>
  38. </view>
  39. </view>
  40. <!-- 评论弹窗 -->
  41. <uni-popup ref="cPopupRef" type="bottom" @change="popChange">
  42. <view class="c_popup_box">
  43. <view class="reply_text">
  44. <template v-if="Object.keys(replyTemp).length">
  45. <span class="text_aid">回复给</span>
  46. <img class="user_avatar"
  47. :src="replyTemp.item2 ? replyTemp.item2.user_avatar : replyTemp.item1.user_avatar" />
  48. <span class="text_main">{{ replyTemp.item2 ? replyTemp.item2.user_name :
  49. replyTemp.item1.user_name }}</span>
  50. </template>
  51. <span v-else class="text_main">发表新评论</span>
  52. </view>
  53. <view class="content">
  54. <view class="text_area">
  55. <textarea class="textarea" v-model="commentValue" :placeholder="commentPlaceholder"
  56. :focus="focus" maxlength="300" auto-height @focus="onTextareaFocus"
  57. @keydown="handleKeydown"></textarea>
  58. <view class="emoji-trigger" @tap="toggleEmojiPanel">
  59. <text class="fa fa-smile-o"></text>
  60. </view>
  61. </view>
  62. <view class="send_btn" @tap="() => sendClick()">发送</view>
  63. </view>
  64. <!-- 表情面板 -->
  65. <view class="emoji-panel" v-if="showEmojiPanel">
  66. <view class="emoji-grid">
  67. <view class="emoji-item" v-for="(emoji, index) in emojiList" :key="index"
  68. @tap="selectEmoji(emoji)">
  69. {{ emoji }}
  70. </view>
  71. </view>
  72. </view>
  73. </view>
  74. </uni-popup>
  75. <!-- 删除弹窗 -->
  76. <!-- <uni-popup ref="delPopupRef" type="dialog">
  77. <uni-popup-dialog mode="base" title="" content="确定删除这条评论吗?" :before-close="true" @close="delCloseFun"
  78. @confirm="delConfirmFun"></uni-popup-dialog>
  79. </uni-popup> -->
  80. <DialogBox ref="DialogBox"></DialogBox>
  81. </view>
  82. </template>
  83. <script>
  84. import CommonComp from "./componets/common";
  85. import { getStorage, setStorage, removeStorage } from "@/common/util.js";
  86. import { mapState,mapMutations ,mapGetters} from 'vuex';
  87. export default {
  88. components: {
  89. CommonComp
  90. },
  91. computed: {
  92. ...mapState('rightsManagement',['teenageMode'])
  93. },
  94. props: {
  95. /** 登陆用户信息
  96. * id: number // 登陆用户id
  97. * user_name: number // 登陆用户名
  98. * user_avatar: string // 登陆用户头像地址
  99. */
  100. myInfo: {
  101. type: Object,
  102. default: () => { },
  103. },
  104. /** 文章作者信息
  105. * id: number // 文章作者id
  106. * user_name: number // 文章作者名
  107. * user_avatar: string // 文章作者头像地址
  108. */
  109. userInfo: {
  110. type: Object,
  111. default: () => { },
  112. },
  113. /** 评论列表
  114. * id: number // 评论id
  115. * parent_id: number // 父级评论id
  116. * reply_id: number // 被回复人评论id
  117. * reply_name: string // 被回复人名称
  118. * user_name: string // 用户名
  119. * user_avatar: string // 评论者头像地址
  120. * user_content: string // 评论内容
  121. * is_like: boolean // 是否点赞
  122. * like_count: number // 点赞数统计
  123. * create_time: string // 创建时间
  124. */
  125. tableData: {
  126. type: Array,
  127. default: () => [],
  128. },
  129. // 评论总数
  130. tableTotal: {
  131. type: Number,
  132. default: 0,
  133. },
  134. // 评论删除模式
  135. // bind - 当被删除的一级评论存在回复评论, 那么该评论内容变更显示为[当前评论内容已被移除]
  136. // only - 仅删除当前评论(后端删除相关联的回复评论, 否则总数显示不对)
  137. // all - 删除所有评论包括回复评论
  138. deleteMode: {
  139. type: String,
  140. default: "all",
  141. },
  142. isComment: {
  143. default: true
  144. }
  145. },
  146. data() {
  147. return {
  148. dataList: [], // 渲染数据(前端的格式)
  149. replyTemp: {}, // 回复临时数据
  150. isNewComment: false, // 是否为新评论
  151. focus: false, // 评论弹窗
  152. commentValue: "", // 输入框值
  153. commentPlaceholder: "说点什么...", // 输入框占位符
  154. delTemp: {}, // 删除临时数据
  155. showEmojiPanel: false, // 是否显示表情面板
  156. emojiList: ['😀', '😃', '😄', '😁', '😆', '😅', '😂', '🤣', '🥲', '😊', '😇', '🙂', '🙃', '😉', '😌', '😍', '🥰', '😘', '😗', '😙', '😚', '😋', '😛', '😝', '😜', '🤪', '🤨', '🧐', '🤓', '😎', '🥸', '🤩', '🥳', '😏', '😒', '😞', '😔', '😟', '😕', '🙁', '☹️', '😣', '😖', '😫', '😩', '🥺', '😢', '😭', '😤', '😠', '😡', '🤬', '🤯', '😳', '🥵', '🥶', '😱', '😨', '😰', '😥', '😓', '🤗', '🤔', '🤭', '🤫', '🤥', '😶', '😐', '😑', '😬', '🙄', '😯', '😦', '😧', '😮', '😲', '🥱', '😴', '🤤', '😪', '😵', '🤐', '🥴', '🤢', '🤮', '🤧', '😷', '🤒', '🤕', '🤑', '🤠'
  157. ]
  158. };
  159. },
  160. watch: {
  161. tableData: {
  162. handler(newVal) {
  163. if (newVal.length !== this.dataList.length) {
  164. this.dataList = this.treeTransForm(newVal);
  165. }
  166. },
  167. deep: true,
  168. immediate: true,
  169. },
  170. },
  171. mounted() { },
  172. methods: {
  173. // 数据转换
  174. treeTransForm(data) {
  175. let newData = JSON.parse(JSON.stringify(data));
  176. let result = [];
  177. let map = {};
  178. newData.forEach((item, i) => {
  179. item.owner = item.user_id === this.myInfo.user_id; // 是否为当前登陆用户
  180. item.author = item.user_id === this.userInfo.user_id; // 是否为作者
  181. map[item.id] = item;
  182. });
  183. newData.forEach((item) => {
  184. let parent = map[item.parent_id];
  185. if (parent) {
  186. (parent.children || (parent.children = [])).push(item); // 所有回复
  187. if (parent.children.length === 1) {
  188. (parent.childrenShow = []).push(item); // 显示的回复
  189. }
  190. } else {
  191. result.push(item);
  192. }
  193. });
  194. return result;
  195. },
  196. // 点赞
  197. setLike(item) {
  198. item.is_like = !item.is_like;
  199. item.like_count = item.is_like ? item.like_count + 1 : item.like_count - 1;
  200. },
  201. likeClick({
  202. item1,
  203. index1,
  204. item2,
  205. index2
  206. }) {
  207. let item = item2 || item1;
  208. let that = this;
  209. this.setLike(item);
  210. this.$emit("likeFun", {
  211. params: item
  212. }, (res) => {
  213. // 请求后端失败, 重置点赞
  214. that.setLike(item);
  215. });
  216. },
  217. // 回复
  218. replyClick({
  219. item1,
  220. index1,
  221. item2,
  222. index2
  223. }) {
  224. uni.$emit('check_login', () => {
  225. let isContentRecommendation
  226. if (this.teenageMode != 1) {
  227. isContentRecommendation = true;
  228. } else {
  229. isContentRecommendation = false;
  230. }
  231. if (!isContentRecommendation) {
  232. uni.showToast({
  233. title: '当前无法评论',
  234. icon: 'none'
  235. });
  236. return;
  237. }
  238. if (this.isComment == 0) {
  239. uni.showToast({
  240. title: '暂无评论权限',
  241. icon: 'none'
  242. })
  243. return
  244. }
  245. this.replyTemp = JSON.parse(JSON.stringify({
  246. item1,
  247. index1,
  248. item2,
  249. index2
  250. }));
  251. this.$refs["cPopupRef"].open();
  252. })
  253. },
  254. // 发起新评论
  255. newCommentFun() {
  256. let isContentRecommendation
  257. if (this.teenageMode != 1) {
  258. isContentRecommendation = true;
  259. } else {
  260. isContentRecommendation = false;
  261. }
  262. if (!isContentRecommendation) {
  263. uni.showToast({
  264. title: '当前无法评论',
  265. icon: 'none'
  266. });
  267. return;
  268. }
  269. if (this.isComment == 0) {
  270. uni.showToast({
  271. title: '暂无评论权限',
  272. icon: 'none'
  273. })
  274. return
  275. }
  276. this.isNewComment = true;
  277. this.$refs["cPopupRef"].open();
  278. },
  279. // 评论弹窗
  280. popChange(e) {
  281. // 关闭弹窗
  282. if (!e.show) {
  283. this.commentValue = ""; // 清空输入框值
  284. this.replyTemp = {}; // 清空被回复人信息
  285. this.isNewComment = false; // 恢复是否为新评论默认值
  286. this.showEmojiPanel = false; // 隐藏表情面板
  287. }
  288. this.focus = e.show;
  289. },
  290. // 切换表情面板显示状态
  291. toggleEmojiPanel() {
  292. this.showEmojiPanel = !this.showEmojiPanel;
  293. },
  294. // 选择表情
  295. selectEmoji(emoji) {
  296. this.commentValue += emoji;
  297. },
  298. // 输入框获取焦点时
  299. onTextareaFocus() {
  300. // 可以选择不关闭表情面板,让用户同时使用键盘和表情
  301. // this.showEmojiPanel = false;
  302. },
  303. // 发送评论
  304. sendClick({
  305. item1,
  306. index1,
  307. item2,
  308. index2
  309. } = this.replyTemp) {
  310. let item = item2 || item1;
  311. let params = {};
  312. // 新评论
  313. if (this.isNewComment) {
  314. params = {
  315. id: Math.random(), // 评论id
  316. parent_id: null, // 父级评论id
  317. reply_id: null, // 被回复评论id
  318. reply_name: null, // 被回复人名称
  319. };
  320. } else {
  321. // 回复评论
  322. params = {
  323. id: Math.random(), // 评论id
  324. parent_id: item && item.parent_id ? item.parent_id : item.id, // 父级评论id
  325. reply_id: item.id, // 被回复评论id
  326. reply_name: item.user_name, // 被回复人名称
  327. };
  328. }
  329. params = {
  330. ...params,
  331. user_id: this.myInfo.user_id, // 用户id
  332. user_name: this.myInfo.user_name, // 用户名
  333. user_avatar: this.myInfo.user_avatar, // 用户头像地址
  334. user_content: this.commentValue, // 用户评论内容
  335. is_like: false, // 是否点赞
  336. like_count: 0, // 点赞数统计
  337. create_time: "刚刚", // 创建时间
  338. owner: true, // 是否为所有者 所有者可以进行删除 管理员默认true
  339. };
  340. uni.showLoading({
  341. title: "正在发送",
  342. mask: true,
  343. });
  344. this.$emit("replyFun", {
  345. params
  346. }, (res) => {
  347. uni.hideLoading();
  348. // 拿到后端返回的id赋值, 因为删除要用到id
  349. params = {
  350. ...params,
  351. id: res.id
  352. };
  353. // 新评论
  354. if (this.isNewComment) {
  355. this.dataList.push(params);
  356. } else {
  357. // 回复
  358. let c_data = this.dataList[index1];
  359. (c_data.children || (c_data.children = [])).push(params);
  360. // 如果已展开所有回复, 那么此时插入children长度会大于childrenShow长度1, 所以就直接展开显示即可
  361. if (c_data.children.length === (c_data.childrenShow || (c_data.childrenShow = [])).length +
  362. 1) {
  363. c_data.childrenShow.push(params);
  364. }
  365. }
  366. this.$emit("update:tableTotal", this.tableTotal + 1);
  367. this.$refs["cPopupRef"].close();
  368. });
  369. },
  370. //删除
  371. deleteClick({
  372. item1,
  373. index1,
  374. item2,
  375. index2
  376. }) {
  377. this.delTemp = JSON.parse(JSON.stringify({
  378. item1,
  379. index1,
  380. item2,
  381. index2
  382. }));
  383. this.$refs['DialogBox'].confirm({
  384. title: '提示',
  385. content: '确定要删除该评论及其回复吗?',
  386. DialogType: 'inquiry',
  387. btn1: '取消',
  388. btn2: '确定',
  389. animation: 0
  390. }).then(() => {
  391. this.delConfirmFun()
  392. }).catch(() => {
  393. this.delCloseFun()
  394. })
  395. },
  396. // 关闭删除弹窗
  397. delCloseFun() {
  398. this.delTemp = {};
  399. // this.$refs["delPopupRef"].close();
  400. },
  401. // 确定删除
  402. delConfirmFun({
  403. item1,
  404. index1,
  405. item2,
  406. index2
  407. } = this.delTemp) {
  408. const deleteMode = this.deleteMode;
  409. let c_data = this.dataList[index1];
  410. uni.showLoading({
  411. title: "正在删除",
  412. mask: true,
  413. });
  414. // 删除二级评论
  415. if (index2 >= 0) {
  416. this.$emit("deleteFun", {
  417. params: [c_data.children[index2].id],
  418. mode: deleteMode
  419. }, (res) => {
  420. uni.hideLoading();
  421. this.$emit("update:tableTotal", this.tableTotal - 1);
  422. c_data.children.splice(index2, 1);
  423. c_data.childrenShow.splice(index2, 1);
  424. });
  425. } else {
  426. // 删除一级评论
  427. if (c_data?.children?.length) {
  428. // 如果一级评论包含回复评论
  429. switch (deleteMode) {
  430. case "bind":
  431. // 一级评论内容展示修改为: 当前评论内容已被移除
  432. this.$emit(
  433. "deleteFun", {
  434. params: [c_data.id],
  435. mode: deleteMode,
  436. },
  437. (res) => {
  438. uni.hideLoading();
  439. c_data.user_content = "当前评论内容已被移除";
  440. }
  441. );
  442. break;
  443. case "only":
  444. // 后端自行根据删除的一级评论id, 查找关联的子评论进行删除
  445. this.$emit(
  446. "deleteFun", {
  447. params: [c_data.id],
  448. mode: deleteMode,
  449. },
  450. (res) => {
  451. uni.hideLoading();
  452. this.$emit("update:tableTotal", this.tableTotal - c_data.children.length + 1);
  453. this.dataList.splice(index1, 1);
  454. }
  455. );
  456. break;
  457. default:
  458. // all
  459. // 收集子评论id, 提交给后端统一删除
  460. let delIdArr = [c_data.id];
  461. c_data.children.forEach((_, i) => {
  462. delIdArr.push(_.id);
  463. });
  464. this.$emit("deleteFun", {
  465. params: delIdArr,
  466. mode: deleteMode
  467. }, (res) => {
  468. uni.hideLoading();
  469. this.$emit("update:tableTotal", this.tableTotal - c_data.children.length + 1);
  470. this.dataList.splice(index1, 1);
  471. });
  472. break;
  473. }
  474. } else {
  475. // 一级评论无回复, 直接删除
  476. this.$emit("deleteFun", {
  477. params: [c_data.id],
  478. mode: deleteMode
  479. }, (res) => {
  480. uni.hideLoading();
  481. this.$emit("update:tableTotal", this.tableTotal - 1);
  482. this.dataList.splice(index1, 1);
  483. });
  484. }
  485. }
  486. this.delCloseFun();
  487. },
  488. // 展开评论if
  489. expandTxtShow({
  490. item1,
  491. index1
  492. }) {
  493. return item1.childrenShow?.length && item1.children.length - item1.childrenShow.length;
  494. },
  495. // 展开更多评论
  496. expandReplyFun({
  497. item1,
  498. index1
  499. }) {
  500. let csLen = this.dataList[index1].childrenShow.length;
  501. this.dataList[index1].childrenShow.push(
  502. ...this.dataList[index1].children.slice(csLen, csLen + 6) // 截取5条评论
  503. );
  504. },
  505. // 收起评论if
  506. shrinkTxtShow({
  507. item1,
  508. index1
  509. }) {
  510. return item1.childrenShow?.length >= 2 && item1.children.length - item1.childrenShow.length === 0;
  511. },
  512. // 收起更多评论
  513. shrinkReplyFun({
  514. item1,
  515. index1
  516. }) {
  517. this.dataList[index1].childrenShow = [];
  518. this.dataList[index1].childrenShow.push(
  519. ...this.dataList[index1].children.slice(0, 1) // 截取1条评论
  520. );
  521. },
  522. handleKeydown(event) { // 新增方法
  523. console.log(event.key, event.shiftKey);
  524. if (event.key === 'Enter' && !event.shiftKey) {
  525. event.preventDefault();
  526. this.sendClick();
  527. }
  528. },
  529. },
  530. };
  531. </script>
  532. <style lang="scss" scoped>
  533. @font-face {
  534. font-family: 'FontAwesome';
  535. src: url('https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/fonts/fontawesome-webfont.woff2') format('woff2');
  536. font-weight: normal;
  537. font-style: normal;
  538. }
  539. .fa {
  540. display: inline-block;
  541. font: normal normal normal 14px/1 FontAwesome;
  542. font-size: inherit;
  543. text-rendering: auto;
  544. -webkit-font-smoothing: antialiased;
  545. }
  546. .fa-smile-o:before {
  547. content: "\f118";
  548. }
  549. ////////////////////////
  550. .center {
  551. display: flex;
  552. align-items: center;
  553. }
  554. ////////////////////////
  555. .c_total {
  556. padding: 20rpx 30rpx 0 28rpx;
  557. font-size: 28rpx;
  558. }
  559. .empty_box {
  560. display: flex;
  561. justify-content: center;
  562. align-items: center;
  563. flex-direction: column;
  564. padding: 150rpx 10rpx;
  565. font-size: 28rpx;
  566. .txt {
  567. color: $uni-text-color-disable;
  568. }
  569. .click {
  570. color: $uni-color-primary;
  571. }
  572. }
  573. .c_comment {
  574. padding: 20rpx 30rpx;
  575. font-size: 28rpx;
  576. .children_item {
  577. padding: 10rpx 0rpx 10rpx 0rpx;
  578. margin-top: 10rpx;
  579. margin-left: 80rpx;
  580. background-color: $uni-bg-color-grey;
  581. .expand_reply,
  582. .shrink_reply {
  583. margin-top: 10rpx;
  584. margin-left: 80rpx;
  585. .txt {
  586. font-weight: 600;
  587. color: $uni-color-primary;
  588. font-size: 26rpx !important;
  589. }
  590. .uni-icons {
  591. font-size: 30rpx !important;
  592. }
  593. }
  594. }
  595. }
  596. .c_popup_box {
  597. background-color: #fff;
  598. margin-bottom: 0rpx;
  599. .reply_text {
  600. @extend .center;
  601. padding: 20rpx 20rpx 0 20rpx;
  602. font-size: 26rpx;
  603. .text_aid {
  604. color: $uni-text-color-grey;
  605. margin-right: 5rpx;
  606. }
  607. .user_avatar {
  608. width: 48rpx;
  609. height: 48rpx;
  610. border-radius: 50%;
  611. margin-right: 6rpx;
  612. margin-left: 12rpx;
  613. }
  614. }
  615. .content {
  616. @extend .center;
  617. .text_area {
  618. flex: 1;
  619. padding: 20rpx;
  620. position: relative;
  621. .textarea {
  622. width: 100%;
  623. min-height: 80rpx;
  624. font-size: 28rpx;
  625. color: #333;
  626. background: #f8f8f8;
  627. border: 2rpx solid #eee;
  628. border-radius: 8rpx;
  629. padding: 16rpx 50rpx 16rpx 16rpx;
  630. }
  631. .emoji-trigger {
  632. position: absolute;
  633. right: 30rpx;
  634. bottom: 30rpx;
  635. width: 60rpx;
  636. height: 60rpx;
  637. display: flex;
  638. align-items: center;
  639. justify-content: center;
  640. color: #666;
  641. font-size: 40rpx;
  642. &:active {
  643. opacity: 0.7;
  644. }
  645. }
  646. }
  647. .send_btn {
  648. @extend .center;
  649. justify-content: center;
  650. width: 120rpx;
  651. height: 60rpx;
  652. border-radius: 20rpx;
  653. font-size: 28rpx;
  654. color: #fff;
  655. background-color: $uni-color-primary;
  656. margin-right: 20rpx;
  657. margin-left: 5rpx;
  658. }
  659. }
  660. .emoji-panel {
  661. padding: 20rpx;
  662. background-color: #f8f8f8;
  663. border-top: 2rpx solid #eee;
  664. max-height: 40vh;
  665. overflow-y: scroll;
  666. .emoji-grid {
  667. display: flex;
  668. flex-wrap: wrap;
  669. // overflow-y: scroll;
  670. .emoji-item {
  671. width: 12.5%;
  672. height: 80rpx;
  673. display: flex;
  674. align-items: center;
  675. justify-content: center;
  676. font-size: 40rpx;
  677. &:active {
  678. background-color: rgba(0, 0, 0, 0.1);
  679. border-radius: 8rpx;
  680. }
  681. }
  682. }
  683. }
  684. }
  685. </style>