liveComment.vue 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <template name="liveComment">
  2. <view>
  3. <view class="banner">
  4. <dever-video
  5. :src="item.live"
  6. :pic="item.pic"
  7. :control="false"
  8. :index="0"
  9. :vid="item.id"
  10. :load.sync="load"
  11. :disabled="disabled"
  12. ref="video"
  13. >
  14. </dever-video>
  15. </view>
  16. <block v-if="item.type == 2">
  17. <dever-comment ref="comment" :item="item" :type="`content/live`" :type_id="item.id"></dever-comment>
  18. </block>
  19. <block v-if="item.type == 1">
  20. <dever-seat ref="seat" :item="item" :index="index" :type="`content/live`" :type_id="item.id" @start="start" @stop="stop" @setDisabled="setDisabled"></dever-seat>
  21. </block>
  22. </view>
  23. </template>
  24. <script>
  25. import deverVideo from '@/lib/dever/components/video.nvue';
  26. import deverComment from "@/lib/dever/components/comment.vue";
  27. import deverSeat from '@/lib/dever/components/seat.vue';
  28. export default {
  29. name: "liveComment",
  30. props: {
  31. control : {
  32. type : Object,
  33. value : null
  34. },
  35. item : {
  36. type : Object,
  37. value : null
  38. },
  39. index : 0
  40. },
  41. data() {
  42. return {
  43. load : false,
  44. //默认不能播放
  45. disabled : true,
  46. }
  47. },
  48. mounted() {
  49. this.control[this.index] = this;
  50. },
  51. methods:{
  52. start : function() {
  53. this.$refs.video.start();
  54. },
  55. stop : function() {
  56. this.$refs.video.stop(true);
  57. },
  58. setDisabled : function(value) {
  59. this.disabled = value;
  60. },
  61. },
  62. components:{
  63. deverVideo,deverComment,deverSeat
  64. }
  65. }
  66. </script>
  67. <style>
  68. .banner{
  69. position: relative;
  70. width: 750rpx;
  71. height: 422rpx;
  72. display: block;
  73. }
  74. </style>