audioComment.vue 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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 :item="item" :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 : 0
  32. },
  33. data() {
  34. return {
  35. load : false,
  36. }
  37. },
  38. mounted() {
  39. this.control[this.index] = this;
  40. },
  41. methods:{
  42. start : function() {
  43. this.$refs.audio.start();
  44. },
  45. stop : function() {
  46. this.$refs.audio.stop();
  47. },
  48. },
  49. components:{
  50. deverAudio,comment
  51. }
  52. }
  53. </script>
  54. <style>
  55. .banner{
  56. position: relative;
  57. width: 750rpx;
  58. height: 422rpx;
  59. display: block;
  60. }
  61. </style>