controls.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. <template>
  2. <div class="app-container">
  3. <!-- 背景 -->
  4. <view class="bg" :style="{'background': `url(${form.icon})no-repeat 100% / cover`}" />
  5. <!-- 跳转App -->
  6. <open-app @open="open" />
  7. <!-- 播控分享 -->
  8. <view class="play_control">
  9. <img v-if="channelType !== '1'" class="cover" :src="form.icon" />
  10. <view v-if="channelType === '1'" class="FM">
  11. <img :src="form.icon" />
  12. <text>以上内容来自{{ form.platformId }}</text>
  13. </view>
  14. <view class="title">{{ form.title }}</view>
  15. <view class="name" v-if="channelType === '1'">{{ form.title }}</view>
  16. <view v-if="channelType !== '1'" class="platform">
  17. 以上内容来自{{ form.platformId }}
  18. </view>
  19. <slider min="0" max="100" block-color="#78B06A" block-size="12" activeColor="#78B06A"
  20. backgroundColor="#727c82" disabled />
  21. <view class="length">
  22. <text>00:00:00</text>
  23. <text>00:00:00</text>
  24. </view>
  25. <img class="play_btn" src="@/static/share/play.png" @click="open" />
  26. </view>
  27. </div>
  28. </template>
  29. <script>
  30. import { boradcastDetail, podCastProgramDetail } from '@/api/share'
  31. export default {
  32. data() {
  33. return {
  34. channelType: '',
  35. form: {},
  36. platFormOptions: [{
  37. value: 0,
  38. label: '未知'
  39. }, {
  40. value: 1,
  41. label: '蜻蜓'
  42. }, {
  43. value: 2,
  44. label: '官方电台'
  45. }, {
  46. value: 3,
  47. label: '猫王好听'
  48. }, {
  49. value: 4,
  50. label: '海外电台'
  51. }, {
  52. value: 5,
  53. label: '音乐随身听'
  54. }, {
  55. value: 6,
  56. label: 'qq音乐'
  57. }, {
  58. value: 7,
  59. label: 'HiFIVE音乐'
  60. }, {
  61. value: 8,
  62. label: '看见音乐'
  63. }, {
  64. value: 11,
  65. label: '阿基米德'
  66. }]
  67. }
  68. },
  69. onLoad(e) {
  70. if (e.audioId) {
  71. this.channelType = e.channelType
  72. if (e.channelType === '1') {
  73. boradcastDetail({
  74. audioId: e.audioId
  75. }).then(res => {
  76. if (res.data.code === 0) {
  77. this.form = res.data.data
  78. this.form.platformId = this.platFormOptions.find(i => i.value === res.data.data.platformId).label
  79. }
  80. })
  81. } else {
  82. podCastProgramDetail({
  83. audioId: e.audioId
  84. }).then(res => {
  85. if (res.data.code === 0) {
  86. this.form = res.data.data
  87. this.form.platformId = this.platFormOptions.find(i => i.value === res.data.data.platformId).label
  88. this.form.icon = res.data.data.audioPic
  89. }
  90. })
  91. }
  92. }
  93. },
  94. methods: {
  95. // 打开app
  96. open() {
  97. // this.openApp(3, this.form.audioId)
  98. this.openApp(`?page=/mobile/audioPage&audioId=${this.form.audioId}`)
  99. }
  100. }
  101. }
  102. </script>
  103. <style lang="scss" scoped>
  104. .bg {
  105. position: absolute;
  106. top: 0;
  107. left: 0;
  108. width: 100%;
  109. height: 450rpx;
  110. filter: brightness(0.5) blur(16px);
  111. z-index: -1;
  112. }
  113. .play_control {
  114. text-align: center;
  115. margin-top: 32rpx;
  116. .cover {
  117. width: 100%;
  118. border-radius: 16rpx;
  119. margin-bottom: 48rpx;
  120. }
  121. .title {
  122. font-size: 48rpx;
  123. font-weight: 600;
  124. }
  125. .name {
  126. font-size: 28rpx;
  127. color: #727c82;
  128. margin: 20rpx 0;
  129. }
  130. .platform {
  131. font-size: 22rpx;
  132. color: #727c82;
  133. line-height: 64rpx;
  134. }
  135. .length {
  136. display: flex;
  137. justify-content: space-between;
  138. align-items: center;
  139. font-size: 20rpx;
  140. color: #727c82;
  141. }
  142. .FM {
  143. width: 558rpx;
  144. height: 606rpx;
  145. border-radius: 16rpx;
  146. padding: 32rpx 32rpx 0;
  147. margin: 0 auto 32rpx auto;
  148. background: rgba(255, 255, 255, 0.05);
  149. img {
  150. width: 494rpx;
  151. height: 494rpx;
  152. border-radius: 16rpx;
  153. }
  154. text {
  155. font-size: 22rpx;
  156. color: rgba(255, 255, 255, 0.4);
  157. margin-top: 20rpx;
  158. float: left;
  159. }
  160. }
  161. .play_btn {
  162. width: 112rpx;
  163. height: 112rpx;
  164. margin-top: 48rpx;
  165. }
  166. }
  167. </style>