| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
- <template>
- <view class="hotgoods-item" @click="goItem(item)" :style="{'height': height}">
- <view class="image-wrapper">
- <image class="image" :src="item.image" mode="scaleToFill"></image>
- </view>
- <view class="price-wrap flex">
- <view class="title clamp">{{item.store_name}}</view>
- <view class="hot-price">
- <view class="price" :style="{'color': pColor}">{{ item.price * 1 }}
- </view>
- <image class="gobuy" src="./img/cart.png" mode="widthFix" :style="{'width': iconWith}"></image>
- </view>
- </view>
- </view>
- </template>
- <script>
- export default {
- name: 'good',
- data() {
- return {
- }
- },
- props: {
- height: {
- type: String,
- default: '490rpx'
- },
- item: {
- type: Object,
- default: () => {}
- },
- pColor: {
- type: String,
- default: '#FF4C4F'
- },
- iconWith: {
- type: String,
- default: '44rpx'
- }
- },
- methods: {
- goItem(item) {
- this.$emit('goItem', item)
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .hotgoods-item {
- width: 335rpx;
- background-color: #ffffff;
- border-radius: 12rpx;
- box-shadow: 0 0 15rpx rgba(0, 0, 0, 0.2);
- margin-bottom: 15rpx;
- .price-wrap {
- flex-direction: column;
- justify-content: space-between;
- align-items: flex-start;
- height: 130rpx;
- }
- .image-wrapper {
- width: 100%;
- height: 345rpx;
- border-radius: 3px;
- overflow: hidden;
- position: relative;
- .image {
- width: 100%;
- height: 100%;
- opacity: 1;
- border-radius: 12rpx 12rpx 0 0;
- }
- }
- .title {
- width: 100%;
- margin-top: 24rpx;
- padding: 0 20rpx;
- font-size: 32rpx;
- font-weight: 500;
- }
- .hot-price {
- display: flex;
- justify-content: space-between;
- align-items: center;
- width: 100%;
- padding: 0 10rpx;
- .price {
- margin-left: 10rpx;
- font-size: 36rpx;
- justify-content: flex-start;
- align-items: center;
- &::before {
- content: '¥';
- font-size: 28rpx;
- }
- }
- }
- }
- </style>
|