123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110 |
- /**
- * 这是与购物有关的业务逻辑的服务
- */
- export default class ProductService {
- constructor(AjaxService) {
- Object.assign(this, { AjaxService })
- this.name = 'ProductService'
- }
- /**
- * @商城首页-常用商品列表
- * @param:userId 用户ID(未登录传0或者''),
- * @param:preferredFlag 新品上线(001) 优惠商品(010) 常用商品(100),,
- * @param:pageNum 页码
- * @param:pageSize 每页条数
- */
- queryProductPreferred (data = {}) {
- return this.AjaxService.get({ url:'/product/preferred', data, isLoading: false })
- }
-
- /**
- * @商品列表-查询商品价格
- * @param:userId 用户ID(未登录传0或者'')
- * @param:productID 商品ID','符号拼接
- */
- querySearchProductPrice (data = {}) {
- return this.AjaxService.get({ url:'/product/listPrice', data, isLoading: false })
- }
-
- /**
- * @查询凑单商品页初始化
- * @param:promotionsId 促销ID
- */
- queryProductPromotionInfo (data = {}) {
- return this.AjaxService.get({ url:'/product/promotion/info', data, isLoading: false })
- }
- /**
- * @查询凑单商品列表
- * @param:promotionsId 促销ID
- * @param:pageSize 查询条数
- * @param:pageNum 查询页数
- */
- queryProductPromotionList (data = {}) {
- return this.AjaxService.get({ url:'/product/promotion/products', data, isLoading: true })
- }
-
- /**
- * @商品详情-查询商品详情
- * @param:userId 用户ID(未登录传0或者'')
- * @param:productIds 商品ID
- */
- queryProductDetils (data = {}) {
- return this.AjaxService.get({ url:'/product/details', data, isLoading: false })
- }
- /**
- * @商品详情-相关推荐
- * @param:productIds 商品ID
- */
- queryProductDetilsRelevant (data = {}) {
- return this.AjaxService.get({ url:'/product/detail/recommend', data, isLoading: false })
- }
-
- /**
- * @加入购物车
- * @param:userId 用户ID(必填)
- * @param:productID 用户ID(必填)
- * @param:productCount 商品数量(必填)
- */
- shoppingAddCart (data = {}) {
- return this.AjaxService.post({ url:'/shoppingCart/addCart', data, isLoading: true })
- }
-
- /**
- * @购物车列表
- * @param:userId 用户ID(必填)
- */
- QueryShoppingCartList (data = {}) {
- return this.AjaxService.get({ url:'/shoppingCart/list', data, isLoading: false })
- }
-
- /**
- * @更新购物车商品增减
- * @param:userId 用户ID(必填)
- * @param:productID 商品ID(必填)
- * @param:productCount 商品数量ID(必填)
- */
- shoppingCartUpdate (data = {}) {
- return this.AjaxService.post({ url:'/shoppingCart/update', data, isLoading: true })
- }
-
- /**
- * @删除购物车商品
- * @param:userId 用户ID(必填)
- * @param:productIDs 商品ID(用','号拼接)
- */
- shoppingCartDelete (data = {}) {
- return this.AjaxService.post({ url:'/shoppingCart/delete', data, isLoading: true })
- }
- /* 二级列表 */
- GetPageTopic (data = {}) {
- return this.AjaxService.get({ url:'/page/topic', data, isLoading: false })
- }
- /* 二级列表banner */
- GetPageTopicBanner (data = {}) {
- return this.AjaxService.get({ url:'/page/topic/info', data, isLoading: false })
- }
- /* 活动专题列表 */
- GetPromotionsrList (data = {}) {
- return this.AjaxService.get({ url:'/promotions/list', data, isLoading: false })
- }
- }
|