second.service.js 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /* HTTP API 二手业务模块
  2. * Copyright 2020, CAIMEI365
  3. * Date 2020/07/16
  4. * auther xw
  5. */
  6. var SecondApi = {
  7. SecondHandProduct: function (params, callback) {//发布信息
  8. Http.AjaxService({ url:'/commodity/second/release', type:'post', data:params, json:false, mask:true,replace:false, isHost:true})
  9. .then(function(res){
  10. callback(res);
  11. });
  12. },
  13. uploadimg: function (params, callback) {//上传图片
  14. Http.uploadImage({
  15. url:'/formData/MultiPictareaddData',
  16. data:params
  17. },callback)
  18. },
  19. uploadFile: function (params, callback) {//上传文件
  20. Http.uploadImage({
  21. url:'/file/upload',
  22. data:params
  23. },callback)
  24. },
  25. SeconHandProductList: function (params, callback) {//商品列表
  26. Http.AjaxService({
  27. url:'/commodity/second/list',
  28. type:'get',
  29. data:params,
  30. json:true,
  31. mask:true,
  32. replace:false,
  33. isHost:true
  34. })
  35. .then(function(res){
  36. callback(res);
  37. });
  38. },
  39. brandList: function (params, callback) {//品牌列表
  40. Http.AjaxService({
  41. url:'/commodity/second/brands',
  42. type:'get',
  43. data:params,
  44. json:true,
  45. mask:true,
  46. replace:false,
  47. isHost:true
  48. })
  49. .then(function(res){
  50. callback(res);
  51. });
  52. },
  53. ProductCount: function (params, callback) {//浏览量
  54. Http.AjaxService({
  55. url:'/product/updateSecondHandProductCount',
  56. type:'get',
  57. data:params,
  58. json:true,
  59. mask:true,
  60. replace:false
  61. })
  62. .then(function(res){
  63. callback(res);
  64. });
  65. },
  66. ProductDetail: function (params, callback) {//商品详情
  67. Http.AjaxService({
  68. url:'/commodity/second/detail',
  69. type:'get',
  70. data:params,
  71. json:true,
  72. mask:true,
  73. replace:false,
  74. isHost:true
  75. })
  76. .then(function(res){
  77. callback(res);
  78. });
  79. },
  80. ProductRecommend: function (params, callback) {//商品详情/相关推荐
  81. Http.AjaxService({
  82. url:'/product/getSecondHandProductRecommend',
  83. type:'get',
  84. data:params,
  85. json:true,
  86. mask:true,
  87. replace:false
  88. })
  89. .then(function(res){
  90. callback(res);
  91. });
  92. },
  93. };