index.vue 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. display: flex;
  37. flex-direction: column;
  38. .list{
  39. padding: 20rpx;
  40. background: #fff;
  41. .list_item{
  42. padding: 20rpx;
  43. border-bottom: 1rpx solid #e2e1d0;
  44. image{
  45. object-fit: contain !important;
  46. width: 160rpx;
  47. height: 220rpx;
  48. margin-right: 30rpx;
  49. }
  50. .innews{
  51. padding: 10rpx 0;
  52. display: flex;
  53. flex-direction: column;
  54. // justify-content: space-around;
  55. }
  56. }
  57. .list_item:nth-last-child(1){
  58. border: 0;
  59. }
  60. }
  61. }
  62. </style>