goods.service.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. import Content from '@/sheep/layouts/content.vue';
  2. import { request } from '@/sheep/request';
  3. import { CRUD } from '@/sheep/request/crud';
  4. const route = {
  5. path: 'goods',
  6. name: 'shop.admin.goods',
  7. component: Content,
  8. meta: {
  9. title: '商品管理',
  10. },
  11. children: [
  12. {
  13. path: 'goods',
  14. name: 'shop.admin.goods.goods',
  15. component: () => import('./goods/index.vue'),
  16. meta: {
  17. title: '商品库',
  18. },
  19. },
  20. {
  21. path: 'category',
  22. name: 'shop.admin.goods.category',
  23. component: () => import('./category/index.vue'),
  24. meta: {
  25. title: '商品分类',
  26. },
  27. },
  28. ],
  29. };
  30. const api = {
  31. goods: {
  32. ...CRUD('mall/product'),
  33. // 批量上下架
  34. batchShowStatus: (data) =>
  35. request({
  36. url: 'mall/product/batchShowStatus',
  37. method: 'POST',
  38. params: data,
  39. }),
  40. // 获取商品状态数量
  41. getStatusNum: () =>
  42. request({
  43. url: 'mall/product/status/num',
  44. method: 'GET',
  45. }),
  46. },
  47. rule: {
  48. ...CRUD('mall/product/rule'),
  49. },
  50. category: {
  51. ...CRUD('mall/category'),
  52. select: (params) => SELECT('shop/admin/category_tag', params),
  53. },
  54. };
  55. export { route, api };