index.vue 990 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <template>
  2. <view :class="'video-box ' + (isMine ? 'my-video' : '')" @click="playerHander">
  3. <image :src="message.payload.thumbUrl" mode="aspectFill" class="poster"></image>
  4. <image :src="`${assetsUrl}talk-playing.png`" mode="aspectFit" class="video-icon"></image>
  5. </view>
  6. </template>
  7. <script>
  8. export default {
  9. data() {
  10. return {
  11. isPlay: false,
  12. assetsUrl:this.$util.assetsUrl,
  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.message=newVal;
  30. // this.setData({
  31. // message: newVal
  32. // });
  33. },
  34. immediate: true,
  35. deep: true
  36. }
  37. },
  38. onLoad() {
  39. console.log(this.message)
  40. },
  41. methods: {
  42. playerHander() {
  43. uni.$emit('videoPlayerHandler', {
  44. isPlay: true,
  45. message: this.message
  46. });
  47. },
  48. stopHander() {
  49. this.isPlay = false;
  50. }
  51. }
  52. };
  53. </script>
  54. <style>
  55. @import './index.css';
  56. </style>