package.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. import request from '@/utils/request'
  2. // 列表
  3. export function list(data) {
  4. return request({
  5. url: `/admin/goods/list`,
  6. method: 'post',
  7. data
  8. })
  9. }
  10. // 详情
  11. export function detail(id) {
  12. return request({
  13. url: `/admin/goods/queryGoodById/${id}`,
  14. method: 'get'
  15. })
  16. }
  17. // 修改
  18. export function edit(data) {
  19. return request({
  20. url: `/admin/goods/edit`,
  21. method: 'put',
  22. data
  23. })
  24. }
  25. // 新增
  26. export function create(data) {
  27. return request({
  28. url: `/admin/goods/add`,
  29. method: 'post',
  30. data
  31. })
  32. }
  33. // 删除
  34. export function remove(id) {
  35. return request({
  36. url: `/admin/goods/remove/${id}`,
  37. method: 'get'
  38. })
  39. }
  40. // 下架
  41. export function shelve(id) {
  42. return request({
  43. url: `/admin/goods/unshelve/${id}`,
  44. method: 'get'
  45. })
  46. }
  47. // 流量套餐
  48. export function goodsList(type) {
  49. return request({
  50. url: `/admin/goods/queryPackageList?platform=${type}`,
  51. method: 'get'
  52. })
  53. }
  54. // 流量套餐
  55. export function newGoodsList(type, businessType) {
  56. return request({
  57. url: `/admin/goods/queryList/${type}/${businessType}`,
  58. method: 'get'
  59. })
  60. }
  61. // 查询设备下对应的赠送的商品列表
  62. export function deviceGoodsList(type, businessType, deviceIds) {
  63. // /?deviceIds=${deviceIds}&businessType=${businessType}&type=${type}
  64. console.log("获取请求链接=00=");
  65. return request({
  66. url: `/admin/goods/listByDevice`,
  67. method: 'post',
  68. data: {
  69. "deviceIds": deviceIds,
  70. "type": type,
  71. "businessType": businessType,
  72. }
  73. })
  74. }