<template>
    <view class="empty-content">
        <image class="empty-content-image" :src="setSrc" mode="aspectFit"></image>
        <text class="error-text">{{ EmptyText }}</text>
    </view>
</template>

<script>
export default {
    props: {
        src: {
            type: String,
            default: 'empty'
        },
        typeIndex: {
            type: String,
            default: 'empty'
        },
        navbarHeight: {
            type: Number
        }
    },

    data() {
        return {
            typeSrcall: {
                empty: `${this.$Static}icon-empty-address.png`
            },
            typeSrc: {
                empty: `${this.$Static}icon-empty-address.png`
            },
            EmptyText: ''
        }
    },
    created() {
        if (this.typeIndex == 0) {
            this.EmptyText = '您还没有任何的订单哟~'
        } else {
            this.EmptyText = '您还没有相关的订单哟~'
        }
    },
    computed: {
        setSrc() {
            let url
            if (this.typeIndex == 0) {
                url = this.typeSrcall[this.src]
            } else {
                url = this.typeSrc[this.src]
            }
            return url
        }
    }
}
</script>

<style lang="scss">
.empty-content {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    margin: auto;
    background: $bg-color;
    z-index: 999;
    &-image {
        width: 290rpx;
        height: 230rpx;
    }
    .error-text {
        font-size: $font-size-28;
        color: $text-color;
        line-height: 88rpx;
    }
}
</style>
