/** * 这是与购物有关的业务逻辑的服务 */ 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 }) } }