0
0

BookInfo.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <template>
  2. <div class="bookinfo">
  3. <div class="thumb">
  4. <img class="back"
  5. :src="info.image"
  6. mode="scaleToFill">
  7. <img class="img"
  8. :src="info.image"
  9. mode="aspectFit">
  10. <div class="info">
  11. <div class="title">
  12. {{info.title}}
  13. </div>
  14. <div class="author">
  15. {{info.author}}
  16. </div>
  17. </div>
  18. </div>
  19. <div class="owner detail">
  20. <img class="avatar"
  21. :src="userinfo.image"
  22. mode="aspectFit">
  23. <!-- 添加人 -->
  24. {{userinfo.name}}
  25. <div class="right text-primary">
  26. {{info.rate}}分
  27. <Rate :value="info.rate"></Rate>
  28. </div>
  29. </div>
  30. <div class="detail">
  31. {{info.publisher}}
  32. <div class="right">
  33. {{info.price}}
  34. </div>
  35. </div>
  36. </div>
  37. </template>
  38. <script>
  39. import Rate from '@/components/Rate'
  40. export default {
  41. components: {
  42. Rate
  43. },
  44. props: ['info'],
  45. computed: {
  46. userinfo() {
  47. return this.info.user_info || {};
  48. }
  49. }
  50. }
  51. </script>
  52. <style lang="scss">
  53. .bookinfo {
  54. font-size: 14px;
  55. .right {
  56. float: right;
  57. }
  58. .detail {
  59. padding: 5px 10px;
  60. .avatar {
  61. width: 40rpx;
  62. height: 40rpx;
  63. border-radius: 50%;
  64. vertical-align: middle;
  65. }
  66. }
  67. .thumb {
  68. width: 750rpx;
  69. height: 450rpx;
  70. overflow: hidden;
  71. position: relative;
  72. .back {
  73. filter: blur(15px);
  74. width: 100%;
  75. }
  76. .img {
  77. position: absolute;
  78. width: 100%;
  79. height: 300rpx;
  80. left: 0;
  81. top: 30rpx;
  82. }
  83. .info {
  84. color: white;
  85. position: absolute;
  86. width: 100%;
  87. left: 0;
  88. top: 330rpx;
  89. text-align: center;
  90. .title {
  91. font-size: 16px;
  92. }
  93. .author {
  94. font-size: 14px;
  95. }
  96. }
  97. }
  98. }
  99. </style>