Recent.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. <template>
  2. <view v-if="show" class="recent-container main-between cross-center">
  3. <view class="close" @click="handleClose">
  4. <u-icon name="close-circle" :color="$colors.primaryColor" size="54rpx" />
  5. </view>
  6. <view class="cover-image">
  7. <image :src="recent.detail.episode.cover_img" mode="aspectFill" />
  8. </view>
  9. <view class="info">
  10. <text class="name">{{ recent.detail.episode.name }}</text>
  11. <view class="status-box">
  12. <text class="status">{{ recent.detail.episode.status_text }}</text>
  13. <text>共{{ recent.detail.episode.total }}集</text>
  14. </view>
  15. <view class="recent">上次观看至 <text>第{{ recent.detail.sort }}集</text></view>
  16. </view>
  17. <view class="play-btn" @click="handlePlay(recent)">继续观看</view>
  18. </view>
  19. </template>
  20. <script>
  21. export default {
  22. name: 'Recent',
  23. data() {
  24. return {
  25. show: false,
  26. recent: []
  27. }
  28. },
  29. created() {
  30. this.getRecent()
  31. },
  32. methods: {
  33. handlePlay(item) {
  34. this.show = false
  35. this.$u.route({
  36. url: '/pages/episode/play',
  37. params: {
  38. id: item.episode_id,
  39. list_id: item.list_id
  40. }
  41. })
  42. },
  43. getRecent() {
  44. this.$api.user.episode.recent().then(res => {
  45. if (res.data) {
  46. this.recent = res.data
  47. setTimeout(() => {
  48. this.show = true
  49. }, 500)
  50. }
  51. })
  52. },
  53. handleClose() {
  54. this.show = false
  55. }
  56. }
  57. }
  58. </script>
  59. <style lang="scss" scoped>
  60. .recent-container {
  61. position: fixed;
  62. bottom: 140rpx;
  63. width: 96vw;
  64. left: 50%;
  65. transform: translateX(-50%);
  66. border: 1rpx solid $primary-color;
  67. height: 300rpx;
  68. border-radius: 20rpx;
  69. background: rgba(24, 28, 47, 0.8);
  70. padding: 20rpx 26rpx;
  71. font-size: 32rpx;
  72. .close{
  73. position: absolute;
  74. top: -70rpx;
  75. right: 0;
  76. }
  77. .cover-image{
  78. image{
  79. width: 200rpx;
  80. height: 240rpx;
  81. }
  82. }
  83. .info{
  84. flex: 1;
  85. margin-left: 20rpx;
  86. color: #fff;
  87. .name{
  88. font-weight: 800;
  89. font-size: 34rpx;
  90. }
  91. .status-box{
  92. margin-bottom: 10rpx;
  93. font-size: 24rpx;
  94. margin-top: 60rpx;
  95. .status{
  96. color: $primary-color;
  97. margin-right: 14rpx;
  98. }
  99. }
  100. .recent{
  101. color: $info-color;
  102. font-size: 24rpx;
  103. text{
  104. color: #FB3651;
  105. margin-left: 8rpx;
  106. }
  107. }
  108. }
  109. .play-btn{
  110. width: 180rpx;
  111. border-radius: 30rpx;
  112. padding: 20rpx 0;
  113. background: linear-gradient(270deg, #6EEBE8 0%, #FF74B9 100%);
  114. text-align: center;
  115. flex-shrink: 0;
  116. font-size: 32rpx;
  117. color: $default-color;
  118. }
  119. }
  120. </style>