<template>
    <nu-link
        class="nus_goodsim"
        :to="to">
        <!-- :col="col"
        :triTag="triTag"
        :nameText="nameText"
        :subNameText="subNameText"
        :nameRow="nameRow"
        :aspect="aspect"
        :imgUrl="imgUrl"
        :bannerImg="bannerImg"
        :isPrice="isPrice"
        :price="price"
        :oldPrice="oldPrice"
        :decimal="decimal"
        :status="status"
        :cornerMark="cornerMark"
        :tags="tags"
        :tagFilter="tagFilter"
        :isProgress="isProgress"
        :progress="progress"
        :promotion="promotion"
        :btnItem="btnItem"
        :isLazy="isLazy"
        :lazyOptions="lazyOptions"
        :tipMessage="tipMessage" -->
        <div :is="goodType"
            v-bind="$props"
            v-on="$listeners"
            @click="_onClick"
            @tap="_onTap"
            @imgLoading="_onImgLoading"
            @clickBtn="_onClickBtn"
            @clickTag="_onClickTag">
            <template slot="hook_content">
                <slot name="hook_content"></slot>
            </template>
            <slot></slot>
            <template slot="hook_img">
                <slot name='hook_img'></slot>
            </template>
            <template slot="hook_rightFt">
                <slot name='hook_rightFt'></slot>
            </template>
        </div>
    </nu-link>
</template>
<script>
import { GOODS_TYPE } from './_comm/constant';
import NuLink from '../../../widget/link';
import GoodsItemTmp from './_comm/GoodsItemTmp';
import NuGoodsitembase from './goodsitembase';
import NuGoodsitembaselevel from './goodsitembaselevel';
import NuGoodsitemtag from './goodsitemtag';
import NuGoodsitemtaglevel from './goodsitemtaglevel';
import NuGoodsitemnobtn from './goodsitemnobtn';
import NuGoodsitemnobtnlevel from './goodsitemnobtnlevel';
import NuGoodsitemfull from './goodsitemfull';
import NuGoodsitemfulllevel from './goodsitemfulllevel';
export default {
    name: 'NuGoodsitem',
    extends: GoodsItemTmp,
    components: {
        NuLink,
        NuGoodsitembase,
        NuGoodsitembaselevel,
        NuGoodsitemtag,
        NuGoodsitemtaglevel,
        NuGoodsitemnobtn,
        NuGoodsitemnobtnlevel,
        NuGoodsitemfull,
        NuGoodsitemfulllevel
    },
    props: {
        /**
         * 商品展示类型
         */
        type: {
            type: String
        },
        to: {}
    },
    computed: {
        goodType() {
            let res = '';
            switch (this.type) {
                case GOODS_TYPE.ITEM_BASE_LEVEL:
                    res = 'nu-goodsitembaselevel';
                    break;
                case GOODS_TYPE.ITEM_TAG:
                    res = 'nu-goodsitemtag';
                    break;
                case GOODS_TYPE.ITEM_TAG_LEVEL:
                    res = 'nu-goodsitemtaglevel';
                    break;
                case GOODS_TYPE.ITEM_NOBTN:
                    res = 'nu-goodsitemnobtn';
                    break;
                case GOODS_TYPE.ITEM_NOBTN_LEVEL:
                    res = 'nu-goodsitemnobtnlevel';
                    break;
                case GOODS_TYPE.ITEM_FULL:
                    res = 'nu-goodsitemfull';
                    break;
                case GOODS_TYPE.ITEM_FULL_LEVEL:
                    res = 'nu-goodsitemfulllevel';
                    break;
                case GOODS_TYPE.ITEM_BASE:
                default:
                    res = 'nu-goodsitembase';
                    break;
            }
            return res;
        }
    }
};
</script>

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

.nus_goodsim{
    background-color: #fff;
    text-align: left;
}
</style>
