图书馆小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

117 lines
2.7 KiB

2 months ago
1 month ago
2 months ago
1 month ago
2 months ago
1 month ago
2 months ago
1 month ago
2 months ago
1 month ago
2 months ago
  1. <template>
  2. <view class="item-container" @click="$emit('click')">
  3. <view class="item-box">
  4. <view class="item-box-left">
  5. <!-- <image
  6. class="img-item"
  7. :src="data.imgCover"
  8. mode="scaleToFill"
  9. /> -->
  10. <image
  11. class="img-item"
  12. :src="data.imgPath ? baseUrl + '/api/fileRelevant/getImg?imgType=2&imgId=' + data.imgPath : '' "
  13. mode="scaleToFill"
  14. ></image>
  15. </view>
  16. <view class="item-box-right">
  17. <view class="item-title line-clamp-2">{{ data.name || '暂无标题' }}</view>
  18. <text class="item-author">{{ data.author || '佚名' }}</text>
  19. <text class="item-publish">{{ data.publisher || '暂无出版社数据' }}</text>
  20. <!-- <view class="item-desc line-clamp-2">{{ data.desc || '暂无简介' }}</view> -->
  21. <!-- <view class="item-bottom-box">
  22. <view class="hot-box">
  23. <text class="hot-text">{{ hotNumber(data.views) }} 热度</text>
  24. </view>
  25. </view>-->
  26. </view>
  27. </view>
  28. </view>
  29. </template>
  30. <script>
  31. import config from '@/utils/config';
  32. export default {
  33. name: "book-list-item",
  34. props: {
  35. data: {
  36. type: Object,
  37. required: true
  38. }
  39. },
  40. data() {
  41. return {
  42. baseUrl: config.baseUrl
  43. }
  44. },
  45. methods: {
  46. hotNumber(num) {
  47. if (!num) return "0";
  48. if (num >= 10000) {
  49. return (num / 10000).toFixed(1) + "w";
  50. }
  51. return num;
  52. }
  53. }
  54. };
  55. </script>
  56. <style lang="scss" scoped>
  57. .item-container {
  58. padding-bottom: 10px;
  59. .item-box {
  60. display: flex;
  61. justify-content: flex-start;
  62. align-items: flex-start;
  63. // margin: 0 10px;
  64. padding: 10px;
  65. background-color: #fff;
  66. border-radius: 6px;
  67. // box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  68. border-bottom: 1px solid #f4f4f4;
  69. .item-box-left {
  70. margin-right: 8px;
  71. .img-item{
  72. width: 64px;
  73. height: 90px;
  74. margin: 0 12px 0 0;
  75. border-radius: 5px;
  76. }
  77. }
  78. .item-box-right {
  79. display: flex;
  80. flex-direction: column;
  81. justify-content: flex-start;
  82. flex: 1;
  83. .item-title {
  84. font-size: 15px;
  85. font-weight: bold;
  86. color: #000;
  87. padding-bottom: 10px;
  88. }
  89. .item-author,
  90. .item-publish {
  91. font-size: 12px;
  92. color: #888;
  93. padding-bottom: 10px;
  94. }
  95. .hot-text {
  96. font-size: 12px;
  97. color: #ff4444;
  98. }
  99. .item-desc {
  100. padding-top: 5px;
  101. font-size: 13px;
  102. color: #666;
  103. line-height: 1.4;
  104. }
  105. .item-bottom-box {
  106. margin-top: 8px;
  107. display: flex;
  108. justify-content: space-between;
  109. align-items: center;
  110. }
  111. }
  112. }
  113. }
  114. </style>