my-audio.vue 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <template>
  2. <!-- 播放器 -->
  3. <view class="audio" :style="{ 'background': (bg ? `url(${bg}) no-repeat 100% / 100%` : '#EEE') }">
  4. <image class="pic" :src="pic" />
  5. <view class="info">
  6. <view class="song">{{ name }}</view>
  7. <view class="singer">暂无歌手名</view>
  8. </view>
  9. <image class="btn" src="../../static/play.png" />
  10. </view>
  11. </template>
  12. <script>
  13. export default {
  14. props: {
  15. bg: String,
  16. pic: String,
  17. name: String
  18. },
  19. data() {
  20. return {
  21. }
  22. },
  23. mounted() {
  24. }
  25. }
  26. </script>
  27. <style lang="scss" scoped>
  28. .audio {
  29. width: 100%;
  30. height: 104px;
  31. padding: 8px 16px 8px 8px;
  32. border-radius: 8px;
  33. display: flex;
  34. align-items: center;
  35. font-weight: bold;
  36. .pic {
  37. width: 88px;
  38. height: 88px;
  39. border-radius: 8px;
  40. margin-right: 16px;
  41. }
  42. .info {
  43. width: calc(100% - 144px);
  44. color: #000;
  45. .song {
  46. font-size: 16px;
  47. margin-bottom: 16px;
  48. }
  49. .singer {
  50. font-size: 12px;
  51. opacity: 0.6;
  52. }
  53. }
  54. .btn {
  55. width: 40px;
  56. height: 40px;
  57. }
  58. }
  59. </style>