<template>
    <div class="nus_goodsitemmaskbg">
        <div class="nu_maskbg-tip" v-if='myTipMessage && myTipMessage.length'>
            <template v-for="(message, index) in myTipMessage">
                <template v-if="index > 0">
                    <div class="nu_line" :key='index'></div>
                </template>
                <template v-else>
                    <div class="nu_tip-message" v-text="message" :key='index'></div>
                </template>
            </template>
        </div>
    </div>
</template>

<script>
export default {
    name: 'NuGoodsitemmaskbg',
    props: {
        tipMessage: {
            type: [Array, String],
            default: function () {
                return ['无货', '已售完'];
            }
        }
    },
    computed: {
        myTipMessage () {
            // const _that = this;
            // let message = [];
            let _tipMessage = this.tipMessage;
            if (!(_tipMessage instanceof Array)) {
                _tipMessage = [_tipMessage];
            }
            // if (_tipMessage && _tipMessage.length > 0) {
            //     message = _tipMessage.join('_line_');
            //     message = message.split('_');
            // }
            return _tipMessage;
        }
    }
};
</script>

<style lang='scss'>
@import '../../../../../_assets/style/_iconFont.scss';
@import '../../../../../_assets/style/_var.scss';
@import '../../../../../_assets/style/_mixin.scss';

.nus_goodsitemmaskbg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    &::before {
        content: '';
        position: absolute;
        width: 100%;
        height: 100%;
        top: 0;
        left: 0;
        background: $nugoodsitem-maskbg-bg-color;
    }
    .nu_maskbg-tip {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        position: absolute;
        background: $nugoodsitem-maskbg-tip-bg-color;
        border-radius: 50%;
        color: $nugoodsitem-maskbg-color;
        font-size: 11px;
        min-width: 70px;
        min-height: 70px;
        left: 50%;
        top: 35%;
        transform: translate(-50%, -50%);
        line-height: 1;
    }
    .nu_line {
        height: 1px;
        background: $nugoodsitem-maskbg-color;
        width: 56%;
        margin: 2px 0;
    }
}
</style>
