export function useGoods(params: any = {}) {

    const baseTagStyle = () => {
        let style = "";
        style += `color:${ 'rgba(255, 0, 0, 1)' };`;
        style += `border-color: ${ 'rgba(255, 0, 0, 1)' };`;
        style += `background-color: ${ 'rgba(255, 255, 255, 1)' };`;
        return style;
    }

    // 价格类型
    const priceType = (data: any) => {
        return data.goodsSku.show_type
    }

    // 商品价格
    const goodsPrice = (data: any) => {
        let price = data.memberPrice
        price = Number(price)
        return parseFloat(price);
    }

    // 错误图片展示
    const errorImgFn = (data: any, type: any) => {
        data[type] = '';
    }

    return {
        baseTagStyle: baseTagStyle,
        goodsPrice: goodsPrice,
        priceType: priceType,
        error: errorImgFn
    }
}
