123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- <template>
- <view class="grid-item" @click="handleClick">
- <view class="item-image-wrapper">
- <image :src="item.main_image" class="item-image"></image>
- </view>
- <view class="line-box"></view>
- <view class="item-info-area">
- <view class="item-title two-omit">{{ item.title || item.short_title }}</view>
- <view class="item-info">
- <text class="item-price">已筹 ¥{{ item.current_amount }}</text>
- <text class="item-supporters">支持者 {{ item.supporter_count }}</text>
- </view>
- </view>
- </view>
- </template>
- <script>
- export default {
- name: 'CrowdFundingItem',
- props: {
- item: {
- type: Object,
- required: true
- }
- },
- methods: {
- handleClick() {
- this.$emit('click', this.item.id);
- }
- }
- }
- </script>
- <style scoped lang="scss">
- .grid-item {
- background: #fff;
- border-radius: 12rpx;
- overflow: hidden;
- display: flex;
- flex-direction: column;
- .line-box{
- width: 100%;
- height: 6rpx;
- background: linear-gradient(to right, #ACF934, transparent);
- }
- .item-image-wrapper {
- width: 100%;
- position: relative;
- padding-bottom: 100%; // 1:1
- overflow: hidden;
- // border-top-left-radius: 18px;
- // border-top-right-radius: 18px;
- }
- .item-image {
- position: absolute;
- left: 0; top: 0; width: 100%; height: 100%;
- object-fit: cover;
- // border-top-left-radius: 18px;
- // border-top-right-radius: 18px;
- display: block;
- }
- .item-info-area {
- background: #fff;
- padding: 12rpx 20rpx;
- display: flex;
- flex-direction: column;
- justify-content: flex-end;
- .item-title {
- font-size: 26rpx;
- color: #1f1f1f;
- font-weight: 500;
- overflow: hidden;
- text-overflow: ellipsis;
- }
- .item-info {
- display: flex;
- justify-content: space-between;
- align-items: center;
- // padding: 0 12px 0 12px;
- font-size: 20rpx;
- margin-top: 12rpx;
- .item-price {
- color: #999999;
- font-weight: 400;
- }
- .item-supporters {
- color: #999999;
- font-weight: 400;
- }
- }
- }
- }
- </style>
|