index.vue 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <template>
  2. <view class="emotion-wrap">
  3. <view class="emotion-btn">
  4. <image src="../../static/img/clear.png"
  5. style="width: 64rpx;height: 64rpx;" @tap="handleRemoveEmoji"></image>
  6. </view>
  7. <swiper class="swiper-wrap" indicator-dots="true" duration="150">
  8. <swiper-item v-for="(page,pid) in list" :key="pid">
  9. <view class="emotion-box">
  10. <view v-for="(em,eid) in page" :key="eid" @tap="handleClikEmoji(em)">
  11. <u-image class="emotion" width="70rpx" height="70rpx" :src="`https://liangxin.zthymaoyi.com/upload/${em.url}`"></u-image>
  12. </view>
  13. </view>
  14. </swiper-item>
  15. </swiper>
  16. </view>
  17. </template>
  18. <script>
  19. import { emojiList } from "@/pageC/static/emoji/emoji.js"
  20. export default {
  21. name:'u-emotion',
  22. data() {
  23. return {
  24. list: emojiList,
  25. cur: {}
  26. }
  27. },
  28. methods: {
  29. handleSend() {
  30. this.$emit('send')
  31. },
  32. handleRemoveEmoji() {
  33. this.$emit('addEmoji', this.cur, true)
  34. },
  35. handleClikEmoji(item) {
  36. this.cur = {
  37. emojiPath: 'https://liangxin.zthymaoyi.com/upload/',
  38. minEmoji: true,
  39. emojiItem: item,
  40. groupIndex: 1,
  41. emoticonFlag: false
  42. }
  43. this.$emit('addEmoji', this.cur)
  44. }
  45. }
  46. }
  47. </script>
  48. <style lang="scss">
  49. .emotion-wrap {
  50. height: 100%;
  51. padding-left: 2%;
  52. padding-bottom: 20px;
  53. overflow: auto;
  54. .emotion-box {
  55. padding-top: 30px;
  56. }
  57. .swiper-wrap {
  58. height: 100%;
  59. }
  60. .emotion-btn {
  61. z-index: 1;
  62. position: fixed;
  63. right: 20rpx;
  64. bottom: 30rpx;
  65. }
  66. .emotion-del {
  67. margin-right: 10rpx;
  68. }
  69. .emotion {
  70. float: left;
  71. margin: 5px;
  72. }
  73. }
  74. </style>