category-mini-card.vue 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <template>
  2. <view class="category-mini-card">
  3. <!-- <image class="img" lazy-load :src="$utils.checkThumbnailUrl(category.thumbnail)" mode="aspectFill"></image> -->
  4. <cache-image
  5. class="img"
  6. height="120rpx"
  7. :url="$utils.checkThumbnailUrl(category.thumbnail)"
  8. :fileMd5="$utils.checkThumbnailUrl(category.thumbnail)"
  9. mode="aspectFill"
  10. ></cache-image>
  11. <text class="label">{{ category.postCount }}&nbsp;篇</text>
  12. <view class="name">{{ category.name }}</view>
  13. </view>
  14. </template>
  15. <script>
  16. export default {
  17. name: 'category-mini-card',
  18. props: {
  19. category: {
  20. type: Object,
  21. default: () => {}
  22. }
  23. }
  24. };
  25. </script>
  26. <style scoped lang="scss">
  27. .category-mini-card {
  28. display: inline-block;
  29. width: 260rpx;
  30. height: 180rpx;
  31. position: relative;
  32. border-radius: 12rpx;
  33. background-color: #fff;
  34. overflow: hidden;
  35. // border: 2rpx solid #f7f7f7;
  36. box-shadow: 0rpx 2rpx 24rpx rgba(0, 0, 0, 0.03);
  37. .img {
  38. width: 100%;
  39. height: 120rpx;
  40. border: 6rpx 6rpx 0 0;
  41. }
  42. .label {
  43. position: absolute;
  44. left: 0;
  45. top: 86rpx;
  46. color: #03a9f4;
  47. font-size: 24rpx;
  48. background-color: rgba(255, 255, 255, 1);
  49. border-radius: 0rpx 24rpx 0 0;
  50. display: flex;
  51. padding: 2rpx 12rpx;
  52. padding-right: 24rpx;
  53. }
  54. .name {
  55. font-size: 24rpx;
  56. text-align: center;
  57. color: var(--main-text-color);
  58. }
  59. }
  60. </style>