controls.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  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. }
  65. },
  66. onLoad(e) {
  67. if (e.audioId) {
  68. this.channelType = e.channelType
  69. if (e.channelType === '1') {
  70. boradcastDetail({
  71. audioId: e.audioId
  72. }).then(res => {
  73. if (res.data.code === 0) {
  74. this.form = res.data.data
  75. this.form.platformId = this.platFormOptions.find(i => i.value === res.data.data.platformId).label
  76. }
  77. })
  78. } else {
  79. podCastProgramDetail({
  80. audioId: e.audioId
  81. }).then(res => {
  82. if (res.data.code === 0) {
  83. this.form = res.data.data
  84. this.form.platformId = this.platFormOptions.find(i => i.value === res.data.data.platformId).label
  85. this.form.icon = res.data.data.audioPic
  86. }
  87. })
  88. }
  89. }
  90. },
  91. methods: {
  92. // 打开app
  93. open() {
  94. // this.openApp(3, this.form.audioId)
  95. this.openApp(`?page=/mobile/audioPage&audioId=${this.form.audioId}`)
  96. }
  97. }
  98. }
  99. </script>
  100. <style lang="scss" scoped>
  101. .bg {
  102. position: absolute;
  103. top: 0;
  104. left: 0;
  105. width: 100%;
  106. height: 450rpx;
  107. filter: brightness(0.5) blur(16px);
  108. z-index: -1;
  109. }
  110. .play_control {
  111. text-align: center;
  112. margin-top: 32rpx;
  113. .cover {
  114. width: 100%;
  115. border-radius: 16rpx;
  116. margin-bottom: 48rpx;
  117. }
  118. .title {
  119. font-size: 48rpx;
  120. font-weight: 600;
  121. }
  122. .name {
  123. font-size: 28rpx;
  124. color: #727c82;
  125. margin: 20rpx 0;
  126. }
  127. .platform {
  128. font-size: 22rpx;
  129. color: #727c82;
  130. line-height: 64rpx;
  131. }
  132. .length {
  133. display: flex;
  134. justify-content: space-between;
  135. align-items: center;
  136. font-size: 20rpx;
  137. color: #727c82;
  138. }
  139. .FM {
  140. width: 558rpx;
  141. height: 606rpx;
  142. border-radius: 16rpx;
  143. padding: 32rpx 32rpx 0;
  144. margin: 0 auto 32rpx auto;
  145. background: rgba(255, 255, 255, 0.05);
  146. img {
  147. width: 494rpx;
  148. height: 494rpx;
  149. border-radius: 16rpx;
  150. }
  151. text {
  152. font-size: 22rpx;
  153. color: rgba(255, 255, 255, 0.4);
  154. margin-top: 20rpx;
  155. float: left;
  156. }
  157. }
  158. .play_btn {
  159. width: 112rpx;
  160. height: 112rpx;
  161. margin-top: 48rpx;
  162. }
  163. }
  164. </style>