audioComment.vue 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <template name="audioComment">
  2. <view>
  3. <view class="banner">
  4. <dever-audio
  5. :src="item.audio"
  6. :pic="item.pic"
  7. :control="true"
  8. :loop="true"
  9. :load.sync="load"
  10. ref="audio"
  11. >
  12. </dever-audio>
  13. </view>
  14. <comment :name="item.name" :type="`content/audio_comment`" :type_id="item.id"></comment>
  15. </view>
  16. </template>
  17. <script>
  18. import deverAudio from '@/lib/dever/components/audio.nvue';
  19. import comment from "@/pages/dream/view/comment.vue";
  20. export default {
  21. name: "audioComment",
  22. props: {
  23. control : {
  24. type : Object,
  25. value : null
  26. },
  27. item : {
  28. type : Object,
  29. value : null
  30. },
  31. index : {
  32. type : Number,
  33. value : null
  34. },
  35. },
  36. data() {
  37. return {
  38. load : false,
  39. }
  40. },
  41. mounted() {
  42. this.control[this.index] = this;
  43. },
  44. methods:{
  45. start : function() {
  46. this.$refs.audio.start();
  47. },
  48. stop : function() {
  49. this.$refs.audio.stop();
  50. },
  51. },
  52. components:{
  53. deverAudio,comment
  54. }
  55. }
  56. </script>
  57. <style>
  58. .banner{
  59. position: relative;
  60. width: 750rpx;
  61. height: 422rpx;
  62. display: block;
  63. }
  64. </style>