142 lines
3.5 KiB
JavaScript
142 lines
3.5 KiB
JavaScript
import {http2} from "@/utils/request.js";
|
|
/**---------------------------------- */
|
|
/**商品组管理 */
|
|
|
|
/**获取商品分组列表 */
|
|
export const getProductGroupList = (params) => {
|
|
return http2.get('/api/v1/admin/good/group/list', {params: params})
|
|
}
|
|
/**创建商品分组 */
|
|
export const createProductGroup = (data) => {
|
|
return http2.post('/api/v1/admin/good/group/create', data,{
|
|
headers:{
|
|
'Content-Type':'multipart/form-data'
|
|
}
|
|
})
|
|
}
|
|
/**更新商品分组 */
|
|
export const updateProductGroup = (data) => {
|
|
return http2.post('/api/v1/admin/good/group/update', data,{
|
|
headers:{
|
|
'Content-Type':'multipart/form-data'
|
|
}
|
|
})
|
|
}
|
|
/**隐藏商品组 */
|
|
export const hideProductGroup = (data) => {
|
|
return http2.post('/api/v1/admin/good/group/disable', data,{
|
|
headers:{
|
|
'Content-Type':'multipart/form-data'
|
|
}
|
|
})
|
|
}
|
|
/**启动商品组 */
|
|
export const startProductGroup = (data) => {
|
|
return http2.post('/api/v1/admin/good/group/enable', data,{
|
|
headers:{
|
|
'Content-Type':'multipart/form-data'
|
|
}
|
|
})
|
|
}
|
|
/**删除商品分组 */
|
|
export const deleteProductGroup = (data) => {
|
|
return http2.delete('/api/v1/admin/good/group/delete',{
|
|
data: data,
|
|
headers:{
|
|
'Content-Type':'multipart/form-data'
|
|
}
|
|
})
|
|
}
|
|
|
|
|
|
|
|
/**---------------------------------- */
|
|
/**商品管理 */
|
|
|
|
/**获取商品列表 */
|
|
export const getProductList = (params) => {
|
|
return http2.get('/api/v1/admin/good/goods/list', {params: params})
|
|
}
|
|
/**创建商品 */
|
|
export const createProduct = (data) => {
|
|
return http2.post('/api/v1/admin/good/goods/create', data,{
|
|
headers:{
|
|
'Content-Type':'multipart/form-data'
|
|
}
|
|
})
|
|
}
|
|
/**更新商品 */
|
|
export const updateProduct = (data) => {
|
|
return http2.post('/api/v1/admin/good/goods/update', data,{
|
|
headers:{
|
|
'Content-Type':'multipart/form-data'
|
|
}
|
|
})
|
|
}
|
|
/**删除商品 */
|
|
export const deleteProduct = (data) => {
|
|
return http2.delete('/api/v1/admin/good/goods/delete',{
|
|
data:data,
|
|
headers:{
|
|
'Content-Type':'multipart/form-data'
|
|
}
|
|
})
|
|
}
|
|
|
|
|
|
|
|
/**---------------------------------- */
|
|
/**商品参数管理 */
|
|
|
|
/**获取商品参数列表 */
|
|
export const getProductParameterList = (params) => {
|
|
return http2.get('/api/v1/admin/good/spec/list', {params: params})
|
|
}
|
|
/**创建商品参数 */
|
|
export const createProductParameter = (data) => {
|
|
return http2.post('/api/v1/admin/good/spec/create', data,{
|
|
headers:{
|
|
'Content-Type':'multipart/form-data'
|
|
}
|
|
})
|
|
}
|
|
/**获取商品参数详情 */
|
|
export const getProductParameterDetail = (params) => {
|
|
return http2.get('/api/v1/admin/good/spec/detail', {params: params})
|
|
}
|
|
/**更新商品参数 */
|
|
export const updateProductParameter = (data) => {
|
|
return http2.post('/api/v1/admin/good/spec/update', data,{
|
|
headers:{
|
|
'Content-Type':'multipart/form-data'
|
|
}
|
|
})
|
|
}
|
|
/**删除商品参数 */
|
|
export const deleteProductParameter = (data) => {
|
|
return http2.delete('/api/v1/admin/good/spec/delete', {
|
|
params: data
|
|
})
|
|
}
|
|
/**增加商品参数值 */
|
|
export const addProductParameterValue = (data) => {
|
|
return http2.post('/api/v1/admin/good/spec/add_value', data,{
|
|
headers:{
|
|
'Content-Type':'multipart/form-data'
|
|
}
|
|
})
|
|
}
|
|
/**删除商品参数值 */
|
|
export const deleteProductParameterValue = (data) => {
|
|
return http2.delete('/api/v1/admin/good/spec/delete_value', {
|
|
params: data
|
|
})
|
|
}
|
|
/**更新商品参数值 */
|
|
export const updateProductParameterValue = (data) => {
|
|
return http2.post('/api/v1/admin/good/spec/update_value', data,{
|
|
headers:{
|
|
'Content-Type':'multipart/form-data'
|
|
}
|
|
})
|
|
} |