xt-video-send.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <template>
  2. <view v-if="showXtDanmu" class="xt-video-send">
  3. <view class="xt-video-mask" @click="_hide"></view>
  4. <view class="xt-video-send-bottom">
  5. <input v-model="value" class="xt-video-input" placeholder="发条弹幕吧~" placeholder-style="font-size:32rpx;" />
  6. <view
  7. class="xt-video-send-btn"
  8. :style="{
  9. 'backgroundColor': activeColor
  10. }"
  11. @click="xtVideoSendDanmu"
  12. >
  13. <text>发送</text>
  14. </view>
  15. </view>
  16. </view>
  17. </template>
  18. <script>
  19. export default {
  20. props: {
  21. activeColor: {
  22. type: String,
  23. default: '#03A3F8'
  24. }
  25. },
  26. data() {
  27. return {
  28. value: '',
  29. showXtDanmu: false
  30. }
  31. },
  32. methods: {
  33. // 展示
  34. _show() {
  35. this.showXtDanmu = true
  36. },
  37. _hide() {
  38. this.showXtDanmu = false
  39. },
  40. // 发送弹幕
  41. xtVideoSendDanmu() {
  42. this.$emit('onSendDanmu', {
  43. width: rect.width,
  44. value: this.value
  45. })
  46. this._hide()
  47. }
  48. }
  49. }
  50. </script>
  51. <style lang="scss" scoped>
  52. .xt-video-send {
  53. position: fixed;
  54. top: 0;
  55. left: 0;
  56. width: 100%;
  57. height: 100%;
  58. z-index: 666;
  59. display: flex;
  60. flex-direction: column;
  61. .xt-video-mask {
  62. flex: 1;
  63. background-color: rgba(0, 0, 0, 0.5);
  64. }
  65. &-bottom {
  66. box-sizing: border-box;
  67. position: absolute;
  68. left: 0;
  69. bottom: 0;
  70. width: 100%;
  71. height: 178rpx;
  72. background-color: #fff;
  73. display: flex;
  74. align-items: center;
  75. padding: 20rpx 24rpx;
  76. }
  77. .xt-video-input {
  78. flex: 1;
  79. padding: 20rpx;
  80. background-color: #F6F5F5;
  81. border-radius: 10rpx;
  82. margin-right: 20rpx;
  83. }
  84. .xt-video-send-btn {
  85. display: flex;
  86. justify-content: center;
  87. align-items: center;
  88. width: 100rpx;
  89. height: 58rpx;
  90. border-radius: 29rpx;
  91. > text {
  92. font-size: 28rpx;
  93. color: #fff;
  94. }
  95. }
  96. .xt-danmu-text {
  97. display: flex;
  98. }
  99. }
  100. </style>