delivery.ts 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. import request from '@/utils/request'
  2. /********************************* 物流公司 ***************************************/
  3. /**
  4. * 获取物流公司列表
  5. * @param params
  6. * @returns
  7. */
  8. export function getCompanyList(params: Record<string, any>) {
  9. return request.get(`mall/shop/delivery/company`, {params})
  10. }
  11. /**
  12. * 获取物流公司详情
  13. * @param company_id 物流公司company_id
  14. * @returns
  15. */
  16. export function getCompanyInfo(company_id: number) {
  17. return request.get(`mall/shop/delivery/company/${company_id}`);
  18. }
  19. /********************************* 运费模版 ***************************************/
  20. /**
  21. * 获取运费模版分页列表
  22. * @param params
  23. * @returns
  24. */
  25. export function getShippingTemplatePageList(params: Record<string, any>) {
  26. return request.get(`mall/shop/shipping/template`, {params})
  27. }
  28. /**
  29. * 获取运费模版列表
  30. * @param params
  31. * @returns
  32. */
  33. export function getShippingTemplateList(params: Record<string, any>) {
  34. return request.get(`mall/shop/shipping/template/list`, {params})
  35. }
  36. /**
  37. * 获取物运费模版详情
  38. * @param template_id 运费模版template_id
  39. * @returns
  40. */
  41. export function getShippingTemplateInfo(template_id: number) {
  42. return request.get(`mall/shop/shipping/template/${template_id}`);
  43. }
  44. /**
  45. * 添加运费模版
  46. * @param params
  47. * @returns
  48. */
  49. export function addShippingTemplate(params: Record<string, any>) {
  50. return request.post('mall/shop/shipping/template', params, {showErrorMessage: true, showSuccessMessage: true})
  51. }
  52. /**
  53. * 编辑运费模版
  54. * @param params
  55. * @returns
  56. */
  57. export function editShippingTemplate(params: Record<string, any>) {
  58. return request.put(`mall/shop/shipping/template/${params.template_id}`, params, {
  59. showErrorMessage: true,
  60. showSuccessMessage: true
  61. })
  62. }
  63. /**
  64. * 删除运费模版
  65. * @param template_id
  66. * @returns
  67. */
  68. export function deleteShippingTemplate(template_id: number) {
  69. return request.delete(`mall/shop/shipping/template/${template_id}`, {showErrorMessage: true, showSuccessMessage: true})
  70. }