im-drawer.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <template>
  2. <view>
  3. <!-- 抽屉栏 -->
  4. <view class="popup-layer" :class="popupLayerClass" @touchmove.stop.prevent="discard">
  5. <!-- 表情 -->
  6. <emotion @addEmoji="addEmoji" @send="sendMsg(0,textMsg)" :class="{hidden:hideEmoji}"></emotion>
  7. <!-- 更多功能 相册-拍照-红包 -->
  8. <view class="more-layer" :class="{hidden:hideMore}">
  9. <view class="list">
  10. <view class="box" @tap="chooseImage">
  11. <image class="box-xx" src="@/static/img/more/tupian.png"></image>
  12. </view>
  13. <view class="box" @tap="camera">
  14. <image class="box-xx" src="@/static/img/more/paizhao.png"></image>
  15. </view>
  16. <!-- <view class="box" @tap="redShow">
  17. <image class="box-xx" src="@/static/img/more/hongbao.png"></image>
  18. </view> -->
  19. </view>
  20. </view>
  21. </view>
  22. </view>
  23. </template>
  24. <script>
  25. import emojiData from "@/pageC/static/emoji/emojiData.js"
  26. import emotion from '@/components/emotion/index.vue'
  27. export default {
  28. name:'im-drawer',
  29. components:{
  30. emotion
  31. },
  32. data() {
  33. return {
  34. inputOffsetBottom: 0, //键盘的高度
  35. viewOffsetBottom: 0, //视窗距离页面的距离
  36. };
  37. },
  38. props: {
  39. hideMore: {
  40. type: Boolean,
  41. default: true
  42. },
  43. hideEmoji: {
  44. type: Boolean,
  45. default: true
  46. },
  47. popupLayerClass: {
  48. type: String,
  49. default: ''
  50. },
  51. textMsg: {
  52. type: String,
  53. default: ''
  54. },
  55. },
  56. methods:{
  57. sendMsg(index,textMsg){
  58. this.$emit('sendMsg', index , textMsg);
  59. },
  60. redShow(){
  61. this.$emit('redShow', true);
  62. },
  63. weizhi(){
  64. },
  65. discard(){
  66. return;
  67. },
  68. getImage(type){
  69. this.$emit('getImage', type);
  70. },
  71. // 选择图片发送
  72. chooseImage(){
  73. this.getImage('album');
  74. },
  75. //拍照发送
  76. camera(){
  77. this.getImage('camera');
  78. },
  79. //添加表情
  80. addEmoji(em, del){
  81. this.$emit('addEmoji', em, del);
  82. },
  83. }
  84. }
  85. </script>
  86. <style lang="scss">
  87. @import "@/pageC/chat/style.scss";
  88. </style>