history.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <template>
  2. <view class="history">
  3. <view
  4. v-for="(item,index) in history"
  5. :key="index"
  6. class="item main-left"
  7. >
  8. <view class="cover-image">
  9. <image :src="item.detail.episode.cover_img" />
  10. </view>
  11. <view class="right-box">
  12. <view class="op-group main-right cross-center">
  13. <view class="delete">删除</view>
  14. <view class="play" @click="handlePlay(item.detail)">播放</view>
  15. </view>
  16. <view class="name">{{ item.detail.episode.name }}</view>
  17. <view class="status-box">
  18. <text class="status">{{ item.detail.episode.status_text }}</text>
  19. <text>共{{ item.detail.episode.total }}集</text>
  20. </view>
  21. <view class="record">
  22. 上次看至 <text>第{{ item.detail.sort }}集</text>
  23. </view>
  24. </view>
  25. </view>
  26. </view>
  27. </template>
  28. <script>
  29. export default {
  30. data() {
  31. return {
  32. history: []
  33. }
  34. },
  35. computed: {},
  36. methods: {
  37. handlePlay(detail) {
  38. this.$u.route({
  39. url: '/pages/episode/play',
  40. params: {
  41. id: detail.episode.id,
  42. list_id: detail.id
  43. }
  44. })
  45. },
  46. getHistory() {
  47. this.$loading()
  48. this.$api.user.episode.record().then(res => {
  49. this.$hideLoading()
  50. this.history = res.data
  51. })
  52. }
  53. },
  54. onLoad() {
  55. this.getHistory()
  56. }
  57. }
  58. </script>
  59. <style lang="scss" scoped>
  60. .history{
  61. padding: 20rpx;
  62. color: $default-color ;
  63. font-size: 30rpx;
  64. .item{
  65. padding: 30rpx;
  66. border: 1rpx solid $primary-color;
  67. border-radius: 30rpx;
  68. margin-top: 30rpx;
  69. .cover-image{
  70. image{
  71. width: 200rpx;
  72. height: 280rpx;
  73. }
  74. }
  75. .right-box{
  76. flex: 1;
  77. margin-left: 20rpx;
  78. .op-group{
  79. .delete{
  80. border: 1rpx solid #FB3651;
  81. color: #FB3651;
  82. border-radius: 30rpx;
  83. width: 140rpx;
  84. padding: 10rpx;
  85. text-align: center;
  86. margin-right: 30rpx;
  87. }
  88. .play{
  89. background: linear-gradient(90deg, #FF74B9,#6EEBE8);
  90. color: $default-color;
  91. border-radius: 30rpx;
  92. width: 140rpx;
  93. padding: 10rpx;
  94. text-align: center;
  95. }
  96. }
  97. .name{
  98. font-size: 38rpx;
  99. font-weight: 600;
  100. margin-bottom: 10rpx;
  101. margin-top: 50rpx;
  102. }
  103. .status-box{
  104. font-size: 28rpx;
  105. margin-bottom: 10rpx;
  106. color: $info-color;
  107. .status{
  108. color: $primary-color;
  109. margin-right: 14rpx;
  110. }
  111. }
  112. .record{
  113. text{
  114. color: #FB3651;
  115. }
  116. }
  117. }
  118. }
  119. }
  120. </style>