product.service.js 6.0 KB

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