CrowdFundingItem.vue 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <template>
  2. <view class="grid-item" @click="handleClick">
  3. <image :src="item.imageUrl" class="item-image"></image>
  4. <view class="item-title">{{ item.title }}</view>
  5. <view class="item-info">
  6. <text class="item-price">已筹 ¥{{ item.raisedAmount }}万</text>
  7. <text class="item-supporters">支持者 {{ item.supporters }}</text>
  8. </view>
  9. </view>
  10. </template>
  11. <script>
  12. export default {
  13. name: 'CrowdFundingItem',
  14. props: {
  15. item: {
  16. type: Object,
  17. required: true
  18. }
  19. },
  20. methods: {
  21. handleClick() {
  22. this.$emit('click', this.item.id);
  23. }
  24. }
  25. }
  26. </script>
  27. <style scoped lang="scss">
  28. .grid-item {
  29. background: #fff;
  30. border-radius: 20rpx;
  31. overflow: hidden;
  32. box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.06);
  33. margin-bottom: 8rpx;
  34. .item-image {
  35. width: 100%;
  36. height: 220rpx;
  37. display: block;
  38. object-fit: cover;
  39. border-top-left-radius: 20rpx;
  40. border-top-right-radius: 20rpx;
  41. }
  42. .item-title {
  43. font-size: 26rpx;
  44. color: #222;
  45. padding: 12rpx 12rpx 0 12rpx;
  46. font-weight: 500;
  47. white-space: nowrap;
  48. overflow: hidden;
  49. text-overflow: ellipsis;
  50. }
  51. .item-info {
  52. display: flex;
  53. justify-content: space-between;
  54. align-items: center;
  55. padding: 0 12rpx 12rpx 12rpx;
  56. font-size: 22rpx;
  57. .item-price {
  58. color: #ff5000;
  59. font-weight: bold;
  60. }
  61. .item-supporters {
  62. color: #999;
  63. }
  64. }
  65. }
  66. </style>