<template>
    <view
        v-if="data && data.imgUrl"
        class="entry"
        :class="{noGap: noGap}"
        :style="{backgroundImage: 'url(' + data.imgUrl + ')'}"
        @tap="handleTap"
    />
</template>

<script>
import {navigate} from '@utils/navigate';
export default {
    config: {
        component: true
    },
    props: {
        // imgUrl:
        // jumpType:unifiUrl
        // name:fission2
        // unifiUrl:
        // xcxUrl:
        // beginTime:2021-10-07 00:00:00
        // endTime:2022-11-13 00:00:00
        data: {
            type: Object,
            default: () => {}
        },
        noGap: {
            type: Boolean,
            default: false
        }
    },
    methods: {
        handleTap() {
            if (this.data && this.data.imgUrl) {
                navigate({url: this.data.unifiUrl});
            }
        }
    }
};
</script>

<style lang="less">
.entry {
    height: 0.87157rem;
    background-size: 100% 100%;
    margin: 0.1rem;
    border-radius: 0.12rem;
    background-repeat: no-repeat;
}
.noGap {
    margin: 0.1rem 0;
}
</style>
