product.service.js 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  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:bigTypeID
  23. * @param:smallTypeID,
  24. * @param:tinyTypeID
  25. * @param:sortType
  26. * @param:pageNum 页码
  27. * @param:pageSize 每页条数
  28. */
  29. GetProductListByTypeID(data = {}) {
  30. return this.AjaxService.get({ url:'/product/listByTypeID', data, isLoading: false })
  31. }
  32. /**
  33. * @商品列表-查询商品价格
  34. * @param:userId 用户ID(未登录传0或者'')
  35. * @param:productID 商品ID','符号拼接
  36. */
  37. querySearchProductPrice (data = {}) {
  38. return this.AjaxService.get({
  39. url:'/commodity/price/list',
  40. data,
  41. isLoading: false ,
  42. isHost:true
  43. })
  44. }
  45. /**
  46. * @查询凑单商品页初始化
  47. * @param:promotionsId 促销ID
  48. */
  49. queryProductPromotionInfo (data = {}) {
  50. return this.AjaxService.get({ url:'/product/promotion/info', data, isLoading: false })
  51. }
  52. /**
  53. * @查询凑单商品列表
  54. * @param:promotionsId 促销ID
  55. * @param:pageSize 查询条数
  56. * @param:pageNum 查询页数
  57. */
  58. queryProductPromotionList (data = {}) {
  59. return this.AjaxService.get({ url:'/product/promotion/products', data, isLoading: true })
  60. }
  61. /**
  62. * @商品详情-查询商品详情
  63. * @param:userId 用户ID(未登录传0或者'')
  64. * @param:productIds 商品ID
  65. */
  66. queryProductDetils (data = {}) {
  67. return this.AjaxService.get({ url:'/product/details', data, isLoading: false })
  68. }
  69. /**
  70. * @商品详情-相关推荐
  71. * @param:productIds 商品ID
  72. */
  73. queryProductDetilsRelevant (data = {}) {
  74. return this.AjaxService.get({ url:'/product/detail/recommend', data, isLoading: false })
  75. }
  76. /**
  77. * @加入购物车
  78. * @param:userId 用户ID(必填)
  79. * @param:productID 用户ID(必填)
  80. * @param:productCount 商品数量(必填)
  81. */
  82. shoppingAddCart (data = {}) {
  83. return this.AjaxService.post({ url:'/shoppingCart/addCart', data, isLoading: true })
  84. }
  85. /**
  86. * @购物车列表
  87. * @param:userId 用户ID(必填)
  88. */
  89. QueryShoppingCartList (data = {}) {
  90. return this.AjaxService.get({ url:'/shoppingCart/list', data, isLoading: false })
  91. }
  92. /**
  93. * @更新购物车商品增减
  94. * @param:userId 用户ID(必填)
  95. * @param:productID 商品ID(必填)
  96. * @param:productCount 商品数量ID(必填)
  97. */
  98. ShoppingCartUpdate (data = {}) {
  99. return this.AjaxService.post({ url:'/shoppingCart/update', data, isLoading: true })
  100. }
  101. /**
  102. * @删除购物车商品
  103. * @param:userId 用户ID(必填)
  104. * @param:productIDs 商品ID(用','号拼接)
  105. */
  106. ShoppingCartDelete (data = {}) {
  107. return this.AjaxService.post({ url:'/shoppingCart/delete', data, isLoading: true })
  108. }
  109. /* 二级列表 */
  110. GetPageTopic (data = {}) {
  111. return this.AjaxService.get({ url:'/page/topic', data, isLoading: false })
  112. }
  113. /* 二级列表banner */
  114. GetPageTopicBanner (data = {}) {
  115. return this.AjaxService.get({ url:'/page/topic/info', data, isLoading: false })
  116. }
  117. /* 活动专题列表 */
  118. GetPromotionsrList (data = {}) {
  119. return this.AjaxService.get({ url:'/promotions/list', data, isLoading: true })
  120. }
  121. /* 搜索项目仪器列表 */
  122. GetSearchEquipmentList (data = {}) {
  123. return this.AjaxService.get({ url:'/search/query/equipment', data, isLoading: true })
  124. }
  125. /* 项目仪器详情 */
  126. GetEquipmentDetails (data = {}) {
  127. return this.AjaxService.get({ url:'/equipment/recommend', data, isLoading: true })
  128. }
  129. /* 查询搜索历史记录 */
  130. GetProductSearchHistory (data = {}) {
  131. return this.AjaxService.get({ url:'/product/searchHistory', data, isLoading: false })
  132. }
  133. /* 添加搜索历史记录 */
  134. GetAddProductSearchHistory (data = {}) {
  135. return this.AjaxService.get({ url:'/product/history/add', data, isLoading: true })
  136. }
  137. /* 清除搜索历史记录 */
  138. GetDeleteProductSearchHistory (data = {}) {
  139. return this.AjaxService.get({ url:'/product/searchHistory/delete', data, isLoading: false })
  140. }
  141. /* 搜索商品列表 */
  142. GetProductSearchList (data = {}) {
  143. return this.AjaxService.get({
  144. url:'/commodity/search/query/product',
  145. data,
  146. isLoading: true ,
  147. isHost:true
  148. })
  149. }
  150. /* 搜索分类商品列表 */
  151. GetSearchProductTypeData (data = {}) {
  152. return this.AjaxService.get({ url:'/search/query/product/type', data, isLoading: true })
  153. }
  154. /* 获取商品评价 */
  155. GetProductEvaluate (data = {}) {
  156. return this.AjaxService.get({ url:'/product/evaluate', data, isLoading: false })
  157. }
  158. /* 获取再次购买商品列表 */
  159. GetRepeatBuyAgainProductList (data = {}) {
  160. return this.AjaxService.get({ url:'/repeat/buyAgain', data, isLoading: true })
  161. }
  162. /* 新商品搜索查询商品阶梯价格 */
  163. GetSearchProductLadderPrice (data = {}) {
  164. return this.AjaxService.get({ url:'/product/ladderPrice', data, isLoading: false })
  165. }
  166. /* 获取分类导航 */
  167. GetProductClassify (data = {}) {
  168. return this.AjaxService.get({ url:'/product/classify', data, isLoading: true })
  169. }
  170. /* 获取小程序三个模块商品列表 */
  171. GetProductPreferred (data = {}) {
  172. return this.AjaxService.get({ url:'/product/preferred', data, isLoading: true })
  173. }
  174. /* 发票信息回显 */
  175. GetPersonalCenterFindInvoice (data = {}) {
  176. return this.AjaxService.get({ url:'/personalCenter/findInvoice', data, isLoading: false })
  177. }
  178. /* 发票信息保存 */
  179. GetPersonalCenterInvoice (data = {}) {
  180. return this.AjaxService.post({ url:'/personalCenter/invoice', data, isLoading: true })
  181. }
  182. }