shop.js 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. import Service from '../lib/service'
  2. import axios from "axios";
  3. import Config from '../config'
  4. class ShopService extends Service {
  5. constructor () {
  6. super()
  7. axios.defaults.baseURL = Config.HostShop
  8. }
  9. //根据CID获取积分商城token
  10. async getShopToken (params = {}) {
  11. let res = await this.postAll("Host80","/shop/custom/info/loginByCId", params);
  12. return res
  13. }
  14. //积分余额
  15. async customBalance (params = {}) {
  16. let res = await this.postAll("HostShop","/custom/balance", params);
  17. return res
  18. }
  19. //积分列表
  20. async customLntegralList (params = {}) {
  21. let res = await this.postAll("HostShop","/custom/integral/search/list", params);
  22. return res
  23. }
  24. //商品分类列表
  25. async commodityTypeList (params = {}) {
  26. let res = await this.postAll("HostShop","/commodity/type/search/list", params);
  27. return res
  28. }
  29. //商品列表
  30. async commodityList (params = {}) {
  31. let res = await this.postAll("HostShop","/commodity/search/list", params);
  32. return res
  33. }
  34. //商品详情
  35. async commoditySingle (params = {}) {
  36. let res = await this.postAll("HostShop","/commodity/search/single", params);
  37. return res
  38. }
  39. //下单
  40. async orderAdd (params = {}) {
  41. let res = await this.postAll("HostShop","/order/add", params);
  42. return res
  43. }
  44. //修改订单
  45. async orderUpdate (params = {}) {
  46. let res = await this.postAll("HostShop","/order/update", params);
  47. return res
  48. }
  49. //取消订单
  50. async orderCancel (params = {}) {
  51. let res = await this.postAll("HostShop","/order/cancel", params);
  52. return res
  53. }
  54. //完成订单
  55. async orderComplete (params = {}) {
  56. let res = await this.postAll("HostShop","/order/complete", params);
  57. return res
  58. }
  59. // 订单列表查询
  60. async orderList (params = {}) {
  61. let res = await this.postAll("HostShop","/order/search/list", params);
  62. return res
  63. }
  64. //订单详情
  65. async orderSingle (params = {}) {
  66. let res = await this.postAll("HostShop","/order/search/single", params);
  67. return res
  68. }
  69. //新增收货地址
  70. async addressAdd (params = {}) {
  71. let res = await this.postAll("HostShop","/custom/address/add", params);
  72. return res
  73. }
  74. //删除收货地址
  75. async addressDelete (params = {}) {
  76. let res = await this.postAll("HostShop","/custom/address/delete", params);
  77. return res
  78. }
  79. //修改收货地址
  80. async addressUpdate (params = {}) {
  81. let res = await this.postAll("HostShop","/custom/address/update", params);
  82. return res
  83. }
  84. //收货地址列表
  85. async addressList (params = {}) {
  86. let res = await this.postAll("HostShop","/custom/address/search/list", params);
  87. return res
  88. }
  89. }
  90. export default new ShopService