index.vue 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <template>
  2. <view class="history">
  3. <view class="list">
  4. <view class="list_item flex" v-for="(item,index) in list" :key="index">
  5. <image :src="item.thumbnail" mode="aspectFill" loading="lazy"></image>
  6. <view class="innews">
  7. <text>{{item.title}}</text>
  8. </view>
  9. </view>
  10. </view>
  11. </view>
  12. </template>
  13. <script>
  14. import { getServerWatchHistory } from '@/apis/my'
  15. export default {
  16. data(){
  17. return{
  18. list:[]
  19. }
  20. },
  21. mounted() {
  22. this.getHistoryList()
  23. },
  24. methods:{
  25. async getHistoryList(){
  26. const res = await getServerWatchHistory()
  27. console.log(res,'res');
  28. this.list = res
  29. }
  30. }
  31. }
  32. </script>
  33. <style lang="scss" scoped>
  34. .history{
  35. height: 100%;
  36. background: #fff;
  37. .list{
  38. padding: 20rpx;
  39. .list_item{
  40. padding: 20rpx;
  41. image{
  42. object-fit: contain;
  43. width: 160rpx;
  44. height: 220rpx;
  45. margin-right: 30rpx;
  46. }
  47. .innews{
  48. padding: 40rpx 0;
  49. display: flex;
  50. flex-direction: column;
  51. // justify-content: space-around;
  52. }
  53. }
  54. }
  55. }
  56. </style>