musicPreview.vue 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <!-- 预览 弹窗列表 -->
  2. <template>
  3. <div class="musicPreview">
  4. <div class="headCon">
  5. <div class="headLeft">
  6. <div class="title">{{ musicObj.name }}</div>
  7. </div>
  8. <div class="headright">
  9. <img @click="emits('close')" class="closeBtn" src="../../cloudCoachElement/cloudCoachList/imgs/close.png" alt="" />
  10. </div>
  11. </div>
  12. <div class="content">
  13. <iframe v-if="props.musicObj.id" :key="props.musicObj.id" class="musicIframe" frameborder="0" :src="url"></iframe>
  14. </div>
  15. </div>
  16. </template>
  17. <script setup lang="ts">
  18. import { computed } from "vue"
  19. import { getMusicResourcesUrl } from "../index"
  20. const emits = defineEmits<{
  21. (event: "close"): void
  22. }>()
  23. const props = defineProps<{
  24. musicObj: Record<string, any>
  25. type: "MUSIC" | "INSTRUMENT" | "MUSICIAN"
  26. }>()
  27. const url = computed(() => {
  28. return getMusicResourcesUrl(props.type, "modal", props.musicObj.id)
  29. })
  30. </script>
  31. <style lang="scss" scoped>
  32. .musicPreview {
  33. width: 100%;
  34. height: 100%;
  35. .headCon {
  36. width: 100%;
  37. height: 64px;
  38. border-bottom: 1px solid #eaeaea;
  39. display: flex;
  40. justify-content: space-between;
  41. align-items: center;
  42. .headLeft {
  43. margin-left: 30px;
  44. display: flex;
  45. align-items: center;
  46. .title {
  47. font-weight: 600;
  48. font-size: 18px;
  49. color: #131415;
  50. line-height: 24px;
  51. }
  52. }
  53. .headright {
  54. margin-right: 30px;
  55. display: flex;
  56. align-items: center;
  57. .closeBtn {
  58. width: 24px;
  59. height: 24px;
  60. cursor: pointer;
  61. &:hover {
  62. opacity: 0.8;
  63. }
  64. }
  65. }
  66. }
  67. .content {
  68. width: 100%;
  69. height: calc(100% - 64px);
  70. .musicIframe {
  71. width: 100%;
  72. height: 100%;
  73. }
  74. }
  75. }
  76. </style>