good.js 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. import request from '@/utils/request'
  2. // 查询模板列表
  3. export function getSpecList(query) {
  4. return request({
  5. url: '/system/template/list',
  6. method: 'get',
  7. params: query
  8. })
  9. }
  10. // 新增或修改模板
  11. export function changeSpec(data) {
  12. return request({
  13. url: `/system/template/${data.specTemplateId ? 'edit' : 'addSpec'}`,
  14. method: 'post',
  15. data
  16. })
  17. }
  18. // 删除规格模板
  19. export function delSpec(id) {
  20. return request({
  21. url: '/system/template/del/' + id,
  22. method: 'get',
  23. })
  24. }
  25. // 模板详情
  26. export function getSpecDetail(id) {
  27. return request({
  28. url: '/system/template/detail/' + id,
  29. method: 'get',
  30. })
  31. }
  32. // 新增规格属性关联
  33. export function relation(data, b) {
  34. return request({
  35. url: `/system/relation/${b ? 'edit' : ''}`,
  36. method: 'post',
  37. data
  38. })
  39. }
  40. // 获得商品模板列表
  41. export function getGoodsSpecList(id) {
  42. return request({
  43. url: '/goods/spec/list/' + id,
  44. method: 'get',
  45. })
  46. }
  47. // 修改商品默认规格模板
  48. export function goodsUpdateSpec(data) {
  49. return request({
  50. url: `/goods/update/spec`,
  51. method: 'post',
  52. data
  53. })
  54. }
  55. // 商品批量上下架
  56. export function goodsUpdateStatus(data) {
  57. return request({
  58. url: `/goods/batch/updateStatus`,
  59. method: 'post',
  60. data
  61. })
  62. }
  63. // 商品批量删除
  64. export function goodsDel(data) {
  65. return request({
  66. url: `/goods/batch/del`,
  67. method: 'post',
  68. data
  69. })
  70. }
  71. // 新增每日一练试卷时间
  72. export function addExamTime(data) {
  73. return request({
  74. url: `/goods/addExamTime`,
  75. method: 'post',
  76. data
  77. })
  78. }