图书馆小程序
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.

114 lines
3.0 KiB

2 weeks ago
  1. <template>
  2. <view class="item-container" @click="$emit('click')">
  3. <view class="book-item-box">
  4. <view class="item-box-left">
  5. <image
  6. class="img-item"
  7. :src="data.imgCover"
  8. mode="scaleToFill"
  9. />
  10. </view>
  11. <view class="item-box-right">
  12. <view class="item-title line-clamp-2">{{ data.title || '暂无标题' }}</view>
  13. <view>
  14. <text class="item-author">{{ data.nickname || '佚名' }}</text>
  15. <text class="item-publish">{{ data.publish || '暂无出版社数据' }}</text>
  16. </view>
  17. <view class="item-desc line-clamp-2">{{ data.desc || '暂无简介' }}</view>
  18. </view>
  19. </view>
  20. <view class="lending-info">
  21. <view class="lending-time">
  22. <text>借阅开始时间{{ data.startTime || '' }}</text>
  23. <text>最后归还时间{{ data.returnTime || '' }}</text>
  24. <text v-if="data.realityTime" style="color: #FF3871;">实际归还时间{{ data.realityTime }}</text>
  25. </view>
  26. <!-- 临期 1 -->
  27. <image v-if="data.returnBook === 1" class="lending-status" src="@/static/images/mylending-img3.png" mode="heightFix" />
  28. <!-- 准时 2 -->
  29. <image v-if="data.returnBook === 2" class="lending-status" src="@/static/images/mylending-img2.png" mode="heightFix" />
  30. <!-- 逾期 3 -->
  31. <image v-if="data.returnBook === 3" class="lending-status" src="@/static/images/mylending-img1.png" mode="heightFix" />
  32. </view>
  33. </view>
  34. </template>
  35. <script>
  36. export default {
  37. name: "lending-list-item",
  38. props: {
  39. data: {
  40. type: Object,
  41. required: true
  42. }
  43. },
  44. methods: {
  45. }
  46. };
  47. </script>
  48. <style lang="scss" scoped>
  49. .item-container {
  50. padding: 10px;
  51. background-color: #fff;
  52. border-radius: 6px;
  53. border-bottom: 1px solid #f4f4f4;
  54. margin-bottom: 10px;
  55. .book-item-box {
  56. display: flex;
  57. justify-content: flex-start;
  58. align-items: flex-start;
  59. .item-box-left {
  60. margin-right: 10px;
  61. .img-item{
  62. width: 64px;
  63. height: 90px;
  64. border-radius: 5px;
  65. }
  66. }
  67. .item-box-right {
  68. display: flex;
  69. flex-direction: column;
  70. justify-content: flex-start;
  71. flex: 1;
  72. .item-title {
  73. font-size: 15px;
  74. font-weight: bold;
  75. color: #000;
  76. padding-bottom: 6px;
  77. }
  78. .item-author,
  79. .item-publish {
  80. font-size: 12px;
  81. color: #191A1A;
  82. padding: 2px 4px;
  83. border-radius: 2px;
  84. background-color: #F4F6FC;
  85. }
  86. .item-author{
  87. margin-right: 6px;
  88. }
  89. .item-desc {
  90. font-size: 12px;
  91. color: #191A1A;
  92. padding-top: 8px;
  93. }
  94. }
  95. }
  96. }
  97. .lending-info{
  98. display: flex;
  99. justify-content: space-between;
  100. align-items: center;
  101. padding: 10px 10px 10px 0;
  102. .lending-time{
  103. font-size: 12px;
  104. display: flex;
  105. flex-direction: column;
  106. justify-content: flex-start;
  107. line-height: 22px;
  108. }
  109. .lending-status{
  110. height: 50px;
  111. }
  112. }
  113. </style>