product.service.js 5.6 KB

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