detail.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
  1. <template>
  2. <view class="app-container">
  3. <!-- 背景 -->
  4. <view class="bg" />
  5. <!-- 跳转App -->
  6. <open-app :page="2" :audioType="data.audioType" />
  7. <!-- 详情 -->
  8. <view class="detail">
  9. <img class="logo" :src="data.thumb" />
  10. <view class="content">
  11. <text style="font-weight: 600;">{{ data.name }}</text>
  12. <view class="tips" v-if="data.podcasters.length > 0">
  13. <img class="avatar" :src="data.podcasters[0].avatar" />
  14. <text>{{ data.podcasters[0].nickname }}</text>
  15. </view>
  16. <view class="play_number">
  17. <img src="@/static/share/playnumber.png" />
  18. <text>{{ data.playcount }}</text>
  19. </view>
  20. </view>
  21. </view>
  22. <text class="info">
  23. <text>{{ data.description }}</text>
  24. <uni-icons />
  25. </text>
  26. <!-- 列表 -->
  27. <uni-segmented-control :current="current" @clickItem="onClickItem" styleType="text" :values="items"
  28. activeColor="#fff" />
  29. <view v-show="current === 0" class="list_content">
  30. <uni-row class="item" v-for="(item, index) in list" :key="item.id" @click.native="getNav(item)">
  31. <uni-col :span="2" style="color:#FFFFFF66; fontSize: 28rpx; fontWeight:bold">
  32. {{ index + 1}}
  33. </uni-col>
  34. <uni-col :span="20">
  35. <view style="fontSize: 32rpx; margin-bottom: 10rpx;">{{ item.name }}</view>
  36. <view style="display:flex; fontSize:22rpx; color:#FFFFFF66;">
  37. <text class="time">{{ item.durationText }}</text>
  38. <text class="play">{{ item.playcount }}</text>
  39. <text class="date">{{ item.updateTimeText }}</text>
  40. </view>
  41. </uni-col>
  42. <uni-col :span="2">
  43. <img src="@/static/share/playbtn.png" style="width: 48rpx;height: 48rpx" @click.stop="open" />
  44. </uni-col>
  45. </uni-row>
  46. </view>
  47. <view v-show="current === 1" class="list_content">
  48. <text class="no-data">暂时没有数据哦</text>
  49. </view>
  50. </view>
  51. </template>
  52. <script>
  53. import { podCastProgramList, podCastDetail } from '@/api/share'
  54. export default {
  55. data() {
  56. return {
  57. current: 0,
  58. items: ['节目', '推荐'],
  59. form: {
  60. audioId: '',
  61. pageNum: 1,
  62. pageSize: 10
  63. },
  64. list: [],
  65. total: 0,
  66. data: {}
  67. }
  68. },
  69. onLoad(e) {
  70. if (e.audioId) {
  71. this.form.audioId = e.audioId
  72. this.getDetail()
  73. this.getList()
  74. }
  75. },
  76. onReachBottom() {
  77. if (this.list.length < this.total) {
  78. this.form.pageSize += 10
  79. this.getList()
  80. }
  81. },
  82. methods: {
  83. // 列表
  84. getList() {
  85. podCastProgramList(this.form).then(res => {
  86. if (res.data.code === 0) {
  87. this.list = res.data.data.records
  88. this.total = res.data.data.total
  89. }
  90. })
  91. },
  92. // 详情
  93. getDetail() {
  94. podCastDetail({
  95. audioId: this.form.audioId
  96. }).then(res => {
  97. if (res.data.code === 0) {
  98. this.data = res.data.data
  99. }
  100. })
  101. },
  102. // 下一页
  103. getNav(item) {
  104. uni.navigateTo({
  105. url: `/pages/share/controls?audioId=${item.audioId}`
  106. })
  107. },
  108. // 打开app
  109. open() {
  110. this.openApp(2, this.data.audioType)
  111. },
  112. onClickItem(e) {
  113. if (this.current != e.currentIndex) {
  114. this.current = e.currentIndex
  115. }
  116. }
  117. }
  118. }
  119. </script>
  120. <style lang="scss" scoped>
  121. .bg {
  122. position: absolute;
  123. top: 0;
  124. left: 0;
  125. width: 100%;
  126. height: 450rpx;
  127. filter: brightness(0.5) blur(16px);
  128. z-index: -1;
  129. }
  130. .detail {
  131. display: flex;
  132. margin-top: 48rpx;
  133. .logo {
  134. width: 240rpx;
  135. height: 240rpx;
  136. border-radius: 16rpx;
  137. }
  138. .content {
  139. display: flex;
  140. flex-direction: column;
  141. justify-content: space-between;
  142. margin-left: 32rpx;
  143. .tips {
  144. color: rgba(255, 255, 255, 0.7);
  145. font-size: 22rpx;
  146. display: flex;
  147. align-items: center;
  148. margin-top: -32rpx;
  149. .avatar {
  150. width: 56rpx;
  151. height: 56rpx;
  152. border-radius: 50%;
  153. margin-right: 20rpx;
  154. }
  155. }
  156. .play_number {
  157. display: flex;
  158. align-content: center;
  159. img {
  160. width: 32rpx;
  161. height: 32rpx;
  162. }
  163. text {
  164. font-size: 24rpx;
  165. color: rgba(255, 255, 255, 0.4);
  166. }
  167. }
  168. }
  169. }
  170. .info {
  171. width: 100%;
  172. color: rgba(255, 255, 255, 0.7);
  173. font-size: 24rpx;
  174. position: relative;
  175. display: block;
  176. margin: 32rpx 0 40rpx 0;
  177. text {
  178. display: inline-block;
  179. width: 96%;
  180. overflow: hidden;
  181. text-overflow: ellipsis;
  182. white-space: nowrap;
  183. }
  184. }
  185. .info::after {
  186. content: '\e6b5';
  187. font-family: uniicons;
  188. position: absolute;
  189. right: 0;
  190. top: 5%;
  191. }
  192. ::v-deep .segmented-control__item {
  193. flex: none;
  194. margin-right: 64rpx;
  195. }
  196. ::v-deep .segmented-control__item--text::after {
  197. content: '';
  198. width: 32rpx;
  199. height: 8rpx;
  200. background: #a4d099;
  201. position: absolute;
  202. left: 50%;
  203. bottom: 0;
  204. transform: translate(-50%);
  205. border-radius: 20rpx;
  206. }
  207. .list_content {
  208. position: relative;
  209. margin-top: 32rpx;
  210. .item {
  211. display: flex;
  212. align-items: center;
  213. margin-bottom: 50rpx;
  214. }
  215. .item:last-child {
  216. margin: 0;
  217. }
  218. }
  219. .time,
  220. .play,
  221. .date {
  222. display: flex;
  223. align-items: center;
  224. margin-right: 16rpx;
  225. }
  226. .time::before,
  227. .play::before,
  228. .date::before {
  229. content: '';
  230. width: 28rpx;
  231. height: 28rpx;
  232. margin-right: 8rpx;
  233. }
  234. .time::before {
  235. background: url('@/static/share/time.png') no-repeat 100% / cover;
  236. }
  237. .play::before {
  238. background: url('@/static/share/playnumber.png') no-repeat 100% / cover;
  239. }
  240. .date::before {
  241. background: url('@/static/share/date.png') no-repeat 100% / cover;
  242. }
  243. .no-data {
  244. position: absolute;
  245. top: 50%;
  246. left: 50%;
  247. transform: translate(-50%, -50%);
  248. color: #ffffff66;
  249. font-size: 24rpx;
  250. }
  251. </style>