VehicleCoverWrapper.vue 4.13 KB
<template>
    <view class="car-image-wrapper">
        <van-image use-error-slot width="120" fit="cover" radius="16rpx" height="90" :src="vehicle.cover?.url"></van-image>
        <view class="light-status light-preview" v-if="auctionVehicle.auctionState==='PREVIEW'">
            等待竞价
        </view>
        <template v-else-if="auctionVehicle.auctionState==='AUCTIONING'">
            <view class="light-status">
                竞价中
            </view>
        </template>
        <template v-else>
            <image src="/static/images/close.png" class="close-icon" mode="aspectFit"></image>
        </template>

        <!--        <template v-if="auctionVehicle.auction.auctionType==='DARK'">-->
        <!--            <text class="dark-status" v-if="auctionVehicle.auctionState==='PREVIEW'">-->
        <!--                等待竞拍-->
        <!--            </text>-->
        <!--            <template v-else-if="auctionVehicle.auctionState==='AUCTIONING'">-->
        <!--                <text class="dark-status">-->
        <!--                    竞拍中-->
        <!--                </text>-->
        <!--            </template>-->
        <!--        </template>-->
        <view class="car-tags">
            <view class="tag-item">
                <template v-if="auctionVehicle.auctionState==='PREVIEW'">
                    <template v-if="previewLessThen24h">
                        <view v-show="auctionVehicle.auction.auctionMode == 1">
                          <van-count-down v-if="Number(previewCountDown) > 0 " class="white-small-count-down" :time="previewCountDown" format="HH:mm:ss 后开拍" @finish="finishCountDownBidStart"/>
                        </view>
                        <view v-show="auctionVehicle.auction.auctionMode == 2">
                            {{ (auctionVehicle.auction.auctionStartTime || '').slice(0, 16) }}
                        </view>    
                    </template>
                    <template v-else>
                        {{ previewStatus }}
                    </template>
                </template>
                <template v-if="auctionVehicle.auctionState==='AUCTIONING'">
                    <template v-if="auctionVehicle.auction.auctionMode==1">
                    <template v-if="remaining5m">
                        <van-count-down class="white-small-count-down" :time="endRemaining" format="距离结束 mm:ss" @finish="countDownBidEnd"/>
                    </template>
                    <template v-else>
                        <van-count-down class="white-small-count-down" :time="endRemaining" format="距离结束 HH:mm:ss" @finish="countDownBidEnd"/>
                    </template>
                    </template>
                </template>
            </view>
        </view>
    </view>
</template>
<script lang="ts">
import {Component} from "vue-facing-decorator";
import AbstractVehicleItem from "@/components/AbstractVehicleItem";

@Component({
    components: {}
})
export default class VehicleCoverWrapper extends AbstractVehicleItem {

    finishCountDownBidStart(): void {
        this.countDownBidStart();
        this.$emit('emitLoadListData');
    }

}
</script>

<style lang="scss" scoped>

.car-image-wrapper {
    min-width: 120px;
    height: 90px;
    position: relative;
}

.car-image {
    width: 100%;
    height: 100%;
    border-radius: 12px;
}

.car-tags {
    position: absolute;
    width: 100%;
    text-align: center;
    bottom: 0;
    background-color: #00000080;
    border-radius: 0 0 12px 12px;
    //opacity: 0.5;
}

.tag-item {
    color: #fff;
    font-size: 10px;
    position: relative;
    bottom: 1px;
}

.light-status {
    position: absolute;
    top: 0;
    left: 0;
    border-radius: 8px 0px 10px 0px;
    background: linear-gradient(228.31deg, #F23204CC 0%, #FF9F82CC 100%);
    font-size: 10px;
    color: #fff;
    padding: 2px 4px;
}

.light-preview {
    background: linear-gradient(143.43deg, #75BCFFCC 0%, #2C66F7CC 100%);
}

.dark-status {
    position: absolute;
    bottom: 24px;
    left: 46px;
    font-size: 10px;
    color: #EE3140;
}

.close-icon {
    position: absolute;
    top: 20px;
    left: 36px;
    width: 48px;
    height: 48px;
}
</style>