goods.js 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. import request from '@/sheep/request';
  2. import request2 from '@/sheep/request2';
  3. export default {
  4. // 商品详情
  5. detail: (id, params = {}) =>
  6. request2({
  7. url: 'product/spu/get-detail?id=' + id,
  8. method: 'GET',
  9. params,
  10. custom: {
  11. showLoading: false,
  12. showError: false,
  13. },
  14. }),
  15. // 商品列表
  16. list: (params) =>
  17. request2({
  18. url: 'product/spu/page',
  19. method: 'GET',
  20. params,
  21. custom: {
  22. showLoading: false,
  23. showError: false,
  24. },
  25. }),
  26. // 商品查询
  27. ids: (params = {}) =>
  28. request({
  29. url: 'goods/goods/ids',
  30. method: 'GET',
  31. params,
  32. custom: {
  33. showLoading: false,
  34. showError: false,
  35. },
  36. }),
  37. // 商品评价列表
  38. comment: (id, params = {}) =>
  39. request2({
  40. url: 'product/comment/list?spuId=' + id,
  41. method: 'GET',
  42. params,
  43. custom: {
  44. showLoading: false,
  45. showError: false,
  46. },
  47. }),
  48. comment2: (id, params = {pageNo:1,pageSize:10,type:0}) =>
  49. request2({
  50. url: 'product/comment/page?spuId='+id,
  51. method: 'GET',
  52. params,
  53. custom: {
  54. showLoading: false,
  55. showError: false,
  56. },
  57. }),
  58. // 商品评价类型
  59. getType: (id) =>
  60. request({
  61. url: 'goods/comment/getType/' + id,
  62. method: 'GET',
  63. custom: {
  64. showLoading: false,
  65. showError: false,
  66. },
  67. }),
  68. // 活动商品查询
  69. // 商品查询
  70. activity: (params = {}) =>
  71. request({
  72. url: 'goods/goods/activity',
  73. method: 'GET',
  74. params,
  75. custom: {
  76. showLoading: false,
  77. showError: false,
  78. },
  79. }),
  80. activityList: (params = {}) =>
  81. request({
  82. url: 'goods/goods/activityList',
  83. method: 'GET',
  84. params,
  85. }),
  86. };