index.vue 890 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <template>
  2. <view :class="'video-box ' + (isMine ? 'my-video' : '')" @click="playerHander">
  3. <image class="video-icon" src="../../../../static/static/images/video-play.png"></image>
  4. </view>
  5. </template>
  6. <script>
  7. import videoIcon from '../../../../static/static/images/video-play.png';
  8. export default {
  9. data() {
  10. return {
  11. isPlay: false,
  12. videoIcon: videoIcon
  13. };
  14. },
  15. components: {},
  16. props: {
  17. message: {
  18. type: Object,
  19. default: () => {}
  20. },
  21. isMine: {
  22. type: Boolean,
  23. default: true
  24. }
  25. },
  26. watch: {
  27. message: {
  28. handler: function(newVal) {
  29. this.setData({
  30. message: newVal
  31. });
  32. },
  33. immediate: true,
  34. deep: true
  35. }
  36. },
  37. methods: {
  38. playerHander() {
  39. uni.$emit('videoPlayerHandler', {
  40. isPlay: true,
  41. message: this.message
  42. });
  43. },
  44. stopHander() {
  45. this.isPlay = false;
  46. }
  47. }
  48. };
  49. </script>
  50. <style>
  51. @import './index.css';
  52. </style>