import request from '@/utils/request'
import Qs from 'qs'

export function listGoods(query) {
    return request({
        url: '/goods/list',
        method: 'get',
        params: query
    })
}

export function listGoods3() {
    return request({
        url: '/goods/list23',
        method: 'get'
    })
}

export function deleteGoods(data) {
    return request({
        url: '/goods/delete',
        method: 'post',
        data
    })
}

export function publishGoods(data) {
    return request({
        url: '/goods/create',
        method: 'post',
        data
    })
}

// 商品上架按钮
export function onsale(data) {
    return request({
        url: '/goods/onsale',
        method: 'post',
        data
    })
}
// 商品热卖
export function onhot(data) {
    return request({
        url: '/goods/onhot',
        method: 'post',
        data
    })
}
// 商品新品
export function onnew(data) {
    return request({
        url: '/goods/onnew',
        method: 'post',
        data
    })
}

export function detailGoods(id) {
    return request({
        url: '/goods/detail',
        method: 'get',
        params: { id }
    })
}

export function editGoods(data) {
    return request({
        url: '/goods/update',
        method: 'post',
        data
    })
}

export function listCatAndBrand() {
    return request({
        url: '/goods/catAndBrand',
        method: 'get'
    })
}


export function getSkills() {
    return request({
        url: '/goods/skills',
        method: 'get'
    })
}

export function getShop() {
    return request({
        url: '/goods/shop',
        method: 'get'
    })
}