product.service.js 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535
  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:productID 商品ID','符号拼接
  13. */
  14. querySearchProductPrice (data = {}) {
  15. return this.AjaxService.get({
  16. url:'/commodity/price/list',
  17. data,
  18. isLoading: false ,
  19. })
  20. }
  21. /**
  22. * @查询凑单商品页初始化
  23. * @param:promotionsId 促销ID
  24. */
  25. queryProductPromotionInfo (data = {}) {
  26. return this.AjaxService.get({
  27. url:'/commodity/promotions/info',
  28. data,
  29. isLoading: false ,
  30. })
  31. }
  32. /**
  33. * @查询凑单商品列表
  34. * @param:promotionsId 促销ID
  35. * @param:pageSize 查询条数
  36. * @param:pageNum 查询页数
  37. */
  38. queryProductPromotionList (data = {}) {
  39. return this.AjaxService.get({
  40. url:'/commodity/promotions/product',
  41. data,
  42. isLoading: true ,
  43. })
  44. }
  45. /**
  46. * @商品详情-查询商品详情
  47. * @param:productId 商品Id
  48. */
  49. getProductDetils (data = {}) {
  50. return this.AjaxService.get({
  51. url:'/commodity/mallProduct/getProductInfo',
  52. data,
  53. isLoading: false ,
  54. })
  55. }
  56. /**
  57. * @商品详情-查看相关优惠券
  58. * @param:userId 用户ID(未登录传0或者'')
  59. * @param:productId 商品ID
  60. * @param:source 来源 1 WWW 2小程序
  61. * @param:status 优惠券领取状态 1 未领取 2 已领取
  62. */
  63. QueryProductDetilsCoupons (data = {}) {
  64. return this.AjaxService.get({
  65. url:'/commodity/coupon/details/coupons',
  66. data,
  67. isLoading: true ,
  68. })
  69. }
  70. /**
  71. * @商品详情-相关推荐
  72. * @param:productIds 商品ID
  73. */
  74. queryProductDetilsRelevant (data = {}) {
  75. return this.AjaxService.get({
  76. url:'/commodity/detail/recommend',
  77. data,
  78. isLoading: false ,
  79. })
  80. }
  81. /**
  82. * @加入购物车
  83. * @param:userId 用户ID(必填)
  84. * @param:productID 用户ID(必填)
  85. * @param:productCount 商品数量(必填)
  86. */
  87. shoppingAddCart (data = {}) {
  88. return this.AjaxService.post({
  89. url:'/order/club/cart/add',
  90. data,
  91. isLoading: true ,
  92. })
  93. }
  94. /**
  95. * @批量加入购物车
  96. * @param:userId 用户ID(必填)
  97. * @param:productInfo 商品及数量信息:[// 商品Id 数量]
  98. */
  99. ShoppingAddCarts (data = {}) {
  100. return this.AjaxService.post({
  101. url:'/order/club/cart/add/bulk',
  102. data,
  103. isLoading: true ,
  104. })
  105. }
  106. /**
  107. * @机构添加购物车替换Sku
  108. * @param:userId 用户ID(必填)
  109. */
  110. ShoppingCheckSku (data = {}) {
  111. return this.AjaxService.get({
  112. url:'/order/club/check/sku',
  113. data,
  114. isLoading: false ,
  115. })
  116. }
  117. /**
  118. * @查询购物车数量
  119. * @param:userId 用户ID(必填)
  120. */
  121. ProductCartNumber (data = {}) {
  122. return this.AjaxService.get({
  123. url:'/order/club/cart/count',
  124. data,
  125. isLoading: false ,
  126. })
  127. }
  128. /**
  129. * @购物车列表
  130. * @param:userId 用户ID(必填)
  131. */
  132. QueryShoppingCartList (data = {}) {
  133. return this.AjaxService.get({
  134. url:'/order/club/cart/list',
  135. data,
  136. isLoading: false ,
  137. })
  138. }
  139. /**
  140. * @更新购物车加减数量
  141. * @param:userId 用户ID(必填)
  142. */
  143. ShoppingCartUpdate (data = {}) {
  144. return this.AjaxService.post({
  145. url:'/order/club/cart/update',
  146. data,
  147. isLoading: false ,
  148. })
  149. }
  150. /**
  151. * @购物车领券弹窗优惠券列表
  152. * @param:userId 用户ID(必填)
  153. * @param:shopId 供应商ID(必填)
  154. * @param:source 来源 1 WWW 2小程序
  155. * @param:status 状态 1 未领取 2已领取
  156. */
  157. ShoppingCartGetCoupon(data = {}) {
  158. return this.AjaxService.get({
  159. url:'/order/club/coupon',
  160. data,
  161. isLoading: true ,
  162. })
  163. }
  164. /**
  165. * @删除购物车商品
  166. * @param:userId 用户ID(必填)
  167. * @param:productIDs 商品ID(用','号拼接)
  168. */
  169. ShoppingCartDelete (data = {}) {
  170. return this.AjaxService.post({
  171. url:'/order/club/cart/delete',
  172. data,
  173. isLoading: true ,
  174. })
  175. }
  176. /* 二级列表 */
  177. GetPageTopic (data = {}) {
  178. return this.AjaxService.get({ url:'/commodity/page/floor', data, isLoading: false })
  179. }
  180. /* 二级列表banner */
  181. GetPageTopicBanner (data = {}) {
  182. return this.AjaxService.get({ url:'/commodity/page/floor', data, isLoading: false })
  183. }
  184. /* 活动专题列表 */
  185. GetPromotionsrList (data = {}) {
  186. return this.AjaxService.get({
  187. url:'/commodity/promotions/list',
  188. data,
  189. isLoading: true ,
  190. })
  191. }
  192. /* 搜索项目仪器列表 */
  193. GetSearchEquipmentList (data = {}) {
  194. return this.AjaxService.get({
  195. url:'/commodity/search/query/equipment',
  196. data,
  197. isLoading: true ,
  198. })
  199. }
  200. /* 项目仪器详情 */
  201. GetEquipmentDetails (data = {}) {
  202. return this.AjaxService.get({
  203. url:'/commodity/equipment/details',
  204. data,
  205. isLoading: true ,
  206. })
  207. }
  208. /* 查询搜索历史记录 */
  209. GetProductSearchHistory (data = {}) {
  210. return this.AjaxService.get({
  211. url:'/commodity/search/query/history',
  212. data,
  213. isLoading: false ,
  214. })
  215. }
  216. /* 添加搜索历史记录 */
  217. GetAddProductSearchHistory (data = {}) {
  218. return this.AjaxService.get({
  219. url:'/commodity/search/query/history/add',
  220. data,
  221. isLoading: true ,
  222. })
  223. }
  224. /* 清除搜索历史记录 */
  225. GetDeleteProductSearchHistory (data = {}) {
  226. return this.AjaxService.get({
  227. url:'/commodity/search/query/history/delete',
  228. data,
  229. isLoading: false ,
  230. })
  231. }
  232. /* 搜索商品列表 */
  233. GetProductSearchList (data = {}) {
  234. return this.AjaxService.get({
  235. url:'/commodity/search/query/product',
  236. data,
  237. isLoading: true ,
  238. })
  239. }
  240. /* 搜索分类商品列表 */
  241. GetSearchProductTypeData (data = {}) {
  242. return this.AjaxService.get({
  243. url:'/commodity/search/query/product/type',
  244. data,
  245. isLoading: true,
  246. })
  247. }
  248. /* 搜索分类商品列表 */
  249. GetSearchCombinationProduct (data = {}) {
  250. return this.AjaxService.get({
  251. url:'/commodity/seller/product/combination',
  252. data,
  253. isLoading: true,
  254. })
  255. }
  256. /* 获取商品评价 */
  257. GetProductEvaluate (data = {}) {
  258. return this.AjaxService.get({ url:'/product/evaluate', data, isLoading: false })
  259. }
  260. /* 获取再次购买商品列表 */
  261. GetRepeatBuyAgainProductList (data = {}) {
  262. return this.AjaxService.get({
  263. url:'/commodity/product/repeat',
  264. data,
  265. isLoading: true ,
  266. })
  267. }
  268. /* 新商品搜索查询商品阶梯价格 */
  269. GetSearchProductLadderPrice (data = {}) {
  270. return this.AjaxService.get({
  271. url:'/commodity/price/ladder',
  272. data,
  273. isLoading: false,
  274. })
  275. }
  276. /* 获取分类导航 */
  277. GetProductClassify (data = {}) {
  278. return this.AjaxService.get({ url:'/product/classify', data, isLoading: true })
  279. }
  280. /* 获取小程序三个模块商品列表 */
  281. GetProductPreferred (data = {}) {
  282. return this.AjaxService.get({ url:'/product/preferred', data, isLoading: true })
  283. }
  284. /* 发票信息回显 */
  285. GetPersonalCenterFindInvoice (data = {}) {
  286. return this.AjaxService.get({ url:'/personalCenter/findInvoice', data, isLoading: false })
  287. }
  288. /* 发票信息保存 */
  289. GetPersonalCenterInvoice (data = {}) {
  290. return this.AjaxService.post({ url:'/personalCenter/invoice', data, isLoading: true })
  291. }
  292. /**
  293. * @优惠券-是定商品活动页列表
  294. * @param:userId 用户userId(未登录传0)
  295. * @param:pageNum 页码
  296. * @param:pageSize 每页条数
  297. * @param:couponId 优惠券ID
  298. */
  299. QueryCouponActivityList (data = {}) {
  300. return this.AjaxService.get({
  301. url:'/commodity/coupon/activity/page',
  302. data,
  303. isLoading: true,
  304. })
  305. }
  306. /**
  307. * @优惠券-个人中心优惠券列表
  308. * @param:userId 用户userId(必传)
  309. * @param:pageNum 页码
  310. * @param:pageSize 每页条数
  311. * @param:status 使用状态 1未使用 2已使用 3已失效
  312. */
  313. QueryCouponCenter (data = {}) {
  314. return this.AjaxService.get({
  315. url:'/commodity/coupon/center',
  316. data,
  317. isLoading: false ,
  318. })
  319. }
  320. /**
  321. * @优惠券-领取中心优惠券列表
  322. * @param:userId 用户userId(未登录传0)
  323. * @param:pageNum 每页页码
  324. * @param:pageSize 条数
  325. */
  326. QueryCouponCollarList (data = {}) {
  327. return this.AjaxService.get({
  328. url:'/commodity/coupon/collar/list',
  329. data,
  330. isLoading: false ,
  331. })
  332. }
  333. /**
  334. * @优惠券-美博会优惠券列表
  335. * @param:userId 用户userId(未登录传0)
  336. * @param:pageNum 每页页码
  337. * @param:pageSize 条数
  338. */
  339. QueryCouponCenterList (data = {}) {
  340. return this.AjaxService.get({
  341. url:'/commodity/coupon/center/list',
  342. data,
  343. isLoading: false ,
  344. })
  345. }
  346. /**
  347. * @优惠券-协销价值优惠券列表
  348. * @param:pageNum 每页页码
  349. * @param:pageSize 条数
  350. */
  351. QueryMoneyCouponList (data = {}) {
  352. return this.AjaxService.get({
  353. url:'/commodity/coupon/money/coupon/list',
  354. data,
  355. isLoading: true ,
  356. })
  357. }
  358. /**
  359. * @优惠券-根据优惠券查询优惠券详细信息
  360. * @param:couponId 优惠券Id
  361. */
  362. QueryCouponDetail (data = {}) {
  363. return this.AjaxService.get({
  364. url:'/commodity/coupon/coupon/detail',
  365. data,
  366. isLoading: true ,
  367. })
  368. }
  369. /**
  370. * @优惠券-领取优惠券
  371. * @param:userId 用户userId
  372. * @param:couponId 优惠券Id
  373. * @param:source 来源: 1WWW 2小程序
  374. */
  375. ReceiveCoupon (data = {}) {
  376. return this.AjaxService.post({
  377. url:'/commodity/coupon/collar',
  378. data,
  379. isLoading: true ,
  380. })
  381. }
  382. /**
  383. * @优惠券-兑换优惠券
  384. * @param:userId 用户userId
  385. * @param:redemptionCode 优惠券兑换码
  386. * @param:source 来源: 1WWW 2小程序
  387. */
  388. ExchangeCoupon (data = {}) {
  389. return this.AjaxService.post({
  390. url:'/commodity/coupon/redeem',
  391. data,
  392. isLoading: true ,
  393. })
  394. }
  395. /**
  396. * @优惠券-我的优惠券数量统计
  397. * @param:userId 用户userId(必传)
  398. */
  399. QueryCouponsCount (data = {}) {
  400. return this.AjaxService.get({
  401. url:'/commodity/coupon/coupons/count',
  402. data,
  403. isLoading: false ,
  404. })
  405. }
  406. /**
  407. * @商品收藏-操作
  408. * @param:userId 用户userId(必传)
  409. * @param:productId 商品Id
  410. */
  411. getProductUserLike (data = {}) {
  412. return this.AjaxService.get({
  413. url:'/commodity/userLike/likeOne',
  414. data,
  415. isLoading: false ,
  416. })
  417. }
  418. /**
  419. * @商品收藏-列表
  420. * @param:userId 用户userId(必传)
  421. * @param:pageNum 页码
  422. * @param:pageSize 条数
  423. */
  424. getProductUserLikeList (data = {}) {
  425. return this.AjaxService.get({
  426. url:'/commodity/userLike/likeList',
  427. data,
  428. isLoading: false ,
  429. })
  430. }
  431. /**
  432. * @商品收藏-取消收藏
  433. * @param:userId 用户userId(必传)
  434. * @param:productIDs 商品Id字符串逗号隔开
  435. */
  436. getDeleteUserLike (data = {}) {
  437. return this.AjaxService.get({
  438. url:'/commodity/userLike/deleteList',
  439. data,
  440. isLoading: false ,
  441. })
  442. }
  443. /**
  444. * @会员优惠商品
  445. * @param:userId 用户userId(必传)
  446. * @param:productIDs 商品Id字符串逗号隔开
  447. */
  448. getSvipProductPage (data = {}) {
  449. return this.AjaxService.get({
  450. url:'/commodity/svip/product/page',
  451. data,
  452. isLoading: true ,
  453. })
  454. }
  455. /**
  456. * @商品详情组合商品列表
  457. * @param:userId 用户userId(必传)
  458. * @param:productId 商品Id字符串逗号隔开
  459. * @param:source 来源 1 网站 2 小程序
  460. */
  461. getCommodityCombinationList (data = {}) {
  462. return this.AjaxService.get({
  463. url:'/commodity/seller/combination/list',
  464. data,
  465. isLoading: true ,
  466. })
  467. }
  468. /**
  469. * @搜索筛选项查询商品品牌
  470. * @param:keyword 关键词
  471. * @param:id 分类id
  472. * @param:idtype 1 一级分类 2 二级分类 3 三级分类
  473. * @param:identity
  474. */
  475. getCommoditySearchQUeryBrand (data = {}) {
  476. return this.AjaxService.get({
  477. url:'/commodity/search/query/brand',
  478. data,
  479. isloading: true ,
  480. })
  481. }
  482. /**
  483. * @数据统计
  484. * @param:TypeId 1:首页banner;2:直播模块;3:最新活动;4:热门文章;5:新品橱窗;6:活动列表
  485. */
  486. sYsStatisticsTypesSatisticsNumber (data = {}) {
  487. return this.AjaxService.get({
  488. url:'/commodity/StatisticsType/statisticsNumber',
  489. data,
  490. isLoading: false ,
  491. })
  492. }
  493. }