New file |
| | |
| | | import createAxios from '@/utils/axios' |
| | | |
| | | // 产品定价管理 API |
| | | const baseUrl = '/admin/product-pricing' |
| | | |
| | | const productPricingApi = { |
| | | // 新增产品定价 |
| | | add(data: object): ApiPromise { |
| | | return createAxios({ |
| | | url: `${baseUrl}/add`, |
| | | method: 'post', |
| | | data, |
| | | }) as ApiPromise |
| | | }, |
| | | |
| | | // 更新产品定价 |
| | | update(data: object): ApiPromise { |
| | | return createAxios({ |
| | | url: `${baseUrl}/update`, |
| | | method: 'put', |
| | | data, |
| | | }) as ApiPromise |
| | | }, |
| | | |
| | | // 根据产品ID获取定价列表 |
| | | listByProductId(productId: string | number): ApiPromise { |
| | | return createAxios({ |
| | | url: `${baseUrl}/product/${productId}`, |
| | | method: 'get', |
| | | }) as ApiPromise |
| | | }, |
| | | |
| | | // 删除定价 |
| | | remove(id: string | number): ApiPromise { |
| | | return createAxios({ |
| | | url: `${baseUrl}/delete/${id}`, |
| | | method: 'delete', |
| | | }) as ApiPromise |
| | | }, |
| | | } |
| | | |
| | | export default productPricingApi |
| | | |