product.service.js 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. /**
  2. * 这是与购物有关的业务逻辑的服务
  3. */
  4. export default class ProductService {
  5. constructor(AjaxService) {
  6. Object.assign(this, { AjaxService })
  7. this.name = 'ProductService'
  8. }
  9. /**
  10. * @商城首页-常用商品列表
  11. * @param:userId 用户ID(未登录传0或者''),
  12. * @param:preferredFlag 新品上线(001) 优惠商品(010) 常用商品(100),,
  13. * @param:pageNum 页码
  14. * @param:pageSize 每页条数
  15. */
  16. queryProductPreferred (data = {}) {
  17. return this.AjaxService.get({ url:'/product/preferred', data, isLoading: false })
  18. }
  19. /**
  20. * @商品列表-查询商品价格
  21. * @param:userId 用户ID(未登录传0或者'')
  22. * @param:productID 商品ID','符号拼接
  23. */
  24. querySearchProductPrice (data = {}) {
  25. return this.AjaxService.get({ url:'/product/listPrice', data, isLoading: false })
  26. }
  27. /**
  28. * @查询凑单商品页初始化
  29. * @param:promotionsId 促销ID
  30. */
  31. queryProductPromotionInfo (data = {}) {
  32. return this.AjaxService.get({ url:'/product/promotion/info', data, isLoading: false })
  33. }
  34. /**
  35. * @查询凑单商品列表
  36. * @param:promotionsId 促销ID
  37. * @param:pageSize 查询条数
  38. * @param:pageNum 查询页数
  39. */
  40. queryProductPromotionList (data = {}) {
  41. return this.AjaxService.get({ url:'/product/promotion/products', data, isLoading: true })
  42. }
  43. /**
  44. * @商品详情-查询商品详情
  45. * @param:userId 用户ID(未登录传0或者'')
  46. * @param:productIds 商品ID
  47. */
  48. queryProductDetils (data = {}) {
  49. return this.AjaxService.get({ url:'/product/details', data, isLoading: false })
  50. }
  51. /**
  52. * @商品详情-相关推荐
  53. * @param:productIds 商品ID
  54. */
  55. queryProductDetilsRelevant (data = {}) {
  56. return this.AjaxService.get({ url:'/product/detail/recommend', data, isLoading: false })
  57. }
  58. /**
  59. * @加入购物车
  60. * @param:userId 用户ID(必填)
  61. * @param:productID 用户ID(必填)
  62. * @param:productCount 商品数量(必填)
  63. */
  64. shoppingAddCart (data = {}) {
  65. return this.AjaxService.post({ url:'/shoppingCart/addCart', data, isLoading: true })
  66. }
  67. /**
  68. * @购物车列表
  69. * @param:userId 用户ID(必填)
  70. */
  71. QueryShoppingCartList (data = {}) {
  72. return this.AjaxService.get({ url:'/shoppingCart/list', data, isLoading: false })
  73. }
  74. /**
  75. * @更新购物车商品增减
  76. * @param:userId 用户ID(必填)
  77. * @param:productID 商品ID(必填)
  78. * @param:productCount 商品数量ID(必填)
  79. */
  80. ShoppingCartUpdate (data = {}) {
  81. return this.AjaxService.post({ url:'/shoppingCart/update', data, isLoading: true })
  82. }
  83. /**
  84. * @删除购物车商品
  85. * @param:userId 用户ID(必填)
  86. * @param:productIDs 商品ID(用','号拼接)
  87. */
  88. ShoppingCartDelete (data = {}) {
  89. return this.AjaxService.post({ url:'/shoppingCart/delete', data, isLoading: true })
  90. }
  91. /* 二级列表 */
  92. GetPageTopic (data = {}) {
  93. return this.AjaxService.get({ url:'/page/topic', data, isLoading: false })
  94. }
  95. /* 二级列表banner */
  96. GetPageTopicBanner (data = {}) {
  97. return this.AjaxService.get({ url:'/page/topic/info', data, isLoading: false })
  98. }
  99. /* 活动专题列表 */
  100. GetPromotionsrList (data = {}) {
  101. return this.AjaxService.get({ url:'/promotions/list', data, isLoading: true })
  102. }
  103. /* 搜索项目仪器列表 */
  104. GetSearchEquipmentList (data = {}) {
  105. return this.AjaxService.get({ url:'/search/query/equipment', data, isLoading: true })
  106. }
  107. /* 项目仪器详情 */
  108. GetEquipmentDetails (data = {}) {
  109. return this.AjaxService.get({ url:'/equipment/recommend', data, isLoading: true })
  110. }
  111. /* 查询搜索历史记录 */
  112. GetProductSearchHistory (data = {}) {
  113. return this.AjaxService.get({ url:'/product/searchHistory', data, isLoading: false })
  114. }
  115. /* 添加搜索历史记录 */
  116. GetAddProductSearchHistory (data = {}) {
  117. return this.AjaxService.get({ url:'/product/history/add', data, isLoading: true })
  118. }
  119. /* 清除搜索历史记录 */
  120. GetDeleteProductSearchHistory (data = {}) {
  121. return this.AjaxService.get({ url:'/product/searchHistory/delete', data, isLoading: false })
  122. }
  123. /* 搜索商品列表 */
  124. GetProductSearchList (data = {}) {
  125. return this.AjaxService.get({ url:'/search/query/product', data, isLoading: true })
  126. }
  127. /* 获取商品评价 */
  128. GetProductEvaluate (data = {}) {
  129. return this.AjaxService.get({ url:'/product/evaluate', data, isLoading: false })
  130. }
  131. /* 获取再次购买商品列表 */
  132. GetRepeatBuyAgainProductList (data = {}) {
  133. return this.AjaxService.get({ url:'/repeat/buyAgain', data, isLoading: true })
  134. }
  135. /* 新商品搜索查询商品阶梯价格 */
  136. GetSearchProductLadderPrice (data = {}) {
  137. return this.AjaxService.get({ url:'/product/ladderPrice', data, isLoading: false })
  138. }
  139. /* 获取分类导航 */
  140. GetProductClassify (data = {}) {
  141. return this.AjaxService.get({ url:'/product/classify', data, isLoading: true })
  142. }
  143. /* 获取小程序三个模块商品列表 */
  144. GetProductPreferred (data = {}) {
  145. return this.AjaxService.get({ url:'/product/preferred', data, isLoading: true })
  146. }
  147. /* 发票信息回显 */
  148. GetPersonalCenterFindInvoice (data = {}) {
  149. return this.AjaxService.get({ url:'/personalCenter/findInvoice', data, isLoading: false })
  150. }
  151. /* 发票信息保存 */
  152. GetPersonalCenterInvoice (data = {}) {
  153. return this.AjaxService.post({ url:'/personalCenter/invoice', data, isLoading: true })
  154. }
  155. }