Card.vue 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <template>
  2. <a :href="detailUrl">
  3. <div class="book-card">
  4. <div class="thumb">
  5. <img :src="book.image" class="img" mode="aspectFit">
  6. </div>
  7. <div class="detail">
  8. <div class="row text-primary">
  9. <div class="right">
  10. {{book.rate}} <Rate :value="book.rate" />
  11. </div>
  12. <div class="left">
  13. {{book.title}}
  14. </div>
  15. </div>
  16. <div class="row">
  17. <div class="right text-primary">
  18. 浏览量: {{book.count}}
  19. </div>
  20. <div class="left">
  21. {{book.author}}
  22. </div>
  23. </div>
  24. <div class="row">
  25. <div class="right">
  26. <!-- 捐赠人 -->
  27. {{book.user_info.nickName}}
  28. </div>
  29. <div class="left">
  30. {{book.publisher}}
  31. </div>
  32. </div>
  33. </div>
  34. </div>
  35. </a>
  36. </template>
  37. <script>
  38. import Rate from '@/components/Rate';
  39. export default {
  40. components:{
  41. Rate
  42. },
  43. props: ['book'],
  44. computed: {
  45. detailUrl() {
  46. return '/pages/detail/main?id='+ this.book.id
  47. }
  48. }
  49. }
  50. </script>
  51. <style lang='scss' scoped>
  52. .book-card{
  53. padding:5px;
  54. overflow: hidden;
  55. margin-top:5px;
  56. margin-bottom:5px;
  57. font-size:14px;
  58. .thumb{
  59. width:90px;
  60. height:90px;
  61. float: left;
  62. margin:0 auto;
  63. overflow:hidden;
  64. .img{
  65. max-width: 100%;
  66. max-height: 100%;
  67. }
  68. }
  69. .detail{
  70. margin-left: 100px;
  71. .row{
  72. line-height:20px;
  73. margin-bottom:3px;
  74. }
  75. .right{
  76. float: right;
  77. }
  78. .left{
  79. margin-right:80px;
  80. }
  81. }
  82. }
  83. </style>